@backstage/cli 0.35.5-next.0 → 0.36.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 +27 -0
- package/config/jest.js +2 -2
- package/dist/modules/{maintenance → build}/commands/package/clean.cjs.js +4 -2
- package/dist/modules/build/commands/package/postpack.cjs.js +15 -0
- package/dist/modules/{maintenance/commands/package/pack.cjs.js → build/commands/package/prepack.cjs.js} +10 -10
- package/dist/modules/build/commands/package/start/startFrontend.cjs.js +1 -1
- package/dist/modules/build/commands/repo/build.cjs.js +1 -1
- package/dist/modules/{maintenance → build}/commands/repo/clean.cjs.js +7 -3
- package/dist/modules/build/index.cjs.js +37 -4
- package/dist/modules/build/lib/buildFrontend.cjs.js +2 -2
- package/dist/modules/build/lib/bundler/config.cjs.js +1 -1
- package/dist/modules/build/lib/bundler/moduleFederation.cjs.js +1 -1
- package/dist/modules/build/lib/bundler/server.cjs.js +1 -1
- package/dist/modules/build/lib/config.cjs.js +94 -0
- package/dist/{lib → modules/build/lib}/optionsParser.cjs.js +2 -2
- package/dist/modules/build/lib/packager/createDistWorkspace.cjs.js +1 -1
- package/dist/modules/build/lib/packager/productionPack.cjs.js +1 -1
- package/dist/modules/config/commands/docs.cjs.js +18 -2
- package/dist/modules/config/commands/print.cjs.js +38 -11
- package/dist/modules/config/commands/schema.cjs.js +22 -4
- package/dist/modules/config/commands/validate.cjs.js +37 -7
- package/dist/modules/config/index.cjs.js +6 -65
- package/dist/modules/config/lib/config.cjs.js +6 -22
- package/dist/modules/create-github-app/index.cjs.js +1 -1
- package/dist/modules/info/commands/info.cjs.js +25 -6
- package/dist/modules/info/index.cjs.js +1 -23
- package/dist/modules/lint/commands/repo/lint.cjs.js +5 -3
- package/dist/modules/lint/index.cjs.js +1 -1
- package/dist/modules/lint/lib/optionsParser.cjs.js +37 -0
- package/dist/modules/maintenance/commands/repo/fix.cjs.js +1 -4
- package/dist/modules/maintenance/index.cjs.js +1 -45
- package/dist/modules/migrate/commands/packageExports.cjs.js +9 -11
- package/dist/modules/migrate/commands/packageLintConfigs.cjs.js +7 -3
- package/dist/modules/migrate/commands/packageRole.cjs.js +3 -1
- package/dist/modules/migrate/commands/packageScripts.cjs.js +11 -7
- package/dist/modules/migrate/commands/reactRouterDeps.cjs.js +7 -3
- package/dist/modules/migrate/commands/versions/bump.cjs.js +7 -9
- package/dist/modules/migrate/index.cjs.js +11 -31
- package/dist/modules/new/index.cjs.js +1 -1
- package/dist/modules/new/lib/execution/PortableTemplater.cjs.js +5 -9
- package/dist/modules/new/lib/preparation/loadPortableTemplate.cjs.js +6 -6
- package/dist/modules/new/lib/preparation/loadPortableTemplateConfig.cjs.js +16 -16
- package/dist/{lib → modules/new/lib}/version.cjs.js +22 -34
- package/dist/modules/test/commands/package/test.cjs.js +0 -3
- package/dist/modules/test/commands/repo/test.cjs.js +6 -5
- package/dist/modules/test/index.cjs.js +1 -1
- package/dist/modules/translations/commands/export.cjs.js +24 -1
- package/dist/modules/translations/commands/import.cjs.js +24 -1
- package/dist/modules/translations/index.cjs.js +2 -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/catalog-client/package.json.cjs.js +1 -1
- package/dist/packages/cli/package.json.cjs.js +2 -4
- package/dist/packages/dev-utils/package.json.cjs.js +1 -1
- package/dist/packages/frontend-test-utils/package.json.cjs.js +1 -1
- package/dist/plugins/auth-backend/package.json.cjs.js +1 -1
- package/dist/plugins/catalog-node/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/dist/wiring/CliInitializer.cjs.js +12 -5
- package/dist/wiring/version.cjs.js +20 -0
- package/package.json +13 -15
- package/dist/lib/cache/SuccessCache.cjs.js +0 -79
- package/dist/lib/versioning/Lockfile.cjs.js +0 -89
- package/dist/lib/yarnPlugin.cjs.js +0 -46
- /package/dist/modules/{maintenance → build}/lib/publishing.cjs.js +0 -0
- /package/dist/{lib → modules/build/lib}/typeDistProject.cjs.js +0 -0
- /package/dist/{lib → modules/migrate/lib}/versioning/packages.cjs.js +0 -0
- /package/dist/{lib → modules/migrate/lib}/versioning/yarn.cjs.js +0 -0
- /package/dist/{lib → wiring}/errors.cjs.js +0 -0
- /package/dist/{lib → wiring}/lazy.cjs.js +0 -0
|
@@ -3,13 +3,6 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var factory = require('../../wiring/factory.cjs.js');
|
|
6
|
-
var yargs = require('yargs');
|
|
7
|
-
var commander = require('commander');
|
|
8
|
-
var lazy = require('../../lib/lazy.cjs.js');
|
|
9
|
-
|
|
10
|
-
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
11
|
-
|
|
12
|
-
var yargs__default = /*#__PURE__*/_interopDefaultCompat(yargs);
|
|
13
6
|
|
|
14
7
|
const configOption = [
|
|
15
8
|
"--config <path>",
|
|
@@ -23,84 +16,32 @@ var index = factory.createCliPlugin({
|
|
|
23
16
|
reg.addCommand({
|
|
24
17
|
path: ["config:docs"],
|
|
25
18
|
description: "Browse the configuration reference documentation",
|
|
26
|
-
execute:
|
|
27
|
-
const command = new commander.Command();
|
|
28
|
-
const defaultCommand = command.option(
|
|
29
|
-
"--package <name>",
|
|
30
|
-
"Only include the schema that applies to the given package"
|
|
31
|
-
).description("Browse the configuration reference documentation").action(lazy.lazy(() => import('./commands/docs.cjs.js'), "default"));
|
|
32
|
-
await defaultCommand.parseAsync(args, { from: "user" });
|
|
33
|
-
}
|
|
19
|
+
execute: { loader: () => import('./commands/docs.cjs.js') }
|
|
34
20
|
});
|
|
35
21
|
reg.addCommand({
|
|
36
22
|
path: ["config", "docs"],
|
|
37
23
|
description: "Browse the configuration reference documentation",
|
|
38
|
-
execute:
|
|
39
|
-
await new commander.Command(info.usage).option(
|
|
40
|
-
"--package <name>",
|
|
41
|
-
"Only include the schema that applies to the given package"
|
|
42
|
-
).description(info.description).action(lazy.lazy(() => import('./commands/docs.cjs.js'), "default")).parseAsync(args, { from: "user" });
|
|
43
|
-
}
|
|
24
|
+
execute: { loader: () => import('./commands/docs.cjs.js') }
|
|
44
25
|
});
|
|
45
26
|
reg.addCommand({
|
|
46
27
|
path: ["config:print"],
|
|
47
28
|
description: "Print the app configuration for the current package",
|
|
48
|
-
execute:
|
|
49
|
-
const argv = await yargs__default.default().options({
|
|
50
|
-
package: { type: "string" },
|
|
51
|
-
lax: { type: "boolean" },
|
|
52
|
-
frontend: { type: "boolean" },
|
|
53
|
-
"with-secrets": { type: "boolean" },
|
|
54
|
-
format: { type: "string" },
|
|
55
|
-
config: { type: "string", array: true, default: [] }
|
|
56
|
-
}).usage("$0", info.description).help().parse(args);
|
|
57
|
-
await lazy.lazy(() => import('./commands/print.cjs.js'), "default")(argv);
|
|
58
|
-
}
|
|
29
|
+
execute: { loader: () => import('./commands/print.cjs.js') }
|
|
59
30
|
});
|
|
60
31
|
reg.addCommand({
|
|
61
32
|
path: ["config:check"],
|
|
62
33
|
description: "Validate that the given configuration loads and matches schema",
|
|
63
|
-
execute:
|
|
64
|
-
const argv = await yargs__default.default().options({
|
|
65
|
-
package: { type: "string" },
|
|
66
|
-
lax: { type: "boolean" },
|
|
67
|
-
frontend: { type: "boolean" },
|
|
68
|
-
deprecated: { type: "boolean" },
|
|
69
|
-
strict: { type: "boolean" },
|
|
70
|
-
config: {
|
|
71
|
-
type: "string",
|
|
72
|
-
array: true,
|
|
73
|
-
default: []
|
|
74
|
-
}
|
|
75
|
-
}).help().parse(args);
|
|
76
|
-
await lazy.lazy(() => import('./commands/validate.cjs.js'), "default")(argv);
|
|
77
|
-
}
|
|
34
|
+
execute: { loader: () => import('./commands/validate.cjs.js') }
|
|
78
35
|
});
|
|
79
36
|
reg.addCommand({
|
|
80
37
|
path: ["config:schema"],
|
|
81
38
|
description: "Print the JSON schema for the given configuration",
|
|
82
|
-
execute:
|
|
83
|
-
const argv = await yargs__default.default().options({
|
|
84
|
-
package: { type: "string" },
|
|
85
|
-
format: { type: "string" },
|
|
86
|
-
merge: { type: "boolean" },
|
|
87
|
-
"no-merge": { type: "boolean" }
|
|
88
|
-
}).help().parse(args);
|
|
89
|
-
await lazy.lazy(() => import('./commands/schema.cjs.js'), "default")(argv);
|
|
90
|
-
}
|
|
39
|
+
execute: { loader: () => import('./commands/schema.cjs.js') }
|
|
91
40
|
});
|
|
92
41
|
reg.addCommand({
|
|
93
42
|
path: ["config", "schema"],
|
|
94
43
|
description: "Print the JSON schema for the given configuration",
|
|
95
|
-
execute:
|
|
96
|
-
const argv = await yargs__default.default().options({
|
|
97
|
-
package: { type: "string" },
|
|
98
|
-
format: { type: "string" },
|
|
99
|
-
merge: { type: "boolean" },
|
|
100
|
-
"no-merge": { type: "boolean" }
|
|
101
|
-
}).help().parse(args);
|
|
102
|
-
await lazy.lazy(() => import('./commands/schema.cjs.js'), "default")(argv);
|
|
103
|
-
}
|
|
44
|
+
execute: { loader: () => import('./commands/schema.cjs.js') }
|
|
104
45
|
});
|
|
105
46
|
}
|
|
106
47
|
});
|
|
@@ -37,43 +37,28 @@ async function loadCliConfig(options) {
|
|
|
37
37
|
const source = configLoader.ConfigSources.default({
|
|
38
38
|
allowMissingDefaultConfig: true,
|
|
39
39
|
substitutionFunc: options.mockEnv ? async (name) => process.env[name] || "x" : void 0,
|
|
40
|
-
watch: Boolean(options.watch),
|
|
41
40
|
rootDir: cliCommon.targetPaths.rootDir,
|
|
42
41
|
argv: options.args.flatMap((t) => ["--config", path.resolve(targetDir, t)])
|
|
43
42
|
});
|
|
44
43
|
const appConfigs = await new Promise((resolve, reject) => {
|
|
45
|
-
async function
|
|
44
|
+
async function readConfig() {
|
|
46
45
|
let loaded = false;
|
|
47
46
|
try {
|
|
48
47
|
const abortController = new AbortController();
|
|
49
48
|
for await (const { configs } of source.readConfigData({
|
|
50
49
|
signal: abortController.signal
|
|
51
50
|
})) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
withFilteredKeys: options.withFilteredKeys,
|
|
56
|
-
withDeprecatedKeys: options.withDeprecatedKeys,
|
|
57
|
-
ignoreSchemaErrors: !options.strict
|
|
58
|
-
});
|
|
59
|
-
options.watch?.(newFrontendAppConfigs);
|
|
60
|
-
} else {
|
|
61
|
-
resolve(configs);
|
|
62
|
-
loaded = true;
|
|
63
|
-
if (!options.watch) {
|
|
64
|
-
abortController.abort();
|
|
65
|
-
}
|
|
66
|
-
}
|
|
51
|
+
resolve(configs);
|
|
52
|
+
loaded = true;
|
|
53
|
+
abortController.abort();
|
|
67
54
|
}
|
|
68
55
|
} catch (error) {
|
|
69
|
-
if (loaded) {
|
|
70
|
-
console.error(`Failed to reload configuration, ${error}`);
|
|
71
|
-
} else {
|
|
56
|
+
if (!loaded) {
|
|
72
57
|
reject(error);
|
|
73
58
|
}
|
|
74
59
|
}
|
|
75
60
|
}
|
|
76
|
-
|
|
61
|
+
readConfig();
|
|
77
62
|
});
|
|
78
63
|
const configurationLoadedMessage = appConfigs.length ? `Loaded config from ${appConfigs.map((c) => c.context).join(", ")}` : `No configuration files found, running without config`;
|
|
79
64
|
process.stderr.write(`${configurationLoadedMessage}
|
|
@@ -81,7 +66,6 @@ async function loadCliConfig(options) {
|
|
|
81
66
|
try {
|
|
82
67
|
const frontendAppConfigs = schema.process(appConfigs, {
|
|
83
68
|
visibility: options.fullVisibility ? ["frontend", "backend", "secret"] : ["frontend"],
|
|
84
|
-
withFilteredKeys: options.withFilteredKeys,
|
|
85
69
|
withDeprecatedKeys: options.withDeprecatedKeys,
|
|
86
70
|
ignoreSchemaErrors: !options.strict
|
|
87
71
|
});
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var factory = require('../../wiring/factory.cjs.js');
|
|
6
6
|
var commander = require('commander');
|
|
7
|
-
var lazy = require('../../
|
|
7
|
+
var lazy = require('../../wiring/lazy.cjs.js');
|
|
8
8
|
|
|
9
9
|
var index = factory.createCliPlugin({
|
|
10
10
|
pluginId: "new",
|
|
@@ -2,14 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var cleye = require('cleye');
|
|
5
6
|
var _package = require('../../../packages/cli/package.json.cjs.js');
|
|
6
7
|
var os = require('node:os');
|
|
7
8
|
var cliCommon = require('@backstage/cli-common');
|
|
8
|
-
var Lockfile = require('../../../lib/versioning/Lockfile.cjs.js');
|
|
9
|
-
var minimatch = require('minimatch');
|
|
10
|
-
require('@manypkg/get-packages');
|
|
11
|
-
require('@backstage/errors');
|
|
12
9
|
var cliNode = require('@backstage/cli-node');
|
|
10
|
+
var minimatch = require('minimatch');
|
|
13
11
|
var fs = require('fs-extra');
|
|
14
12
|
|
|
15
13
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
@@ -30,7 +28,28 @@ function hasBackstageField(packageName, targetPath) {
|
|
|
30
28
|
const pkg = tryReadPackageJson(packageName, targetPath);
|
|
31
29
|
return pkg?.backstage !== void 0;
|
|
32
30
|
}
|
|
33
|
-
var info = async (
|
|
31
|
+
var info = async ({ args, info }) => {
|
|
32
|
+
const {
|
|
33
|
+
flags: { include, format }
|
|
34
|
+
} = cleye.cli(
|
|
35
|
+
{
|
|
36
|
+
help: info,
|
|
37
|
+
flags: {
|
|
38
|
+
include: {
|
|
39
|
+
type: [String],
|
|
40
|
+
description: "Glob patterns for additional packages to include (e.g., @spotify/backstage*)"
|
|
41
|
+
},
|
|
42
|
+
format: {
|
|
43
|
+
type: String,
|
|
44
|
+
description: "Output format (text or json)",
|
|
45
|
+
default: "text"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
void 0,
|
|
50
|
+
args
|
|
51
|
+
);
|
|
52
|
+
const options = { include, format };
|
|
34
53
|
await new Promise(async () => {
|
|
35
54
|
const yarnVersion = await cliCommon.runOutput(["yarn", "--version"]);
|
|
36
55
|
const isLocal = fs__default.default.existsSync(cliCommon.findOwnPaths(__dirname).resolve("./src"));
|
|
@@ -57,7 +76,7 @@ var info = async (options) => {
|
|
|
57
76
|
backstage: backstageVersion
|
|
58
77
|
};
|
|
59
78
|
const lockfilePath = cliCommon.targetPaths.resolveRoot("yarn.lock");
|
|
60
|
-
const lockfile = await
|
|
79
|
+
const lockfile = await cliNode.Lockfile.load(lockfilePath);
|
|
61
80
|
const targetPath = cliCommon.targetPaths.rootDir;
|
|
62
81
|
const workspacePackages = /* @__PURE__ */ new Map();
|
|
63
82
|
try {
|
|
@@ -2,13 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var yargs = require('yargs');
|
|
6
5
|
var factory = require('../../wiring/factory.cjs.js');
|
|
7
|
-
var lazy = require('../../lib/lazy.cjs.js');
|
|
8
|
-
|
|
9
|
-
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
10
|
-
|
|
11
|
-
var yargs__default = /*#__PURE__*/_interopDefaultCompat(yargs);
|
|
12
6
|
|
|
13
7
|
var index = factory.createCliPlugin({
|
|
14
8
|
pluginId: "info",
|
|
@@ -16,23 +10,7 @@ var index = factory.createCliPlugin({
|
|
|
16
10
|
reg.addCommand({
|
|
17
11
|
path: ["info"],
|
|
18
12
|
description: "Show helpful information for debugging and reporting bugs",
|
|
19
|
-
execute:
|
|
20
|
-
const argv = await yargs__default.default().options({
|
|
21
|
-
include: {
|
|
22
|
-
type: "string",
|
|
23
|
-
array: true,
|
|
24
|
-
default: [],
|
|
25
|
-
description: "Glob patterns for additional packages to include (e.g., @spotify/backstage*)"
|
|
26
|
-
},
|
|
27
|
-
format: {
|
|
28
|
-
type: "string",
|
|
29
|
-
choices: ["text", "json"],
|
|
30
|
-
default: "text",
|
|
31
|
-
description: "Output format (text or json)"
|
|
32
|
-
}
|
|
33
|
-
}).help().parse(args);
|
|
34
|
-
await lazy.lazy(() => import('./commands/info.cjs.js'), "default")(argv);
|
|
35
|
-
}
|
|
13
|
+
execute: { loader: () => import('./commands/info.cjs.js') }
|
|
36
14
|
});
|
|
37
15
|
}
|
|
38
16
|
});
|
|
@@ -6,8 +6,7 @@ var crypto = require('node:crypto');
|
|
|
6
6
|
var path = require('node:path');
|
|
7
7
|
var cliNode = require('@backstage/cli-node');
|
|
8
8
|
var cliCommon = require('@backstage/cli-common');
|
|
9
|
-
var optionsParser = require('
|
|
10
|
-
var SuccessCache = require('../../../../lib/cache/SuccessCache.cjs.js');
|
|
9
|
+
var optionsParser = require('../../lib/optionsParser.cjs.js');
|
|
11
10
|
|
|
12
11
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
13
12
|
|
|
@@ -21,7 +20,10 @@ function depCount(pkg) {
|
|
|
21
20
|
}
|
|
22
21
|
async function command(opts, cmd) {
|
|
23
22
|
let packages = await cliNode.PackageGraph.listTargetPackages();
|
|
24
|
-
const cache =
|
|
23
|
+
const cache = cliNode.SuccessCache.create({
|
|
24
|
+
name: "lint",
|
|
25
|
+
basePath: opts.successCacheDir
|
|
26
|
+
});
|
|
25
27
|
const cacheContext = opts.successCache ? {
|
|
26
28
|
entries: await cache.read(),
|
|
27
29
|
lockfile: await cliNode.Lockfile.load(cliCommon.targetPaths.resolveRoot("yarn.lock"))
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var factory = require('../../wiring/factory.cjs.js');
|
|
6
6
|
var commander = require('commander');
|
|
7
|
-
var lazy = require('../../
|
|
7
|
+
var lazy = require('../../wiring/lazy.cjs.js');
|
|
8
8
|
|
|
9
9
|
function registerPackageLintCommand(command) {
|
|
10
10
|
command.arguments("[directories...]");
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function createScriptOptionsParser(anyCmd, commandPath) {
|
|
4
|
+
let rootCmd = anyCmd;
|
|
5
|
+
while (rootCmd.parent) {
|
|
6
|
+
rootCmd = rootCmd.parent;
|
|
7
|
+
}
|
|
8
|
+
let targetCmd = rootCmd;
|
|
9
|
+
for (const name of commandPath) {
|
|
10
|
+
targetCmd = targetCmd?.commands.find((c) => c.name() === name);
|
|
11
|
+
}
|
|
12
|
+
if (!targetCmd) {
|
|
13
|
+
throw new Error(
|
|
14
|
+
`Could not find package command '${commandPath.join(" ")}'`
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
const cmd = targetCmd;
|
|
18
|
+
const expectedScript = `backstage-cli ${commandPath.join(" ")}`;
|
|
19
|
+
return (scriptStr) => {
|
|
20
|
+
if (!scriptStr || !scriptStr.startsWith(expectedScript)) {
|
|
21
|
+
return void 0;
|
|
22
|
+
}
|
|
23
|
+
const argsStr = scriptStr.slice(expectedScript.length).trim();
|
|
24
|
+
const currentOpts = cmd._optionValues;
|
|
25
|
+
const currentStore = cmd._storeOptionsAsProperties;
|
|
26
|
+
const result = {};
|
|
27
|
+
cmd._storeOptionsAsProperties = false;
|
|
28
|
+
cmd._optionValues = result;
|
|
29
|
+
cmd.parseOptions(argsStr.split(" "));
|
|
30
|
+
cmd._optionValues = currentOpts;
|
|
31
|
+
cmd._storeOptionsAsProperties = currentStore;
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
exports.createScriptOptionsParser = createScriptOptionsParser;
|
|
37
|
+
//# sourceMappingURL=optionsParser.cjs.js.map
|
|
@@ -4,7 +4,6 @@ var cliNode = require('@backstage/cli-node');
|
|
|
4
4
|
var fs = require('fs-extra');
|
|
5
5
|
var path = require('node:path');
|
|
6
6
|
var cliCommon = require('@backstage/cli-common');
|
|
7
|
-
var publishing = require('../../lib/publishing.cjs.js');
|
|
8
7
|
|
|
9
8
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
10
9
|
|
|
@@ -371,9 +370,7 @@ async function command(opts) {
|
|
|
371
370
|
fixRepositoryField,
|
|
372
371
|
fixPluginId,
|
|
373
372
|
fixPluginPackages,
|
|
374
|
-
fixPeerModules
|
|
375
|
-
// Run the publish preflight check too, to make sure we don't uncover errors during publishing
|
|
376
|
-
publishing.publishPreflightCheck
|
|
373
|
+
fixPeerModules
|
|
377
374
|
);
|
|
378
375
|
}
|
|
379
376
|
for (const fixer of fixers) {
|
|
@@ -4,44 +4,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var commander = require('commander');
|
|
6
6
|
var factory = require('../../wiring/factory.cjs.js');
|
|
7
|
-
var lazy = require('../../
|
|
7
|
+
var lazy = require('../../wiring/lazy.cjs.js');
|
|
8
8
|
|
|
9
9
|
var index = factory.createCliPlugin({
|
|
10
10
|
pluginId: "maintenance",
|
|
11
11
|
init: async (reg) => {
|
|
12
|
-
reg.addCommand({
|
|
13
|
-
path: ["package", "clean"],
|
|
14
|
-
description: "Delete cache directories",
|
|
15
|
-
execute: async ({ args }) => {
|
|
16
|
-
const command = new commander.Command();
|
|
17
|
-
const defaultCommand = command.action(
|
|
18
|
-
lazy.lazy(() => import('./commands/package/clean.cjs.js'), "default")
|
|
19
|
-
);
|
|
20
|
-
await defaultCommand.parseAsync(args, { from: "user" });
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
reg.addCommand({
|
|
24
|
-
path: ["package", "prepack"],
|
|
25
|
-
description: "Prepares a package for packaging before publishing",
|
|
26
|
-
execute: async ({ args }) => {
|
|
27
|
-
const command = new commander.Command();
|
|
28
|
-
const defaultCommand = command.action(
|
|
29
|
-
lazy.lazy(() => import('./commands/package/pack.cjs.js'), "pre")
|
|
30
|
-
);
|
|
31
|
-
await defaultCommand.parseAsync(args, { from: "user" });
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
reg.addCommand({
|
|
35
|
-
path: ["package", "postpack"],
|
|
36
|
-
description: "Restores the changes made by the prepack command",
|
|
37
|
-
execute: async ({ args }) => {
|
|
38
|
-
const command = new commander.Command();
|
|
39
|
-
const defaultCommand = command.action(
|
|
40
|
-
lazy.lazy(() => import('./commands/package/pack.cjs.js'), "post")
|
|
41
|
-
);
|
|
42
|
-
await defaultCommand.parseAsync(args, { from: "user" });
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
12
|
reg.addCommand({
|
|
46
13
|
path: ["repo", "fix"],
|
|
47
14
|
description: "Automatically fix packages in the project",
|
|
@@ -57,17 +24,6 @@ var index = factory.createCliPlugin({
|
|
|
57
24
|
await defaultCommand.parseAsync(args, { from: "user" });
|
|
58
25
|
}
|
|
59
26
|
});
|
|
60
|
-
reg.addCommand({
|
|
61
|
-
path: ["repo", "clean"],
|
|
62
|
-
description: "Delete cache and output directories",
|
|
63
|
-
execute: async ({ args }) => {
|
|
64
|
-
const command = new commander.Command();
|
|
65
|
-
const defaultCommand = command.action(
|
|
66
|
-
lazy.lazy(() => import('./commands/repo/clean.cjs.js'), "command")
|
|
67
|
-
);
|
|
68
|
-
await defaultCommand.parseAsync(args, { from: "user" });
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
27
|
reg.addCommand({
|
|
72
28
|
path: ["repo", "list-deprecations"],
|
|
73
29
|
description: "List deprecations",
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
var cleye = require('cleye');
|
|
6
|
+
|
|
7
|
+
var packageExports = async ({ args, info }) => {
|
|
8
|
+
cleye.cli({ help: info }, void 0, args);
|
|
9
|
+
throw new Error(
|
|
10
|
+
"The `migrate package-exports` command has been removed, use `repo fix` instead."
|
|
8
11
|
);
|
|
9
|
-
|
|
10
|
-
for (const pkg of packages) {
|
|
11
|
-
fix.fixPackageExports(pkg);
|
|
12
|
-
}
|
|
13
|
-
await fix.writeFixedPackages(packages);
|
|
14
|
-
}
|
|
12
|
+
};
|
|
15
13
|
|
|
16
|
-
exports.
|
|
14
|
+
exports.default = packageExports;
|
|
17
15
|
//# sourceMappingURL=packageExports.cjs.js.map
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var cleye = require('cleye');
|
|
3
6
|
var fs = require('fs-extra');
|
|
4
7
|
var path = require('node:path');
|
|
5
8
|
var cliNode = require('@backstage/cli-node');
|
|
@@ -10,7 +13,8 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
|
|
|
10
13
|
var fs__default = /*#__PURE__*/_interopDefaultCompat(fs);
|
|
11
14
|
|
|
12
15
|
const PREFIX = `module.exports = require('@backstage/cli/config/eslint-factory')`;
|
|
13
|
-
async
|
|
16
|
+
var packageLintConfigs = async ({ args, info }) => {
|
|
17
|
+
cleye.cli({ help: info }, void 0, args);
|
|
14
18
|
const packages = await cliNode.PackageGraph.listTargetPackages();
|
|
15
19
|
const oldConfigs = [
|
|
16
20
|
require.resolve("@backstage/cli/config/eslint.js"),
|
|
@@ -67,7 +71,7 @@ async function command() {
|
|
|
67
71
|
if (hasPrettier) {
|
|
68
72
|
await cliCommon.runOutput(["prettier", "--write", ...configPaths]);
|
|
69
73
|
}
|
|
70
|
-
}
|
|
74
|
+
};
|
|
71
75
|
|
|
72
|
-
exports.
|
|
76
|
+
exports.default = packageLintConfigs;
|
|
73
77
|
//# sourceMappingURL=packageLintConfigs.cjs.js.map
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var cleye = require('cleye');
|
|
5
6
|
var fs = require('fs-extra');
|
|
6
7
|
var path = require('node:path');
|
|
7
8
|
var getPackages = require('@manypkg/get-packages');
|
|
@@ -12,7 +13,8 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
|
|
|
12
13
|
|
|
13
14
|
var fs__default = /*#__PURE__*/_interopDefaultCompat(fs);
|
|
14
15
|
|
|
15
|
-
var packageRole = async () => {
|
|
16
|
+
var packageRole = async ({ args, info }) => {
|
|
17
|
+
cleye.cli({ help: info }, void 0, args);
|
|
16
18
|
const { packages } = await getPackages.getPackages(cliCommon.targetPaths.dir);
|
|
17
19
|
await Promise.all(
|
|
18
20
|
packages.map(async ({ dir, packageJson: pkg }) => {
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var cleye = require('cleye');
|
|
3
6
|
var fs = require('fs-extra');
|
|
4
7
|
var path = require('node:path');
|
|
5
8
|
var cliNode = require('@backstage/cli-node');
|
|
@@ -10,7 +13,8 @@ var fs__default = /*#__PURE__*/_interopDefaultCompat(fs);
|
|
|
10
13
|
|
|
11
14
|
const configArgPattern = /--config[=\s][^\s$]+/;
|
|
12
15
|
const noStartRoles = ["cli", "common-library"];
|
|
13
|
-
async
|
|
16
|
+
var packageScripts = async ({ args, info }) => {
|
|
17
|
+
cleye.cli({ help: info }, void 0, args);
|
|
14
18
|
const packages = await cliNode.PackageGraph.listTargetPackages();
|
|
15
19
|
await Promise.all(
|
|
16
20
|
packages.map(async ({ dir, packageJson }) => {
|
|
@@ -38,11 +42,11 @@ async function command() {
|
|
|
38
42
|
}
|
|
39
43
|
const testCmd = ["test"];
|
|
40
44
|
if (scripts.test?.startsWith("backstage-cli test")) {
|
|
41
|
-
const
|
|
42
|
-
if (
|
|
43
|
-
|
|
45
|
+
const testArgs = scripts.test.slice("backstage-cli test".length).split(" ").filter(Boolean);
|
|
46
|
+
if (testArgs.includes("--passWithNoTests")) {
|
|
47
|
+
testArgs.splice(testArgs.indexOf("--passWithNoTests"), 1);
|
|
44
48
|
}
|
|
45
|
-
testCmd.push(...
|
|
49
|
+
testCmd.push(...testArgs);
|
|
46
50
|
}
|
|
47
51
|
const expectedScripts = {
|
|
48
52
|
...hasStart && {
|
|
@@ -77,7 +81,7 @@ async function command() {
|
|
|
77
81
|
}
|
|
78
82
|
})
|
|
79
83
|
);
|
|
80
|
-
}
|
|
84
|
+
};
|
|
81
85
|
|
|
82
|
-
exports.
|
|
86
|
+
exports.default = packageScripts;
|
|
83
87
|
//# sourceMappingURL=packageScripts.cjs.js.map
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var cleye = require('cleye');
|
|
3
6
|
var fs = require('fs-extra');
|
|
4
7
|
var path = require('node:path');
|
|
5
8
|
var cliNode = require('@backstage/cli-node');
|
|
@@ -10,7 +13,8 @@ var fs__default = /*#__PURE__*/_interopDefaultCompat(fs);
|
|
|
10
13
|
|
|
11
14
|
const REACT_ROUTER_DEPS = ["react-router", "react-router-dom"];
|
|
12
15
|
const REACT_ROUTER_RANGE = "6.0.0-beta.0 || ^6.3.0";
|
|
13
|
-
async
|
|
16
|
+
var reactRouterDeps = async ({ args, info }) => {
|
|
17
|
+
cleye.cli({ help: info }, void 0, args);
|
|
14
18
|
const packages = await cliNode.PackageGraph.listTargetPackages();
|
|
15
19
|
await Promise.all(
|
|
16
20
|
packages.map(async ({ dir, packageJson }) => {
|
|
@@ -41,7 +45,7 @@ async function command() {
|
|
|
41
45
|
}
|
|
42
46
|
})
|
|
43
47
|
);
|
|
44
|
-
}
|
|
48
|
+
};
|
|
45
49
|
|
|
46
|
-
exports.
|
|
50
|
+
exports.default = reactRouterDeps;
|
|
47
51
|
//# sourceMappingURL=reactRouterDeps.cjs.js.map
|
|
@@ -10,10 +10,8 @@ var minimatch = require('minimatch');
|
|
|
10
10
|
var semver = require('semver');
|
|
11
11
|
var errors = require('@backstage/errors');
|
|
12
12
|
var path = require('node:path');
|
|
13
|
-
var yarnPlugin = require('../../../../lib/yarnPlugin.cjs.js');
|
|
14
|
-
var Lockfile = require('../../../../lib/versioning/Lockfile.cjs.js');
|
|
15
|
-
var packages = require('../../../../lib/versioning/packages.cjs.js');
|
|
16
13
|
var cliNode = require('@backstage/cli-node');
|
|
14
|
+
var packages = require('../../lib/versioning/packages.cjs.js');
|
|
17
15
|
var releaseManifests = require('@backstage/release-manifests');
|
|
18
16
|
var migrate = require('./migrate.cjs.js');
|
|
19
17
|
var utils = require('../../lib/utils.cjs.js');
|
|
@@ -40,8 +38,8 @@ function extendsDefaultPattern(pattern) {
|
|
|
40
38
|
}
|
|
41
39
|
var bump = async (opts) => {
|
|
42
40
|
const lockfilePath = cliCommon.targetPaths.resolveRoot("yarn.lock");
|
|
43
|
-
const lockfile = await
|
|
44
|
-
const
|
|
41
|
+
const lockfile = await cliNode.Lockfile.load(lockfilePath);
|
|
42
|
+
const yarnPluginEnabled = await cliNode.hasBackstageYarnPlugin();
|
|
45
43
|
let pattern = opts.pattern;
|
|
46
44
|
if (!pattern) {
|
|
47
45
|
console.log(`Using default pattern glob ${DEFAULT_PATTERN_GLOB}`);
|
|
@@ -85,7 +83,7 @@ var bump = async (opts) => {
|
|
|
85
83
|
releaseManifest
|
|
86
84
|
});
|
|
87
85
|
}
|
|
88
|
-
if (
|
|
86
|
+
if (yarnPluginEnabled) {
|
|
89
87
|
console.log();
|
|
90
88
|
console.log(
|
|
91
89
|
`Updating yarn plugin to v${releaseManifest.releaseVersion}...`
|
|
@@ -147,7 +145,7 @@ var bump = async (opts) => {
|
|
|
147
145
|
if (depType in pkgJson && dep.name in pkgJson[depType]) {
|
|
148
146
|
const oldRange = pkgJson[depType][dep.name];
|
|
149
147
|
const oldLockfileRange = await asLockfileVersion(oldRange);
|
|
150
|
-
const useBackstageRange =
|
|
148
|
+
const useBackstageRange = yarnPluginEnabled && // Only use backstage:^ versions if the package is present in
|
|
151
149
|
// the manifest for the release we're bumping to.
|
|
152
150
|
releaseManifest.packages.find(
|
|
153
151
|
({ name: manifestPackageName }) => dep.name === manifestPackageName
|
|
@@ -174,7 +172,7 @@ var bump = async (opts) => {
|
|
|
174
172
|
if (extendsDefaultPattern(pattern)) {
|
|
175
173
|
await bumpBackstageJsonVersion(
|
|
176
174
|
releaseManifest.releaseVersion,
|
|
177
|
-
|
|
175
|
+
yarnPluginEnabled
|
|
178
176
|
);
|
|
179
177
|
} else {
|
|
180
178
|
console.log(
|
|
@@ -228,7 +226,7 @@ var bump = async (opts) => {
|
|
|
228
226
|
} else {
|
|
229
227
|
console.log();
|
|
230
228
|
}
|
|
231
|
-
if (
|
|
229
|
+
if (yarnPluginEnabled) {
|
|
232
230
|
console.log();
|
|
233
231
|
console.log(
|
|
234
232
|
chalk__default.default.blue(
|