@cimplify/cli 0.7.21 → 0.7.23

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.
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { gitDetectRoot, gitCurrentBranch, gitCurrentSha, gitStatusPorcelain } from './chunk-K5464A3L.mjs';
3
3
  import { parseEnvFile } from './chunk-DBZ3UOQ2.mjs';
4
- import { package_default } from './chunk-IJMD2ND5.mjs';
4
+ import { package_default } from './chunk-TKFUMOQQ.mjs';
5
5
  import { parseArgs } from './chunk-C4M3DXKC.mjs';
6
6
  import { readAuthOrNull, readProjectLinkOrNull, readProjectState } from './chunk-UBAI443T.mjs';
7
7
  import { bold, dim, yellow, green, info, result, red } from './chunk-E2T2SBP5.mjs';
@@ -2,7 +2,7 @@
2
2
  // package.json
3
3
  var package_default = {
4
4
  name: "@cimplify/cli",
5
- version: "0.7.21",
5
+ version: "0.7.23",
6
6
  description: "Cimplify CLI \u2014 deploy, manage env vars, link projects, and scaffold storefronts",
7
7
  keywords: [
8
8
  "cimplify",
@@ -47,7 +47,7 @@ var package_default = {
47
47
  vitest: "^4.1.5"
48
48
  },
49
49
  dependencies: {
50
- "@cimplify/sdk": "^0.80.0"
50
+ "@cimplify/sdk": "^0.84.0"
51
51
  }
52
52
  };
53
53
 
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { TEMPLATES } from './chunk-TIOFFYPC.mjs';
3
- import { package_default } from './chunk-IJMD2ND5.mjs';
2
+ import { package_default } from './chunk-TKFUMOQQ.mjs';
3
+ import { TEMPLATES } from './chunk-5VJ5VV27.mjs';
4
4
 
5
5
  // src/dispatcher.ts
6
6
  var VERSION = package_default.version ?? "unknown";
@@ -33,6 +33,8 @@ Deploy:
33
33
  cimplify status Show the latest deployment for the linked project
34
34
  cimplify logs [flags] Stream build logs for the latest (or given) deployment
35
35
  cimplify dev [--remote] Run your project's dev script (optionally with prod env)
36
+ cimplify mock [flags] Boot the local Cimplify API mock (custom seeds welcome)
37
+ cimplify mock init [--from <seed>] Scaffold a cimplify.seed.ts (or --format json) to customise
36
38
 
37
39
  Env vars:
38
40
  cimplify env ls [--scope=<s>] List env vars (default scope: preview)
@@ -120,8 +122,11 @@ Logs flags:
120
122
  --deployment <id> Override which deployment to read (default: latest)
121
123
  --follow Poll until the deployment terminates
122
124
 
123
- Need the mock storefront server? It ships with @cimplify/sdk:
124
- bunx @cimplify/sdk mock [flags] Boot the local Cimplify API mock
125
+ Local mock server (custom demo data, no fork needed):
126
+ cimplify mock [flags] Boot the mock (auto-loads ./cimplify.seed.{ts,json})
127
+ cimplify mock init --from retail Scaffold an editable seed to start from a built-in
128
+ cimplify mock --seed-file demo.json Boot from a JSON snapshot (--dump one to create it)
129
+ cimplify mock --seed-module ./seed.ts Boot from a seed module (defineSeed from @cimplify/sdk/mock)
125
130
  `;
126
131
  var COMMANDS = {
127
132
  login: () => import('./login-3OD4ND2H.mjs'),
@@ -138,16 +143,17 @@ var COMMANDS = {
138
143
  logs: () => import('./logs-YNN2PQ24.mjs'),
139
144
  status: () => import('./status-JSYXM5RT.mjs'),
140
145
  dev: () => import('./dev-ONW2S77K.mjs'),
141
- introspect: () => import('./introspect-XV4JT4C6.mjs'),
146
+ mock: () => import('./mock-TSUKCLWU.mjs'),
147
+ introspect: () => import('./introspect-XL6Y35PZ.mjs'),
142
148
  inspect: () => import('./inspect-CGYX4DDF.mjs'),
143
- doctor: () => import('./doctor-KQZXXPTK.mjs'),
144
- explain: () => import('./explain-OUHZKG5D.mjs'),
149
+ doctor: () => import('./doctor-ARURW6E5.mjs'),
150
+ explain: () => import('./explain-Z4FKFZOA.mjs'),
145
151
  assets: () => import('./assets-74SK63TR.mjs'),
146
152
  repo: () => import('./repo-KNQMSPVV.mjs'),
147
- list: () => import('./list-DYDJKABB.mjs'),
148
- add: () => import('./add-2SMF46YU.mjs'),
149
- update: () => import('./update-RYIYFUEU.mjs'),
150
- upgrade: () => import('./update-RYIYFUEU.mjs'),
153
+ list: () => import('./list-EZTRRY4Z.mjs'),
154
+ add: () => import('./add-LABPJFW7.mjs'),
155
+ update: () => import('./update-6NCPLWGV.mjs'),
156
+ upgrade: () => import('./update-6NCPLWGV.mjs'),
151
157
  "auth-step-up": () => import('./auth-step-up-BIUYQJP6.mjs')
152
158
  };
153
159
  var COMMAND_PREFIXES = {
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import { gatherIntrospection } from './chunk-HFTJPRLH.mjs';
2
+ import { gatherIntrospection } from './chunk-FIMXBNN3.mjs';
3
3
  import './chunk-K5464A3L.mjs';
4
4
  import './chunk-DBZ3UOQ2.mjs';
5
- import './chunk-IJMD2ND5.mjs';
5
+ import './chunk-TKFUMOQQ.mjs';
6
6
  import { parseArgs, flagBool } from './chunk-C4M3DXKC.mjs';
7
7
  import { ApiClient } from './chunk-MAOO6ZZ5.mjs';
8
8
  import { readAuthOrNull } from './chunk-UBAI443T.mjs';
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { package_default } from './chunk-IJMD2ND5.mjs';
2
+ import { package_default } from './chunk-TKFUMOQQ.mjs';
3
3
  import { parseArgs } from './chunk-C4M3DXKC.mjs';
4
4
  import { bold, dim, info, result, CliError, CLI_ERROR_CODE } from './chunk-E2T2SBP5.mjs';
5
5
 
@@ -178,7 +178,7 @@ var TOPICS = [
178
178
  "title": "seeds",
179
179
  "description": "Available mock seeds and how to switch between them",
180
180
  "source_url": "https://cimplify.dev/docs/cli/mock",
181
- "body": '## Mock seeds\n\nEvery Cimplify storefront ships with a local Hono mock backed by one of\nthese seeds. Switch with `cimplify mock seed <name>` (or hand-edit the\n`--seed` flag in your `package.json` `scripts.dev`).\n\n| Seed | Notes |\n| --- | --- |\n| `auto` | (no description) |\n| `default` | Generic small business \u2014 minimal fixtures |\n| `empty` | No data \u2014 for blank-slate testing |\n| `fashion` | Apparel with multi-axis variants (size, color) |\n| `grocery` | High-SKU produce + perishables |\n| `pharmacy` | Wellspring Apothecary \u2014 health products with regulated metadata |\n| `reesa-storefront` | Reesa-specific demo storefront |\n| `restaurant` | Menu-driven with reservations |\n| `retail` | Electronics-focused storefront with variants and add-ons |\n| `services` | Bookable services (e.g. salon, spa) |\n\n### Finding fixture IDs\n\nEach seed is a TypeScript file at `packages/sdk/src/mock/seeds/<name>.ts`\nin the cimplify monorepo. Product slugs, categories, and variant axes\nare defined inline. Grep that file when you need a real slug for a\nhard-coded demo:\n\n```bash\ngrep "slug:" node_modules/@cimplify/sdk/dist/mock/seeds/<name>.* | head\n```\n\nA future `cimplify mock products ls --json` will surface these IDs\ndirectly without grep.\n'
181
+ "body": '## Mock seeds\n\nEvery Cimplify storefront ships with a local Hono mock backed by one of\nthese seeds. Switch with `cimplify mock seed <name>` (or hand-edit the\n`--seed` flag in your `package.json` `scripts.dev`).\n\n| Seed | Notes |\n| --- | --- |\n| `auto` | (no description) |\n| `context` | (no description) |\n| `default` | Generic small business \u2014 minimal fixtures |\n| `empty` | No data \u2014 for blank-slate testing |\n| `fashion` | Apparel with multi-axis variants (size, color) |\n| `grocery` | High-SKU produce + perishables |\n| `pharmacy` | Wellspring Apothecary \u2014 health products with regulated metadata |\n| `reesa-storefront` | Reesa-specific demo storefront |\n| `restaurant` | Menu-driven with reservations |\n| `retail` | Electronics-focused storefront with variants and add-ons |\n| `services` | Bookable services (e.g. salon, spa) |\n| `source` | (no description) |\n\n### Finding fixture IDs\n\nEach seed is a TypeScript file at `packages/sdk/src/mock/seeds/<name>.ts`\nin the cimplify monorepo. Product slugs, categories, and variant axes\nare defined inline. Grep that file when you need a real slug for a\nhard-coded demo:\n\n```bash\ngrep "slug:" node_modules/@cimplify/sdk/dist/mock/seeds/<name>.* | head\n```\n\nA future `cimplify mock products ls --json` will surface these IDs\ndirectly without grep.\n'
182
182
  }
183
183
  ];
184
184
  var TOPICS_BY_NAME = Object.fromEntries(
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
- export { run as default, extractMockSeed, gatherIntrospection, renderIntrospection } from './chunk-HFTJPRLH.mjs';
2
+ export { run as default, extractMockSeed, gatherIntrospection, renderIntrospection } from './chunk-FIMXBNN3.mjs';
3
3
  import './chunk-K5464A3L.mjs';
4
4
  import './chunk-DBZ3UOQ2.mjs';
5
- import './chunk-IJMD2ND5.mjs';
5
+ import './chunk-TKFUMOQQ.mjs';
6
6
  import './chunk-C4M3DXKC.mjs';
7
7
  import './chunk-UBAI443T.mjs';
8
8
  import './chunk-E2T2SBP5.mjs';
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { REGISTRY_INDEX } from './chunk-TIOFFYPC.mjs';
2
+ import { REGISTRY_INDEX } from './chunk-5VJ5VV27.mjs';
3
3
  import { parseArgs, flagBool } from './chunk-C4M3DXKC.mjs';
4
4
  import { CliError, CLI_ERROR_CODE, info, bold, dim, green, result } from './chunk-E2T2SBP5.mjs';
5
5
 
@@ -0,0 +1,96 @@
1
+ #!/usr/bin/env node
2
+ import { parseArgs, flagString, flagBool } from './chunk-C4M3DXKC.mjs';
3
+ import { CliError, CLI_ERROR_CODE, info, dim } from './chunk-E2T2SBP5.mjs';
4
+ import { spawn } from 'child_process';
5
+ import { existsSync, writeFileSync } from 'fs';
6
+ import path from 'path';
7
+
8
+ var MOCK_BIN = "cimplify-mock";
9
+ var SDK_PACKAGE = "@cimplify/sdk";
10
+ var SEED_FILE_TS = "cimplify.seed.ts";
11
+ var SEED_FILE_JSON = "cimplify.seed.json";
12
+ var DEFAULT_FROM = "default";
13
+ function findLocalMockBin(start) {
14
+ let dir = start;
15
+ for (; ; ) {
16
+ const candidate = path.join(dir, "node_modules", ".bin", MOCK_BIN);
17
+ if (existsSync(candidate)) return candidate;
18
+ const parent = path.dirname(dir);
19
+ if (parent === dir) return null;
20
+ dir = parent;
21
+ }
22
+ }
23
+ function spawnMock(args) {
24
+ const local = findLocalMockBin(process.cwd());
25
+ const cmd = local ?? "npx";
26
+ const cmdArgs = local ? args : ["-y", "-p", SDK_PACKAGE, MOCK_BIN, ...args];
27
+ return new Promise((resolve, reject) => {
28
+ const child = spawn(cmd, cmdArgs, { cwd: process.cwd(), stdio: "inherit" });
29
+ child.on(
30
+ "error",
31
+ (err) => reject(
32
+ new CliError(CLI_ERROR_CODE.INVALID_INPUT, `Failed to start the mock server: ${err.message}`, {
33
+ remediation: local ? void 0 : `Install the SDK first: \`bun add ${SDK_PACKAGE}\``
34
+ })
35
+ )
36
+ );
37
+ child.on("close", (code) => {
38
+ process.exitCode = code ?? 0;
39
+ resolve();
40
+ });
41
+ });
42
+ }
43
+ function seedTemplate(from) {
44
+ return `import { defineSeed } from "${SDK_PACKAGE}/mock";
45
+
46
+ /**
47
+ * Local mock seed. The mock server picks this file up automatically
48
+ * (run \`cimplify mock\`), or point at it with \`--seed-module\`.
49
+ */
50
+ export default defineSeed((ctx) => {
51
+ // Start from a built-in seed, then customise from there.
52
+ const { businessId } = ctx.extend("${from}");
53
+
54
+ // Or start from scratch instead of extending:
55
+ // const biz = ctx.business({ name: "Akua's Bakery", handle: "akua", default_currency: "GHS" });
56
+ // const breads = ctx.category({ name: "Breads" });
57
+ // ctx.product({ name: "Sourdough", price: "25.00", category: breads,
58
+ // image: ctx.image("bakery", "sourdough-loaf") });
59
+ // return { businessId: biz.id };
60
+
61
+ return { businessId };
62
+ });
63
+ `;
64
+ }
65
+ async function runInit(rest) {
66
+ const args = parseArgs(rest);
67
+ const from = flagString(args, "from") ?? DEFAULT_FROM;
68
+ const format = flagString(args, "format") ?? "ts";
69
+ const force = flagBool(args, "force");
70
+ const cwd = process.cwd();
71
+ if (format !== "ts" && format !== "json") {
72
+ throw new CliError(CLI_ERROR_CODE.INVALID_INPUT, `--format must be "ts" or "json" (got "${format}").`);
73
+ }
74
+ const target = format === "json" ? SEED_FILE_JSON : SEED_FILE_TS;
75
+ if (existsSync(path.join(cwd, target)) && !force) {
76
+ throw new CliError(CLI_ERROR_CODE.INVALID_INPUT, `${target} already exists. Pass --force to overwrite.`);
77
+ }
78
+ if (format === "json") {
79
+ await spawnMock(["--seed", from, "--dump", target]);
80
+ info(`Wrote ${target} from the "${from}" seed.`);
81
+ info(dim(`Edit it, then run: cimplify mock --seed-file ${target}`));
82
+ return;
83
+ }
84
+ writeFileSync(path.join(cwd, target), seedTemplate(from), "utf8");
85
+ info(`Wrote ${target} (extends the "${from}" seed).`);
86
+ info(dim("Edit it, then run: cimplify mock"));
87
+ }
88
+ async function run(argv) {
89
+ const [sub, ...rest] = argv;
90
+ if (sub === "init") {
91
+ return runInit(rest);
92
+ }
93
+ return spawnMock(argv);
94
+ }
95
+
96
+ export { run as default };
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { package_default } from './chunk-IJMD2ND5.mjs';
2
+ import { package_default } from './chunk-TKFUMOQQ.mjs';
3
3
  import { promptYesNo } from './chunk-ITAFAORS.mjs';
