@backstage/cli 0.18.0 → 0.18.1-next.0
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 +7 -0
- package/dist/cjs/{Lockfile-48dc675e.cjs.js → Lockfile-72b7072e.cjs.js} +25 -9
- package/dist/cjs/{PackageGraph-1d7b086a.cjs.js → PackageGraph-6e1d4bd4.cjs.js} +17 -9
- package/dist/cjs/{build-52ba70a2.cjs.js → build-3b11f7c9.cjs.js} +26 -15
- package/dist/cjs/{buildBackend-55985c84.cjs.js → buildBackend-87996ad4.cjs.js} +61 -36
- package/dist/cjs/{buildWorkspace-d663903d.cjs.js → buildWorkspace-425726da.cjs.js} +7 -7
- package/dist/cjs/{bump-1a3769e9.cjs.js → bump-f3c6b3cd.cjs.js} +88 -33
- package/dist/cjs/{clean-9a8c294a.cjs.js → clean-798512b5.cjs.js} +2 -2
- package/dist/cjs/{config-de1bf46a.cjs.js → config-4a59f918.cjs.js} +15 -11
- package/dist/cjs/{create-b0ca2add.cjs.js → create-a7269bb5.cjs.js} +80 -32
- package/dist/cjs/{createDistWorkspace-fc94c796.cjs.js → createDistWorkspace-cb9a9a84.cjs.js} +137 -65
- package/dist/cjs/{createPlugin-4d7e1b01.cjs.js → createPlugin-fca2c26e.cjs.js} +69 -30
- package/dist/cjs/{diff-a561bee3.cjs.js → diff-3dec490d.cjs.js} +68 -16
- package/dist/cjs/{docs-bd70b38e.cjs.js → docs-e60d4fe7.cjs.js} +9 -5
- package/dist/cjs/{fix-47eb8dc4.cjs.js → fix-b60a5395.cjs.js} +17 -7
- package/dist/cjs/{index-27d57881.cjs.js → index-131467e2.cjs.js} +10 -10
- package/dist/cjs/{index-7e13cc9d.cjs.js → index-50703ee1.cjs.js} +151 -50
- package/dist/cjs/{index-4f4a8498.cjs.js → index-71d143d5.cjs.js} +57 -38
- package/dist/cjs/{index-bb24147b.cjs.js → index-7efbd23e.cjs.js} +39 -12
- package/dist/cjs/{info-29f0ee36.cjs.js → info-04610119.cjs.js} +20 -6
- package/dist/cjs/{install-fea0e3f5.cjs.js → install-589f1c25.cjs.js} +44 -17
- package/dist/cjs/{lint-81a75364.cjs.js → lint-41010f96.cjs.js} +37 -11
- package/dist/cjs/{lint-1711bbbb.cjs.js → lint-6fcb9a70.cjs.js} +5 -3
- package/dist/cjs/{lint-0db8937c.cjs.js → lint-7f6b0d33.cjs.js} +4 -4
- package/dist/cjs/{list-deprecations-cea8fad3.cjs.js → list-deprecations-8aee2123.cjs.js} +3 -3
- package/dist/cjs/{pack-8ab429c0.cjs.js → pack-91881c2f.cjs.js} +17 -11
- package/dist/cjs/packageLintConfigs-f9e5fcc6.cjs.js +83 -0
- package/dist/cjs/packageRole-16eb6c89.cjs.js +59 -0
- package/dist/cjs/{packageRoles-a310f84c.cjs.js → packageRoles-96528891.cjs.js} +5 -3
- package/dist/cjs/packageScripts-eb2443c2.cjs.js +98 -0
- package/dist/cjs/{packages-ea5c38ec.cjs.js → packages-1b40c101.cjs.js} +17 -12
- package/dist/cjs/parallel-a8f6219c.cjs.js +187 -0
- package/dist/cjs/{paths-d98c9d0c.cjs.js → paths-b34f135a.cjs.js} +100 -55
- package/dist/cjs/{print-4cbe70e7.cjs.js → print-e99d7c2e.cjs.js} +4 -4
- package/dist/cjs/{run-5e05ba2c.cjs.js → run-722b1384.cjs.js} +2 -2
- package/dist/cjs/{schema-2c842cbe.cjs.js → schema-c636e913.cjs.js} +9 -5
- package/dist/cjs/{tasks-b054c9ce.cjs.js → tasks-4776baa6.cjs.js} +29 -12
- package/dist/cjs/{test-b5969f53.cjs.js → test-76539f57.cjs.js} +3 -3
- package/dist/cjs/{validate-8a03d402.cjs.js → validate-f9273594.cjs.js} +4 -4
- package/dist/index.cjs.js +1 -1
- package/package.json +12 -12
- package/dist/cjs/packageLintConfigs-77b71b79.cjs.js +0 -74
- package/dist/cjs/packageRole-d1e7c7d6.cjs.js +0 -53
- package/dist/cjs/packageScripts-6731503e.cjs.js +0 -96
- package/dist/cjs/parallel-8286d3fa.cjs.js +0 -171
|
@@ -10,12 +10,12 @@ var camelCase = require('lodash/camelCase');
|
|
|
10
10
|
var upperFirst = require('lodash/upperFirst');
|
|
11
11
|
var os = require('os');
|
|
12
12
|
var errors = require('@backstage/errors');
|
|
13
|
-
var tasks = require('./tasks-
|
|
14
|
-
var index = require('./index-
|
|
15
|
-
var Lockfile = require('./Lockfile-
|
|
13
|
+
var tasks = require('./tasks-4776baa6.cjs.js');
|
|
14
|
+
var index = require('./index-50703ee1.cjs.js');
|
|
15
|
+
var Lockfile = require('./Lockfile-72b7072e.cjs.js');
|
|
16
16
|
require('minimatch');
|
|
17
17
|
require('@manypkg/get-packages');
|
|
18
|
-
require('./run-
|
|
18
|
+
require('./run-722b1384.cjs.js');
|
|
19
19
|
require('handlebars');
|
|
20
20
|
require('ora');
|
|
21
21
|
require('recursive-readdir');
|
|
@@ -38,9 +38,13 @@ const exec = util.promisify(child_process.exec);
|
|
|
38
38
|
async function checkExists(destination) {
|
|
39
39
|
await tasks.Task.forItem("checking", destination, async () => {
|
|
40
40
|
if (await fs__default["default"].pathExists(destination)) {
|
|
41
|
-
const existing = chalk__default["default"].cyan(
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
const existing = chalk__default["default"].cyan(
|
|
42
|
+
destination.replace(`${index.paths.targetRoot}/`, "")
|
|
43
|
+
);
|
|
44
|
+
throw new Error(
|
|
45
|
+
`A plugin with the same name already exists: ${existing}
|
|
46
|
+
Please try again with a different plugin ID`
|
|
47
|
+
);
|
|
44
48
|
}
|
|
45
49
|
});
|
|
46
50
|
}
|
|
@@ -63,14 +67,18 @@ async function addPluginDependencyToApp(rootDir, pluginPackage, versionStr) {
|
|
|
63
67
|
const packageFileJson = JSON.parse(packageFileContent);
|
|
64
68
|
const dependencies = packageFileJson.dependencies;
|
|
65
69
|
if (dependencies[pluginPackage]) {
|
|
66
|
-
throw new Error(
|
|
70
|
+
throw new Error(
|
|
71
|
+
`Plugin ${pluginPackage} already exists in ${packageFile}`
|
|
72
|
+
);
|
|
67
73
|
}
|
|
68
74
|
dependencies[pluginPackage] = `^${versionStr}`;
|
|
69
75
|
packageFileJson.dependencies = sortObjectByKeys(dependencies);
|
|
70
76
|
const newContents = `${JSON.stringify(packageFileJson, null, 2)}
|
|
71
77
|
`;
|
|
72
78
|
await fs__default["default"].writeFile(packageFile, newContents, "utf-8").catch((error) => {
|
|
73
|
-
throw new Error(
|
|
79
|
+
throw new Error(
|
|
80
|
+
`Failed to add plugin as dependency to app: ${packageFile}: ${error.message}`
|
|
81
|
+
);
|
|
74
82
|
});
|
|
75
83
|
});
|
|
76
84
|
}
|
|
@@ -83,12 +91,24 @@ async function addPluginExtensionToApp(pluginId, extensionName, pluginPackage) {
|
|
|
83
91
|
var _a;
|
|
84
92
|
const content = await fs__default["default"].readFile(pluginsFilePath, "utf8");
|
|
85
93
|
const revLines = content.split("\n").reverse();
|
|
86
|
-
const lastImportIndex = revLines.findIndex(
|
|
87
|
-
|
|
94
|
+
const lastImportIndex = revLines.findIndex(
|
|
95
|
+
(line) => line.match(/ from ("|').*("|')/)
|
|
96
|
+
);
|
|
97
|
+
const lastRouteIndex = revLines.findIndex(
|
|
98
|
+
(line) => line.match(/<\/FlatRoutes/)
|
|
99
|
+
);
|
|
88
100
|
if (lastImportIndex !== -1 && lastRouteIndex !== -1) {
|
|
89
|
-
revLines.splice(
|
|
101
|
+
revLines.splice(
|
|
102
|
+
lastImportIndex,
|
|
103
|
+
0,
|
|
104
|
+
`import { ${extensionName} } from '${pluginPackage}';`
|
|
105
|
+
);
|
|
90
106
|
const [indentation] = (_a = revLines[lastRouteIndex + 1].match(/^\s*/)) != null ? _a : [];
|
|
91
|
-
revLines.splice(
|
|
107
|
+
revLines.splice(
|
|
108
|
+
lastRouteIndex + 1,
|
|
109
|
+
0,
|
|
110
|
+
`${indentation}<Route path="/${pluginId}" element={<${extensionName} />}/>`
|
|
111
|
+
);
|
|
92
112
|
const newContent = revLines.reverse().join("\n");
|
|
93
113
|
await fs__default["default"].writeFile(pluginsFilePath, newContent, "utf8");
|
|
94
114
|
}
|
|
@@ -114,7 +134,9 @@ async function buildPlugin(pluginFolder) {
|
|
|
114
134
|
}).catch((error) => {
|
|
115
135
|
process.stdout.write(error.stderr);
|
|
116
136
|
process.stdout.write(error.stdout);
|
|
117
|
-
throw new Error(
|
|
137
|
+
throw new Error(
|
|
138
|
+
`Warning: Could not execute command ${chalk__default["default"].cyan(command)}`
|
|
139
|
+
);
|
|
118
140
|
});
|
|
119
141
|
} catch (error) {
|
|
120
142
|
errors.assertError(error);
|
|
@@ -126,7 +148,9 @@ async function buildPlugin(pluginFolder) {
|
|
|
126
148
|
async function movePlugin(tempDir, destination, id) {
|
|
127
149
|
await tasks.Task.forItem("moving", id, async () => {
|
|
128
150
|
await fs__default["default"].move(tempDir, destination).catch((error) => {
|
|
129
|
-
throw new Error(
|
|
151
|
+
throw new Error(
|
|
152
|
+
`Failed to move plugin from ${tempDir} to ${destination}: ${error.message}`
|
|
153
|
+
);
|
|
130
154
|
});
|
|
131
155
|
});
|
|
132
156
|
}
|
|
@@ -141,7 +165,9 @@ var createPlugin = async (opts) => {
|
|
|
141
165
|
if (!value) {
|
|
142
166
|
return chalk__default["default"].red("Please enter an ID for the plugin");
|
|
143
167
|
} else if (!/^[a-z0-9]+(-[a-z0-9]+)*$/.test(value)) {
|
|
144
|
-
return chalk__default["default"].red(
|
|
168
|
+
return chalk__default["default"].red(
|
|
169
|
+
"Plugin IDs must be lowercase and contain only letters, digits, and dashes."
|
|
170
|
+
);
|
|
145
171
|
}
|
|
146
172
|
return true;
|
|
147
173
|
}
|
|
@@ -151,14 +177,18 @@ var createPlugin = async (opts) => {
|
|
|
151
177
|
questions.push({
|
|
152
178
|
type: "input",
|
|
153
179
|
name: "owner",
|
|
154
|
-
message: chalk__default["default"].blue(
|
|
180
|
+
message: chalk__default["default"].blue(
|
|
181
|
+
"Enter the owner(s) of the plugin. If specified, this will be added to CODEOWNERS for the plugin path. [optional]"
|
|
182
|
+
),
|
|
155
183
|
validate: (value) => {
|
|
156
184
|
if (!value) {
|
|
157
185
|
return true;
|
|
158
186
|
}
|
|
159
187
|
const ownerIds = tasks.parseOwnerIds(value);
|
|
160
188
|
if (!ownerIds) {
|
|
161
|
-
return chalk__default["default"].red(
|
|
189
|
+
return chalk__default["default"].red(
|
|
190
|
+
"The owner must be a space separated list of team names (e.g. @org/team-name), usernames (e.g. @username), or the email addresses of users (e.g. user@example.com)."
|
|
191
|
+
);
|
|
162
192
|
}
|
|
163
193
|
return true;
|
|
164
194
|
}
|
|
@@ -173,7 +203,9 @@ var createPlugin = async (opts) => {
|
|
|
173
203
|
const privatePackage = opts.private === false ? false : true;
|
|
174
204
|
const isMonoRepo = await fs__default["default"].pathExists(index.paths.resolveTargetRoot("lerna.json"));
|
|
175
205
|
const appPackage = index.paths.resolveTargetRoot("packages/app");
|
|
176
|
-
const templateDir = index.paths.resolveOwn(
|
|
206
|
+
const templateDir = index.paths.resolveOwn(
|
|
207
|
+
opts.backend ? "templates/default-backend-plugin" : "templates/default-plugin"
|
|
208
|
+
);
|
|
177
209
|
const pluginDir = isMonoRepo ? index.paths.resolveTargetRoot("plugins", pluginId) : index.paths.resolveTargetRoot(pluginId);
|
|
178
210
|
const { version: pluginVersion } = isMonoRepo ? await fs__default["default"].readJson(index.paths.resolveTargetRoot("lerna.json")) : { version: "0.1.0" };
|
|
179
211
|
let lockfile;
|
|
@@ -187,18 +219,25 @@ var createPlugin = async (opts) => {
|
|
|
187
219
|
tasks.Task.section("Checking if the plugin ID is available");
|
|
188
220
|
await checkExists(pluginDir);
|
|
189
221
|
tasks.Task.section("Creating a temporary plugin directory");
|
|
190
|
-
const tempDir = await fs__default["default"].mkdtemp(
|
|
222
|
+
const tempDir = await fs__default["default"].mkdtemp(
|
|
223
|
+
path.join(os__default["default"].tmpdir(), `backstage-plugin-${pluginId}`)
|
|
224
|
+
);
|
|
191
225
|
try {
|
|
192
226
|
tasks.Task.section("Preparing files");
|
|
193
|
-
await tasks.templatingTask(
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
227
|
+
await tasks.templatingTask(
|
|
228
|
+
templateDir,
|
|
229
|
+
tempDir,
|
|
230
|
+
{
|
|
231
|
+
...answers,
|
|
232
|
+
pluginVar,
|
|
233
|
+
pluginVersion,
|
|
234
|
+
extensionName,
|
|
235
|
+
name,
|
|
236
|
+
privatePackage,
|
|
237
|
+
npmRegistry
|
|
238
|
+
},
|
|
239
|
+
index.createPackageVersionProvider(lockfile)
|
|
240
|
+
);
|
|
202
241
|
tasks.Task.section("Moving to final location");
|
|
203
242
|
await movePlugin(tempDir, pluginDir, pluginId);
|
|
204
243
|
tasks.Task.section("Building the plugin");
|
|
@@ -234,4 +273,4 @@ exports.addPluginExtensionToApp = addPluginExtensionToApp;
|
|
|
234
273
|
exports.capitalize = capitalize;
|
|
235
274
|
exports["default"] = createPlugin;
|
|
236
275
|
exports.movePlugin = movePlugin;
|
|
237
|
-
//# sourceMappingURL=createPlugin-
|
|
276
|
+
//# sourceMappingURL=createPlugin-fca2c26e.cjs.js.map
|
|
@@ -7,7 +7,7 @@ var path = require('path');
|
|
|
7
7
|
var inquirer = require('inquirer');
|
|
8
8
|
var handlebars = require('handlebars');
|
|
9
9
|
var recursive = require('recursive-readdir');
|
|
10
|
-
var index = require('./index-
|
|
10
|
+
var index = require('./index-50703ee1.cjs.js');
|
|
11
11
|
require('commander');
|
|
12
12
|
require('semver');
|
|
13
13
|
require('@backstage/cli-common');
|
|
@@ -44,7 +44,13 @@ class PackageJsonHandler {
|
|
|
44
44
|
}
|
|
45
45
|
const pkg = JSON.parse(templateContents);
|
|
46
46
|
const targetPkg = JSON.parse(targetContents);
|
|
47
|
-
const handler = new PackageJsonHandler(
|
|
47
|
+
const handler = new PackageJsonHandler(
|
|
48
|
+
write,
|
|
49
|
+
prompt,
|
|
50
|
+
pkg,
|
|
51
|
+
targetPkg,
|
|
52
|
+
variant
|
|
53
|
+
);
|
|
48
54
|
await handler.handle();
|
|
49
55
|
}
|
|
50
56
|
static async appHandler(file, prompt) {
|
|
@@ -65,7 +71,9 @@ class PackageJsonHandler {
|
|
|
65
71
|
await this.syncReactDeps();
|
|
66
72
|
}
|
|
67
73
|
async syncField(fieldName, obj = this.pkg, targetObj = this.targetPkg, prefix, sort, optional) {
|
|
68
|
-
const fullFieldName = chalk__default["default"].cyan(
|
|
74
|
+
const fullFieldName = chalk__default["default"].cyan(
|
|
75
|
+
prefix ? `${prefix}[${fieldName}]` : fieldName
|
|
76
|
+
);
|
|
69
77
|
const newValue = obj[fieldName];
|
|
70
78
|
const coloredNewValue = chalk__default["default"].cyan(JSON.stringify(newValue));
|
|
71
79
|
if (fieldName in targetObj) {
|
|
@@ -83,7 +91,9 @@ class PackageJsonHandler {
|
|
|
83
91
|
await this.write();
|
|
84
92
|
}
|
|
85
93
|
} else if (fieldName in obj && optional !== true) {
|
|
86
|
-
if (await this.prompt(
|
|
94
|
+
if (await this.prompt(
|
|
95
|
+
`package.json is missing field ${fullFieldName}, set to ${coloredNewValue}?`
|
|
96
|
+
)) {
|
|
87
97
|
targetObj[fieldName] = newValue;
|
|
88
98
|
if (sort) {
|
|
89
99
|
sortObjectKeys(targetObj);
|
|
@@ -97,7 +107,11 @@ class PackageJsonHandler {
|
|
|
97
107
|
const hasSchemaFile = typeof configSchema === "string";
|
|
98
108
|
if (!this.targetPkg.files) {
|
|
99
109
|
const expected = hasSchemaFile ? ["dist", configSchema] : ["dist"];
|
|
100
|
-
if (await this.prompt(
|
|
110
|
+
if (await this.prompt(
|
|
111
|
+
`package.json is missing field "files", set to ${JSON.stringify(
|
|
112
|
+
expected
|
|
113
|
+
)}?`
|
|
114
|
+
)) {
|
|
101
115
|
this.targetPkg.files = expected;
|
|
102
116
|
await this.write();
|
|
103
117
|
}
|
|
@@ -110,7 +124,11 @@ class PackageJsonHandler {
|
|
|
110
124
|
missing.push(configSchema);
|
|
111
125
|
}
|
|
112
126
|
if (missing.length) {
|
|
113
|
-
if (await this.prompt(
|
|
127
|
+
if (await this.prompt(
|
|
128
|
+
`package.json is missing ${JSON.stringify(
|
|
129
|
+
missing
|
|
130
|
+
)} in the "files" field, add?`
|
|
131
|
+
)) {
|
|
114
132
|
this.targetPkg.files.push(...missing);
|
|
115
133
|
await this.write();
|
|
116
134
|
}
|
|
@@ -123,7 +141,9 @@ class PackageJsonHandler {
|
|
|
123
141
|
if (!pkgScripts) {
|
|
124
142
|
return;
|
|
125
143
|
}
|
|
126
|
-
const hasNewScript = Object.values(targetScripts).some(
|
|
144
|
+
const hasNewScript = Object.values(targetScripts).some(
|
|
145
|
+
(script) => String(script).includes("backstage-cli package ")
|
|
146
|
+
);
|
|
127
147
|
if (hasNewScript) {
|
|
128
148
|
return;
|
|
129
149
|
}
|
|
@@ -146,7 +166,12 @@ class PackageJsonHandler {
|
|
|
146
166
|
}
|
|
147
167
|
for (const key of Object.keys(pkgPublishConf)) {
|
|
148
168
|
if (!["access", "registry"].includes(key)) {
|
|
149
|
-
await this.syncField(
|
|
169
|
+
await this.syncField(
|
|
170
|
+
key,
|
|
171
|
+
pkgPublishConf,
|
|
172
|
+
targetPublishConf,
|
|
173
|
+
"publishConfig"
|
|
174
|
+
);
|
|
150
175
|
}
|
|
151
176
|
}
|
|
152
177
|
}
|
|
@@ -157,12 +182,25 @@ class PackageJsonHandler {
|
|
|
157
182
|
return;
|
|
158
183
|
}
|
|
159
184
|
await this.syncField("@backstage/core", {}, targetDeps, fieldName, true);
|
|
160
|
-
await this.syncField(
|
|
185
|
+
await this.syncField(
|
|
186
|
+
"@backstage/core-api",
|
|
187
|
+
{},
|
|
188
|
+
targetDeps,
|
|
189
|
+
fieldName,
|
|
190
|
+
true
|
|
191
|
+
);
|
|
161
192
|
for (const key of Object.keys(pkgDeps)) {
|
|
162
193
|
if (this.variant === "app" && key.startsWith("plugin-")) {
|
|
163
194
|
continue;
|
|
164
195
|
}
|
|
165
|
-
await this.syncField(
|
|
196
|
+
await this.syncField(
|
|
197
|
+
key,
|
|
198
|
+
pkgDeps,
|
|
199
|
+
targetDeps,
|
|
200
|
+
fieldName,
|
|
201
|
+
true,
|
|
202
|
+
!required
|
|
203
|
+
);
|
|
166
204
|
}
|
|
167
205
|
}
|
|
168
206
|
async syncReactDeps() {
|
|
@@ -197,7 +235,9 @@ async function exactMatchHandler({ path, write, missing, targetContents, templat
|
|
|
197
235
|
process.stdout.write(` ${diff.value}`);
|
|
198
236
|
}
|
|
199
237
|
}
|
|
200
|
-
if (await prompt(
|
|
238
|
+
if (await prompt(
|
|
239
|
+
`Outdated ${coloredPath}, do you want to apply the above patch?`
|
|
240
|
+
)) {
|
|
201
241
|
await write(templateContents);
|
|
202
242
|
}
|
|
203
243
|
}
|
|
@@ -224,7 +264,11 @@ const handlers = {
|
|
|
224
264
|
async function handleAllFiles(fileHandlers, files, promptFunc) {
|
|
225
265
|
for (const file of files) {
|
|
226
266
|
const path$1 = file.path.split(path.sep).join(path.posix.sep);
|
|
227
|
-
const fileHandler = fileHandlers.find(
|
|
267
|
+
const fileHandler = fileHandlers.find(
|
|
268
|
+
(handler) => handler.patterns.some(
|
|
269
|
+
(pattern) => typeof pattern === "string" ? pattern === path$1 : pattern.test(path$1)
|
|
270
|
+
)
|
|
271
|
+
);
|
|
228
272
|
if (fileHandler) {
|
|
229
273
|
await fileHandler.handler(file, promptFunc);
|
|
230
274
|
} else {
|
|
@@ -250,7 +294,9 @@ const makeCheckPromptFunc = () => {
|
|
|
250
294
|
};
|
|
251
295
|
const finalize = () => {
|
|
252
296
|
if (failed) {
|
|
253
|
-
throw new Error(
|
|
297
|
+
throw new Error(
|
|
298
|
+
"Check failed, the plugin is not in sync with the latest template"
|
|
299
|
+
);
|
|
254
300
|
}
|
|
255
301
|
};
|
|
256
302
|
return [promptFunc, finalize];
|
|
@@ -269,7 +315,10 @@ async function readTemplateFile(templateFile, templateVars) {
|
|
|
269
315
|
return handlebars__default["default"].compile(contents)(templateVars, {
|
|
270
316
|
helpers: {
|
|
271
317
|
versionQuery(name, hint) {
|
|
272
|
-
return packageVersionProvider(
|
|
318
|
+
return packageVersionProvider(
|
|
319
|
+
name,
|
|
320
|
+
typeof hint === "string" ? hint : void 0
|
|
321
|
+
);
|
|
273
322
|
}
|
|
274
323
|
}
|
|
275
324
|
});
|
|
@@ -370,7 +419,10 @@ async function readPluginData() {
|
|
|
370
419
|
} catch (error) {
|
|
371
420
|
throw new Error(`Failed to read target package, ${error}`);
|
|
372
421
|
}
|
|
373
|
-
const pluginTsContents = await fs__default["default"].readFile(
|
|
422
|
+
const pluginTsContents = await fs__default["default"].readFile(
|
|
423
|
+
index.paths.resolveTarget("src/plugin.ts"),
|
|
424
|
+
"utf8"
|
|
425
|
+
);
|
|
374
426
|
const pluginIdMatch = pluginTsContents.match(/id: ['"`](.+?)['"`]/);
|
|
375
427
|
if (!pluginIdMatch) {
|
|
376
428
|
throw new Error(`Failed to parse plugin.ts, no plugin ID found`);
|
|
@@ -380,4 +432,4 @@ async function readPluginData() {
|
|
|
380
432
|
}
|
|
381
433
|
|
|
382
434
|
exports["default"] = diff;
|
|
383
|
-
//# sourceMappingURL=diff-
|
|
435
|
+
//# sourceMappingURL=diff-3dec490d.cjs.js.map
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
var configLoader = require('@backstage/config-loader');
|
|
4
4
|
var openBrowser = require('react-dev-utils/openBrowser');
|
|
5
|
-
var config = require('./config-
|
|
5
|
+
var config = require('./config-4a59f918.cjs.js');
|
|
6
6
|
require('@backstage/config');
|
|
7
|
-
require('./index-
|
|
7
|
+
require('./index-50703ee1.cjs.js');
|
|
8
8
|
require('commander');
|
|
9
9
|
require('chalk');
|
|
10
10
|
require('fs-extra');
|
|
@@ -12,7 +12,7 @@ require('semver');
|
|
|
12
12
|
require('@backstage/cli-common');
|
|
13
13
|
require('@backstage/errors');
|
|
14
14
|
require('@manypkg/get-packages');
|
|
15
|
-
require('./PackageGraph-
|
|
15
|
+
require('./PackageGraph-6e1d4bd4.cjs.js');
|
|
16
16
|
require('path');
|
|
17
17
|
require('child_process');
|
|
18
18
|
require('util');
|
|
@@ -28,9 +28,13 @@ var docs = async (opts) => {
|
|
|
28
28
|
fromPackage: opts.package,
|
|
29
29
|
mockEnv: true
|
|
30
30
|
});
|
|
31
|
-
const schema = configLoader.mergeConfigSchemas(
|
|
31
|
+
const schema = configLoader.mergeConfigSchemas(
|
|
32
|
+
appSchemas.serialize().schemas.map(
|
|
33
|
+
(_) => _.value
|
|
34
|
+
)
|
|
35
|
+
);
|
|
32
36
|
openBrowser__default["default"](`${DOCS_URL}#schema=${JSON.stringify(schema)}`);
|
|
33
37
|
};
|
|
34
38
|
|
|
35
39
|
exports["default"] = docs;
|
|
36
|
-
//# sourceMappingURL=docs-
|
|
40
|
+
//# sourceMappingURL=docs-e60d4fe7.cjs.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-50703ee1.cjs.js');
|
|
4
4
|
var eslint = require('eslint');
|
|
5
5
|
var path = require('path');
|
|
6
6
|
var fs = require('fs-extra');
|
|
7
7
|
var cliCommon = require('@backstage/cli-common');
|
|
8
|
-
var PackageGraph = require('./PackageGraph-
|
|
8
|
+
var PackageGraph = require('./PackageGraph-6e1d4bd4.cjs.js');
|
|
9
9
|
require('commander');
|
|
10
10
|
require('chalk');
|
|
11
11
|
require('semver');
|
|
@@ -29,10 +29,14 @@ async function command() {
|
|
|
29
29
|
const pkgJsonPath = index.paths.resolveTarget("package.json");
|
|
30
30
|
const pkg = await fs__default["default"].readJson(pkgJsonPath);
|
|
31
31
|
if (pkg.workspaces) {
|
|
32
|
-
throw new Error(
|
|
32
|
+
throw new Error(
|
|
33
|
+
"Adding dependencies to the workspace root is not supported"
|
|
34
|
+
);
|
|
33
35
|
}
|
|
34
36
|
const packages = await PackageGraph.PackageGraph.listTargetPackages();
|
|
35
|
-
const localPackageVersions = new Map(
|
|
37
|
+
const localPackageVersions = new Map(
|
|
38
|
+
packages.map((p) => [p.packageJson.name, p.packageJson.version])
|
|
39
|
+
);
|
|
36
40
|
const eslint$1 = new eslint.ESLint({
|
|
37
41
|
cwd: index.paths.targetDir,
|
|
38
42
|
overrideConfig: {
|
|
@@ -103,14 +107,20 @@ async function command() {
|
|
|
103
107
|
delete pkg.devDependencies;
|
|
104
108
|
}
|
|
105
109
|
if (pkg.dependencies) {
|
|
106
|
-
pkg.dependencies = Object.fromEntries(
|
|
110
|
+
pkg.dependencies = Object.fromEntries(
|
|
111
|
+
Object.entries(pkg.dependencies).sort(([a], [b]) => a.localeCompare(b))
|
|
112
|
+
);
|
|
107
113
|
}
|
|
108
114
|
if (pkg.devDependencies) {
|
|
109
|
-
pkg.devDependencies = Object.fromEntries(
|
|
115
|
+
pkg.devDependencies = Object.fromEntries(
|
|
116
|
+
Object.entries(pkg.devDependencies).sort(
|
|
117
|
+
([a], [b]) => a.localeCompare(b)
|
|
118
|
+
)
|
|
119
|
+
);
|
|
110
120
|
}
|
|
111
121
|
await fs__default["default"].writeJson(pkgJsonPath, pkg, { spaces: 2 });
|
|
112
122
|
}
|
|
113
123
|
}
|
|
114
124
|
|
|
115
125
|
exports.command = command;
|
|
116
|
-
//# sourceMappingURL=fix-
|
|
126
|
+
//# sourceMappingURL=fix-b60a5395.cjs.js.map
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var createDistWorkspace = require('./createDistWorkspace-
|
|
4
|
-
var packageRoles = require('./packageRoles-
|
|
5
|
-
var index = require('./index-
|
|
6
|
-
var buildBackend = require('./buildBackend-
|
|
3
|
+
var createDistWorkspace = require('./createDistWorkspace-cb9a9a84.cjs.js');
|
|
4
|
+
var packageRoles = require('./packageRoles-96528891.cjs.js');
|
|
5
|
+
var index = require('./index-50703ee1.cjs.js');
|
|
6
|
+
var buildBackend = require('./buildBackend-87996ad4.cjs.js');
|
|
7
7
|
require('chalk');
|
|
8
8
|
require('fs-extra');
|
|
9
9
|
require('path');
|
|
10
10
|
require('os');
|
|
11
11
|
require('tar');
|
|
12
12
|
require('lodash/partition');
|
|
13
|
-
require('./run-
|
|
13
|
+
require('./run-722b1384.cjs.js');
|
|
14
14
|
require('child_process');
|
|
15
15
|
require('util');
|
|
16
16
|
require('@backstage/errors');
|
|
17
|
-
require('./PackageGraph-
|
|
17
|
+
require('./PackageGraph-6e1d4bd4.cjs.js');
|
|
18
18
|
require('@manypkg/get-packages');
|
|
19
19
|
require('rollup');
|
|
20
20
|
require('@rollup/plugin-commonjs');
|
|
@@ -27,7 +27,7 @@ require('@rollup/plugin-json');
|
|
|
27
27
|
require('@rollup/plugin-yaml');
|
|
28
28
|
require('rollup-pluginutils');
|
|
29
29
|
require('./svgrTemplate-550efce6.cjs.js');
|
|
30
|
-
require('./parallel-
|
|
30
|
+
require('./parallel-a8f6219c.cjs.js');
|
|
31
31
|
require('worker_threads');
|
|
32
32
|
require('npm-packlist');
|
|
33
33
|
require('zod');
|
|
@@ -40,7 +40,7 @@ require('html-webpack-plugin');
|
|
|
40
40
|
require('react-dev-utils/ModuleScopePlugin');
|
|
41
41
|
require('run-script-webpack-plugin');
|
|
42
42
|
require('webpack-node-externals');
|
|
43
|
-
require('./paths-
|
|
43
|
+
require('./paths-b34f135a.cjs.js');
|
|
44
44
|
require('mini-css-extract-plugin');
|
|
45
45
|
require('eslint-webpack-plugin');
|
|
46
46
|
require('lodash/pickBy');
|
|
@@ -49,7 +49,7 @@ require('react-dev-utils/FileSizeReporter');
|
|
|
49
49
|
require('react-dev-utils/formatWebpackMessages');
|
|
50
50
|
require('webpack-dev-server');
|
|
51
51
|
require('react-dev-utils/openBrowser');
|
|
52
|
-
require('./config-
|
|
52
|
+
require('./config-4a59f918.cjs.js');
|
|
53
53
|
require('@backstage/config-loader');
|
|
54
54
|
require('@backstage/config');
|
|
55
55
|
|
|
@@ -87,4 +87,4 @@ async function command(opts) {
|
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
exports.command = command;
|
|
90
|
-
//# sourceMappingURL=index-
|
|
90
|
+
//# sourceMappingURL=index-131467e2.cjs.js.map
|