@boopkit/cli 0.6.17 → 0.6.18
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/dist/cli.js +1 -0
- package/dist/commands/add.d.ts +1 -0
- package/dist/commands/add.js +7 -3
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -81,6 +81,7 @@ program
|
|
|
81
81
|
.option('--no-install', 'Skip npm install')
|
|
82
82
|
.option('--json', 'Output structured JSON')
|
|
83
83
|
.option('--dry-run', 'Show what would be done without making changes')
|
|
84
|
+
.option('--tag <tag>', 'Use a specific npm dist-tag instead of latest (e.g. beta)')
|
|
84
85
|
.addHelpText('after', '\nRun `boop list capabilities` to see available options.')
|
|
85
86
|
.action(add_1.runAdd);
|
|
86
87
|
program
|
package/dist/commands/add.d.ts
CHANGED
package/dist/commands/add.js
CHANGED
|
@@ -65,13 +65,17 @@ function runAdd(capabilityName, options) {
|
|
|
65
65
|
// When the CLI is installed globally, capability packages aren't in
|
|
66
66
|
// node_modules yet. Install the package so preflight can read its
|
|
67
67
|
// capability.json, scaffold files, etc.
|
|
68
|
-
|
|
68
|
+
// With --tag, install from that dist-tag even when a package is present
|
|
69
|
+
// (the operator asked for that version), and skip npm's cached registry
|
|
70
|
+
// metadata, which can predate a just-published beta.
|
|
71
|
+
if (options.tag || !(0, capability_1.getPackageDir)(capabilityName, [targetDir])) {
|
|
69
72
|
const catalogEntry = (0, capability_1.getCatalogEntry)(capabilityName);
|
|
70
73
|
if (catalogEntry?.package) {
|
|
71
|
-
const spec = catalogEntry.package;
|
|
74
|
+
const spec = options.tag ? `${catalogEntry.package}@${options.tag}` : catalogEntry.package;
|
|
75
|
+
const flags = options.tag ? ' --prefer-online' : '';
|
|
72
76
|
console.error(`Installing ${spec}...`);
|
|
73
77
|
try {
|
|
74
|
-
(0, child_process_1.execSync)(`npm install ${spec}`, { cwd: targetDir, stdio: 'pipe' });
|
|
78
|
+
(0, child_process_1.execSync)(`npm install ${spec}${flags}`, { cwd: targetDir, stdio: 'pipe' });
|
|
75
79
|
}
|
|
76
80
|
catch (err) {
|
|
77
81
|
console.error(`\x1b[31mERR\x1b[0m Failed to install ${spec}: ${err.message}`);
|
package/package.json
CHANGED