@construct-space/cli 1.7.2 → 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.
- package/dist/index.js +22 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10157,7 +10157,7 @@ async function dev() {
|
|
|
10157
10157
|
|
|
10158
10158
|
// src/commands/run.ts
|
|
10159
10159
|
init_source();
|
|
10160
|
-
import { existsSync as existsSync9, cpSync as cpSync2, mkdirSync as mkdirSync3, readdirSync as readdirSync4, chmodSync, lstatSync } from "fs";
|
|
10160
|
+
import { existsSync as existsSync9, cpSync as cpSync2, mkdirSync as mkdirSync3, readdirSync as readdirSync4, chmodSync, lstatSync, rmSync } from "fs";
|
|
10161
10161
|
import { join as join11 } from "path";
|
|
10162
10162
|
init_appdir();
|
|
10163
10163
|
function ensureBinExecutable(installDir) {
|
|
@@ -10198,8 +10198,9 @@ function install() {
|
|
|
10198
10198
|
bundleAgentDir(agentDir, distDir);
|
|
10199
10199
|
}
|
|
10200
10200
|
const installDir = spaceDir(m.id);
|
|
10201
|
+
rmSync(installDir, { recursive: true, force: true });
|
|
10201
10202
|
mkdirSync3(installDir, { recursive: true });
|
|
10202
|
-
cpSync2(distDir, installDir, { recursive: true, verbatimSymlinks: true });
|
|
10203
|
+
cpSync2(distDir, installDir, { recursive: true, verbatimSymlinks: true, force: true });
|
|
10203
10204
|
ensureBinExecutable(installDir);
|
|
10204
10205
|
console.log(source_default.green(`Installed ${m.name} \u2192 ${installDir}`));
|
|
10205
10206
|
console.log(source_default.dim(" Restart Construct to load the updated space."));
|
|
@@ -10294,12 +10295,15 @@ async function packSource(root) {
|
|
|
10294
10295
|
}
|
|
10295
10296
|
|
|
10296
10297
|
// src/commands/publish.ts
|
|
10297
|
-
async function uploadSource(portalURL, identityToken, publisherKey, tarballPath, m) {
|
|
10298
|
+
async function uploadSource(portalURL, identityToken, publisherKey, tarballPath, m, opts) {
|
|
10298
10299
|
const formData = new FormData;
|
|
10299
10300
|
formData.append("manifest", JSON.stringify(m));
|
|
10300
10301
|
const fileData = readFileSync8(tarballPath);
|
|
10301
10302
|
const blob = new Blob([fileData]);
|
|
10302
10303
|
formData.append("source", blob, basename6(tarballPath));
|
|
10304
|
+
if (opts.private) {
|
|
10305
|
+
formData.append("private", "true");
|
|
10306
|
+
}
|
|
10303
10307
|
const headers = {
|
|
10304
10308
|
Authorization: `Bearer ${identityToken}`
|
|
10305
10309
|
};
|
|
@@ -10345,6 +10349,7 @@ function setVersionInFiles(root, oldVer, newVer) {
|
|
|
10345
10349
|
async function publish(options) {
|
|
10346
10350
|
const root = process.cwd();
|
|
10347
10351
|
const yes = options?.yes ?? false;
|
|
10352
|
+
const wantPrivate = options?.private ?? false;
|
|
10348
10353
|
if (!exists(root)) {
|
|
10349
10354
|
console.error(source_default.red("No space.manifest.json found in current directory"));
|
|
10350
10355
|
process.exit(1);
|
|
@@ -10434,6 +10439,12 @@ async function publish(options) {
|
|
|
10434
10439
|
console.log(source_default.dim(" (Org Settings \u2192 Developer), then re-run this command."));
|
|
10435
10440
|
console.log();
|
|
10436
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
|
+
}
|
|
10437
10448
|
console.log();
|
|
10438
10449
|
console.log(` Space: ${source_default.cyan(m.name)}`);
|
|
10439
10450
|
console.log(` Version: ${source_default.cyan("v" + m.version)}`);
|
|
@@ -10445,6 +10456,7 @@ async function publish(options) {
|
|
|
10445
10456
|
} else if (creds.user) {
|
|
10446
10457
|
console.log(` Author: ${source_default.dim(creds.user.name)}`);
|
|
10447
10458
|
}
|
|
10459
|
+
console.log(` Audience: ${wantPrivate ? source_default.magenta("org-private") : source_default.cyan("public")}`);
|
|
10448
10460
|
console.log();
|
|
10449
10461
|
if (!yes) {
|
|
10450
10462
|
const proceed = await dist_default4({
|
|
@@ -10468,7 +10480,7 @@ async function publish(options) {
|
|
|
10468
10480
|
}
|
|
10469
10481
|
const uploadSpinner = ora("Uploading & building...").start();
|
|
10470
10482
|
try {
|
|
10471
|
-
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 });
|
|
10472
10484
|
unlinkSync2(tarballPath);
|
|
10473
10485
|
gitSafe(root, "tag", `v${m.version}`);
|
|
10474
10486
|
gitSafe(root, "push", "origin", `v${m.version}`);
|
|
@@ -10628,7 +10640,7 @@ function check() {
|
|
|
10628
10640
|
|
|
10629
10641
|
// src/commands/clean.ts
|
|
10630
10642
|
init_source();
|
|
10631
|
-
import { rmSync, existsSync as existsSync14 } from "fs";
|
|
10643
|
+
import { rmSync as rmSync2, existsSync as existsSync14 } from "fs";
|
|
10632
10644
|
import { join as join17 } from "path";
|
|
10633
10645
|
function clean(options) {
|
|
10634
10646
|
const root = process.cwd();
|
|
@@ -10640,7 +10652,7 @@ function clean(options) {
|
|
|
10640
10652
|
for (const dir of dirs) {
|
|
10641
10653
|
const path = join17(root, dir);
|
|
10642
10654
|
if (existsSync14(path)) {
|
|
10643
|
-
|
|
10655
|
+
rmSync2(path, { recursive: true });
|
|
10644
10656
|
console.log(source_default.dim(` Removed ${dir}/`));
|
|
10645
10657
|
}
|
|
10646
10658
|
}
|
|
@@ -10648,7 +10660,7 @@ function clean(options) {
|
|
|
10648
10660
|
for (const file of lockfiles) {
|
|
10649
10661
|
const path = join17(root, file);
|
|
10650
10662
|
if (existsSync14(path)) {
|
|
10651
|
-
|
|
10663
|
+
rmSync2(path);
|
|
10652
10664
|
console.log(source_default.dim(` Removed ${file}`));
|
|
10653
10665
|
}
|
|
10654
10666
|
}
|
|
@@ -11419,7 +11431,7 @@ function graphFork(newSpaceID) {
|
|
|
11419
11431
|
// package.json
|
|
11420
11432
|
var package_default = {
|
|
11421
11433
|
name: "@construct-space/cli",
|
|
11422
|
-
version: "1.7.
|
|
11434
|
+
version: "1.7.4",
|
|
11423
11435
|
description: "Construct CLI \u2014 scaffold, build, develop, and publish spaces",
|
|
11424
11436
|
type: "module",
|
|
11425
11437
|
bin: {
|
|
@@ -11471,7 +11483,7 @@ program2.command("scaffold [name]").alias("new").alias("create").description("Cr
|
|
|
11471
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));
|
|
11472
11484
|
program2.command("dev").description("Start dev mode with file watching and live reload").action(async () => dev());
|
|
11473
11485
|
program2.command("install").alias("run").description("Install built space to Construct spaces directory").action(() => install());
|
|
11474
|
-
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));
|
|
11475
11487
|
program2.command("validate").description("Validate space.manifest.json").action(() => validate3());
|
|
11476
11488
|
program2.command("check").description("Run type-check (vue-tsc) and linter (eslint)").action(() => check());
|
|
11477
11489
|
program2.command("clean").description("Remove build artifacts").option("--all", "Also remove node_modules and lockfiles").action((opts) => clean(opts));
|
|
@@ -11502,7 +11514,7 @@ space.command("scaffold [name]").alias("new").alias("create").option("--with-tes
|
|
|
11502
11514
|
space.command("build").option("--entry-only").action(async (opts) => build(opts));
|
|
11503
11515
|
space.command("dev").action(async () => dev());
|
|
11504
11516
|
space.command("install").alias("run").action(() => install());
|
|
11505
|
-
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));
|
|
11506
11518
|
space.command("validate").action(() => validate3());
|
|
11507
11519
|
space.command("check").action(() => check());
|
|
11508
11520
|
space.command("clean").option("--all").action((opts) => clean(opts));
|