@backstage/cli 0.10.5 → 0.13.0

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.
Files changed (43) hide show
  1. package/CHANGELOG.md +197 -0
  2. package/config/eslint.js +4 -0
  3. package/dist/cjs/PackageGraph-7a0d3a83.cjs.js +73 -0
  4. package/dist/cjs/{build-b8486ea8.cjs.js → build-411cb39c.cjs.js} +8 -4
  5. package/dist/cjs/{build-9b61e21d.cjs.js → build-959e2ffa.cjs.js} +5 -4
  6. package/dist/cjs/{build-133af6d0.cjs.js → build-b4301c17.cjs.js} +11 -13
  7. package/dist/cjs/{build-b09ce39b.cjs.js → build-c7b2ea88.cjs.js} +5 -4
  8. package/dist/cjs/{buildWorkspace-674700ee.cjs.js → buildWorkspace-df8a4418.cjs.js} +6 -4
  9. package/dist/cjs/{bump-fc9f451d.cjs.js → bump-d7017b61.cjs.js} +6 -5
  10. package/dist/cjs/{bundle-2dd090df.cjs.js → bundle-a12319b7.cjs.js} +8 -6
  11. package/dist/cjs/{clean-fbe87564.cjs.js → clean-5638771f.cjs.js} +2 -2
  12. package/dist/cjs/{config-ac195003.cjs.js → config-199a492f.cjs.js} +15 -29
  13. package/dist/cjs/{create-b1277797.cjs.js → create-db02de74.cjs.js} +5 -4
  14. package/dist/cjs/{createPlugin-a20640b2.cjs.js → createPlugin-10786f3f.cjs.js} +5 -4
  15. package/dist/cjs/{dev-357f9a5b.cjs.js → dev-76979eca.cjs.js} +6 -6
  16. package/dist/cjs/{diff-2c9f0f5b.cjs.js → diff-49413933.cjs.js} +2 -2
  17. package/dist/cjs/{docs-c28d9fe6.cjs.js → docs-701e1b43.cjs.js} +5 -3
  18. package/dist/cjs/{index-15114177.cjs.js → index-34d6a6a3.cjs.js} +65 -68
  19. package/dist/cjs/{index-d778c391.cjs.js → index-d5e2da99.cjs.js} +2 -2
  20. package/dist/cjs/{index-ce6e84ad.cjs.js → index-de296eda.cjs.js} +21 -38
  21. package/dist/cjs/{info-fb86e821.cjs.js → info-82d6df9a.cjs.js} +4 -3
  22. package/dist/cjs/{install-0e40a4b5.cjs.js → install-c1cc1699.cjs.js} +5 -4
  23. package/dist/cjs/{lint-d03a1e28.cjs.js → lint-3a07e770.cjs.js} +3 -3
  24. package/dist/cjs/{lint-364632ce.cjs.js → lint-90b05512.cjs.js} +4 -3
  25. package/dist/cjs/pack-6d555709.cjs.js +69 -0
  26. package/dist/cjs/{packager-c484b561.cjs.js → packager-b384ddb4.cjs.js} +101 -8
  27. package/dist/cjs/{packages-37922fa4.cjs.js → packages-deee570e.cjs.js} +8 -9
  28. package/dist/cjs/{parallel-a4714c72.cjs.js → parallel-7e32a8d0.cjs.js} +1 -5
  29. package/dist/cjs/{paths-5901f4e6.cjs.js → paths-2c7f6dab.cjs.js} +40 -53
  30. package/dist/cjs/{print-2861b2bc.cjs.js → print-e49ed821.cjs.js} +5 -3
  31. package/dist/cjs/{run-0c9b9637.cjs.js → run-596a22b2.cjs.js} +2 -2
  32. package/dist/cjs/{schema-bd2de85b.cjs.js → schema-cd5d09d2.cjs.js} +5 -3
  33. package/dist/cjs/{serve-9d7083ef.cjs.js → serve-948b0129.cjs.js} +14 -13
  34. package/dist/cjs/{serve-1a01caf7.cjs.js → serve-a81d4924.cjs.js} +10 -9
  35. package/dist/cjs/{server-5605972b.cjs.js → server-11842d16.cjs.js} +6 -3
  36. package/dist/cjs/{tasks-abce8018.cjs.js → tasks-47ef8136.cjs.js} +2 -2
  37. package/dist/cjs/{testCommand-34249b0d.cjs.js → testCommand-c91c3e8a.cjs.js} +3 -3
  38. package/dist/cjs/{validate-c29f64b6.cjs.js → validate-ee0ea71a.cjs.js} +7 -4
  39. package/dist/index.cjs.js +1 -1
  40. package/package.json +39 -36
  41. package/templates/default-backend-plugin/src/service/standaloneServer.ts.hbs +1 -1
  42. package/dist/cjs/pack-cc9d3480.cjs.js +0 -42
  43. package/dist/cjs/removePlugin-299f58a3.cjs.js +0 -175
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
3
  var fs = require('fs-extra');
