@backstage/cli 0.29.3-next.2 → 0.29.4

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 (28) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/config/nodeTransform.cjs +1 -1
  3. package/dist/commands/build/buildFrontend.cjs.js +7 -4
  4. package/dist/commands/repo/build.cjs.js +4 -1
  5. package/dist/commands/start/startFrontend.cjs.js +7 -4
  6. package/dist/lib/bundler/bundle.cjs.js +5 -0
  7. package/dist/lib/bundler/config.cjs.js +9 -3
  8. package/dist/lib/bundler/moduleFederation.cjs.js +26 -2
  9. package/dist/lib/bundler/server.cjs.js +5 -0
  10. package/dist/packages/backend-defaults/package.json.cjs.js +1 -1
  11. package/dist/packages/backend-plugin-api/package.json.cjs.js +1 -1
  12. package/dist/packages/backend-test-utils/package.json.cjs.js +1 -1
  13. package/dist/packages/catalog-client/package.json.cjs.js +1 -1
  14. package/dist/packages/cli/package.json.cjs.js +2 -2
  15. package/dist/packages/config/package.json.cjs.js +1 -1
  16. package/dist/packages/core-app-api/package.json.cjs.js +1 -1
  17. package/dist/packages/core-components/package.json.cjs.js +1 -1
  18. package/dist/packages/core-plugin-api/package.json.cjs.js +1 -1
  19. package/dist/packages/dev-utils/package.json.cjs.js +1 -1
  20. package/dist/packages/errors/package.json.cjs.js +1 -1
  21. package/dist/packages/test-utils/package.json.cjs.js +1 -1
  22. package/dist/packages/theme/package.json.cjs.js +1 -1
  23. package/dist/plugins/auth-backend/package.json.cjs.js +1 -1
  24. package/dist/plugins/auth-backend-module-guest-provider/package.json.cjs.js +1 -1
  25. package/dist/plugins/catalog-node/package.json.cjs.js +1 -1
  26. package/dist/plugins/scaffolder-node/package.json.cjs.js +1 -1
  27. package/dist/plugins/scaffolder-node-test-utils/package.json.cjs.js +1 -1
  28. package/package.json +28 -28
package/CHANGELOG.md CHANGED
@@ -1,5 +1,36 @@
1
1
  # @backstage/cli
2
2
 
3
+ ## 0.29.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 2b6c1ea: If the Backstage yarn plugin is installed, it will now be automatically updated as part of `versions:bump`.
8
+ - 7dcff85: Remove special-casing for `@types` packages when generating dependency entries
9
+ during templating
10
+ - 3c3a7e6: Revert `css-loader@v7` bump
11
+ - 0aff006: Bumped the version range for `html-webpack-plugin` to fix the `htmlPluginExports.getCompilationHooks is not a function` error when using experimental Rspack.
12
+ - 583f3d4: Added `@backstage/cli/config/prettier` as a replacement for `@spotify/prettier-config`, but with the same configuration.
13
+ - 62a9062: Updated dependency `@module-federation/enhanced` to `^0.8.0`.
14
+ - 5f04976: Update `rollup` to avoid issues with build output when running `backstage-cli package build`.
15
+ - 5f04976: Fixed a bug that caused missing code in published packages.
16
+ - a49030a: Add support for `--output-file` option from ESLint to `package lint` and `repo lint` commands.
17
+ - 96331fa: Enhance the behavior of the experimental support for module federation in the backstage CLI,
18
+ by using the `package.json` exports (when present) to complete the list of exposed modules.
19
+ This allows, for example, using exported `alpha` definitions through module federation.
20
+ - 5c9cc05: Use native fetch instead of node-fetch
21
+ - dcd99d2: added experimental RSPack support for build command in the repo scope
22
+ - Updated dependencies
23
+ - @backstage/integration@1.16.0
24
+ - @backstage/release-manifests@0.0.12
25
+ - @backstage/cli-node@0.2.11
26
+ - @backstage/config-loader@1.9.3
27
+ - @backstage/errors@1.2.6
28
+ - @backstage/catalog-model@1.7.2
29
+ - @backstage/cli-common@0.1.15
30
+ - @backstage/config@1.3.1
31
+ - @backstage/eslint-plugin@0.1.10
32
+ - @backstage/types@1.2.0
33
+
3
34
  ## 0.29.3-next.2
