Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@ All notable changes to `@red-hat-developer-hub/cli` are documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 3.0.0 - 2026-09-14

### Changed

- **Frontend plugin export:** Frontend plugins now use Backstage standard module federation exclusively. The generated remote assets are written to `dist/`, including `dist/remoteEntry.js`.
- Removed the frontend export options `--scalprum-config`, `--generate-scalprum-assets`, `--no-generate-scalprum-assets`, `--generate-module-federation-assets`, and `--no-generate-module-federation-assets`. Frontend module-federation assets are now always generated during `plugin export`.
- Removed the legacy Scalprum frontend bundler and the `plugin build` and `plugin start` commands.
- Frontend dynamic packages no longer contain `dist-scalprum/`, `plugin-manifest.json`, or a `scalprum` package manifest field.

### Migration

- Remove the deleted frontend export options from scripts and CI jobs.
- Update integrations that read `dist-scalprum/plugin-manifest.json` to use the standard module-federation output under `dist/` and NFS metadata in `backstage.features`.
- Remove `dist-scalprum` and related glob entries from frontend plugin `files` fields and clean any checked-in legacy output before exporting with rhdh-cli 3.0.0.

## 2.0.6 - 2026-09-11

### Added
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@ This new CLI aims to offer more flexibility and ease of use compared to the prev
> | `npx @janus-idp/cli package package-dynamic-plugins` | `npx @red-hat-developer-hub/cli plugin package` |
<!-- prettier-ignore-end -->

## Migrating to 3.0.0

Version 3.0.0 is a breaking release for frontend plugin export. Scalprum support has been removed and frontend exports now use Backstage standard module federation and NFS metadata only.

Update frontend plugin scripts and CI jobs as follows:

- Remove `--scalprum-config`, `--generate-scalprum-assets`, `--no-generate-scalprum-assets`, `--generate-module-federation-assets`, and `--no-generate-module-federation-assets` from `rhdh-cli plugin export` invocations. Standard module-federation assets are now generated automatically.
- Replace consumers of `dist-scalprum/plugin-manifest.json` with the generated assets under `dist/`, including `dist/remoteEntry.js`, and use `backstage.features` for NFS feature metadata.
- Remove `dist-scalprum` and related glob entries from frontend plugin `files` fields. Delete any checked-in or stale `dist-scalprum` output before exporting.
- The legacy `plugin build` and `plugin start` commands are no longer available.

## `plugin package` requirements

