Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .changeset/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
},
"changesets": [
"blue-dingos-exist",
"calm-data-flow",
"crazy-berries-peel",
"early-knives-sing",
"forty-cows-brush",
Expand All @@ -18,8 +19,13 @@
"hungry-emus-poke",
"khaki-doodles-heal",
"nasty-seas-learn",
"plain-names-land",
"quiet-bins-show",
"quiet-names-stay",
"sharp-flags-halt",
"stale-socks-relax",
"tired-trams-play",
"tired-webs-hunt"
"tired-webs-hunt",
"whole-args-pass"
]
}
2 changes: 1 addition & 1 deletion bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/node-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"prod": "node cli.js"
},
"dependencies": {
"@gud/cli": "1.0.0-beta.7",
"@gud/cli": "1.0.0-beta.8",
"@gud/cli-menu": "1.0.0-beta.5"
}
}
2 changes: 1 addition & 1 deletion examples/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"watch": "tsc --watch"
},
"dependencies": {
"@gud/cli": "1.0.0-beta.7",
"@gud/cli": "1.0.0-beta.8",
"@gud/cli-menu": "1.0.0-beta.5"
},
"devDependencies": {
Expand Down
11 changes: 11 additions & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# @gud/cli

## 1.0.0-beta.8

### Patch Changes

- a7d101e: Added `setData()` to the command state to set the data without continuing to the next command, and an optional result type parameter to `fork()`. Fixed `beforeCommand` hooks' `setData()` not reaching the command handler, and `afterCommand` hooks receiving the command's input instead of its output; `afterCommand` hooks' `setData()` now also overrides the data when the command calls `next()` or `end()`. Documented that passing `undefined` to `next()` or `end()` keeps the current data and `null` clears it.
- e5b36fe: Fixed option values of commands with `isMiddleware: false` being resolved as subcommands, e.g., `hello --name Bob` failing with `Command "Bob" not found`. Leading options are now removed using the command's options config regardless of `isMiddleware`.
- f0e7af4: Fixed the help usage line showing a partial path to the executed script instead of the CLI name. The name defaults to the matching `bin` entry in the CLI's package.json, so it's correct when package managers install a shim instead of a symlink (pnpm, and npm or yarn on Windows), and falls back to the script's file name. It can also be set with the new `name` option on `run()` and `Context`, and the lookup is exported as `getBinName`. Also made `getHelp`, `plugin`, and `PluginError` runtime exports; they were previously exported as types only.
- 7a13c3f: Fixed arguments containing spaces being split apart when `run()` is given a command array (including the default `process.argv`), e.g., `--name "Bob Smith"` failing with `Command "Smith" not found`. `joinTokens()` now quotes tokens with spaces whenever there's more than one token, not only when it's given more than one argument.
- 1658940: Fixed subcommands being resolved from the wrong position when a leading option or option value matched the subcommand's name, e.g., `deploy --target run run` resolving `run` twice. `removeLeadingOptions()` now stops at the first argument that isn't an option or an option's value instead of searching for the next command.
- b860d92: Fixed quotes, escapes, and repeated spaces in arguments being lost (e.g., `--msg 'say "hi"'` becoming `say`) by passing arguments through resolution and parsing as an array instead of a command string. `Context` has a new `argv` property and accepts `argv` instead of `commandString`, resolved commands have `remainingArgv`, the `beforeResolve`, `beforeResolveNext`, and `beforeParse` hooks receive `argv`, and `resolveCommand()`, `context.resolveCommand()`, `context.parseCommand()`, and `removeLeadingOptions()` accept arrays. `ParseCommandFn` now receives `string | string[]`, and the CLI passes it arrays, so custom parse functions need to handle arrays; support for command strings will be removed in the next major version. `splitTokens()` now ignores repeated delimiters.

## 1.0.0-beta.7

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gud/cli",
"version": "1.0.0-beta.7",
"version": "1.0.0-beta.8",
"description": "A framework for building flexible and extensible CLIs",
"license": "Apache-2.0",
"author": "ryan goree (https://github.com/ryangoree)",
Expand Down