@theholocron/cli 5.0.0-alpha.441 → 5.0.0-alpha.442
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.mjs +37 -3
- package/dist/cli.mjs.map +1 -1
- package/package.json +13 -13
package/dist/cli.mjs
CHANGED
|
@@ -14699,6 +14699,7 @@ async function runRequestsExport(input) {
|
|
|
14699
14699
|
};
|
|
14700
14700
|
}
|
|
14701
14701
|
}
|
|
14702
|
+
const paths = [];
|
|
14702
14703
|
for (const { tool, provider, collectionFiles, envFiles, outDir } of targets) try {
|
|
14703
14704
|
const result = await tool.export({
|
|
14704
14705
|
collectionFiles,
|
|
@@ -14709,11 +14710,18 @@ async function runRequestsExport(input) {
|
|
|
14709
14710
|
});
|
|
14710
14711
|
const where = relative(repoRoot, outDir);
|
|
14711
14712
|
const files = result.files.length > 0 ? ` (${result.files.join(", ")})` : "";
|
|
14713
|
+
paths.push(...result.files.map((file) => resolve(outDir, file)));
|
|
14712
14714
|
rows.push(row$4(provider, "ok", `${dryRun ? "would write" : "wrote"} ${result.files.length} file(s) to ${where}${files}`, result.issues.map((issue) => `issue in ${issue.file}: ${issue.message}`)));
|
|
14713
14715
|
} catch (err) {
|
|
14714
14716
|
rows.push(row$4(provider, "fail", describeError(err)));
|
|
14715
14717
|
}
|
|
14716
|
-
|
|
14718
|
+
const report = finish(rows.sort((a, b) => a.id.localeCompare(b.id)));
|
|
14719
|
+
if (paths.length > 0) {
|
|
14720
|
+
print("");
|
|
14721
|
+
print(dryRun ? "Would write:" : "Wrote:");
|
|
14722
|
+
for (const path of paths) print(` ${path}`);
|
|
14723
|
+
}
|
|
14724
|
+
return report;
|
|
14717
14725
|
}
|
|
14718
14726
|
// src/commands/requests-export/requests-export.command.ts
|
|
14719
14727
|
const requestsExportCommand = {
|
|
@@ -23515,6 +23523,8 @@ const defaultLogin = async (cwd) => {
|
|
|
23515
23523
|
}).status ?? -1 };
|
|
23516
23524
|
};
|
|
23517
23525
|
// src/commands/publish/discover-manifests.ts
|
|
23526
|
+
/** `./plugins/x/`, `plugins/x` and `plugins/x/` are the same folder. */
|
|
23527
|
+
const normalizeDir = (dir) => dir.replace(/^\.\//, "").replace(/\/+$/, "");
|
|
23518
23528
|
/**
|
|
23519
23529
|
* Monorepo (the workspace declares public packages): every workspace
|
|
23520
23530
|
* package. Single package (it declares none -- no `pnpm-workspace.yaml`, or one
|
|
@@ -23524,8 +23534,18 @@ const defaultLogin = async (cwd) => {
|
|
|
23524
23534
|
* With a `group` (a folder of the repo, `clients`), only that group's packages,
|
|
23525
23535
|
* and never the root `package.json`: a group that has no packages has nothing to
|
|
23526
23536
|
* publish, not a single-package repo.
|
|
23537
|
+
*
|
|
23538
|
+
* With `onlyPackages` (package names or their folders), only those packages: what is left after the group and
|
|
23539
|
+
* the exclusions is narrowed to them, and one that matches nothing is simply not there.
|
|
23527
23540
|
*/
|
|
23528
23541
|
function discoverManifests(cwd, scope = {}) {
|
|
23542
|
+
const found = discoverAll(cwd, scope);
|
|
23543
|
+
const only = scope.onlyPackages;
|
|
23544
|
+
if (only === void 0 || only.length === 0) return found;
|
|
23545
|
+
const wanted = new Set(only.map(normalizeDir));
|
|
23546
|
+
return found.filter(({ manifest, dir }) => wanted.has(manifest.name ?? "") || wanted.has(normalizeDir(dir)));
|
|
23547
|
+
}
|
|
23548
|
+
function discoverAll(cwd, scope) {
|
|
23529
23549
|
const workspace = discoverWorkspacePackages(cwd, scope);
|
|
23530
23550
|
if (scope.group !== void 0) return workspace.map(({ manifest, relativeDir }) => ({
|
|
23531
23551
|
manifest,
|
|
@@ -23612,6 +23632,8 @@ function printNextSteps(print, env, packageNames, identity, workflowFile) {
|
|
|
23612
23632
|
print(` Organization: ${identity.owner}`);
|
|
23613
23633
|
print(` Repository: ${identity.repo}`);
|
|
23614
23634
|
print(` Workflow filename: ${workflowFile}`);
|
|
23635
|
+
print(" or let the CLI register it on every package that has none (needs an npm session):");
|
|
23636
|
+
print(` holocron publish package --sync-trust ${workflowFile} ${workflowFile}`);
|
|
23615
23637
|
print("");
|
|
23616
23638
|
print("→ packages to be published:");
|
|
23617
23639
|
for (const name of packageNames) print(` https://www.npmjs.com/package/${name}/access`);
|
|
@@ -23664,10 +23686,11 @@ async function resolveRepoIdentity(cwd, exec) {
|
|
|
23664
23686
|
}
|
|
23665
23687
|
// src/commands/publish/scope-of.ts
|
|
23666
23688
|
/** The {@link WorkspaceScope} a publish input asks for; unset options stay unset. */
|
|
23667
|
-
function scopeOf({ group, excludeGroups }) {
|
|
23689
|
+
function scopeOf({ group, excludeGroups, onlyPackages }) {
|
|
23668
23690
|
return {
|
|
23669
23691
|
...group === void 0 ? {} : { group },
|
|
23670
|
-
...excludeGroups === void 0 ? {} : { excludeGroups }
|
|
23692
|
+
...excludeGroups === void 0 ? {} : { excludeGroups },
|
|
23693
|
+
...onlyPackages === void 0 ? {} : { onlyPackages }
|
|
23671
23694
|
};
|
|
23672
23695
|
}
|
|
23673
23696
|
// src/commands/publish/workspace-filter-args.ts
|
|
@@ -24278,6 +24301,10 @@ const publishArgs = (y) => y.option("initial", {
|
|
|
24278
24301
|
}).option("group", {
|
|
24279
24302
|
type: "string",
|
|
24280
24303
|
describe: "Only this version group's packages: a folder of the repo (clients, observability). Omitted, every public package in the workspace."
|
|
24304
|
+
}).option("package", {
|
|
24305
|
+
type: "string",
|
|
24306
|
+
array: true,
|
|
24307
|
+
describe: "Only this package (repeatable): its name or its folder, like @theholocron/holocron-plugin-bruno or plugins/holocron-plugin-bruno. For --initial and --sync-trust; a steady-state publish refuses it."
|
|
24281
24308
|
}).option("exclude-group", {
|
|
24282
24309
|
type: "string",
|
|
24283
24310
|
array: true,
|
|
@@ -24314,6 +24341,7 @@ const publishPackageCommand = {
|
|
|
24314
24341
|
force: argv.force,
|
|
24315
24342
|
...argv.group ? { group: argv.group } : {},
|
|
24316
24343
|
...argv.excludeGroup?.length ? { excludeGroups: argv.excludeGroup } : {},
|
|
24344
|
+
...argv.package?.length ? { onlyPackages: argv.package } : {},
|
|
24317
24345
|
...argv.repo ? { repo: argv.repo } : {}
|
|
24318
24346
|
})).status === "fail") process.exitCode = 1;
|
|
24319
24347
|
return;
|
|
@@ -24324,6 +24352,7 @@ const publishPackageCommand = {
|
|
|
24324
24352
|
dryRun: argv.dryRun,
|
|
24325
24353
|
...argv.group ? { group: argv.group } : {},
|
|
24326
24354
|
...argv.excludeGroup?.length ? { excludeGroups: argv.excludeGroup } : {},
|
|
24355
|
+
...argv.package?.length ? { onlyPackages: argv.package } : {},
|
|
24327
24356
|
...argv.tag ? { tag: argv.tag } : {},
|
|
24328
24357
|
...otp ? { otp } : {}
|
|
24329
24358
|
});
|
|
@@ -24331,6 +24360,11 @@ const publishPackageCommand = {
|
|
|
24331
24360
|
else if (report.status === "ok" && report.packageNames.length === 0 && env$2.get(DRY_RUN_PREVIEW_ENV_VAR) === "1") process.exitCode = DRY_RUN_NOOP_EXIT_CODE;
|
|
24332
24361
|
return;
|
|
24333
24362
|
}
|
|
24363
|
+
if (argv.package?.length) {
|
|
24364
|
+
reportError("publish package --package works with --initial or --sync-trust; a steady-state publish takes the whole scope");
|
|
24365
|
+
process.exitCode = 1;
|
|
24366
|
+
return;
|
|
24367
|
+
}
|
|
24334
24368
|
if ((await runSteadyPublish({
|
|
24335
24369
|
cwd: argv.cwd,
|
|
24336
24370
|
dryRun: argv.dryRun,
|