@backstage/cli 0.11.0 → 0.13.1-next.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 (39) hide show
  1. package/CHANGELOG.md +164 -0
  2. package/dist/cjs/{build-821a11bc.cjs.js → build-380254f7.cjs.js} +8 -4
  3. package/dist/cjs/{build-52b0db70.cjs.js → build-5d1cb969.cjs.js} +5 -4
  4. package/dist/cjs/{build-3ec9b2bc.cjs.js → build-669ecde7.cjs.js} +7 -10
  5. package/dist/cjs/{build-cee864c1.cjs.js → build-be81c94d.cjs.js} +5 -4
  6. package/dist/cjs/{buildWorkspace-45130a91.cjs.js → buildWorkspace-5c2e178b.cjs.js} +4 -4
  7. package/dist/cjs/{bump-a67373dc.cjs.js → bump-2cfa8a5a.cjs.js} +5 -5
  8. package/dist/cjs/{bundle-a7edd074.cjs.js → bundle-b573b38a.cjs.js} +5 -5
  9. package/dist/cjs/{clean-639396b1.cjs.js → clean-780112f6.cjs.js} +2 -2
  10. package/dist/cjs/{config-123cfeb7.cjs.js → config-ee0c4a83.cjs.js} +4 -3
  11. package/dist/cjs/{create-fa295702.cjs.js → create-48c86908.cjs.js} +4 -4
  12. package/dist/cjs/{createPlugin-e3f24ce4.cjs.js → createPlugin-7d56930f.cjs.js} +4 -4
  13. package/dist/cjs/{dev-770fcb5a.cjs.js → dev-3c88dd2a.cjs.js} +5 -4
  14. package/dist/cjs/{diff-1cb77679.cjs.js → diff-df7c9a0c.cjs.js} +2 -2
  15. package/dist/cjs/{docs-0c0c53e6.cjs.js → docs-c11c4103.cjs.js} +3 -3
  16. package/dist/cjs/{index-f1e57e57.cjs.js → index-18554f1c.cjs.js} +2 -2
  17. package/dist/cjs/{index-cf8ea481.cjs.js → index-621ba6c9.cjs.js} +53 -56
  18. package/dist/cjs/{index-79dd2453.cjs.js → index-cb0ecebc.cjs.js} +3 -3
  19. package/dist/cjs/{info-ac02891f.cjs.js → info-db368553.cjs.js} +3 -3
  20. package/dist/cjs/{install-f342f3ba.cjs.js → install-b711cea1.cjs.js} +4 -4
  21. package/dist/cjs/{lint-a6f00949.cjs.js → lint-2d7a9bdc.cjs.js} +3 -3
  22. package/dist/cjs/{lint-b832c4cb.cjs.js → lint-fb6d3fe7.cjs.js} +3 -3
  23. package/dist/cjs/pack-0225b8ee.cjs.js +69 -0
  24. package/dist/cjs/{packager-23503c79.cjs.js → packager-03db0c91.cjs.js} +101 -8
  25. package/dist/cjs/{packages-c57bbd82.cjs.js → packages-ea22fb5a.cjs.js} +3 -3
  26. package/dist/cjs/{paths-8ed90bf4.cjs.js → paths-f1f75c0e.cjs.js} +23 -28
  27. package/dist/cjs/{print-806737e5.cjs.js → print-23333c9a.cjs.js} +3 -3
  28. package/dist/cjs/{run-267170f8.cjs.js → run-615f671f.cjs.js} +2 -2
  29. package/dist/cjs/{schema-80d0f67f.cjs.js → schema-47f19cb7.cjs.js} +3 -3
  30. package/dist/cjs/{serve-08f7c81f.cjs.js → serve-0d165973.cjs.js} +7 -6
  31. package/dist/cjs/{serve-da609963.cjs.js → serve-c7a64437.cjs.js} +37 -19
  32. package/dist/cjs/{server-8a3d6585.cjs.js → server-d167ef2f.cjs.js} +6 -3
  33. package/dist/cjs/{tasks-6f86c24f.cjs.js → tasks-0a084d00.cjs.js} +2 -2
  34. package/dist/cjs/{testCommand-08baa990.cjs.js → testCommand-53436344.cjs.js} +3 -3
  35. package/dist/cjs/{validate-b3cefb09.cjs.js → validate-aa20bf78.cjs.js} +5 -4
  36. package/dist/index.cjs.js +1 -1
  37. package/package.json +27 -24
  38. package/dist/cjs/pack-30336e9e.cjs.js +0 -42
  39. package/dist/cjs/removePlugin-4925434c.cjs.js +0 -175
