Support frontend plugin modules in CLI

Signed-off-by: solimant <solimant@users.noreply.github.com>
This commit is contained in:
solimant
2025-03-08 06:04:59 +00:00
parent f196d9cb5f
commit 38b424338d
10 changed files with 63 additions and 0 deletions
@@ -0,0 +1 @@
module.exports = require('@backstage/cli/config/eslint-factory')(__dirname);
@@ -0,0 +1,5 @@
# {{packageName}}
The {{moduleId}} frontend module for the {{pluginId}} plugin.
_This plugin was created through the Backstage CLI_
@@ -0,0 +1,34 @@
{
"name": "{{packageName}}",
"description": "The {{moduleId}} frontend module for the {{pluginId}} plugin.",
"main": "src/index.ts",
"types": "src/index.ts",
"publishConfig": {
"access": "public",
"main": "dist/index.cjs.js",
"module": "dist/index.esm.js",
"types": "dist/index.d.ts"
},
"backstage": {
"role": "frontend-plugin-module"
},
"sideEffects": false,
"scripts": {
"build": "backstage-cli package build",
"lint": "backstage-cli package lint",
"test": "backstage-cli package test",
"clean": "backstage-cli package clean",
"prepack": "backstage-cli package prepack",
"postpack": "backstage-cli package postpack"
},
"dependencies": {
"@backstage/frontend-plugin-api": "{{versionQuery '@backstage/frontend-plugin-api'}}"
},
"devDependencies": {
"@backstage/cli": "{{versionQuery '@backstage/cli'}}",
"@testing-library/jest-dom": "{{versionQuery '@testing-library/jest-dom' '6.0.0'}}"
},
"files": [
"dist"
]
}
@@ -0,0 +1,5 @@
name: frontend-plugin-module
role: frontend-plugin-module
description: A new frontend module that extends an existing frontend plugin
values:
moduleVar: '{{ camelCase pluginId }}Module{{ upperFirst ( camelCase moduleId ) }}'
@@ -0,0 +1 @@
export { {{ moduleVar }} } from './plugin';
@@ -0,0 +1,8 @@
import { createFrontendModule } from '@backstage/frontend-plugin-api';
export const {{ moduleVar }} = createFrontendModule({
pluginId: '{{ pluginId }}',
extensions: [
/* TODO */
],
});
@@ -0,0 +1 @@
import '@testing-library/jest-dom';