Skip to content

Commit 0e4468d

Browse files
layershifterclaude
andcommitted
chore: migrate from TS path aliases to workspaces + project references
Replace 36 TypeScript path aliases in tsconfig.base.json with Yarn workspaces and TypeScript project references for proper module resolution. Key changes: - Enable Yarn workspaces for packages/*, apps/*, e2e/*, tools/* - Add package exports with @griffel/source custom condition for source resolution - Switch moduleResolution to "bundler" with customConditions: ["@griffel/source"] - Enable composite builds and add cross-project references - Register @nx/js/typescript plugin for inferred type-check targets - Remove all custom type-check targets from project.json files - Standardize tsconfig extends patterns and remove redundant options - Add workspace:* dependencies for internal @griffel/* packages - Fix Vitest SSR environment resolve conditions for Vite 7 - Fix devtools webpack build (disable ForkTsCheckerWebpackPlugin) - Add tag-processor CJS build config for wyw-in-js runtime evaluation - Update e2e paths and ts-node config for new output structure - Exclude out-tsc from ESLint and add bundle-size to lint overrides Type-check (22), build (13), test (17 non-e2e), lint (17) all pass. E2e tests need follow-up for npm pack compatibility. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent f87ed33 commit 0e4468d

112 files changed

Lines changed: 791 additions & 1230 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
node_modules
22
/packages/*/dist
3+
out-tsc

.eslintrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
{
7171
"files": [
7272
"**/__fixtures__/**/*",
73+
"**/bundle-size/**",
7374
"**/*.stories.ts",
7475
"**/*.stories.tsx",
7576
"**/*.test.ts",

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# See http://help.github.com/ignore-files/ for more about ignoring files.
22

33
# compiled output
4-
/dist
4+
dist
55
/tmp
6-
/out-tsc
6+
out-tsc
77
/packages/*/dist/bundle-size
88

99
# TypeScript build info
@@ -53,4 +53,4 @@ Thumbs.db
5353
.github/instructions/nx.instructions.md
5454

5555
vite.config.*.timestamp*
56-
vitest.config.*.timestamp*
56+
vitest.config.*.timestamp*

apps/website/project.json

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,16 @@
88
"executor": "nx:run-commands",
99
"options": {
1010
"cwd": "apps/website",
11-
"commands": [{ "command": "docusaurus build --out-dir ../../dist/apps/website" }]
11+
"commands": [{ "command": "docusaurus build --out-dir ./dist" }]
1212
},
13-
"outputs": ["{workspaceRoot}/dist/apps/website"]
13+
"outputs": ["{workspaceRoot}/apps/website/dist"]
1414
},
1515
"serve": {
1616
"executor": "nx:run-commands",
1717
"options": {
1818
"cwd": "apps/website",
1919
"commands": [{ "command": "docusaurus start" }]
2020
}
21-
},
22-
"type-check": {
23-
"executor": "nx:run-commands",
24-
"options": {
25-
"cwd": "apps/website",
26-
"commands": [{ "command": "tsc -b --pretty" }],
27-
"outputPath": []
28-
}
2921
}
3022
},
3123
"tags": []

apps/website/tsconfig.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
{
22
"extends": "../../tsconfig.base.json",
33
"compilerOptions": {
4-
"allowJs": true,
54
"allowSyntheticDefaultImports": true,
6-
"checkJs": true,
75
"forceConsistentCasingInFileNames": true,
86
"jsx": "react",
9-
"noEmit": true,
10-
"outDir": "../../dist/out-tsc",
7+
"outDir": "../../dist/out-tsc/apps/website",
118
"strict": true,
129
"noImplicitOverride": true,
1310
"noPropertyAccessFromIndexSignature": true,
@@ -21,5 +18,10 @@
2118
"webpack-env"
2219
]
2320
},
24-
"include": ["./src/**/*.ts", "./src/**/*.tsx", "./src/**/*.js"]
21+
"include": ["./src/**/*.ts", "./src/**/*.tsx"],
22+
"references": [
23+
{
24+
"path": "../../packages/core"
25+
}
26+
]
2527
}

e2e/nextjs/project.json

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,6 @@
1313
"commands": [{ "command": "ts-node src/test.ts" }]
1414
},
1515
"outputs": []
16-
},
17-
"type-check": {
18-
"executor": "nx:run-commands",
19-
"options": {
20-
"cwd": "e2e/nextjs",
21-
"commands": [{ "command": "tsc -b --pretty" }],
22-
"outputPath": []
23-
}
2416
}
2517
},
2618
"tags": []

