Commit Graph

19 Commits

Author SHA1 Message Date
David Festal 4074a227c2 fix(backend-dynamic-feature-service): improve package resolution for bundled dynamic plugins
Updated `resolvePackagePath` to correctly resolve `package.json` for dynamic plugins that bundle their own copy of `@backstage/backend-plugin-api`. This change ensures that the resolution works for both the host application and bundled dependencies, enhancing compatibility with plugins created using the `backstage-cli package bundle` command.

Signed-off-by: David Festal <dfestal@redhat.com>
Assisted-by: Cursor
2026-03-16 18:42:07 +01:00
David Festal 62d08492c7 feat(cli): contribute a bundle command for dynamic loading
for both frontend and backend plugins.

Signed-off-by: David Festal <dfestal@redhat.com>
Assisted-by: Cursor
2026-03-16 18:36:46 +01:00
Patrik Oldsberg 08dbd83cd3 chore: remove redundant cli.ts files from CLI modules
The bin scripts already had the full runCliModule logic for the production
path. Inline the same pattern for local dev and drop the intermediate
src/cli.ts files that just duplicated it.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-16 13:12:00 +01:00
Patrik Oldsberg 4d081452b1 Address review feedback from freben
- Use cli-defaults instead of listing individual CLI modules in
  create-app template and root package.json
- Move nodeTransform config files from cli-module-build to cli-node
  to avoid cross-module direct imports
- Rename cli-module-create-github-app to cli-module-github
- Start createCliModule init chain with Promise.resolve()
- Deduplicate exitWithError in runCliModule.ts
- Extract shared isCommandNodeHidden to @internal/cli
- Add explanatory comment for fromArray deduplication field
- Restore error for cli role packages missing bin in runCliExtraction

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-16 12:55:22 +01:00
Patrik Oldsberg 26eab3bf83 Rename CLI module bin entries to use backstage prefix
Rename all bin entries from `cli-module-*` to `backstage-cli-module-*`
to establish a clear namespace for Backstage CLI tooling.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-16 12:27:08 +01:00
Patrik Oldsberg 6395e35c6a Generate CLI reports for cli-module packages
Include cli-module role in CLI report generation alongside the
existing cli role. Packages without a bin field are silently skipped.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-15 23:12:59 +01:00
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 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 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
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
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 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 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