The `plugin package` command stages each `dist-dynamic` plugin with `npm pack` and `tar` (via a short bash script). The following must be available on your `PATH`:
Expand Down
6 changes: 1 addition & 5 deletions e2e-tests/community-plugins-build-package.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,9 @@ describe('export and package backstage-community plugin', () => {
// eslint-disable-next-line jest/no-conditional-expect
expect(
fs.existsSync(
path.join(
getFullPluginPath(),
'dist-dynamic/dist-scalprum/plugin-manifest.json',
),
path.join(getFullPluginPath(), 'dist-dynamic/dist/remoteEntry.js'),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Instead of adding tests that verify the dist-scalprum directory no longer exists, we can just remove any expects on the directory entirely. If we no longer carry it as an implementation, I see no need to test its absence.

),
).toEqual(true);

const distDynamicPkg = JSON.parse(
fs.readFileSync(
path.join(getFullPluginPath(), 'dist-dynamic/package.json'),
Expand Down
6 changes: 1 addition & 5 deletions e2e-tests/rhdh-plugins-build-package.test.ts

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's drop any 'scaprum' related assertions here as well.

Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,9 @@ describe('export and package rhdh-plugins scorecard workspace plugin', () => {
// eslint-disable-next-line jest/no-conditional-expect
expect(
fs.existsSync(
path.join(
getFullPluginPath(),
'dist-dynamic/dist-scalprum/plugin-manifest.json',
),
path.join(getFullPluginPath(), 'dist-dynamic/dist/remoteEntry.js'),
),
).toEqual(true);

const distDynamicPkg = JSON.parse(
fs.readFileSync(
path.join(getFullPluginPath(), 'dist-dynamic/package.json'),
Expand Down
28 changes: 2 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@red-hat-developer-hub/cli",
"description": "CLI for developing Backstage plugins and apps",
"version": "2.0.6",
"version": "3.0.0",
"publishConfig": {
"access": "public"
},
Expand Down Expand Up @@ -51,51 +51,27 @@
"@backstage/release-manifests": "~0.0.13",
"@backstage/types": "~1.2.2",
"@manypkg/get-packages": "^1.1.3",
"@openshift/dynamic-plugin-sdk-webpack": "^3.0.0",
"@pmmmwh/react-refresh-webpack-plugin": "^0.6.0",
"@svgr/webpack": "^6.5.1",
"@yarnpkg/lockfile": "^1.1.0",
"@yarnpkg/parsers": "^3.0.0-rc.4",
"bfj": "^9.0.2",
"chalk": "^4.0.0",
"chokidar": "^3.3.1",
"codeowners": "^5.1.1",
"commander": "^9.1.0",
"css-loader": "^6.5.1",
"esbuild": "^0.28.1",
"esbuild-loader": "^4.0.0",
"eslint": "8.57.1",
"eslint-config-prettier": "^9.0.0",
"eslint-webpack-plugin": "^4.2.0",
"fork-ts-checker-webpack-plugin": "^9.0.0",
"fs-extra": "^11.2.0",
"gitconfiglocal": "2.1.0",
"handlebars": "^4.7.7",
"html-webpack-plugin": "~5.6.3",
"is-native-module": "^1.1.3",
"lodash": "^4.17.21",
"mini-css-extract-plugin": "^2.4.2",
"node-stdlib-browser": "^1.3.1",
"npm-packlist": "^5.0.0",
"ora": "^5.3.0",
"postcss": "^8.2.13",
"react-dev-utils": "^12.0.0-next.60",
"react-refresh": "^0.18.0",
"recursive-readdir": "^2.2.2",
"semver": "^7.5.4",
"style-loader": "^3.3.1",
"swc-loader": "^0.2.3",
"typescript": "5.4.5",
"typescript-json-schema": "^0.64.0",
"webpack": "~5.105.0",
"webpack-dev-server": "^5.0.0",
"yaml": "^2.5.1",
"yml-loader": "^2.1.0",
"yn": "^4.0.0"
"yaml": "^2.5.1"
},
"devDependencies": {
"@backstage/cli-module-test-jest": "0.1.3",
"@backstage/core-plugin-api": "~1.12.7",
"@backstage/eslint-plugin": "~0.3.1",
"@backstage/repo-tools": "~0.17.3",
"@jest/globals": "^30.0.0-beta.3",
Expand Down
51 changes: 0 additions & 51 deletions src/commands/build/buildFrontend.ts

This file was deleted.

51 changes: 0 additions & 51 deletions src/commands/build/command.ts

This file was deleted.

17 changes: 0 additions & 17 deletions src/commands/build/index.ts

This file was deleted.

12 changes: 2 additions & 10 deletions src/commands/export-dynamic-plugin/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,10 @@ export async function command(opts: OptionValues): Promise<void> {
];
} else if (role === 'frontend-plugin' || role === 'frontend-plugin-module') {
targetPath = await frontend(roleInfo, opts);
configSchemaPaths = [];
if (fs.existsSync(path.join(targetPath, 'dist-scalprum'))) {
configSchemaPaths.push(
path.join(targetPath, 'dist-scalprum/configSchema.json'),
);
}
if (fs.existsSync(path.join(targetPath, 'dist'))) {
configSchemaPaths.push(path.join(targetPath, 'dist/.config-schema.json'));
}
configSchemaPaths = [path.join(targetPath, 'dist/.config-schema.json')];

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] error-handling

The guard if (fs.existsSync(path.join(targetPath, 'dist'))) that previously protected the config-schema write path was removed. The new code unconditionally assigns configSchemaPaths. If dist-dynamic/dist does not exist, fs.writeJson throws ENOENT because it does not create parent directories.

Suggested fix: Use fs.outputJson instead of fs.writeJson, or add await fs.ensureDir(path.dirname(configSchemaPath)) before the write loop.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] error-handling-idiom

The guard that previously protected the config-schema write path was removed. The new code unconditionally assigns configSchemaPaths. If dist-dynamic/dist does not exist, the subsequent fs.writeJson throws ENOENT because fs-extra's writeJson does not create parent directories.

Suggested fix: Use fs.outputJson instead of fs.writeJson, or add await fs.ensureDir(path.dirname(configSchemaPath)) before the write loop.

} else {
throw new Error(
'Only packages with the "backend-plugin", "backend-plugin-module" or "frontend-plugin" roles can be exported as dynamic backend plugins',
'Only packages with the "backend-plugin", "backend-plugin-module", "frontend-plugin" or "frontend-plugin-module" roles can be exported as dynamic plugins',
);
}

Expand Down
Loading
Loading