@backstage/cli 0.10.0 → 0.10.1
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 +13 -0
- package/dist/cjs/{Lockfile-80f0eec4.cjs.js → Lockfile-35661afa.cjs.js} +18 -18
- package/dist/cjs/{build-555a7349.cjs.js → build-4c85e374.cjs.js} +9 -9
- package/dist/cjs/{build-be463597.cjs.js → build-574ad84f.cjs.js} +21 -21
- package/dist/cjs/{build-8652aa69.cjs.js → build-c587cc8c.cjs.js} +8 -7
- package/dist/cjs/{build-b5fb2b35.cjs.js → build-dc2484e7.cjs.js} +8 -7
- package/dist/cjs/{buildWorkspace-79c93924.cjs.js → buildWorkspace-29b42a0b.cjs.js} +6 -6
- package/dist/cjs/{bump-53a961f8.cjs.js → bump-24057de2.cjs.js} +36 -36
- package/dist/cjs/{bundle-64a797f5.cjs.js → bundle-854deefb.cjs.js} +15 -15
- package/dist/cjs/{clean-a28705b5.cjs.js → clean-ecf90e6b.cjs.js} +6 -6
- package/dist/cjs/{config-3816244a.cjs.js → config-91083c1e.cjs.js} +7 -7
- package/dist/cjs/{create-d5e65154.cjs.js → create-89dd36f0.cjs.js} +41 -41
- package/dist/cjs/{createPlugin-77a95bbd.cjs.js → createPlugin-a8527ca3.cjs.js} +31 -31
- package/dist/cjs/{dev-3b68b882.cjs.js → dev-3713f802.cjs.js} +8 -8
- package/dist/cjs/{diff-7238cc6c.cjs.js → diff-79e33159.cjs.js} +39 -32
- package/dist/cjs/{docs-f46d6945.cjs.js → docs-a8506fde.cjs.js} +6 -6
- package/dist/cjs/{index-05328067.cjs.js → index-33d9cbba.cjs.js} +15 -15
- package/dist/cjs/{index-c8a3517a.cjs.js → index-9cf6e421.cjs.js} +14 -14
- package/dist/cjs/{index-8a512334.cjs.js → index-b2152549.cjs.js} +61 -62
- package/dist/cjs/{info-a069f3b4.cjs.js → info-d8ce894c.cjs.js} +6 -6
- package/dist/cjs/{install-43a8076b.cjs.js → install-9e5b8576.cjs.js} +23 -23
- package/dist/cjs/{lint-60658813.cjs.js → lint-955bc62d.cjs.js} +4 -4
- package/dist/cjs/{lint-0053aded.cjs.js → lint-a78b8bb6.cjs.js} +7 -7
- package/dist/cjs/{pack-a4246579.cjs.js → pack-f474f79b.cjs.js} +6 -6
- package/dist/cjs/{packager-b1a183ad.cjs.js → packager-6c80f203.cjs.js} +37 -35
- package/dist/cjs/{packages-562fcd14.cjs.js → packages-bcde9079.cjs.js} +5 -5
- package/dist/cjs/{paths-f77bdf66.cjs.js → paths-f9c22b94.cjs.js} +35 -35
- package/dist/cjs/{print-db876002.cjs.js → print-5e70799c.cjs.js} +5 -5
- package/dist/cjs/{removePlugin-1379b63a.cjs.js → removePlugin-891ec166.cjs.js} +30 -30
- package/dist/cjs/{run-bacdaaf1.cjs.js → run-8388d249.cjs.js} +5 -5
- package/dist/cjs/{schema-3fe57ce7.cjs.js → schema-80516b43.cjs.js} +5 -5
- package/dist/cjs/{serve-e89d4ea4.cjs.js → serve-1b0ace54.cjs.js} +15 -15
- package/dist/cjs/{serve-a9cf4184.cjs.js → serve-6c335165.cjs.js} +9 -9
- package/dist/cjs/{server-4f0e40d3.cjs.js → server-b2f87b69.cjs.js} +6 -6
- package/dist/cjs/{svgrTemplate-2d0d15cf.cjs.js → svgrTemplate-f19e974c.cjs.js} +3 -3
- package/dist/cjs/{tasks-29b7d09e.cjs.js → tasks-f12b95ba.cjs.js} +29 -29
- package/dist/cjs/{testCommand-5602a58f.cjs.js → testCommand-1c515cf7.cjs.js} +4 -4
- package/dist/cjs/{validate-9b1a5456.cjs.js → validate-9907afbb.cjs.js} +4 -4
- package/dist/index.cjs.js +1 -1
- package/package.json +14 -15
- package/templates/default-plugin/package.json.hbs +3 -2
|
@@ -29,13 +29,13 @@ class ExitCodeError extends CustomError {
|
|
|
29
29
|
function exitWithError(error) {
|
|
30
30
|
if (error instanceof ExitCodeError) {
|
|
31
31
|
process.stderr.write(`
|
|
32
|
-
${chalk__default[
|
|
32
|
+
${chalk__default["default"].red(error.message)}
|
|
33
33
|
|
|
34
34
|
`);
|
|
35
35
|
process.exit(error.code);
|
|
36
36
|
} else {
|
|
37
37
|
process.stderr.write(`
|
|
38
|
-
${chalk__default[
|
|
38
|
+
${chalk__default["default"].red(`${error}`)}
|
|
39
39
|
|
|
40
40
|
`);
|
|
41
41
|
process.exit(1);
|
|
@@ -46,9 +46,9 @@ class NotFoundError extends CustomError {
|
|
|
46
46
|
|
|
47
47
|
const paths = cliCommon.findPaths(__dirname);
|
|
48
48
|
|
|
49
|
-
var version$9 = "0.9.
|
|
49
|
+
var version$9 = "0.9.13";
|
|
50
50
|
|
|
51
|
-
var version$8 = "0.10.
|
|
51
|
+
var version$8 = "0.10.1";
|
|
52
52
|
var dependencies = {
|
|
53
53
|
"@backstage/cli-common": "^0.1.6",
|
|
54
54
|
"@backstage/config": "^0.1.11",
|
|
@@ -60,9 +60,9 @@ var dependencies = {
|
|
|
60
60
|
"@lerna/project": "^4.0.0",
|
|
61
61
|
"@octokit/request": "^5.4.12",
|
|
62
62
|
"@rollup/plugin-commonjs": "^21.0.1",
|
|
63
|
-
"@rollup/plugin-json": "^4.0
|
|
63
|
+
"@rollup/plugin-json": "^4.1.0",
|
|
64
64
|
"@rollup/plugin-node-resolve": "^13.0.0",
|
|
65
|
-
"@rollup/plugin-yaml": "^3.
|
|
65
|
+
"@rollup/plugin-yaml": "^3.1.0",
|
|
66
66
|
"@spotify/eslint-config-base": "^12.0.0",
|
|
67
67
|
"@spotify/eslint-config-react": "^12.0.0",
|
|
68
68
|
"@spotify/eslint-config-typescript": "^12.0.0",
|
|
@@ -84,7 +84,7 @@ var dependencies = {
|
|
|
84
84
|
"css-loader": "^5.2.6",
|
|
85
85
|
dashify: "^2.0.0",
|
|
86
86
|
diff: "^5.0.0",
|
|
87
|
-
esbuild: "^0.
|
|
87
|
+
esbuild: "^0.14.1",
|
|
88
88
|
eslint: "^7.30.0",
|
|
89
89
|
"eslint-config-prettier": "^8.3.0",
|
|
90
90
|
"eslint-formatter-friendly": "^7.0.0",
|
|
@@ -111,14 +111,13 @@ var dependencies = {
|
|
|
111
111
|
ora: "^5.3.0",
|
|
112
112
|
postcss: "^8.1.0",
|
|
113
113
|
process: "^0.11.10",
|
|
114
|
-
react: "^16.0.0",
|
|
115
114
|
"react-dev-utils": "^12.0.0-next.47",
|
|
116
115
|
"react-hot-loader": "^4.12.21",
|
|
117
116
|
"recursive-readdir": "^2.2.2",
|
|
118
117
|
"replace-in-file": "^6.0.0",
|
|
119
|
-
rollup: "2.
|
|
120
|
-
"rollup-plugin-dts": "^
|
|
121
|
-
"rollup-plugin-esbuild": "
|
|
118
|
+
rollup: "^2.60.2",
|
|
119
|
+
"rollup-plugin-dts": "^4.0.1",
|
|
120
|
+
"rollup-plugin-esbuild": "^4.7.2",
|
|
122
121
|
"rollup-plugin-peer-deps-external": "^2.2.2",
|
|
123
122
|
"rollup-plugin-postcss": "^4.0.0",
|
|
124
123
|
"rollup-pluginutils": "^2.8.2",
|
|
@@ -139,13 +138,13 @@ var dependencies = {
|
|
|
139
138
|
yn: "^4.0.0"
|
|
140
139
|
};
|
|
141
140
|
var devDependencies = {
|
|
142
|
-
"@backstage/backend-common": "^0.9.
|
|
141
|
+
"@backstage/backend-common": "^0.9.13",
|
|
143
142
|
"@backstage/config": "^0.1.11",
|
|
144
|
-
"@backstage/core-components": "^0.
|
|
145
|
-
"@backstage/core-plugin-api": "^0.
|
|
146
|
-
"@backstage/core-app-api": "^0.
|
|
147
|
-
"@backstage/dev-utils": "^0.2.
|
|
148
|
-
"@backstage/test-utils": "^0.1.
|
|
143
|
+
"@backstage/core-components": "^0.8.0",
|
|
144
|
+
"@backstage/core-plugin-api": "^0.3.0",
|
|
145
|
+
"@backstage/core-app-api": "^0.2.0",
|
|
146
|
+
"@backstage/dev-utils": "^0.2.14",
|
|
147
|
+
"@backstage/test-utils": "^0.1.24",
|
|
149
148
|
"@backstage/theme": "^0.2.14",
|
|
150
149
|
"@types/diff": "^5.0.0",
|
|
151
150
|
"@types/express": "^4.17.6",
|
|
@@ -168,19 +167,19 @@ var devDependencies = {
|
|
|
168
167
|
"ts-node": "^10.0.0"
|
|
169
168
|
};
|
|
170
169
|
|
|
171
|
-
var version$7 = "0.
|
|
170
|
+
var version$7 = "0.2.0";
|
|
172
171
|
|
|
173
|
-
var version$6 = "0.
|
|
172
|
+
var version$6 = "0.8.0";
|
|
174
173
|
|
|
175
|
-
var version$5 = "0.
|
|
174
|
+
var version$5 = "0.3.0";
|
|
176
175
|
|
|
177
|
-
var version$4 = "0.2.
|
|
176
|
+
var version$4 = "0.2.14";
|
|
178
177
|
|
|
179
|
-
var version$3 = "0.1.
|
|
178
|
+
var version$3 = "0.1.24";
|
|
180
179
|
|
|
181
180
|
var version$2 = "0.2.14";
|
|
182
181
|
|
|
183
|
-
var version$1 = "0.15.
|
|
182
|
+
var version$1 = "0.15.16";
|
|
184
183
|
|
|
185
184
|
const packageVersions = {
|
|
186
185
|
"@backstage/backend-common": version$9,
|
|
@@ -195,11 +194,11 @@ const packageVersions = {
|
|
|
195
194
|
"@backstage/plugin-scaffolder-backend": version$1
|
|
196
195
|
};
|
|
197
196
|
function findVersion() {
|
|
198
|
-
const pkgContent = fs__default[
|
|
197
|
+
const pkgContent = fs__default["default"].readFileSync(paths.resolveOwn("package.json"), "utf8");
|
|
199
198
|
return JSON.parse(pkgContent).version;
|
|
200
199
|
}
|
|
201
200
|
const version = findVersion();
|
|
202
|
-
fs__default[
|
|
201
|
+
fs__default["default"].pathExistsSync(paths.resolveOwn("src"));
|
|
203
202
|
function createPackageVersionProvider(lockfile) {
|
|
204
203
|
return (name, versionHint) => {
|
|
205
204
|
var _a;
|
|
@@ -212,7 +211,7 @@ function createPackageVersionProvider(lockfile) {
|
|
|
212
211
|
if (name.startsWith("@types/") && (lockfileEntries == null ? void 0 : lockfileEntries.some((entry) => entry.range === "*"))) {
|
|
213
212
|
return "*";
|
|
214
213
|
}
|
|
215
|
-
const validRanges = lockfileEntries == null ? void 0 : lockfileEntries.filter((entry) => semver__default[
|
|
214
|
+
const validRanges = lockfileEntries == null ? void 0 : lockfileEntries.filter((entry) => semver__default["default"].satisfies(targetVersion, entry.range));
|
|
216
215
|
const highestRange = validRanges == null ? void 0 : validRanges.slice(-1)[0];
|
|
217
216
|
if (highestRange == null ? void 0 : highestRange.range) {
|
|
218
217
|
return highestRange == null ? void 0 : highestRange.range;
|
|
@@ -220,10 +219,10 @@ function createPackageVersionProvider(lockfile) {
|
|
|
220
219
|
if (packageVersion) {
|
|
221
220
|
return `^${packageVersion}`;
|
|
222
221
|
}
|
|
223
|
-
if ((_a = semver__default[
|
|
222
|
+
if ((_a = semver__default["default"].parse(versionHint)) == null ? void 0 : _a.prerelease.length) {
|
|
224
223
|
return versionHint;
|
|
225
224
|
}
|
|
226
|
-
return `^${versionHint}
|
|
225
|
+
return (versionHint == null ? void 0 : versionHint.match(/^[\d\.]+$/)) ? `^${versionHint}` : versionHint;
|
|
227
226
|
};
|
|
228
227
|
}
|
|
229
228
|
|
|
@@ -234,33 +233,33 @@ function registerCommands(program) {
|
|
|
234
233
|
(opt, opts) => [...opts, opt],
|
|
235
234
|
Array()
|
|
236
235
|
];
|
|
237
|
-
program.command("app:build").description("Build an app for a production release").option("--stats", "Write bundle stats to output directory").option("--lax", "[DEPRECATED] - Do not require environment variables to be set").option(...configOption).action(lazy(() => Promise.resolve().then(function () { return require('./build-
|
|
238
|
-
program.command("app:serve").description("Serve an app for local development").option("--check", "Enable type checking and linting").option(...configOption).action(lazy(() => Promise.resolve().then(function () { return require('./serve-
|
|
239
|
-
program.command("backend:build").description("Build a backend plugin").action(lazy(() => Promise.resolve().then(function () { return require('./build-
|
|
240
|
-
program.command("backend:bundle").description("Bundle the backend into a deployment archive").option("--build-dependencies", "Build all local package dependencies before bundling the backend").action(lazy(() => Promise.resolve().then(function () { return require('./bundle-
|
|
241
|
-
program.command("backend:dev").description("Start local development server with HMR for the backend").option("--check", "Enable type checking and linting").option("--inspect", "Enable debugger").option("--inspect-brk", "Enable debugger with await to attach debugger").option(...configOption).action(lazy(() => Promise.resolve().then(function () { return require('./dev-
|
|
242
|
-
program.command("create").storeOptionsAsProperties(false).description("Open up an interactive guide to creating new things in your app").option("--select <name>", "Select the thing you want to be creating upfront").option("--option <name>=<value>", "Pre-fill options for the creation process", (opt, arr) => [...arr, opt], []).option("--scope <scope>", "The scope to use for new packages").option("--npm-registry <URL>", "The package registry to use for new packages").option("--no-private", "Do not mark new packages as private").action(lazy(() => Promise.resolve().then(function () { return require('./create-
|
|
243
|
-
program.command("create-plugin").option("--backend", "Create plugin with the backend dependencies as default").description("Creates a new plugin in the current repository").option("--scope <scope>", "npm scope").option("--npm-registry <URL>", "npm registry URL").option("--no-private", "Public npm package").action(lazy(() => Promise.resolve().then(function () { return require('./createPlugin-
|
|
244
|
-
program.command("remove-plugin").description("[DEPRECATED] - Removes plugin in the current repository").action(lazy(() => Promise.resolve().then(function () { return require('./removePlugin-
|
|
245
|
-
program.command("plugin:build").description("Build a plugin").action(lazy(() => Promise.resolve().then(function () { return require('./build-
|
|
246
|
-
program.command("plugin:serve").description("Serves the dev/ folder of a plugin").option("--check", "Enable type checking and linting").option(...configOption).action(lazy(() => Promise.resolve().then(function () { return require('./serve-
|
|
247
|
-
program.command("plugin:diff").option("--check", "Fail if changes are required").option("--yes", "Apply all changes").description("Diff an existing plugin with the creation template").action(lazy(() => Promise.resolve().then(function () { return require('./diff-
|
|
248
|
-
program.command("build").description("Build a package for publishing").option("--outputs <formats>", "List of formats to output [types,cjs,esm]").action(lazy(() => Promise.resolve().then(function () { return require('./build-
|
|
249
|
-
program.command("lint").option("--format <format>", "Lint report output format", "eslint-formatter-friendly").option("--fix", "Attempt to automatically fix violations").description("Lint a package").action(lazy(() => Promise.resolve().then(function () { return require('./lint-
|
|
250
|
-
program.command("test").allowUnknownOption(true).helpOption(", --backstage-cli-help").description("Run tests, forwarding args to Jest, defaulting to watch mode").action(lazy(() => Promise.resolve().then(function () { return require('./testCommand-
|
|
251
|
-
program.command("config:docs").option("--package <name>", "Only include the schema that applies to the given package").description("Browse the configuration reference documentation").action(lazy(() => Promise.resolve().then(function () { return require('./docs-
|
|
252
|
-
program.command("config:print").option("--package <name>", "Only load config schema that applies to the given package").option("--lax", "Do not require environment variables to be set").option("--frontend", "Print only the frontend configuration").option("--with-secrets", "Include secrets in the printed configuration").option("--format <format>", "Format to print the configuration in, either json or yaml [yaml]").option(...configOption).description("Print the app configuration for the current package").action(lazy(() => Promise.resolve().then(function () { return require('./print-
|
|
253
|
-
program.command("config:check").option("--package <name>", "Only load config schema that applies to the given package").option("--lax", "Do not require environment variables to be set").option("--frontend", "Only validate the frontend configuration").option(...configOption).description("Validate that the given configuration loads and matches schema").action(lazy(() => Promise.resolve().then(function () { return require('./validate-
|
|
254
|
-
program.command("config:schema").option("--package <name>", "Only output config schema that applies to the given package").option("--format <format>", "Format to print the schema in, either json or yaml [yaml]").description("Print configuration schema").action(lazy(() => Promise.resolve().then(function () { return require('./schema-
|
|
255
|
-
program.command("versions:bump").description("Bump Backstage packages to the latest versions").action(lazy(() => Promise.resolve().then(function () { return require('./bump-
|
|
256
|
-
program.command("versions:check").option("--fix", "Fix any auto-fixable versioning problems").description("Check Backstage package versioning").action(lazy(() => Promise.resolve().then(function () { return require('./lint-
|
|
257
|
-
program.command("prepack").description("Prepares a package for packaging before publishing").action(lazy(() => Promise.resolve().then(function () { return require('./pack-
|
|
258
|
-
program.command("postpack").description("Restores the changes made by the prepack command").action(lazy(() => Promise.resolve().then(function () { return require('./pack-
|
|
259
|
-
program.command("clean").description("Delete cache directories").action(lazy(() => Promise.resolve().then(function () { return require('./clean-
|
|
260
|
-
program.command("build-workspace <workspace-dir> ...<packages>").description("Builds a temporary dist workspace from the provided packages").action(lazy(() => Promise.resolve().then(function () { return require('./buildWorkspace-
|
|
261
|
-
program.command("create-github-app <github-org>").description("Create new GitHub App in your organization.").action(lazy(() => Promise.resolve().then(function () { return require('./index-
|
|
262
|
-
program.command("info").description("Show helpful information for debugging and reporting bugs").action(lazy(() => Promise.resolve().then(function () { return require('./info-
|
|
263
|
-
program.command("install [plugin-id]", {hidden: true}).option("--from <packageJsonFilePath>", "Install from a local package.json containing the installation recipe").description("Install a Backstage plugin [EXPERIMENTAL]").action(lazy(() => Promise.resolve().then(function () { return require('./install-
|
|
236
|
+
program.command("app:build").description("Build an app for a production release").option("--stats", "Write bundle stats to output directory").option("--lax", "[DEPRECATED] - Do not require environment variables to be set").option(...configOption).action(lazy(() => Promise.resolve().then(function () { return require('./build-574ad84f.cjs.js'); }).then((m) => m.default)));
|
|
237
|
+
program.command("app:serve").description("Serve an app for local development").option("--check", "Enable type checking and linting").option(...configOption).action(lazy(() => Promise.resolve().then(function () { return require('./serve-1b0ace54.cjs.js'); }).then((m) => m.default)));
|
|
238
|
+
program.command("backend:build").description("Build a backend plugin").option("--minify", "Minify the generated code").action(lazy(() => Promise.resolve().then(function () { return require('./build-c587cc8c.cjs.js'); }).then((m) => m.default)));
|
|
239
|
+
program.command("backend:bundle").description("Bundle the backend into a deployment archive").option("--build-dependencies", "Build all local package dependencies before bundling the backend").action(lazy(() => Promise.resolve().then(function () { return require('./bundle-854deefb.cjs.js'); }).then((m) => m.default)));
|
|
240
|
+
program.command("backend:dev").description("Start local development server with HMR for the backend").option("--check", "Enable type checking and linting").option("--inspect", "Enable debugger").option("--inspect-brk", "Enable debugger with await to attach debugger").option(...configOption).action(lazy(() => Promise.resolve().then(function () { return require('./dev-3713f802.cjs.js'); }).then((m) => m.default)));
|
|
241
|
+
program.command("create").storeOptionsAsProperties(false).description("Open up an interactive guide to creating new things in your app").option("--select <name>", "Select the thing you want to be creating upfront").option("--option <name>=<value>", "Pre-fill options for the creation process", (opt, arr) => [...arr, opt], []).option("--scope <scope>", "The scope to use for new packages").option("--npm-registry <URL>", "The package registry to use for new packages").option("--no-private", "Do not mark new packages as private").action(lazy(() => Promise.resolve().then(function () { return require('./create-89dd36f0.cjs.js'); }).then((m) => m.default)));
|
|
242
|
+
program.command("create-plugin").option("--backend", "Create plugin with the backend dependencies as default").description("Creates a new plugin in the current repository").option("--scope <scope>", "npm scope").option("--npm-registry <URL>", "npm registry URL").option("--no-private", "Public npm package").action(lazy(() => Promise.resolve().then(function () { return require('./createPlugin-a8527ca3.cjs.js'); }).then((m) => m.default)));
|
|
243
|
+
program.command("remove-plugin").description("[DEPRECATED] - Removes plugin in the current repository").action(lazy(() => Promise.resolve().then(function () { return require('./removePlugin-891ec166.cjs.js'); }).then((m) => m.default)));
|
|
244
|
+
program.command("plugin:build").description("Build a plugin").option("--minify", "Minify the generated code").action(lazy(() => Promise.resolve().then(function () { return require('./build-dc2484e7.cjs.js'); }).then((m) => m.default)));
|
|
245
|
+
program.command("plugin:serve").description("Serves the dev/ folder of a plugin").option("--check", "Enable type checking and linting").option(...configOption).action(lazy(() => Promise.resolve().then(function () { return require('./serve-6c335165.cjs.js'); }).then((m) => m.default)));
|
|
246
|
+
program.command("plugin:diff").option("--check", "Fail if changes are required").option("--yes", "Apply all changes").description("Diff an existing plugin with the creation template").action(lazy(() => Promise.resolve().then(function () { return require('./diff-79e33159.cjs.js'); }).then((m) => m.default)));
|
|
247
|
+
program.command("build").description("Build a package for publishing").option("--outputs <formats>", "List of formats to output [types,cjs,esm]").action(lazy(() => Promise.resolve().then(function () { return require('./build-4c85e374.cjs.js'); }).then((m) => m.default)));
|
|
248
|
+
program.command("lint").option("--format <format>", "Lint report output format", "eslint-formatter-friendly").option("--fix", "Attempt to automatically fix violations").description("Lint a package").action(lazy(() => Promise.resolve().then(function () { return require('./lint-955bc62d.cjs.js'); }).then((m) => m.default)));
|
|
249
|
+
program.command("test").allowUnknownOption(true).helpOption(", --backstage-cli-help").description("Run tests, forwarding args to Jest, defaulting to watch mode").action(lazy(() => Promise.resolve().then(function () { return require('./testCommand-1c515cf7.cjs.js'); }).then((m) => m.default)));
|
|
250
|
+
program.command("config:docs").option("--package <name>", "Only include the schema that applies to the given package").description("Browse the configuration reference documentation").action(lazy(() => Promise.resolve().then(function () { return require('./docs-a8506fde.cjs.js'); }).then((m) => m.default)));
|
|
251
|
+
program.command("config:print").option("--package <name>", "Only load config schema that applies to the given package").option("--lax", "Do not require environment variables to be set").option("--frontend", "Print only the frontend configuration").option("--with-secrets", "Include secrets in the printed configuration").option("--format <format>", "Format to print the configuration in, either json or yaml [yaml]").option(...configOption).description("Print the app configuration for the current package").action(lazy(() => Promise.resolve().then(function () { return require('./print-5e70799c.cjs.js'); }).then((m) => m.default)));
|
|
252
|
+
program.command("config:check").option("--package <name>", "Only load config schema that applies to the given package").option("--lax", "Do not require environment variables to be set").option("--frontend", "Only validate the frontend configuration").option(...configOption).description("Validate that the given configuration loads and matches schema").action(lazy(() => Promise.resolve().then(function () { return require('./validate-9907afbb.cjs.js'); }).then((m) => m.default)));
|
|
253
|
+
program.command("config:schema").option("--package <name>", "Only output config schema that applies to the given package").option("--format <format>", "Format to print the schema in, either json or yaml [yaml]").description("Print configuration schema").action(lazy(() => Promise.resolve().then(function () { return require('./schema-80516b43.cjs.js'); }).then((m) => m.default)));
|
|
254
|
+
program.command("versions:bump").description("Bump Backstage packages to the latest versions").action(lazy(() => Promise.resolve().then(function () { return require('./bump-24057de2.cjs.js'); }).then((m) => m.default)));
|
|
255
|
+
program.command("versions:check").option("--fix", "Fix any auto-fixable versioning problems").description("Check Backstage package versioning").action(lazy(() => Promise.resolve().then(function () { return require('./lint-a78b8bb6.cjs.js'); }).then((m) => m.default)));
|
|
256
|
+
program.command("prepack").description("Prepares a package for packaging before publishing").action(lazy(() => Promise.resolve().then(function () { return require('./pack-f474f79b.cjs.js'); }).then((m) => m.pre)));
|
|
257
|
+
program.command("postpack").description("Restores the changes made by the prepack command").action(lazy(() => Promise.resolve().then(function () { return require('./pack-f474f79b.cjs.js'); }).then((m) => m.post)));
|
|
258
|
+
program.command("clean").description("Delete cache directories").action(lazy(() => Promise.resolve().then(function () { return require('./clean-ecf90e6b.cjs.js'); }).then((m) => m.default)));
|
|
259
|
+
program.command("build-workspace <workspace-dir> ...<packages>").description("Builds a temporary dist workspace from the provided packages").action(lazy(() => Promise.resolve().then(function () { return require('./buildWorkspace-29b42a0b.cjs.js'); }).then((m) => m.default)));
|
|
260
|
+
program.command("create-github-app <github-org>").description("Create new GitHub App in your organization.").action(lazy(() => Promise.resolve().then(function () { return require('./index-9cf6e421.cjs.js'); }).then((m) => m.default)));
|
|
261
|
+
program.command("info").description("Show helpful information for debugging and reporting bugs").action(lazy(() => Promise.resolve().then(function () { return require('./info-d8ce894c.cjs.js'); }).then((m) => m.default)));
|
|
262
|
+
program.command("install [plugin-id]", { hidden: true }).option("--from <packageJsonFilePath>", "Install from a local package.json containing the installation recipe").description("Install a Backstage plugin [EXPERIMENTAL]").action(lazy(() => Promise.resolve().then(function () { return require('./install-9e5b8576.cjs.js'); }).then((m) => m.default)));
|
|
264
263
|
}
|
|
265
264
|
function lazy(getActionFunc) {
|
|
266
265
|
return async (...args) => {
|
|
@@ -276,16 +275,16 @@ function lazy(getActionFunc) {
|
|
|
276
275
|
}
|
|
277
276
|
|
|
278
277
|
const main = (argv) => {
|
|
279
|
-
program__default[
|
|
280
|
-
registerCommands(program__default[
|
|
281
|
-
program__default[
|
|
278
|
+
program__default["default"].name("backstage-cli").version(version);
|
|
279
|
+
registerCommands(program__default["default"]);
|
|
280
|
+
program__default["default"].on("command:*", () => {
|
|
282
281
|
console.log();
|
|
283
|
-
console.log(chalk__default[
|
|
282
|
+
console.log(chalk__default["default"].red(`Invalid command: ${program__default["default"].args.join(" ")}`));
|
|
284
283
|
console.log();
|
|
285
|
-
program__default[
|
|
284
|
+
program__default["default"].outputHelp();
|
|
286
285
|
process.exit(1);
|
|
287
286
|
});
|
|
288
|
-
program__default[
|
|
287
|
+
program__default["default"].parse(argv);
|
|
289
288
|
};
|
|
290
289
|
process.on("unhandledRejection", (rejection) => {
|
|
291
290
|
if (rejection instanceof Error) {
|
|
@@ -304,4 +303,4 @@ exports.devDependencies = devDependencies;
|
|
|
304
303
|
exports.paths = paths;
|
|
305
304
|
exports.version = version;
|
|
306
305
|
exports.version$1 = version$8;
|
|
307
|
-
//# sourceMappingURL=index-
|
|
306
|
+
//# sourceMappingURL=index-b2152549.cjs.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-b2152549.cjs.js');
|
|
4
4
|
var os = require('os');
|
|
5
|
-
var run = require('./run-
|
|
6
|
-
var Lockfile = require('./Lockfile-
|
|
5
|
+
var run = require('./run-8388d249.cjs.js');
|
|
6
|
+
var Lockfile = require('./Lockfile-35661afa.cjs.js');
|
|
7
7
|
require('chalk');
|
|
8
8
|
require('commander');
|
|
9
9
|
require('fs-extra');
|
|
@@ -23,7 +23,7 @@ var info = async () => {
|
|
|
23
23
|
await new Promise(async () => {
|
|
24
24
|
const yarnVersion = await run.runPlain("yarn --version");
|
|
25
25
|
const isLocal = require("fs").existsSync(index.paths.resolveOwn("./src"));
|
|
26
|
-
console.log(`OS: ${os__default[
|
|
26
|
+
console.log(`OS: ${os__default["default"].type} ${os__default["default"].release} - ${os__default["default"].platform}/${os__default["default"].arch}`);
|
|
27
27
|
console.log(`node: ${process.version}`);
|
|
28
28
|
console.log(`yarn: ${yarnVersion}`);
|
|
29
29
|
console.log(`cli: ${index.version$1} (${isLocal ? "local" : "installed"})`);
|
|
@@ -40,5 +40,5 @@ var info = async () => {
|
|
|
40
40
|
});
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
-
exports
|
|
44
|
-
//# sourceMappingURL=info-
|
|
43
|
+
exports["default"] = info;
|
|
44
|
+
//# sourceMappingURL=info-d8ce894c.cjs.js.map
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
var fs = require('fs-extra');
|
|
4
4
|
require('semver');
|
|
5
5
|
require('@yarnpkg/lockfile');
|
|
6
|
-
var packages = require('./packages-
|
|
7
|
-
var index = require('./index-
|
|
6
|
+
var packages = require('./packages-bcde9079.cjs.js');
|
|
7
|
+
var index = require('./index-b2152549.cjs.js');
|
|
8
8
|
var chalk = require('chalk');
|
|
9
9
|
var sortBy = require('lodash/sortBy');
|
|
10
10
|
var groupBy = require('lodash/groupBy');
|
|
11
|
-
var run = require('./run-
|
|
11
|
+
var run = require('./run-8388d249.cjs.js');
|
|
12
12
|
require('commander');
|
|
13
13
|
require('@backstage/cli-common');
|
|
14
14
|
require('@backstage/config/package.json');
|
|
@@ -33,9 +33,9 @@ class AppRouteStep {
|
|
|
33
33
|
}
|
|
34
34
|
async run() {
|
|
35
35
|
var _a;
|
|
36
|
-
const {path, element, packageName} = this.data;
|
|
36
|
+
const { path, element, packageName } = this.data;
|
|
37
37
|
const appTsxPath = index.paths.resolveTargetRoot("packages/app/src/App.tsx");
|
|
38
|
-
const contents = await fs__default[
|
|
38
|
+
const contents = await fs__default["default"].readFile(appTsxPath, "utf-8");
|
|
39
39
|
let failed = false;
|
|
40
40
|
const contentsWithRoute = contents.replace(/(\s*)<\/FlatRoutes>/, `$1 <Route path="${path}" element={${element}} />$1</FlatRoutes>`);
|
|
41
41
|
if (contentsWithRoute === contents) {
|
|
@@ -56,21 +56,21 @@ import `);
|
|
|
56
56
|
console.log(`1. import { ${componentName} } from '${packageName}';`);
|
|
57
57
|
console.log(`2. <Route path="${path}" element={${element}} />`);
|
|
58
58
|
} else {
|
|
59
|
-
await fs__default[
|
|
59
|
+
await fs__default["default"].writeFile(appTsxPath, contentsWithImport);
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
const appRoute = createStepDefinition({
|
|
64
64
|
type: "app-route",
|
|
65
65
|
deserialize(obj, pkg) {
|
|
66
|
-
const {path, element} = obj;
|
|
66
|
+
const { path, element } = obj;
|
|
67
67
|
if (!path || typeof path !== "string") {
|
|
68
68
|
throw new Error("Invalid install step, 'path' must be a string");
|
|
69
69
|
}
|
|
70
70
|
if (!element || typeof element !== "string") {
|
|
71
71
|
throw new Error("Invalid install step, 'element' must be a string");
|
|
72
72
|
}
|
|
73
|
-
return new AppRouteStep({path, element, packageName: pkg.name});
|
|
73
|
+
return new AppRouteStep({ path, element, packageName: pkg.name });
|
|
74
74
|
},
|
|
75
75
|
create(data) {
|
|
76
76
|
return new AppRouteStep(data);
|
|
@@ -82,23 +82,23 @@ class DependenciesStep {
|
|
|
82
82
|
this.data = data;
|
|
83
83
|
}
|
|
84
84
|
async run() {
|
|
85
|
-
const {dependencies: dependencies2} = this.data;
|
|
86
|
-
const byTarget = groupBy__default[
|
|
85
|
+
const { dependencies: dependencies2 } = this.data;
|
|
86
|
+
const byTarget = groupBy__default["default"](dependencies2, "target");
|
|
87
87
|
for (const [target, deps] of Object.entries(byTarget)) {
|
|
88
88
|
const pkgPath = index.paths.resolveTargetRoot(target, "package.json");
|
|
89
|
-
const pkgJson = await fs__default[
|
|
90
|
-
const depTypes = new Set();
|
|
89
|
+
const pkgJson = await fs__default["default"].readJson(pkgPath);
|
|
90
|
+
const depTypes = /* @__PURE__ */ new Set();
|
|
91
91
|
for (const dep of deps) {
|
|
92
92
|
depTypes.add(dep.type);
|
|
93
93
|
pkgJson[dep.type][dep.name] = dep.query;
|
|
94
94
|
}
|
|
95
95
|
for (const depType of depTypes) {
|
|
96
|
-
pkgJson[depType] = Object.fromEntries(sortBy__default[
|
|
96
|
+
pkgJson[depType] = Object.fromEntries(sortBy__default["default"](Object.entries(pkgJson[depType]), ([key]) => key));
|
|
97
97
|
}
|
|
98
|
-
await fs__default[
|
|
98
|
+
await fs__default["default"].writeJson(pkgPath, pkgJson, { spaces: 2 });
|
|
99
99
|
}
|
|
100
100
|
console.log();
|
|
101
|
-
console.log(`Running ${chalk__default[
|
|
101
|
+
console.log(`Running ${chalk__default["default"].blue("yarn install")} to install new versions`);
|
|
102
102
|
console.log();
|
|
103
103
|
await run.run("yarn", ["install"]);
|
|
104
104
|
}
|
|
@@ -124,11 +124,11 @@ class MessageStep {
|
|
|
124
124
|
const message = createStepDefinition({
|
|
125
125
|
type: "message",
|
|
126
126
|
deserialize(obj) {
|
|
127
|
-
const {message: msg} = obj;
|
|
127
|
+
const { message: msg } = obj;
|
|
128
128
|
if (!msg || typeof msg !== "string" && !Array.isArray(msg)) {
|
|
129
129
|
throw new Error("Invalid install step, 'message' must be a string or array");
|
|
130
130
|
}
|
|
131
|
-
return new MessageStep({message: [msg].flat().join("")});
|
|
131
|
+
return new MessageStep({ message: [msg].flat().join("") });
|
|
132
132
|
},
|
|
133
133
|
create(data) {
|
|
134
134
|
return new MessageStep(data);
|
|
@@ -173,10 +173,10 @@ class PluginInstaller {
|
|
|
173
173
|
});
|
|
174
174
|
steps.push({
|
|
175
175
|
type: "dependencies",
|
|
176
|
-
step: dependencies.create({dependencies: dependencies$1})
|
|
176
|
+
step: dependencies.create({ dependencies: dependencies$1 })
|
|
177
177
|
});
|
|
178
178
|
for (const step of (_b = (_a = pkg.experimentalInstallationRecipe) == null ? void 0 : _a.steps) != null ? _b : []) {
|
|
179
|
-
const {type} = step;
|
|
179
|
+
const { type } = step;
|
|
180
180
|
const definition = stepDefinitions.find((d) => d.type === type);
|
|
181
181
|
if (definition) {
|
|
182
182
|
steps.push({
|
|
@@ -190,7 +190,7 @@ class PluginInstaller {
|
|
|
190
190
|
return steps;
|
|
191
191
|
}
|
|
192
192
|
async run() {
|
|
193
|
-
for (const {type, step} of this.steps) {
|
|
193
|
+
for (const { type, step } of this.steps) {
|
|
194
194
|
console.log(`Running step ${type}`);
|
|
195
195
|
await step.run();
|
|
196
196
|
}
|
|
@@ -201,7 +201,7 @@ var install = async (pluginId, cmd) => {
|
|
|
201
201
|
if (pluginId) {
|
|
202
202
|
pkg = await fetchPluginPackage(pluginId);
|
|
203
203
|
} else if (cmd == null ? void 0 : cmd.from) {
|
|
204
|
-
pkg = await fs__default[
|
|
204
|
+
pkg = await fs__default["default"].readJson(cmd.from);
|
|
205
205
|
} else {
|
|
206
206
|
throw new Error("Missing both <plugin-id> or a package.json file path in the --from flag.");
|
|
207
207
|
}
|
|
@@ -210,5 +210,5 @@ var install = async (pluginId, cmd) => {
|
|
|
210
210
|
await installer.run();
|
|
211
211
|
};
|
|
212
212
|
|
|
213
|
-
exports
|
|
214
|
-
//# sourceMappingURL=install-
|
|
213
|
+
exports["default"] = install;
|
|
214
|
+
//# sourceMappingURL=install-9e5b8576.cjs.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var run = require('./run-
|
|
4
|
-
var index = require('./index-
|
|
3
|
+
var run = require('./run-8388d249.cjs.js');
|
|
4
|
+
var index = require('./index-b2152549.cjs.js');
|
|
5
5
|
require('child_process');
|
|
6
6
|
require('util');
|
|
7
7
|
require('@backstage/errors');
|
|
@@ -25,5 +25,5 @@ var lint = async (cmd, cmdArgs) => {
|
|
|
25
25
|
await run.run("eslint", args);
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
-
exports
|
|
29
|
-
//# sourceMappingURL=lint-
|
|
28
|
+
exports["default"] = lint;
|
|
29
|
+
//# sourceMappingURL=lint-955bc62d.cjs.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var Lockfile = require('./Lockfile-
|
|
4
|
-
require('./run-
|
|
3
|
+
var Lockfile = require('./Lockfile-35661afa.cjs.js');
|
|
4
|
+
require('./run-8388d249.cjs.js');
|
|
5
5
|
require('chalk');
|
|
6
|
-
var index = require('./index-
|
|
6
|
+
var index = require('./index-b2152549.cjs.js');
|
|
7
7
|
var partition = require('lodash/partition');
|
|
8
8
|
require('fs-extra');
|
|
9
9
|
require('semver');
|
|
@@ -42,14 +42,14 @@ var lint = async (cmd) => {
|
|
|
42
42
|
lockfile.replaceVersions(result.newVersions);
|
|
43
43
|
await lockfile.save();
|
|
44
44
|
} else {
|
|
45
|
-
const [newVersionsForbidden, newVersionsAllowed] = partition__default[
|
|
45
|
+
const [newVersionsForbidden, newVersionsAllowed] = partition__default["default"](result.newVersions, ({ name }) => forbiddenDuplicatesFilter(name));
|
|
46
46
|
if (newVersionsForbidden.length && !fix) {
|
|
47
47
|
success = false;
|
|
48
48
|
}
|
|
49
49
|
logArray(newVersionsForbidden, "The following packages must be deduplicated, this can be done automatically with --fix", (e) => ` ${e.name} @ ${e.range} bumped from ${e.oldVersion} to ${e.newVersion}`);
|
|
50
50
|
logArray(newVersionsAllowed, "The following packages can be deduplicated, this can be done automatically with --fix", (e) => ` ${e.name} @ ${e.range} bumped from ${e.oldVersion} to ${e.newVersion}`);
|
|
51
51
|
}
|
|
52
|
-
const [newRangesForbidden, newRangesAllowed] = partition__default[
|
|
52
|
+
const [newRangesForbidden, newRangesAllowed] = partition__default["default"](result.newRanges, ({ name }) => forbiddenDuplicatesFilter(name));
|
|
53
53
|
if (newRangesForbidden.length) {
|
|
54
54
|
success = false;
|
|
55
55
|
}
|
|
@@ -71,7 +71,7 @@ function logArray(arr, header, each) {
|
|
|
71
71
|
console.log();
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
exports
|
|
74
|
+
exports["default"] = lint;
|
|
75
75
|
exports.forbiddenDuplicatesFilter = forbiddenDuplicatesFilter;
|
|
76
76
|
exports.includedFilter = includedFilter;
|
|
77
|
-
//# sourceMappingURL=lint-
|
|
77
|
+
//# sourceMappingURL=lint-a78b8bb6.cjs.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var fs = require('fs-extra');
|
|
4
|
-
var index = require('./index-
|
|
4
|
+
var index = require('./index-b2152549.cjs.js');
|
|
5
5
|
require('commander');
|
|
6
6
|
require('chalk');
|
|
7
7
|
require('semver');
|
|
@@ -19,19 +19,19 @@ const PKG_BACKUP_PATH = "package.json-prepack";
|
|
|
19
19
|
const pre = async () => {
|
|
20
20
|
var _a;
|
|
21
21
|
const pkgPath = index.paths.resolveTarget(PKG_PATH);
|
|
22
|
-
const pkgContent = await fs__default[
|
|
22
|
+
const pkgContent = await fs__default["default"].readFile(pkgPath, "utf8");
|
|
23
23
|
const pkg = JSON.parse(pkgContent);
|
|
24
|
-
await fs__default[
|
|
24
|
+
await fs__default["default"].writeFile(PKG_BACKUP_PATH, pkgContent);
|
|
25
25
|
for (const key of Object.keys((_a = pkg.publishConfig) != null ? _a : {})) {
|
|
26
26
|
if (!SKIPPED_KEYS.includes(key)) {
|
|
27
27
|
pkg[key] = pkg.publishConfig[key];
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
await fs__default[
|
|
30
|
+
await fs__default["default"].writeJson(pkgPath, pkg, { encoding: "utf8", spaces: 2 });
|
|
31
31
|
};
|
|
32
32
|
const post = async () => {
|
|
33
33
|
try {
|
|
34
|
-
await fs__default[
|
|
34
|
+
await fs__default["default"].move(PKG_BACKUP_PATH, PKG_PATH, { overwrite: true });
|
|
35
35
|
} catch (error) {
|
|
36
36
|
console.warn(`Failed to restore package.json during postpack, ${error}. Your package will be fine but you may have ended up with some garbage in the repo.`);
|
|
37
37
|
}
|
|
@@ -39,4 +39,4 @@ const post = async () => {
|
|
|
39
39
|
|
|
40
40
|
exports.post = post;
|
|
41
41
|
exports.pre = pre;
|
|
42
|
-
//# sourceMappingURL=pack-
|
|
42
|
+
//# sourceMappingURL=pack-f474f79b.cjs.js.map
|