Repository navigation
Conversation
@oclif/command, @oclif/config and @oclif/parser are deprecated, and
@oclif/test@1 can't load on Node 22+ (module.parent is undefined), so
the test suite only ran on Node 20 and below.
- All commands move to @oclif/core v4: args use Args.*, flags use
Flags.*, and parse is awaited. CliUx.ux calls go through a small
src/utils/ux.ts module that keeps the old method surface
(log, styledJSON, prompt, confirm, url, table).
- Commands that never called this.parse now do, which v4 expects.
- bin/dev uses @oclif/core's execute({development: true}).
- @oclif/plugin-help v6 stays a runtime dependency (it's in
oclif.plugins); engines.node is >=18 to match @oclif/core v4.
- Tests: @oclif/test@1 was fancy-test plus a .command() plugin.
test/helpers/oclif.ts re-registers .command() on top of v4 with
fancy-test@1, so the existing tests only change their import.
Two --level assertions match v4's "Nonexistent flag" wording, and
the permission test stubs the ux module's prompt.
- .eslintrc: allow @oclif/core in node/no-missing-import, since
eslint-plugin-node@11 doesn't read package "exports".
Claude-Session: https://claude.ai/code/session_01PsSVdfBGzbRD6i9BwVosdN
This file contains hidden or 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
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.
Summary
Moves the CLI from the deprecated
@oclif/command/@oclif/config/@oclif/parser(oclif v1) to@oclif/corev4. It also fixes the test suite, which doesn't load on Node 22+ because@oclif/test@1relies onmodule.parent.This is the second of the smaller PRs replacing #41, rebased onto current master including the #45/#46 msig work.
Commands
Args.*/Flags.*in object form, andawait this.parse(...).CliUx.ux.*calls go throughsrc/utils/ux.ts, which keeps the old methods (log,styledJSON,prompt,confirm,url,table) so command bodies barely change.this.parsenow do. v4 expects it and otherwise warns in dev/test runs.bin/devnow usesexecute({development: true}).bin/runis unchanged and works as-is.Packaging
@oclif/plugin-helpis bumped to v6 and kept independencies, since it's listed inoclif.plugins.engines.nodeis>=18, matching@oclif/corev4.Tests: the existing test bodies are unchanged.
@oclif/test@1wasfancy-testplus a.command()plugin, and@oclif/test@4drops that chainable API.test/helpers/oclif.tsre-registers.command()on v4 (pinned tofancy-test@1so.stub()behaves the same), and the 7 test files only change their import.--levelassertions now match v4's wording ("Nonexistent flag: --level" instead of "Unexpected argument"). The behavior is the same.permission.test.tsstubsprompton theuxmodule instead ofCliUx.ux.Lint:
.eslintrcadds@oclif/coretoallowModulesfornode/no-missing-import.eslint-plugin-node@11doesn't read packageexports, and@oclif/corev4 has nomain. The defaulttryExtensionsare kept.Testing
nyc mocha "test/**/*.test.ts": 82 passing on Node 18, 20 and 22. On master, Node 22 fails to load the suite at all.npm run build,npm pack, then a clean install of the tarball. Ranversion,--help,help msig,key:list,msig:approve --helpandchain:listfrom the installed binary withNODE_ENVunset; all exit 0.@oclif/*. The remaining 8 come through@proton/api,@proton/jsandnyc.tsc --noEmitis clean. Hand-migrated files lint with 0 errors. Repo-wideposttestlint still fails as it does on master, from pre-existing issues.Notes
npm run buildrewrites it with v4's help formatting (~250 lines), and the next version bump will do that anyway.help:, which both v1 and v4 ignore, so argument descriptions have never appeared in--help. Switching todescription:would fix that, but it's left for a follow-up to keep this PR a pure migration.