@guanghechen/commander 3.2.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/README.md +2 -5
- package/lib/cjs/index.cjs +501 -597
- package/lib/esm/index.mjs +501 -597
- package/lib/types/index.d.ts +152 -79
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 4.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- Breaking changes:
|
|
8
|
+
- Rename `description` field to `desc` in ICommandConfig
|
|
9
|
+
- Implement 5-stage execution flow with breaking API changes
|
|
10
|
+
- Implement ICommandToken for naming convention support with format validation
|
|
11
|
+
|
|
12
|
+
## 3.3.0
|
|
13
|
+
|
|
14
|
+
### Minor Changes
|
|
15
|
+
|
|
16
|
+
- Apply code review fixes:
|
|
17
|
+
- Fix `#getCommandPath` to return full command path (e.g., "cli sub" instead of just "sub")
|
|
18
|
+
- Remove unused `#parseLongOption` and `#parseShortOption` dead code
|
|
19
|
+
- Improve `--no-{option}` help description to "Negate --{option}"
|
|
20
|
+
- Document short option negative value limitation in spec
|
|
21
|
+
|
|
3
22
|
## 3.2.0
|
|
4
23
|
|
|
5
24
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -124,7 +124,6 @@ const root = new Command({
|
|
|
124
124
|
})
|
|
125
125
|
|
|
126
126
|
const clone = new Command({
|
|
127
|
-
name: 'clone',
|
|
128
127
|
description: 'Clone a repository',
|
|
129
128
|
})
|
|
130
129
|
.argument({ name: 'url', kind: 'required', description: 'Repository URL' })
|
|
@@ -134,8 +133,6 @@ const clone = new Command({
|
|
|
134
133
|
})
|
|
135
134
|
|
|
136
135
|
const commit = new Command({
|
|
137
|
-
name: 'commit',
|
|
138
|
-
aliases: ['ci'],
|
|
139
136
|
description: 'Record changes to the repository',
|
|
140
137
|
})
|
|
141
138
|
.option({ long: 'message', short: 'm', type: 'string', required: true, description: 'Commit message' })
|
|
@@ -144,7 +141,7 @@ const commit = new Command({
|
|
|
144
141
|
console.log(`Committing: ${opts['message']}`)
|
|
145
142
|
})
|
|
146
143
|
|
|
147
|
-
root.subcommand(clone).subcommand(commit)
|
|
144
|
+
root.subcommand('clone', clone).subcommand('commit', commit).subcommand('ci', commit)
|
|
148
145
|
|
|
149
146
|
root.run({ argv: process.argv.slice(2), envs: process.env })
|
|
150
147
|
```
|
|
@@ -161,7 +158,7 @@ const root = new Command({
|
|
|
161
158
|
})
|
|
162
159
|
|
|
163
160
|
// Add completion subcommand
|
|
164
|
-
root.subcommand(new CompletionCommand(root))
|
|
161
|
+
root.subcommand('completion', new CompletionCommand(root))
|
|
165
162
|
|
|
166
163
|
// Generate completion scripts:
|
|
167
164
|
// mycli completion --bash > ~/.local/share/bash-completion/completions/mycli
|