Repository navigation
Remove ts-node support - #937
Open
Elizabeth Craig (ecraig12345) wants to merge 4 commits into
Open
Elizabeth Craig (ecraig12345) wants to merge 4 commits into
Elizabeth Craig (ecraig12345) wants to merge 4 commits into
Conversation
Elizabeth Craig (ecraig12345)
force-pushed
the
no-ts-node
branch
from
November 17, 2026 07:50
bc79b69 to
57c891b
Compare
There was a problem hiding this comment.
🟡 Changes recommended
CommonJS configs exporting a then task can leave loading unresolved, allowing just build to exit successfully without running the requested task.
3 open issues
What changed in this PR
This PR replaces ts-node integration in Just’s task runner and preset tasks with native TypeScript and ES module loading on Node.js 22.18+.
Changes:
- Load configs through
import(), supporting.mjs/.mts, top-levelawait, and asynchronous initializers. - Remove
ts-nodedependencies and task options; require webpack-cli v7+. - Migrate examples, expand native-loading tests, and document v3 migration requirements.
| File | Description |
|---|---|
yarn.lock |
Removes ts-node dependencies and updates workspace requirements. |
packages/just-task/src/index.ts |
Exports the shared import helper. |
packages/just-task/src/importModule.ts |
Adds file-URL imports with error logging. |
packages/just-task/src/enableTypeScript.ts |
Removes ts-node registration. |
packages/just-task/src/config.ts |
Loads configs asynchronously and discovers ESM extensions. |
packages/just-task/src/cli.ts |
Awaits config initialization before command handling. |
packages/just-task/src/__tests__/resolve.spec.ts |
Tests additional config extensions. |
packages/just-task/src/__tests__/importModule.spec.ts |
Tests module imports and error preservation. |
packages/just-task/src/__tests__/cli.spec.ts |
Adds native config-loading integration coverage. |
packages/just-task/package.json |
Removes ts-node dependencies. |
packages/just-task/etc/just-task.api.md |
Records the import helper’s public API. |
packages/just-scripts/src/typescript/getTsNodeEnv.ts |
Removes ts-node environment helpers. |
packages/just-scripts/src/tasks/webpackTask.ts |
Imports webpack configs natively. |
packages/just-scripts/src/tasks/webpackDevServerTask.ts |
Removes ts-node options and environment setup. |
packages/just-scripts/src/tasks/webpackCliTask.ts |
Delegates native config loading to webpack-cli. |
packages/just-scripts/src/tasks/nodeExecTask.ts |
Runs scripts without ts-node registration. |
packages/just-scripts/src/tasks/__tests__/webpackTask.spec.ts |
Adds real builds using native config formats. |
packages/just-scripts/src/tasks/__tests__/webpackTask.mock.spec.ts |
Removes the obsolete TypeScript-enabling mock. |
packages/just-scripts/src/tasks/__tests__/webpackDevServerTask.mock.spec.ts |
Updates environment expectations for native loading. |
packages/just-scripts/src/tasks/__tests__/webpackCliTask.mock.spec.ts |
Verifies removal of ts-node environment injection. |
packages/just-scripts/src/tasks/__tests__/nodeExecTask.test.ts |
Updates script execution tests for native TypeScript. |
packages/just-scripts/package.json |
Removes ts-node and raises the webpack-cli minimum. |
packages/just-scripts/etc/just-scripts.api.md |
Records removed task options. |
packages/just-example-lib/webpack.config.mts |
Uses an ESM default export. |
packages/just-example-lib/tsconfig.json |
Includes renamed .mts configs. |
packages/just-example-lib/src/customTask.ts |
Removes the previous TypeScript script. |
packages/just-example-lib/src/customTask.mts |
Adds its native ESM replacement. |
packages/just-example-lib/package.json |
Removes the example’s ts-node dependency. |
packages/just-example-lib/just.config.mts |
Adapts paths and script execution for ESM. |
docs/tasks/index.md |
Documents native config loading and restrictions. |
docs/migration/v3.md |
Expands the v3 migration guide. |
docs/.vuepress/config.ts |
Links directly to the v3 migration page. |
change/change-e7f138ae-f57f-449a-8d01-5a5d497f301d.json |
Records breaking changes for both published packages. |
.yarnrc.yml |
Removes ts-node from the dependency catalog. |
Review effort: Balanced
There was a problem hiding this comment.
🟡 Changes recommended
The change breaks explicit JSON webpack config loading and can leave symlinked CommonJS initializer tasks unregistered when --preserve-symlinks is enabled.
5 open issues
Make test verify options registered after await are honored · New Resolve cached configs with Node's symlink-aware path · New JSON webpack configs fail without import type attribute · New Document the new API and exit behavior in changelog · New Remove obsolete just-task entry from older changelog · New
3 resolved since last review
Review effort: Max
Updated comment to include new features and behavior changes. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Replace
ts-nodesupport with native TypeScript and ES module loading in Node.js 22.18+.import(), supporting ESM and top-levelawaitwhile preserving CommonJS compatibility and existing task export styles. Await asynchronous Just config initializers before registering exported tasks and parsing task options.just.config.mjsandjust.config.mtsimportModule()helper which provides file-URL conversion and better import errors.ts-noderegistration, dependencies, and related options. Keep permissive webpack peer ranges and document version-specific native config loading..mts, document native TypeScript restrictions, and add a v3 migration guide.Breaking changes
tsconfig.jsonor perform type-checking when loading them.--esmflag. Config module formats now follow Node's native rules; use.mtsto explicitly select ESM or.ctsfor CommonJS.transpileOnlyfromwebpackTask, andtsconfigandtranspileOnlyfromwebpackCliTaskandwebpackDevServerTask.enableTypeScript,tsconfig, andtranspileOnlyfromnodeExecTask.Caveats
This is potentially one of the more disruptive changes due to the feature limitations of type stripping. If it's not feasible to migrate, it might be possible to restore
ts-nodesupport as an optional mode.