@backstage/cli 0.29.0-next.2 → 0.29.0-next.3
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 +26 -0
- package/dist/commands/index.cjs.js +1 -1
- package/dist/commands/lint.cjs.js +2 -1
- package/dist/commands/repo/lint.cjs.js +2 -1
- package/dist/lib/builder/config.cjs.js +3 -2
- package/dist/lib/bundler/config.cjs.js +1 -1
- package/dist/lib/packager/productionPack.cjs.js +13 -37
- package/dist/packages/backend-defaults/package.json.cjs.js +1 -1
- package/dist/packages/backend-test-utils/package.json.cjs.js +1 -1
- package/dist/packages/cli/package.json.cjs.js +4 -4
- package/dist/packages/core-components/package.json.cjs.js +1 -1
- package/dist/packages/dev-utils/package.json.cjs.js +1 -1
- package/dist/plugins/scaffolder-node/package.json.cjs.js +1 -1
- package/dist/plugins/scaffolder-node-test-utils/package.json.cjs.js +1 -1
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @backstage/cli
|
|
2
2
|
|
|
3
|
+
## 0.29.0-next.3
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 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.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- 4a378d3: Fix dev server reloads of plugin discovery for new frontend system.
|
|
12
|
+
- 6c48ebd: Add `--max-warnings -1` support to `backstage-cli package lint`
|
|
13
|
+
- 23f1da2: Updated dependency `ts-morph` to `^24.0.0`.
|
|
14
|
+
- b533056: Updated dependency `css-loader` to `^7.0.0`.
|
|
15
|
+
- be008c3: Updated dependency `@module-federation/enhanced` to `^0.7.0`.
|
|
16
|
+
- 09ea093: Fixed an issue where `.css` style injection would fail for published packages.
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
- @backstage/catalog-model@1.7.0
|
|
19
|
+
- @backstage/cli-common@0.1.15-next.0
|
|
20
|
+
- @backstage/cli-node@0.2.10-next.0
|
|
21
|
+
- @backstage/config@1.2.0
|
|
22
|
+
- @backstage/config-loader@1.9.2-next.0
|
|
23
|
+
- @backstage/errors@1.2.4
|
|
24
|
+
- @backstage/eslint-plugin@0.1.10
|
|
25
|
+
- @backstage/integration@1.15.1
|
|
26
|
+
- @backstage/release-manifests@0.0.11
|
|
27
|
+
- @backstage/types@1.1.1
|
|
28
|
+
|
|
3
29
|
## 0.29.0-next.2
|
|
4
30
|
|
|
5
31
|
### Minor Changes
|
|
@@ -90,7 +90,7 @@ function registerScriptCommand(program) {
|
|
|
90
90
|
"eslint-formatter-friendly"
|
|
91
91
|
).option("--fix", "Attempt to automatically fix violations").option(
|
|
92
92
|
"--max-warnings <number>",
|
|
93
|
-
"Fail if more than this number of warnings (default: 0)"
|
|
93
|
+
"Fail if more than this number of warnings. -1 allows warnings. (default: 0)"
|
|
94
94
|
).description("Lint a package").action(lazy(() => Promise.resolve().then(function () { return require('./lint.cjs.js'); }).then((m) => m.default)));
|
|
95
95
|
command.command("test").allowUnknownOption(true).helpOption(", --backstage-cli-help").description("Run tests, forwarding args to Jest, defaulting to watch mode").action(lazy(() => Promise.resolve().then(function () { return require('./test.cjs.js'); }).then((m) => m.default)));
|
|
96
96
|
command.command("clean").description("Delete cache directories").action(lazy(() => Promise.resolve().then(function () { return require('./clean/clean.cjs.js'); }).then((m) => m.default)));
|
|
@@ -15,7 +15,8 @@ var lint = async (directories, opts) => {
|
|
|
15
15
|
directories.length ? directories : ["."]
|
|
16
16
|
);
|
|
17
17
|
const maxWarnings = opts.maxWarnings ?? 0;
|
|
18
|
-
const
|
|
18
|
+
const ignoreWarnings = +maxWarnings === -1;
|
|
19
|
+
const failed = results.some((r) => r.errorCount > 0) || !ignoreWarnings && results.reduce((current, next) => current + next.warningCount, 0) > maxWarnings;
|
|
19
20
|
if (opts.fix) {
|
|
20
21
|
await eslint.ESLint.outputFixes(results);
|
|
21
22
|
}
|
|
@@ -145,8 +145,9 @@ async function command(opts, cmd) {
|
|
|
145
145
|
await ESLint.outputFixes(results);
|
|
146
146
|
}
|
|
147
147
|
const maxWarnings = lintOptions?.maxWarnings ?? 0;
|
|
148
|
+
const ignoreWarnings = +maxWarnings === -1;
|
|
148
149
|
const resultText = formatter.format(results);
|
|
149
|
-
const failed2 = results.some((r) => r.errorCount > 0) || results.reduce((current, next) => current + next.warningCount, 0) > maxWarnings;
|
|
150
|
+
const failed2 = results.some((r) => r.errorCount > 0) || !ignoreWarnings && results.reduce((current, next) => current + next.warningCount, 0) > maxWarnings;
|
|
150
151
|
return {
|
|
151
152
|
relativeDir,
|
|
152
153
|
resultText,
|
|
@@ -87,10 +87,11 @@ async function makeRollupConfigs(options) {
|
|
|
87
87
|
if (options.outputs.has(types.Output.cjs) || options.outputs.has(types.Output.esm)) {
|
|
88
88
|
const output = new Array();
|
|
89
89
|
const mainFields = ["module", "main"];
|
|
90
|
+
const rewriteNodeModules = (name) => name.replaceAll("node_modules", "node_modules_dist");
|
|
90
91
|
if (options.outputs.has(types.Output.cjs)) {
|
|
91
92
|
output.push({
|
|
92
93
|
dir: distDir,
|
|
93
|
-
entryFileNames:
|
|
94
|
+
entryFileNames: (chunkInfo) => `${rewriteNodeModules(chunkInfo.name)}.cjs.js`,
|
|
94
95
|
chunkFileNames: `cjs/[name]-[hash].cjs.js`,
|
|
95
96
|
format: "commonjs",
|
|
96
97
|
interop: "compat",
|
|
@@ -103,7 +104,7 @@ async function makeRollupConfigs(options) {
|
|
|
103
104
|
if (options.outputs.has(types.Output.esm)) {
|
|
104
105
|
output.push({
|
|
105
106
|
dir: distDir,
|
|
106
|
-
entryFileNames:
|
|
107
|
+
entryFileNames: (chunkInfo) => `${rewriteNodeModules(chunkInfo.name)}.esm.js`,
|
|
107
108
|
chunkFileNames: `esm/[name]-[hash].esm.js`,
|
|
108
109
|
format: "module",
|
|
109
110
|
sourcemap: true,
|
|
@@ -23,18 +23,13 @@ async function productionPack(options) {
|
|
|
23
23
|
if (!targetDir) {
|
|
24
24
|
await fs__default.default.writeFile(PKG_BACKUP_PATH, pkgContent);
|
|
25
25
|
}
|
|
26
|
-
|
|
27
|
-
pkg,
|
|
28
|
-
packageDir,
|
|
29
|
-
options.featureDetectionProject
|
|
30
|
-
);
|
|
26
|
+
await rewriteEntryPoints(pkg, packageDir, options.featureDetectionProject);
|
|
31
27
|
const publishConfig = pkg.publishConfig ?? {};
|
|
32
28
|
for (const key of Object.keys(publishConfig)) {
|
|
33
29
|
if (!SKIPPED_KEYS.includes(key)) {
|
|
34
30
|
pkg[key] = publishConfig[key];
|
|
35
31
|
}
|
|
36
32
|
}
|
|
37
|
-
delete pkg.typesVersions;
|
|
38
33
|
if (pkg.bundled) {
|
|
39
34
|
delete pkg.dependencies;
|
|
40
35
|
delete pkg.devDependencies;
|
|
@@ -62,9 +57,6 @@ async function productionPack(options) {
|
|
|
62
57
|
} else {
|
|
63
58
|
await fs__default.default.writeJson(pkgPath, pkg, { encoding: "utf8", spaces: 2 });
|
|
64
59
|
}
|
|
65
|
-
if (writeCompatibilityEntryPoints) {
|
|
66
|
-
await writeCompatibilityEntryPoints(targetDir ?? packageDir);
|
|
67
|
-
}
|
|
68
60
|
}
|
|
69
61
|
async function revertProductionPack(packageDir) {
|
|
70
62
|
try {
|
|
@@ -87,15 +79,17 @@ const EXPORT_MAP = {
|
|
|
87
79
|
require: ".cjs.js",
|
|
88
80
|
types: ".d.ts"
|
|
89
81
|
};
|
|
90
|
-
async function
|
|
82
|
+
async function rewriteEntryPoints(pkg, packageDir, featureDetectionProject) {
|
|
91
83
|
const distPath = path.resolve(packageDir, "dist");
|
|
92
84
|
if (!await fs__default.default.pathExists(distPath)) {
|
|
93
85
|
return void 0;
|
|
94
86
|
}
|
|
95
87
|
const distFiles = await fs__default.default.readdir(distPath);
|
|
96
88
|
const outputExports = {};
|
|
97
|
-
const compatibilityWriters = new Array();
|
|
98
89
|
const entryPoints$1 = entryPoints.readEntryPoints(pkg);
|
|
90
|
+
if (pkg.typesVersions) {
|
|
91
|
+
pkg.typesVersions = { "*": {} };
|
|
92
|
+
}
|
|
99
93
|
for (const entryPoint of entryPoints$1) {
|
|
100
94
|
if (!SCRIPT_EXTS.includes(entryPoint.ext)) {
|
|
101
95
|
outputExports[entryPoint.mount] = entryPoint.path;
|
|
@@ -108,6 +102,14 @@ async function prepareExportsEntryPoints(pkg, packageDir, featureDetectionProjec
|
|
|
108
102
|
exp[key] = `./${path.posix.join(`dist`, name)}`;
|
|
109
103
|
}
|
|
110
104
|
}
|
|
105
|
+
if (exp.types) {
|
|
106
|
+
if (!pkg.typesVersions) {
|
|
107
|
+
pkg.typesVersions = { "*": {} };
|
|
108
|
+
}
|
|
109
|
+
pkg.typesVersions["*"][entryPoint.name] = [
|
|
110
|
+
`dist/${entryPoint.name}.d.ts`
|
|
111
|
+
];
|
|
112
|
+
}
|
|
111
113
|
exp.default = exp.require ?? exp.import;
|
|
112
114
|
if (exp.types && featureDetectionProject) {
|
|
113
115
|
const defaultFeatureType = pkg.backstage?.role && typeDistProject.getEntryPointDefaultFeatureType(
|
|
@@ -130,27 +132,6 @@ async function prepareExportsEntryPoints(pkg, packageDir, featureDetectionProjec
|
|
|
130
132
|
if (exp.types) {
|
|
131
133
|
pkg.types = exp.types;
|
|
132
134
|
}
|
|
133
|
-
} else {
|
|
134
|
-
compatibilityWriters.push(async (targetDir) => {
|
|
135
|
-
const entryPointDir = path.resolve(targetDir, entryPoint.name);
|
|
136
|
-
await fs__default.default.ensureDir(entryPointDir);
|
|
137
|
-
await fs__default.default.writeJson(
|
|
138
|
-
path.resolve(entryPointDir, PKG_PATH),
|
|
139
|
-
{
|
|
140
|
-
// Need a temporary name, as sharing the same name causes some typescript issues with caching of packages names
|
|
141
|
-
// And their defined `types` field.
|
|
142
|
-
name: `${pkg.name}__${entryPoint.name.toLocaleLowerCase("en-US")}`,
|
|
143
|
-
version: pkg.version,
|
|
144
|
-
...exp.default ? { main: path.posix.join("..", exp.default) } : {},
|
|
145
|
-
...exp.import ? { module: path.posix.join("..", exp.import) } : {},
|
|
146
|
-
...exp.types ? { types: path.posix.join("..", exp.types) } : {}
|
|
147
|
-
},
|
|
148
|
-
{ encoding: "utf8", spaces: 2 }
|
|
149
|
-
);
|
|
150
|
-
});
|
|
151
|
-
if (Array.isArray(pkg.files) && !pkg.files.includes(entryPoint.name)) {
|
|
152
|
-
pkg.files.push(entryPoint.name);
|
|
153
|
-
}
|
|
154
135
|
}
|
|
155
136
|
if (Object.keys(exp).length > 0) {
|
|
156
137
|
outputExports[entryPoint.mount] = exp;
|
|
@@ -160,11 +141,6 @@ async function prepareExportsEntryPoints(pkg, packageDir, featureDetectionProjec
|
|
|
160
141
|
pkg.exports = outputExports;
|
|
161
142
|
pkg.exports["./package.json"] = "./package.json";
|
|
162
143
|
}
|
|
163
|
-
if (compatibilityWriters.length > 0) {
|
|
164
|
-
return async (targetDir) => {
|
|
165
|
-
await Promise.all(compatibilityWriters.map((writer) => writer(targetDir)));
|
|
166
|
-
};
|
|
167
|
-
}
|
|
168
144
|
return void 0;
|
|
169
145
|
}
|
|
170
146
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var version = "0.29.0-next.
|
|
3
|
+
var version = "0.29.0-next.3";
|
|
4
4
|
var dependencies = {
|
|
5
5
|
"@backstage/catalog-model": "workspace:^",
|
|
6
6
|
"@backstage/cli-common": "workspace:^",
|
|
@@ -13,7 +13,7 @@ var dependencies = {
|
|
|
13
13
|
"@backstage/release-manifests": "workspace:^",
|
|
14
14
|
"@backstage/types": "workspace:^",
|
|
15
15
|
"@manypkg/get-packages": "^1.1.3",
|
|
16
|
-
"@module-federation/enhanced": "^0.
|
|
16
|
+
"@module-federation/enhanced": "^0.7.0",
|
|
17
17
|
"@octokit/graphql": "^5.0.0",
|
|
18
18
|
"@octokit/graphql-schema": "^13.7.0",
|
|
19
19
|
"@octokit/oauth-app": "^4.2.0",
|
|
@@ -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": "^
|
|
51
|
+
"css-loader": "^7.0.0",
|
|
52
52
|
"ctrlc-windows": "^2.1.0",
|
|
53
53
|
esbuild: "^0.24.0",
|
|
54
54
|
"esbuild-loader": "^4.0.0",
|
|
@@ -107,7 +107,7 @@ var dependencies = {
|
|
|
107
107
|
"swc-loader": "^0.2.3",
|
|
108
108
|
tar: "^6.1.12",
|
|
109
109
|
"terser-webpack-plugin": "^5.1.3",
|
|
110
|
-
"ts-morph": "^
|
|
110
|
+
"ts-morph": "^24.0.0",
|
|
111
111
|
util: "^0.12.3",
|
|
112
112
|
webpack: "^5.94.0",
|
|
113
113
|
"webpack-dev-server": "^5.0.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/cli",
|
|
3
|
-
"version": "0.29.0-next.
|
|
3
|
+
"version": "0.29.0-next.3",
|
|
4
4
|
"description": "CLI for developing Backstage plugins and apps",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "cli"
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@backstage/release-manifests": "0.0.11",
|
|
54
54
|
"@backstage/types": "1.1.1",
|
|
55
55
|
"@manypkg/get-packages": "^1.1.3",
|
|
56
|
-
"@module-federation/enhanced": "^0.
|
|
56
|
+
"@module-federation/enhanced": "^0.7.0",
|
|
57
57
|
"@octokit/graphql": "^5.0.0",
|
|
58
58
|
"@octokit/graphql-schema": "^13.7.0",
|
|
59
59
|
"@octokit/oauth-app": "^4.2.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": "^
|
|
91
|
+
"css-loader": "^7.0.0",
|
|
92
92
|
"ctrlc-windows": "^2.1.0",
|
|
93
93
|
"esbuild": "^0.24.0",
|
|
94
94
|
"esbuild-loader": "^4.0.0",
|
|
@@ -147,7 +147,7 @@
|
|
|
147
147
|
"swc-loader": "^0.2.3",
|
|
148
148
|
"tar": "^6.1.12",
|
|
149
149
|
"terser-webpack-plugin": "^5.1.3",
|
|
150
|
-
"ts-morph": "^
|
|
150
|
+
"ts-morph": "^24.0.0",
|
|
151
151
|
"util": "^0.12.3",
|
|
152
152
|
"webpack": "^5.94.0",
|
|
153
153
|
"webpack-dev-server": "^5.0.0",
|
|
@@ -160,19 +160,19 @@
|
|
|
160
160
|
"devDependencies": {
|
|
161
161
|
"@backstage/backend-common": "^0.25.0",
|
|
162
162
|
"@backstage/backend-plugin-api": "1.0.2-next.2",
|
|
163
|
-
"@backstage/backend-test-utils": "1.1.0-next.
|
|
163
|
+
"@backstage/backend-test-utils": "1.1.0-next.3",
|
|
164
164
|
"@backstage/catalog-client": "1.8.0-next.1",
|
|
165
165
|
"@backstage/config": "1.2.0",
|
|
166
166
|
"@backstage/core-app-api": "1.15.1",
|
|
167
|
-
"@backstage/core-components": "0.16.0-next.
|
|
167
|
+
"@backstage/core-components": "0.16.0-next.2",
|
|
168
168
|
"@backstage/core-plugin-api": "1.10.0",
|
|
169
|
-
"@backstage/dev-utils": "1.1.3-next.
|
|
169
|
+
"@backstage/dev-utils": "1.1.3-next.3",
|
|
170
170
|
"@backstage/errors": "1.2.4",
|
|
171
171
|
"@backstage/plugin-auth-backend": "0.24.0-next.2",
|
|
172
172
|
"@backstage/plugin-auth-backend-module-guest-provider": "0.2.2-next.2",
|
|
173
173
|
"@backstage/plugin-catalog-node": "1.14.0-next.2",
|
|
174
|
-
"@backstage/plugin-scaffolder-node": "0.5.1-next.
|
|
175
|
-
"@backstage/plugin-scaffolder-node-test-utils": "0.1.15-next.
|
|
174
|
+
"@backstage/plugin-scaffolder-node": "0.5.1-next.3",
|
|
175
|
+
"@backstage/plugin-scaffolder-node-test-utils": "0.1.15-next.3",
|
|
176
176
|
"@backstage/test-utils": "1.7.1-next.0",
|
|
177
177
|
"@backstage/theme": "0.6.1-next.0",
|
|
178
178
|
"@rspack/core": "^1.0.10",
|