chore(deps): upgrade typescript 5.9.2 to 6.0.3#10326
chore(deps): upgrade typescript 5.9.2 to 6.0.3#10326davidfirst wants to merge 11 commits intomasterfrom
Conversation
- Bump typescript in workspace.jsonc (two locations). - Add ignoreDeprecations, noUncheckedSideEffectImports, and explicit types array to root tsconfig to absorb TS 6 default changes. - Inject ignoreDeprecations at runtime in TypescriptMain.createCompiler when TS 6+ is loaded, so shipped env tsconfigs stay TS 5.x-compatible.
There was a problem hiding this comment.
Pull request overview
Upgrades the repo’s pinned TypeScript version to 6.0.3 and applies targeted configuration/runtime adjustments so the workspace can compile/lint cleanly under TS 6 while keeping shipped env tsconfigs compatible with TS 5.x consumers.
Changes:
- Bump
typescriptpin from 5.9.2 → 6.0.3 in the root dependency policy and thescopes/harmony/bitvariant. - Update the repo-root
tsconfig.jsonwith TS 6 compatibility settings (ignoreDeprecations,noUncheckedSideEffectImports, and explicittypes). - Update
TypescriptMain.createCompiler()to auto-injectignoreDeprecations: "6.0"only when the loaded compiler is TS 6+ and the caller didn’t set it.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
workspace.jsonc |
Updates the workspace dependency policy pins to TypeScript 6.0.3 (root + scopes/harmony/bit variant). |
tsconfig.json |
Adjusts repo-internal TypeScript compiler options to accommodate TS 6 stricter defaults. |
scopes/typescript/typescript/typescript.main.runtime.ts |
Conditionally injects ignoreDeprecations at runtime for TS 6+ to preserve TS 5.x compatibility of shipped env configs. |
…EffectImports on TS 6 Capsule builds were failing with 778 implicit-any errors because TS 6 flipped 'strict' default from false to true, turning on full strict mode for shipped env tsconfigs that relied on the TS 5 default. Extend the runtime injection in TypescriptMain.createCompiler to also set strict=false and noUncheckedSideEffectImports=false when those are not explicitly configured.
There was a problem hiding this comment.
Pull request overview
Upgrades the repo’s pinned TypeScript version to 6.0.3 and adds targeted configuration/runtime shims so Bit’s shipped TypeScript env configs remain compatible with TS 5.x consumers while the repo itself builds with TS 6.
Changes:
- Bump
typescriptpin to6.0.3inworkspace.jsonc(root + harmony/bit variant). - Update root
tsconfig.jsonwith TS6-related options (ignoreDeprecations,noUncheckedSideEffectImports, explicittypeslist). - Patch
TypescriptMain.createCompiler()to inject TS6-only compiler options at runtime when the loaded compiler is TS 6+.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| workspace.jsonc | Pins TypeScript to 6.0.3 in dependency policies. |
| tsconfig.json | Adjusts repo-internal TS compiler options for TS 6 defaults/behavior. |
| scopes/typescript/typescript/typescript.main.runtime.ts | Adds TS 6+ runtime tsconfig patching to keep shipped env tsconfigs TS 5.x compatible. |
TS 6 stopped auto-discovering @types/* packages (types defaults to []). Spec files lost their describe/it/expect globals. Extend the createCompiler runtime injection to seed ['node', 'jest'] when compilerOptions.types is unset — both are universally installed by Bit envs (node env + React env both ship @types/jest, which provides BDD-style globals).
There was a problem hiding this comment.
Pull request overview
Upgrades the repository’s TypeScript toolchain to TS 6.0.3 and applies compatibility shims/config tweaks so TS 6’s stricter defaults don’t unintentionally change behavior (especially around deprecations, side-effect imports, and ambient type discovery).
Changes:
- Bump
typescriptfrom 5.9.2 to 6.0.3 inworkspace.jsonc(root policy + harmony/bit variant). - Update root
tsconfig.jsonwith TS6-focused options (ignoreDeprecations,noUncheckedSideEffectImports, explicittypes). - Patch
TypescriptMain.createCompiler()to conditionally adjustcompilerOptionsat runtime when running under TS 6+.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| workspace.jsonc | Updates TS version pin(s) to 6.0.3. |
| tsconfig.json | Adds TS6 compilerOptions to keep repo-local typechecking consistent with prior behavior. |
| scopes/typescript/typescript/typescript.main.runtime.ts | Adds TS6+ runtime tsconfig patching logic inside createCompiler(). |
- Refresh pnpm-lock.yaml to align with typescript@6.0.3 pin. - Pin @types/jest in workspace.jsonc to match the explicit jest types in the root tsconfig. - Skip the strict/types runtime injection when the tsconfig uses extends, since an inherited base config may already set these and our injection would silently override them.
The tsconfig-env-mismatch test was relying on the TS 5 default of strict=false. TS 6 flipped that default to true, so the permissive fixture started reporting strict-mode errors. Setting strict: false explicitly makes the fixture independent of the TS version default.
There was a problem hiding this comment.
Pull request overview
Upgrades the repo’s pinned TypeScript version to 6.0.3 and adds targeted compatibility shims/config tweaks so the workspace and shipped Bit TypeScript envs continue to behave as before (especially around TS6’s stricter defaults).
Changes:
- Bump TypeScript pin to
6.0.3(root policy +scopes/harmony/bitvariant) and add an explicit@types/jestpin. - Update root
tsconfig.jsonto absorb TS6 defaults (ignoreDeprecations,noUncheckedSideEffectImports, explicittypeslist for test globals). - Patch
TypescriptMain.createCompiler()to apply TS6-only runtime tsconfig adjustments (without breaking TS5.x consumers of shipped env tsconfigs). - Update an e2e fixture to explicitly set
strict: falseto keep the test intent stable under TS6.
Reviewed changes
Copilot reviewed 3 out of 5 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| workspace.jsonc | Pins TypeScript 6.0.3 and adds @types/jest to make root tsconfig’s explicit types reproducible. |
| tsconfig.json | Adds TS6 compatibility flags and explicitly lists global types for test files. |
| scopes/typescript/typescript/typescript.main.runtime.ts | Injects TS6-only compilerOptions defaults at runtime to keep shipped env configs TS5-compatible. |
| e2e/harmony/tsconfig-env-mismatch.e2e.ts | Makes the permissive fixture explicitly strict: false to keep it permissive under TS6. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 4 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
workspace.jsonc:405
@types/jestis pinned to 26.0.20, but this workspace also pinsjestto 29.3.1. Keeping Jest runtime and its type package on different majors can lead to missing/incorrect typings (especially for newer Jest APIs) and make test type-checking less reliable. Consider updating@types/jestto a 29.x version that matches the Jest major (or, if the intent is to avoid full Jest typings, document why this older major is intentionally pinned).
"@types/mdx-js__react": "1.5.5",
"@types/jest": "26.0.20",
"@types/memoizee": "0.4.5",
"@types/mime": "2.0.3",
"@types/mini-css-extract-plugin": "2.2.0",
"@types/minimatch": "3.0.4",
"@types/mocha": "9.1.0",
Bumps
typescriptto the latest stable major (6.0.3). Small set of compatibility adjustments to absorb TS 6's new stricter defaults without changing behavior for downstream users on TS 5.x.workspace.jsonc: bumptypescriptpin in root policy and in thescopes/harmony/bitvariant.tsconfig.json(repo-internal only, not shipped): addignoreDeprecations: "6.0", setnoUncheckedSideEffectImports: false, and listtypes: ["node", "mocha", "chai", "jest"]to restore the pre-6 auto-discovery behavior for test specs.scopes/typescript/typescript/typescript.main.runtime.ts: increateCompiler, auto-injectignoreDeprecations: "6.0"when the loadedtypescriptis major version ≥ 6 and the caller hasn't set it. This keeps the shipped env tsconfigs (scopes/react/react/typescript/*.json,scopes/harmony/aspect/typescript/tsconfig.json,scopes/typescript/typescript/tsconfig.default.json) untouched so they remain valid for TS 5.x consumers — TS 5.x rejectsignoreDeprecations: "6.0"with TS5103, and TS 5.x rejectsmoduleResolution: "bundler"+module: "commonjs".Test plan
bit compile— 311/311 components compilenpm run lint— 0 tsc errors, 0 oxlint warnings across 2,838 files