e2e/nextjs/tsconfig.json

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,8 @@
11
{
22
"extends": "../../tsconfig.base.json",
33
"compilerOptions": {
4-
"allowJs": true,
54
"allowSyntheticDefaultImports": true,
6-
"checkJs": true,
7-
"module": "CommonJS",
8-
"jsx": "react",
9-
"noEmit": true,
10-
"forceConsistentCasingInFileNames": true,
11-
"strict": true,
12-
"noImplicitOverride": true,
13-
"noPropertyAccessFromIndexSignature": true,
14-
"noImplicitReturns": true,
15-
"noFallthroughCasesInSwitch": true
5+
"jsx": "react"
166
},
177
"files": [],
188
"include": [],
@@ -22,7 +12,10 @@
2212
}
2313
],
2414
"ts-node": {
25-
"require": ["tsconfig-paths/register"],
26-
"swc": true
15+
"swc": true,
16+
"compilerOptions": {
17+
"module": "commonjs",
18+
"moduleResolution": "node"
19+
}
2720
}
2821
}

e2e/nextjs/tsconfig.lib.json

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,24 @@
11
{
2-
"extends": "./tsconfig.json",
2+
"extends": "../../tsconfig.base.json",
33
"compilerOptions": {
4-
"outDir": "../../dist/out-tsc",
4+
"outDir": "./dist",
5+
"rootDir": "./src",
56
"types": ["node", "environment"]
67
},
7-
"include": ["**/*.ts", "**/*.tsx", "**/*.js"]
8+
"exclude": ["src/**/*.test.ts", "src/**/__fixture__/", "src/**/__mocks__/"],
9+
"include": ["src/**/*.ts"],
10+
"references": [
11+
{
12+
"path": "../../packages/webpack-loader/tsconfig.lib.json"
13+
},
14+
{
15+
"path": "../../packages/react/tsconfig.lib.json"
16+
},
17+
{
18+
"path": "../../packages/next-extraction-plugin/tsconfig.lib.json"
19+
},
20+
{
21+
"path": "../utils/tsconfig.lib.json"
22+
}
23+
]
824
}

e2e/rspack/project.json

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,6 @@
1313
"commands": [{ "command": "ts-node src/test.ts" }]
1414
},
1515
"outputs": []
16-
},
17-
"type-check": {
18-
"executor": "nx:run-commands",
19-
"options": {
20-
"cwd": "e2e/rspack",
21-
"commands": [{ "command": "tsc -b --pretty" }],
22-
"outputPath": []
23-
}
2416
}
2517
},
2618
"tags": []

e2e/rspack/tsconfig.json

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,7 @@
11
{
22
"extends": "../../tsconfig.base.json",
33
"compilerOptions": {
4-
"allowJs": true,
5-
"checkJs": true,
6-
"module": "CommonJS",
7-
"jsx": "react",
8-
"noEmit": true,
9-
"forceConsistentCasingInFileNames": true,
10-
"strict": true,
11-
"noImplicitOverride": true,
12-
"noPropertyAccessFromIndexSignature": true,
13-
"noImplicitReturns": true,
14-
"noFallthroughCasesInSwitch": true
4+
"jsx": "react"
155
},
166
"files": [],
177
"include": [],
@@ -21,7 +11,10 @@
2111
}
2212
],
2313
"ts-node": {
24-
"require": ["tsconfig-paths/register"],
25-
"swc": true
14+
"swc": true,
15+
"compilerOptions": {
16+
"module": "commonjs",
17+
"moduleResolution": "node"
18+
}
2619
}
2720
}

0 commit comments

Comments
 (0)