Skip to content

feat: upgrade TypeScript peer dep and devDep to v7.0.1-rc#120

Closed
morganney with Copilot wants to merge 1 commit into
mainfrom
copilot/upgrade-typescript-to-7-0-1-rc
Closed

feat: upgrade TypeScript peer dep and devDep to v7.0.1-rc#120
morganney with Copilot wants to merge 1 commit into
mainfrom
copilot/upgrade-typescript-to-7-0-1-rc

Conversation

Copilot AI commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Upgrades @knighted/duel to support TypeScript 7.0.1-rc as both a dev and peer dependency, and fixes the npm install ERESOLVE conflict caused by npm's semver pre-release exclusion rules.

Dependency changes

  • devDependencies.typescript: ^6.0.3^7.0.1-rc
  • peerDependencies.typescript: >=5.5.0 <7>=5.5.0 <8
  • Added "typescript": "$typescript" to overrides — npm's semver pre-release rules exclude 7.0.1-rc from matching >=5.0.0 comparators (e.g. eslint-plugin-n's peerOptional), causing ERESOLVE; the override forces all dependents to share the root's typescript version

TypeScript 7 breaking changes

  • Import assertions removed (TS2880): Updated fixture files using assert { 'resolution-mode': 'import' } to with { 'resolution-mode': 'import' } in plain/src/index.ts and cjsProject/src/cjs.cts
  • CJS output hoisting: TypeScript 7 emits exports.fn = fn assignments before function declarations. Fixed a source map integration test that searched for a bare identifier ('greet') and was hitting the new unmapped hoisted line — changed to search for 'function greet' instead

ESLint workaround (scripts/patch-es-x.js)

TypeScript 7 dropped its default CJS export — require('typescript') now throws ERR_PACKAGE_PATH_NOT_EXPORTED instead of MODULE_NOT_FOUND. eslint-plugin-es-x's optionalRequire helper only silences MODULE_NOT_FOUND, so ESLint crashes at startup. A postinstall script patches the installed module to also catch ERR_PACKAGE_PATH_NOT_EXPORTED. This is a stopgap until eslint-plugin-es-x releases a fix.

Miscellaneous

  • Added *.tsbuildinfo to .gitignore; TypeScript 7's incremental builds were generating these in test fixture directories
  • duel's sequential build orchestration (await runPrimaryBuild()await runBuild()) is already safe relative to TypeScript 7's new multi-threaded compiler
Original prompt

Typescript has released 7.0.1-rc. I want to upgrade @knighted/duel to support that version of typescript both as a peer dependency and as it's own dev dependency. The goal is to see what changes, if any, are needed.

Main thing to keep in mind is that v7 has multi threading, so we need to make sure the duel orchestration is strictly sequential (as it should already be).

Currently I see this when runnig npm i:

morgan@mactop ~/knighted/duel (bananas)$ npm i

npm error code ERESOLVE

npm error ERESOLVE could not resolve

npm error

npm error While resolving: eslint-plugin-n@18.0.1

npm error Found: typescript@7.0.1-rc

npm error node_modules/typescript

npm error dev typescript@"^7.0.1-rc" from the root project

npm error

npm error Could not resolve dependency:

npm error peerOptional typescript@">=5.0.0" from eslint-plugin-n@18.0.1

npm error node_modules/eslint-plugin-n

npm error dev eslint-plugin-n@"^18.0.1" from the root project

npm error

npm error Conflicting peer dependency: typescript@6.0.3

npm error node_modules/typescript

npm error peerOptional typescript@">=5.0.0" from eslint-plugin-n@18.0.1

npm error node_modules/eslint-plugin-n

npm error dev eslint-plugin-n@"^18.0.1" from the root project

npm error

npm error Fix the upstream dependency conflict, or retry

npm error this command with --force or --legacy-peer-deps

npm error to accept an incorrect (and potentially broken) dependency resolution.

npm error

npm error

npm error For a full report see:

npm error /Users/morgan/.npm/_logs/2026-06-22T21_01_43_158Z-eresolve-report.txt

npm error A complete log of this run can be found in: /Users/morgan/.npm/_logs/2026-06-22T21_01_43_158Z-debug-0.log

The user has attached the following file paths as relevant context:

  • AGENTS.md
  • AGENTS.md
  • AGENTS.md

Created from VS Code.

Copilot AI changed the title [WIP] Update @knighted/duel to support TypeScript 7.0.1-rc feat: upgrade TypeScript peer dep and devDep to v7.0.1-rc Jun 22, 2026
Copilot AI requested a review from morganney June 22, 2026 21:38
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.

3 participants