4
35
 
5
36
  ### Patch Changes
@@ -41,7 +41,7 @@ if (process.env.BACKSTAGE_CLI_LINKED_WORKSPACE) {
41
41
  }
42
42
 
43
43
  // The package import that we're overriding will always existing in the root
44
- // node_modules of the linked workspace, so it's enough to override the the
44
+ // node_modules of the linked workspace, so it's enough to override the
45
45
  // parent paths with that single entry
46
46
  return origLoad.call(this, request, {
47
47
  ...parent,
@@ -32,19 +32,22 @@ var fs__default = /*#__PURE__*/_interopDefaultCompat(fs);
32
32
 
33
33
  async function buildFrontend(options) {
34
34
  const { targetDir, writeStats, configPaths, rspack } = options;
35
- const { name } = await fs__default.default.readJson(path.resolve(targetDir, "package.json"));
35
+ const packageJson = await fs__default.default.readJson(
36
+ path.resolve(targetDir, "package.json")
37
+ );
36
38
  await bundle.buildBundle({
37
39
  targetDir,
38
40
  entry: "src/index",
39
41
  parallelism: parallel.getEnvironmentParallelism(),
40
42
  statsJsonEnabled: writeStats,
41
- moduleFederation: moduleFederation.getModuleFederationOptions(
42
- name,
43
+ moduleFederation: await moduleFederation.getModuleFederationOptions(
44
+ packageJson,
45
+ path.resolve(targetDir),
43
46
  options.isModuleFederationRemote
44
47
  ),
45
48
  ...await config.loadCliConfig({
46
49
  args: configPaths,
47
- fromPackage: name
50
+ fromPackage: packageJson.name
48
51
  }),
49
52
  rspack
50
53
  });
@@ -16,6 +16,8 @@ var chalk__default = /*#__PURE__*/_interopDefaultCompat(chalk);
16
16
 
17
17
  async function command(opts, cmd) {
18
18
  let packages = await cliNode.PackageGraph.listTargetPackages();
19
+ const shouldUseRspack = Boolean(process.env.EXPERIMENTAL_RSPACK);
20
+ const rspack = shouldUseRspack ? require("@rspack/core") : void 0;
19
21
  if (opts.since) {
20
22
  const graph = cliNode.PackageGraph.fromPackages(packages);
21
23
  const changedPackages = await graph.listChangedPackages({
@@ -83,7 +85,8 @@ async function command(opts, cmd) {
83
85
  await buildFrontend.buildFrontend({
84
86
  targetDir: pkg.dir,
85
87
  configPaths: buildOptions.config ?? [],
86
- writeStats: Boolean(buildOptions.stats)
88
+ writeStats: Boolean(buildOptions.stats),
89
+ rspack
87
90
  });
88
91
  }
89
92
  });
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  var fs = require('fs-extra');
4
+ var path = require('path');
4
5
  require('yn');
5
- require('path');
6
6
  require('webpack');
7
7
  require('react-dev-utils/FileSizeReporter');
8
8
  require('react-dev-utils/formatWebpackMessages');
@@ -25,7 +25,9 @@ var moduleFederation = require('../../lib/bundler/moduleFederation.cjs.js');
25
25
  var server = require('../../lib/bundler/server.cjs.js');
26
26
 
27
27
  async function startFrontend(options) {
28
- const { name } = await fs.readJson(paths.paths.resolveTarget("package.json"));
28
+ const packageJson = await fs.readJson(
29
+ paths.paths.resolveTarget("package.json")
30
+ );
29
31
  const waitForExit = await server.serveBundle({
30
32
  entry: options.entry,
31
33
  checksEnabled: options.checksEnabled,
@@ -33,8 +35,9 @@ async function startFrontend(options) {
33
35
  verifyVersions: options.verifyVersions,
34
36
  skipOpenBrowser: options.skipOpenBrowser,
35
37
  linkedWorkspace: options.linkedWorkspace,
36
- moduleFederation: moduleFederation.getModuleFederationOptions(
37
- name,
38
+ moduleFederation: await moduleFederation.getModuleFederationOptions(
39
+ packageJson,
40
+ path.resolve(paths.paths.targetDir),
38
41
  options.isModuleFederationRemote
39
42
  )
40
43
  });
@@ -91,6 +91,11 @@ async function buildBundle(options) {
91
91
  { spaces: 2 }
92
92
  );
93
93
  }
94
+ if (rspack) {
95
+ console.log(
96
+ chalk__default.default.yellow(`\u26A0\uFE0F WARNING: Using experimental RSPack bundler.`)
97
+ );
98
+ }
94
99
  const { stats } = await build(configs, isCi, rspack);
95
100
  if (!stats) {
96
101
  throw new Error("No stats returned");
@@ -170,13 +170,19 @@ async function createConfig(paths, options) {
170
170
  if (options.moduleFederation) {
171
171
  const isRemote = options.moduleFederation?.mode === "remote";
172
172
  const AdaptedModuleFederationPlugin = rspack ? rspack.container.ModuleFederationPlugin : webpack.ModuleFederationPlugin;
173
+ const exposes = options.moduleFederation?.exposes ? Object.fromEntries(
174
+ Object.entries(options.moduleFederation?.exposes).map(([k, v]) => [
175
+ k,
176
+ path.resolve(paths.targetPath, v)
177
+ ])
178
+ ) : {
179
+ ".": paths.targetEntry
180
+ };
173
181
  plugins.push(
174
182
  new AdaptedModuleFederationPlugin({
175
183
  ...isRemote && {
176
184
  filename: "remoteEntry.js",
177
- exposes: {
178
- ".": paths.targetEntry
179
- }
185
+ exposes
180
186
  },
181
187
  name: options.moduleFederation.name,
182
188
  runtime: false,
@@ -1,12 +1,14 @@
1
1
  'use strict';
2
2
 
3
3
  var chalk = require('chalk');
4
+ var entryPoints = require('../entryPoints.cjs.js');
5
+ var typeDistProject = require('../typeDistProject.cjs.js');
4
6
 
5
7
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
6
8
 
7
9
  var chalk__default = /*#__PURE__*/_interopDefaultCompat(chalk);
8
10
 
9
- function getModuleFederationOptions(name, isModuleFederationRemote) {
11
+ async function getModuleFederationOptions(packageJson, packageDir, isModuleFederationRemote) {
10
12
  if (!isModuleFederationRemote && !process.env.EXPERIMENTAL_MODULE_FEDERATION) {
11
13
  return void 0;
12
14
  }
@@ -15,12 +17,34 @@ function getModuleFederationOptions(name, isModuleFederationRemote) {
15
17
  `\u26A0\uFE0F WARNING: Module federation is experimental and will receive immediate breaking changes in the future.`
16
18
  )
17
19
  );
20
+ let exposes;
21
+ const packageRole = packageJson.backstage?.role;
22
+ if (isModuleFederationRemote && packageJson.exports && packageRole) {
23
+ const project = await typeDistProject.createTypeDistProject();
24
+ exposes = Object.fromEntries(
25
+ entryPoints.readEntryPoints(packageJson).filter((ep) => {
26
+ if (ep.mount === "./package.json") {
27
+ return false;
28
+ }
29
+ if (ep.mount === ".") {
30
+ return true;
31
+ }
32
+ return typeDistProject.getEntryPointDefaultFeatureType(
33
+ packageRole,
34
+ packageDir,
35
+ project,
36
+ ep.path
37
+ ) !== null;
38
+ }).map((ep) => [ep.mount, ep.path])
39
+ );
40
+ }
18
41
  return {
19
42
  mode: isModuleFederationRemote ? "remote" : "host",
20
43
  // The default output mode requires the name to be a usable as a code
21
44
  // symbol, there might be better options here but for now we need to
22
45
  // sanitize the name.
23
- name: name.replaceAll("@", "").replaceAll("/", "__").replaceAll("-", "_")
46
+ name: packageJson.name.replaceAll("@", "").replaceAll("/", "__").replaceAll("-", "_"),
47
+ exposes
24
48
  };
25
49
  }
26
50
 
@@ -188,6 +188,11 @@ DEPRECATION WARNING: React Router Beta is deprecated and support for it will be
188
188
  } else {
189
189
  const bundler = rspack ?? webpack__default.default;
190
190
  const DevServer = rspack ? require("@rspack/dev-server").RspackDevServer : WebpackDevServer__default.default;
191
+ if (rspack) {
192
+ console.log(
193
+ chalk__default.default.yellow(`\u26A0\uFE0F WARNING: Using experimental RSPack dev server.`)
194
+ );
195
+ }
191
196
  const publicPaths = await paths.resolveOptionalBundlingPaths({
192
197
  entry: "src/index-public-experimental",
193
198
  dist: "dist/public"
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var version = "0.6.0-next.2";
3
+ var version = "0.6.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.1.0-next.2";
3
+ var version = "1.1.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.9.0-next.2";
3
+ var version = "1.9.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.29.3-next.2";
3
+ var version = "0.29.4";
4
4
  var dependencies = {
5
5
  "@backstage/catalog-model": "workspace:^",
6
6
  "@backstage/cli-common": "workspace:^",
@@ -48,7 +48,7 @@ var dependencies = {
48
48
  commander: "^12.0.0",
49
49
  "cross-fetch": "^4.0.0",
50
50
  "cross-spawn": "^7.0.3",
51
- "css-loader": "^7.0.0",
51
+ "css-loader": "^6.5.1",
52
52
  "ctrlc-windows": "^2.1.0",
53
53
  esbuild: "^0.24.0",
54
54
  "esbuild-loader": "^4.0.0",
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var version = "1.3.1-next.0";
3
+ var version = "1.3.1";
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.15.3-next.1";
3
+ var version = "1.15.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.16.2-next.2";
3
+ var version = "0.16.2";
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.2-next.0";
3
+ var version = "1.10.2";
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.5-next.2";
3
+ var version = "1.1.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.2.6-next.0";
3
+ var version = "1.2.6";
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.3-next.1";
3
+ var version = "1.7.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.6.3-next.0";
3
+ var version = "0.6.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.24.1-next.2";
3
+ var version = "0.24.1";
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.3-next.2";
3
+ var version = "0.2.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 = "1.15.0-next.2";
3
+ var version = "1.15.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.6.2-next.2";
3
+ var version = "0.6.2";
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.17-next.2";
3
+ var version = "0.1.17";
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.29.3-next.2",
3
+ "version": "0.29.4",
4
4
  "description": "CLI for developing Backstage plugins and apps",
5
5
  "backstage": {
6
6
  "role": "cli"
@@ -42,16 +42,16 @@
42
42
  "watch": "./src"
43
43
  },
44
44
  "dependencies": {
45
- "@backstage/catalog-model": "1.7.2-next.0",
46
- "@backstage/cli-common": "0.1.15",
47
- "@backstage/cli-node": "0.2.11-next.1",
48
- "@backstage/config": "1.3.1-next.0",
49
- "@backstage/config-loader": "1.9.3-next.1",
50
- "@backstage/errors": "1.2.6-next.0",
51
- "@backstage/eslint-plugin": "0.1.10",
52
- "@backstage/integration": "1.16.0-next.1",
53
- "@backstage/release-manifests": "0.0.12-next.1",
54
- "@backstage/types": "1.2.0",
45
+ "@backstage/catalog-model": "^1.7.2",
46
+ "@backstage/cli-common": "^0.1.15",
47
+ "@backstage/cli-node": "^0.2.11",
48
+ "@backstage/config": "^1.3.1",
49
+ "@backstage/config-loader": "^1.9.3",
50
+ "@backstage/errors": "^1.2.6",
51
+ "@backstage/eslint-plugin": "^0.1.10",
52
+ "@backstage/integration": "^1.16.0",
53
+ "@backstage/release-manifests": "^0.0.12",
54
+ "@backstage/types": "^1.2.0",
55
55
  "@manypkg/get-packages": "^1.1.3",
56
56
  "@module-federation/enhanced": "^0.8.0",
57
57
  "@octokit/graphql": "^5.0.0",
@@ -88,7 +88,7 @@
88
88
  "commander": "^12.0.0",
89
89
  "cross-fetch": "^4.0.0",
90
90
  "cross-spawn": "^7.0.3",
91
- "css-loader": "^7.0.0",
91
+ "css-loader": "^6.5.1",
92
92
  "ctrlc-windows": "^2.1.0",
93
93
  "esbuild": "^0.24.0",
94
94
  "esbuild-loader": "^4.0.0",
@@ -157,22 +157,22 @@
157
157
  "zod": "^3.22.4"
158
158
  },
159
159
  "devDependencies": {
160
- "@backstage/backend-plugin-api": "1.1.0-next.2",
161
- "@backstage/backend-test-utils": "1.2.0-next.2",
162
- "@backstage/catalog-client": "1.9.0-next.2",
163
- "@backstage/config": "1.3.1-next.0",
164
- "@backstage/core-app-api": "1.15.3-next.1",
165
- "@backstage/core-components": "0.16.2-next.2",
166
- "@backstage/core-plugin-api": "1.10.2-next.0",
167
- "@backstage/dev-utils": "1.1.5-next.2",
168
- "@backstage/errors": "1.2.6-next.0",
169
- "@backstage/plugin-auth-backend": "0.24.1-next.2",
170
- "@backstage/plugin-auth-backend-module-guest-provider": "0.2.3-next.2",
171
- "@backstage/plugin-catalog-node": "1.15.0-next.2",
172
- "@backstage/plugin-scaffolder-node": "0.6.2-next.2",
173
- "@backstage/plugin-scaffolder-node-test-utils": "0.1.17-next.2",
174
- "@backstage/test-utils": "1.7.3-next.1",
175
- "@backstage/theme": "0.6.3-next.0",
160
+ "@backstage/backend-plugin-api": "^1.1.0",
161
+ "@backstage/backend-test-utils": "^1.2.0",
162
+ "@backstage/catalog-client": "^1.9.0",
163
+ "@backstage/config": "^1.3.1",
164
+ "@backstage/core-app-api": "^1.15.3",
165
+ "@backstage/core-components": "^0.16.2",
166
+ "@backstage/core-plugin-api": "^1.10.2",
167
+ "@backstage/dev-utils": "^1.1.5",
168
+ "@backstage/errors": "^1.2.6",
169
+ "@backstage/plugin-auth-backend": "^0.24.1",
170
+ "@backstage/plugin-auth-backend-module-guest-provider": "^0.2.3",
171
+ "@backstage/plugin-catalog-node": "^1.15.0",
172
+ "@backstage/plugin-scaffolder-node": "^0.6.2",
173
+ "@backstage/plugin-scaffolder-node-test-utils": "^0.1.17",
174
+ "@backstage/test-utils": "^1.7.3",
175
+ "@backstage/theme": "^0.6.3",
176
176
  "@rspack/core": "^1.0.10",
177
177
  "@rspack/dev-server": "^1.0.9",
178
178
  "@rspack/plugin-react-refresh": "^1.0.0",