Skip to content
This repository was archived by the owner on Jan 27, 2026. It is now read-only.

Commit d6c06fd

Browse files
authored
feat(cli): add deprecation warnings to package-dynamic-plugins and export-dynamic-plugin (#2675)
* feat(cli): Add deprecation warnings to package-dynamic-plugins and export-dynamic-plugin Signed-off-by: Tomas Kral <tkral@redhat.com> Assisted-by: Cursor * add changeset * fix formatting --------- Signed-off-by: Tomas Kral <tkral@redhat.com>
1 parent 98baadf commit d6c06fd

File tree

7 files changed

+138
-2
lines changed

7 files changed

+138
-2
lines changed

.changeset/forty-numbers-serve.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@janus-idp/cli": minor
3+
---
4+
5+
add deprecation warnings to package-dynamic-plugins and export-dynamic-plugin and point to new rhdh-cli

packages/cli/MIGRATION.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Migration Guide: @janus-idp/cli@red-hat-developer-hub/cli
2+
3+
⚠️ **The @janus-idp/cli is deprecated and will no longer receive updates.**
4+
5+
This guide will help you migrate from the deprecated `@janus-idp/cli` to the new `@red-hat-developer-hub/cli`.
6+
7+
## Overview
8+
9+
The Red Hat Developer Hub team has introduced a new CLI tool that replaces the `@janus-idp/cli` with improved functionality and better maintainability. The new CLI offers more flexibility and ease of use for developing, packaging, and distributing dynamic plugins for Red Hat Developer Hub (RHDH).
10+
11+
## Command Migration
12+
13+
### Export Dynamic Plugin
14+
15+
**Old Command:**
16+
17+
```bash
18+
npx @janus-idp/cli package export-dynamic-plugin
19+
```
20+
21+
**New Command:**
22+
23+
```bash
24+
npx @red-hat-developer-hub/cli plugin export
25+
```
26+
27+
### Package Dynamic Plugins
28+
29+
**Old Command:**
30+
31+
```bash
32+
npx @janus-idp/cli package package-dynamic-plugins
33+
```
34+
35+
**New Command:**
36+
37+
```bash
38+
npx @red-hat-developer-hub/cli plugin package
39+
```
40+
41+
### NPM Scripts Example
42+
43+
**Before:**
44+
45+
```json
46+
{
47+
"scripts": {
48+
"export-dynamic": "@janus-idp/cli package export-dynamic-plugin",
49+
"package-plugins": "@janus-idp/cli package package-dynamic-plugins"
50+
}
51+
}
52+
```
53+
54+
**After:**
55+
56+
```json
57+
{
58+
"scripts": {
59+
"export-dynamic": "@red-hat-developer-hub/cli plugin export",
60+
"package-plugins": "@red-hat-developer-hub/cli plugin package"
61+
}
62+
}
63+
```
64+
65+
## Support and Resources
66+
67+
- **New CLI Repository**: https://github.com/redhat-developer/rhdh-cli
68+
- **Documentation**: Available in the new CLI repository
69+
- **Issues**: Report issues and bugs in Jira at https://issues.redhat.com/projects/RHIDP/summary
70+
71+
## Getting Help
72+
73+
If you encounter issues during migration:
74+
75+
1. Check the new CLI documentation: https://github.com/redhat-developer/rhdh-cli
76+
2. Compare command options between old and new CLI using `--help`
77+
3. Open an issue in the new CLI repository if you find missing functionality

packages/cli/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
# @janus-idp/cli
22

3+
<!-- prettier formatting breaks GitHub Markdown callouts, so this block is ignored -->
4+
<!-- prettier-ignore-start -->
5+
> [!WARNING]
6+
> **⚠️ DEPRECATION NOTICE**
7+
>
8+
> This CLI is **deprecated** and will no longer receive updates. Please migrate to the new **[@red-hat-developer-hub/cli](https://github.com/redhat-developer/rhdh-cli)**.
9+
>
10+
> **Command Migration:**
11+
>
12+
> - `npx @janus-idp/cli package export-dynamic-plugin``npx @red-hat-developer-hub/cli plugin export`
13+
> - `npx @janus-idp/cli package package-dynamic-plugins``npx @red-hat-developer-hub/cli plugin package`
14+
>
15+
> For more information, visit: https://github.com/redhat-developer/rhdh-cli
16+
>
17+
> **📖 [View Migration Guide](./MIGRATION.md)** - Step-by-step instructions for migrating to the new CLI
18+
<!-- prettier-ignore-end -->
19+
320
This package provides a CLI for developing and exporting Backstage plugins as dynamic plugins. It implements a few new commands on top of the @backstage/cli codebase:
421

522
- `package export-dynamic plugin` - Exports a Backstage plugin to a dynamic plugin package

packages/cli/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "@janus-idp/cli",
33
"description": "CLI for developing Backstage plugins and apps",
44
"version": "3.6.1",
5+
"deprecated": "This package is deprecated and will no longer receive updates. Please migrate to @red-hat-developer-hub/cli. See https://github.com/redhat-developer/rhdh-cli for more information.",
56
"publishConfig": {
67
"access": "public"
78
},

packages/cli/src/commands/export-dynamic-plugin/command.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,24 @@ import { applyDevOptions } from './dev';
3131
import { frontend } from './frontend';
3232

3333
export async function command(opts: OptionValues): Promise<void> {
34+
// Display deprecation warning for this specific command
35+
console.log();
36+
console.log(chalk.yellow('⚠️ COMMAND DEPRECATED'));
37+
console.log(
38+
chalk.yellow(
39+
'This command has been moved to the new @red-hat-developer-hub/cli',
40+
),
41+
);
42+
console.log(
43+
chalk.white('Please use: ') +
44+
chalk.green('npx @red-hat-developer-hub/cli plugin export'),
45+
);
46+
console.log(
47+
chalk.yellow('For more information: ') +
48+
chalk.cyan('https://github.com/redhat-developer/rhdh-cli'),
49+
);
50+
console.log();
51+
3452
const rawPkg = await fs.readJson(paths.resolveTarget('package.json'));
3553
const role = PackageRoles.getRoleFromPackage(rawPkg);
3654
if (!role) {

packages/cli/src/commands/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export function registerScriptCommand(program: Command) {
8080
command
8181
.command('export-dynamic-plugin')
8282
.description(
83-
'Build and export a plugin package to be loaded as a dynamic plugin. The repackaged dynamic plugin is exported inside a ./dist-dynamic sub-folder.',
83+
'[DEPRECATED] Build and export a plugin package to be loaded as a dynamic plugin. Use "npx @red-hat-developer-hub/cli plugin export" instead.',
8484
)
8585
.option('--minify', 'Minify the generated code (backend plugin only).')
8686
.option(
@@ -157,7 +157,7 @@ export function registerScriptCommand(program: Command) {
157157
command
158158
.command('package-dynamic-plugins')
159159
.description(
160-
'Package up exported dynamic plugins as container image for deployment',
160+
'[DEPRECATED] Package up exported dynamic plugins as container image for deployment. Use "npx @red-hat-developer-hub/cli plugin package" instead.',
161161
)
162162
.option(
163163
'--force-export',

packages/cli/src/commands/package-dynamic-plugins/command.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,24 @@ import { paths } from '../../lib/paths';
1313
import { Task } from '../../lib/tasks';
1414

1515
export async function command(opts: OptionValues): Promise<void> {
16+
// Display deprecation warning for this specific command
17+
console.log();
18+
console.log(chalk.yellow('⚠️ COMMAND DEPRECATED'));
19+
console.log(
20+
chalk.yellow(
21+
'This command has been moved to the new @red-hat-developer-hub/cli',
22+
),
23+
);
24+
console.log(
25+
chalk.white('Please use: ') +
26+
chalk.green('npx @red-hat-developer-hub/cli plugin package'),
27+
);
28+
console.log(
29+
chalk.yellow('For more information: ') +
30+
chalk.cyan('https://github.com/redhat-developer/rhdh-cli'),
31+
);
32+
console.log();
33+
1634
const {
1735
exportTo,
1836
forceExport,

0 commit comments

Comments
 (0)