Closed amitdahan closed 2 months ago
Awesome initiative!
While digging inside CLI I noticed we use js
extensions in imports.
Is that the recommended way? It doesn't make much sense.
Should we switch to extension-less import? Or to ts
extension import?
@luixo
While digging inside CLI I noticed we use
js
extensions in imports. Is that the recommended way?
I believe it actually is. I couldn't find a good summary, but this StackOverflow answer might do it well enough.
It doesn't make much sense.
I agree.
Should we switch to extension-less import? Or to
ts
extension import?
This would require compilerOptions.allowImportingTsExtensions: true
which also requires noEmit: true
or declarationOnly: true
, which implies not using tsc
to build.
So I'd say when we stop using tsc
to build our .js
output - we could also change the imported extension to .ts
, but also I feel this weirdness is unfortunately already pretty much "accepted" by the ecosystem (auto imports do the "right" thing, etc).
@luixo
As you still deep in the context of all the operations needed for CLI, I suggest adding
CONTRIBUTING.md
with explanation of whatever is needed to contribute / test / generate / build / release the CLI.
Agreed, will follow-up in a separate PR though.
Initially I wanted to use Bun for all the things:
bun install
instead ofnpm i
)bun run
orbunx
instead ofnpm run
ornpx
)bun run --bun
instead ofnode
)bun build
instead oftsc
)bun build --compile
instead ofpkg
)bun test
instead ofvitest
)In practice - it turned out to be a pretty big effort, so I'll try to split this into separate PRs, starting with:
Mostly went smooth, except
bun pkg.js
which seemed to fail during Node binary fetch, so I still usenode pkg.js
in therelease.yml
workflowCI gains: