chore: update typescript to 6.0.3#10475
Conversation
PR Summary by Qodochore: bump TypeScript to 6.0.3 and adapt root typecheck config
AI Description
Diagram
High-Level Assessment
Files changed (4)
|
Code Review by Qodo
1. TS5 still installed
|
…o-6.0.3 # Conflicts: # pnpm-lock.yaml
|
Code review by qodo was updated up to the latest commit c3c82d7 |
…r TS6 TS6 rejects moduleResolution=node (node10) with TS5107. The shipped default compile tsconfigs (aspect env, typescript-compiler default, react env) are read by the now-bundled TS 6.0.3 when compiling user components, so switch them to the non-deprecated 'bundler' resolution.
|
Code review by qodo was updated up to the latest commit 54da7a9 |
Under TS6, the side-effect 'import "reset-css"' in scope.tsx and workspace.tsx fails with TS2882 (no resolvable types) when compiled by core-aspect-env in a capsule. The root ts-ambient.d.ts shim doesn't reach env builds, so co-locate the declaration with each component.
|
Code review by qodo was updated up to the latest commit 9aa0a55 |
…imports
Per review: 'declare module "x" {}' keeps reset-css / @mdx-js/loader
side-effect-only (import 'x' is valid, an accidental value import errors),
instead of the bare 'declare module "x";' which widens them to any.
| "ts-graphviz": "^2.1.6", | ||
| "type-coverage": "2.15.1", | ||
| "typescript": "5.9.2", | ||
| "typescript": "6.0.3", |
There was a problem hiding this comment.
1. Ts5 still installed 🐞 Bug ☼ Reliability
Even after bumping the workspace dependency policy to TypeScript 6.0.3, pnpm-lock.yaml still pins scopes/harmony/bit to typescript@5.9.2, so installs keep multiple TypeScript versions and that importer can still resolve/use TS5. This can reintroduce TS5-vs-TS6 behavior differences for any tooling executed in that workspace package (or anything resolving its local typescript).
Agent Prompt
## Issue description
The PR updates `workspace.jsonc` to TypeScript `6.0.3`, but `pnpm-lock.yaml` still records `typescript@5.9.2` as a direct dependency for the `scopes/harmony/bit` workspace importer. This leaves multiple TypeScript versions in the install and may cause some tooling to run under TS5.
## Issue Context
The root importer is already on TS6, so this is a per-importer skew.
## Fix Focus Areas
- pnpm-lock.yaml[2058-2063]
- pnpm-lock.yaml[21753-21880]
- workspace.jsonc[643-650]
## Suggested fix
1. Identify why the `scopes/harmony/bit` importer still requests TS `5.9.2` (component-level dependency policy / variant override / generated manifest input).
2. Update that source to request `typescript@6.0.3`.
3. Regenerate `pnpm-lock.yaml` (e.g., via the same `bit install` workflow used for this PR) and confirm `scopes/harmony/bit` now resolves TS6.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
There was a problem hiding this comment.
Good catch — this is real. teambit.harmony/bit's typescript dep lives in the component model (set via a past bit deps set), not in workspace.jsonc — see the note on the variant's dependency-resolver policy: "Changes here won't affect the actual dependencies … To change a dependency from this list, run bit deps set teambit.harmony/bit <pkg@version>." So the workspace.jsonc bump can't move it, and the importer stays on 5.9.2.
Note the actual CI build already compiles under TS6 (it resolves the root-hoisted typescript@6.0.3; that's what surfaces the TS6 errors), so this is a manifest-consistency gap rather than the current build failure. The correct fix is bit deps set teambit.harmony/bit typescript@6.0.3 + bit install, which we're sequencing as part of the broader TS6 rollout (currently gated on the env-side TS6 migration). Leaving this thread open to track it.
|
Code review by qodo was updated up to the latest commit f3c3c17 |
Status: green except
|
Bumps the repo's own
typescriptdev dependency from5.9.2to6.0.3inworkspace.jsonc(both the dependency policy and the bvm-root pins), matching the TS6 core envs andtypescript-compiler@3.0.0.pnpm-lock.yamlregenerated bybit install.The root
tsconfig.json(used by thetsc --noEmitlint check) needed three TS6 adaptations, kept intentionally minimal to preserve the existing resolution behavior:ignoreDeprecations: "6.0"— TS6 turns classicnode(node10) resolution into a hard error (TS5107). KeptmoduleResolution: node(switching tobundler/nodenextwould honorexportsand surface source-vs-dist duplicate-identity noise across installed @teambit packages). Revisit before TS7 removes node10.types: ["node", "jest"]— TS6 no longer auto-includesnode_modules/@types.@types/nodestill loads via imported node builtins, butjestis only used ambiently in specs, so it must be pinned.ts-ambient.d.ts—declare modulestubs for side-effect imports whose types ship as.d.cts(reset-css,@mdx-js/loader) and can't be resolved under node10. Component builds resolve them fine via bundler; these only satisfy the root check.npm run lint(tsc --noEmit + oxlint) passes clean;bit installcompiles all 313 components.