Skip to content

chore: update @oclif/core to v4 and migrate ESLint to v9 flat config#392

Merged
shazron merged 4 commits intomasterfrom
feat/update-oclif-core-v4
Apr 7, 2026
Merged

chore: update @oclif/core to v4 and migrate ESLint to v9 flat config#392
shazron merged 4 commits intomasterfrom
feat/update-oclif-core-v4

Conversation

@shazron
Copy link
Copy Markdown
Member

@shazron shazron commented Mar 25, 2026

Fixes #391

Summary

  • Upgrades @oclif/core from ^2.8.12 to ^4.0.0, resolving chore: update @oclif/core to latest version #391
  • Replaces removed ux.table with a custom src/ux-table.js compatible with the CJS project (the official @oclif/table replacement is ESM-only)
  • Upgrades @adobe/eslint-config-aio-lib-config to 5.0.0 and eslint to ^9.0.0
  • Migrates ESLint config from legacy .eslintrc to eslint.config.js (flat config format required by ESLint v9)
  • Upgrades oclif CLI to ^4.0.0 and eslint-plugin-jest to ^29.0.0

Breaking changes handled

  • ux.table removed in v4 → custom table implementation preserving identical output format
  • Command.parse() now requires this.config.runHook → patched in test setup for unit tests that instantiate commands directly
  • _flags internal property removed → updated createTestFlagsFunction to check flags instead
  • argv is now a writable class field → simplified test that previously used a getter-only Object.defineProperty

Test plan

  • All 813 existing unit tests pass (npm test)
  • ESLint reports no errors (npm run lint)
  • 100% branch/line/statement coverage maintained

🤖 Generated with Claude Code

- Upgrade @oclif/core from ^2.8.12 to ^4.0.0 (fixes #391)
- Replace removed ux.table with custom src/ux-table.js (ESM-only @oclif/table is incompatible with CJS)
- Upgrade @adobe/eslint-config-aio-lib-config to 5.0.0, eslint to ^9.0.0
- Migrate ESLint config from .eslintrc to eslint.config.js (flat config format)
- Patch Command.prototype.parse in test setup for oclif v4 config.runHook requirement
- Update createTestFlagsFunction to check 'flags' instead of '_flags' (oclif v4 change)
- Simplify api/list.js --json flag handling (remove oclif v2 workaround)
- Maintain 100% branch/line/statement coverage

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@shazron shazron changed the title feat: update @oclif/core to v4 and migrate ESLint to v9 flat config chore: update @oclif/core to v4 and migrate ESLint to v9 flat config Mar 25, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates this plugin to work with the @oclif/core v4 ecosystem and ESLint v9, including adapting CLI output and test scaffolding to accommodate breaking changes introduced by oclif v4 and the ESLint flat-config migration.

Changes:

  • Upgrade @oclif/core (and oclif dev tooling) to v4 and adjust tests for updated parsing/config expectations.
  • Replace removed ux.table usage with a local src/ux-table.js implementation and update commands accordingly.
  • Migrate from .eslintrc to eslint.config.js (ESLint v9 flat config) and update lint dependencies.

Reviewed changes

Copilot reviewed 15 out of 16 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
test/jest.setup.js Patches Command.prototype.parse for unit tests and updates flag assertions for oclif v4.
test/commands/runtime/api/list.test.js Simplifies argv-related test logic after command parsing changes.
src/ux-table.js Adds a local table printer intended to replace ux.table.
src/commands/runtime/trigger/list.js Switches table output from ux.table to local table().
src/commands/runtime/rule/list.js Switches table output from ux.table to local table().
src/commands/runtime/property/get.js Switches table output from ux.table to local table().
src/commands/runtime/package/list.js Switches table output from ux.table to local table().
src/commands/runtime/namespace/list.js Switches table output from ux.table to local table().
src/commands/runtime/namespace/get.js Switches multiple table outputs from ux.table to local table().
src/commands/runtime/api/list.js Removes prior argv workaround and uses local table() for output.
src/commands/runtime/activation/list.js Switches table output from ux.table to local table().
src/commands/runtime/action/list.js Switches table output from ux.table to local table().
package.json Bumps oclif/core to v4 and updates ESLint/Jest lint tooling dependencies.
eslint.config.js Introduces ESLint v9 flat config and test globals integration.
.gitignore Adds .claude ignore entry.
.eslintrc Removes legacy ESLint config (replaced by flat config).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/ux-table.js Outdated
Comment thread src/ux-table.js
Comment thread test/commands/runtime/api/list.test.js Outdated
Comment thread eslint.config.js
shazron and others added 2 commits April 7, 2026 19:12
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@shazron
Copy link
Copy Markdown
Member Author

shazron commented Apr 7, 2026

@copilot apply changes based on the comments in this thread

Copy link
Copy Markdown

Copilot AI commented Apr 7, 2026

@copilot apply changes based on the comments in this thread

Applied all four review changes in commit dccc4a6:

  1. src/ux-table.js maxWidth — removed maxWidth from minWidth calculation and now enforce it as a strict upper bound via Math.min. Header and data values that exceed the content area (w - 1) are truncated.
  2. src/commands/runtime/activation/list.js Topmost column — added minWidth: 2 alongside the existing maxWidth: 2 so the decorator column stays exactly 2 chars wide regardless of data content.
  3. test/commands/runtime/api/list.test.js — removed the "handles falsy argv gracefully" test, which was testing an oclif v2 workaround that no longer exists.
  4. eslint.config.js — restored the jsdoc/tag-lines: ["error", "never", { startLines: null }] rule that was in the original .eslintrc.

Also added test/ux-table.test.js to cover the new maxWidth truncation and no-header branches, restoring 100% branch coverage.

@shazron shazron merged commit f4b69e6 into master Apr 7, 2026
9 checks passed
@shazron shazron deleted the feat/update-oclif-core-v4 branch April 7, 2026 12:08
@shazron shazron mentioned this pull request Apr 7, 2026
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore: update @oclif/core to latest version

4 participants