@backstage/cli 0.33.0-next.1 → 0.33.0-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
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @backstage/cli
|
|
2
2
|
|
|
3
|
+
## 0.33.0-next.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 8a0164c: Fix an issue where some commands were not usable because of missing dist files
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @backstage/eslint-plugin@0.1.11-next.0
|
|
10
|
+
- @backstage/catalog-model@1.7.4
|
|
11
|
+
- @backstage/cli-common@0.1.15
|
|
12
|
+
- @backstage/cli-node@0.2.13
|
|
13
|
+
- @backstage/config@1.3.2
|
|
14
|
+
- @backstage/config-loader@1.10.1
|
|
15
|
+
- @backstage/errors@1.2.7
|
|
16
|
+
- @backstage/integration@1.17.0
|
|
17
|
+
- @backstage/release-manifests@0.0.13
|
|
18
|
+
- @backstage/types@1.2.1
|
|
19
|
+
|
|
3
20
|
## 0.33.0-next.1
|
|
4
21
|
|
|
5
22
|
### Minor Changes
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var yaml = require('yaml');
|
|
6
|
+
var config$1 = require('@backstage/config');
|
|
7
|
+
var config = require('../lib/config.cjs.js');
|
|
8
|
+
|
|
9
|
+
var print = async (opts) => {
|
|
10
|
+
const { schema, appConfigs } = await config.loadCliConfig({
|
|
11
|
+
args: opts.config,
|
|
12
|
+
fromPackage: opts.package,
|
|
13
|
+
mockEnv: opts.lax,
|
|
14
|
+
fullVisibility: !opts.frontend
|
|
15
|
+
});
|
|
16
|
+
const visibility = getVisibilityOption(opts);
|
|
17
|
+
const data = serializeConfigData(appConfigs, schema, visibility);
|
|
18
|
+
if (opts.format === "json") {
|
|
19
|
+
process.stdout.write(`${JSON.stringify(data, null, 2)}
|
|
20
|
+
`);
|
|
21
|
+
} else {
|
|
22
|
+
process.stdout.write(`${yaml.stringify(data)}
|
|
23
|
+
`);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
function getVisibilityOption(opts) {
|
|
27
|
+
if (opts.frontend && opts.withSecrets) {
|
|
28
|
+
throw new Error("Not allowed to combine frontend and secret config");
|
|
29
|
+
}
|
|
30
|
+
if (opts.frontend) {
|
|
31
|
+
return "frontend";
|
|
32
|
+
} else if (opts.withSecrets) {
|
|
33
|
+
return "secret";
|
|
34
|
+
}
|
|
35
|
+
return "backend";
|
|
36
|
+
}
|
|
37
|
+
function serializeConfigData(appConfigs, schema, visibility) {
|
|
38
|
+
if (visibility === "frontend") {
|
|
39
|
+
const frontendConfigs = schema.process(appConfigs, {
|
|
40
|
+
visibility: ["frontend"]
|
|
41
|
+
});
|
|
42
|
+
return config$1.ConfigReader.fromConfigs(frontendConfigs).get();
|
|
43
|
+
} else if (visibility === "secret") {
|
|
44
|
+
return config$1.ConfigReader.fromConfigs(appConfigs).get();
|
|
45
|
+
}
|
|
46
|
+
const sanitizedConfigs = schema.process(appConfigs, {
|
|
47
|
+
valueTransform: (value, context) => context.visibility === "secret" ? "<secret>" : value
|
|
48
|
+
});
|
|
49
|
+
return config$1.ConfigReader.fromConfigs(sanitizedConfigs).get();
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
exports.default = print;
|
|
53
|
+
//# sourceMappingURL=print.cjs.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var config = require('../lib/config.cjs.js');
|
|
6
|
+
|
|
7
|
+
var validate = async (opts) => {
|
|
8
|
+
await config.loadCliConfig({
|
|
9
|
+
args: opts.config,
|
|
10
|
+
fromPackage: opts.package,
|
|
11
|
+
mockEnv: opts.lax,
|
|
12
|
+
fullVisibility: !opts.frontend,
|
|
13
|
+
withDeprecatedKeys: opts.deprecated,
|
|
14
|
+
strict: opts.strict
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
exports.default = validate;
|
|
19
|
+
//# sourceMappingURL=validate.cjs.js.map
|
|
@@ -54,8 +54,7 @@ var index = factory.createCliPlugin({
|
|
|
54
54
|
format: { type: "string" },
|
|
55
55
|
config: { type: "string", array: true, default: [] }
|
|
56
56
|
}).usage("$0", info.description).help().parse(args);
|
|
57
|
-
|
|
58
|
-
await m.default(argv);
|
|
57
|
+
await lazy.lazy(() => import('./commands/print.cjs.js'), "default")(argv);
|
|
59
58
|
}
|
|
60
59
|
});
|
|
61
60
|
reg.addCommand({
|
|
@@ -74,8 +73,7 @@ var index = factory.createCliPlugin({
|
|
|
74
73
|
default: []
|
|
75
74
|
}
|
|
76
75
|
}).help().parse(args);
|
|
77
|
-
|
|
78
|
-
await m.default(argv);
|
|
76
|
+
await lazy.lazy(() => import('./commands/validate.cjs.js'), "default")(argv);
|
|
79
77
|
}
|
|
80
78
|
});
|
|
81
79
|
reg.addCommand({
|
|
@@ -88,8 +86,7 @@ var index = factory.createCliPlugin({
|
|
|
88
86
|
merge: { type: "boolean" },
|
|
89
87
|
"no-merge": { type: "boolean" }
|
|
90
88
|
}).help().parse(args);
|
|
91
|
-
|
|
92
|
-
await m.default(argv);
|
|
89
|
+
await lazy.lazy(() => import('./commands/schema.cjs.js'), "default")(argv);
|
|
93
90
|
}
|
|
94
91
|
});
|
|
95
92
|
reg.addCommand({
|
|
@@ -102,8 +99,7 @@ var index = factory.createCliPlugin({
|
|
|
102
99
|
merge: { type: "boolean" },
|
|
103
100
|
"no-merge": { type: "boolean" }
|
|
104
101
|
}).help().parse(args);
|
|
105
|
-
|
|
106
|
-
await m.default(argv);
|
|
102
|
+
await lazy.lazy(() => import('./commands/schema.cjs.js'), "default")(argv);
|
|
107
103
|
}
|
|
108
104
|
});
|
|
109
105
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/cli",
|
|
3
|
-
"version": "0.33.0-next.
|
|
3
|
+
"version": "0.33.0-next.2",
|
|
4
4
|
"description": "CLI for developing Backstage plugins and apps",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "cli"
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@backstage/config": "1.3.2",
|
|
54
54
|
"@backstage/config-loader": "1.10.1",
|
|
55
55
|
"@backstage/errors": "1.2.7",
|
|
56
|
-
"@backstage/eslint-plugin": "0.1.
|
|
56
|
+
"@backstage/eslint-plugin": "0.1.11-next.0",
|
|
57
57
|
"@backstage/integration": "1.17.0",
|
|
58
58
|
"@backstage/release-manifests": "0.0.13",
|
|
59
59
|
"@backstage/types": "1.2.1",
|