@cimplify/cli 0.2.0 → 0.2.2
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/{add-ZJQJZJEF.mjs → add-YJDP63WM.mjs} +2 -2
- package/dist/{chunk-TAMGCHIL.mjs → chunk-2BO4H6VP.mjs} +11 -3
- package/dist/{chunk-D7D75ONX.mjs → chunk-4SBJVRGM.mjs} +38 -0
- package/dist/chunk-O36TGF2L.mjs +48 -0
- package/dist/{chunk-XSWWWO6H.mjs → chunk-SN6E73KY.mjs} +11 -11
- package/dist/{chunk-MQMNWLMU.mjs → chunk-VE74N3YS.mjs} +0 -1
- package/dist/{chunk-5XH72JMJ.mjs → chunk-WLLH5HFI.mjs} +2 -2
- package/dist/{deploy-WCZOGMED.mjs → deploy-N3GTTUI5.mjs} +4 -4
- package/dist/{dev-4HKIXWXX.mjs → dev-ABPRBTPU.mjs} +2 -2
- package/dist/dispatcher.mjs +25 -20
- package/dist/{domains-3RJ4T5IX.mjs → domains-7Y23SAEM.mjs} +2 -2
- package/dist/{env-LBYBCBWV.mjs → env-H6M4G4V6.mjs} +2 -2
- package/dist/{link-SEJNW7JS.mjs → link-QPWA5Q6Z.mjs} +1 -1
- package/dist/{list-D4JC2VWY.mjs → list-DS4C3JRB.mjs} +2 -2
- package/dist/{login-MRYWLQRY.mjs → login-JFDAQ7T5.mjs} +1 -1
- package/dist/{logs-LK7CMBCE.mjs → logs-EABEQBEV.mjs} +2 -2
- package/dist/{projects-QJUGOCQZ.mjs → projects-L7JEO3KO.mjs} +2 -2
- package/dist/{repo-MV22OHON.mjs → repo-54HUIBFC.mjs} +3 -3
- package/dist/{rollback-XO7RIG2A.mjs → rollback-YTKRECZ5.mjs} +3 -3
- package/dist/{status-7CMVLD54.mjs → status-IFJIYWRQ.mjs} +2 -2
- package/dist/update-UH2HKLOK.mjs +196 -0
- package/package.json +1 -1
- package/templates/storefront-bakery/.claude/skills/cimplify-storefront/SKILL.md +10 -10
- package/templates/storefront-bakery/.cursor/rules/cimplify-storefront.mdc +1 -1
- package/templates/storefront-bakery/AGENTS.md +3 -3
- package/templates/storefront-bakery/CLAUDE.md +1 -1
- package/templates/storefront-bakery/README.md +7 -7
- package/templates/storefront-bakery/package.json +2 -2
- package/templates/storefront-fashion/.claude/skills/cimplify-storefront/SKILL.md +10 -10
- package/templates/storefront-fashion/.cursor/rules/cimplify-storefront.mdc +1 -1
- package/templates/storefront-fashion/AGENTS.md +3 -3
- package/templates/storefront-fashion/CLAUDE.md +1 -1
- package/templates/storefront-fashion/README.md +8 -8
- package/templates/storefront-fashion/package.json +2 -2
- package/templates/storefront-grocery/.claude/skills/cimplify-storefront/SKILL.md +10 -10
- package/templates/storefront-grocery/.cursor/rules/cimplify-storefront.mdc +1 -1
- package/templates/storefront-grocery/AGENTS.md +3 -3
- package/templates/storefront-grocery/CLAUDE.md +1 -1
- package/templates/storefront-grocery/README.md +7 -7
- package/templates/storefront-grocery/package.json +2 -2
- package/templates/storefront-restaurant/.claude/skills/cimplify-storefront/SKILL.md +10 -10
- package/templates/storefront-restaurant/.cursor/rules/cimplify-storefront.mdc +1 -1
- package/templates/storefront-restaurant/AGENTS.md +3 -3
- package/templates/storefront-restaurant/CLAUDE.md +1 -1
- package/templates/storefront-restaurant/README.md +7 -7
- package/templates/storefront-restaurant/package.json +2 -2
- package/templates/storefront-retail/.claude/skills/cimplify-storefront/SKILL.md +10 -10
- package/templates/storefront-retail/.cursor/rules/cimplify-storefront.mdc +1 -1
- package/templates/storefront-retail/AGENTS.md +3 -3
- package/templates/storefront-retail/CLAUDE.md +1 -1
- package/templates/storefront-retail/README.md +8 -8
- package/templates/storefront-retail/package.json +2 -2
- package/templates/storefront-services/.claude/skills/cimplify-storefront/SKILL.md +10 -10
- package/templates/storefront-services/.cursor/rules/cimplify-storefront.mdc +1 -1
- package/templates/storefront-services/AGENTS.md +3 -3
- package/templates/storefront-services/CLAUDE.md +1 -1
- package/templates/storefront-services/README.md +7 -7
- package/templates/storefront-services/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { promptYesNo } from './chunk-L6474RPL.mjs';
|
|
3
|
-
import { TOKEN_PURPOSE, REPO_PROVIDER, REPO_PROVIDER_VALUES } from './chunk-
|
|
4
|
-
import { parseArgs, flagString, flagBool } from './chunk-
|
|
3
|
+
import { TOKEN_PURPOSE, REPO_PROVIDER, REPO_PROVIDER_VALUES } from './chunk-VE74N3YS.mjs';
|
|
4
|
+
import { parseArgs, flagString, flagBool } from './chunk-4SBJVRGM.mjs';
|
|
5
5
|
import { ApiClient } from './chunk-4ZVTPMUZ.mjs';
|
|
6
6
|
import { readAuth, readProjectLink } from './chunk-JJYWETGA.mjs';
|
|
7
7
|
import { CliError, CLI_ERROR_CODE, isJsonMode, result, dim, success, info, bold } from './chunk-NZ4RG62Z.mjs';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { pollDeployment } from './chunk-
|
|
3
|
-
import { fetchCloneToken } from './chunk-
|
|
2
|
+
import { pollDeployment } from './chunk-2BO4H6VP.mjs';
|
|
3
|
+
import { fetchCloneToken } from './chunk-WLLH5HFI.mjs';
|
|
4
4
|
import { promptYesNo } from './chunk-L6474RPL.mjs';
|
|
5
|
-
import { TOKEN_PURPOSE, ENV_SCOPE, DEPLOY_TRIGGER, DEPLOYMENT_STATUS } from './chunk-
|
|
6
|
-
import { parseArgs, flagBool, flagString } from './chunk-
|
|
5
|
+
import { TOKEN_PURPOSE, ENV_SCOPE, DEPLOY_TRIGGER, DEPLOYMENT_STATUS } from './chunk-VE74N3YS.mjs';
|
|
6
|
+
import { parseArgs, flagBool, flagString } from './chunk-4SBJVRGM.mjs';
|
|
7
7
|
import { ApiClient } from './chunk-4ZVTPMUZ.mjs';
|
|
8
8
|
import { readAuth, readProjectLink, writeProjectState } from './chunk-JJYWETGA.mjs';
|
|
9
9
|
import { CliError, CLI_ERROR_CODE, step, info, dim, success, result, EXIT_CODE } from './chunk-NZ4RG62Z.mjs';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { parseEnvFile, formatEnvFile } from './chunk-4YSOZ6LY.mjs';
|
|
3
|
-
import { ENV_SCOPE, PUBLIC_ENV_PREFIX } from './chunk-
|
|
4
|
-
import { parseArgs, flagBool } from './chunk-
|
|
3
|
+
import { ENV_SCOPE, PUBLIC_ENV_PREFIX } from './chunk-VE74N3YS.mjs';
|
|
4
|
+
import { parseArgs, flagBool } from './chunk-4SBJVRGM.mjs';
|
|
5
5
|
import { ApiClient } from './chunk-4ZVTPMUZ.mjs';
|
|
6
6
|
import { readAuth, readProjectLink } from './chunk-JJYWETGA.mjs';
|
|
7
7
|
import { info, CliError, CLI_ERROR_CODE, dim } from './chunk-NZ4RG62Z.mjs';
|
package/dist/dispatcher.mjs
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
// package.json
|
|
5
|
-
var package_default = {
|
|
6
|
-
version: "0.2.0"};
|
|
2
|
+
import { package_default } from './chunk-O36TGF2L.mjs';
|
|
3
|
+
import { TEMPLATES } from './chunk-SN6E73KY.mjs';
|
|
7
4
|
|
|
8
5
|
// src/dispatcher.ts
|
|
9
|
-
var VERSION = package_default.version;
|
|
6
|
+
var VERSION = package_default.version ?? "unknown";
|
|
10
7
|
var HELP = `cimplify \u2014 Cimplify CLI
|
|
11
8
|
|
|
12
9
|
Usage:
|
|
@@ -74,6 +71,12 @@ Global flags (work with any cloud subcommand):
|
|
|
74
71
|
--yes, -y Auto-confirm yes/no prompts (e.g. --allow-dirty).
|
|
75
72
|
Non-TTY runs throw INTERACTIVE_REQUIRED unless --yes is set.
|
|
76
73
|
|
|
74
|
+
Self-update:
|
|
75
|
+
cimplify update [flags] Re-run the installer to upgrade the native binary
|
|
76
|
+
cimplify update --check Compare current version to latest release; don't install
|
|
77
|
+
cimplify update --version cli-v0.2.2 Pin a specific release
|
|
78
|
+
cimplify update --prefix ~/.local Override install location (default: inferred from $0)
|
|
79
|
+
|
|
77
80
|
Misc:
|
|
78
81
|
cimplify --help, -h Show this help
|
|
79
82
|
cimplify --version, -v Show CLI version
|
|
@@ -96,7 +99,7 @@ Deploy flags:
|
|
|
96
99
|
--no-poll Return after enqueue; don't stream progress
|
|
97
100
|
|
|
98
101
|
Env flags:
|
|
99
|
-
--scope <scope> development | preview |
|
|
102
|
+
--scope <scope> development | preview | production
|
|
100
103
|
--show Reveal non-secret values in \`env ls\`
|
|
101
104
|
--out <path> Output path for \`env pull\` (default .env.local)
|
|
102
105
|
--file <path> Input path for \`env push\` (default .env.local)
|
|
@@ -112,22 +115,24 @@ Need the mock storefront server? It ships with @cimplify/sdk:
|
|
|
112
115
|
bunx @cimplify/sdk mock [flags] Boot the local Cimplify API mock
|
|
113
116
|
`;
|
|
114
117
|
var COMMANDS = {
|
|
115
|
-
login: () => import('./login-
|
|
118
|
+
login: () => import('./login-JFDAQ7T5.mjs'),
|
|
116
119
|
logout: () => import('./logout-ZFZLSJ32.mjs'),
|
|
117
120
|
whoami: () => import('./whoami-INHDUHWA.mjs'),
|
|
118
|
-
projects: () => import('./projects-
|
|
119
|
-
link: () => import('./link-
|
|
121
|
+
projects: () => import('./projects-L7JEO3KO.mjs'),
|
|
122
|
+
link: () => import('./link-QPWA5Q6Z.mjs'),
|
|
120
123
|
unlink: () => import('./unlink-5ABCT7B6.mjs'),
|
|
121
|
-
deploy: () => import('./deploy-
|
|
122
|
-
rollback: () => import('./rollback-
|
|
123
|
-
env: () => import('./env-
|
|
124
|
-
domains: () => import('./domains-
|
|
125
|
-
logs: () => import('./logs-
|
|
126
|
-
status: () => import('./status-
|
|
127
|
-
dev: () => import('./dev-
|
|
128
|
-
repo: () => import('./repo-
|
|
129
|
-
list: () => import('./list-
|
|
130
|
-
add: () => import('./add-
|
|
124
|
+
deploy: () => import('./deploy-N3GTTUI5.mjs'),
|
|
125
|
+
rollback: () => import('./rollback-YTKRECZ5.mjs'),
|
|
126
|
+
env: () => import('./env-H6M4G4V6.mjs'),
|
|
127
|
+
domains: () => import('./domains-7Y23SAEM.mjs'),
|
|
128
|
+
logs: () => import('./logs-EABEQBEV.mjs'),
|
|
129
|
+
status: () => import('./status-IFJIYWRQ.mjs'),
|
|
130
|
+
dev: () => import('./dev-ABPRBTPU.mjs'),
|
|
131
|
+
repo: () => import('./repo-54HUIBFC.mjs'),
|
|
132
|
+
list: () => import('./list-DS4C3JRB.mjs'),
|
|
133
|
+
add: () => import('./add-YJDP63WM.mjs'),
|
|
134
|
+
update: () => import('./update-UH2HKLOK.mjs'),
|
|
135
|
+
upgrade: () => import('./update-UH2HKLOK.mjs')
|
|
131
136
|
};
|
|
132
137
|
var GLOBAL_FLAGS = /* @__PURE__ */ new Set(["--json", "--yes", "-y"]);
|
|
133
138
|
function extractGlobalFlags(argv) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { promptYesNo } from './chunk-L6474RPL.mjs';
|
|
3
|
-
import { ENV_SCOPE, DOMAIN_TYPE } from './chunk-
|
|
4
|
-
import { parseArgs, flagBool, flagString } from './chunk-
|
|
3
|
+
import { ENV_SCOPE, DOMAIN_TYPE } from './chunk-VE74N3YS.mjs';
|
|
4
|
+
import { parseArgs, flagBool, flagString } from './chunk-4SBJVRGM.mjs';
|
|
5
5
|
import { ApiClient } from './chunk-4ZVTPMUZ.mjs';
|
|
6
6
|
import { readAuth, readProjectLink } from './chunk-JJYWETGA.mjs';
|
|
7
7
|
import { CliError, CLI_ERROR_CODE, info, dim, result, bold, success } from './chunk-NZ4RG62Z.mjs';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { formatEnvFile, parseEnvFile, parseKeyValueArg } from './chunk-4YSOZ6LY.mjs';
|
|
3
3
|
import { promptYesNo } from './chunk-L6474RPL.mjs';
|
|
4
|
-
import { ENV_SCOPE, PUBLIC_ENV_PREFIX, SECRET_MASK } from './chunk-
|
|
5
|
-
import { parseArgs, flagString, flagBool } from './chunk-
|
|
4
|
+
import { ENV_SCOPE, PUBLIC_ENV_PREFIX, SECRET_MASK } from './chunk-VE74N3YS.mjs';
|
|
5
|
+
import { parseArgs, flagString, flagBool } from './chunk-4SBJVRGM.mjs';
|
|
6
6
|
import { ApiClient } from './chunk-4ZVTPMUZ.mjs';
|
|
7
7
|
import { readAuth, readProjectLink } from './chunk-JJYWETGA.mjs';
|
|
8
8
|
import { CliError, CLI_ERROR_CODE, info, dim, result, bold, success } from './chunk-NZ4RG62Z.mjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { parseArgs } from './chunk-
|
|
2
|
+
import { parseArgs } from './chunk-4SBJVRGM.mjs';
|
|
3
3
|
import { ApiClient } from './chunk-4ZVTPMUZ.mjs';
|
|
4
4
|
import { readAuth, writeProjectLink } from './chunk-JJYWETGA.mjs';
|
|
5
5
|
import { CliError, CLI_ERROR_CODE, success, info, dim, result } from './chunk-NZ4RG62Z.mjs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { REGISTRY_INDEX } from './chunk-
|
|
3
|
-
import { parseArgs, flagBool } from './chunk-
|
|
2
|
+
import { REGISTRY_INDEX } from './chunk-SN6E73KY.mjs';
|
|
3
|
+
import { parseArgs, flagBool } from './chunk-4SBJVRGM.mjs';
|
|
4
4
|
import { CliError, CLI_ERROR_CODE, info, bold, dim, green, result } from './chunk-NZ4RG62Z.mjs';
|
|
5
5
|
|
|
6
6
|
// src/commands/list.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { parseArgs, flagString, flagBool } from './chunk-
|
|
2
|
+
import { parseArgs, flagString, flagBool } from './chunk-4SBJVRGM.mjs';
|
|
3
3
|
import { resolveBaseUrl, ApiClient } from './chunk-4ZVTPMUZ.mjs';
|
|
4
4
|
import { writeAuth } from './chunk-JJYWETGA.mjs';
|
|
5
5
|
import { CliError, CLI_ERROR_CODE, success, result, isJsonMode, step, info, dim } from './chunk-NZ4RG62Z.mjs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { TERMINAL_DEPLOYMENT_STATUSES } from './chunk-
|
|
3
|
-
import { parseArgs, flagString, flagBool } from './chunk-
|
|
2
|
+
import { TERMINAL_DEPLOYMENT_STATUSES } from './chunk-VE74N3YS.mjs';
|
|
3
|
+
import { parseArgs, flagString, flagBool } from './chunk-4SBJVRGM.mjs';
|
|
4
4
|
import { ApiClient } from './chunk-4ZVTPMUZ.mjs';
|
|
5
5
|
import { readAuth, readProjectLink, readProjectState } from './chunk-JJYWETGA.mjs';
|
|
6
6
|
import { CliError, CLI_ERROR_CODE, isJsonMode, failure, result, red } from './chunk-NZ4RG62Z.mjs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { REPO_PROVIDER } from './chunk-
|
|
3
|
-
import { parseArgs, flagString, flagBool } from './chunk-
|
|
2
|
+
import { REPO_PROVIDER } from './chunk-VE74N3YS.mjs';
|
|
3
|
+
import { parseArgs, flagString, flagBool } from './chunk-4SBJVRGM.mjs';
|
|
4
4
|
import { ApiClient } from './chunk-4ZVTPMUZ.mjs';
|
|
5
5
|
import { readAuth } from './chunk-JJYWETGA.mjs';
|
|
6
6
|
import { CliError, CLI_ERROR_CODE, info, dim, result, bold, success } from './chunk-NZ4RG62Z.mjs';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
export { run as default, fetchCloneToken } from './chunk-
|
|
2
|
+
export { run as default, fetchCloneToken } from './chunk-WLLH5HFI.mjs';
|
|
3
3
|
import './chunk-L6474RPL.mjs';
|
|
4
|
-
import './chunk-
|
|
5
|
-
import './chunk-
|
|
4
|
+
import './chunk-VE74N3YS.mjs';
|
|
5
|
+
import './chunk-4SBJVRGM.mjs';
|
|
6
6
|
import './chunk-4ZVTPMUZ.mjs';
|
|
7
7
|
import './chunk-JJYWETGA.mjs';
|
|
8
8
|
import './chunk-NZ4RG62Z.mjs';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { pollDeployment } from './chunk-
|
|
3
|
-
import { DEPLOYMENT_STATUS, DEPLOY_TRIGGER } from './chunk-
|
|
4
|
-
import { parseArgs, flagBool } from './chunk-
|
|
2
|
+
import { pollDeployment } from './chunk-2BO4H6VP.mjs';
|
|
3
|
+
import { DEPLOYMENT_STATUS, DEPLOY_TRIGGER } from './chunk-VE74N3YS.mjs';
|
|
4
|
+
import { parseArgs, flagBool } from './chunk-4SBJVRGM.mjs';
|
|
5
5
|
import { ApiClient } from './chunk-4ZVTPMUZ.mjs';
|
|
6
6
|
import { readAuth, readProjectLink, writeProjectState } from './chunk-JJYWETGA.mjs';
|
|
7
7
|
import { CliError, CLI_ERROR_CODE, step, success, info, dim, result, EXIT_CODE } from './chunk-NZ4RG62Z.mjs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { DEPLOYMENT_STATUS } from './chunk-
|
|
3
|
-
import { parseArgs } from './chunk-
|
|
2
|
+
import { DEPLOYMENT_STATUS } from './chunk-VE74N3YS.mjs';
|
|
3
|
+
import { parseArgs } from './chunk-4SBJVRGM.mjs';
|
|
4
4
|
import { ApiClient } from './chunk-4ZVTPMUZ.mjs';
|
|
5
5
|
import { readAuth, readProjectLink, readProjectState } from './chunk-JJYWETGA.mjs';
|
|
6
6
|
import { bold, dim, info, result } from './chunk-NZ4RG62Z.mjs';
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { package_default } from './chunk-O36TGF2L.mjs';
|
|
3
|
+
import { promptYesNo } from './chunk-L6474RPL.mjs';
|
|
4
|
+
import { parseArgs, flagBool, flagString } from './chunk-4SBJVRGM.mjs';
|
|
5
|
+
import { success, bold, info, dim, result, failure, CliError, CLI_ERROR_CODE, step, isJsonMode } from './chunk-NZ4RG62Z.mjs';
|
|
6
|
+
import { spawn } from 'child_process';
|
|
7
|
+
import { basename, dirname } from 'path';
|
|
8
|
+
|
|
9
|
+
var CURRENT_VERSION = package_default.version ?? "unknown";
|
|
10
|
+
var INSTALL_URL = "https://cimplify.io/install";
|
|
11
|
+
var RELEASES_API = "https://api.github.com/repos/cimplifylabs/cli/releases/latest";
|
|
12
|
+
function detectContext() {
|
|
13
|
+
const exec = process.execPath;
|
|
14
|
+
const name = basename(exec).replace(/\.exe$/i, "");
|
|
15
|
+
if (name === "cimplify") {
|
|
16
|
+
return { isNative: true, prefix: dirname(dirname(exec)) };
|
|
17
|
+
}
|
|
18
|
+
return { isNative: false, runtime: name };
|
|
19
|
+
}
|
|
20
|
+
async function fetchLatestTag() {
|
|
21
|
+
let res;
|
|
22
|
+
try {
|
|
23
|
+
res = await fetch(RELEASES_API, {
|
|
24
|
+
headers: {
|
|
25
|
+
Accept: "application/vnd.github+json",
|
|
26
|
+
"User-Agent": `@cimplify/cli/${CURRENT_VERSION}`
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
} catch (err) {
|
|
30
|
+
throw new CliError(
|
|
31
|
+
CLI_ERROR_CODE.NETWORK_ERROR,
|
|
32
|
+
`GitHub releases request failed: ${err instanceof Error ? err.message : String(err)}`
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
if (!res.ok) {
|
|
36
|
+
throw new CliError(
|
|
37
|
+
CLI_ERROR_CODE.NETWORK_ERROR,
|
|
38
|
+
`GitHub releases query failed: ${res.status} ${res.statusText}`
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
const body = await res.json();
|
|
42
|
+
if (!body.tag_name) {
|
|
43
|
+
throw new CliError(
|
|
44
|
+
CLI_ERROR_CODE.NETWORK_ERROR,
|
|
45
|
+
"GitHub releases response missing tag_name"
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
return body.tag_name;
|
|
49
|
+
}
|
|
50
|
+
function stripTagPrefix(tag) {
|
|
51
|
+
return tag.replace(/^cli-v/, "");
|
|
52
|
+
}
|
|
53
|
+
function compareSemver(a, b) {
|
|
54
|
+
const parse = (v) => {
|
|
55
|
+
const [maj, min, patch] = v.split(/[.+-]/).slice(0, 3).map((p) => Number(p) || 0);
|
|
56
|
+
return [maj, min, patch];
|
|
57
|
+
};
|
|
58
|
+
const [a1, a2, a3] = parse(a);
|
|
59
|
+
const [b1, b2, b3] = parse(b);
|
|
60
|
+
if (a1 !== b1) return a1 < b1 ? -1 : 1;
|
|
61
|
+
if (a2 !== b2) return a2 < b2 ? -1 : 1;
|
|
62
|
+
if (a3 !== b3) return a3 < b3 ? -1 : 1;
|
|
63
|
+
return 0;
|
|
64
|
+
}
|
|
65
|
+
async function runInstall(prefix, versionTag) {
|
|
66
|
+
let scriptRes;
|
|
67
|
+
try {
|
|
68
|
+
scriptRes = await fetch(INSTALL_URL);
|
|
69
|
+
} catch (err) {
|
|
70
|
+
throw new CliError(
|
|
71
|
+
CLI_ERROR_CODE.NETWORK_ERROR,
|
|
72
|
+
`${INSTALL_URL} fetch failed: ${err instanceof Error ? err.message : String(err)}`
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
if (!scriptRes.ok) {
|
|
76
|
+
throw new CliError(
|
|
77
|
+
CLI_ERROR_CODE.NETWORK_ERROR,
|
|
78
|
+
`${INSTALL_URL} returned ${scriptRes.status} ${scriptRes.statusText}`
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
const script = await scriptRes.text();
|
|
82
|
+
const installArgs = ["-s", "--", "--prefix", prefix, "--version", versionTag];
|
|
83
|
+
const json = isJsonMode();
|
|
84
|
+
const stdoutSink = json ? "pipe" : "inherit";
|
|
85
|
+
const stderrSink = json ? "pipe" : "inherit";
|
|
86
|
+
await new Promise((resolve, reject) => {
|
|
87
|
+
const child = spawn("sh", installArgs, {
|
|
88
|
+
stdio: ["pipe", stdoutSink, stderrSink]
|
|
89
|
+
});
|
|
90
|
+
let captured = "";
|
|
91
|
+
if (json) {
|
|
92
|
+
child.stdout?.on("data", (chunk) => {
|
|
93
|
+
captured += chunk.toString();
|
|
94
|
+
});
|
|
95
|
+
child.stderr?.on("data", (chunk) => {
|
|
96
|
+
captured += chunk.toString();
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
if (!child.stdin) {
|
|
100
|
+
reject(new CliError(CLI_ERROR_CODE.INVALID_INPUT, "installer child has no stdin"));
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
child.stdin.write(script);
|
|
104
|
+
child.stdin.end();
|
|
105
|
+
child.on("error", (err) => reject(err));
|
|
106
|
+
child.on("exit", (code) => {
|
|
107
|
+
if (code === 0) resolve();
|
|
108
|
+
else {
|
|
109
|
+
const detail = json && captured ? `
|
|
110
|
+
${captured.trim()}` : "";
|
|
111
|
+
reject(
|
|
112
|
+
new CliError(
|
|
113
|
+
CLI_ERROR_CODE.INVALID_INPUT,
|
|
114
|
+
`installer exited with code ${code ?? "null"}${detail}`,
|
|
115
|
+
{
|
|
116
|
+
remediation: "Re-run without --json to see live installer output, or with --prefix <writable-path>."
|
|
117
|
+
}
|
|
118
|
+
)
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
async function run(argv) {
|
|
125
|
+
const args = parseArgs(argv);
|
|
126
|
+
const check = flagBool(args, "check");
|
|
127
|
+
const targetVersion = flagString(args, "version");
|
|
128
|
+
const prefixOverride = flagString(args, "prefix");
|
|
129
|
+
const ctx = detectContext();
|
|
130
|
+
const latestTag = await fetchLatestTag();
|
|
131
|
+
const latestVersion = stripTagPrefix(latestTag);
|
|
132
|
+
const cmp = compareSemver(CURRENT_VERSION, latestVersion);
|
|
133
|
+
const upToDate = cmp >= 0;
|
|
134
|
+
if (check) {
|
|
135
|
+
if (upToDate) {
|
|
136
|
+
success(`Already on latest: ${bold(CURRENT_VERSION)}`);
|
|
137
|
+
} else {
|
|
138
|
+
info(
|
|
139
|
+
`Update available: ${dim(CURRENT_VERSION)} \u2192 ${bold(latestVersion)} (${latestTag})`
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
result({
|
|
143
|
+
current: CURRENT_VERSION,
|
|
144
|
+
latest: latestVersion,
|
|
145
|
+
latest_tag: latestTag,
|
|
146
|
+
up_to_date: upToDate
|
|
147
|
+
});
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
if (!ctx.isNative) {
|
|
151
|
+
failure(
|
|
152
|
+
`cimplify update only updates the native binary; this process is running under ${ctx.runtime}.`
|
|
153
|
+
);
|
|
154
|
+
info(" \u2192 Native install: `curl -fsSL https://cimplify.io/install | sh`");
|
|
155
|
+
info(` \u2192 Or npm install: \`npm i -g @cimplify/cli@${latestVersion}\``);
|
|
156
|
+
throw new CliError(
|
|
157
|
+
CLI_ERROR_CODE.INVALID_INPUT,
|
|
158
|
+
"self-update unsupported under non-native runtime",
|
|
159
|
+
{
|
|
160
|
+
remediation: "Reinstall via cimplify.io/install or your package manager (npm / bun / pnpm)."
|
|
161
|
+
}
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
if (upToDate && !targetVersion) {
|
|
165
|
+
success(`Already on latest: ${bold(CURRENT_VERSION)}`);
|
|
166
|
+
result({
|
|
167
|
+
current: CURRENT_VERSION,
|
|
168
|
+
latest: latestVersion,
|
|
169
|
+
latest_tag: latestTag,
|
|
170
|
+
updated: false
|
|
171
|
+
});
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
const versionTag = targetVersion ?? latestTag;
|
|
175
|
+
const prefix = prefixOverride ?? ctx.prefix;
|
|
176
|
+
const targetVer = stripTagPrefix(versionTag);
|
|
177
|
+
info(
|
|
178
|
+
`Updating ${bold("cimplify")}: ${dim(CURRENT_VERSION)} \u2192 ${bold(targetVer)} (${versionTag})`
|
|
179
|
+
);
|
|
180
|
+
info(` prefix: ${dim(prefix)}`);
|
|
181
|
+
const ok = await promptYesNo("Proceed?", true);
|
|
182
|
+
if (!ok) throw new CliError(CLI_ERROR_CODE.ABORTED, "Aborted by user.");
|
|
183
|
+
step("Downloading + verifying\u2026");
|
|
184
|
+
await runInstall(prefix, versionTag);
|
|
185
|
+
success(`Updated to ${targetVer}`);
|
|
186
|
+
result({
|
|
187
|
+
current: CURRENT_VERSION,
|
|
188
|
+
latest: latestVersion,
|
|
189
|
+
latest_tag: latestTag,
|
|
190
|
+
updated: true,
|
|
191
|
+
installed: targetVer,
|
|
192
|
+
prefix
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export { run as default };
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@ description: Build, customize, rebrand, or deploy a Cimplify-scaffolded storefro
|
|
|
5
5
|
|
|
6
6
|
# Cimplify Storefront skill
|
|
7
7
|
|
|
8
|
-
You're working on a project scaffolded from `
|
|
8
|
+
You're working on a project scaffolded from `cimplify init`. The architecture is opinionated and the rebrand surface is intentionally small. Read `AGENTS.md` at the project root for the file ↔ brand-field map for *this template's* industry; this skill gives you the playbook that's the same across all six.
|
|
9
9
|
|
|
10
10
|
## The contract — never break
|
|
11
11
|
|
|
@@ -95,8 +95,8 @@ async function getX() {
|
|
|
95
95
|
Try `classNames`, `renderImage`, `renderLink`, slot props first. If those run out:
|
|
96
96
|
|
|
97
97
|
```bash
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
cimplify list
|
|
99
|
+
cimplify add product-card --dir src/components/cimplify
|
|
100
100
|
```
|
|
101
101
|
|
|
102
102
|
Once ejected, the file is yours. Hooks/types still come from `@cimplify/sdk`.
|
|
@@ -104,13 +104,13 @@ Once ejected, the file is yours. Hooks/types still come from `@cimplify/sdk`.
|
|
|
104
104
|
### Deploy
|
|
105
105
|
|
|
106
106
|
```bash
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
107
|
+
cimplify login
|
|
108
|
+
cimplify projects create my-store
|
|
109
|
+
cimplify link <project-id>
|
|
110
|
+
cimplify env push
|
|
111
|
+
cimplify deploy --prod
|
|
112
|
+
cimplify logs --follow
|
|
113
|
+
cimplify domains add my-store.com
|
|
114
114
|
```
|
|
115
115
|
|
|
116
116
|
## Pitfalls — explicit ❌ list
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Cimplify storefront — architectural rules and rebrand contract for a project scaffolded from `
|
|
2
|
+
description: Cimplify storefront — architectural rules and rebrand contract for a project scaffolded from `cimplify init`. Triggers when files like lib/brand.ts, app/globals.css, components/header.tsx, or .cimplify/project.json are in the workspace.
|
|
3
3
|
globs: ["lib/brand.ts", "app/**", "components/**", ".env.local", "next.config.ts"]
|
|
4
4
|
alwaysApply: true
|
|
5
5
|
---
|
|
@@ -103,9 +103,9 @@ app/
|
|
|
103
103
|
For anything beyond `lib/brand.ts` + `app/globals.css`, lean on the SDK's prebuilt components rather than reinvent. **Especially for product customization** (variants, add-ons, bundles, composites, services with scheduling) — the SDK already gets price math, axis matching, and cart payload contracts right. Default to ejecting and restyling:
|
|
104
104
|
|
|
105
105
|
```bash
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
cimplify add cart-drawer
|
|
107
|
+
cimplify add variant-selector
|
|
108
|
+
cimplify add product-page
|
|
109
109
|
```
|
|
110
110
|
|
|
111
111
|
Then edit the local copy. **Don't change the cart payload shape** unless you're also touching the SDK mock + backend lens. Full ejection rules and the customizer contract are in the SDK-level [`AGENTS.md`](../../AGENTS.md) → "Don't reinvent product customization".
|
|
@@ -5,8 +5,8 @@ A Cimplify storefront scaffolded from the **bakery** template — Next.js 16 (Ap
|
|
|
5
5
|
For a different industry, scaffold with `--template`:
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
cimplify init my-store --template retail # electronics / consumer goods
|
|
9
|
+
cimplify init my-store --template bakery # default — food / pâtisserie
|
|
10
10
|
```
|
|
11
11
|
|
|
12
12
|
## Run
|
|
@@ -18,7 +18,7 @@ bun dev
|
|
|
18
18
|
|
|
19
19
|
Two things start in parallel:
|
|
20
20
|
|
|
21
|
-
- `
|
|
21
|
+
- `cimplify-mock` — the Cimplify mock API on `http://127.0.0.1:8787` (Akua's Bakery seeded by default).
|
|
22
22
|
- `next dev` — this storefront on `http://localhost:3000`.
|
|
23
23
|
|
|
24
24
|
Open the storefront in your browser. Edit `app/page.tsx` to start customising. The SDK ships full pages (`<CataloguePage>`, `<ProductPage>`, `<CartPage>`, `<CheckoutPage>`) and layouts (`<DefaultProductLayout>`, `<FoodProductLayout>`, etc.) that you can swap in.
|
|
@@ -50,10 +50,10 @@ lib/
|
|
|
50
50
|
## Switch seed
|
|
51
51
|
|
|
52
52
|
```bash
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
cimplify-mock --seed restaurant # Mama's Kitchen
|
|
54
|
+
cimplify-mock --seed retail # Currents Electronics
|
|
55
|
+
cimplify-mock --seed services # Serene Spa
|
|
56
|
+
cimplify-mock --seed grocery # FreshMart
|
|
57
57
|
```
|
|
58
58
|
|
|
59
59
|
Update `NEXT_PUBLIC_CIMPLIFY_BUSINESS_ID` in `.env.local` to match the seeded business.
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
"private": true,
|
|
4
4
|
"version": "0.0.0",
|
|
5
5
|
"scripts": {
|
|
6
|
-
"dev": "concurrently -k -n mock,next -c blue,magenta \"
|
|
6
|
+
"dev": "concurrently -k -n mock,next -c blue,magenta \"cimplify-mock --seed default --quiet\" \"next dev\"",
|
|
7
7
|
"dev:storefront": "next dev",
|
|
8
|
-
"dev:mock": "
|
|
8
|
+
"dev:mock": "cimplify-mock --seed default",
|
|
9
9
|
"build": "next build",
|
|
10
10
|
"start": "next start",
|
|
11
11
|
"typecheck": "tsc --noEmit",
|
|
@@ -5,7 +5,7 @@ description: Build, customize, rebrand, or deploy a Cimplify-scaffolded storefro
|
|
|
5
5
|
|
|
6
6
|
# Cimplify Storefront skill
|
|
7
7
|
|
|
8
|
-
You're working on a project scaffolded from `
|
|
8
|
+
You're working on a project scaffolded from `cimplify init`. The architecture is opinionated and the rebrand surface is intentionally small. Read `AGENTS.md` at the project root for the file ↔ brand-field map for *this template's* industry; this skill gives you the playbook that's the same across all six.
|
|
9
9
|
|
|
10
10
|
## The contract — never break
|
|
11
11
|
|
|
@@ -95,8 +95,8 @@ async function getX() {
|
|
|
95
95
|
Try `classNames`, `renderImage`, `renderLink`, slot props first. If those run out:
|
|
96
96
|
|
|
97
97
|
```bash
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
cimplify list
|
|
99
|
+
cimplify add product-card --dir src/components/cimplify
|
|
100
100
|
```
|
|
101
101
|
|
|
102
102
|
Once ejected, the file is yours. Hooks/types still come from `@cimplify/sdk`.
|
|
@@ -104,13 +104,13 @@ Once ejected, the file is yours. Hooks/types still come from `@cimplify/sdk`.
|
|
|
104
104
|
### Deploy
|
|
105
105
|
|
|
106
106
|
```bash
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
107
|
+
cimplify login
|
|
108
|
+
cimplify projects create my-store
|
|
109
|
+
cimplify link <project-id>
|
|
110
|
+
cimplify env push
|
|
111
|
+
cimplify deploy --prod
|
|
112
|
+
cimplify logs --follow
|
|
113
|
+
cimplify domains add my-store.com
|
|
114
114
|
```
|
|
115
115
|
|
|
116
116
|
## Pitfalls — explicit ❌ list
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Cimplify storefront — architectural rules and rebrand contract for a project scaffolded from `
|
|
2
|
+
description: Cimplify storefront — architectural rules and rebrand contract for a project scaffolded from `cimplify init`. Triggers when files like lib/brand.ts, app/globals.css, components/header.tsx, or .cimplify/project.json are in the workspace.
|
|
3
3
|
globs: ["lib/brand.ts", "app/**", "components/**", ".env.local", "next.config.ts"]
|
|
4
4
|
alwaysApply: true
|
|
5
5
|
---
|
|
@@ -101,9 +101,9 @@ Wired to `--seed fashion` (Studio FRX apparel catalogue — 14 products with siz
|
|
|
101
101
|
For anything beyond `lib/brand.ts` + `app/globals.css`, you'll likely want to lean on the SDK's prebuilt components rather than reinvent. Particularly for **product customization** (variants, add-ons, bundles, composites, services with scheduling), the SDK already gets the price math, variant axis matching, and cart payload contracts right. Default to ejecting and restyling:
|
|
102
102
|
|
|
103
103
|
```bash
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
cimplify add variant-selector # copies into ./components/
|
|
105
|
+
cimplify add cart-drawer
|
|
106
|
+
cimplify add product-page
|
|
107
107
|
```
|
|
108
108
|
|
|
109
109
|
Then edit the local copy. **Don't change the cart payload shape** unless you're also touching the SDK's mock and the backend lens.
|