@backstage/cli 0.35.3 → 0.35.4-next.2
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 +40 -3
- package/bin/backstage-cli +4 -2
- package/config/eslint-factory.js +2 -2
- package/config/jest.js +3 -3
- package/config/jestFileTransform.js +1 -1
- package/config/jestRejectNetworkRequests.js +2 -2
- package/config/jestSucraseTransform.js +1 -1
- package/config/jestYamlTransform.js +1 -1
- package/config/nodeTransform.cjs +3 -3
- package/config/nodeTransformHooks.mjs +4 -4
- package/dist/lib/cache/SuccessCache.cjs.js +5 -5
- package/dist/lib/entryPoints.cjs.js +5 -3
- package/dist/lib/parallel.cjs.js +4 -4
- package/dist/lib/typeDistProject.cjs.js +1 -1
- package/dist/modules/build/commands/package/build/command.cjs.js +6 -0
- package/dist/modules/build/commands/package/start/resolveLinkedWorkspace.cjs.js +1 -1
- package/dist/modules/build/commands/package/start/startBackend.cjs.js +1 -1
- package/dist/modules/build/commands/package/start/startFrontend.cjs.js +1 -1
- package/dist/modules/build/commands/package/start/startPackage.cjs.js +1 -1
- package/dist/modules/build/commands/repo/build.cjs.js +1 -1
- package/dist/modules/build/commands/repo/start.cjs.js +3 -3
- package/dist/modules/build/lib/buildBackend.cjs.js +22 -4
- package/dist/modules/build/lib/buildFrontend.cjs.js +1 -1
- package/dist/modules/build/lib/builder/config.cjs.js +4 -3
- package/dist/modules/build/lib/builder/packager.cjs.js +3 -2
- package/dist/modules/build/lib/builder/plugins.cjs.js +36 -1
- package/dist/modules/build/lib/bundler/bundle.cjs.js +1 -1
- package/dist/modules/build/lib/bundler/config.cjs.js +1 -1
- package/dist/modules/build/lib/bundler/linkWorkspaces.cjs.js +1 -1
- package/dist/modules/build/lib/bundler/packageDetection.cjs.js +2 -2
- package/dist/modules/build/lib/bundler/paths.cjs.js +1 -1
- package/dist/modules/build/lib/bundler/server.cjs.js +1 -1
- package/dist/modules/build/lib/packager/createDistWorkspace.cjs.js +23 -5
- package/dist/modules/build/lib/packager/productionPack.cjs.js +5 -2
- package/dist/modules/build/lib/runner/runBackend.cjs.js +3 -3
- package/dist/modules/config/lib/config.cjs.js +1 -1
- package/dist/modules/create-github-app/commands/create-github-app/GithubCreateAppServer.cjs.js +1 -1
- package/dist/modules/info/commands/info.cjs.js +1 -1
- package/dist/modules/lint/commands/repo/lint.cjs.js +5 -5
- package/dist/modules/maintenance/commands/repo/clean.cjs.js +1 -1
- package/dist/modules/maintenance/commands/repo/fix.cjs.js +62 -16
- package/dist/modules/maintenance/commands/repo/list-deprecations.cjs.js +1 -1
- package/dist/modules/migrate/commands/packageLintConfigs.cjs.js +1 -1
- package/dist/modules/migrate/commands/packageRole.cjs.js +1 -1
- package/dist/modules/migrate/commands/packageScripts.cjs.js +1 -1
- package/dist/modules/migrate/commands/reactRouterDeps.cjs.js +1 -1
- package/dist/modules/migrate/commands/versions/bump.cjs.js +8 -8
- package/dist/modules/migrate/commands/versions/migrate.cjs.js +1 -1
- package/dist/modules/new/lib/codeowners/codeowners.cjs.js +1 -1
- package/dist/modules/new/lib/execution/writeTemplateContents.cjs.js +1 -1
- package/dist/modules/new/lib/preparation/loadPortableTemplate.cjs.js +2 -3
- package/dist/modules/new/lib/preparation/loadPortableTemplateConfig.cjs.js +4 -4
- package/dist/modules/new/lib/preparation/resolvePackageParams.cjs.js +1 -1
- package/dist/modules/test/commands/repo/test.cjs.js +2 -2
- package/dist/packages/backend-defaults/package.json.cjs.js +1 -1
- package/dist/packages/backend-plugin-api/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 +4 -3
- package/dist/packages/core-app-api/package.json.cjs.js +1 -1
- package/dist/packages/core-components/package.json.cjs.js +1 -1
- package/dist/packages/core-plugin-api/package.json.cjs.js +1 -1
- package/dist/packages/dev-utils/package.json.cjs.js +1 -1
- package/dist/packages/frontend-defaults/package.json.cjs.js +1 -1
- package/dist/packages/frontend-plugin-api/package.json.cjs.js +1 -1
- package/dist/packages/frontend-test-utils/package.json.cjs.js +1 -1
- package/dist/packages/test-utils/package.json.cjs.js +1 -1
- package/dist/packages/theme/package.json.cjs.js +1 -1
- package/dist/plugins/auth-backend/package.json.cjs.js +1 -1
- package/dist/plugins/auth-backend-module-guest-provider/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 +1 -1
- package/package.json +31 -30
- package/templates/catalog-provider-module/src/module.ts.hbs +1 -1
- package/templates/scaffolder-backend-module/src/module.ts +1 -1
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var chalk = require('chalk');
|
|
4
4
|
var fs = require('fs-extra');
|
|
5
|
-
var path = require('path');
|
|
6
|
-
var os = require('os');
|
|
5
|
+
var path = require('node:path');
|
|
6
|
+
var os = require('node:os');
|
|
7
7
|
var tar = require('tar');
|
|
8
8
|
var partition = require('lodash/partition');
|
|
9
9
|
var paths = require('../../../../lib/paths.cjs.js');
|
|
@@ -18,9 +18,27 @@ var typeDistProject = require('../../../../lib/typeDistProject.cjs.js');
|
|
|
18
18
|
|
|
19
19
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
20
20
|
|
|
21
|
+
function _interopNamespaceCompat(e) {
|
|
22
|
+
if (e && typeof e === 'object' && 'default' in e) return e;
|
|
23
|
+
var n = Object.create(null);
|
|
24
|
+
if (e) {
|
|
25
|
+
Object.keys(e).forEach(function (k) {
|
|
26
|
+
if (k !== 'default') {
|
|
27
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
28
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
29
|
+
enumerable: true,
|
|
30
|
+
get: function () { return e[k]; }
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
n.default = e;
|
|
36
|
+
return Object.freeze(n);
|
|
37
|
+
}
|
|
38
|
+
|
|
21
39
|
var chalk__default = /*#__PURE__*/_interopDefaultCompat(chalk);
|
|
22
40
|
var fs__default = /*#__PURE__*/_interopDefaultCompat(fs);
|
|
23
|
-
var
|
|
41
|
+
var tar__namespace = /*#__PURE__*/_interopNamespaceCompat(tar);
|
|
24
42
|
var partition__default = /*#__PURE__*/_interopDefaultCompat(partition);
|
|
25
43
|
|
|
26
44
|
const UNSAFE_PACKAGES = [
|
|
@@ -130,7 +148,7 @@ async function createDistWorkspace(packageNames, options = {}) {
|
|
|
130
148
|
const dir = path.relative(paths.paths.targetRoot, target.dir);
|
|
131
149
|
return path.join(dir, "package.json");
|
|
132
150
|
}).sort();
|
|
133
|
-
await
|
|
151
|
+
await tar__namespace.create(
|
|
134
152
|
{
|
|
135
153
|
file: path.resolve(targetDir, options.skeleton),
|
|
136
154
|
cwd: targetDir,
|
|
@@ -175,7 +193,7 @@ async function moveToDistWorkspace(workspaceDir, localPackages, alwaysPack, enab
|
|
|
175
193
|
const outputDir = path.relative(paths.paths.targetRoot, target.dir);
|
|
176
194
|
const absoluteOutputPath = path.resolve(workspaceDir, outputDir);
|
|
177
195
|
await fs__default.default.ensureDir(absoluteOutputPath);
|
|
178
|
-
await
|
|
196
|
+
await tar__namespace.extract({
|
|
179
197
|
file: archivePath,
|
|
180
198
|
cwd: absoluteOutputPath,
|
|
181
199
|
strip: 1
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var fs = require('fs-extra');
|
|
4
4
|
var npmPackList = require('npm-packlist');
|
|
5
|
-
var path = require('path');
|
|
5
|
+
var path = require('node:path');
|
|
6
6
|
var entryPoints = require('../../../../lib/entryPoints.cjs.js');
|
|
7
7
|
var typeDistProject = require('../../../../lib/typeDistProject.cjs.js');
|
|
8
8
|
|
|
@@ -92,7 +92,10 @@ async function rewriteEntryPoints(pkg, packageDir, featureDetectionProject) {
|
|
|
92
92
|
}
|
|
93
93
|
for (const entryPoint of entryPoints$1) {
|
|
94
94
|
if (!SCRIPT_EXTS.includes(entryPoint.ext)) {
|
|
95
|
-
outputExports[entryPoint.mount] = entryPoint.path
|
|
95
|
+
outputExports[entryPoint.mount] = entryPoint.path.replace(
|
|
96
|
+
/^(\.\/)?src\//,
|
|
97
|
+
"./dist/"
|
|
98
|
+
);
|
|
96
99
|
continue;
|
|
97
100
|
}
|
|
98
101
|
let exp = {};
|
|
@@ -5,8 +5,8 @@ var ctrlcWindows = require('ctrlc-windows');
|
|
|
5
5
|
var IpcServer = require('../ipc/IpcServer.cjs.js');
|
|
6
6
|
var ServerDataStore = require('../ipc/ServerDataStore.cjs.js');
|
|
7
7
|
var debounce = require('lodash/debounce');
|
|
8
|
-
var
|
|
9
|
-
var path = require('path');
|
|
8
|
+
var node_url = require('node:url');
|
|
9
|
+
var path = require('node:path');
|
|
10
10
|
var paths = require('../../../../lib/paths.cjs.js');
|
|
11
11
|
var spawn = require('cross-spawn');
|
|
12
12
|
|
|
@@ -99,7 +99,7 @@ async function runBackend(options) {
|
|
|
99
99
|
if (typeof data === "object" && data?.type === "watch") {
|
|
100
100
|
let path$1 = data.path;
|
|
101
101
|
if (path$1.startsWith("file:")) {
|
|
102
|
-
path$1 =
|
|
102
|
+
path$1 = node_url.fileURLToPath(path$1);
|
|
103
103
|
}
|
|
104
104
|
if (path.isAbsolute(path$1) && !watchedPaths.has(path$1)) {
|
|
105
105
|
watchedPaths.add(path$1);
|
|
@@ -5,7 +5,7 @@ var config = require('@backstage/config');
|
|
|
5
5
|
var paths = require('../../../lib/paths.cjs.js');
|
|
6
6
|
var getPackages = require('@manypkg/get-packages');
|
|
7
7
|
var cliNode = require('@backstage/cli-node');
|
|
8
|
-
var path = require('path');
|
|
8
|
+
var path = require('node:path');
|
|
9
9
|
|
|
10
10
|
async function loadCliConfig(options) {
|
|
11
11
|
const targetDir = options.targetDir ?? paths.paths.targetDir;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var _package = require('../../../packages/cli/package.json.cjs.js');
|
|
6
|
-
var os = require('os');
|
|
6
|
+
var os = require('node:os');
|
|
7
7
|
var cliCommon = require('@backstage/cli-common');
|
|
8
8
|
var paths = require('../../../lib/paths.cjs.js');
|
|
9
9
|
var Lockfile = require('../../../lib/versioning/Lockfile.cjs.js');
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var chalk = require('chalk');
|
|
4
4
|
var fs = require('fs-extra');
|
|
5
|
-
var crypto = require('crypto');
|
|
6
|
-
var path = require('path');
|
|
5
|
+
var crypto = require('node:crypto');
|
|
6
|
+
var path = require('node:path');
|
|
7
7
|
var cliNode = require('@backstage/cli-node');
|
|
8
8
|
var paths = require('../../../../lib/paths.cjs.js');
|
|
9
9
|
var parallel = require('../../../../lib/parallel.cjs.js');
|
|
@@ -90,10 +90,10 @@ async function command(opts, cmd) {
|
|
|
90
90
|
maxWarnings
|
|
91
91
|
}) => {
|
|
92
92
|
const { ESLint } = require("eslint");
|
|
93
|
-
const crypto = require("crypto");
|
|
93
|
+
const crypto = require("node:crypto");
|
|
94
94
|
const globby = require("globby");
|
|
95
|
-
const { readFile } = require("fs/promises");
|
|
96
|
-
const workerPath = require("path");
|
|
95
|
+
const { readFile } = require("node:fs/promises");
|
|
96
|
+
const workerPath = require("node:path");
|
|
97
97
|
return async ({
|
|
98
98
|
fullDir,
|
|
99
99
|
relativeDir,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var fs = require('fs-extra');
|
|
4
|
-
var path = require('path');
|
|
4
|
+
var path = require('node:path');
|
|
5
5
|
var cliNode = require('@backstage/cli-node');
|
|
6
6
|
var paths = require('../../../../lib/paths.cjs.js');
|
|
7
7
|
var cliCommon = require('@backstage/cli-common');
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var cliNode = require('@backstage/cli-node');
|
|
4
4
|
var fs = require('fs-extra');
|
|
5
|
-
var path = require('path');
|
|
5
|
+
var path = require('node:path');
|
|
6
6
|
var paths = require('../../../../lib/paths.cjs.js');
|
|
7
7
|
var publishing = require('../../lib/publishing.cjs.js');
|
|
8
8
|
|
|
@@ -10,6 +10,7 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
|
|
|
10
10
|
|
|
11
11
|
var fs__default = /*#__PURE__*/_interopDefaultCompat(fs);
|
|
12
12
|
|
|
13
|
+
const SCRIPT_EXTS = [".js", ".jsx", ".ts", ".tsx", ".json"];
|
|
13
14
|
async function readFixablePackages() {
|
|
14
15
|
const packages = await cliNode.PackageGraph.listTargetPackages();
|
|
15
16
|
return packages.map((pkg) => ({ ...pkg, changed: false }));
|
|
@@ -72,32 +73,43 @@ function fixPackageExports(pkg) {
|
|
|
72
73
|
}
|
|
73
74
|
const existingTypesVersions = JSON.stringify(pkg.packageJson.typesVersions);
|
|
74
75
|
const typeEntries = {};
|
|
75
|
-
for (const [path, value] of Object.entries(exp)) {
|
|
76
|
-
if (path === ".") {
|
|
76
|
+
for (const [path$1, value] of Object.entries(exp)) {
|
|
77
|
+
if (path$1 === ".") {
|
|
77
78
|
continue;
|
|
78
79
|
}
|
|
79
|
-
const newPath = trimRelative(path);
|
|
80
|
+
const newPath = trimRelative(path$1);
|
|
80
81
|
if (typeof value === "string") {
|
|
81
|
-
|
|
82
|
+
if (SCRIPT_EXTS.includes(path.extname(value))) {
|
|
83
|
+
typeEntries[newPath] = [trimRelative(value)];
|
|
84
|
+
}
|
|
82
85
|
} else if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
83
86
|
if (typeof value.types === "string") {
|
|
84
87
|
typeEntries[newPath] = [trimRelative(value.types)];
|
|
85
|
-
} else if (typeof value.default === "string") {
|
|
88
|
+
} else if (typeof value.default === "string" && SCRIPT_EXTS.includes(path.extname(value.default))) {
|
|
86
89
|
typeEntries[newPath] = [trimRelative(value.default)];
|
|
87
90
|
}
|
|
88
91
|
}
|
|
89
92
|
}
|
|
90
|
-
const
|
|
93
|
+
const hasTypeEntries = Object.keys(typeEntries).length > 0;
|
|
94
|
+
const typesVersions = hasTypeEntries ? { "*": typeEntries } : void 0;
|
|
91
95
|
if (existingTypesVersions !== JSON.stringify(typesVersions)) {
|
|
92
|
-
|
|
93
|
-
(
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
96
|
+
if (pkg.packageJson.typesVersions) {
|
|
97
|
+
if (typesVersions) {
|
|
98
|
+
pkg.packageJson.typesVersions = typesVersions;
|
|
99
|
+
} else {
|
|
100
|
+
delete pkg.packageJson.typesVersions;
|
|
101
|
+
}
|
|
102
|
+
} else if (typesVersions) {
|
|
103
|
+
const newPkgEntries = Object.entries(pkg.packageJson);
|
|
104
|
+
newPkgEntries.splice(
|
|
105
|
+
newPkgEntries.findIndex(([name]) => name === "exports") + 1,
|
|
106
|
+
0,
|
|
107
|
+
["typesVersions", typesVersions]
|
|
108
|
+
);
|
|
109
|
+
pkg.packageJson = Object.fromEntries(
|
|
110
|
+
newPkgEntries
|
|
111
|
+
);
|
|
112
|
+
}
|
|
101
113
|
pkg.changed = true;
|
|
102
114
|
}
|
|
103
115
|
const publishConfig = pkg.packageJson.publishConfig;
|
|
@@ -318,6 +330,38 @@ function fixPluginPackages(pkg, repoPackages) {
|
|
|
318
330
|
}
|
|
319
331
|
}
|
|
320
332
|
}
|
|
333
|
+
function fixPeerModules(pkg) {
|
|
334
|
+
const pkgBackstage = pkg.packageJson.backstage;
|
|
335
|
+
const role = pkgBackstage?.role;
|
|
336
|
+
if (!role) {
|
|
337
|
+
return;
|
|
338
|
+
}
|
|
339
|
+
const peerModules = pkgBackstage.peerModules;
|
|
340
|
+
if (peerModules === void 0) {
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
const packagePath = path.relative(
|
|
344
|
+
paths.paths.targetRoot,
|
|
345
|
+
path.resolve(pkg.dir, "package.json")
|
|
346
|
+
);
|
|
347
|
+
if (role !== "backend-plugin" && role !== "frontend-plugin") {
|
|
348
|
+
throw new Error(
|
|
349
|
+
`The 'backstage.peerModules' field in "${pkg.packageJson.name}" can only be used on plugin packages (backend-plugin or frontend-plugin), but package has role '${role}' in "${packagePath}"`
|
|
350
|
+
);
|
|
351
|
+
}
|
|
352
|
+
if (!Array.isArray(peerModules)) {
|
|
353
|
+
throw new Error(
|
|
354
|
+
`Invalid 'backstage.peerModules' field in "${pkg.packageJson.name}", must be an array of package names in "${packagePath}"`
|
|
355
|
+
);
|
|
356
|
+
}
|
|
357
|
+
for (const entry of peerModules) {
|
|
358
|
+
if (typeof entry !== "string" || entry.length === 0) {
|
|
359
|
+
throw new Error(
|
|
360
|
+
`Invalid entry in 'backstage.peerModules' field in "${pkg.packageJson.name}", all entries must be non-empty package name strings in "${packagePath}"`
|
|
361
|
+
);
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
}
|
|
321
365
|
async function command(opts) {
|
|
322
366
|
const packages = await readFixablePackages();
|
|
323
367
|
const fixRepositoryField = createRepositoryFieldFixer();
|
|
@@ -327,6 +371,7 @@ async function command(opts) {
|
|
|
327
371
|
fixRepositoryField,
|
|
328
372
|
fixPluginId,
|
|
329
373
|
fixPluginPackages,
|
|
374
|
+
fixPeerModules,
|
|
330
375
|
// Run the publish preflight check too, to make sure we don't uncover errors during publishing
|
|
331
376
|
publishing.publishPreflightCheck
|
|
332
377
|
);
|
|
@@ -348,6 +393,7 @@ async function command(opts) {
|
|
|
348
393
|
exports.command = command;
|
|
349
394
|
exports.createRepositoryFieldFixer = createRepositoryFieldFixer;
|
|
350
395
|
exports.fixPackageExports = fixPackageExports;
|
|
396
|
+
exports.fixPeerModules = fixPeerModules;
|
|
351
397
|
exports.fixPluginId = fixPluginId;
|
|
352
398
|
exports.fixPluginPackages = fixPluginPackages;
|
|
353
399
|
exports.fixSideEffects = fixSideEffects;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var fs = require('fs-extra');
|
|
6
|
-
var path = require('path');
|
|
6
|
+
var path = require('node:path');
|
|
7
7
|
var getPackages = require('@manypkg/get-packages');
|
|
8
8
|
var cliNode = require('@backstage/cli-node');
|
|
9
9
|
var paths = require('../../../lib/paths.cjs.js');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var fs = require('fs-extra');
|
|
4
|
-
var path = require('path');
|
|
4
|
+
var path = require('node:path');
|
|
5
5
|
var cliNode = require('@backstage/cli-node');
|
|
6
6
|
|
|
7
7
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var fs = require('fs-extra');
|
|
4
|
-
var path = require('path');
|
|
4
|
+
var path = require('node:path');
|
|
5
5
|
var cliNode = require('@backstage/cli-node');
|
|
6
6
|
|
|
7
7
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var cliCommon = require('@backstage/cli-common');
|
|
6
|
-
var
|
|
6
|
+
var node_process = require('node:process');
|
|
7
7
|
var fs = require('fs-extra');
|
|
8
8
|
var chalk = require('chalk');
|
|
9
9
|
var minimatch = require('minimatch');
|
|
10
10
|
var semver = require('semver');
|
|
11
11
|
var errors = require('@backstage/errors');
|
|
12
|
-
var path = require('path');
|
|
12
|
+
var path = require('node:path');
|
|
13
13
|
var paths = require('../../../../lib/paths.cjs.js');
|
|
14
14
|
var yarnPlugin = require('../../../../lib/yarnPlugin.cjs.js');
|
|
15
15
|
var Lockfile = require('../../../../lib/versioning/Lockfile.cjs.js');
|
|
@@ -54,8 +54,8 @@ var bump = async (opts) => {
|
|
|
54
54
|
}
|
|
55
55
|
let findTargetVersion;
|
|
56
56
|
let releaseManifest;
|
|
57
|
-
if (
|
|
58
|
-
releaseManifest = await fs__default.default.readJson(
|
|
57
|
+
if (node_process.env.BACKSTAGE_MANIFEST_FILE) {
|
|
58
|
+
releaseManifest = await fs__default.default.readJson(node_process.env.BACKSTAGE_MANIFEST_FILE);
|
|
59
59
|
findTargetVersion = createStrictVersionFinder({
|
|
60
60
|
releaseManifest
|
|
61
61
|
});
|
|
@@ -68,17 +68,17 @@ var bump = async (opts) => {
|
|
|
68
68
|
if (opts.release === "next") {
|
|
69
69
|
const next = await releaseManifests.getManifestByReleaseLine({
|
|
70
70
|
releaseLine: "next",
|
|
71
|
-
versionsBaseUrl:
|
|
71
|
+
versionsBaseUrl: node_process.env.BACKSTAGE_VERSIONS_BASE_URL
|
|
72
72
|
});
|
|
73
73
|
const main = await releaseManifests.getManifestByReleaseLine({
|
|
74
74
|
releaseLine: "main",
|
|
75
|
-
versionsBaseUrl:
|
|
75
|
+
versionsBaseUrl: node_process.env.BACKSTAGE_VERSIONS_BASE_URL
|
|
76
76
|
});
|
|
77
77
|
releaseManifest = semver__default.default.gt(next.releaseVersion, main.releaseVersion) ? next : main;
|
|
78
78
|
} else {
|
|
79
79
|
releaseManifest = await releaseManifests.getManifestByReleaseLine({
|
|
80
80
|
releaseLine: opts.release,
|
|
81
|
-
versionsBaseUrl:
|
|
81
|
+
versionsBaseUrl: node_process.env.BACKSTAGE_VERSIONS_BASE_URL
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
84
|
findTargetVersion = createVersionFinder({
|
|
@@ -92,7 +92,7 @@ var bump = async (opts) => {
|
|
|
92
92
|
`Updating yarn plugin to v${releaseManifest.releaseVersion}...`
|
|
93
93
|
);
|
|
94
94
|
console.log();
|
|
95
|
-
const yarnPluginUrl =
|
|
95
|
+
const yarnPluginUrl = node_process.env.BACKSTAGE_VERSIONS_BASE_URL ? `${node_process.env.BACKSTAGE_VERSIONS_BASE_URL}/v1/releases/${releaseManifest.releaseVersion}/yarn-plugin` : `https://versions.backstage.io/v1/releases/${releaseManifest.releaseVersion}/yarn-plugin`;
|
|
96
96
|
await cliCommon.run(["yarn", "plugin", "import", yarnPluginUrl]).waitForExit();
|
|
97
97
|
console.log();
|
|
98
98
|
}
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var cliNode = require('@backstage/cli-node');
|
|
6
6
|
var chalk = require('chalk');
|
|
7
|
-
var path = require('path');
|
|
7
|
+
var path = require('node:path');
|
|
8
8
|
var fs = require('fs-extra');
|
|
9
9
|
var minimatch = require('minimatch');
|
|
10
10
|
var utils = require('../../lib/utils.cjs.js');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var fs = require('fs-extra');
|
|
4
|
-
var path = require('path');
|
|
4
|
+
var path = require('node:path');
|
|
5
5
|
var paths = require('../../../../lib/paths.cjs.js');
|
|
6
6
|
|
|
7
7
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
var z = require('zod');
|
|
4
4
|
var fs = require('fs-extra');
|
|
5
5
|
var recursiveReaddir = require('recursive-readdir');
|
|
6
|
-
var path = require('path');
|
|
7
|
-
var node_path = require('node:path');
|
|
6
|
+
var path = require('node:path');
|
|
8
7
|
var yaml = require('yaml');
|
|
9
8
|
var paths = require('../../../../lib/paths.cjs.js');
|
|
10
9
|
var types = require('../types.cjs.js');
|
|
@@ -41,7 +40,7 @@ async function loadPortableTemplate(pointer) {
|
|
|
41
40
|
);
|
|
42
41
|
}
|
|
43
42
|
const { role, values = {} } = parsed.data;
|
|
44
|
-
const templatePath = path.resolve(
|
|
43
|
+
const templatePath = path.resolve(path.dirname(pointer.target));
|
|
45
44
|
const filePaths = await recursiveReaddir__default.default(templatePath).catch((error) => {
|
|
46
45
|
throw new errors.ForwardedError(
|
|
47
46
|
`Failed to load template contents from '${templatePath}'`,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var fs = require('fs-extra');
|
|
4
|
-
var
|
|
4
|
+
var path = require('node:path');
|
|
5
5
|
var paths = require('../../../../lib/paths.cjs.js');
|
|
6
6
|
var defaultTemplates = require('../defaultTemplates.cjs.js');
|
|
7
7
|
var types = require('../types.cjs.js');
|
|
@@ -58,7 +58,7 @@ async function loadPortableTemplateConfig(options = {}) {
|
|
|
58
58
|
);
|
|
59
59
|
}
|
|
60
60
|
const config = parsed.data.backstage?.cli?.new;
|
|
61
|
-
const basePath =
|
|
61
|
+
const basePath = path.dirname(pkgPath);
|
|
62
62
|
const templatePointerEntries = await Promise.all(
|
|
63
63
|
(config?.templates ?? defaultTemplates.defaultTemplates).map(async (rawPointer) => {
|
|
64
64
|
try {
|
|
@@ -100,11 +100,11 @@ async function loadPortableTemplateConfig(options = {}) {
|
|
|
100
100
|
};
|
|
101
101
|
}
|
|
102
102
|
function resolveLocalTemplatePath(pointer, basePath) {
|
|
103
|
-
if (
|
|
103
|
+
if (path.isAbsolute(pointer)) {
|
|
104
104
|
throw new Error(`Template target may not be an absolute path`);
|
|
105
105
|
}
|
|
106
106
|
if (pointer.startsWith(".")) {
|
|
107
|
-
return
|
|
107
|
+
return path.resolve(basePath, pointer, types.TEMPLATE_FILE_NAME);
|
|
108
108
|
}
|
|
109
109
|
return require.resolve(`${pointer}/${types.TEMPLATE_FILE_NAME}`, {
|
|
110
110
|
paths: [basePath]
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var os = require('os');
|
|
3
|
+
var os = require('node:os');
|
|
4
4
|
var crypto = require('node:crypto');
|
|
5
5
|
var yargs = require('yargs');
|
|
6
6
|
var jestCli = require('jest-cli');
|
|
7
|
-
var path = require('path');
|
|
7
|
+
var path = require('node:path');
|
|
8
8
|
var cliNode = require('@backstage/cli-node');
|
|
9
9
|
var paths = require('../../../../lib/paths.cjs.js');
|
|
10
10
|
var cliCommon = require('@backstage/cli-common');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var version = "0.35.
|
|
3
|
+
var version = "0.35.4-next.2";
|
|
4
4
|
var dependencies = {
|
|
5
5
|
"@backstage/catalog-model": "workspace:^",
|
|
6
6
|
"@backstage/cli-common": "workspace:^",
|
|
@@ -73,6 +73,7 @@ var dependencies = {
|
|
|
73
73
|
"p-queue": "^6.6.2",
|
|
74
74
|
pirates: "^4.0.6",
|
|
75
75
|
postcss: "^8.1.0",
|
|
76
|
+
"postcss-import": "^16.1.0",
|
|
76
77
|
process: "^0.11.10",
|
|
77
78
|
"raw-loader": "^4.0.2",
|
|
78
79
|
"react-dev-utils": "^12.0.0-next.60",
|
|
@@ -88,7 +89,7 @@ var dependencies = {
|
|
|
88
89
|
"style-loader": "^3.3.1",
|
|
89
90
|
sucrase: "^3.20.2",
|
|
90
91
|
"swc-loader": "^0.2.3",
|
|
91
|
-
tar: "^
|
|
92
|
+
tar: "^7.5.6",
|
|
92
93
|
"ts-checker-rspack-plugin": "^1.1.5",
|
|
93
94
|
"ts-morph": "^24.0.0",
|
|
94
95
|
undici: "^7.2.3",
|
|
@@ -146,7 +147,7 @@ var devDependencies = {
|
|
|
146
147
|
msw: "^1.0.0",
|
|
147
148
|
nodemon: "^3.0.1",
|
|
148
149
|
"terser-webpack-plugin": "^5.1.3",
|
|
149
|
-
webpack: "~5.
|
|
150
|
+
webpack: "~5.104.0",
|
|
150
151
|
"webpack-dev-server": "^5.0.0"
|
|
151
152
|
};
|
|
152
153
|
|