-
-
Notifications
You must be signed in to change notification settings - Fork 69
feat: add cli builder replacements #528
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| --- | ||
| description: Modern alternatives to packages for building CLI applications | ||
| --- | ||
|
|
||
| # Replacements for CLI builders | ||
|
|
||
| ## `sade` | ||
|
|
||
| [`sade`](https://github.com/lukeed/sade) is a small but powerful tool for building CLI applications for Node.js | ||
|
|
||
| ```ts | ||
| import sade from 'sade' | ||
|
|
||
| const prog = sade('my-cli') | ||
|
|
||
| prog | ||
| .version('1.0.5') | ||
| .option('--global, -g', 'An example global flag') | ||
| .option('-c, --config', 'Provide path to custom config', 'foo.config.js') | ||
|
|
||
| prog | ||
| .command('build <src> <dest>') | ||
| .describe('Build the source directory. Expects an `index.js` entry file.') | ||
| .option('-o, --output', 'Change the name of the output file', 'bundle.js') | ||
| .example('build src build --global --config my-conf.js') | ||
| .example('build app public -o main.js') | ||
| .action((src, dest, opts) => { | ||
| console.log(`> building from ${src} to ${dest}`) | ||
| console.log('> these are extra opts', opts) | ||
| }) | ||
|
|
||
| prog.parse(process.argv) | ||
| ``` | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Also we could add a link back to this one for the other doc too? |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -126,6 +126,12 @@ | |
| "replacements": ["util.styleText", "picocolors", "ansis"], | ||
| "url": {"type": "e18e", "id": "chalk"} | ||
| }, | ||
| "commander": { | ||
| "type": "module", | ||
| "moduleName": "commander", | ||
| "replacements": ["sade"], | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are we adding more from this list here? cc: @43081j
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i think adding cleye and possibly stricli would make sense |
||
| "url": {"type": "e18e", "id": "commander"} | ||
| }, | ||
| "copy-text-to-clipboard": { | ||
| "type": "module", | ||
| "moduleName": "copy-text-to-clipboard", | ||
|
|
@@ -3371,6 +3377,12 @@ | |
| "type": "documented", | ||
| "replacementModule": "rollup-plugin-visualizer" | ||
| }, | ||
| "sade": { | ||
| "id": "sade", | ||
| "type": "documented", | ||
| "url": {"type": "e18e", "id": "commander"}, | ||
| "replacementModule": "sade" | ||
| }, | ||
| "smol-toml": { | ||
| "id": "smol-toml", | ||
| "type": "documented", | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we rename the doc file, as it's currently
commander