4
- var index = require('./index-15114177.cjs.js');
4
+ var index = require('./index-34d6a6a3.cjs.js');
5
5
  var webpack = require('webpack');
6
- var paths = require('./paths-5901f4e6.cjs.js');
6
+ var paths = require('./paths-2c7f6dab.cjs.js');
7
7
  require('commander');
8
8
  require('chalk');
9
9
  require('semver');
@@ -16,13 +16,13 @@ require('html-webpack-plugin');
16
16
  require('react-dev-utils/ModuleScopePlugin');
17
17
  require('run-script-webpack-plugin');
18
18
  require('webpack-node-externals');
19
- require('terser-webpack-plugin');
20
- require('./parallel-a4714c72.cjs.js');
19
+ require('@manypkg/get-packages');
21
20
  require('mini-css-extract-plugin');
22
21
  require('./svgrTemplate-f19e974c.cjs.js');
23
- require('./run-0c9b9637.cjs.js');
22
+ require('./run-596a22b2.cjs.js');
24
23
  require('child_process');
25
24
  require('util');
25
+ require('eslint-webpack-plugin');
26
26
  require('lodash/pickBy');
27
27
 
28
28
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -67,4 +67,4 @@ var dev = async (cmd) => {
67
67
  };
68
68
 
69
69
  exports["default"] = dev;
70
- //# sourceMappingURL=dev-357f9a5b.cjs.js.map
70
+ //# sourceMappingURL=dev-76979eca.cjs.js.map
@@ -7,7 +7,7 @@ var path = require('path');
7
7
  var inquirer = require('inquirer');
8
8
  var handlebars = require('handlebars');
9
9
  var recursive = require('recursive-readdir');
10
- var index = require('./index-15114177.cjs.js');
10
+ var index = require('./index-34d6a6a3.cjs.js');
11
11
  require('commander');
12
12
  require('semver');
13
13
  require('@backstage/cli-common');
@@ -381,4 +381,4 @@ async function readPluginData() {
381
381
  }
382
382
 
383
383
  exports["default"] = diff;
384
- //# sourceMappingURL=diff-2c9f0f5b.cjs.js.map
384
+ //# sourceMappingURL=diff-49413933.cjs.js.map
@@ -2,9 +2,9 @@
2
2
 
3
3
  var configLoader = require('@backstage/config-loader');
4
4
  var openBrowser = require('react-dev-utils/openBrowser');
5
- var config = require('./config-ac195003.cjs.js');
5
+ var config = require('./config-199a492f.cjs.js');
6
6
  require('@backstage/config');
7
- require('./index-15114177.cjs.js');
7
+ require('./index-34d6a6a3.cjs.js');
8
8
  require('commander');
9
9
  require('chalk');
10
10
  require('fs-extra');
@@ -12,6 +12,8 @@ require('semver');
12
12
  require('@backstage/cli-common');
13
13
  require('@backstage/config/package.json');
14
14
  require('@backstage/errors');
15
+ require('@manypkg/get-packages');
16
+ require('./PackageGraph-7a0d3a83.cjs.js');
15
17
 
16
18
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
17
19
 
@@ -29,4 +31,4 @@ var docs = async (cmd) => {
29
31
  };
30
32
 
31
33
  exports["default"] = docs;
