Commit Graph

72068 Commits

Author SHA1 Message Date
Patrik Oldsberg 55f6eb8c64 Move config files to CLI modules with lazy proxies
Move jest config files to cli-module-test-jest/config and node
transform + webpack-public-path to cli-module-build/config. Replace
originals in @backstage/cli/config with lazy proxies that forward
to the appropriate module or throw if it is not installed.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-15 22:11:43 +01:00
Patrik Oldsberg 00adaa9902 Restore findOwnPaths for serve_index.html in build module
Move serve_index.html to cli-module-build/templates and use
findOwnPaths instead of require.resolve for safer path resolution.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-15 22:01:41 +01:00
Patrik Oldsberg 2069f64201 Remove extra exports from CLI module packages
CLI modules should only export the module itself as a default export.
Remove the named `buildPlugin` export from cli-module-build and the
unused `configOption` export from cli-module-config. Also remove the
API report warning skip for CLI module packages.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-15 21:51:07 +01:00
Patrik Oldsberg 7879215cca Add CLI module deduplication and improve conflict reporting
Individual CLI modules now silently take precedence over array-sourced
modules (e.g. from cli-defaults) when their commands overlap. Conflict
errors between non-array modules include both package names for easier
debugging.

Commands reference their parent module instead of storing a raw package
name string. createCliModule now validates that packageJson has a name.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-15 21:16:00 +01:00
Charles de Dreuille b2110c19c6 Update CardsWithListBox.stories.tsx
Signed-off-by: Charles de Dreuille <charles.dedreuille@gmail.com>
2026-03-15 19:10:58 +00:00
Charles de Dreuille a8dfc35a9e Update page.mdx
Signed-off-by: Charles de Dreuille <charles.dedreuille@gmail.com>
2026-03-15 17:41:05 +00:00
Patrik Oldsberg 4f2d7d555b Add README files to CLI module packages
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-15 15:03:35 +01:00
Patrik Oldsberg 7781ae5911 Add @backstage/cli-defaults package
Introduces a new `@backstage/cli-defaults` package that re-exports all
standard CLI modules as a single array, simplifying dependency management
for consumers. The CLI's `CliInitializer` is updated to support array
exports alongside single module exports. The create-app template,
changesets, and CLI fallback are updated to use `@backstage/cli-defaults`
instead of listing 11 individual modules.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-15 15:01:35 +01:00
Patrik Oldsberg 7db7ca5714 Convert discovered module paths to file URLs for Windows compatibility
On Windows, require.resolve() returns paths like D:\...\index.cjs.js
which when passed to import() causes ERR_UNSUPPORTED_ESM_URL_SCHEME
because the D: prefix is interpreted as a URL protocol. Use
pathToFileURL() to produce proper file:// URLs.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-15 13:35:12 +01:00
Patrik Oldsberg 47b50ef3c4 Add back @types/webpack-env to CLI dependencies
The CLI provides tsconfig presets that include webpack-env in the
types array, so @types/webpack-env must remain a dependency of the
CLI package for consuming apps to compile correctly.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-15 12:56:32 +01:00
Patrik Oldsberg 9937a8aa8e Clean up CLI module dependencies and revert incorrect require() changes
Align dependency versions in CLI modules to match the original CLI
package versions. Move dependencies that are only used by modules out
of the main CLI package, and add missing dependencies to the modules
that actually use them. Revert import-to-require conversions in
cli-module-build that were incorrectly introduced during the split.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-15 12:40:25 +01:00
Charles de Dreuille fa23437a87 Update components.tsx
Signed-off-by: Charles de Dreuille <charles.dedreuille@gmail.com>
2026-03-15 09:02:29 +00:00
Charles de Dreuille 668639722c Cleanups
Signed-off-by: Charles de Dreuille <charles.dedreuille@gmail.com>
2026-03-15 08:39:46 +00:00
Charles de Dreuille 9ee2931cc8 Improve styles
Signed-off-by: Charles de Dreuille <charles.dedreuille@gmail.com>
2026-03-15 08:32:41 +00:00
Patrik Oldsberg ff593fa8fa Capture stderr in E2E plugin creation step
Keep stderr capture from the plugin creation child process to aid
debugging if the command fails in the future.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-15 02:11:14 +01:00
Patrik Oldsberg 2c952496bf Use static imports for version extraction in cli-module-new
Convert dynamic require() calls to static import statements so that
Rollup can inline the version values at build time. The cli-module role
uses preserveModules in Rollup, which cannot resolve dynamic requires.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-15 01:40:26 +01:00
Patrik Oldsberg 99af21a711 Add stderr logging to E2E plugin creation step
Capture and print stdout and stderr when the plugin creation command
fails, so that the actual error is visible in CI logs.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-15 01:26:54 +01:00
Patrik Oldsberg 935c646e89 Fix CLI module discovery and create-app test mock
Resolve CLI module entry points relative to the target project root
rather than relying on bare module name resolution. This ensures modules
are found even when the CLI package is symlinked from a separate location,
such as in the E2E test workspace setup.

