@backstage/cli 0.30.0-next.2 → 0.30.0-next.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -0
- package/dist/commands/index.cjs.js +3 -0
- package/dist/commands/new/new.cjs.js +39 -80
- package/dist/lib/new/createNewPackage.cjs.js +32 -0
- package/dist/lib/new/defaultTemplates.cjs.js +16 -0
- package/dist/lib/new/execution/PortableTemplater.cjs.js +91 -0
- package/dist/lib/new/execution/executePortableTemplate.cjs.js +54 -0
- package/dist/lib/new/execution/installNewPackage.cjs.js +127 -0
- package/dist/lib/new/execution/writeTemplateContents.cjs.js +111 -0
- package/dist/lib/new/preparation/collectPortableTemplateInput.cjs.js +157 -0
- package/dist/lib/new/preparation/loadPortableTemplate.cjs.js +82 -0
- package/dist/lib/new/preparation/loadPortableTemplateConfig.cjs.js +121 -0
- package/dist/lib/new/preparation/resolvePackageParams.cjs.js +40 -0
- package/dist/lib/new/preparation/selectTemplateInteractively.cjs.js +38 -0
- package/dist/lib/new/types.cjs.js +15 -4
- package/dist/lib/tasks.cjs.js +0 -111
- package/dist/packages/backend-defaults/package.json.cjs.js +1 -1
- package/dist/packages/backend-plugin-api/package.json.cjs.js +1 -1
- package/dist/packages/backend-test-utils/package.json.cjs.js +1 -1
- package/dist/packages/cli/package.json.cjs.js +3 -2
- package/dist/packages/dev-utils/package.json.cjs.js +1 -1
- package/dist/plugins/auth-backend/package.json.cjs.js +1 -1
- package/dist/plugins/auth-backend-module-guest-provider/package.json.cjs.js +1 -1
- package/dist/plugins/catalog-node/package.json.cjs.js +1 -1
- package/dist/plugins/scaffolder-node/package.json.cjs.js +1 -1
- package/dist/plugins/scaffolder-node-test-utils/package.json.cjs.js +1 -1
- package/package.json +11 -10
- package/templates/{default-backend-plugin → backend-plugin}/README.md.hbs +4 -4
- package/templates/{default-backend-plugin → backend-plugin}/dev/index.ts.hbs +5 -5
- package/templates/{default-backend-plugin → backend-plugin}/package.json.hbs +1 -9
- package/templates/backend-plugin/portable-template.yaml +5 -0
- package/templates/{default-backend-plugin → backend-plugin}/src/plugin.test.ts.hbs +5 -5
- package/templates/{default-backend-plugin → backend-plugin}/src/plugin.ts.hbs +1 -1
- package/templates/{default-backend-module → backend-plugin-module}/README.md.hbs +1 -1
- package/templates/{default-backend-module → backend-plugin-module}/package.json.hbs +1 -9
- package/templates/backend-plugin-module/portable-template.yaml +5 -0
- package/templates/{default-plugin → frontend-plugin}/README.md.hbs +3 -3
- package/templates/{default-plugin → frontend-plugin}/dev/index.tsx.hbs +1 -1
- package/templates/{default-plugin → frontend-plugin}/package.json.hbs +1 -9
- package/templates/frontend-plugin/portable-template.yaml +6 -0
- package/templates/{default-plugin → frontend-plugin}/src/components/ExampleComponent/ExampleComponent.test.tsx.hbs +1 -1
- package/templates/{default-plugin → frontend-plugin}/src/components/ExampleComponent/ExampleComponent.tsx.hbs +1 -1
- package/templates/{default-plugin → frontend-plugin}/src/plugin.test.ts.hbs +1 -1
- package/templates/{default-plugin → frontend-plugin}/src/plugin.ts.hbs +1 -1
- package/templates/{default-plugin → frontend-plugin}/src/routes.ts.hbs +1 -1
- package/templates/{node-library-package → node-library}/README.md.hbs +2 -2
- package/templates/{node-library-package → node-library}/package.json.hbs +1 -9
- package/templates/node-library/portable-template.yaml +3 -0
- package/templates/plugin-common-library/README.md.hbs +5 -0
- package/templates/{default-common-plugin-package → plugin-common-library}/package.json.hbs +2 -10
- package/templates/plugin-common-library/portable-template.yaml +3 -0
- package/templates/{default-common-plugin-package → plugin-common-library}/src/index.ts.hbs +1 -1
- package/templates/plugin-node-library/README.md.hbs +5 -0
- package/templates/{default-node-plugin-package → plugin-node-library}/package.json.hbs +2 -10
- package/templates/plugin-node-library/portable-template.yaml +3 -0
- package/templates/{default-node-plugin-package → plugin-node-library}/src/index.ts.hbs +1 -1
- package/templates/plugin-web-library/README.md.hbs +5 -0
- package/templates/{default-react-plugin-package → plugin-web-library}/package.json.hbs +2 -10
- package/templates/plugin-web-library/portable-template.yaml +3 -0
- package/templates/{default-react-plugin-package → plugin-web-library}/src/index.ts.hbs +1 -1
- package/templates/scaffolder-backend-module/README.md.hbs +5 -0
- package/templates/{scaffolder-module → scaffolder-backend-module}/package.json.hbs +2 -10
- package/templates/scaffolder-backend-module/portable-template.yaml +6 -0
- package/templates/{scaffolder-module → scaffolder-backend-module}/src/index.ts.hbs +1 -1
- package/templates/{web-library-package → web-library}/README.md.hbs +2 -2
- package/templates/{web-library-package → web-library}/package.json.hbs +1 -9
- package/templates/web-library/portable-template.yaml +3 -0
- package/dist/lib/new/FactoryRegistry.cjs.js +0 -96
- package/dist/lib/new/factories/backendModule.cjs.js +0 -82
- package/dist/lib/new/factories/backendPlugin.cjs.js +0 -78
- package/dist/lib/new/factories/common/prompts.cjs.js +0 -57
- package/dist/lib/new/factories/common/tasks.cjs.js +0 -66
- package/dist/lib/new/factories/common/util.cjs.js +0 -16
- package/dist/lib/new/factories/frontendPlugin.cjs.js +0 -107
- package/dist/lib/new/factories/index.cjs.js +0 -24
- package/dist/lib/new/factories/nodeLibraryPackage.cjs.js +0 -57
- package/dist/lib/new/factories/pluginCommon.cjs.js +0 -58
- package/dist/lib/new/factories/pluginNode.cjs.js +0 -58
- package/dist/lib/new/factories/pluginWeb.cjs.js +0 -58
- package/dist/lib/new/factories/scaffolderModule.cjs.js +0 -90
- package/dist/lib/new/factories/webLibraryPackage.cjs.js +0 -57
- package/templates/default-backend-module/tsconfig.json +0 -9
- package/templates/default-backend-plugin/tsconfig.json +0 -13
- package/templates/default-common-plugin-package/README.md.hbs +0 -5
- package/templates/default-common-plugin-package/tsconfig.json +0 -9
- package/templates/default-node-plugin-package/README.md.hbs +0 -5
- package/templates/default-node-plugin-package/tsconfig.json +0 -9
- package/templates/default-plugin/tsconfig.json +0 -12
- package/templates/default-react-plugin-package/README.md.hbs +0 -5
- package/templates/default-react-plugin-package/tsconfig.json +0 -11
- package/templates/node-library-package/tsconfig.json +0 -11
- package/templates/scaffolder-module/README.md.hbs +0 -5
- package/templates/scaffolder-module/tsconfig.json +0 -9
- package/templates/web-library-package/tsconfig.json +0 -11
- /package/templates/{default-backend-plugin → backend-plugin}/.eslintrc.js.hbs +0 -0
- /package/templates/{default-backend-plugin → backend-plugin}/src/index.ts.hbs +0 -0
- /package/templates/{default-backend-plugin → backend-plugin}/src/router.test.ts +0 -0
- /package/templates/{default-backend-plugin → backend-plugin}/src/router.ts +0 -0
- /package/templates/{default-backend-plugin → backend-plugin}/src/services/TodoListService/createTodoListService.ts +0 -0
- /package/templates/{default-backend-plugin → backend-plugin}/src/services/TodoListService/index.ts +0 -0
- /package/templates/{default-backend-plugin → backend-plugin}/src/services/TodoListService/types.ts +0 -0
- /package/templates/{default-backend-plugin → backend-plugin}/src/setupTests.ts +0 -0
- /package/templates/{default-backend-module → backend-plugin-module}/.eslintrc.js.hbs +0 -0
- /package/templates/{default-backend-module → backend-plugin-module}/src/index.ts.hbs +0 -0
- /package/templates/{default-backend-module → backend-plugin-module}/src/module.ts.hbs +0 -0
- /package/templates/{default-common-plugin-package → frontend-plugin}/.eslintrc.js.hbs +0 -0
- /package/templates/{default-plugin → frontend-plugin}/src/components/ExampleComponent/index.ts +0 -0
- /package/templates/{default-plugin → frontend-plugin}/src/components/ExampleFetchComponent/ExampleFetchComponent.test.tsx.hbs +0 -0
- /package/templates/{default-plugin → frontend-plugin}/src/components/ExampleFetchComponent/ExampleFetchComponent.tsx.hbs +0 -0
- /package/templates/{default-plugin → frontend-plugin}/src/components/ExampleFetchComponent/index.ts +0 -0
- /package/templates/{default-plugin → frontend-plugin}/src/index.ts.hbs +0 -0
- /package/templates/{default-plugin → frontend-plugin}/src/setupTests.ts +0 -0
- /package/templates/{default-node-plugin-package → node-library}/.eslintrc.js.hbs +0 -0
- /package/templates/{node-library-package → node-library}/src/index.ts.hbs +0 -0
- /package/templates/{default-common-plugin-package → node-library}/src/setupTests.ts +0 -0
- /package/templates/{default-plugin → plugin-common-library}/.eslintrc.js.hbs +0 -0
- /package/templates/{default-node-plugin-package → plugin-common-library}/src/setupTests.ts +0 -0
- /package/templates/{default-react-plugin-package → plugin-node-library}/.eslintrc.js.hbs +0 -0
- /package/templates/{node-library-package → plugin-node-library}/src/setupTests.ts +0 -0
- /package/templates/{node-library-package → plugin-web-library}/.eslintrc.js.hbs +0 -0
- /package/templates/{default-react-plugin-package → plugin-web-library}/src/components/ExampleComponent/ExampleComponent.test.tsx +0 -0
- /package/templates/{default-react-plugin-package → plugin-web-library}/src/components/ExampleComponent/ExampleComponent.tsx +0 -0
- /package/templates/{default-react-plugin-package → plugin-web-library}/src/components/ExampleComponent/index.ts +0 -0
- /package/templates/{default-react-plugin-package → plugin-web-library}/src/components/index.ts +0 -0
- /package/templates/{default-react-plugin-package → plugin-web-library}/src/hooks/index.ts +0 -0
- /package/templates/{default-react-plugin-package → plugin-web-library}/src/hooks/useExample/index.ts +0 -0
- /package/templates/{default-react-plugin-package → plugin-web-library}/src/hooks/useExample/useExample.ts +0 -0
- /package/templates/{default-react-plugin-package → plugin-web-library}/src/setupTests.ts +0 -0
- /package/templates/{scaffolder-module → scaffolder-backend-module}/.eslintrc.js.hbs +0 -0
- /package/templates/{scaffolder-module → scaffolder-backend-module}/src/actions/example.test.ts +0 -0
- /package/templates/{scaffolder-module → scaffolder-backend-module}/src/actions/example.ts +0 -0
- /package/templates/{scaffolder-module → scaffolder-backend-module}/src/module.ts +0 -0
- /package/templates/{web-library-package → web-library}/.eslintrc.js.hbs +0 -0
- /package/templates/{web-library-package → web-library}/src/index.ts.hbs +0 -0
- /package/templates/{web-library-package → web-library}/src/setupTests.ts +0 -0
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chalk = require('chalk');
|
|
4
|
-
var paths = require('../../paths.cjs.js');
|
|
5
|
-
var codeowners = require('../../codeowners/codeowners.cjs.js');
|
|
6
|
-
var types = require('../types.cjs.js');
|
|
7
|
-
var tasks = require('../../tasks.cjs.js');
|
|
8
|
-
var prompts = require('./common/prompts.cjs.js');
|
|
9
|
-
var tasks$1 = require('./common/tasks.cjs.js');
|
|
10
|
-
var util = require('./common/util.cjs.js');
|
|
11
|
-
|
|
12
|
-
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
13
|
-
|
|
14
|
-
var chalk__default = /*#__PURE__*/_interopDefaultCompat(chalk);
|
|
15
|
-
|
|
16
|
-
const pluginNode = types.createFactory({
|
|
17
|
-
name: "plugin-node",
|
|
18
|
-
description: "A new Node.js library plugin package",
|
|
19
|
-
optionsDiscovery: async () => ({
|
|
20
|
-
codeOwnersPath: await codeowners.getCodeownersFilePath(paths.paths.targetRoot)
|
|
21
|
-
}),
|
|
22
|
-
optionsPrompts: [prompts.pluginIdPrompt(), prompts.ownerPrompt()],
|
|
23
|
-
async create(options, ctx) {
|
|
24
|
-
const { id } = options;
|
|
25
|
-
const suffix = `${id}-node`;
|
|
26
|
-
const name = util.resolvePackageName({
|
|
27
|
-
baseName: suffix,
|
|
28
|
-
scope: ctx.scope,
|
|
29
|
-
plugin: true
|
|
30
|
-
});
|
|
31
|
-
tasks.Task.log();
|
|
32
|
-
tasks.Task.log(`Creating Node.js plugin library ${chalk__default.default.cyan(name)}`);
|
|
33
|
-
const targetDir = ctx.isMonoRepo ? paths.paths.resolveTargetRoot("plugins", suffix) : paths.paths.resolveTargetRoot(`backstage-plugin-${suffix}`);
|
|
34
|
-
await tasks$1.executePluginPackageTemplate(ctx, {
|
|
35
|
-
targetDir,
|
|
36
|
-
templateName: "default-node-plugin-package",
|
|
37
|
-
values: {
|
|
38
|
-
id,
|
|
39
|
-
name,
|
|
40
|
-
privatePackage: ctx.private,
|
|
41
|
-
npmRegistry: ctx.npmRegistry,
|
|
42
|
-
pluginVersion: ctx.defaultVersion,
|
|
43
|
-
license: ctx.license
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
if (options.owner) {
|
|
47
|
-
await codeowners.addCodeownersEntry(`/plugins/${suffix}`, options.owner);
|
|
48
|
-
}
|
|
49
|
-
await tasks.Task.forCommand("yarn install", { cwd: targetDir, optional: true });
|
|
50
|
-
await tasks.Task.forCommand("yarn lint --fix", {
|
|
51
|
-
cwd: targetDir,
|
|
52
|
-
optional: true
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
exports.pluginNode = pluginNode;
|
|
58
|
-
//# sourceMappingURL=pluginNode.cjs.js.map
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chalk = require('chalk');
|
|
4
|
-
var paths = require('../../paths.cjs.js');
|
|
5
|
-
var codeowners = require('../../codeowners/codeowners.cjs.js');
|
|
6
|
-
var types = require('../types.cjs.js');
|
|
7
|
-
var tasks = require('../../tasks.cjs.js');
|
|
8
|
-
var prompts = require('./common/prompts.cjs.js');
|
|
9
|
-
var tasks$1 = require('./common/tasks.cjs.js');
|
|
10
|
-
var util = require('./common/util.cjs.js');
|
|
11
|
-
|
|
12
|
-
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
13
|
-
|
|
14
|
-
var chalk__default = /*#__PURE__*/_interopDefaultCompat(chalk);
|
|
15
|
-
|
|
16
|
-
const pluginWeb = types.createFactory({
|
|
17
|
-
name: "plugin-react",
|
|
18
|
-
description: "A new web library plugin package",
|
|
19
|
-
optionsDiscovery: async () => ({
|
|
20
|
-
codeOwnersPath: await codeowners.getCodeownersFilePath(paths.paths.targetRoot)
|
|
21
|
-
}),
|
|
22
|
-
optionsPrompts: [prompts.pluginIdPrompt(), prompts.ownerPrompt()],
|
|
23
|
-
async create(options, ctx) {
|
|
24
|
-
const { id } = options;
|
|
25
|
-
const suffix = `${id}-react`;
|
|
26
|
-
const name = util.resolvePackageName({
|
|
27
|
-
baseName: suffix,
|
|
28
|
-
scope: ctx.scope,
|
|
29
|
-
plugin: true
|
|
30
|
-
});
|
|
31
|
-
tasks.Task.log();
|
|
32
|
-
tasks.Task.log(`Creating web plugin library ${chalk__default.default.cyan(name)}`);
|
|
33
|
-
const targetDir = ctx.isMonoRepo ? paths.paths.resolveTargetRoot("plugins", suffix) : paths.paths.resolveTargetRoot(`backstage-plugin-${suffix}`);
|
|
34
|
-
await tasks$1.executePluginPackageTemplate(ctx, {
|
|
35
|
-
targetDir,
|
|
36
|
-
templateName: "default-react-plugin-package",
|
|
37
|
-
values: {
|
|
38
|
-
id,
|
|
39
|
-
name,
|
|
40
|
-
privatePackage: ctx.private,
|
|
41
|
-
npmRegistry: ctx.npmRegistry,
|
|
42
|
-
pluginVersion: ctx.defaultVersion,
|
|
43
|
-
license: ctx.license
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
if (options.owner) {
|
|
47
|
-
await codeowners.addCodeownersEntry(`/plugins/${suffix}`, options.owner);
|
|
48
|
-
}
|
|
49
|
-
await tasks.Task.forCommand("yarn install", { cwd: targetDir, optional: true });
|
|
50
|
-
await tasks.Task.forCommand("yarn lint --fix", {
|
|
51
|
-
cwd: targetDir,
|
|
52
|
-
optional: true
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
exports.pluginWeb = pluginWeb;
|
|
58
|
-
//# sourceMappingURL=pluginWeb.cjs.js.map
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var fs = require('fs-extra');
|
|
4
|
-
var chalk = require('chalk');
|
|
5
|
-
var paths = require('../../paths.cjs.js');
|
|
6
|
-
var codeowners = require('../../codeowners/codeowners.cjs.js');
|
|
7
|
-
var types = require('../types.cjs.js');
|
|
8
|
-
var tasks = require('../../tasks.cjs.js');
|
|
9
|
-
var prompts = require('./common/prompts.cjs.js');
|
|
10
|
-
var tasks$1 = require('./common/tasks.cjs.js');
|
|
11
|
-
var util = require('./common/util.cjs.js');
|
|
12
|
-
|
|
13
|
-
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
14
|
-
|
|
15
|
-
var fs__default = /*#__PURE__*/_interopDefaultCompat(fs);
|
|
16
|
-
var chalk__default = /*#__PURE__*/_interopDefaultCompat(chalk);
|
|
17
|
-
|
|
18
|
-
const scaffolderModule = types.createFactory({
|
|
19
|
-
name: "scaffolder-module",
|
|
20
|
-
description: "An module exporting custom actions for @backstage/plugin-scaffolder-backend",
|
|
21
|
-
optionsDiscovery: async () => ({
|
|
22
|
-
codeOwnersPath: await codeowners.getCodeownersFilePath(paths.paths.targetRoot)
|
|
23
|
-
}),
|
|
24
|
-
optionsPrompts: [
|
|
25
|
-
{
|
|
26
|
-
type: "input",
|
|
27
|
-
name: "id",
|
|
28
|
-
message: "Enter the name of the module [required]",
|
|
29
|
-
validate: (value) => {
|
|
30
|
-
if (!value) {
|
|
31
|
-
return "Please enter the name of the module";
|
|
32
|
-
} else if (!/^[a-z0-9]+(-[a-z0-9]+)*$/.test(value)) {
|
|
33
|
-
return "Module names must be lowercase and contain only letters, digits, and dashes.";
|
|
34
|
-
}
|
|
35
|
-
return true;
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
prompts.ownerPrompt()
|
|
39
|
-
],
|
|
40
|
-
async create(options, ctx) {
|
|
41
|
-
const { id } = options;
|
|
42
|
-
const slug = `scaffolder-backend-module-${id}`;
|
|
43
|
-
const name = util.resolvePackageName({
|
|
44
|
-
baseName: slug,
|
|
45
|
-
scope: ctx.scope,
|
|
46
|
-
plugin: true
|
|
47
|
-
});
|
|
48
|
-
tasks.Task.log();
|
|
49
|
-
tasks.Task.log(`Creating module ${chalk__default.default.cyan(name)}`);
|
|
50
|
-
const targetDir = ctx.isMonoRepo ? paths.paths.resolveTargetRoot("plugins", slug) : paths.paths.resolveTargetRoot(`backstage-plugin-${slug}`);
|
|
51
|
-
await tasks$1.executePluginPackageTemplate(ctx, {
|
|
52
|
-
targetDir,
|
|
53
|
-
templateName: "scaffolder-module",
|
|
54
|
-
values: {
|
|
55
|
-
id,
|
|
56
|
-
name,
|
|
57
|
-
privatePackage: ctx.private,
|
|
58
|
-
npmRegistry: ctx.npmRegistry,
|
|
59
|
-
pluginVersion: ctx.defaultVersion,
|
|
60
|
-
license: ctx.license
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
if (await fs__default.default.pathExists(paths.paths.resolveTargetRoot("packages/backend"))) {
|
|
64
|
-
await tasks.Task.forItem("backend", "adding dependency", async () => {
|
|
65
|
-
await tasks.addPackageDependency(
|
|
66
|
-
paths.paths.resolveTargetRoot("packages/backend/package.json"),
|
|
67
|
-
{
|
|
68
|
-
dependencies: {
|
|
69
|
-
[name]: `^${ctx.defaultVersion}`
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
);
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
await tasks.addToBackend(name, {
|
|
76
|
-
type: "module"
|
|
77
|
-
});
|
|
78
|
-
if (options.owner) {
|
|
79
|
-
await codeowners.addCodeownersEntry(`/plugins/${slug}`, options.owner);
|
|
80
|
-
}
|
|
81
|
-
await tasks.Task.forCommand("yarn install", { cwd: targetDir, optional: true });
|
|
82
|
-
await tasks.Task.forCommand("yarn lint --fix", {
|
|
83
|
-
cwd: targetDir,
|
|
84
|
-
optional: true
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
exports.scaffolderModule = scaffolderModule;
|
|
90
|
-
//# sourceMappingURL=scaffolderModule.cjs.js.map
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chalk = require('chalk');
|
|
4
|
-
var paths = require('../../paths.cjs.js');
|
|
5
|
-
var codeowners = require('../../codeowners/codeowners.cjs.js');
|
|
6
|
-
var types = require('../types.cjs.js');
|
|
7
|
-
var tasks = require('../../tasks.cjs.js');
|
|
8
|
-
var prompts = require('./common/prompts.cjs.js');
|
|
9
|
-
var tasks$1 = require('./common/tasks.cjs.js');
|
|
10
|
-
var util = require('./common/util.cjs.js');
|
|
11
|
-
|
|
12
|
-
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
13
|
-
|
|
14
|
-
var chalk__default = /*#__PURE__*/_interopDefaultCompat(chalk);
|
|
15
|
-
|
|
16
|
-
const webLibraryPackage = types.createFactory({
|
|
17
|
-
name: "web-library",
|
|
18
|
-
description: "A new web-library package, exporting shared functionality for frontend plugins",
|
|
19
|
-
optionsDiscovery: async () => ({
|
|
20
|
-
codeOwnersPath: await codeowners.getCodeownersFilePath(paths.paths.targetRoot)
|
|
21
|
-
}),
|
|
22
|
-
optionsPrompts: [prompts.pluginIdPrompt(), prompts.ownerPrompt()],
|
|
23
|
-
async create(options, ctx) {
|
|
24
|
-
const { id } = options;
|
|
25
|
-
const name = util.resolvePackageName({
|
|
26
|
-
baseName: id,
|
|
27
|
-
scope: ctx.scope,
|
|
28
|
-
plugin: false
|
|
29
|
-
});
|
|
30
|
-
tasks.Task.log();
|
|
31
|
-
tasks.Task.log(`Creating web-library package ${chalk__default.default.cyan(name)}`);
|
|
32
|
-
const targetDir = ctx.isMonoRepo ? paths.paths.resolveTargetRoot("packages", id) : paths.paths.resolveTargetRoot(`${id}`);
|
|
33
|
-
await tasks$1.executePluginPackageTemplate(ctx, {
|
|
34
|
-
targetDir,
|
|
35
|
-
templateName: "web-library-package",
|
|
36
|
-
values: {
|
|
37
|
-
id,
|
|
38
|
-
name,
|
|
39
|
-
pluginVersion: ctx.defaultVersion,
|
|
40
|
-
privatePackage: ctx.private,
|
|
41
|
-
npmRegistry: ctx.npmRegistry,
|
|
42
|
-
license: ctx.license
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
if (options.owner) {
|
|
46
|
-
await codeowners.addCodeownersEntry(`/packages/${id}`, options.owner);
|
|
47
|
-
}
|
|
48
|
-
await tasks.Task.forCommand("yarn install", { cwd: targetDir, optional: true });
|
|
49
|
-
await tasks.Task.forCommand("yarn lint --fix", {
|
|
50
|
-
cwd: targetDir,
|
|
51
|
-
optional: true
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
exports.webLibraryPackage = webLibraryPackage;
|
|
57
|
-
//# sourceMappingURL=webLibraryPackage.cjs.js.map
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/templates/{default-backend-plugin → backend-plugin}/src/services/TodoListService/index.ts
RENAMED
|
File without changes
|
/package/templates/{default-backend-plugin → backend-plugin}/src/services/TodoListService/types.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/templates/{default-plugin → frontend-plugin}/src/components/ExampleComponent/index.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/templates/{default-plugin → frontend-plugin}/src/components/ExampleFetchComponent/index.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/templates/{default-react-plugin-package → plugin-web-library}/src/components/index.ts
RENAMED
|
File without changes
|
|
File without changes
|
/package/templates/{default-react-plugin-package → plugin-web-library}/src/hooks/useExample/index.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/templates/{scaffolder-module → scaffolder-backend-module}/src/actions/example.test.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|