Skip to content

Make the project TS6 compatible#1

Open
ZheSun88 wants to merge 1 commit into
ausginer:mainfrom
ZheSun88:make-it-ts6
Open

Make the project TS6 compatible#1
ZheSun88 wants to merge 1 commit into
ausginer:mainfrom
ZheSun88:make-it-ts6

Conversation

@ZheSun88

Copy link
Copy Markdown

Summary of changes

  1. package.json — peerDependencies.typescript: "5" → ">=5"
  2. tsconfig.build.json — added "rootDir": "src" (TS 6's TS5011 requires explicit rootDir when outDir differs from inferred root).
  3. tsconfig.json — added "types": ["node"] (TS 6 no longer auto-pulls @types/node for this project, so node:crypto and the global crypto weren't found).
  4. src/index.ts — replaced ambient crypto.randomUUID() with explicit import { randomUUID } from 'node:crypto'. This is the only source change; it's not a TypeScript-API change but a Node-standard-import cleanup.

Verification

  • npm run build — clean.
  • npm test — 12/12 pass on typescript@6.0.3.

@ZheSun88

Copy link
Copy Markdown
Author

hey @Lodin , we are using this in hilla project which has been upgraded to use TS 6,
when build the project with it, i can see warnings/errors like

warn Could not resolve dependency:
npm warn peer typescript@"5" from tsc-template@0.2.3
npm warn node_modules/@vaadin/hilla-file-router/node_modules/tsc-template
npm warn   tsc-template@"0.2.3" from @vaadin/hilla-file-router@25.2.0-alpha5
npm warn   node_modules/@vaadin/hilla-file-router

do you have time to take a look this PR, if everything is good, make a new release?

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