32
- //# sourceMappingURL=docs-c28d9fe6.cjs.js.map
34
+ //# sourceMappingURL=docs-701e1b43.cjs.js.map
@@ -46,18 +46,17 @@ class NotFoundError extends CustomError {
46
46
 
47
47
  const paths = cliCommon.findPaths(__dirname);
48
48
 
49
- var version$9 = "0.10.2";
49
+ var version$9 = "0.10.5";
50
50
 
51
- var version$8 = "0.10.5";
51
+ var version$8 = "0.13.0";
52
52
  var dependencies = {
53
53
  "@backstage/cli-common": "^0.1.6",
54
- "@backstage/config": "^0.1.11",
55
- "@backstage/config-loader": "^0.9.1",
56
- "@backstage/errors": "^0.1.5",
54
+ "@backstage/config": "^0.1.13",
55
+ "@backstage/config-loader": "^0.9.3",
56
+ "@backstage/errors": "^0.2.0",
57
57
  "@backstage/types": "^0.1.1",
58
58
  "@hot-loader/react-dom": "^16.13.0",
59
- "@lerna/package-graph": "^4.0.0",
60
- "@lerna/project": "^4.0.0",
59
+ "@manypkg/get-packages": "^1.1.3",
61
60
  "@octokit/request": "^5.4.12",
62
61
  "@rollup/plugin-commonjs": "^21.0.1",
63
62
  "@rollup/plugin-json": "^4.1.0",
@@ -68,13 +67,13 @@ var dependencies = {
68
67
  "@spotify/eslint-config-typescript": "^12.0.0",
69
68
  "@sucrase/jest-plugin": "^2.1.1",
70
69
  "@sucrase/webpack-loader": "^2.0.0",
71
- "@svgr/plugin-jsx": "5.5.x",
72
- "@svgr/plugin-svgo": "5.4.x",
70
+ "@svgr/plugin-jsx": "6.2.x",
71
+ "@svgr/plugin-svgo": "6.2.x",
73
72
  "@svgr/rollup": "5.5.x",
74
73
  "@svgr/webpack": "5.5.x",
75
74
  "@types/webpack-env": "^1.15.2",
76
- "@typescript-eslint/eslint-plugin": "^v4.33.0",
77
- "@typescript-eslint/parser": "^v4.28.3",
75
+ "@typescript-eslint/eslint-plugin": "^5.9.0",
76
+ "@typescript-eslint/parser": "^5.9.0",
78
77
  "@yarnpkg/lockfile": "^1.1.0",
79
78
  bfj: "^7.0.2",
80
79
  buffer: "^6.0.3",
@@ -83,18 +82,20 @@ var dependencies = {
83
82
  commander: "^6.1.0",
84
83
  "css-loader": "^6.5.1",
85
84
  diff: "^5.0.0",
86
- esbuild: "^0.14.1",
87
- eslint: "^7.30.0",
85
+ esbuild: "^0.14.10",
86
+ "esbuild-loader": "^2.18.0",
87
+ eslint: "^8.6.0",
88
+ "eslint-webpack-plugin": "^2.6.0",
88
89
  "eslint-config-prettier": "^8.3.0",
89
90
  "eslint-formatter-friendly": "^7.0.0",
90
- "eslint-plugin-import": "^2.20.2",
91
- "eslint-plugin-jest": "^24.1.0",
92
- "eslint-plugin-jsx-a11y": "^6.2.1",
91
+ "eslint-plugin-import": "^2.25.4",
92
+ "eslint-plugin-jest": "^25.3.4",
93
+ "eslint-plugin-jsx-a11y": "^6.5.1",
93
94
  "eslint-plugin-monorepo": "^0.3.2",
94
- "eslint-plugin-react": "^7.12.4",
95
- "eslint-plugin-react-hooks": "^4.0.0",
95
+ "eslint-plugin-react": "^7.28.0",
96
+ "eslint-plugin-react-hooks": "^4.3.0",
96
97
  express: "^4.17.1",
97
- "fork-ts-checker-webpack-plugin": "^4.0.5",
98
+ "fork-ts-checker-webpack-plugin": "^7.0.0-alpha.8",
98
99
  "fs-extra": "9.1.0",
99
100
  glob: "^7.1.7",
100
101
  handlebars: "^4.7.3",
@@ -103,7 +104,7 @@ var dependencies = {
103
104
  jest: "^26.0.1",
104
105
  "jest-css-modules": "^2.1.0",
105
106
  "json-schema": "^0.4.0",
106
- "jest-transform-yaml": "^0.1.1",
107
+ "jest-transform-yaml": "^1.0.0",
107
108
  lodash: "^4.17.21",
108
109
  minimatch: "3.0.4",
109
110
  "mini-css-extract-plugin": "^2.4.2",
@@ -111,8 +112,8 @@ var dependencies = {
111
112
  ora: "^5.3.0",
112
113
  postcss: "^8.1.0",
113
114
  process: "^0.11.10",
114
- "react-dev-utils": "^12.0.0-next.47",
115
- "react-hot-loader": "^4.12.21",
115
+ "react-dev-utils": "^12.0.0-next.60",
116
+ "react-hot-loader": "^4.13.0",
116
117
  "recursive-readdir": "^2.2.2",
117
118
  "replace-in-file": "^6.0.0",
118
119
  rollup: "^2.60.2",
@@ -127,23 +128,22 @@ var dependencies = {
127
128
  sucrase: "^3.20.2",
128
129
  tar: "^6.1.2",
129
130
  "terser-webpack-plugin": "^5.1.3",
130
- typescript: "^4.0.3",
131
131
  util: "^0.12.3",
132
- webpack: "^5.48.0",
133
- "webpack-dev-server": "4.3.1",
132
+ webpack: "^5.66.0",
133
+ "webpack-dev-server": "^4.7.3",
134
134
  "webpack-node-externals": "^3.0.0",
135
135
  yaml: "^1.10.0",
136
136
  "yml-loader": "^2.1.0",
137
137
  yn: "^4.0.0"
138
138
  };
139
139
  var devDependencies = {
140
- "@backstage/backend-common": "^0.10.2",
141
- "@backstage/config": "^0.1.11",
142
- "@backstage/core-components": "^0.8.3",
143
- "@backstage/core-plugin-api": "^0.4.1",
144
- "@backstage/core-app-api": "^0.3.1",
145
- "@backstage/dev-utils": "^0.2.16",
146
- "@backstage/test-utils": "^0.2.1",
140
+ "@backstage/backend-common": "^0.10.5",
141
+ "@backstage/config": "^0.1.13",
142
+ "@backstage/core-components": "^0.8.6",
143
+ "@backstage/core-plugin-api": "^0.6.0",
144
+ "@backstage/core-app-api": "^0.5.1",
145
+ "@backstage/dev-utils": "^0.2.19",
146
+ "@backstage/test-utils": "^0.2.3",
147
147
  "@backstage/theme": "^0.2.14",
148
148
  "@types/diff": "^5.0.0",
149
149
  "@types/express": "^4.17.6",
@@ -158,8 +158,6 @@ var devDependencies = {
158
158
  "@types/rollup-plugin-postcss": "^2.0.0",
159
159
  "@types/tar": "^6.1.1",
160
160
  "@types/terser-webpack-plugin": "^5.0.4",
161
- "@types/webpack": "^5.28.0",
162
- "@types/webpack-dev-server": "^3.11.5",
163
161
  "@types/yarnpkg__lockfile": "^1.1.4",
164
162
  del: "^6.0.0",
165
163
  "mock-fs": "^5.1.0",
@@ -167,19 +165,19 @@ var devDependencies = {
167
165
  "ts-node": "^10.0.0"
168
166
  };
169
167
 
170
- var version$7 = "0.3.1";
168
+ var version$7 = "0.5.1";
171
169
 
172
- var version$6 = "0.8.3";
170
+ var version$6 = "0.8.6";
173
171
 
174
- var version$5 = "0.4.1";
172
+ var version$5 = "0.6.0";
175
173
 
176
- var version$4 = "0.2.16";
174
+ var version$4 = "0.2.19";
177
175
 
178
- var version$3 = "0.2.1";
176
+ var version$3 = "0.2.3";
179
177
 
180
178
  var version$2 = "0.2.14";
181
179
 
182
- var version$1 = "0.15.19";
180
+ var version$1 = "0.15.22";
183
181
 
184
182
  const packageVersions = {
185
183
  "@backstage/backend-common": version$9,
@@ -233,33 +231,32 @@ function registerCommands(program) {
233
231
  (opt, opts) => [...opts, opt],
234
232
  Array()
235
233
  ];
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-133af6d0.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-9d7083ef.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-9b61e21d.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-2dd090df.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-357f9a5b.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-b1277797.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-a20640b2.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-299f58a3.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-b09ce39b.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-1a01caf7.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-2c9f0f5b.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]").option("--minify", "Minify the generated code").action(lazy(() => Promise.resolve().then(function () { return require('./build-b8486ea8.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-d03a1e28.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-34249b0d.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-c28d9fe6.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-2861b2bc.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-c29f64b6.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-bd2de85b.cjs.js'); }).then((m) => m.default)));
254
- program.command("versions:bump").option("--pattern <glob>", "Override glob for matching packages to upgrade").description("Bump Backstage packages to the latest versions").action(lazy(() => Promise.resolve().then(function () { return require('./bump-fc9f451d.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-364632ce.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-cc9d3480.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-cc9d3480.cjs.js'); }).then((m) => m.post)));
258
- program.command("clean").description("Delete cache directories").action(lazy(() => Promise.resolve().then(function () { return require('./clean-fbe87564.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-674700ee.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-d778c391.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-fb86e821.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-0e40a4b5.cjs.js'); }).then((m) => m.default)));
234
+ program.command("app:build").description("Build an app for a production release").option("--stats", "Write bundle stats to output directory").option(...configOption).action(lazy(() => Promise.resolve().then(function () { return require('./build-b4301c17.cjs.js'); }).then((m) => m.default)));
235
+ 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-948b0129.cjs.js'); }).then((m) => m.default)));
236
+ program.command("backend:build").description("Build a backend plugin").option("--minify", "Minify the generated code").option("--experimental-type-build", "Enable experimental type build").action(lazy(() => Promise.resolve().then(function () { return require('./build-959e2ffa.cjs.js'); }).then((m) => m.default)));
237
+ 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-a12319b7.cjs.js'); }).then((m) => m.default)));
238
+ 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-76979eca.cjs.js'); }).then((m) => m.default)));
239
+ 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-db02de74.cjs.js'); }).then((m) => m.default)));
240
+ 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-10786f3f.cjs.js'); }).then((m) => m.default)));
241
+ program.command("plugin:build").description("Build a plugin").option("--minify", "Minify the generated code").option("--experimental-type-build", "Enable experimental type build").action(lazy(() => Promise.resolve().then(function () { return require('./build-c7b2ea88.cjs.js'); }).then((m) => m.default)));
242
+ 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-a81d4924.cjs.js'); }).then((m) => m.default)));
243
+ 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-49413933.cjs.js'); }).then((m) => m.default)));
244
+ program.command("build").description("Build a package for publishing").option("--outputs <formats>", "List of formats to output [types,cjs,esm]").option("--minify", "Minify the generated code").option("--experimental-type-build", "Enable experimental type build").action(lazy(() => Promise.resolve().then(function () { return require('./build-411cb39c.cjs.js'); }).then((m) => m.default)));
245
+ 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-3a07e770.cjs.js'); }).then((m) => m.default)));
246
+ 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-c91c3e8a.cjs.js'); }).then((m) => m.default)));
247
+ 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-701e1b43.cjs.js'); }).then((m) => m.default)));
248
+ 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-e49ed821.cjs.js'); }).then((m) => m.default)));
249
+ 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("--deprecated", "Output deprecated configuration settings").option(...configOption).description("Validate that the given configuration loads and matches schema").action(lazy(() => Promise.resolve().then(function () { return require('./validate-ee0ea71a.cjs.js'); }).then((m) => m.default)));
250
+ 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-cd5d09d2.cjs.js'); }).then((m) => m.default)));
251
+ program.command("versions:bump").option("--pattern <glob>", "Override glob for matching packages to upgrade").description("Bump Backstage packages to the latest versions").action(lazy(() => Promise.resolve().then(function () { return require('./bump-d7017b61.cjs.js'); }).then((m) => m.default)));
252
+ 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-90b05512.cjs.js'); }).then((m) => m.default)));
253
+ program.command("prepack").description("Prepares a package for packaging before publishing").action(lazy(() => Promise.resolve().then(function () { return require('./pack-6d555709.cjs.js'); }).then((m) => m.pre)));
254
+ program.command("postpack").description("Restores the changes made by the prepack command").action(lazy(() => Promise.resolve().then(function () { return require('./pack-6d555709.cjs.js'); }).then((m) => m.post)));
255
+ program.command("clean").description("Delete cache directories").action(lazy(() => Promise.resolve().then(function () { return require('./clean-5638771f.cjs.js'); }).then((m) => m.default)));
256
+ 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-df8a4418.cjs.js'); }).then((m) => m.default)));
257
+ program.command("create-github-app <github-org>").description("Create new GitHub App in your organization.").action(lazy(() => Promise.resolve().then(function () { return require('./index-d5e2da99.cjs.js'); }).then((m) => m.default)));
258
+ program.command("info").description("Show helpful information for debugging and reporting bugs").action(lazy(() => Promise.resolve().then(function () { return require('./info-82d6df9a.cjs.js'); }).then((m) => m.default)));
259
+ 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-c1cc1699.cjs.js'); }).then((m) => m.default)));
263
260
  }
264
261
  function lazy(getActionFunc) {
265
262
  return async (...args) => {
@@ -303,4 +300,4 @@ exports.devDependencies = devDependencies;
303
300
  exports.paths = paths;
304
301
  exports.version = version;
305
302
  exports.version$1 = version$8;
306
- //# sourceMappingURL=index-15114177.cjs.js.map
303
+ //# sourceMappingURL=index-34d6a6a3.cjs.js.map
@@ -3,7 +3,7 @@
3
3
  var fs = require('fs-extra');
4
4
  var chalk = require('chalk');
5
5
  var yaml = require('yaml');
6
- var index$1 = require('./index-15114177.cjs.js');
6
+ var index$1 = require('./index-34d6a6a3.cjs.js');
7
7
  var crypto = require('crypto');
8
8
  var openBrowser = require('react-dev-utils/openBrowser');
9
9
  var request = require('@octokit/request');
@@ -128,4 +128,4 @@ ${yaml.stringify(config)}`;
128
128
  };
129
129
 
130
130
  exports["default"] = index;
131
- //# sourceMappingURL=index-d778c391.cjs.js.map
131
+ //# sourceMappingURL=index-d5e2da99.cjs.js.map
@@ -4,8 +4,10 @@ var fs = require('fs-extra');
4
4
  var path = require('path');
5
5
  var os = require('os');
6
6
  var tar = require('tar');
7
- var index = require('./index-15114177.cjs.js');
8
- var run = require('./run-0c9b9637.cjs.js');
7
+ var index = require('./index-34d6a6a3.cjs.js');
8
+ var run = require('./run-596a22b2.cjs.js');
9
+ var getPackages = require('@manypkg/get-packages');
10
+ var PackageGraph = require('./PackageGraph-7a0d3a83.cjs.js');
9
11
 
10
12
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
11
13
 
@@ -19,7 +21,15 @@ const UNSAFE_PACKAGES = [
19
21
  async function createDistWorkspace(packageNames, options = {}) {
20
22
  var _a, _b, _c;
21
23
  const targetDir = (_a = options.targetDir) != null ? _a : await fs__default["default"].mkdtemp(path.resolve(os.tmpdir(), "dist-workspace"));
22
- const targets = await findTargetPackages(packageNames);
24
+ const { packages } = await getPackages.getPackages(index.paths.targetDir);
25
+ const packageGraph = PackageGraph.PackageGraph.fromPackages(packages);
26
+ const targetNames = packageGraph.collectPackageNames(packageNames, (node) => {
27
+ if (node.packageJson.bundled) {
28
+ return void 0;
29
+ }
30
+ return node.publishedLocalDependencies.keys();
31
+ });
32
+ const targets = Array.from(targetNames).map((name) => packageGraph.get(name));
23
33
  if (options.buildDependencies) {
24
34
  const exclude = (_b = options.buildExcludes) != null ? _b : [];
25
35
  const toBuild = targets.filter((target) => !exclude.includes(target.name));
@@ -40,7 +50,7 @@ async function createDistWorkspace(packageNames, options = {}) {
40
50
  }
41
51
  if (options.skeleton) {
42
52
  const skeletonFiles = targets.map((target) => {
43
- const dir = path.relative(index.paths.targetRoot, target.location);
53
+ const dir = path.relative(index.paths.targetRoot, target.dir);
44
54
  return path.join(dir, "package.json");
45
55
  });
46
56
  await tar__default["default"].create({
@@ -55,15 +65,16 @@ async function createDistWorkspace(packageNames, options = {}) {
55
65
  }
56
66
  async function moveToDistWorkspace(workspaceDir, localPackages) {
57
67
  async function pack(target, archive) {
68
+ var _a, _b;
58
69
  console.log(`Repacking ${target.name} into dist workspace`);
59
70
  const archivePath = path.resolve(workspaceDir, archive);
60
71
  await run.run("yarn", ["pack", "--filename", archivePath], {
61
- cwd: target.location
72
+ cwd: target.dir
62
73
  });
63
- if (target.scripts.postpack) {
64
- await run.run("yarn", ["postpack"], { cwd: target.location });
74
+ if ((_b = (_a = target.packageJson) == null ? void 0 : _a.scripts) == null ? void 0 : _b.postpack) {
75
+ await run.run("yarn", ["postpack"], { cwd: target.dir });
65
76
  }
66
- const outputDir = path.relative(index.paths.targetRoot, target.location);
77
+ const outputDir = path.relative(index.paths.targetRoot, target.dir);
67
78
  const absoluteOutputPath = path.resolve(workspaceDir, outputDir);
68
79
  await fs__default["default"].ensureDir(absoluteOutputPath);
69
80
  await tar__default["default"].extract({
@@ -72,7 +83,7 @@ async function moveToDistWorkspace(workspaceDir, localPackages) {
72
83
  strip: 1
73
84
  });
74
85
  await fs__default["default"].remove(archivePath);
75
- if (target.get("bundled")) {
86
+ if (target.packageJson.bundled) {
76
87
  const pkgJson = await fs__default["default"].readJson(path.resolve(absoluteOutputPath, "package.json"));
77
88
  delete pkgJson.dependencies;
78
89
  delete pkgJson.devDependencies;
@@ -90,34 +101,6 @@ async function moveToDistWorkspace(workspaceDir, localPackages) {
90
101
  }
91
102
  await Promise.all(safePackages.map(async (target, index) => pack(target, `temp-package-${index}.tgz`)));
92
103
  }
93
- async function findTargetPackages(pkgNames) {
94
- var _a;
95
- const { Project } = require("@lerna/project");
96
- const { PackageGraph } = require("@lerna/package-graph");
97
- const project = new Project(index.paths.targetDir);
98
- const packages = await project.getPackages();
99
- const graph = new PackageGraph(packages);
100
- const targets = /* @__PURE__ */ new Map();
101
- const searchNames = pkgNames.slice();
102
- while (searchNames.length) {
103
- const name = searchNames.pop();
104
- if (targets.has(name)) {
105
- continue;
106
- }
107
- const node = graph.get(name);
108
- if (!node) {
109
- throw new Error(`Package '${name}' not found`);
110
- }
111
- if (!node.pkg.get("bundled")) {
112
- const pkgDeps = Object.keys((_a = node.pkg.dependencies) != null ? _a : {});
113
- const localDeps = Array.from(node.localDependencies.keys());
114
- const filteredDeps = localDeps.filter((dep) => pkgDeps.includes(dep));
115
- searchNames.push(...filteredDeps);
116
- }
117
- targets.set(name, node.pkg);
118
- }
119
- return Array.from(targets.values());
120
- }
121
104
 
122
105
  exports.createDistWorkspace = createDistWorkspace;
123
- //# sourceMappingURL=index-ce6e84ad.cjs.js.map
106
+ //# sourceMappingURL=index-de296eda.cjs.js.map
@@ -1,10 +1,11 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-15114177.cjs.js');
3
+ var index = require('./index-34d6a6a3.cjs.js');
4
4
  var os = require('os');
5
- var run = require('./run-0c9b9637.cjs.js');
5
+ var run = require('./run-596a22b2.cjs.js');
6
6
  var Lockfile = require('./Lockfile-35661afa.cjs.js');
7
7
  require('minimatch');
8
+ require('@manypkg/get-packages');
8
9
  require('chalk');
9
10
  require('commander');
10
11
  require('fs-extra');
@@ -42,4 +43,4 @@ var info = async () => {
42
43
  };
43
44
 
44
45
  exports["default"] = info;
45
- //# sourceMappingURL=info-fb86e821.cjs.js.map
46
+ //# sourceMappingURL=info-82d6df9a.cjs.js.map
@@ -3,13 +3,14 @@
3
3
  var fs = require('fs-extra');
4
4
  require('semver');
5
5
  require('@yarnpkg/lockfile');
6
- var packages = require('./packages-37922fa4.cjs.js');
7
- var index = require('./index-15114177.cjs.js');
6
+ var packages = require('./packages-deee570e.cjs.js');
7
+ var index = require('./index-34d6a6a3.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-0c9b9637.cjs.js');
11
+ var run = require('./run-596a22b2.cjs.js');
12
12
  require('minimatch');
13
+ require('@manypkg/get-packages');
13
14
  require('commander');
14
15
  require('@backstage/cli-common');
15
16
  require('@backstage/config/package.json');
@@ -239,4 +240,4 @@ var install = async (pluginId, cmd) => {
239
240
  };
240
241
 
241
242
  exports["default"] = install;
242
- //# sourceMappingURL=install-0e40a4b5.cjs.js.map
243
+ //# sourceMappingURL=install-c1cc1699.cjs.js.map
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var run = require('./run-0c9b9637.cjs.js');
4
- var index = require('./index-15114177.cjs.js');
3
+ var run = require('./run-596a22b2.cjs.js');
4
+ var index = require('./index-34d6a6a3.cjs.js');
5
5
  require('child_process');
6
6
  require('util');
7
7
  require('@backstage/errors');
@@ -26,4 +26,4 @@ var lint = async (cmd, cmdArgs) => {
26
26
  };
27
27
 
28
28
  exports["default"] = lint;
29
- //# sourceMappingURL=lint-d03a1e28.cjs.js.map
29
+ //# sourceMappingURL=lint-3a07e770.cjs.js.map
@@ -2,9 +2,10 @@
2
2
 
3
3
  var Lockfile = require('./Lockfile-35661afa.cjs.js');
4
4
  require('minimatch');
5
- require('./run-0c9b9637.cjs.js');
5
+ require('@manypkg/get-packages');
6
+ require('./run-596a22b2.cjs.js');
6
7
  require('chalk');
7
- var index = require('./index-15114177.cjs.js');
8
+ var index = require('./index-34d6a6a3.cjs.js');
8
9
  var partition = require('lodash/partition');
9
10
  require('fs-extra');
10
11
  require('semver');
@@ -75,4 +76,4 @@ function logArray(arr, header, each) {
75
76
  exports["default"] = lint;
76
77
  exports.forbiddenDuplicatesFilter = forbiddenDuplicatesFilter;
77
78
  exports.includedFilter = includedFilter;
78
- //# sourceMappingURL=lint-364632ce.cjs.js.map
79
+ //# sourceMappingURL=lint-90b05512.cjs.js.map
@@ -0,0 +1,69 @@
1
+ 'use strict';
2
+
3
+ var fs = require('fs-extra');
4
+ var index = require('./index-34d6a6a3.cjs.js');
5
+ var path = require('path');
6
+ require('commander');
7
+ require('chalk');
8
+ require('semver');
9
+ require('@backstage/cli-common');
10
+ require('@backstage/config/package.json');
11
+ require('@backstage/errors');
12
+
13
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
14
+
15
+ var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);
16
+
17
+ const SKIPPED_KEYS = ["access", "registry", "tag", "alphaTypes", "betaTypes"];
18
+ const PKG_PATH = "package.json";
19
+ const PKG_BACKUP_PATH = "package.json-prepack";
20
+ async function writeReleaseStageEntrypoint(pkg, stage) {
21
+ await fs__default["default"].ensureDir(index.paths.resolveTarget(stage));
22
+ await fs__default["default"].writeJson(index.paths.resolveTarget(stage, PKG_PATH), {
23
+ name: pkg.name,
24
+ version: pkg.version,
25
+ main: (pkg.publishConfig.main || pkg.main) && "..",
26
+ module: (pkg.publishConfig.module || pkg.module) && "..",
27
+ browser: (pkg.publishConfig.browser || pkg.browser) && "..",
28
+ types: path.join("..", pkg.publishConfig[`${stage}Types`])
29
+ }, { encoding: "utf8", spaces: 2 });
30
+ }
31
+ const pre = async () => {
32
+ var _a;
33
+ const pkgPath = index.paths.resolveTarget(PKG_PATH);
34
+ const pkgContent = await fs__default["default"].readFile(pkgPath, "utf8");
35
+ const pkg = JSON.parse(pkgContent);
36
+ await fs__default["default"].writeFile(PKG_BACKUP_PATH, pkgContent);
37
+ const publishConfig = (_a = pkg.publishConfig) != null ? _a : {};
38
+ for (const key of Object.keys(publishConfig)) {
39
+ if (!SKIPPED_KEYS.includes(key)) {
40
+ pkg[key] = publishConfig[key];
41
+ }
42
+ }
43
+ await fs__default["default"].writeJson(pkgPath, pkg, { encoding: "utf8", spaces: 2 });
44
+ if (publishConfig.alphaTypes) {
45
+ await writeReleaseStageEntrypoint(pkg, "alpha");
46
+ }
47
+ if (publishConfig.betaTypes) {
48
+ await writeReleaseStageEntrypoint(pkg, "beta");
49
+ }
50
+ };
51
+ const post = async () => {
52
+ var _a, _b;
53
+ try {
54
+ await fs__default["default"].move(PKG_BACKUP_PATH, PKG_PATH, { overwrite: true });
55
+ const pkg = await fs__default["default"].readJson(PKG_PATH);
56
+ if ((_a = pkg.publishConfig) == null ? void 0 : _a.alphaTypes) {
57
+ await fs__default["default"].remove(index.paths.resolveTarget("alpha"));
58
+ }
59
+ if ((_b = pkg.publishConfig) == null ? void 0 : _b.betaTypes) {
60
+ await fs__default["default"].remove(index.paths.resolveTarget("beta"));
61
+ }
62
+ } catch (error) {
63
+ 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.`);
64
+ }
65
+ };
66
+
67
+ exports.post = post;
68
+ exports.pre = pre;
69
+ //# sourceMappingURL=pack-6d555709.cjs.js.map