neondatabase / neonctl

Neon CLI tool. The Neon CLI is a command-line interface that lets you manage Neon Serverless Postgres directly from the terminal.
https://neon.tech/docs/reference/neon-cli
Apache License 2.0
51 stars 10 forks source link

chore: Use Bun package manager & runner #229

Closed amitdahan closed 2 months ago

amitdahan commented 3 months ago

Initially I wanted to use Bun for all the things:

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 use node pkg.js in the release.yml workflow


CI gains:

luixo commented 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?

amitdahan commented 2 months ago

@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).

amitdahan commented 2 months ago

@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.