@construct-space/cli 1.7.4 → 1.7.6

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 CHANGED
@@ -10304,6 +10304,9 @@ async function uploadSource(portalURL, identityToken, publisherKey, tarballPath,
10304
10304
  if (opts.private) {
10305
10305
  formData.append("private", "true");
10306
10306
  }
10307
+ if (opts.public) {
10308
+ formData.append("public", "true");
10309
+ }
10307
10310
  const headers = {
10308
10311
  Authorization: `Bearer ${identityToken}`
10309
10312
  };
@@ -10321,7 +10324,14 @@ async function uploadSource(portalURL, identityToken, publisherKey, tarballPath,
10321
10324
  }
10322
10325
  if (resp.status === 403) {
10323
10326
  let msg = result.error || "You are not the owner of this space";
10324
- if (result.owner_user_id) {
10327
+ if (result.owner_kind === "org") {
10328
+ const label = result.owner_name ? `${result.owner_name} (org${result.owner_org_id ? `: ${result.owner_org_id}` : ""})` : result.owner_org_id || "unknown org";
10329
+ msg += `
10330
+ Owned by: ${label}`;
10331
+ } else if (result.owner_name) {
10332
+ msg += `
10333
+ Owned by: ${result.owner_name}${result.owner_user_id ? ` (${result.owner_user_id})` : ""}`;
10334
+ } else if (result.owner_user_id) {
10325
10335
  msg += `
10326
10336
  Current owner: ${result.owner_user_id}`;
10327
10337
  }
@@ -10350,6 +10360,11 @@ async function publish(options) {
10350
10360
  const root = process.cwd();
10351
10361
  const yes = options?.yes ?? false;
10352
10362
  const wantPrivate = options?.private ?? false;
10363
+ const wantPublic = options?.public ?? false;
10364
+ if (wantPrivate && wantPublic) {
10365
+ console.error(source_default.red("Cannot combine --private and --public. Pick one."));
10366
+ process.exit(1);
10367
+ }
10353
10368
  if (!exists(root)) {
10354
10369
  console.error(source_default.red("No space.manifest.json found in current directory"));
10355
10370
  process.exit(1);
@@ -10456,7 +10471,13 @@ async function publish(options) {
10456
10471
  } else if (creds.user) {
10457
10472
  console.log(` Author: ${source_default.dim(creds.user.name)}`);
10458
10473
  }
10459
- console.log(` Audience: ${wantPrivate ? source_default.magenta("org-private") : source_default.cyan("public")}`);
10474
+ if (wantPrivate) {
10475
+ console.log(` Audience: ${source_default.magenta("org-private")} ${source_default.dim("(--private)")}`);
10476
+ } else if (wantPublic) {
10477
+ console.log(` Audience: ${source_default.cyan("public")} ${source_default.dim("(--public; flips a previously-private space)")}`);
10478
+ } else {
10479
+ console.log(` Audience: ${source_default.dim("preserved (default public on first publish, sticky on update)")}`);
10480
+ }
10460
10481
  console.log();
10461
10482
  if (!yes) {
10462
10483
  const proceed = await dist_default4({
@@ -10480,7 +10501,7 @@ async function publish(options) {
10480
10501
  }
10481
10502
  const uploadSpinner = ora("Uploading & building...").start();
10482
10503
  try {
10483
- const result = await uploadSource(creds.portal, creds.token, creds.publisherKey, tarballPath, m, { private: wantPrivate });
10504
+ const result = await uploadSource(creds.portal, creds.token, creds.publisherKey, tarballPath, m, { private: wantPrivate, public: wantPublic });
10484
10505
  unlinkSync2(tarballPath);
10485
10506
  gitSafe(root, "tag", `v${m.version}`);
10486
10507
  gitSafe(root, "push", "origin", `v${m.version}`);
@@ -11131,7 +11152,12 @@ async function graphPush() {
11131
11152
  try {
11132
11153
  const errBody = await resp.json();
11133
11154
  console.error(source_default.red(` ${errBody.error || "You are not the owner of this space"}`));
11134
- if (errBody.owner_user_id) {
11155
+ if (errBody.owner_kind === "org") {
11156
+ const label = errBody.owner_name ? `${errBody.owner_name} (org${errBody.owner_org_id ? `: ${errBody.owner_org_id}` : ""})` : errBody.owner_org_id || "unknown org";
11157
+ console.error(source_default.dim(` Owned by: ${label}`));
11158
+ } else if (errBody.owner_name) {
11159
+ console.error(source_default.dim(` Owned by: ${errBody.owner_name}${errBody.owner_user_id ? ` (${errBody.owner_user_id})` : ""}`));
11160
+ } else if (errBody.owner_user_id) {
11135
11161
  console.error(source_default.dim(` Current owner: ${errBody.owner_user_id}`));
11136
11162
  }
11137
11163
  console.error(source_default.dim(" Fork to a new space_id to publish your own version."));
@@ -11431,7 +11457,7 @@ function graphFork(newSpaceID) {
11431
11457
  // package.json
11432
11458
  var package_default = {
11433
11459
  name: "@construct-space/cli",
11434
- version: "1.7.4",
11460
+ version: "1.7.6",
11435
11461
  description: "Construct CLI \u2014 scaffold, build, develop, and publish spaces",
11436
11462
  type: "module",
11437
11463
  bin: {
@@ -11483,7 +11509,7 @@ program2.command("scaffold [name]").alias("new").alias("create").description("Cr
11483
11509
  program2.command("build").description("Build the space (generate entry + run Vite)").option("--entry-only", "Only generate src/entry.ts").action(async (opts) => build(opts));
11484
11510
  program2.command("dev").description("Start dev mode with file watching and live reload").action(async () => dev());
11485
11511
  program2.command("install").alias("run").description("Install built space to Construct spaces directory").action(() => install());
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));
11512
+ 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));
11487
11513
  program2.command("validate").description("Validate space.manifest.json").action(() => validate3());
11488
11514
  program2.command("check").description("Run type-check (vue-tsc) and linter (eslint)").action(() => check());
11489
11515
  program2.command("clean").description("Remove build artifacts").option("--all", "Also remove node_modules and lockfiles").action((opts) => clean(opts));
@@ -11514,7 +11540,7 @@ space.command("scaffold [name]").alias("new").alias("create").option("--with-tes
11514
11540
  space.command("build").option("--entry-only").action(async (opts) => build(opts));
11515
11541
  space.command("dev").action(async () => dev());
11516
11542
  space.command("install").alias("run").action(() => install());
11517
- space.command("publish").option("-y, --yes").option("--bump <type>").option("--private").action(async (opts) => publish(opts));
11543
+ space.command("publish").option("-y, --yes").option("--bump <type>").option("--private").option("--public").action(async (opts) => publish(opts));
11518
11544
  space.command("validate").action(() => validate3());
11519
11545
  space.command("check").action(() => check());
11520
11546
  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
- "scope": "app | project | org", // org = multi-tenant per organization
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
- `scope: 'org'` makes everything multi-tenant — graph schemas auto-partition per org. Use `useOrg()` to read current org context.
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
 
@@ -7,7 +7,8 @@
7
7
  "name": "Your Name"
8
8
  },
9
9
  "icon": "i-lucide-box",
10
- "scope": "app",
10
+ "scopes": ["app"],
11
+ "projectAware": false,
11
12
  "minConstructVersion": "0.7.0",
12
13
  "navigation": {
13
14
  "label": "{{.DisplayName}}",
@@ -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": "^5.2.3",
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": "^6.3.5",
29
+ "vite": "^8.0.12",
30
30
  "vue-tsc": "^3.2.5"
31
31
  },
32
32
  "dependencies": {
33
- "@construct-space/graph": "^0.6.2",
34
- "@construct-space/ui": "^0.6.1"
33
+ "@construct-space/graph": "^0.7.1",
34
+ "@construct-space/ui": "^0.7.4"
35
35
  }
36
36
  }
@@ -7,7 +7,8 @@
7
7
  "name": "Your Name"
8
8
  },
9
9
  "icon": "i-lucide-box",
10
- "scope": "app",
10
+ "scopes": ["app"],
11
+ "projectAware": false,
11
12
  "minConstructVersion": "0.7.0",
12
13
  "navigation": {
13
14
  "label": "{{.DisplayName}}",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@construct-space/cli",
3
- "version": "1.7.4",
3
+ "version": "1.7.6",
4
4
  "description": "Construct CLI — scaffold, build, develop, and publish spaces",
5
5
  "type": "module",
6
6
  "bin": {
@@ -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
- "scope": "app | project | org", // org = multi-tenant per organization
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
- `scope: 'org'` makes everything multi-tenant — graph schemas auto-partition per org. Use `useOrg()` to read current org context.
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
 
@@ -7,7 +7,8 @@
7
7
  "name": "Your Name"
8
8
  },
9
9
  "icon": "i-lucide-box",
10
- "scope": "app",
10
+ "scopes": ["app"],
11
+ "projectAware": false,
11
12
  "minConstructVersion": "0.7.0",
12
13
  "navigation": {
13
14
  "label": "{{.DisplayName}}",
@@ -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": "^5.2.3",
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": "^6.3.5",
29
+ "vite": "^8.0.12",
30
30
  "vue-tsc": "^3.2.5"
31
31
  },
32
32
  "dependencies": {
33
- "@construct-space/graph": "^0.6.2",
34
- "@construct-space/ui": "^0.6.1"
33
+ "@construct-space/graph": "^0.7.1",
34
+ "@construct-space/ui": "^0.7.4"
35
35
  }
36
36
  }
@@ -7,7 +7,8 @@
7
7
  "name": "Your Name"
8
8
  },
9
9
  "icon": "i-lucide-box",
10
- "scope": "app",
10
+ "scopes": ["app"],
11
+ "projectAware": false,
11
12
  "minConstructVersion": "0.7.0",
12
13
  "navigation": {
13
14
  "label": "{{.DisplayName}}",