Skip to content

Commit 2559fd7

Browse files
authored
fix(cli): create appropriate plugin directory name (#2659)
This change restores the package-dynamic-plugin's conversion of the exported dynamic plugin's package name to a flat file path. Signed-off-by: Stan Lewis <[email protected]>
1 parent a3e8716 commit 2559fd7

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

.changeset/rude-bobcats-shake.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@janus-idp/cli": patch
3+
---
4+
5+
This change fixes package-dynamic-plugin to transform any organization identifier into a flat file path when packaging dynamic plugins.

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,10 @@ export async function command(opts: OptionValues): Promise<void> {
114114
const pluginPackageJson = (await fs.readJson(
115115
path.join(distDynamicDirectory, 'package.json'),
116116
)) as PackageJson;
117-
const packageName = pluginPackageJson.name!.replace(/-dynamic$/, '');
117+
const packageName = pluginPackageJson
118+
.name!.replace(/-dynamic$/, '')
119+
.replace(/^@/, '')
120+
.replace(/\//, '-');
118121
const targetDirectory = path.join(tmpDir, packageName);
119122
Task.log(`Copying '${distDynamicDirectory}' to '${targetDirectory}`);
120123
try {
@@ -125,6 +128,7 @@ export async function command(opts: OptionValues): Promise<void> {
125128
dereference: true,
126129
});
127130
const {
131+
name,
128132
version,
129133
description,
130134
backstage,
@@ -138,7 +142,7 @@ export async function command(opts: OptionValues): Promise<void> {
138142
} = pluginPackageJson;
139143
pluginRegistryMetadata.push({
140144
[packageName]: {
141-
name: packageName,
145+
name,
142146
version,
143147
description,
144148
backstage,

0 commit comments

Comments
 (0)