Also add the missing cli-module-* entries to the create-app tasks test
mock that were omitted in a previous commit.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-15 01:12:43 +01:00
Peter Macdonald 1e2c57ebb0 Merge pull request #33334 from chanchalkhatri19/docs/okta-entity-provider
docs: add Okta entity provider documentation
2026-03-14 22:42:39 +01:00
Patrik Oldsberg f100c26c92 Fix relative paths in cli-module-translations test
The test file was moved from packages/cli/src/modules/translations/lib/
to packages/cli-module-translations/src/lib/ but the relative paths to
the repo root tsconfig.json and test fixtures were not updated.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-14 20:25:16 +01:00
Charles de Dreuille 2b1bb9ca3e feat(ui): add customActions prop to ListBoxItem
Adds a `customActions` prop that renders a flex row of React nodes on
the right side of a list item. Click and keyboard events on the actions
area are stopped from propagating to the item's selection handler.

Adds two new stories:
- WithActionsMenu: ButtonIcon (ellipsis) triggering a dropdown Menu
- WithActionsTags: inline TagGroup showing metadata tags per item

Signed-off-by: Charles de Dreuille <charles.dedreuille@gmail.com>
Made-with: Cursor
2026-03-14 18:17:03 +00:00
Charles de Dreuille b7b1b86d8a fix(ui): update ListBox item check and icon design
- Check icon is now only rendered when the item is selected, so it
  takes no space when unselected and pushes content in when selected
- Icon slot is now a fixed 32x32px box to consistently frame any
  React icon component (e.g. from Remix icons)

Signed-off-by: Charles de Dreuille <charles.dedreuille@gmail.com>
Made-with: Cursor
2026-03-14 18:11:39 +00:00
Patrik Oldsberg 2fae035613 Move @types packages to devDependencies in cli-module-config and cli-module-create-github-app
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-14 17:12:41 +01:00
Patrik Oldsberg 95a5771b47 Fix remaining undeclared imports in cli-module-new and cli-module-test-jest
Add missing devDependencies to cli-module-new and add cleye, yargs,
and jest-cli peer dependency to cli-module-test-jest.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-14 16:57:58 +01:00
Patrik Oldsberg 86509de5c8 Fix CI failures: dependencies, API reports, and create-app versions
- Move runtime dependencies from devDependencies to dependencies in
  cli-module-build, cli-module-auth, cli-module-migrate, cli-module-new,
  cli-module-test-jest, and cli-module-translations
- Fix relative package.json paths in cli-module-build
- Downgrade rollup in cli-module-build to ^4.27.3 to match the CLI
- Downgrade eslint-webpack-plugin to ^4.2.0 to prevent @types/eslint v9
- Add CLI module packages to create-app version helper
- Add allow-warnings for CLI module packages in API reports
- Generate API report files for all CLI module packages

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-14 16:44:50 +01:00
Patrik Oldsberg 506da6b8be Fix rollup version in cli-module-build to prevent API report breakage
Downgrade rollup from ^4.59.0 to ^4.27.3 to match the main CLI package
and avoid the dedupe upgrading all rollup instances to 4.59.0, which
breaks API report generation.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-14 16:14:54 +01:00
Patrik Oldsberg 72457cfe98 Fix incorrect relative package.json paths in cli-module-build
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-14 16:06:33 +01:00
Patrik Oldsberg 7c8bb02ffe Fix eslint-webpack-plugin version and regenerate lockfile
Downgrade eslint-webpack-plugin in cli-module-build from ^5.0.3 to
^4.2.0 to match the main CLI package, preventing @types/eslint from
being resolved to v9 which breaks the eslint-plugin TypeScript checks.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-14 15:59:28 +01:00
Patrik Oldsberg f51e4df2d1 Fix Prettier formatting and run yarn dedupe
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-14 15:44:54 +01:00
Charles de Dreuille 04d9d8df40 feat(ui): add ListBox and ListBoxItem components
Adds standalone `ListBox` and `ListBoxItem` components to `@backstage/ui`,
built on top of React Aria's ListBox primitives. Items support icons,
descriptions, and single or multiple selection modes.

Includes Storybook stories and docs-ui documentation page.

Signed-off-by: Charles de Dreuille <charles.dedreuille@gmail.com>
Made-with: Cursor
2026-03-14 14:37:33 +00:00
Patrik Oldsberg 329f394d82 Start CLI module packages at version 0.0.0 with introductory changeset
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-14 12:46:37 +01:00
Patrik Oldsberg d806b0cc9f Add automatic discovery of CLI modules from project dependencies
The CLI now scans the project root's dependencies and devDependencies
for packages with the cli-module role, loading them automatically.
Falls back to the built-in set with a deprecation warning when no
modules are found. Updated create-app templates and the monorepo root
to include all CLI modules as explicit devDependencies.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-14 12:40:43 +01:00
Patrik Oldsberg 64a96d9d9f Add bin entry points for standalone CLI module execution
Each CLI module package now includes a bin script and cli.ts entry
point, allowing modules to be executed directly via npx without
being wired into the main @backstage/cli package.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-14 12:40:43 +01:00
Patrik Oldsberg 401c1f7e24 Resolve CLI version dynamically in info module
The info command now tries to resolve the @backstage/cli version at
runtime instead of using a hardcoded relative path. This allows the
module to work standalone when the CLI package is not present. The
module's own version is always reported as infoModuleVersion.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-14 12:40:43 +01:00
Patrik Oldsberg c95a130f52 Add runCliModule helper for standalone module execution
Add a public `runCliModule` function to `@backstage/cli-node` that
allows CLI module packages to be executed directly as standalone
programs, without needing to be wired into a larger CLI host.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-14 12:40:43 +01:00
Patrik Oldsberg a151ad0814 Split CLI modules into separate packages
Extract each CLI module from packages/cli/src/modules/ into its own
package under packages/cli-module-*. This enables independent versioning
and clearer dependency boundaries for each CLI capability.

