@construct-space/cli 1.7.3 → 1.7.4

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.
Files changed (2) hide show
  1. package/dist/index.js +16 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -10295,12 +10295,15 @@ async function packSource(root) {
10295
10295
  }
10296
10296
 
10297
10297
  // src/commands/publish.ts
10298
- async function uploadSource(portalURL, identityToken, publisherKey, tarballPath, m) {
10298
+ async function uploadSource(portalURL, identityToken, publisherKey, tarballPath, m, opts) {
10299
10299
  const formData = new FormData;
10300
10300
  formData.append("manifest", JSON.stringify(m));
10301
10301
  const fileData = readFileSync8(tarballPath);
10302
10302
  const blob = new Blob([fileData]);
10303
10303
  formData.append("source", blob, basename6(tarballPath));
10304
+ if (opts.private) {
10305
+ formData.append("private", "true");
10306
+ }
10304
10307
  const headers = {
10305
10308
  Authorization: `Bearer ${identityToken}`
10306
10309
  };
@@ -10346,6 +10349,7 @@ function setVersionInFiles(root, oldVer, newVer) {
10346
10349
  async function publish(options) {
10347
10350
  const root = process.cwd();
10348
10351
  const yes = options?.yes ?? false;
10352
+ const wantPrivate = options?.private ?? false;
10349
10353
  if (!exists(root)) {
10350
10354
  console.error(source_default.red("No space.manifest.json found in current directory"));
10351
10355
  process.exit(1);
@@ -10435,6 +10439,12 @@ async function publish(options) {
10435
10439
  console.log(source_default.dim(" (Org Settings \u2192 Developer), then re-run this command."));
10436
10440
  console.log();
10437
10441
  }
10442
+ if (wantPrivate && creds.publisherKind !== "org") {
10443
+ console.error(source_default.red("--private requires an org publisher key."));
10444
+ console.error(source_default.dim(" Personal publishes are always public."));
10445
+ console.error(source_default.dim(" Enrol an org from the desktop app (Org Settings \u2192 Developer) and re-run."));
10446
+ process.exit(1);
10447
+ }
10438
10448
  console.log();
10439
10449
  console.log(` Space: ${source_default.cyan(m.name)}`);
10440
10450
  console.log(` Version: ${source_default.cyan("v" + m.version)}`);
@@ -10446,6 +10456,7 @@ async function publish(options) {
10446
10456
  } else if (creds.user) {
10447
10457
  console.log(` Author: ${source_default.dim(creds.user.name)}`);
10448
10458
  }
10459
+ console.log(` Audience: ${wantPrivate ? source_default.magenta("org-private") : source_default.cyan("public")}`);
10449
10460
  console.log();
10450
10461
  if (!yes) {
10451
10462
  const proceed = await dist_default4({
@@ -10469,7 +10480,7 @@ async function publish(options) {
10469
10480
  }
10470
10481
  const uploadSpinner = ora("Uploading & building...").start();
10471
10482
  try {
10472
- const result = await uploadSource(creds.portal, creds.token, creds.publisherKey, tarballPath, m);
10483
+ const result = await uploadSource(creds.portal, creds.token, creds.publisherKey, tarballPath, m, { private: wantPrivate });
10473
10484
  unlinkSync2(tarballPath);
10474
10485
  gitSafe(root, "tag", `v${m.version}`);
10475
10486
  gitSafe(root, "push", "origin", `v${m.version}`);
@@ -11420,7 +11431,7 @@ function graphFork(newSpaceID) {
11420
11431
  // package.json
11421
11432
  var package_default = {
11422
11433
  name: "@construct-space/cli",
11423
- version: "1.7.3",
11434
+ version: "1.7.4",
11424
11435
  description: "Construct CLI \u2014 scaffold, build, develop, and publish spaces",
11425
11436
  type: "module",
11426
11437
  bin: {
@@ -11472,7 +11483,7 @@ program2.command("scaffold [name]").alias("new").alias("create").description("Cr
11472
11483
  program2.command("build").description("Build the space (generate entry + run Vite)").option("--entry-only", "Only generate src/entry.ts").action(async (opts) => build(opts));
11473
11484
  program2.command("dev").description("Start dev mode with file watching and live reload").action(async () => dev());
11474
11485
  program2.command("install").alias("run").description("Install built space to Construct spaces directory").action(() => install());
11475
- program2.command("publish").description("Publish a space to the Construct registry").option("-y, --yes", "Skip all confirmation prompts").option("--bump <type>", "Auto-bump version (patch, minor, major)").action(async (opts) => publish(opts));
11486
+ program2.command("publish").description("Publish a space to the Construct registry").option("-y, --yes", "Skip all confirmation prompts").option("--bump <type>", "Auto-bump version (patch, minor, major)").option("--private", "Publish as org-private (catalog-listed only inside the owning org). Requires an org publisher key.").action(async (opts) => publish(opts));
11476
11487
  program2.command("validate").description("Validate space.manifest.json").action(() => validate3());
11477
11488
  program2.command("check").description("Run type-check (vue-tsc) and linter (eslint)").action(() => check());
11478
11489
  program2.command("clean").description("Remove build artifacts").option("--all", "Also remove node_modules and lockfiles").action((opts) => clean(opts));
@@ -11503,7 +11514,7 @@ space.command("scaffold [name]").alias("new").alias("create").option("--with-tes
11503
11514
  space.command("build").option("--entry-only").action(async (opts) => build(opts));
11504
11515
  space.command("dev").action(async () => dev());
11505
11516
  space.command("install").alias("run").action(() => install());
11506
- space.command("publish").option("-y, --yes").option("--bump <type>").action(async (opts) => publish(opts));
11517
+ space.command("publish").option("-y, --yes").option("--bump <type>").option("--private").action(async (opts) => publish(opts));
11507
11518
  space.command("validate").action(() => validate3());
11508
11519
  space.command("check").action(() => check());
11509
11520
  space.command("clean").option("--all").action((opts) => clean(opts));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@construct-space/cli",
3
- "version": "1.7.3",
3
+ "version": "1.7.4",
4
4
  "description": "Construct CLI — scaffold, build, develop, and publish spaces",
5
5
  "type": "module",
6
6
  "bin": {