@construct-space/cli 1.4.2 → 1.4.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 +65 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -10485,15 +10485,30 @@ function update() {
10485
10485
  const rt = detect();
10486
10486
  try {
10487
10487
  if (rt.name === "bun") {
10488
- execSync5(`bun install -g ${PKG_NAME}@latest`, { stdio: "inherit" });
10488
+ try {
10489
+ execSync5("bun pm cache rm", { stdio: "inherit" });
10490
+ } catch {}
10491
+ execSync5(`bun install -g ${PKG_NAME}@${latest}`, { stdio: "inherit" });
10489
10492
  } else {
10490
- execSync5(`npm install -g ${PKG_NAME}@latest`, { stdio: "inherit" });
10493
+ execSync5(`npm install -g --prefer-online ${PKG_NAME}@${latest}`, { stdio: "inherit" });
10491
10494
  }
10492
- console.log(source_default.green(`Updated to v${latest}`));
10493
10495
  } catch (err) {
10494
10496
  console.error(source_default.red(`Update failed: ${err.message}`));
10495
10497
  process.exit(1);
10496
10498
  }
10499
+ try {
10500
+ const installed = execSync5(`${rt.name === "bun" ? "bun" : "npm"} ${rt.name === "bun" ? "pm ls -g" : "ls -g --depth=0"} ${PKG_NAME}`, { encoding: "utf-8" });
10501
+ const match = installed.match(new RegExp(PKG_NAME.replace(/[.*+?^${}()|[\]\\]/g, "\\$&") + "@(\\d[^\\s]*)"));
10502
+ const resolved = match ? match[1] : "unknown";
10503
+ if (resolved && resolved !== latest) {
10504
+ console.warn(source_default.yellow(`Installed ${resolved} but expected ${latest}.`));
10505
+ console.warn(source_default.dim(" Try: bun pm cache rm && bun install -g " + PKG_NAME + "@" + latest));
10506
+ return;
10507
+ }
10508
+ console.log(source_default.green(`Updated to v${latest}`));
10509
+ } catch {
10510
+ console.log(source_default.green(`Updated to v${latest}`));
10511
+ }
10497
10512
  }
10498
10513
 
10499
10514
  // src/commands/graph/init.ts
@@ -11052,9 +11067,55 @@ function parseModelFields(content, fileName) {
11052
11067
  }
11053
11068
  return { name: modelMatch[1], fields };
11054
11069
  }
11070
+ // package.json
11071
+ var package_default = {
11072
+ name: "@construct-space/cli",
11073
+ version: "1.4.4",
11074
+ description: "Construct CLI \u2014 scaffold, build, develop, and publish spaces",
11075
+ type: "module",
11076
+ bin: {
11077
+ construct: "dist/index.js"
11078
+ },
11079
+ exports: {
11080
+ ".": {
11081
+ import: "./dist/index.js"
11082
+ }
11083
+ },
11084
+ files: [
11085
+ "dist",
11086
+ "templates"
11087
+ ],
11088
+ scripts: {
11089
+ build: "bun build src/index.ts --outdir dist --target bun --format esm && cp -r templates dist/",
11090
+ dev: "bun run src/index.ts",
11091
+ test: "bun test",
11092
+ typecheck: "tsc --noEmit"
11093
+ },
11094
+ dependencies: {
11095
+ commander: "^14.0.3",
11096
+ "@inquirer/prompts": "^8.3.2",
11097
+ chalk: "^5.6.2",
11098
+ ora: "^9.3.0",
11099
+ chokidar: "^5.0.0"
11100
+ },
11101
+ devDependencies: {
11102
+ "@types/bun": "latest",
11103
+ typescript: "^6.0.2"
11104
+ },
11105
+ keywords: [
11106
+ "construct",
11107
+ "cli",
11108
+ "space",
11109
+ "graph"
11110
+ ],
11111
+ author: {
11112
+ name: "Construct Team"
11113
+ },
11114
+ license: "MIT"
11115
+ };
11055
11116
 
11056
11117
  // src/index.ts
11057
- var VERSION = "1.3.1";
11118
+ var VERSION = package_default.version;
11058
11119
  var program2 = new Command;
11059
11120
  program2.name("construct").description("Construct CLI \u2014 scaffold, build, develop, and publish spaces").version(VERSION);
11060
11121
  program2.command("scaffold [name]").alias("new").alias("create").description("Create a new Construct space project").option("--with-tests", "Include E2E testing boilerplate").option("--full", "Full preset: multiple pages, extra skills, widget templates").action(async (name, opts) => scaffold(name, opts));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@construct-space/cli",
3
- "version": "1.4.2",
3
+ "version": "1.4.4",
4
4
  "description": "Construct CLI — scaffold, build, develop, and publish spaces",
5
5
  "type": "module",
6
6
  "bin": {