fix(init): use bin.js entry point for TypeScript loader in justfile#1252
Conversation
`just init` fails because `node packages/tools/src/index.ts` runs without a TypeScript loader, so Node.js cannot resolve `.js` imports to `.ts` files. Use `bin.js` which registers `@oxc-node/core/register` before importing `index.ts`.
✅ Deploy Preview for viteplus-preview canceled.
|
|
@jong-kyung should merge changes from main branch first |
I've merged it! Thank you for reviewing |
| init: _clean_dist | ||
| cargo binstall watchexec-cli cargo-insta typos-cli cargo-shear dprint taplo-cli -y | ||
| node packages/tools/src/index.ts sync-remote | ||
| node packages/tools/src/bin.js sync-remote |
There was a problem hiding this comment.
@jong-kyung This change will cause problems, as the "@oxc-node/core" dependency is not installed during the initialization phase. Since we declared that the node version supports running ts directly, the original node packages/tools/src/index.ts sync-remote is correct. I will revert this change first.
There was a problem hiding this comment.
I know the reason for your modification. Tools should be changed to a pure TypeScript project. Let me refactor it.
There was a problem hiding this comment.
I know the reason for your modification. Tools should be changed to a pure TypeScript project. Let me refactor it.
@fengmk2 Thanks for the explanation! I didn't consider that @oxc-node/core isn't available during the init phase. Looking forward to the refactor.
…reference Switch tools package imports from .js to .ts extensions, update entry point from bin.js to index.ts, and enable allowImportingTsExtensions in tsconfig. Also fix potential null reference on wasiBindingError in the NAPI binding loader. #1252 (comment)
Switch tools package imports from .js to .ts extensions, update entry point from bin.js to index.ts, and enable allowImportingTsExtensions in tsconfig. Also fix potential null reference on wasiBindingError in the NAPI binding loader. #1252 (comment)


Summary
Closes #1251
just initfails withERR_MODULE_NOT_FOUNDbecausenode packages/tools/src/index.tsruns without a TypeScript loader, so Node.js cannot resolve.jsimports to.tsfilesnode packages/tools/src/bin.jswhich registers@oxc-node/core/registerbefore importingindex.ts, enabling proper.js→.tsresolution