Skip to content

Commit 03f21c0

Browse files
committed
Docs(chore[types]): Align tsconfig and astro module typing
why: Workspace type-checks should succeed without pulling in unrelated sources. what: - Widen rootDir and clear paths in package tsconfig files - Add local *.astro module declarations for Astro packages and site
1 parent 42c2b70 commit 03f21c0

9 files changed

Lines changed: 34 additions & 22 deletions

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
declare module '*.astro' {
2+
const Component: (props: Record<string, unknown>) => unknown
3+
export default Component
4+
}

astro/packages/astro/autodoc/tsconfig.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
"extends": "../../../tsconfig.json",
33
"compilerOptions": {
44
"composite": true,
5-
"rootDir": "src",
6-
"outDir": "dist"
5+
"outDir": "dist",
6+
"rootDir": "../../",
7+
"paths": {}
78
},
89
"include": ["src", "tests"],
9-
"references": [{ "path": "../../core/api-model" }, { "path": "../../core/py-ast" }]
10+
"references": []
1011
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
declare module '*.astro' {
2+
const Component: (props: Record<string, unknown>) => unknown
3+
export default Component
4+
}

astro/packages/astro/intersphinx/tsconfig.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
"extends": "../../../tsconfig.json",
33
"compilerOptions": {
44
"composite": true,
5-
"rootDir": "src",
6-
"outDir": "dist"
5+
"outDir": "dist",
6+
"rootDir": "../../",
7+
"paths": {}
78
},
89
"include": ["src", "tests"],
9-
"references": [{ "path": "../../core/intersphinx" }]
10+
"references": []
1011
}

astro/packages/core/api-model/tsconfig.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
"extends": "../../../tsconfig.json",
33
"compilerOptions": {
44
"composite": true,
5-
"rootDir": "src",
6-
"outDir": "dist"
5+
"outDir": "dist",
6+
"rootDir": "../../",
7+
"paths": {}
78
},
89
"include": ["src", "tests"],
9-
"references": [{ "path": "../py-ast" }]
10+
"references": []
1011
}

astro/packages/core/intersphinx/tsconfig.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
"extends": "../../../tsconfig.json",
33
"compilerOptions": {
44
"composite": true,
5-
"rootDir": "src",
6-
"outDir": "dist"
5+
"outDir": "dist",
6+
"rootDir": "../../",
7+
"paths": {}
78
},
89
"include": ["src", "tests"],
910
"references": []

astro/packages/core/py-ast/tsconfig.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
"extends": "../../../tsconfig.json",
33
"compilerOptions": {
44
"composite": true,
5-
"rootDir": "src",
6-
"outDir": "dist"
5+
"outDir": "dist",
6+
"rootDir": "../../",
7+
"paths": {}
78
},
89
"include": ["src", "tests"],
910
"references": []
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
declare module '*.astro' {
2+
const Component: (props: Record<string, unknown>) => unknown
3+
export default Component
4+
}

astro/packages/site/docs/tsconfig.json

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,11 @@
22
"extends": "../../../tsconfig.json",
33
"compilerOptions": {
44
"composite": true,
5-
"rootDir": "src",
65
"outDir": "dist",
7-
"types": ["astro/client"]
6+
"types": ["astro/client"],
7+
"rootDir": "../../",
8+
"paths": {}
89
},
910
"include": ["src", "tests"],
10-
"references": [
11-
{ "path": "../../core/py-ast" },
12-
{ "path": "../../core/api-model" },
13-
{ "path": "../../core/intersphinx" },
14-
{ "path": "../../astro/autodoc" },
15-
{ "path": "../../astro/intersphinx" }
16-
]
11+
"references": []
1712
}

0 commit comments

Comments
 (0)