@backstage/cli 0.30.1-next.0 → 0.31.0-next.1

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,30 @@
1
1
  # @backstage/cli
2
2
 
3
+ ## 0.31.0-next.1
4
+
5
+ ### Minor Changes
6
+
7
+ - 5b70679: **BREAKING**: ESLint warnings no longer trigger system exit codes like errors do.
8
+
9
+ 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.
10
+
11
+ ### Patch Changes
12
+
13
+ - e0b226b: build(deps): bump `esbuild` from 0.24.2 to 0.25.0
14
+ - 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.
15
+ - 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.
16
+ - Updated dependencies
17
+ - @backstage/config-loader@1.10.0-next.0
18
+ - @backstage/integration@1.16.2-next.0
19
+ - @backstage/catalog-model@1.7.3
20
+ - @backstage/cli-common@0.1.15
21
+ - @backstage/cli-node@0.2.13
22
+ - @backstage/config@1.3.2
23
+ - @backstage/errors@1.2.7
24
+ - @backstage/eslint-plugin@0.1.10
25
+ - @backstage/release-manifests@0.0.12
26
+ - @backstage/types@1.2.1
27
+
3
28
  ## 0.30.1-next.0
4
29
 
5
30
  ### Patch Changes
@@ -95,7 +95,7 @@ function createConfig(dir, extraConfig = {}) {
95
95
  '@typescript-eslint/no-unused-expressions': 'error',
96
96
  '@typescript-eslint/consistent-type-assertions': 'error',
97
97
  '@typescript-eslint/no-unused-vars': [
98
- 'warn',
98
+ 'error',
99
99
  {
100
100
  vars: 'all',
101
101
  args: 'after-used',
@@ -173,7 +173,7 @@ function createConfig(dir, extraConfig = {}) {
173
173
  'no-unused-vars': 'off',
174
174
  'unused-imports/no-unused-imports': 'error',
175
175
  'unused-imports/no-unused-vars': [
176
- 'warn',
176
+ 'error',
177
177
  {
178
178
  vars: 'all',
179
179
  varsIgnorePattern: '^_',
@@ -55,7 +55,7 @@ function registerScriptCommand(program) {
55
55
  "Write the lint report to a file instead of stdout"
56
56
  ).option("--fix", "Attempt to automatically fix violations").option(
57
57
  "--max-warnings <number>",
58
- "Fail if more than this number of warnings. -1 allows warnings. (default: 0)"
58
+ "Fail if more than this number of warnings. -1 allows warnings. (default: -1)"
59
59
  ).description("Lint a package").action(lazy.lazy(() => import('./lint.cjs.js'), "default"));
60
60
  command.command("clean").description("Delete cache directories").action(lazy.lazy(() => import('./clean/clean.cjs.js'), "default"));
61
61
  command.command("prepack").description("Prepares a package for packaging before publishing").action(lazy.lazy(() => import('./pack.cjs.js'), "pre"));
@@ -19,7 +19,7 @@ var lint = async (directories, opts) => {
19
19
  const results = await eslint$1.lintFiles(
20
20
  directories.length ? directories : ["."]
21
21
  );
22
- const maxWarnings = opts.maxWarnings ?? 0;
22
+ const maxWarnings = opts.maxWarnings ?? -1;
23
23
  const ignoreWarnings = +maxWarnings === -1;
24
24
  const failed = results.some((r) => r.errorCount > 0) || !ignoreWarnings && results.reduce((current, next) => current + next.warningCount, 0) > maxWarnings;
25
25
  if (opts.fix) {
@@ -17,8 +17,7 @@ var _new = async (opts) => {
17
17
  let pluginInfix = void 0;
18
18
  let packagePrefix = void 0;
19
19
  if (scope) {
20
- const backstagePrefix = scope.startsWith("backstage") ? "" : "backstage-";
21
- packagePrefix = scope.includes("/") ? `@${scope}${backstagePrefix}` : `@${scope}/${backstagePrefix}`;
20
+ packagePrefix = scope.includes("/") ? `@${scope}` : `@${scope}/`;
22
21
  pluginInfix = scope.includes("backstage") ? "plugin-" : "backstage-plugin-";
23
22
  }
24
23
  if (isPrivate === false || // set to false with --no-private flag
@@ -88,7 +88,7 @@ async function rewriteEntryPoints(pkg, packageDir, featureDetectionProject) {
88
88
  const outputExports = {};
89
89
  const entryPoints$1 = entryPoints.readEntryPoints(pkg);
90
90
  if (pkg.typesVersions) {
91
- pkg.typesVersions = { "*": {} };
91
+ pkg.typesVersions = void 0;
92
92
  }
93
93
  for (const entryPoint of entryPoints$1) {
94
94
  if (!SCRIPT_EXTS.includes(entryPoint.ext)) {
@@ -106,9 +106,8 @@ async function rewriteEntryPoints(pkg, packageDir, featureDetectionProject) {
106
106
  if (!pkg.typesVersions) {
107
107
  pkg.typesVersions = { "*": {} };
108
108
  }
109
- pkg.typesVersions["*"][entryPoint.name] = [
110
- `dist/${entryPoint.name}.d.ts`
111
- ];
109
+ const mount = entryPoint.name === "index" ? "*" : entryPoint.name;
110
+ pkg.typesVersions["*"][mount] = [`dist/${entryPoint.name}.d.ts`];
112
111
  }
113
112
  exp.default = exp.require ?? exp.import;
114
113
  if (exp.types && featureDetectionProject) {
@@ -140,6 +139,12 @@ async function rewriteEntryPoints(pkg, packageDir, featureDetectionProject) {
140
139
  outputExports[entryPoint.mount] = exp;
141
140
  }
142
141
  }
142
+ if (pkg.typesVersions?.["*"]) {
143
+ const keys = Object.keys(pkg.typesVersions["*"]);
144
+ if (keys.length === 1 && keys[0] === "*") {
145
+ delete pkg.typesVersions;
146
+ }
147
+ }
143
148
  if (pkg.exports) {
144
149
  pkg.exports = outputExports;
145
150
  pkg.exports["./package.json"] = "./package.json";
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var version = "0.8.2-next.1";
3
+ var version = "0.8.2-next.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.3.1-next.1";
3
+ var version = "1.3.1-next.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.30.1-next.0";
3
+ var version = "0.31.0-next.1";
4
4
  var dependencies = {
5
5
  "@backstage/catalog-model": "workspace:^",
6
6
  "@backstage/cli-common": "workspace:^",
@@ -50,7 +50,7 @@ var dependencies = {
50
50
  "cross-spawn": "^7.0.3",
51
51
  "css-loader": "^6.5.1",
52
52
  "ctrlc-windows": "^2.1.0",
53
- esbuild: "^0.24.0",
53
+ esbuild: "^0.25.0",
54
54
  "esbuild-loader": "^4.0.0",
55
55
  eslint: "^8.6.0",
56
56
  "eslint-config-prettier": "^9.0.0",
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var version = "1.15.5";
3
+ var version = "1.16.0-next.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.16.5-next.0";
3
+ var version = "0.16.5-next.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.1.8-next.1";
3
+ var version = "1.1.8-next.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.7.5";
3
+ var version = "1.7.6-next.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.24.4-next.1";
3
+ var version = "0.24.4-next.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.7.1-next.1";
3
+ var version = "0.8.0-next.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.20-next.1";
3
+ var version = "0.2.0-next.2";
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.1-next.0",
3
+ "version": "0.31.0-next.1",
4
4
  "description": "CLI for developing Backstage plugins and apps",
5
5
  "backstage": {
6
6
  "role": "cli"
@@ -51,10 +51,10 @@
51
51
  "@backstage/cli-common": "0.1.15",
52
52
  "@backstage/cli-node": "0.2.13",
53
53
  "@backstage/config": "1.3.2",
54
- "@backstage/config-loader": "1.9.6",
54
+ "@backstage/config-loader": "1.10.0-next.0",
55
55
  "@backstage/errors": "1.2.7",
56
56
  "@backstage/eslint-plugin": "0.1.10",
57
- "@backstage/integration": "1.16.1",
57
+ "@backstage/integration": "1.16.2-next.0",
58
58
  "@backstage/release-manifests": "0.0.12",
59
59
  "@backstage/types": "1.2.1",
60
60
  "@manypkg/get-packages": "^1.1.3",
@@ -95,7 +95,7 @@
95
95
  "cross-spawn": "^7.0.3",
96
96
  "css-loader": "^6.5.1",
97
97
  "ctrlc-windows": "^2.1.0",
98
- "esbuild": "^0.24.0",
98
+ "esbuild": "^0.25.0",
99
99
  "esbuild-loader": "^4.0.0",
100
100
  "eslint": "^8.6.0",
101
101
  "eslint-config-prettier": "^9.0.0",
@@ -164,20 +164,20 @@
164
164
  },
165
165
  "devDependencies": {
166
166
  "@backstage/backend-plugin-api": "1.2.1-next.1",
167
- "@backstage/backend-test-utils": "1.3.1-next.1",
167
+ "@backstage/backend-test-utils": "1.3.1-next.2",
168
168
  "@backstage/catalog-client": "1.9.1",
169
169
  "@backstage/config": "1.3.2",
170
- "@backstage/core-app-api": "1.15.5",
171
- "@backstage/core-components": "0.16.5-next.0",
170
+ "@backstage/core-app-api": "1.16.0-next.0",
171
+ "@backstage/core-components": "0.16.5-next.1",
172
172
  "@backstage/core-plugin-api": "1.10.4",
173
- "@backstage/dev-utils": "1.1.8-next.1",
173
+ "@backstage/dev-utils": "1.1.8-next.2",
174
174
  "@backstage/errors": "1.2.7",
175
- "@backstage/plugin-auth-backend": "0.24.4-next.1",
175
+ "@backstage/plugin-auth-backend": "0.24.4-next.2",
176
176
  "@backstage/plugin-auth-backend-module-guest-provider": "0.2.6-next.1",
177
177
  "@backstage/plugin-catalog-node": "1.16.1-next.1",
178
- "@backstage/plugin-scaffolder-node": "0.7.1-next.1",
179
- "@backstage/plugin-scaffolder-node-test-utils": "0.1.20-next.1",
180
- "@backstage/test-utils": "1.7.5",
178
+ "@backstage/plugin-scaffolder-node": "0.8.0-next.2",
179
+ "@backstage/plugin-scaffolder-node-test-utils": "0.2.0-next.2",
180
+ "@backstage/test-utils": "1.7.6-next.0",
181
181
  "@backstage/theme": "0.6.4",
182
182
  "@rspack/core": "^1.0.10",
183
183
  "@rspack/dev-server": "^1.0.9",
@@ -1,19 +1,20 @@
1
1
  import React from 'react';
2
- import { render, screen } from '@testing-library/react';
2
+ import { renderInTestApp } from '@backstage/test-utils';
3
3
  import { ExampleFetchComponent } from './ExampleFetchComponent';
4
4
 
5
5
  describe('ExampleFetchComponent', () => {
6
6
  it('renders the user table', async () => {
7
- render(<ExampleFetchComponent />);
7
+ const { getAllByText, getByAltText, getByText, findByRole } =
8
+ await renderInTestApp(<ExampleFetchComponent />);
8
9
 
9
10
  // Wait for the table to render
10
- const table = await screen.findByRole('table');
11
- const nationality = screen.getAllByText('GB');
11
+ const table = await findByRole('table');
12
+ const nationality = getAllByText('GB');
12
13
  // Assert that the table contains the expected user data
13
14
  expect(table).toBeInTheDocument();
14
- expect(screen.getByAltText('Carolyn')).toBeInTheDocument();
15
- expect(screen.getByText('Carolyn Moore')).toBeInTheDocument();
16
- expect(screen.getByText('carolyn.moore@example.com')).toBeInTheDocument();
15
+ expect(getByAltText('Carolyn')).toBeInTheDocument();
16
+ expect(getByText('Carolyn Moore')).toBeInTheDocument();
17
+ expect(getByText('carolyn.moore@example.com')).toBeInTheDocument();
17
18
  expect(nationality[0]).toBeInTheDocument();
18
19
  });
19
20
  });