@backstage/cli 0.30.0-next.3 → 0.30.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,63 @@
1
1
  # @backstage/cli
2
2
 
3
+ ## 0.30.0
4
+
5
+ ### Minor Changes
6
+
7
+ - cb76663: **BREAKING**: Add support for native ESM in Node.js code. This changes the behavior of dynamic import expressions in Node.js code. Typically this can be fixed by replacing `import(...)` with `require(...)`, with an `as typeof import(...)` cast if needed for types. This is because dynamic imports will no longer be transformed to `require(...)` calls, but instead be left as-is. This in turn allows you to load ESM modules from CommonJS code using `import(...)`.
8
+
9
+ This change adds support for the following in Node.js packages, across type checking, package builds, runtime transforms and Jest tests:
10
+
11
+ - Dynamic imports that load ESM modules from CommonJS code.
12
+ - Both `.mjs` and `.mts` files as explicit ESM files, as well as `.cjs` and `.cts` as explicit CommonJS files.
13
+ - Support for the `"type": "module"` field in `package.json` to indicate that the package is an ESM package.
14
+
15
+ There are a few caveats to be aware of:
16
+
17
+ - To enable support for native ESM in tests, you need to run the tests with the `--experimental-vm-modules` flag enabled, typically via `NODE_OPTIONS='--experimental-vm-modules'`.
18
+ - Declaring a package as `"type": "module"` in `package.json` is supported, but in tests it will cause all local transitive dependencies to also be treated as ESM, regardless of whether they declare `"type": "module"` or not.
19
+ - Node.js has an [ESM interoperability layer with CommonJS](https://nodejs.org/docs/latest-v22.x/api/esm.html#interoperability-with-commonjs) that allows for imports from ESM to identify named exports in CommonJS packages. This interoperability layer is **only** enabled when importing packages with a `.cts` or `.cjs` extension. This is because the interoperability layer is not fully compatible with the NPM ecosystem, and would break package if it was enabled for `.js` files.
20
+ - Dynamic imports of CommonJS packages will vary in shape depending on the runtime, i.e. test vs local development, etc. It is therefore recommended to avoid dynamic imports of CommonJS packages and instead use `require`, or to use the explicit CommonJS extensions as mentioned above. If you do need to dynamically import CommonJS packages, avoid using `default` exports, as the shape of them vary across different environments and you would otherwise need to manually unwrap the import based on the shape of the module object.
21
+
22
+ - b30e788: The `new` command is now powered by a new template system that allows you to define your own templates in a declarative way, as well as import existing templates from external sources. See the [CLI templates documentation](https://backstage.io/docs/tooling/cli/templates) for more information.
23
+
24
+ The following flags for the `new` command have been deprecated and will be removed in a future release:
25
+
26
+ - `--license=<license>`: Configure the global `license` instead.
27
+ - `--no-private`: Configure the global `private` instead.
28
+ - `--baseVersion=<version>`: Configure the global `version` instead.
29
+ - `--npmRegistry=<url>`: Configure the global `publishRegistry` instead.
30
+ - `--scope=<scope>`: Configure the global `namePrefix` and/or `namePluginInfix` instead.
31
+
32
+ As part of this change the template IDs and their options have changed. The following backwards compatibility mappings for the `--select` and `--option` flags are enabled when using the default set of templates, but they will also be removed in the future:
33
+
34
+ - `--select=plugin` is mapped to `--select=frontend-plugin` instead.
35
+ - `--option=id=<id>` is mapped to `--option=pluginId=<id>` instead.
36
+
37
+ ### Patch Changes
38
+
39
+ - f17ef61: The `versions:bump` command will now reject `*` as a pattern.
40
+ - 86c72c1: The packing process when running `build-workspace` with the `--alwaysYarnPack` flag now respects the `BACKSTAGE_CLI_BUILD_PARALLEL` environment variable, defaulting parallel work limits based on CPU availability.
41
+ - 2167afc: Treat static file assets as always being free from side effects in package builds.
42
+ - f54eed0: Fixed an issue where default feature type information wasn't being added to package.json/exports before publishing if exports didn't exist beforehand
43
+ - 90a1edf: Add check to make sure that the `--link` option for the `start` command is a valid workspace.
44
+ - 207f88f: Fixed the file path pattern of many static assets output as part of the frontend build process, where there was an extra `.` before the extension, leading to names like `image-af7946b..png`.
45
+ - 9638f6d: Only allow pass through of `.mjs` in Jest transform if static ESM is supported.
46
+ - 9d49e04: Replaced dependency `node-libs-browser` with `node-stdlib-browser`
47
+ - 2c14147: Corrected path when trying to add dependency to respective `package.json` when using `yarn new` templates
48
+ - f21b125: Ensure that both global-agent and undici agents are enabled when proxying is enabled.
49
+ - Updated dependencies
50
+ - @backstage/cli-node@0.2.13
51
+ - @backstage/config-loader@1.9.6
52
+ - @backstage/catalog-model@1.7.3
53
+ - @backstage/cli-common@0.1.15
54
+ - @backstage/config@1.3.2
55
+ - @backstage/errors@1.2.7
56
+ - @backstage/eslint-plugin@0.1.10
57
+ - @backstage/integration@1.16.1
58
+ - @backstage/release-manifests@0.0.12
59
+ - @backstage/types@1.2.1
60
+
3
61
  ## 0.30.0-next.3
4
62
 
5
63
  ### Minor Changes
@@ -1,11 +1,37 @@
1
1
  'use strict';
2
2
 
3
+ var fs = require('fs-extra');
4
+ var node_path = require('node:path');
3
5
  var role = require('../../lib/role.cjs.js');
4
6
  var startBackend = require('./startBackend.cjs.js');
5
7
  var startFrontend = require('./startFrontend.cjs.js');
8
+ var errors = require('@backstage/errors');
9
+
10
+ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
11
+
12
+ var fs__default = /*#__PURE__*/_interopDefaultCompat(fs);
6
13
 
7
14
  async function command(opts) {
8
15
  const role$1 = await role.findRoleFromCommand(opts);
16
+ if (opts.link) {
17
+ const dir = node_path.resolve(opts.link);
18
+ if (!fs__default.default.pathExistsSync(dir)) {
19
+ throw new Error(
20
+ `Invalid workspace link, directory does not exist: ${dir}`
21
+ );
22
+ }
23
+ const pkgJson = await fs__default.default.readJson(node_path.resolve(dir, "package.json")).catch((error) => {
24
+ throw new errors.ForwardedError(
25
+ "Failed to read package.json in linked workspace",
26
+ error
27
+ );
28
+ });
29
+ if (!pkgJson.workspaces) {
30
+ throw new Error(
31
+ `Invalid workspace link, directory is not a workspace: ${dir}`
32
+ );
33
+ }
34
+ }
9
35
  const options = {
10
36
  configPaths: opts.config,
11
37
  checksEnabled: Boolean(opts.check),
@@ -318,7 +318,7 @@ async function createConfig(paths, options) {
318
318
  extensions: [".ts", ".tsx", ".mjs", ".js", ".jsx", ".json", ".wasm"],
319
319
  mainFields: ["browser", "module", "main"],
320
320
  fallback: {
321
- ...pickBy__default.default(require("node-libs-browser")),
321
+ ...pickBy__default.default(require("node-stdlib-browser")),
322
322
  module: false,
323
323
  dgram: false,
324
324
  dns: false,
@@ -23,18 +23,18 @@ async function installNewPackage(input) {
23
23
  return;
24
24
  // No installation action needed for library packages
25
25
  case "frontend-plugin":
26
- await addDependency(input, "package/app/package.json");
26
+ await addDependency(input, "packages/app/package.json");
27
27
  await tryAddFrontendLegacy(input);
28
28
  return;
29
29
  case "frontend-plugin-module":
30
- await addDependency(input, "package/app/package.json");
30
+ await addDependency(input, "packages/app/package.json");
31
31
  return;
32
32
  case "backend-plugin":
33
- await addDependency(input, "package/backend/package.json");
33
+ await addDependency(input, "packages/backend/package.json");
34
34
  await tryAddBackend(input);
35
35
  return;
36
36
  case "backend-plugin-module":
37
- await addDependency(input, "package/backend/package.json");
37
+ await addDependency(input, "packages/backend/package.json");
38
38
  await tryAddBackend(input);
39
39
  return;
40
40
  default:
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var version = "0.8.0-next.3";
3
+ var version = "0.8.0";
4
4
 
5
5
  exports.version = version;
6
6
  //# sourceMappingURL=package.json.cjs.js.map
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var version = "1.2.0-next.2";
3
+ var version = "1.2.0";
4
4
 
5
5
  exports.version = version;
6
6
  //# sourceMappingURL=package.json.cjs.js.map
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var version = "1.3.0-next.3";
3
+ var version = "1.3.0";
4
4
 
5
5
  exports.version = version;
6
6
  //# sourceMappingURL=package.json.cjs.js.map
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var version = "0.30.0-next.3";
3
+ var version = "0.30.0";
4
4
  var dependencies = {
5
5
  "@backstage/catalog-model": "workspace:^",
6
6
  "@backstage/cli-common": "workspace:^",
@@ -82,7 +82,7 @@ var dependencies = {
82
82
  lodash: "^4.17.21",
83
83
  "mini-css-extract-plugin": "^2.4.2",
84
84
  minimatch: "^9.0.0",
85
- "node-libs-browser": "^2.2.1",
85
+ "node-stdlib-browser": "^1.3.1",
86
86
  "npm-packlist": "^5.0.0",
87
87
  ora: "^5.3.0",
88
88
  "p-queue": "^6.6.2",
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var version = "1.15.5-next.0";
3
+ var version = "1.15.5";
4
4
 
5
5
  exports.version = version;
6
6
  //# sourceMappingURL=package.json.cjs.js.map
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var version = "0.16.4-next.1";
3
+ var version = "0.16.4";
4
4
 
5
5
  exports.version = version;
6
6
  //# sourceMappingURL=package.json.cjs.js.map
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var version = "1.10.4-next.0";
3
+ var version = "1.10.4";
4
4
 
5
5
  exports.version = version;
6
6
  //# sourceMappingURL=package.json.cjs.js.map
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var version = "1.1.7-next.3";
3
+ var version = "1.1.7";
4
4
 
5
5
  exports.version = version;
6
6
  //# sourceMappingURL=package.json.cjs.js.map
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var version = "1.7.5-next.0";
3
+ var version = "1.7.5";
4
4
 
5
5
  exports.version = version;
6
6
  //# sourceMappingURL=package.json.cjs.js.map
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var version = "0.6.4-next.0";
3
+ var version = "0.6.4";
4
4
 
5
5
  exports.version = version;
6
6
  //# sourceMappingURL=package.json.cjs.js.map
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var version = "0.24.3-next.3";
3
+ var version = "0.24.3";
4
4
 
5
5
  exports.version = version;
6
6
  //# sourceMappingURL=package.json.cjs.js.map
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var version = "0.2.5-next.2";
3
+ var version = "0.2.5";
4
4
 
5
5
  exports.version = version;
6
6
  //# sourceMappingURL=package.json.cjs.js.map
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var version = "1.16.0-next.3";
3
+ var version = "1.16.0";
4
4
 
5
5
  exports.version = version;
6
6
  //# sourceMappingURL=package.json.cjs.js.map
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var version = "0.7.0-next.2";
3
+ var version = "0.7.0";
4
4
 
5
5
  exports.version = version;
6
6
  //# sourceMappingURL=package.json.cjs.js.map
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var version = "0.1.19-next.3";
3
+ var version = "0.1.19";
4
4
 
5
5
  exports.version = version;
6
6
  //# sourceMappingURL=package.json.cjs.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/cli",
3
- "version": "0.30.0-next.3",
3
+ "version": "0.30.0",
4
4
  "description": "CLI for developing Backstage plugins and apps",
5
5
  "backstage": {
6
6
  "role": "cli"
@@ -47,16 +47,16 @@
47
47
  ]
48
48
  },
49
49
  "dependencies": {
50
- "@backstage/catalog-model": "1.7.3",
51
- "@backstage/cli-common": "0.1.15",
52
- "@backstage/cli-node": "0.2.13-next.1",
53
- "@backstage/config": "1.3.2",
54
- "@backstage/config-loader": "1.9.6-next.0",
55
- "@backstage/errors": "1.2.7",
56
- "@backstage/eslint-plugin": "0.1.10",
57
- "@backstage/integration": "1.16.1",
58
- "@backstage/release-manifests": "0.0.12",
59
- "@backstage/types": "1.2.1",
50
+ "@backstage/catalog-model": "^1.7.3",
51
+ "@backstage/cli-common": "^0.1.15",
52
+ "@backstage/cli-node": "^0.2.13",
53
+ "@backstage/config": "^1.3.2",
54
+ "@backstage/config-loader": "^1.9.6",
55
+ "@backstage/errors": "^1.2.7",
56
+ "@backstage/eslint-plugin": "^0.1.10",
57
+ "@backstage/integration": "^1.16.1",
58
+ "@backstage/release-manifests": "^0.0.12",
59
+ "@backstage/types": "^1.2.1",
60
60
  "@manypkg/get-packages": "^1.1.3",
61
61
  "@module-federation/enhanced": "^0.8.0",
62
62
  "@octokit/graphql": "^5.0.0",
@@ -127,7 +127,7 @@
127
127
  "lodash": "^4.17.21",
128
128
  "mini-css-extract-plugin": "^2.4.2",
129
129
  "minimatch": "^9.0.0",
130
- "node-libs-browser": "^2.2.1",
130
+ "node-stdlib-browser": "^1.3.1",
131
131
  "npm-packlist": "^5.0.0",
132
132
  "ora": "^5.3.0",
133
133
  "p-queue": "^6.6.2",
@@ -163,22 +163,22 @@
163
163
  "zod-validation-error": "^3.4.0"
164
164
  },
165
165
  "devDependencies": {
166
- "@backstage/backend-plugin-api": "1.2.0-next.2",
167
- "@backstage/backend-test-utils": "1.3.0-next.3",
168
- "@backstage/catalog-client": "1.9.1",
169
- "@backstage/config": "1.3.2",
170
- "@backstage/core-app-api": "1.15.5-next.0",
171
- "@backstage/core-components": "0.16.4-next.1",
172
- "@backstage/core-plugin-api": "1.10.4-next.0",
173
- "@backstage/dev-utils": "1.1.7-next.3",
174
- "@backstage/errors": "1.2.7",
175
- "@backstage/plugin-auth-backend": "0.24.3-next.3",
176
- "@backstage/plugin-auth-backend-module-guest-provider": "0.2.5-next.2",
177
- "@backstage/plugin-catalog-node": "1.16.0-next.3",
178
- "@backstage/plugin-scaffolder-node": "0.7.0-next.2",
179
- "@backstage/plugin-scaffolder-node-test-utils": "0.1.19-next.3",
180
- "@backstage/test-utils": "1.7.5-next.0",
181
- "@backstage/theme": "0.6.4-next.0",
166
+ "@backstage/backend-plugin-api": "^1.2.0",
167
+ "@backstage/backend-test-utils": "^1.3.0",
168
+ "@backstage/catalog-client": "^1.9.1",
169
+ "@backstage/config": "^1.3.2",
170
+ "@backstage/core-app-api": "^1.15.5",
171
+ "@backstage/core-components": "^0.16.4",
172
+ "@backstage/core-plugin-api": "^1.10.4",
173
+ "@backstage/dev-utils": "^1.1.7",
174
+ "@backstage/errors": "^1.2.7",
175
+ "@backstage/plugin-auth-backend": "^0.24.3",
176
+ "@backstage/plugin-auth-backend-module-guest-provider": "^0.2.5",
177
+ "@backstage/plugin-catalog-node": "^1.16.0",
178
+ "@backstage/plugin-scaffolder-node": "^0.7.0",
179
+ "@backstage/plugin-scaffolder-node-test-utils": "^0.1.19",
180
+ "@backstage/test-utils": "^1.7.5",
181
+ "@backstage/theme": "^0.6.4",
182
182
  "@rspack/core": "^1.0.10",
183
183
  "@rspack/dev-server": "^1.0.9",
184
184
  "@rspack/plugin-react-refresh": "^1.0.0",