Fix #187: support TypeScript v6 and let test features work.#188
Fix #187: support TypeScript v6 and let test features work.#188samchon wants to merge 6 commits intononara:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds TypeScript 6.x compatibility across the patching pipeline and test harness, including new logic to skip patching TS6 “thin wrapper” modules and improved ESM loading behavior for newer Node runtimes.
Changes:
- Update TypeScript dependency to
~6.0.2and adjust tsconfig settings (incl.ignoreDeprecations: "6.0"androotDir/typesfixes). - Introduce “non-patchable” module detection (TS 6+) and wire it into
check/patchflows with user-facing logs. - Improve ESM loading behavior and update webpack ESM test expectations based on Node version.
Reviewed changes
Copilot reviewed 16 out of 17 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| yarn.lock | Updates lockfile for TypeScript 6.0.2. |
| package.json | Bumps TypeScript dependency to ~6.0.2. |
| tsconfig.base.json | Adds ignoreDeprecations: "6.0" to suppress TS6 warnings. |
| test/tsconfig.json | Adds types: ["jest","node"] to stabilize test typing. |
| test/tests/webpack.test.ts | Adjusts ESM/no-esm-package test behavior for Node 22.12+. |
| test/assets/projects/webpack/tsconfig.json | Adds ignoreDeprecations: "6.0" for TS6 test project noise reduction. |
| test/assets/projects/path-mapping/tsconfig.plugin.json | Sets rootDir to align emitted paths with includes. |
| test/assets/projects/path-mapping/tsconfig.json | Adds ignoreDeprecations: "6.0" for TS6 compatibility. |
| test/assets/projects/package-config/tsconfig.json | Sets rootDir to align emitted paths with includes. |
| projects/patch/tsconfig.json | Sets rootDir and ignoreDeprecations for TS6 builds. |
| projects/patch/src/plugin/register-plugin.ts | Automatically sets ignoreDeprecations for TS6+ when registering ts-node. |
| projects/patch/src/plugin/esm-intercept.ts | Attempts native ESM require first, falls back to esm package. |
| projects/core/tsconfig.json | Adds Node types for core build typing consistency. |
| projects/core/src/module/ts-module.ts | Adds TsModule.isPatchable() + TS6 non-patchable module list. |
| projects/core/src/actions/patch.ts | Skips patching non-patchable modules with logging. |
| projects/core/src/actions/check.ts | Reports non-patchable modules and skips patch checks for them. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
samchon
left a comment
There was a problem hiding this comment.
@nonara I have done my best to work with Claude Code.
On my local machine, yarn test passes every time, but it fails for several test cases in GitHub Actions. This is happening on the master branch as well, and I am not sure how to resolve this.
I have preemptively applied this to typia as well, and it works well. Please finalize and publish this - samchon/typia#1804
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 17 out of 18 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - name: Clean yarn cache | ||
| run: yarn cache clean |
There was a problem hiding this comment.
yarn cache clean is run before the test step, but the test harness spins up fixture projects and runs yarn --check-cache ... installs (see test/src/project.ts). Cleaning the cache here removes the warm cache and forces network downloads during tests, increasing CI time and adding avoidable flakiness. If the goal is to free disk space, consider moving cache cleanup after tests, or restoring dependency caching (e.g. via actions/cache) instead of clearing it mid-job.
samchon
left a comment
There was a problem hiding this comment.
Also tested samchon/nestia#1442, and no problem.
|
Thanks @samchon. If there are failures, I'll need to check them out, but I'm sure we can get it passing. Appreciate the hard work. Will try to review Sunday. |
samchon
left a comment
There was a problem hiding this comment.
Thank you. As TypeScript team is saying they will start keeping the semver, it would be the last version on both ts-patch and typia. Let's see again in golang ecosystem.
This pull request adds support for TypeScript 6.x, including proper handling of modules that are now thin wrappers and do not require independent patching. It also improves compatibility with Node.js 22.12+ native ESM support, updates TypeScript dependencies, and makes several adjustments to TypeScript and test configurations to suppress deprecation warnings and ensure correct root directories.
TypeScript 6.x Support and Module Patching:
tsserverlibrary.jsandtsserver.js) in TypeScript 6+, since they delegate totypescript.jsand don't need independent patching (TsModule.isPatchable). [1] [2] [3]checkandpatchactions to report and skip these non-patchable modules, providing clear log messages to users. [1] [2]ESM and Node.js Compatibility:
requirefor ESM modules on Node 22.12+ and fall back to theesmpackage only when necessary. [1] [2]Dependency and Configuration Updates:
~6.0.2inpackage.json."ignoreDeprecations": "6.0"to varioustsconfig.jsonfiles to suppress deprecation warnings for TypeScript 6.x. [1] [2] [3] [4]rootDirandtypessettings intsconfig.jsonfiles for both source and test projects. [1] [2] [3] [4] [5]Plugin and Registration Improvements:
ignoreDeprecationsautomatically for TypeScript 6+. [1] [2]These changes collectively improve compatibility with the latest TypeScript and Node.js versions, streamline module patching, and reduce noise from deprecation warnings.