Skip to content

chore: migrate from TS path aliases to workspaces + project references#774

Draft
layershifter wants to merge 23 commits intomicrosoft:mainfrom
layershifter:chore/workspace-migration
Draft

chore: migrate from TS path aliases to workspaces + project references#774
layershifter wants to merge 23 commits intomicrosoft:mainfrom
layershifter:chore/workspace-migration

Conversation

@layershifter
Copy link
Member

Summary

  • Replace 36 TypeScript path aliases in tsconfig.base.json with Yarn workspaces + TypeScript project references
  • Switch moduleResolution to "bundler" with customConditions: ["@griffel/source"] for source-level resolution
  • Enable composite builds with cross-project references in tsconfig files
  • Register @nx/js/typescript plugin to infer type-check targets automatically
  • Standardize all tsconfig files (consistent extends, rootDir, remove redundant options)
  • Add workspace:* dependencies for internal @griffel/* packages
  • Fix Vitest SSR environment conditions, devtools webpack build, vite-plugin test aliases
  • Add tag-processor/tsconfig.build.json for CJS output (wyw-in-js runtime evaluation)

CI status: type-check (22), build (13), test (17 non-e2e), lint (17) all pass.
E2e tests need follow-up for npm pack compatibility with new output paths.

Test plan

  • nx run-many -t type-check — all 22 projects pass
  • nx run-many -t build — all 13 projects pass
  • nx run-many -t test (excluding e2e) — all 17 projects pass
  • nx run-many -t lint — all 17 projects pass
  • E2e tests — need package.json in dist/ for npm pack

🤖 Generated with Claude Code

@layershifter layershifter requested a review from a team as a code owner March 5, 2026 16:53
@layershifter layershifter force-pushed the chore/workspace-migration branch from 0e4468d to 953c290 Compare March 6, 2026 09:08
@github-actions
Copy link

github-actions bot commented Mar 6, 2026

📊 Bundle size report

✅ No changes found

@layershifter layershifter force-pushed the chore/workspace-migration branch from 6c3e83b to 9bd737f Compare March 6, 2026 13:21
@layershifter layershifter reopened this Mar 6, 2026
@layershifter layershifter marked this pull request as draft March 6, 2026 15:48
layershifter and others added 22 commits March 9, 2026 14:57
- Remove module/moduleResolution overrides (inherit bundler from base)
- Change outDir to local ./out-tsc/spec
- Add project references to tsconfig.lib.json
- Widen __fixtures__ include patterns

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Enable Yarn workspaces in root package.json
- Add exports field with @griffel/source condition to all packages
- Add top-level types field pointing to source for moduleResolution node compat
- Create package.json for e2e/ and tools/ projects

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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>
Restore noEmit, fix outDir path, remove leftover strict options
(now inherited from base).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Nx infers the build target from rollup.config.cjs, matching how
core already works.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Same pattern as core and react — Nx infers the build target from
the rollup config file.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The package has a tsc build step (inferred by Nx). The exports map
should point to dist/index.js and dist/index.d.ts, not source .ts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…nge files

Webpack resolves @griffel/* via package.json exports now.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The patch redirected publish to dist/<pkg> which no longer applies.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…-syntax

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add rollup.config.cjs to style-types (consistent with core/react/shadow-dom)
- Update style-types exports to use index.esm.js/index.cjs.js pattern
- Fix packLocalPackage to copy package.json into dist with rewritten paths

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…nfig

- Update exports for 7 packages (babel-preset, postcss-syntax, jest-serializer,
  webpack-loader, webpack-extraction-plugin, next-extraction-plugin, eslint-plugin)
  to point to ./dist/ files, enabling @nx/js/typescript build target inference
- Add cleanDeclarations rollup plugin to remove .d.ts files and .tsbuildinfo
  generated by rollup's TypeScript plugin, preventing conflicts with tsc --build
- Remove duplicate compilerOptions entries in tsconfig.base.json (from merge)
- Simplify packLocalPackage to pack from package root directory

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add "files": ["dist/"] to all publishable packages for correct npm pack
- Fix top-level "types" fields to point to dist instead of source
- Add module: "node16" + moduleResolution: "node16" in tsconfig.lib.json
  for CJS-only packages (babel-preset, webpack-loader,
  webpack-extraction-plugin, next-extraction-plugin, tag-processor,
  postcss-syntax, jest-serializer, eslint-plugin)
- Fix virtual-loader to require from dist instead of src

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@layershifter layershifter force-pushed the chore/workspace-migration branch from 9bd737f to e92975d Compare March 9, 2026 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant