dev(release): use ts-node, add top-level shortuct
Created by: bobheadxi
Slight improvements for one of the items https://github.com/sourcegraph/sourcegraph/issues/16207 :
Would be nice to have a more "CLI-like" experience
- Use
ts-node
, which removes the need for a separatebuild
step- this seems reasonably speedy, ~1.5s for command runs after the first. I think being able to avoid "forgot to build" scenarios is much more valuable
- this also kind of negates the need for https://github.com/sourcegraph/sourcegraph/issues/15729 but if we want to change this more (e.g. declare config in a ts class that implements the Config interface) I would do that in a separate PR. I'm not sure why I didn't think of
ts-node
before but I woke up from a nap just now and thought, "doesn'tts-node
exist?"
- Add a top-level
yarn run release
shortcut that does the exact same thing- For example, try
yarn run release _test:config
from project root. For the lazy
- For example, try
thoughts
I'm not sure what else to cover here - we could introduce flags, but there's not much that requires flags right now (there's another item in #16207 (closed) for secrets management, another potential use of flags)
I'm a bit unsure about having this be a properly global CLI, since it is inherently tied to the Sourcegraph commit (most notably through the config)
We could add a dev
bash script so that we can use a marginally shorter dev/release.sh [...]
but I feel like the gains from that is marginal
Open to more ideas here!