@backstage/cli
Version:
CLI for developing Backstage plugins and apps
1,045 lines (830 loc) • 232 kB
Markdown
# @backstage/cli
## 0.34.0
### Minor Changes
- 38b4243: Added plugin and module templates for the new frontend system. These templates are not included by default, but can be included by adding `@backstage/cli/templates/new-frontend-plugin` and `@backstage/cli/templates/new-frontend-plugin-module` as [custom templates](https://backstage.io/docs/tooling/cli/templates#installing-custom-templates).
- 923ceb2: **BREAKING**: The new app build based on [Rspack](https://rspack.dev/) is now the default, and the `EXPERIMENTAL_RSPACK` flag has been removed. To revert to the old behavior, set the `LEGACY_WEBPACK_BUILD` environment flag and install the following optional dependencies:
```json
{
"dependencies": {
"@module-federation/enhanced": "^0.9.0",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.7",
"esbuild-loader": "^4.0.0",
"eslint-webpack-plugin": "^4.2.0",
"fork-ts-checker-webpack-plugin": "^9.0.0",
"mini-css-extract-plugin": "^2.4.2",
"terser-webpack-plugin": "^5.1.3",
"webpack": "^5.96.0",
"webpack-dev-server": "^5.0.0"
}
}
```
If you do encounter a blocking issue that forces you to use the old WebPack build, please [open an issue](https://github.com/backstage/backstage/issues) explaining the problem. The WebPack build will be removed in a future release.
- eda80c7: **BREAKING**: Removed support for `.icon.svg` imports, which have been deprecated since the 1.19 release.
### Patch Changes
- 2b8082a: Internal refactor of error handling
- 8b1bf6e: Deprecated new frontend system config setting `app.experimental.packages` to just `app.packages`. The old config will continue working for the time being, but may be removed in a future release.
- ead626f: The Node.js transform in `@backstage/cli/config/nodeTransformHooks.mjs` now supports the built-in type stripping in Node.js, which is enabled by default from v22.18.0.
- a6af768: Allow js files to be processed by the nodeTransform loader
- Updated dependencies
- @backstage/cli-node@0.2.14
## 0.34.0-next.2
### Minor Changes
- 923ceb2: **BREAKING**: The new app build based on [Rspack](https://rspack.dev/) is now the default, and the `EXPERIMENTAL_RSPACK` flag has been removed. To revert to the old behavior, set the `LEGACY_WEBPACK_BUILD` environment flag and install the following optional dependencies:
```json
{
"dependencies": {
"@module-federation/enhanced": "^0.9.0",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.7",
"esbuild-loader": "^4.0.0",
"eslint-webpack-plugin": "^4.2.0",
"fork-ts-checker-webpack-plugin": "^9.0.0",
"mini-css-extract-plugin": "^2.4.2",
"terser-webpack-plugin": "^5.1.3",
"webpack": "^5.96.0",
"webpack-dev-server": "^5.0.0"
}
}
```
If you do encounter a blocking issue that forces you to use the old WebPack build, please [open an issue](https://github.com/backstage/backstage/issues) explaining the problem. The WebPack build will be removed in a future release.
- eda80c7: **BREAKING**: Removed support for `.icon.svg` imports, which have been deprecated since the 1.19 release.
### Patch Changes
- 8b1bf6e: Deprecated new frontend system config setting `app.experimental.packages` to just `app.packages`. The old config will continue working for the time being, but may be removed in a future release.
- ead626f: The Node.js transform in `@backstage/cli/config/nodeTransformHooks.mjs` now supports the built-in type stripping in Node.js, which is enabled by default from v22.18.0.
## 0.34.0-next.1
### Minor Changes
- 38b4243: Added plugin and module templates for the new frontend system. These templates are not included by default, but can be included by adding `@backstage/cli/templates/new-frontend-plugin` and `@backstage/cli/templates/new-frontend-plugin-module` as [custom templates](https://backstage.io/docs/tooling/cli/templates#installing-custom-templates).
### Patch Changes
- Updated dependencies
- @backstage/catalog-model@1.7.5
- @backstage/cli-common@0.1.15
- @backstage/cli-node@0.2.13
- @backstage/config@1.3.3
- @backstage/config-loader@1.10.2
- @backstage/errors@1.2.7
- @backstage/eslint-plugin@0.1.11
- @backstage/integration@1.17.1
- @backstage/release-manifests@0.0.13
- @backstage/types@1.2.1
## 0.33.2-next.0
### Patch Changes
- a6af768: Allow js files to be processed by the nodeTransform loader
- Updated dependencies
- @backstage/cli-node@0.2.13
- @backstage/config-loader@1.10.2
- @backstage/catalog-model@1.7.5
- @backstage/cli-common@0.1.15
- @backstage/config@1.3.3
- @backstage/errors@1.2.7
- @backstage/eslint-plugin@0.1.11
- @backstage/integration@1.17.1
- @backstage/release-manifests@0.0.13
- @backstage/types@1.2.1
## 0.33.1
### Patch Changes
- 50f0ce6: Fixes a module not found error when running `backstage-cli info`.
- Updated dependencies
- @backstage/config-loader@1.10.2
- @backstage/config@1.3.3
- @backstage/catalog-model@1.7.5
- @backstage/integration@1.17.1
## 0.33.1-next.2
### Patch Changes
- 50f0ce6: Fixes a module not found error when running `backstage-cli info`.
## 0.33.1-next.1
### Patch Changes
- Updated dependencies
- @backstage/config-loader@1.10.2-next.0
- @backstage/config@1.3.3-next.0
- @backstage/catalog-model@1.7.5-next.0
- @backstage/integration@1.17.1-next.1
## 0.33.1-next.0
### Patch Changes
- Updated dependencies
- @backstage/integration@1.17.1-next.0
- @backstage/cli-node@0.2.13
- @backstage/config-loader@1.10.1
- @backstage/catalog-model@1.7.4
- @backstage/cli-common@0.1.15
- @backstage/config@1.3.2
- @backstage/errors@1.2.7
- @backstage/eslint-plugin@0.1.11
- @backstage/release-manifests@0.0.13
- @backstage/types@1.2.1
## 0.33.0
### Minor Changes
- eef0e83: Internal update to promote the modular CLI entrypoint to stable.
### Patch Changes
- d07fe35: Added user feedback when opening config docs in browser. The command now clearly indicates what it's doing and provides fallback instructions if the browser fails to open.
- ce70439: The `BACKSTAGE_CLI_EXPERIMENTAL_BUILD_CACHE` flag has been removed. Existing users are encouraged to switch to `EXPERIMENTAL_RSPACK` instead.
- 1d8f00b: Switched to using the `ModuleFederationPlugin` from `@module-federation/enhanced/rspack` for Rspack, rather than the built-in one.
- 2b9633f: The experimental `FORCE_REACT_DEVELOPMENT` flag has been removed.
- d8c4a54: Only use the caching Jest module loader for frontend packages in order to avoid breaking real ESM module imports.
- d6d63c7: Updating the scaffolder action boilerplate to use new `zod` schema
- e36e855: Added `backstage.pluginId` field in `package.json` to all default plugin package templates for the `new` command.
- 1bab255: Internal refactor to combine alpha `build` and `start` modules.
- 713e957: fix: merge eslint reports when using json format
- 8a0164c: Fix an issue where some commands were not usable because of missing dist files
- Updated dependencies
- @backstage/eslint-plugin@0.1.11
- @backstage/catalog-model@1.7.4
- @backstage/cli-common@0.1.15
- @backstage/cli-node@0.2.13
- @backstage/config@1.3.2
- @backstage/config-loader@1.10.1
- @backstage/errors@1.2.7
- @backstage/integration@1.17.0
- @backstage/release-manifests@0.0.13
- @backstage/types@1.2.1
## 0.33.0-next.2
### Patch Changes
- 8a0164c: Fix an issue where some commands were not usable because of missing dist files
- Updated dependencies
- @backstage/eslint-plugin@0.1.11-next.0
- @backstage/catalog-model@1.7.4
- @backstage/cli-common@0.1.15
- @backstage/cli-node@0.2.13
- @backstage/config@1.3.2
- @backstage/config-loader@1.10.1
- @backstage/errors@1.2.7
- @backstage/integration@1.17.0
- @backstage/release-manifests@0.0.13
- @backstage/types@1.2.1
## 0.33.0-next.1
### Minor Changes
- eef0e83: Internal update to promote the modular CLI entrypoint to stable.
### Patch Changes
- d07fe35: Added user feedback when opening config docs in browser. The command now clearly indicates what it's doing and provides fallback instructions if the browser fails to open.
- d6d63c7: Updating the scaffolder action boilerplate to use new `zod` schema
- e36e855: Added `backstage.pluginId` field in `package.json` to all default plugin package templates for the `new` command.
- Updated dependencies
- @backstage/catalog-model@1.7.4
- @backstage/cli-common@0.1.15
- @backstage/cli-node@0.2.13
- @backstage/config@1.3.2
- @backstage/config-loader@1.10.1
- @backstage/errors@1.2.7
- @backstage/eslint-plugin@0.1.10
- @backstage/integration@1.17.0
- @backstage/release-manifests@0.0.13
- @backstage/types@1.2.1
## 0.32.2-next.0
### Patch Changes
- ce70439: The `BACKSTAGE_CLI_EXPERIMENTAL_BUILD_CACHE` flag has been removed. Existing users are encouraged to switch to `EXPERIMENTAL_RSPACK` instead.
- 1d8f00b: Switched to using the `ModuleFederationPlugin` from `@module-federation/enhanced/rspack` for Rspack, rather than the built-in one.
- 2b9633f: The experimental `FORCE_REACT_DEVELOPMENT` flag has been removed.
- d8c4a54: Only use the caching Jest module loader for frontend packages in order to avoid breaking real ESM module imports.
- 1bab255: Internal refactor to combine alpha `build` and `start` modules.
- 713e957: fix: merge eslint reports when using json format
- Updated dependencies
- @backstage/catalog-model@1.7.4
- @backstage/cli-common@0.1.15
- @backstage/cli-node@0.2.13
- @backstage/config@1.3.2
- @backstage/config-loader@1.10.1
- @backstage/errors@1.2.7
- @backstage/eslint-plugin@0.1.10
- @backstage/integration@1.17.0
- @backstage/release-manifests@0.0.13
- @backstage/types@1.2.1
## 0.32.1
### Patch Changes
- 674def9: fix: enable `lazyCompilation` and `refreshOptions` for rspack
- d649df0: Internal code cleanup
- c2cae47: Add missing modules to the Backstage CLI alpha entrypoint.
- 3f45861: Add a warning for React 17 deprecation that triggers when frontend packages and plugins start.
- 9aaec54: Internal refactor of opaque type handling.
- 9285385: Added `info` object to the context of the alpha CLI.
- 6cc9507: Updated dependency `@octokit/request` to `^8.0.0`.
- 5cd3c54: Updated dependency `react-refresh` to `^0.17.0`.
- 72d019d: Removed various typos
- 19a4e7c: Internal refactor to move things closer to home
- Updated dependencies
- @backstage/integration@1.17.0
- @backstage/catalog-model@1.7.4
- @backstage/release-manifests@0.0.13
- @backstage/config-loader@1.10.1
- @backstage/cli-node@0.2.13
- @backstage/config@1.3.2
- @backstage/cli-common@0.1.15
- @backstage/errors@1.2.7
- @backstage/eslint-plugin@0.1.10
- @backstage/types@1.2.1
## 0.32.1-next.3
### Patch Changes
- 674def9: fix: enable `lazyCompilation` and `refreshOptions` for rspack
- 19a4e7c: Internal refactor to move things closer to home
- Updated dependencies
- @backstage/release-manifests@0.0.13-next.0
- @backstage/integration@1.17.0-next.3
- @backstage/catalog-model@1.7.3
- @backstage/cli-common@0.1.15
- @backstage/cli-node@0.2.13
- @backstage/config@1.3.2
- @backstage/config-loader@1.10.1-next.0
- @backstage/errors@1.2.7
- @backstage/eslint-plugin@0.1.10
- @backstage/types@1.2.1
## 0.32.1-next.2
### Patch Changes
- Updated dependencies
- @backstage/integration@1.17.0-next.2
- @backstage/cli-node@0.2.13
- @backstage/config@1.3.2
- @backstage/release-manifests@0.0.12
- @backstage/catalog-model@1.7.3
- @backstage/cli-common@0.1.15
- @backstage/config-loader@1.10.1-next.0
- @backstage/errors@1.2.7
- @backstage/eslint-plugin@0.1.10
- @backstage/types@1.2.1
## 0.32.1-next.1
### Patch Changes
- d649df0: Internal code cleanup
- 9aaec54: Internal refactor of opaque type handling.
- 9285385: Added `info` object to the context of the alpha CLI.
- 6cc9507: Updated dependency `@octokit/request` to `^8.0.0`.
- 72d019d: Removed various typos
- Updated dependencies
- @backstage/integration@1.16.4-next.1
- @backstage/config-loader@1.10.1-next.0
- @backstage/catalog-model@1.7.3
- @backstage/cli-common@0.1.15
- @backstage/cli-node@0.2.13
- @backstage/config@1.3.2
- @backstage/errors@1.2.7
- @backstage/eslint-plugin@0.1.10
- @backstage/release-manifests@0.0.12
- @backstage/types@1.2.1
## 0.32.1-next.0
### Patch Changes
- 5cd3c54: Updated dependency `react-refresh` to `^0.17.0`.
- Updated dependencies
- @backstage/integration@1.16.4-next.0
- @backstage/cli-node@0.2.13
- @backstage/config-loader@1.10.0
- @backstage/catalog-model@1.7.3
- @backstage/cli-common@0.1.15
- @backstage/config@1.3.2
- @backstage/errors@1.2.7
- @backstage/eslint-plugin@0.1.10
- @backstage/release-manifests@0.0.12
- @backstage/types@1.2.1
## 0.32.0
### Minor Changes
- a47fd39: Removes default React imports from template files, aligning with the requirements for the upcoming React 19 migration. Introduces a new ESLint rule to disallow `import React from 'react'` and `import * as React from 'react'`.
<https://legacy.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html>
- 65b584c: Internal update to move the `new` and `create-github-app` to their own module.
- c7254ae: Internal update to move the `clean`, `pre/postpack` and `fix` commands into their own separate module.
### Patch Changes
- 4ea76f7: Bump @module-federation/enhanced ^0.9.0 to fix GHSA-593f-38f6-jp5m
- 87a5cb4: Fixed an issue causing the `repo lint` command to fail when the `--max-warnings` option was used.
- 6969f79: Avoid trailing `/*` when automatically adding imports for package with multiple entry points.
- 98b7131: Update the `to do` plugin template to stop using the deprecated catalog alpha service reference.
If you start seeing the `should create TODO item with catalog information` test failing, you have two options to fix this:
Update the test to mock the legacy alpha catalog service, or migrate the `TODO` plugin backend to use the new catalog service reference.
We recommend the second option, see [this](https://github.com/backstage/backstage/pull/29450/files/267115d0436009443ca68ac84e7dcc646c9c938d#diff-47e01aeb12dd55fab9e697f810be21a8d08d39c37df1b078f6d0894f9bad5a1b) pull request for an example of how to do the migration.
- d5c4fed: make certificate strings optional for Dev environments
- d83f3f4: Resolved a problem where the `start` command did not correctly handle multiple `--require` flags, ensuring all specified modules are now properly loaded.
- d2091c6: Added a new `repo start` command to replace the existing pattern of using `yarn dev` scripts. The `repo start` command runs the app and/or backend package in the repo by default, but will also fall back to running other individual frontend or backend packages or even plugin dev entry points if the can be uniquely selected.
The goal of this change is to reduce the number of different necessary scripts and align on `yarn start` being the only command needed for local development, similar to how `repo test` handles testing in the repo. It also opens up for more powerful options, like the `--plugin <pluginId>` flag that runs the dev entry point of the selected plugin.
The new script is installed as follows, replacing the existing `yarn start` script:
```json
{
"scripts": {
"start": "backstage-cli repo start"
}
}
```
In order to help users migrate in existing projects, it is recommended to add the following scripts to the root `package.json`:
```json
{
"scripts": {
"dev": "echo \"Use 'yarn start' instead\"",
"start-backend": "echo \"Use 'yarn start backend' instead\""
}
}
```
For more information, run `yarn start --help` once the new command is installed.
- 918c883: Included a reference to the JSX transform guide in the warning about using the default React import.
- Updated dependencies
- @backstage/integration@1.16.3
- @backstage/catalog-model@1.7.3
- @backstage/cli-common@0.1.15
- @backstage/cli-node@0.2.13
- @backstage/config@1.3.2
- @backstage/config-loader@1.10.0
- @backstage/errors@1.2.7
- @backstage/eslint-plugin@0.1.10
- @backstage/release-manifests@0.0.12
- @backstage/types@1.2.1
## 0.32.0-next.2
### Minor Changes
- a47fd39: Removes default React imports from template files, aligning with the requirements for the upcoming React 19 migration. Introduces a new ESLint rule to disallow `import React from 'react'` and `import * as React from 'react'`.
<https://legacy.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html>
### Patch Changes
- 6969f79: Avoid trailing `/*` when automatically adding imports for package with multiple entry points.
- 98b7131: Update the `to do` plugin template to stop using the deprecated catalog alpha service reference.
If you start seeing the `should create TODO item with catalog information` test failing, you have two options to fix this:
Update the test to mock the legacy alpha catalog service, or migrate the `TODO` plugin backend to use the new catalog service reference.
We recommend the second option, see [this](https://github.com/backstage/backstage/pull/29450/files/267115d0436009443ca68ac84e7dcc646c9c938d#diff-47e01aeb12dd55fab9e697f810be21a8d08d39c37df1b078f6d0894f9bad5a1b) pull request for an example of how to do the migration.
- d5c4fed: make certificate strings optional for Dev environments
- d2091c6: Added a new `repo start` command to replace the existing pattern of using `yarn dev` scripts. The `repo start` command runs the app and/or backend package in the repo by default, but will also fall back to running other individual frontend or backend packages or even plugin dev entry points if the can be uniquely selected.
The goal of this change is to reduce the number of different necessary scripts and align on `yarn start` being the only command needed for local development, similar to how `repo test` handles testing in the repo. It also opens up for more powerful options, like the `--plugin <pluginId>` flag that runs the dev entry point of the selected plugin.
The new script is installed as follows, replacing the existing `yarn start` script:
```json
{
"scripts": {
"start": "backstage-cli repo start"
}
}
```
In order to help users migrate in existing projects, it is recommended to add the following scripts to the root `package.json`:
```json
{
"scripts": {
"dev": "echo \"Use 'yarn start' instead\"",
"start-backend": "echo \"Use 'yarn start backend' instead\""
}
}
```
For more information, run `yarn start --help` once the new command is installed.
- Updated dependencies
- @backstage/catalog-model@1.7.3
- @backstage/cli-common@0.1.15
- @backstage/cli-node@0.2.13
- @backstage/config@1.3.2
- @backstage/config-loader@1.10.0
- @backstage/errors@1.2.7
- @backstage/eslint-plugin@0.1.10
- @backstage/integration@1.16.3-next.0
- @backstage/release-manifests@0.0.12
- @backstage/types@1.2.1
## 0.32.0-next.1
### Patch Changes
- Updated dependencies
- @backstage/integration@1.16.3-next.0
- @backstage/catalog-model@1.7.3
- @backstage/cli-common@0.1.15
- @backstage/cli-node@0.2.13
- @backstage/config@1.3.2
- @backstage/config-loader@1.10.0
- @backstage/errors@1.2.7
- @backstage/eslint-plugin@0.1.10
- @backstage/release-manifests@0.0.12
- @backstage/types@1.2.1
## 0.32.0-next.0
### Minor Changes
- c7254ae: Internal update to move the `clean`, `pre/postpack` and `fix` commands into their own separate module.
### Patch Changes
- 4ea76f7: Bump @module-federation/enhanced ^0.9.0 to fix GHSA-593f-38f6-jp5m
- 87a5cb4: Fixed an issue causing the `repo lint` command to fail when the `--max-warnings` option was used.
- d83f3f4: Resolved a problem where the `start` command did not correctly handle multiple `--require` flags, ensuring all specified modules are now properly loaded.
- Updated dependencies
- @backstage/catalog-model@1.7.3
- @backstage/cli-common@0.1.15
- @backstage/cli-node@0.2.13
- @backstage/config@1.3.2
- @backstage/config-loader@1.10.0
- @backstage/errors@1.2.7
- @backstage/eslint-plugin@0.1.10
- @backstage/integration@1.16.2
- @backstage/release-manifests@0.0.12
- @backstage/types@1.2.1
## 0.31.0
### Minor Changes
- 5b70679: **BREAKING**: ESLint warnings no longer trigger system exit codes like errors do.
Set the max number of warnings to `-1` during linting to enable the gradual adoption of new ESLint rules. To restore the previous behavior, include the `--max-warnings 0` flag in the `backstage-cli <repo|package> lint` command.
### Patch Changes
- 0586d4c: Internal change to move the `migrate` and `version:*` commands into a new migrate module.
- e0b226b: build(deps): bump `esbuild` from 0.24.2 to 0.25.0
- 4d45498: Fixed the package prepack command so that it no longer produces unnecessary `index` entries in the `typesVersions` map, which could cause `/index` to be added when automatically adding imports.
- 485b3ba: Internal update to move `test` commands to a separate module.
- a76c482: Internal change to migrate `lint` to the new module system.
- 8df78bf: Internal update to move build commands to a CLI module.
- d0fc357: Internal update to move `info` commands to a separate module.
- f8bd342: Fix a bug in the translation of the deprecated `--scope` option for the `new` command that could cause plugins to have `backstage-backstage-plugin` in their name.
- Updated dependencies
- @backstage/config-loader@1.10.0
- @backstage/integration@1.16.2
- @backstage/catalog-model@1.7.3
- @backstage/cli-common@0.1.15
- @backstage/cli-node@0.2.13
- @backstage/config@1.3.2
- @backstage/errors@1.2.7
- @backstage/eslint-plugin@0.1.10
- @backstage/release-manifests@0.0.12
- @backstage/types@1.2.1
## 0.31.0-next.1
### Minor Changes
- 5b70679: **BREAKING**: ESLint warnings no longer trigger system exit codes like errors do.
Set the max number of warnings to `-1` during linting to enable the gradual adoption of new ESLint rules. To restore the previous behavior, include the `--max-warnings 0` flag in the `backstage-cli <repo|package> lint` command.
### Patch Changes
- e0b226b: build(deps): bump `esbuild` from 0.24.2 to 0.25.0
- 4d45498: Fixed the package prepack command so that it no longer produces unnecessary `index` entries in the `typesVersions` map, which could cause `/index` to be added when automatically adding imports.
- f8bd342: Fix a bug in the translation of the deprecated `--scope` option for the `new` command that could cause plugins to have `backstage-backstage-plugin` in their name.
- Updated dependencies
- @backstage/config-loader@1.10.0-next.0
- @backstage/integration@1.16.2-next.0
- @backstage/catalog-model@1.7.3
- @backstage/cli-common@0.1.15
- @backstage/cli-node@0.2.13
- @backstage/config@1.3.2
- @backstage/errors@1.2.7
- @backstage/eslint-plugin@0.1.10
- @backstage/release-manifests@0.0.12
- @backstage/types@1.2.1
## 0.30.1-next.0
### Patch Changes
- 0586d4c: Internal change to move the `migrate` and `version:*` commands into a new migrate module.
- 485b3ba: Internal update to move `test` commands to a separate module.
- 8df78bf: Internal update to move build commands to a CLI module.
- d0fc357: Internal update to move `info` commands to a separate module.
- Updated dependencies
- @backstage/catalog-model@1.7.3
- @backstage/cli-common@0.1.15
- @backstage/cli-node@0.2.13
- @backstage/config@1.3.2
- @backstage/config-loader@1.9.6
- @backstage/errors@1.2.7
- @backstage/eslint-plugin@0.1.10
- @backstage/integration@1.16.1
- @backstage/release-manifests@0.0.12
- @backstage/types@1.2.1
## 0.30.0
### Minor Changes
- 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(...)`.
This change adds support for the following in Node.js packages, across type checking, package builds, runtime transforms and Jest tests:
- Dynamic imports that load ESM modules from CommonJS code.
- Both `.mjs` and `.mts` files as explicit ESM files, as well as `.cjs` and `.cts` as explicit CommonJS files.
- Support for the `"type": "module"` field in `package.json` to indicate that the package is an ESM package.
There are a few caveats to be aware of:
- 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'`.
- 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.
- 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.
- 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.
- 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.
The following flags for the `new` command have been deprecated and will be removed in a future release:
- `--license=<license>`: Configure the global `license` instead.
- `--no-private`: Configure the global `private` instead.
- `--baseVersion=<version>`: Configure the global `version` instead.
- `--npmRegistry=<url>`: Configure the global `publishRegistry` instead.
- `--scope=<scope>`: Configure the global `namePrefix` and/or `namePluginInfix` instead.
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:
- `--select=plugin` is mapped to `--select=frontend-plugin` instead.
- `--option=id=<id>` is mapped to `--option=pluginId=<id>` instead.
### Patch Changes
- f17ef61: The `versions:bump` command will now reject `*` as a pattern.
- 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.
- 2167afc: Treat static file assets as always being free from side effects in package builds.
- 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
- 90a1edf: Add check to make sure that the `--link` option for the `start` command is a valid workspace.
- 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`.
- 9638f6d: Only allow pass through of `.mjs` in Jest transform if static ESM is supported.
- 9d49e04: Replaced dependency `node-libs-browser` with `node-stdlib-browser`
- 2c14147: Corrected path when trying to add dependency to respective `package.json` when using `yarn new` templates
- f21b125: Ensure that both global-agent and undici agents are enabled when proxying is enabled.
- Updated dependencies
- @backstage/cli-node@0.2.13
- @backstage/config-loader@1.9.6
- @backstage/catalog-model@1.7.3
- @backstage/cli-common@0.1.15
- @backstage/config@1.3.2
- @backstage/errors@1.2.7
- @backstage/eslint-plugin@0.1.10
- @backstage/integration@1.16.1
- @backstage/release-manifests@0.0.12
- @backstage/types@1.2.1
## 0.30.0-next.3
### Minor Changes
- 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.
The following flags for the `new` command have been deprecated and will be removed in a future release:
- `--license=<license>`: Configure the global `license` instead.
- `--no-private`: Configure the global `private` instead.
- `--baseVersion=<version>`: Configure the global `version` instead.
- `--npmRegistry=<url>`: Configure the global `publishRegistry` instead.
- `--scope=<scope>`: Configure the global `namePrefix` and/or `namePluginInfix` instead.
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:
- `--select=plugin` is mapped to `--select=frontend-plugin` instead.
- `--option=id=<id>` is mapped to `--option=pluginId=<id>` instead.
### Patch Changes
- Updated dependencies
- @backstage/cli-node@0.2.13-next.1
- @backstage/config-loader@1.9.6-next.0
- @backstage/catalog-model@1.7.3
- @backstage/cli-common@0.1.15
- @backstage/config@1.3.2
- @backstage/errors@1.2.7
- @backstage/eslint-plugin@0.1.10
- @backstage/integration@1.16.1
- @backstage/release-manifests@0.0.12
- @backstage/types@1.2.1
## 0.30.0-next.2
### Patch Changes
- f17ef61: The `versions:bump` command will now reject `*` as a pattern.
- 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.
- 2167afc: Treat static file assets as always being free from side effects in package builds.
- 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
- 9638f6d: Only allow pass through of `.mjs` in Jest transform if static ESM is supported.
- Updated dependencies
- @backstage/cli-node@0.2.13-next.1
- @backstage/catalog-model@1.7.3
- @backstage/cli-common@0.1.15
- @backstage/config@1.3.2
- @backstage/config-loader@1.9.6-next.0
- @backstage/errors@1.2.7
- @backstage/eslint-plugin@0.1.10
- @backstage/integration@1.16.1
- @backstage/release-manifests@0.0.12
- @backstage/types@1.2.1
## 0.30.0-next.1
### Patch Changes
- 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`.
- Updated dependencies
- @backstage/catalog-model@1.7.3
- @backstage/cli-common@0.1.15
- @backstage/cli-node@0.2.13-next.0
- @backstage/config@1.3.2
- @backstage/config-loader@1.9.6-next.0
- @backstage/errors@1.2.7
- @backstage/eslint-plugin@0.1.10
- @backstage/integration@1.16.1
- @backstage/release-manifests@0.0.12
- @backstage/types@1.2.1
## 0.30.0-next.0
### Minor Changes
- 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(...)`.
This change adds support for the following in Node.js packages, across type checking, package builds, runtime transforms and Jest tests:
- Dynamic imports that load ESM modules from CommonJS code.
- Both `.mjs` and `.mts` files as explicit ESM files, as well as `.cjs` and `.cts` as explicit CommonJS files.
- Support for the `"type": "module"` field in `package.json` to indicate that the package is an ESM package.
There are a few caveats to be aware of:
- 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'`.
- 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.
- 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.
- 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.
### Patch Changes
- f21b125: Ensure that both global-agent and undici agents are enabled when proxying is enabled.
- Updated dependencies
- @backstage/cli-node@0.2.13-next.0
- @backstage/config-loader@1.9.6-next.0
- @backstage/catalog-model@1.7.3
- @backstage/cli-common@0.1.15
- @backstage/config@1.3.2
- @backstage/errors@1.2.7
- @backstage/eslint-plugin@0.1.10
- @backstage/integration@1.16.1
- @backstage/release-manifests@0.0.12
- @backstage/types@1.2.1
## 0.29.5
### Patch Changes
- e937ce0: Fixed incompatible `@typescript-eslint` versions with current `eslint@8.x.x`
- 8557e09: Removed the `EXPERIMENTAL_VITE` flag for using Vite as a dev server. If you were using this feature, we recommend switching to Rspack via the `EXPERIMENTAL_RSPACK` flag.
- Updated dependencies
- @backstage/types@1.2.1
- @backstage/config-loader@1.9.5
- @backstage/integration@1.16.1
- @backstage/catalog-model@1.7.3
- @backstage/cli-common@0.1.15
- @backstage/cli-node@0.2.12
- @backstage/config@1.3.2
- @backstage/errors@1.2.7
- @backstage/eslint-plugin@0.1.10
- @backstage/release-manifests@0.0.12
## 0.29.5-next.1
### Patch Changes
- Updated dependencies
- @backstage/types@1.2.1-next.0
- @backstage/catalog-model@1.7.3-next.0
- @backstage/cli-node@0.2.12-next.0
- @backstage/config@1.3.2-next.0
- @backstage/config-loader@1.9.5-next.1
- @backstage/errors@1.2.7-next.0
- @backstage/release-manifests@0.0.12
- @backstage/cli-common@0.1.15
- @backstage/eslint-plugin@0.1.10
- @backstage/integration@1.16.1-next.0
## 0.29.5-next.0
### Patch Changes
- e937ce0: Fixed incompatible `@typescript-eslint` versions with current `eslint@8.x.x`
- Updated dependencies
- @backstage/config-loader@1.9.5-next.0
- @backstage/catalog-model@1.7.2
- @backstage/cli-common@0.1.15
- @backstage/cli-node@0.2.11
- @backstage/config@1.3.1
- @backstage/errors@1.2.6
- @backstage/eslint-plugin@0.1.10
- @backstage/integration@1.16.0
- @backstage/release-manifests@0.0.12
- @backstage/types@1.2.0
## 0.29.4
### Patch Changes
- 2b6c1ea: If the Backstage yarn plugin is installed, it will now be automatically updated as part of `versions:bump`.
- 7dcff85: Remove special-casing for `@types` packages when generating dependency entries
during templating
- 3c3a7e6: Revert `css-loader@v7` bump
- 0aff006: Bumped the version range for `html-webpack-plugin` to fix the `htmlPluginExports.getCompilationHooks is not a function` error when using experimental Rspack.
- 583f3d4: Added `@backstage/cli/config/prettier` as a replacement for `@spotify/prettier-config`, but with the same configuration.
- 62a9062: Updated dependency `@module-federation/enhanced` to `^0.8.0`.
- 5f04976: Update `rollup` to avoid issues with build output when running `backstage-cli package build`.
- 5f04976: Fixed a bug that caused missing code in published packages.
- a49030a: Add support for `--output-file` option from ESLint to `package lint` and `repo lint` commands.
- 96331fa: Enhance the behavior of the experimental support for module federation in the backstage CLI,
by using the `package.json` exports (when present) to complete the list of exposed modules.
This allows, for example, using exported `alpha` definitions through module federation.
- 5c9cc05: Use native fetch instead of node-fetch
- dcd99d2: added experimental RSPack support for build command in the repo scope
- Updated dependencies
- @backstage/integration@1.16.0
- @backstage/release-manifests@0.0.12
- @backstage/cli-node@0.2.11
- @backstage/config-loader@1.9.3
- @backstage/errors@1.2.6
- @backstage/catalog-model@1.7.2
- @backstage/cli-common@0.1.15
- @backstage/config@1.3.1
- @backstage/eslint-plugin@0.1.10
- @backstage/types@1.2.0
## 0.29.3-next.2
### Patch Changes
- 62a9062: Updated dependency `@module-federation/enhanced` to `^0.8.0`.
- Updated dependencies
- @backstage/errors@1.2.6-next.0
- @backstage/cli-node@0.2.11-next.1
- @backstage/config-loader@1.9.3-next.1
- @backstage/catalog-model@1.7.2-next.0
- @backstage/cli-common@0.1.15
- @backstage/config@1.3.1-next.0
- @backstage/eslint-plugin@0.1.10
- @backstage/integration@1.16.0-next.1
- @backstage/release-manifests@0.0.12-next.1
- @backstage/types@1.2.0
## 0.29.3-next.1
### Patch Changes
- a49030a: Add support for `--output-file` option from ESLint to `package lint` and `repo lint` commands.
- 5c9cc05: Use native fetch instead of node-fetch
- Updated dependencies
- @backstage/config-loader@1.9.3-next.0
- @backstage/release-manifests@0.0.12-next.1
- @backstage/catalog-model@1.7.1
- @backstage/cli-common@0.1.15
- @backstage/cli-node@0.2.11-next.0
- @backstage/config@1.3.0
- @backstage/errors@1.2.5
- @backstage/eslint-plugin@0.1.10
- @backstage/integration@1.16.0-next.0
- @backstage/types@1.2.0
## 0.29.3-next.0
### Patch Changes
- 2b6c1ea: If the Backstage yarn plugin is installed, it will now be automatically updated as part of `versions:bump`.
- 7dcff85: Remove special-casing for `@types` packages when generating dependency entries
during templating
- 0aff006: Bumped the version range for `html-webpack-plugin` to fix the `htmlPluginExports.getCompilationHooks is not a function` error when using experimental Rspack.
- 583f3d4: Added `@backstage/cli/config/prettier` as a replacement for `@spotify/prettier-config`, but with the same configuration.
- 5f04976: Update `rollup` to avoid issues with build output when running `backstage-cli package build`.
- 5f04976: Fixed a bug that caused missing code in published packages.
- Updated dependencies
- @backstage/integration@1.16.0-next.0
- @backstage/release-manifests@0.0.12-next.0
- @backstage/cli-node@0.2.11-next.0
- @backstage/catalog-model@1.7.1
- @backstage/cli-common@0.1.15
- @backstage/config@1.3.0
- @backstage/config-loader@1.9.2
- @backstage/errors@1.2.5
- @backstage/eslint-plugin@0.1.10
- @backstage/types@1.2.0
## 0.29.0
### Minor Changes
- bc47b17: **BREAKING**: Updates ESLint config to ignore all generated source code under `src/**/generated/**/*.ts`.
- 6819f8c: Added a new optimization to the `repo test` command that will filter out unused packages in watch mode if all provide filters are paths that point from the repo root. This significantly speeds up running individual tests from the repo root in a large workspace, for example:
```sh
yarn test packages/app/src/App.test.tsx
```
- d849865: The package packing now populates `typesVersions` for additional entry points rather than using additional `package.json` files for type resolution. This improves auto completion of separate entry points when consuming published packages.
- bc71665: **BREAKING**: The `LEGACY_BACKEND_START` flag has been removed, along with support for `src/run.ts` as the development entry point.
### Patch Changes
- 4046d53: Fixed an issue where the `--successCache` option for the `repo test` and `repo lint` commands would be include the workspace path in generated cache keys. This previously broke caching in environments where the workspace path varies across builds.
- 4a378d3: Fix dev server reloads of plugin discovery for new frontend system.
- 28b60ad: The check for `react-dom/client` in the Jest configuration will now properly always run from the target directory.
- 6b2888c: Fixed an issue with the `--successCache` flag for `repo test` where the tree hash for the wrong package directory would sometimes be used to generate the cache key.
- e30b65d: Added `--alwaysPack` as a replacement for the now hidden `--alwaysYarnPack` flag for the `build-workspace` command.
- be0278e: Removed circular import
- a7f97e4: Added a new `"rejectFrontendNetworkRequests"` configuration flag that can be set in the `"jest"` field in the root `package.json`:
```json
{
"jest": {
"rejectFrontendNetworkRequests": true
}
}
```
This flag causes rejection of any form of network requests that are attempted to be made in frontend or common package tests. This flag can only be set in the root `package.json` and can not be overridden in individual package configurations.
- 6c48ebd: Add `--max-warnings -1` support to `backstage-cli package lint`
- 04297a0: The `--successCache` option for the `repo test` and `repo lint` commands now use an additive store that keeps old entries around for a week before they are cleaned up automatically.
- a2f0559: When using the experimental Rspack flag the app build and dev server now injects configuration via a `<script type="backstage.io/config">...</script>` tag in `index.html` rather than the `process.env.APP_CONFIG` definition, which will now be defined as an empty array instead.
This requires the app to be using the config loader from the 1.31 release of Backstage. Make sure your app is using at least that version if you are upgrading to this version of the CLI.
If you have copied the implementation of the `defaultConfigLoader`, make sure to update it to the new implementation. In particular the config loader needs to be able to read configuration from `script` tags with the type `backstage.io/config`.
- b4627f2: Fixed an issue where the `raw-loader` for loading HTML templates was not resolved from the context of the CLI package.
- cd1ef2b: Updated dependency `vite` to `^5.0.0`.
- 23f1da2: Updated dependency `ts-morph` to `^24.0.0`.
- b533056: Updated dependency `css-loader` to `^7.0.0`.
- be008c3: Updated dependency `@module-federation/enhanced` to `^0.7.0`.
- 6266ed3: Updated dependency `del` to `^8.0.0`.
- 4046d53: Fixed an issue with the `repo lint` command where the cache key for the `--successCache` option would not properly ignore files that should be ignored according to `.eslintignore`s.
- e19c53c: Fix for the `--link` flag for `package start` to deduplicate `react-router` and `react-router-dom`.
- 17850a5: Update upgrade-helper link in `versions:bump` command to include `yarnPlugin` parameter when the yarn plugin is installed
- 09ea093: Fixed an issue where `.css` style injection would fail for published packages.
- 702f41d: Bumped dev dependencies `@types/node`
- 5d74716: Remove unused backend-common dependency
- b084f5a: Bump the Webpack dependency range to `^5.94.0`, as our current configuration is not compatible with some older versions.
- e565f73: Added support for `.webp` files in the frontend tooling.
- 946fa34: Added a new `--link <workspace-path>` option for frontend builds that allow you to override module resolution to link in an external workspace at runtime.
As part of this change the Webpack linked workspace resolution plugin for frontend builds has been removed. It was in place to support the old workspace linking where it was done by Yarn, which is no longer a working option.
- Updated dependencies
- @backstage/config@1.3.0
- @backstage/types@1.2.0
- @backstage/config-loader@1.9.2
- @backstage/cli-common@0.1.15
- @backstage/catalog-model@1.7.1
- @backstage/cli-node@0.2.10
- @backstage/errors@1.2.5
- @backstage/eslint-plugin@0.1.10
- @backstage/integration@1.15.2
- @backstage/release-manifests@0.0.11
## 0.29.0-next.3
### Minor Changes
- d849865: The package packing now populates `typesVersions` for additional entry points rather than using additional `package.json` files for type resolution. This improves auto completion of separate entry points when consuming published packages.
### Patch Changes
- 4a378d3: Fix dev server reloads of plugin discovery for new frontend system.
- 6c48ebd: Add `--max-warnings -1` support to `backstage-cli package lint`
- 23f1da2: Updated dependency `ts-morph` to `^24.0.0`.
- b533056: Updated dependency `css-loader` to `^7.0.0`.
- be008c3: Updated dependency `@module-federation/enhanced` to `^0.7.0`.
- 09ea093: Fixed an issue where `.css` style injection would fail for published packages.
- Updated dependencies
- @backstage/catalog-model@1.7.0
- @backstage/cli-common@0.1.15-next.0
- @backstage/cli-node@0.2.10-next.0
- @backstage/config@1.2.0
- @backstage/config-loader@1.9.2-next.0
- @backstage/errors@1.2.4
- @backstage/eslint-plugin@0.1.10
- @backstage/integration@1.15.1
- @backstage/release-manifests@0.0.11
- @backstage/types@1.1.1
## 0.29.0-next.2
### Minor Changes
- bc47b17: **BREAKING**: Updates ESLint config to ignore all generated source code under `src/**/generated/**/*.ts`.
### Patch Changes
- e19c53c: Fix for the `--link` flag for `package start` to deduplicate `react-router` and `react-router-dom`.
- e565f73: Added support for `.webp` files in the frontend tooling.
- Updated dependencies
- @backstage/catalog-model@1.7.0
- @backstage/cli-common@0.1.15-next.0
- @backstage/cli-node@0.2.10-next.0
- @backstage/config@1.2.0
- @backstage/config-loader@1.9.2-next.0
- @backstage/errors@1.2.4
- @backstage/eslint-plugin@0.1.10
- @backstage/integration@1.15.1
- @backstage/release-manifests@0.0.11
- @backstage/types@1.1.1
## 0.29.0-next.1
### Minor Changes
- 6819f8c: Added a new optimization to the `repo test` command that will filter out unused packages in watch mode if all provide filters are paths that point from the repo root. This significantly speeds up running individual tests from the repo root in a large workspace, for example:
```sh
yarn test packages/app/src/App.test.tsx
```
### Patch Changes
- 4046d53: Fixed an issue where the `--successCache` option for the `repo test` and `repo lint` commands would be include the workspace path in generated cache keys. This previously broke caching in environments where the workspace path varies across builds.
- 6b2888c: Fixed an issue with the `--successCache` flag for `repo test` where the tree hash for the wrong package directory would sometimes be used to generate the cache key.
- 6266ed3: Updated dependency `del` to `^8.0.0`.
- 4046d53: Fixed an issue with the `repo lint` command where the cache key for the `--successCache` option would not properly ignore files that should be ignored according to `.eslintignore`s.
- 702f41d: Bumped dev dependencies `@types/node`
- Updated dependencies
- @backstage/cli-common@0.1.15-next.0
- @backstage/catalog-model@1.7.0
- @backstage/cli-node@0.2.10-next.0
- @backstage/config@1.2.0
- @backstage/config-loader@1.9.2-next.0
- @backstage/errors@1.2.4
- @backstage/eslint-plugin@0.1.10
- @backstage/integration@1.15.1
- @backstage/release-manifests@0.0.11
- @backstage/types@1.1.1
## 0.29.0-next.0
### Minor Changes
- bc71665: **BREAKING**: The `LEGACY_BACKEND_START` flag has been removed, along with support for `src/run.ts` as the development entry point.
### Patch Changes
- 28b60ad: The check for `react-dom/client` in the Jest configuration will now properly always run from the target directory.
- e30b65d: Added `--alwaysPack` as a replacement for the now hidden `--alwaysYarnPack` flag for the `build-workspace` command.
- a7f97e4: Added a new `"rejectFrontendNetworkRequests"` configuration flag that can be set in the `"jest"` field in the root `package.json`:
```json
{
"jest": {
"rejectFrontendNetworkRequests": true
}
}
```
This flag causes rejection of any form of network requests that are attempted to be made in frontend or common package tests. This flag can only be set in the root `package.json` and can not be overridden in individual package configurations.
- 04297a0: The