Support frontend plugin modules in CLI
Signed-off-by: solimant <solimant@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/cli': minor
|
||||
---
|
||||
|
||||
Support frontend plugin modules in CLI
|
||||
@@ -42,6 +42,7 @@ import { version as coreComponents } from '../../../../packages/core-components/
|
||||
import { version as corePluginApi } from '../../../../packages/core-plugin-api/package.json';
|
||||
import { version as devUtils } from '../../../../packages/dev-utils/package.json';
|
||||
import { version as errors } from '../../../../packages/errors/package.json';
|
||||
import { version as frontendPluginApi } from '../../../../packages/frontend-plugin-api/package.json';
|
||||
import { version as testUtils } from '../../../../packages/test-utils/package.json';
|
||||
import { version as scaffolderNode } from '../../../../plugins/scaffolder-node/package.json';
|
||||
import { version as scaffolderNodeTestUtils } from '../../../../plugins/scaffolder-node-test-utils/package.json';
|
||||
@@ -63,6 +64,7 @@ export const packageVersions: Record<string, string> = {
|
||||
'@backstage/core-plugin-api': corePluginApi,
|
||||
'@backstage/dev-utils': devUtils,
|
||||
'@backstage/errors': errors,
|
||||
'@backstage/frontend-plugin-api': frontendPluginApi,
|
||||
'@backstage/test-utils': testUtils,
|
||||
'@backstage/theme': theme,
|
||||
'@backstage/plugin-scaffolder-node': scaffolderNode,
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
export const defaultTemplates = [
|
||||
'@backstage/cli/templates/frontend-plugin',
|
||||
'@backstage/cli/templates/frontend-plugin-module',
|
||||
'@backstage/cli/templates/backend-plugin',
|
||||
'@backstage/cli/templates/backend-plugin-module',
|
||||
'@backstage/cli/templates/plugin-web-library',
|
||||
|
||||
@@ -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';
|
||||
Reference in New Issue
Block a user