-
Notifications
You must be signed in to change notification settings - Fork 69
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
Version 2.0.0 #539
Merged
Merged
Version 2.0.0 #539
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rpastro
referenced
this pull request
Jan 11, 2023
mdonnalley
added a commit
that referenced
this pull request
Jan 23, 2023
* chore: create v2 prerelease * fix: tests * chore(release): 2.0.0-beta.1 [skip ci] * chore(release): 2.0.1 [skip ci] * fix: onRelease github action * fix: correct version * chore(release): 2.0.0-beta.3 [skip ci] * feat: version 2.0.0 (#539) * feat: improve interfaces * feat: new command types * feat: more changes * chore: clean up * chore: enable eslint rules * chore: add files * feat: remove parser/deps * chore: more clean up * chore: tests * feat: rename globalFlags to baseFlags * feat: typed args * chore: renaming things and cleanup * chore: make tests compilable * chore: add args types test * chore: get tests passing * feat: flatten ux * fix: ux.table export * fix: read from stdin * fix: args and cleanup * chore: tests * fix: arg and flag types * fix: small bugs * fix: handle non-existent flags * chore: tests * chore: compilation issues * chore: update cli-ux docs * feat: add execute * refactor: clean up cli-ux imports * test: begin removing fancy-test * feat: remove ux.open * chore: cleam up from merge * feat: add delimiter option * fix: deprecateAliases * chore: update tests * chore: update migration guide * fix: add backwards compatability for v1 args * fix: typing for default context * fix: styledObject type and boolean flag parser * fix: types * chore(release): 2.0.0-beta.4 [skip ci] * fix: make ux stubbable again * chore(release): 2.0.0-beta.5 [skip ci] * fix: default id on statically instantiated commands * chore(release): 2.0.0-beta.6 [skip ci] * fix: remove PromiseLike * chore(release): 2.0.0-beta.7 [skip ci] * fix: bump package version * chore(release): 2.0.2-beta.1 [skip ci] * fix: add missing dev dependency * chore(release): 2.0.2-beta.2 [skip ci] * fix: force publish * chore(release): 2.0.2-beta.4 [skip ci] * fix: type issues * chore(release): 2.0.2-beta.5 [skip ci] * fix: types * chore(release): 2.0.2-beta.6 [skip ci] * fix: more backwards compatiblity * chore(release): 2.0.2-beta.7 [skip ci] * chore(release): 2.0.2-beta.8 [skip ci] * fix: code review * chore(release): 2.0.2-beta.9 [skip ci] * chore(release): 2.0.2-beta.10 [skip ci] * chore(release): 2.0.2-beta.11 [skip ci] Co-authored-by: svc-cli-bot <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Breaking Changes
Command Args
We updated the
Command.args
to more closely resemble flagsBefore
After
These are the available Args:
Interfaces
Interfaces.Command
since they were not usable for tests. These are replaced by types that are available under theCommand
namespaceCliUx
We flattened
CliUx.ux
intoux
for ease of useBefore
After
CliUx.ux.open
We removed the
open
method since it was a direct import/export of theopen
package. If you need this functionality, then you should importopen
yourself.Flags
color
flagglobalFlags
tobaseFlags
globalFlags
was a misleading name because the flags added there weren't actually global to the entire CLI. Instead, they were just flags that would be inherited by any command that extended the command class they were defined in.Flag and Arg Parsing
--hekp
were parsed as arguments, instead of throwing an error. In order to handle this, oclif now assumes that anything that starts with a hypen must be a flag and will throw an error if no corresponding flag definition is found. In other words, your command can no longer accept arguments that begin with a hyphen (fixes Addingstrict=false
parses a non-existing flag as aarg
#526)parse
. This was added to support backwards compatibility for flags that separated values by commas (e.g.my-flag=val1,val2
). However, this was problematic because it didn't allow theparse
to manipulate the individual values. If you need this functionality, you can now set adelimiter
option on your flags. By doing so, oclif will split the string on the delimiter before parsing.ESM/CJS Friendliness
Writing plugins with ESM has always been possible, but it requires a handful of modifications for it to work, especially in the bin scripts. In v2 we've introduced an
execute
method that the bin scripts can use to avoid having to make changes for ESM of CJS.CJS
bin/dev
beforeCJS
bin/dev.js
afterESM
bin/dev.js
beforeESM
bin/dev.js
afterNote that ESM and CJS plugins still require different settings in the tsconfig.json - you will still need to make those modifications yourself.
Other Changes
@oclif/screen
@oclif/linewrap
withwordwrap
deprecated
property does not work when=
is used to provide value #586TODO
ux.open
method (users can import theopen
library directly if they need it)will-fix-in-v2
issuesRelated
oclif/oclif.github.io#188