Skip to content

Commit 12f982e

Browse files
authored
Configure project to automatically sort imports (#31)
* Configure project to automatically sort imports * Remove unused constant
1 parent 4939659 commit 12f982e

14 files changed

Lines changed: 35 additions & 54 deletions

File tree

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
"test": "vitest",
1111
"test:ui": "vitest --ui",
1212
"test:run": "vitest run",
13-
"format": "biome format --write .",
14-
"lint": "biome lint --write .",
13+
"format": "biome check --write --linter-enabled=false .",
14+
"lint": "biome check --formatter-enabled=false .",
1515
"check": "biome check --write .",
1616
"check:ci": "biome check ."
1717
},

src/index.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,14 @@ import { cache } from "hono/cache"
44
import { cors } from "hono/cors"
55
import { HTTPException } from "hono/http-exception"
66
import { trimTrailingSlash } from "hono/trailing-slash"
7-
8-
import { NotFoundError } from "./lib/fetch"
97
import {
108
decodeExternalTargetPath,
11-
extractExternalDocumentationBasePath,
129
ExternalAccessError,
10+
extractExternalDocumentationBasePath,
1311
fetchExternalDocCJSON,
1412
validateExternalDocumentationUrl,
1513
} from "./lib/external"
14+
import { NotFoundError } from "./lib/fetch"
1615
import {
1716
fetchHIGPageData,
1817
fetchHIGTableOfContents,

src/lib/external/fetch.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import type { AppleDocJSON } from "../types"
21
import { renderFromJSON } from "../reference"
3-
import type { ExternalPolicyEnv, RobotsPolicyResult } from "./types"
2+
import type { AppleDocJSON } from "../types"
43
import {
54
assertExternalDocumentationAccess,
65
ExternalAccessError,
76
validateExternalDocumentationUrl,
87
} from "./policy"
8+
import type { ExternalPolicyEnv, RobotsPolicyResult } from "./types"
99

1010
const RESTRICTIVE_X_ROBOTS_TAGS = ["none", "noindex", "noai", "noimageai"] as const
1111

src/lib/external/index.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@
33
* Re-exports all external-doc related functions and types
44
*/
55

6-
// Re-export types
7-
export type * from "./types"
8-
9-
// Re-export fetching functions
106
export * from "./fetch"
11-
12-
// Re-export policy functions and errors
137
export * from "./policy"
8+
export type * from "./types"

src/lib/hig/index.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,7 @@
33
* Re-exports all HIG-related functions and types
44
*/
55

6-
// Re-export types
7-
export type * from "./types"
8-
9-
// Re-export fetching functions
106
export * from "./fetch"
11-
12-
// Re-export rendering functions
137
export * from "./render"
14-
15-
// Re-export utility functions
16-
export * from "./util"
8+
export type * from "./types"
9+
export { hasChildren, isHIGImageReference, isHIGTopicReference } from "./util"

src/lib/hig/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Human Interface Guidelines (HIG) specific types
33
*/
44

5-
import type { ContentItem, TextFragment, PrimaryContentSection } from "../types"
5+
import type { ContentItem, PrimaryContentSection, TextFragment } from "../types"
66

77
// ============================================================================
88
// HIG TYPES

src/lib/hig/util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { HIGReference, HIGImageReference, HIGExternalReference, HIGTocItem } from "./types"
1+
import type { HIGExternalReference, HIGImageReference, HIGReference, HIGTocItem } from "./types"
22

33
// ============================================================================
44
// TYPE GUARDS

src/lib/mcp.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import { z } from "zod"
33

44
import type { ExternalPolicyEnv } from "./external"
55
import { fetchExternalDocumentationMarkdown } from "./external"
6+
import { fetchHIGPageData, renderHIGFromJSON } from "./hig"
67
import { fetchJSONData, renderFromJSON } from "./reference"
78
import { searchAppleDeveloperDocs } from "./search"
89
import { generateAppleDocUrl, normalizeDocumentationPath } from "./url"
9-
import { fetchHIGPageData, renderHIGFromJSON } from "./hig"
1010

1111
export function createMcpServer(externalPolicyEnv: ExternalPolicyEnv = {}) {
1212
const server = new McpServer({

src/lib/reference/index.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@
33
* Re-exports all reference documentation related functions and types
44
*/
55

6-
// Re-export types
7-
export type * from "./types"
8-
9-
// Re-export fetching functions
106
export * from "./fetch"
11-
12-
// Re-export rendering functions
137
export * from "./render"
8+
export type * from "./types"

src/lib/reference/types.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,22 @@
99
export type {
1010
AppleDocJSON,
1111
ContentItem,
12-
TextFragment,
1312
Declaration,
14-
Parameter,
15-
TopicSection,
16-
SeeAlsoSection,
17-
PrimaryContentSection,
18-
Variant,
19-
LanguageVariant,
13+
DocumentationIdentifier,
14+
DocumentationMetadata,
2015
ImageVariant,
21-
SymbolVariant,
22-
SwiftInterfaceItem,
2316
IndexContentItem,
24-
Platform,
25-
DocumentationMetadata,
26-
DocumentationIdentifier,
27-
isLanguageVariant,
2817
isImageVariant,
18+
isLanguageVariant,
2919
isSymbolVariant,
20+
LanguageVariant,
21+
Parameter,
22+
Platform,
23+
PrimaryContentSection,
24+
SeeAlsoSection,
25+
SwiftInterfaceItem,
26+
SymbolVariant,
27+
TextFragment,
28+
TopicSection,
29+
Variant,
3030
} from "../types"

0 commit comments

Comments
 (0)