@@ -46,13 +46,13 @@ class NotFoundError extends CustomError {
46
46
 
47
47
  const paths = cliCommon.findPaths(__dirname);
48
48
 
49
- var version$9 = "0.10.3";
49
+ var version$9 = "0.10.5";
50
50
 
51
- var version$8 = "0.11.0";
51
+ var version$8 = "0.13.1-next.0";
52
52
  var dependencies = {
53
53
  "@backstage/cli-common": "^0.1.6",
54
- "@backstage/config": "^0.1.12",
55
- "@backstage/config-loader": "^0.9.2",
54
+ "@backstage/config": "^0.1.13",
55
+ "@backstage/config-loader": "^0.9.3",
56
56
  "@backstage/errors": "^0.2.0",
57
57
  "@backstage/types": "^0.1.1",
58
58
  "@hot-loader/react-dom": "^16.13.0",
@@ -67,8 +67,8 @@ var dependencies = {
67
67
  "@spotify/eslint-config-typescript": "^12.0.0",
68
68
  "@sucrase/jest-plugin": "^2.1.1",
69
69
  "@sucrase/webpack-loader": "^2.0.0",
70
- "@svgr/plugin-jsx": "5.5.x",
71
- "@svgr/plugin-svgo": "5.4.x",
70
+ "@svgr/plugin-jsx": "6.2.x",
71
+ "@svgr/plugin-svgo": "6.2.x",
72
72
  "@svgr/rollup": "5.5.x",
73
73
  "@svgr/webpack": "5.5.x",
74
74
  "@types/webpack-env": "^1.15.2",
@@ -85,6 +85,7 @@ var dependencies = {
85
85
  esbuild: "^0.14.10",
86
86
  "esbuild-loader": "^2.18.0",
87
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
91
  "eslint-plugin-import": "^2.25.4",
@@ -94,7 +95,7 @@ var dependencies = {
94
95
  "eslint-plugin-react": "^7.28.0",
95
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.3",
141
- "@backstage/config": "^0.1.12",
142
- "@backstage/core-components": "^0.8.4",
143
- "@backstage/core-plugin-api": "^0.5.0",
144
- "@backstage/core-app-api": "^0.4.0",
145
- "@backstage/dev-utils": "^0.2.17",
146
- "@backstage/test-utils": "^0.2.2",
140
+ "@backstage/backend-common": "^0.10.5",
141
+ "@backstage/config": "^0.1.13",
142
+ "@backstage/core-components": "^0.8.7-next.0",
143
+ "@backstage/core-plugin-api": "^0.6.0",
144
+ "@backstage/core-app-api": "^0.5.1",
145
+ "@backstage/dev-utils": "^0.2.20-next.0",
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.4.0";
168
+ var version$7 = "0.5.1";
171
169
 
172
- var version$6 = "0.8.4";
170
+ var version$6 = "0.8.7-next.0";
173
171
 
174
- var version$5 = "0.5.0";
172
+ var version$5 = "0.6.0";
175
173
 
176
- var version$4 = "0.2.17";
174
+ var version$4 = "0.2.20-next.0";
177
175
 
178
- var version$3 = "0.2.2";
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.20";
180
+ var version$1 = "0.15.23-next.0";
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-3ec9b2bc.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-da609963.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-cee864c1.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-a7edd074.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-770fcb5a.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-fa295702.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-e3f24ce4.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-4925434c.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-52b0db70.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-08f7c81f.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-1cb77679.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-821a11bc.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-a6f00949.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-08baa990.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-0c0c53e6.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-806737e5.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-b3cefb09.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-80d0f67f.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-a67373dc.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-b832c4cb.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-30336e9e.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-30336e9e.cjs.js'); }).then((m) => m.post)));
258
- program.command("clean").description("Delete cache directories").action(lazy(() => Promise.resolve().then(function () { return require('./clean-639396b1.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-45130a91.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-f1e57e57.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-ac02891f.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-f342f3ba.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-669ecde7.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-c7a64437.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-be81c94d.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-b573b38a.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-3c88dd2a.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-48c86908.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-7d56930f.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-5d1cb969.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-0d165973.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-df7c9a0c.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-380254f7.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-2d7a9bdc.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-53436344.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-c11c4103.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-23333c9a.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-aa20bf78.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-47f19cb7.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-2cfa8a5a.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-fb6d3fe7.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-0225b8ee.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-0225b8ee.cjs.js'); }).then((m) => m.post)));
255
+ program.command("clean").description("Delete cache directories").action(lazy(() => Promise.resolve().then(function () { return require('./clean-780112f6.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-5c2e178b.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-18554f1c.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-db368553.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-b711cea1.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-cf8ea481.cjs.js.map
303
+ //# sourceMappingURL=index-621ba6c9.cjs.js.map
@@ -4,8 +4,8 @@ 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-cf8ea481.cjs.js');
8
- var run = require('./run-267170f8.cjs.js');
7
+ var index = require('./index-621ba6c9.cjs.js');
8
+ var run = require('./run-615f671f.cjs.js');
9
9
  var getPackages = require('@manypkg/get-packages');
10
10
  var PackageGraph = require('./PackageGraph-7a0d3a83.cjs.js');
11
11
 
@@ -103,4 +103,4 @@ async function moveToDistWorkspace(workspaceDir, localPackages) {
103
103
  }
104
104
 
105
105
  exports.createDistWorkspace = createDistWorkspace;
106
- //# sourceMappingURL=index-79dd2453.cjs.js.map
106
+ //# sourceMappingURL=index-cb0ecebc.cjs.js.map
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-cf8ea481.cjs.js');
3
+ var index = require('./index-621ba6c9.cjs.js');
4
4
  var os = require('os');
5
- var run = require('./run-267170f8.cjs.js');
5
+ var run = require('./run-615f671f.cjs.js');
6
6
  var Lockfile = require('./Lockfile-35661afa.cjs.js');
7
7
  require('minimatch');
8
8
  require('@manypkg/get-packages');
@@ -43,4 +43,4 @@ var info = async () => {
43
43
  };
44
44
 
45
45
  exports["default"] = info;
46
- //# sourceMappingURL=info-ac02891f.cjs.js.map
46
+ //# sourceMappingURL=info-db368553.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-c57bbd82.cjs.js');
7
- var index = require('./index-cf8ea481.cjs.js');
6
+ var packages = require('./packages-ea22fb5a.cjs.js');
7
+ var index = require('./index-621ba6c9.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-267170f8.cjs.js');
11
+ var run = require('./run-615f671f.cjs.js');
12
12
  require('minimatch');
13
13
  require('@manypkg/get-packages');
14
14
  require('commander');
@@ -240,4 +240,4 @@ var install = async (pluginId, cmd) => {
240
240
  };
241
241
 
242
242
  exports["default"] = install;
243
- //# sourceMappingURL=install-f342f3ba.cjs.js.map
243
+ //# sourceMappingURL=install-b711cea1.cjs.js.map
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var run = require('./run-267170f8.cjs.js');
4
- var index = require('./index-cf8ea481.cjs.js');
3
+ var run = require('./run-615f671f.cjs.js');
4
+ var index = require('./index-621ba6c9.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-a6f00949.cjs.js.map
29
+ //# sourceMappingURL=lint-2d7a9bdc.cjs.js.map
@@ -3,9 +3,9 @@
3
3
  var Lockfile = require('./Lockfile-35661afa.cjs.js');
4
4
  require('minimatch');
5
5
  require('@manypkg/get-packages');
6
- require('./run-267170f8.cjs.js');
6
+ require('./run-615f671f.cjs.js');
7
7
  require('chalk');
8
- var index = require('./index-cf8ea481.cjs.js');
8
+ var index = require('./index-621ba6c9.cjs.js');
9
9
  var partition = require('lodash/partition');
10
10
  require('fs-extra');
11
11
  require('semver');
@@ -76,4 +76,4 @@ function logArray(arr, header, each) {
76
76
  exports["default"] = lint;
77
77
  exports.forbiddenDuplicatesFilter = forbiddenDuplicatesFilter;
78
78
  exports.includedFilter = includedFilter;
79
- //# sourceMappingURL=lint-b832c4cb.cjs.js.map
79
+ //# sourceMappingURL=lint-fb6d3fe7.cjs.js.map
@@ -0,0 +1,69 @@
1
+ 'use strict';
2
+
3
+ var fs = require('fs-extra');
4
+ var index = require('./index-621ba6c9.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-0225b8ee.cjs.js.map
@@ -4,7 +4,7 @@ var fs = require('fs-extra');
4
4
  var rollup = require('rollup');
5
5
  var chalk = require('chalk');
6
6
  var path = require('path');
7
- var index = require('./index-cf8ea481.cjs.js');
7
+ var index = require('./index-621ba6c9.cjs.js');
8
8
  var peerDepsExternal = require('rollup-plugin-peer-deps-external');
9
9
  var commonjs = require('@rollup/plugin-commonjs');
10
10
  var resolve = require('@rollup/plugin-node-resolve');
@@ -95,7 +95,7 @@ var Output = /* @__PURE__ */ ((Output2) => {
95
95
  return Output2;
96
96
  })(Output || {});
97
97
 
98
- const makeConfigs = async (options) => {
98
+ async function makeRollupConfigs(options) {
99
99
  const configs = new Array();
100
100
  if (options.outputs.has(Output.cjs) || options.outputs.has(Output.esm)) {
101
101
  const output = new Array();
@@ -161,7 +161,7 @@ const makeConfigs = async (options) => {
161
161
  ]
162
162
  });
163
163
  }
164
- if (options.outputs.has(Output.types)) {
164
+ if (options.outputs.has(Output.types) && !options.useApiExtractor) {
165
165
  const typesInput = index.paths.resolveTargetRoot("dist-types", path.relative(index.paths.targetRoot, index.paths.targetDir), "src/index.d.ts");
166
166
  const declarationsExist = await fs__default["default"].pathExists(typesInput);
167
167
  if (!declarationsExist) {
@@ -178,7 +178,96 @@ const makeConfigs = async (options) => {
178
178
  });
179
179
  }
180
180
  return configs;
181
- };
181
+ }
182
+
183
+ const ignoredMessages = /* @__PURE__ */ new Set(["tsdoc-undefined-tag", "ae-forgotten-export"]);
184
+ let apiExtractor;
185
+ function prepareApiExtractor() {
186
+ if (apiExtractor) {
187
+ return apiExtractor;
188
+ }
189
+ try {
190
+ apiExtractor = require("@microsoft/api-extractor");
191
+ } catch (error) {
192
+ throw new Error("Failed to resolve @microsoft/api-extractor, it must best installed as a dependency of your project in order to use experimental type builds");
193
+ }
194
+ const {
195
+ PackageJsonLookup
196
+ } = require("@rushstack/node-core-library/lib/PackageJsonLookup");
197
+ const old = PackageJsonLookup.prototype.tryGetPackageJsonFilePathFor;
198
+ PackageJsonLookup.prototype.tryGetPackageJsonFilePathFor = function tryGetPackageJsonFilePathForPatch(path$1) {
199
+ if (path$1.includes("@material-ui") && !path.dirname(path$1).endsWith("@material-ui")) {
200
+ return void 0;
201
+ }
202
+ return old.call(this, path$1);
203
+ };
204
+ return apiExtractor;
205
+ }
206
+ async function buildTypeDefinitions() {
207
+ const { Extractor, ExtractorConfig } = prepareApiExtractor();
208
+ const distTypesPackageDir = index.paths.resolveTargetRoot("dist-types", path.relative(index.paths.targetRoot, index.paths.targetDir));
209
+ const entryPoint = path.resolve(distTypesPackageDir, "src/index.d.ts");
210
+ const declarationsExist = await fs__default["default"].pathExists(entryPoint);
211
+ if (!declarationsExist) {
212
+ const path$1 = path.relative(index.paths.targetDir, entryPoint);
213
+ throw new Error(`No declaration files found at ${path$1}, be sure to run ${chalk__default["default"].bgRed.white("yarn tsc")} to generate .d.ts files before packaging`);
214
+ }
215
+ const extractorConfig = ExtractorConfig.prepare({
216
+ configObject: {
217
+ mainEntryPointFilePath: entryPoint,
218
+ bundledPackages: [],
219
+ compiler: {
220
+ skipLibCheck: true,
221
+ tsconfigFilePath: index.paths.resolveTargetRoot("tsconfig.json")
222
+ },
223
+ dtsRollup: {
224
+ enabled: true,
225
+ untrimmedFilePath: index.paths.resolveTarget("dist/index.alpha.d.ts"),
226
+ betaTrimmedFilePath: index.paths.resolveTarget("dist/index.beta.d.ts"),
227
+ publicTrimmedFilePath: index.paths.resolveTarget("dist/index.d.ts")
228
+ },
229
+ newlineKind: "lf",
230
+ projectFolder: index.paths.targetDir
231
+ },
232
+ configObjectFullPath: index.paths.targetDir,
233
+ packageJsonFullPath: index.paths.resolveTarget("package.json")
234
+ });
235
+ const typescriptDir = index.paths.resolveTargetRoot("node_modules/typescript");
236
+ const hasTypescript = await fs__default["default"].pathExists(typescriptDir);
237
+ const extractorResult = Extractor.invoke(extractorConfig, {
238
+ typescriptCompilerFolder: hasTypescript ? typescriptDir : void 0,
239
+ localBuild: false,
240
+ showVerboseMessages: false,
241
+ showDiagnostics: false,
242
+ messageCallback(message) {
243
+ message.handled = true;
244
+ if (ignoredMessages.has(message.messageId)) {
245
+ return;
246
+ }
247
+ let text = `${message.text} (${message.messageId})`;
248
+ if (message.sourceFilePath) {
249
+ text += " at ";
250
+ text += path.relative(distTypesPackageDir, message.sourceFilePath);
251
+ if (message.sourceFileLine) {
252
+ text += `:${message.sourceFileLine}`;
253
+ if (message.sourceFileColumn) {
254
+ text += `:${message.sourceFileColumn}`;
255
+ }
256
+ }
257
+ }
258
+ if (message.logLevel === "error") {
259
+ console.error(chalk__default["default"].red(`Error: ${text}`));
260
+ } else if (message.logLevel === "warning" || message.category === "Extractor") {
261
+ console.warn(`Warning: ${text}`);
262
+ } else {
263
+ console.log(text);
264
+ }
265
+ }
266
+ });
267
+ if (!extractorResult.succeeded) {
268
+ throw new Error(`Type definition build completed with ${extractorResult.errorCount} errors and ${extractorResult.warningCount} warnings`);
269
+ }
270
+ }
182
271
 
183
272
  function formatErrorMessage(error) {
184
273
  var _a;
@@ -228,7 +317,7 @@ function formatErrorMessage(error) {
228
317
  }
229
318
  return msg;
230
319
  }
231
- async function build(config) {
320
+ async function rollupBuild(config) {
232
321
  try {
233
322
  const bundle = await rollup.rollup(config);
234
323
  if (config.output) {
@@ -249,11 +338,15 @@ const buildPackage = async (options) => {
249
338
  }
250
339
  } catch {
251
340
  }
252
- const configs = await makeConfigs(options);
341
+ const rollupConfigs = await makeRollupConfigs(options);
253
342
  await fs__default["default"].remove(index.paths.resolveTarget("dist"));
254
- await Promise.all(configs.map(build));
343
+ const buildTasks = rollupConfigs.map(rollupBuild);
344
+ if (options.outputs.has(Output.types) && options.useApiExtractor) {
345
+ buildTasks.push(buildTypeDefinitions());
346
+ }
347
+ await Promise.all(buildTasks);
255
348
  };
256
349
 
257
350
  exports.Output = Output;
258
351
  exports.buildPackage = buildPackage;
259
- //# sourceMappingURL=packager-23503c79.cjs.js.map
352
+ //# sourceMappingURL=packager-03db0c91.cjs.js.map
@@ -2,8 +2,8 @@
2
2
 
3
3
  var minimatch = require('minimatch');
4
4
  var getPackages = require('@manypkg/get-packages');
5
- var run = require('./run-267170f8.cjs.js');
6
- var index = require('./index-cf8ea481.cjs.js');
5
+ var run = require('./run-615f671f.cjs.js');
6
+ var index = require('./index-621ba6c9.cjs.js');
7
7
 
8
8
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
9
9
 
@@ -50,4 +50,4 @@ async function mapDependencies(targetDir, pattern) {
50
50
 
51
51
  exports.fetchPackageInfo = fetchPackageInfo;
52
52
  exports.mapDependencies = mapDependencies;
53
- //# sourceMappingURL=packages-c57bbd82.cjs.js.map
53
+ //# sourceMappingURL=packages-ea22fb5a.cjs.js.map