denox
denox copied to clipboard
Syntax: "denox start" as option to "denox run start"
Issue Type
- [ ] Bug Report
- [x] Feature Request
- [ ] Other
Expected
Denox could run a denox
denox start
denox run start
Actual
denox run start
Possible Solutions
Could fork the project to start this feature. BTW, Awesome Library! I was searching for something like this
Info
- DenoX version: denox/0.3.0 darwin-x86_64 deno-1.0.0
Thank you @dllmkdir it would be a good addition.
As I am currently adding a couple of commands eg: denox init it would be nice to have a set of reserved script names with an explanatory error message.
For example if a user adds a script named init:
scripts:
init:
file: main.ts
We could display a warning saying that init is a reserved keyword and the script cannot be run with the shorthand command.
Feel free to make a PR, if you need any help let me know
I love less typing, too! I have proposed an alternate solution to this in #16
I want to echo what @BentoumiTech said about reserved words, and also add another note:
It is more robust CLI design to reserve argument positions for the types they represent.
Currently, the first argument to denox is a command keyword, and by introducing this change, there will be two kinds of consequences:
- Enumerating which commands can/will exist and need to be reserved now
- Causing a breaking change in the future if a new command ever needs to be added that was not considered now
Very interesting proposal. Just wanna drop another use case to consider.
I would love to do denox unit to start a deno test --watch --import-map=index.unit.importmap.json index.test.ts (thx @jsejcksn for this suggestion).
Imagine the workspace file would look some like:
scripts:
unit:
command: test
# 👆 command be of type "run" | "test" with "run" as default
deno_options:
watch: true
import-map: index.unit.importmap.json index.test.ts