-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate from TSDX to publishing untranspiled .ts source files #587
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
🚮 Removed packages: npm/[email protected] |
size-limit report 📦
|
Nice, the ➜ preflight git:(remove-tsdx) pnpm add --global https://pkg.csb.dev/upleveled/preflight/commit/0a1b8cde/@upleveled/preflight
WARN 6 deprecated subdependencies found: @oclif/[email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
Packages: +144
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 825, reused 801, downloaded 1, added 1, done
/Users/k/Library/pnpm/global/5:
+ @upleveled/preflight 7.0.9
Done in 2.5s
➜ preflight git:(remove-tsdx) preflight
🚀 UpLeveled Preflight v7.0.9
✔ All changes committed to Git
✔ node_modules/ folder ignored in Git
✔ No extraneous files committed to Git
✔ No secrets committed to Git
✔ Use single package manager
✔ Project folder name matches correct format
⚠ No dependency problems
✖ No unused dependencies
› Unused dependencies found:
* depcheck
* @size-limit/file
* postinstall-postinstall
* tslib
Remove these dependencies by running the following command for each dependency:
$ pnpm remove <dependency name here>
✔ No dependencies without types
✔ GitHub repo has deployed project link under About
✖ ESLint
› ESLint problems found in the following files:
bin/preflight.ts
Open these files in your editor - there should be problems to fix
✔ Prettier
✖ ESLint config is latest version
› Your current version of the UpLeveled ESLint Config (8.7.3) is older than the latest version 8.7.4 - upgrade by running all lines of the install instructions on
https://www.npmjs.com/package/eslint-config-upleveled
✔ Preflight is latest version |
Closes #126
Switch from the unmaintained TSDX to publishing untranspiled
.ts
source files, to:(Unconventional) method: Use shebang with
pnpm exec tsx
to execute TypeScript on the consumer machine:The pnpm shim (
@zkochan/cmd-shim
) also uses the correct binary (bun) because of shebang parsing, eg. forbun-pr
:@zkochan/cmd-shim
will also generate correct commands forexec -S ...
commands:TODO:
bin/preflight.js
tobin/preflight.ts
node
shebang topnpx tsx
shebangtsdx
dependenciestsconfig.json
in rootnode --experimental-type-stripping
in Docker containerPrior Art
This is not the most common, widespread pattern for publishing TypeScript, but there are some examples of prior art for this:
bun-pr
Alternatives Considered
Use shebang with Node.js
--experimental-strip-types
flagDownside: Currently Node.js cannot strip types in
node_modules
Use shebang with Bun
Downside: Currently Bun is not installed on student computers, potential Bun incompatibilities