Module mapping:
- auth → @backstage/cli-module-auth
- build → @backstage/cli-module-build
- config → @backstage/cli-module-config
- create-github-app → @backstage/cli-module-create-github-app
- info → @backstage/cli-module-info
- lint → @backstage/cli-module-lint
- maintenance → @backstage/cli-module-maintenance
- migrate → @backstage/cli-module-migrate
- new → @backstage/cli-module-new
- test → @backstage/cli-module-test-jest
- translations → @backstage/cli-module-translations

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-14 12:40:43 +01:00
Patrik Oldsberg 18012b5802 Rename CliPlugin to CliModule and cli-plugin role to cli-module
Rename createCliPlugin to createCliModule, CliPlugin to CliModule, and
the cli-plugin package role to cli-module to better distinguish CLI
modules from other plugin types.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-14 12:40:43 +01:00
Patrik Oldsberg 1929a95b97 Rename BackstageCommand to CliCommand and CommandContext to CliCommandContext
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-14 12:40:43 +01:00
Patrik Oldsberg 7d055ef0c4 Merge cli-plugin-api into cli-node
Move createCliPlugin and related types from the standalone
@backstage/cli-plugin-api package into @backstage/cli-node and
remove the now-empty package.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-14 12:40:43 +01:00
Patrik Oldsberg a90939e138 Use opaque types for command graph nodes
Switch CommandGraph and CliInitializer to use OpaqueCommandTreeNode and
OpaqueCommandLeafNode from @internal/cli instead of raw $$type markers.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-14 12:40:42 +01:00
Patrik Oldsberg 28a438a9f2 Add documentation to cli-plugin-api and remove CliFeature type
Add thorough TSDoc comments to createCliPlugin, BackstageCommand,
CommandContext, and CliPlugin. Remove the CliFeature type alias in
favor of using CliPlugin directly.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-14 12:40:42 +01:00
Patrik Oldsberg 7e6ad01a21 Refine cli-plugin-api: use packageJson, inline types, rename context fields
Replace pluginId with packageJson input for createCliPlugin, remove
CommandExecuteFn type alias by inlining it, and rename
CommandContext.info.description to info.name.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-14 12:40:42 +01:00
Patrik Oldsberg 2e5f189cfa Add @internal/cli package for opaque CLI types
Move OpaqueCliPlugin to a new @internal/cli inline package, following the
same pattern as @internal/frontend. Both cli-plugin-api and cli import it
directly, and it gets bundled into their dists at build time.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-14 12:40:42 +01:00
Patrik Oldsberg d6caf7f13b Slim cli-plugin-api to only export createCliPlugin
Move error handling and lazy utilities back to @backstage/cli since they
are host-only concerns. The cli-plugin-api internals subpath provides
isCliPlugin and initializeCliPlugin for the CLI host.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-14 12:40:42 +01:00
Patrik Oldsberg 0be3eab18b cli: initial cli-plugin-api
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-14 12:40:42 +01:00
Patrik Oldsberg 94a885a2ef Add cli-plugin package role
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-03-14 12:39:21 +01:00
Charles de Dreuille 0733b76b75 Update Row.tsx
Signed-off-by: Charles de Dreuille <charles.dedreuille@gmail.com>
2026-03-14 10:44:22 +00:00
Charles de Dreuille 421641b0f5 Update Header.module.css
Signed-off-by: Charles de Dreuille <charles.dedreuille@gmail.com>
2026-03-14 10:41:32 +00:00
Charles de Dreuille 612c217c1f fix(ui): open external Table row hrefs in a new tab
Automatically apply `target="_blank"` and `rel="noopener noreferrer"` on
`Row` when `href` is an external link, so external links in default BUI
Table rows open in a new tab instead of navigating the current page.

`rel` tokens are merged rather than replaced, so consumer-provided tokens
(e.g. `rel="nofollow"`) are preserved while `noopener noreferrer` is
always enforced whenever `target="_blank"` is in effect.

Signed-off-by: Charles de Dreuille <charles.dedreuille@gmail.com>
2026-03-14 10:37:13 +00:00
Charles de Dreuille 9318146af7 Update rename-header-css-classes.md
Signed-off-by: Charles de Dreuille <charles.dedreuille@gmail.com>
2026-03-14 10:32:58 +00:00