diff --git a/packages/cli/src/commands/start/command.ts b/packages/cli/src/commands/start/command.ts index 6615d5fd46..66aaa897ef 100644 --- a/packages/cli/src/commands/start/command.ts +++ b/packages/cli/src/commands/start/command.ts @@ -31,8 +31,8 @@ export async function command(cmd: Command): Promise { switch (role) { case 'backend': - case 'plugin-backend': - case 'plugin-backend-module': + case 'backend-plugin': + case 'backend-plugin-module': case 'node-library': return startBackend(options); case 'app': @@ -42,8 +42,8 @@ export async function command(cmd: Command): Promise { verifyVersions: true, }); case 'web-library': - case 'plugin-frontend': - case 'plugin-frontend-module': + case 'frontend-plugin': + case 'frontend-plugin-module': return startFrontend({ entry: 'dev/index', ...options }); default: throw new Error( diff --git a/packages/cli/src/lib/role/packageRoles.test.ts b/packages/cli/src/lib/role/packageRoles.test.ts index f6c9fb418a..db6b63f327 100644 --- a/packages/cli/src/lib/role/packageRoles.test.ts +++ b/packages/cli/src/lib/role/packageRoles.test.ts @@ -180,7 +180,7 @@ describe('detectRoleFromPackage', () => { clean: 'backstage-cli clean', }, }), - ).toEqual('plugin-frontend'); + ).toEqual('frontend-plugin'); }); it('detects the role of @backstage/plugin-catalog-backend', () => { @@ -204,7 +204,7 @@ describe('detectRoleFromPackage', () => { clean: 'backstage-cli clean', }, }), - ).toEqual('plugin-backend'); + ).toEqual('backend-plugin'); }); it('detects the role of @backstage/plugin-catalog-react', () => { @@ -274,7 +274,7 @@ describe('detectRoleFromPackage', () => { clean: 'backstage-cli clean', }, }), - ).toEqual('plugin-backend-module'); + ).toEqual('backend-plugin-module'); }); it('detects the role of @backstage/plugin-permission-node', () => { @@ -323,6 +323,6 @@ describe('detectRoleFromPackage', () => { clean: 'backstage-cli clean', }, }), - ).toEqual('plugin-frontend-module'); + ).toEqual('frontend-plugin-module'); }); }); diff --git a/packages/cli/src/lib/role/packageRoles.ts b/packages/cli/src/lib/role/packageRoles.ts index 7c855ee0fd..b5fbd75b56 100644 --- a/packages/cli/src/lib/role/packageRoles.ts +++ b/packages/cli/src/lib/role/packageRoles.ts @@ -52,22 +52,22 @@ const packageRoleInfos: PackageRoleInfo[] = [ output: ['types', 'esm', 'cjs'], }, { - role: 'plugin-frontend', + role: 'frontend-plugin', platform: 'web', output: ['types', 'esm'], }, { - role: 'plugin-frontend-module', + role: 'frontend-plugin-module', platform: 'web', output: ['types', 'esm'], }, { - role: 'plugin-backend', + role: 'backend-plugin', platform: 'node', output: ['types', 'cjs'], }, { - role: 'plugin-backend-module', + role: 'backend-plugin-module', platform: 'node', output: ['types', 'cjs'], }, @@ -153,16 +153,16 @@ export function detectRoleFromPackage( return 'backend'; } if (pkg.name?.includes('plugin-') && pkg.name?.includes('-backend-module-')) { - return 'plugin-backend-module'; + return 'backend-plugin-module'; } if (pkg.name?.includes('plugin-') && pkg.name?.includes('-module-')) { - return 'plugin-frontend-module'; + return 'frontend-plugin-module'; } if (pkg.scripts?.start?.includes('plugin:serve')) { - return 'plugin-frontend'; + return 'frontend-plugin'; } if (pkg.scripts?.start?.includes('backend:dev')) { - return 'plugin-backend'; + return 'backend-plugin'; } const mainEntry = pkg.publishConfig?.main || pkg.main; diff --git a/packages/cli/src/lib/role/types.ts b/packages/cli/src/lib/role/types.ts index 6a89f7bdaf..1b18c71620 100644 --- a/packages/cli/src/lib/role/types.ts +++ b/packages/cli/src/lib/role/types.ts @@ -21,10 +21,10 @@ export type PackageRole = | 'web-library' | 'node-library' | 'common-library' - | 'plugin-frontend' - | 'plugin-frontend-module' - | 'plugin-backend' - | 'plugin-backend-module'; + | 'frontend-plugin' + | 'frontend-plugin-module' + | 'backend-plugin' + | 'backend-plugin-module'; export type PackagePlatform = 'node' | 'web' | 'common'; export type PackageOutputType = 'bundle' | 'types' | 'esm' | 'cjs';