@construct-space/cli 1.7.3 → 1.7.5
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 +30 -5
- package/dist/templates/space/construct.md.tmpl +3 -2
- package/dist/templates/space/full/space.manifest.json.tmpl +2 -1
- package/dist/templates/space/package.json.tmpl +4 -4
- package/dist/templates/space/space.manifest.json.tmpl +2 -1
- package/package.json +1 -1
- package/templates/space/construct.md.tmpl +3 -2
- package/templates/space/full/space.manifest.json.tmpl +2 -1
- package/templates/space/package.json.tmpl +4 -4
- package/templates/space/space.manifest.json.tmpl +2 -1
package/dist/index.js
CHANGED
|
@@ -10295,12 +10295,18 @@ 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
|
+
}
|
|
10307
|
+
if (opts.public) {
|
|
10308
|
+
formData.append("public", "true");
|
|
10309
|
+
}
|
|
10304
10310
|
const headers = {
|
|
10305
10311
|
Authorization: `Bearer ${identityToken}`
|
|
10306
10312
|
};
|
|
@@ -10346,6 +10352,12 @@ function setVersionInFiles(root, oldVer, newVer) {
|
|
|
10346
10352
|
async function publish(options) {
|
|
10347
10353
|
const root = process.cwd();
|
|
10348
10354
|
const yes = options?.yes ?? false;
|
|
10355
|
+
const wantPrivate = options?.private ?? false;
|
|
10356
|
+
const wantPublic = options?.public ?? false;
|
|
10357
|
+
if (wantPrivate && wantPublic) {
|
|
10358
|
+
console.error(source_default.red("Cannot combine --private and --public. Pick one."));
|
|
10359
|
+
process.exit(1);
|
|
10360
|
+
}
|
|
10349
10361
|
if (!exists(root)) {
|
|
10350
10362
|
console.error(source_default.red("No space.manifest.json found in current directory"));
|
|
10351
10363
|
process.exit(1);
|
|
@@ -10435,6 +10447,12 @@ async function publish(options) {
|
|
|
10435
10447
|
console.log(source_default.dim(" (Org Settings \u2192 Developer), then re-run this command."));
|
|
10436
10448
|
console.log();
|
|
10437
10449
|
}
|
|
10450
|
+
if (wantPrivate && creds.publisherKind !== "org") {
|
|
10451
|
+
console.error(source_default.red("--private requires an org publisher key."));
|
|
10452
|
+
console.error(source_default.dim(" Personal publishes are always public."));
|
|
10453
|
+
console.error(source_default.dim(" Enrol an org from the desktop app (Org Settings \u2192 Developer) and re-run."));
|
|
10454
|
+
process.exit(1);
|
|
10455
|
+
}
|
|
10438
10456
|
console.log();
|
|
10439
10457
|
console.log(` Space: ${source_default.cyan(m.name)}`);
|
|
10440
10458
|
console.log(` Version: ${source_default.cyan("v" + m.version)}`);
|
|
@@ -10446,6 +10464,13 @@ async function publish(options) {
|
|
|
10446
10464
|
} else if (creds.user) {
|
|
10447
10465
|
console.log(` Author: ${source_default.dim(creds.user.name)}`);
|
|
10448
10466
|
}
|
|
10467
|
+
if (wantPrivate) {
|
|
10468
|
+
console.log(` Audience: ${source_default.magenta("org-private")} ${source_default.dim("(--private)")}`);
|
|
10469
|
+
} else if (wantPublic) {
|
|
10470
|
+
console.log(` Audience: ${source_default.cyan("public")} ${source_default.dim("(--public; flips a previously-private space)")}`);
|
|
10471
|
+
} else {
|
|
10472
|
+
console.log(` Audience: ${source_default.dim("preserved (default public on first publish, sticky on update)")}`);
|
|
10473
|
+
}
|
|
10449
10474
|
console.log();
|
|
10450
10475
|
if (!yes) {
|
|
10451
10476
|
const proceed = await dist_default4({
|
|
@@ -10469,7 +10494,7 @@ async function publish(options) {
|
|
|
10469
10494
|
}
|
|
10470
10495
|
const uploadSpinner = ora("Uploading & building...").start();
|
|
10471
10496
|
try {
|
|
10472
|
-
const result = await uploadSource(creds.portal, creds.token, creds.publisherKey, tarballPath, m);
|
|
10497
|
+
const result = await uploadSource(creds.portal, creds.token, creds.publisherKey, tarballPath, m, { private: wantPrivate, public: wantPublic });
|
|
10473
10498
|
unlinkSync2(tarballPath);
|
|
10474
10499
|
gitSafe(root, "tag", `v${m.version}`);
|
|
10475
10500
|
gitSafe(root, "push", "origin", `v${m.version}`);
|
|
@@ -11420,7 +11445,7 @@ function graphFork(newSpaceID) {
|
|
|
11420
11445
|
// package.json
|
|
11421
11446
|
var package_default = {
|
|
11422
11447
|
name: "@construct-space/cli",
|
|
11423
|
-
version: "1.7.
|
|
11448
|
+
version: "1.7.5",
|
|
11424
11449
|
description: "Construct CLI \u2014 scaffold, build, develop, and publish spaces",
|
|
11425
11450
|
type: "module",
|
|
11426
11451
|
bin: {
|
|
@@ -11472,7 +11497,7 @@ program2.command("scaffold [name]").alias("new").alias("create").description("Cr
|
|
|
11472
11497
|
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
11498
|
program2.command("dev").description("Start dev mode with file watching and live reload").action(async () => dev());
|
|
11474
11499
|
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));
|
|
11500
|
+
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.").option("--public", "Flip a previously-private space back to the public catalog on this publish. Without --private or --public, visibility is preserved on update (and defaults to public on first publish).").action(async (opts) => publish(opts));
|
|
11476
11501
|
program2.command("validate").description("Validate space.manifest.json").action(() => validate3());
|
|
11477
11502
|
program2.command("check").description("Run type-check (vue-tsc) and linter (eslint)").action(() => check());
|
|
11478
11503
|
program2.command("clean").description("Remove build artifacts").option("--all", "Also remove node_modules and lockfiles").action((opts) => clean(opts));
|
|
@@ -11503,7 +11528,7 @@ space.command("scaffold [name]").alias("new").alias("create").option("--with-tes
|
|
|
11503
11528
|
space.command("build").option("--entry-only").action(async (opts) => build(opts));
|
|
11504
11529
|
space.command("dev").action(async () => dev());
|
|
11505
11530
|
space.command("install").alias("run").action(() => install());
|
|
11506
|
-
space.command("publish").option("-y, --yes").option("--bump <type>").action(async (opts) => publish(opts));
|
|
11531
|
+
space.command("publish").option("-y, --yes").option("--bump <type>").option("--private").option("--public").action(async (opts) => publish(opts));
|
|
11507
11532
|
space.command("validate").action(() => validate3());
|
|
11508
11533
|
space.command("check").action(() => check());
|
|
11509
11534
|
space.command("clean").option("--all").action((opts) => clean(opts));
|
|
@@ -67,7 +67,8 @@ construct graph install <id> install a published space for current org
|
|
|
67
67
|
```jsonc
|
|
68
68
|
{
|
|
69
69
|
"id": "{{.ID}}",
|
|
70
|
-
"
|
|
70
|
+
"scopes": ["app"], // or ["org"], or ["app", "org"] for both
|
|
71
|
+
"projectAware": false, // true = also mounts inside projects
|
|
71
72
|
"minConstructVersion": "0.7.0",
|
|
72
73
|
"pages": [{ "path": "", "label": "Home", "default": true }],
|
|
73
74
|
"toolbar": [{ "id": "...", "icon": "...", "action": "createX" }],
|
|
@@ -78,7 +79,7 @@ construct graph install <id> install a published space for current org
|
|
|
78
79
|
}
|
|
79
80
|
```
|
|
80
81
|
|
|
81
|
-
`
|
|
82
|
+
`scopes: ['org']` makes everything multi-tenant — graph schemas auto-partition per org. Use `useOrg()` to read current org context. `projectAware: true` is the orthogonal flag for spaces that also live inside a project.
|
|
82
83
|
|
|
83
84
|
---
|
|
84
85
|
|
|
@@ -20,17 +20,17 @@
|
|
|
20
20
|
"@construct-space/cli": "latest",
|
|
21
21
|
"@construct-space/sdk": "latest",
|
|
22
22
|
"@eslint/js": "^10.0.1",
|
|
23
|
-
"@vitejs/plugin-vue": "^
|
|
23
|
+
"@vitejs/plugin-vue": "^6.0.6",
|
|
24
24
|
"eslint": "^10.2.1",
|
|
25
25
|
"eslint-plugin-vue": "^10.0.0",
|
|
26
26
|
"lucide-vue-next": "^1.0.0",
|
|
27
27
|
"typescript": "^5.9.3",
|
|
28
28
|
"typescript-eslint": "^8.0.0",
|
|
29
|
-
"vite": "^
|
|
29
|
+
"vite": "^8.0.12",
|
|
30
30
|
"vue-tsc": "^3.2.5"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@construct-space/graph": "^0.
|
|
34
|
-
"@construct-space/ui": "^0.
|
|
33
|
+
"@construct-space/graph": "^0.7.1",
|
|
34
|
+
"@construct-space/ui": "^0.7.4"
|
|
35
35
|
}
|
|
36
36
|
}
|
package/package.json
CHANGED
|
@@ -67,7 +67,8 @@ construct graph install <id> install a published space for current org
|
|
|
67
67
|
```jsonc
|
|
68
68
|
{
|
|
69
69
|
"id": "{{.ID}}",
|
|
70
|
-
"
|
|
70
|
+
"scopes": ["app"], // or ["org"], or ["app", "org"] for both
|
|
71
|
+
"projectAware": false, // true = also mounts inside projects
|
|
71
72
|
"minConstructVersion": "0.7.0",
|
|
72
73
|
"pages": [{ "path": "", "label": "Home", "default": true }],
|
|
73
74
|
"toolbar": [{ "id": "...", "icon": "...", "action": "createX" }],
|
|
@@ -78,7 +79,7 @@ construct graph install <id> install a published space for current org
|
|
|
78
79
|
}
|
|
79
80
|
```
|
|
80
81
|
|
|
81
|
-
`
|
|
82
|
+
`scopes: ['org']` makes everything multi-tenant — graph schemas auto-partition per org. Use `useOrg()` to read current org context. `projectAware: true` is the orthogonal flag for spaces that also live inside a project.
|
|
82
83
|
|
|
83
84
|
---
|
|
84
85
|
|
|
@@ -20,17 +20,17 @@
|
|
|
20
20
|
"@construct-space/cli": "latest",
|
|
21
21
|
"@construct-space/sdk": "latest",
|
|
22
22
|
"@eslint/js": "^10.0.1",
|
|
23
|
-
"@vitejs/plugin-vue": "^
|
|
23
|
+
"@vitejs/plugin-vue": "^6.0.6",
|
|
24
24
|
"eslint": "^10.2.1",
|
|
25
25
|
"eslint-plugin-vue": "^10.0.0",
|
|
26
26
|
"lucide-vue-next": "^1.0.0",
|
|
27
27
|
"typescript": "^5.9.3",
|
|
28
28
|
"typescript-eslint": "^8.0.0",
|
|
29
|
-
"vite": "^
|
|
29
|
+
"vite": "^8.0.12",
|
|
30
30
|
"vue-tsc": "^3.2.5"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@construct-space/graph": "^0.
|
|
34
|
-
"@construct-space/ui": "^0.
|
|
33
|
+
"@construct-space/graph": "^0.7.1",
|
|
34
|
+
"@construct-space/ui": "^0.7.4"
|
|
35
35
|
}
|
|
36
36
|
}
|