4
4
  import { parseArgs, flagBool, flagString } from './chunk-C4M3DXKC.mjs';
5
5
  import { success, bold, info, dim, result, failure, CliError, CLI_ERROR_CODE, step, isJsonMode } from './chunk-E2T2SBP5.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cimplify/cli",
3
- "version": "0.7.21",
3
+ "version": "0.7.23",
4
4
  "description": "Cimplify CLI — deploy, manage env vars, link projects, and scaffold storefronts",
5
5
  "keywords": [
6
6
  "cimplify",
@@ -45,6 +45,6 @@
45
45
  "vitest": "^4.1.5"
46
46
  },
47
47
  "dependencies": {
48
- "@cimplify/sdk": "^0.80.0"
48
+ "@cimplify/sdk": "^0.84.0"
49
49
  }
50
50
  }
@@ -17,7 +17,7 @@
17
17
  "check": "bun run typecheck && bun run test:run"
18
18
  },
19
19
  "dependencies": {
20
- "@cimplify/sdk": "^0.80.0",
20
+ "@cimplify/sdk": "^0.84.0",
21
21
  "next": "^16.2.6",
22
22
  "react": "^19.0.0",
23
23
  "react-dom": "^19.0.0"
@@ -17,7 +17,7 @@
17
17
  "check": "bun run typecheck && bun run test:run"
18
18
  },
