bump: update TypeScript templates to TypeScript 6#3642
bump: update TypeScript templates to TypeScript 6#3642knative-prow[bot] merged 4 commits intoknative:mainfrom
Conversation
|
Hi @Ankitsinghsisodya. Thanks for your PR. I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with Tip We noticed you've done this a few times! Consider joining the org to skip this step and gain Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
There was a problem hiding this comment.
Pull request overview
Updates the TypeScript function templates to TypeScript 6 and adjusts associated tooling/config to keep builds/tests working under TS6.
Changes:
- Bump TypeScript and related tooling dependencies (notably
typescript-eslint,tsd) and replacets-nodewithtsx. - Update
tsconfig.jsonto setrootDirand migratemoduleResolutiontobundler. - Regenerate
package-lock.jsonfor both TypeScript templates to reflect dependency changes.
Reviewed changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| templates/typescript/http/tsconfig.json | Adds rootDir and updates module resolution for TS6 output/layout compatibility. |
| templates/typescript/http/package.json | Bumps TS-related dev deps and switches tests from ts-node to tsx. |
| templates/typescript/http/package-lock.json | Lockfile refresh reflecting TS6 + tsx dependency graph. |
| templates/typescript/cloudevents/tsconfig.json | Adds rootDir and updates module resolution for TS6 output/layout compatibility. |
| templates/typescript/cloudevents/package.json | Bumps TS-related dev deps and switches tests from ts-node to tsx. |
| templates/typescript/cloudevents/package-lock.json | Lockfile refresh reflecting TS6 + tsx dependency graph. |
Files not reviewed (2)
- templates/typescript/cloudevents/package-lock.json: Language not supported
- templates/typescript/http/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
f3bdcce to
8694522
Compare
Upgraded TypeScript, tsx, tsd, and typescript-eslint to their latest versions. Replaced ts-node with tsx in test scripts for improved performance. Added rootDir option in tsconfig.json for better project structure. Changed moduleResolution from 'node' to 'bundler' for module handling.
…structure and contents
8694522 to
eda76fc
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3642 +/- ##
==========================================
+ Coverage 56.40% 56.41% +0.01%
==========================================
Files 180 181 +1
Lines 20578 20669 +91
==========================================
+ Hits 11607 11661 +54
- Misses 7769 7795 +26
- Partials 1202 1213 +11
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@matejvasek, just looked into the Podman CI failure — it's not related to the TypeScript changes in this PR at all. The issue is in The fix is straightforward — drop the - $CONTAINER_ENGINE run -d --restart=always -p "127.0.0.1:50000:5000" --name "func-registry" registry:2
+ $CONTAINER_ENGINE run -d --restart=always -p "50000:5000" --name "func-registry" registry:2This applies to both the What are your thoughts? |
That's odd I would expect Go to use
There are various school of thought. |
|
Maybe the podman issue was just a flake? |
|
@twoGiants please check this PR, you know JS more than me Claude reviewd this and does not like the change of bundler
But maybe it's all right, I do not know. |
twoGiants
left a comment
There was a problem hiding this comment.
Hi @Ankitsinghsisodya ! 👋 😸
Thank you for your contribution. See my comments below.
@matejvasek I addressed your comment.
|
/test unit-tests |
|
I did rerun it, but it may be legit error: |
|
The test failed again. Possibly because the knative test infra uses NodeJS 18? |
|
You probably also need to update test/presubmit-tests.sh too. |
Modified test scripts in TypeScript templates to utilize Node.js with tsx for improved compatibility and performance. Updated Node.js version in presubmit tests from v18.10.0 to v22.11.0.
|
Why you changed |
|
/ok-to-test |
Locally some tests were failing. Changing tsx => node --require tsx/cjs worked because it bypasses esm entirely and uses commonjs hooks, which has no problem with extensonless files |
|
/lgtm |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Ankitsinghsisodya, matejvasek, twoGiants The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What
Bumps TypeScript from v5 to v6 across both TypeScript function templates (
templates/typescript/httpandtemplates/typescript/cloudevents), including all required tooling adjustments.This is the TypeScript follow-up to #3582 (Node template bumps).
Changes
package.json(both templates)typescript^5.5.2^6.0.3typescript-eslint^8.0.0^8.59.0ts-node^10.9.2tsx^4.21.0tsd^0.31.1^0.33.0tsconfig.json(both templates)rootDir"./src"build/src/instead ofbuild/moduleResolution"node""bundler""node"(node10) is deprecated in TS6; bundler+commonjs is the recommended migration pathScripts (both templates)
package-lock.jsonregenerated for both templates.Verification
tsc --noEmitpasses on both templates with TypeScript 6.0.3tscbuild producesbuild/index.jsat the expected path in both templatessrc/index.tsor test files