19
19
  "dependencies": {
20
- "@cimplify/sdk": "^0.80.0",
20
+ "@cimplify/sdk": "^0.84.0",
21
21
  "next": "^16.2.6",
22
22
  "react": "^19.0.0",
23
23
  "react-dom": "^19.0.0"
@@ -19,7 +19,7 @@
19
19
  "check": "bun run typecheck && bun run test:run"
20
20
  },
21
21
  "dependencies": {
22
- "@cimplify/sdk": "^0.80.0",
22
+ "@cimplify/sdk": "^0.84.0",
23
23
  "next": "^16.2.6",
24
24
  "react": "^19.0.0",
25
25
  "react-dom": "^19.0.0"
@@ -17,7 +17,7 @@
17
17
  "check": "bun run typecheck && bun run test:run"
18
18
  },
19
19
  "dependencies": {
20
- "@cimplify/sdk": "^0.80.0",
20
+ "@cimplify/sdk": "^0.84.0",
21
21
  "next": "^16.2.6",
22
22
  "react": "^19.0.0",
23
23
  "react-dom": "^19.0.0"
@@ -17,7 +17,7 @@
17
17
  "check": "bun run typecheck && bun run test:run"
18
18
  },
19
19
  "dependencies": {
20
- "@cimplify/sdk": "^0.80.0",
20
+ "@cimplify/sdk": "^0.84.0",
21
21
  "next": "^16.2.6",
22
22
  "react": "^19.0.0",
23
23
  "react-dom": "^19.0.0"
@@ -17,7 +17,7 @@
17
17
  "check": "bun run typecheck && bun run test:run"
18
18
  },
19
19
  "dependencies": {
20
- "@cimplify/sdk": "^0.80.0",
20
+ "@cimplify/sdk": "^0.84.0",
21
21
  "next": "^16.2.6",
22
22
  "react": "^19.0.0",
23
23
  "react-dom": "^19.0.0"
@@ -17,7 +17,7 @@
17
17
  "check": "bun run typecheck && bun run test:run"
18
18
  },
19
19
  "dependencies": {
20
- "@cimplify/sdk": "^0.80.0",
20
+ "@cimplify/sdk": "^0.84.0",
21
21
  "next": "^16.2.6",
22
22
  "react": "^19.0.0",
23
23
  "react-dom": "^19.0.0"
@@ -17,7 +17,7 @@
17
17
  "check": "bun run typecheck && bun run test:run"
18
18
  },
19
19
  "dependencies": {
20
- "@cimplify/sdk": "^0.80.0",
20
+ "@cimplify/sdk": "^0.84.0",
21
21
  "next": "^16.2.6",
22
22
  "react": "^19.0.0",
23
23
  "react-dom": "^19.0.0"