@cimplify/cli 0.13.3 → 0.13.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.
- package/README.md +11 -8
- package/dist/{add-F7GKDXAD.mjs → add-542NLKYG.mjs} +4 -5
- package/dist/{assets-Y4JE6MSG.mjs → assets-OEY6FHHZ.mjs} +4 -5
- package/dist/{auth-step-up-EHL5PM2L.mjs → auth-step-up-ALEUQUCE.mjs} +5 -6
- package/dist/{cancel-QSZE2XC2.mjs → cancel-FD66LTTS.mjs} +4 -5
- package/dist/chunk-4O4G2CDE.mjs +162 -0
- package/dist/{chunk-C4M3DXKC.mjs → chunk-5KYR6WJB.mjs} +10 -2
- package/dist/{chunk-4YIFBYBV.mjs → chunk-5ZQURRIM.mjs} +1 -2
- package/dist/{chunk-QA36VSLX.mjs → chunk-6CHBU7O4.mjs} +1 -1
- package/dist/{chunk-QKDCMUWP.mjs → chunk-7NUSJVN3.mjs} +3 -2
- package/dist/{chunk-72VM62IN.mjs → chunk-HJQ6PF5N.mjs} +6 -6
- package/dist/{chunk-UP7N53C4.mjs → chunk-IK6NQHTG.mjs} +1 -1
- package/dist/{chunk-OVHZV57L.mjs → chunk-MLVBE5V2.mjs} +1 -1
- package/dist/{chunk-RR4NOZGY.mjs → chunk-OE7YRDLH.mjs} +5 -6
- package/dist/{chunk-VJJDGHZC.mjs → chunk-PDGKBATF.mjs} +1 -2
- package/dist/{chunk-5U5OXOPN.mjs → chunk-RU53TQLZ.mjs} +1 -1
- package/dist/{chunk-JPXK5BLA.mjs → chunk-TOQGLBWF.mjs} +1 -1
- package/dist/{chunk-SVJPU4K7.mjs → chunk-VCDGYXFU.mjs} +51 -43
- package/dist/{deploy-UTAYLZOM.mjs → deploy-SLRFPGTH.mjs} +8 -9
- package/dist/{dev-SYFBDJSY.mjs → dev-L3W6UXYN.mjs} +19 -26
- package/dist/dispatcher.mjs +41 -33
- package/dist/{doctor-QPCWLW4L.mjs → doctor-E6JH4VSN.mjs} +8 -9
- package/dist/{domains-OS3DXSDN.mjs → domains-7D7WJAMC.mjs} +5 -6
- package/dist/{env-UVO4OIEO.mjs → env-PAENNABF.mjs} +6 -7
- package/dist/{explain-XB67PYQQ.mjs → explain-SZPLL5MP.mjs} +3 -4
- package/dist/{inspect-ULWQHT7J.mjs → inspect-MGVG4Z44.mjs} +3 -4
- package/dist/introspect-SDHD3PVX.mjs +8 -0
- package/dist/{link-VQN2WPZO.mjs → link-KGNQWCSZ.mjs} +4 -5
- package/dist/lint-NM3APP7L.mjs +1327 -0
- package/dist/{list-DZTPWNU3.mjs → list-W5JABY7B.mjs} +3 -4
- package/dist/{login-UZ5Y7GIO.mjs → login-NCO4P5G5.mjs} +5 -6
- package/dist/{logout-XYWZR6QJ.mjs → logout-MF6SOLPE.mjs} +2 -3
- package/dist/{logs-YNXDXAF7.mjs → logs-76TCJBIQ.mjs} +4 -5
- package/dist/{mock-HFVAAYK2.mjs → mock-CAWNXSGC.mjs} +2 -3
- package/dist/{projects-RJ44DJKZ.mjs → projects-U75DOOR7.mjs} +4 -5
- package/dist/repo-IE5IOLR5.mjs +8 -0
- package/dist/{rollback-Z2PRL7FS.mjs → rollback-ZL3V7SYH.mjs} +5 -6
- package/dist/{status-RR3GGTVU.mjs → status-52HG63FE.mjs} +4 -5
- package/dist/{unlink-JBVZYOA3.mjs → unlink-TCG3NBAR.mjs} +2 -3
- package/dist/{update-B5HANRBK.mjs → update-447FR363.mjs} +4 -5
- package/dist/{whoami-5G32NNEP.mjs → whoami-B5Y5KSOZ.mjs} +3 -4
- package/package.json +3 -2
- package/templates/storefront-auto/app/categories/[slug]/page.tsx +1 -0
- package/templates/storefront-auto/app/collections/[slug]/page.tsx +1 -0
- package/templates/storefront-auto/app/page.tsx +4 -1
- package/templates/storefront-auto/app/products/[slug]/page.tsx +1 -0
- package/templates/storefront-auto/components/auth-error-toast.tsx +2 -2
- package/templates/storefront-auto/package.json +1 -1
- package/templates/storefront-bakery/app/categories/[slug]/page.tsx +1 -0
- package/templates/storefront-bakery/app/collections/[slug]/page.tsx +1 -0
- package/templates/storefront-bakery/app/page.tsx +1 -1
- package/templates/storefront-bakery/components/auth-error-toast.tsx +2 -2
- package/templates/storefront-bakery/package.json +1 -1
- package/templates/storefront-fashion/app/categories/[slug]/page.tsx +1 -0
- package/templates/storefront-fashion/app/collections/[slug]/page.tsx +1 -0
- package/templates/storefront-fashion/app/page.tsx +1 -1
- package/templates/storefront-fashion/app/products/[slug]/page.tsx +1 -0
- package/templates/storefront-fashion/components/auth-error-toast.tsx +2 -2
- package/templates/storefront-fashion/package.json +1 -1
- package/templates/storefront-grocery/app/categories/[slug]/page.tsx +1 -0
- package/templates/storefront-grocery/app/collections/[slug]/page.tsx +1 -0
- package/templates/storefront-grocery/app/page.tsx +1 -1
- package/templates/storefront-grocery/components/auth-error-toast.tsx +2 -2
- package/templates/storefront-grocery/package.json +1 -1
- package/templates/storefront-pharmacy/app/categories/[slug]/page.tsx +1 -0
- package/templates/storefront-pharmacy/app/collections/[slug]/page.tsx +1 -0
- package/templates/storefront-pharmacy/app/globals.css +11 -3
- package/templates/storefront-pharmacy/app/page.tsx +4 -1
- package/templates/storefront-pharmacy/app/products/[slug]/page.tsx +1 -0
- package/templates/storefront-pharmacy/components/auth-error-toast.tsx +2 -2
- package/templates/storefront-pharmacy/components/pharmacy-hero.tsx +10 -3
- package/templates/storefront-pharmacy/components/urgent-ctas.tsx +30 -5
- package/templates/storefront-pharmacy/package.json +1 -1
- package/templates/storefront-restaurant/app/categories/[slug]/page.tsx +1 -0
- package/templates/storefront-restaurant/app/collections/[slug]/page.tsx +1 -0
- package/templates/storefront-restaurant/app/page.tsx +1 -1
- package/templates/storefront-restaurant/components/auth-error-toast.tsx +2 -2
- package/templates/storefront-restaurant/package.json +1 -1
- package/templates/storefront-retail/app/categories/[slug]/page.tsx +1 -0
- package/templates/storefront-retail/app/collections/[slug]/page.tsx +1 -0
- package/templates/storefront-retail/app/page.tsx +1 -1
- package/templates/storefront-retail/app/products/[slug]/page.tsx +1 -0
- package/templates/storefront-retail/components/auth-error-toast.tsx +2 -2
- package/templates/storefront-retail/package.json +1 -1
- package/templates/storefront-services/app/book/book-client.tsx +3 -5
- package/templates/storefront-services/app/categories/[slug]/page.tsx +1 -0
- package/templates/storefront-services/app/collections/[slug]/page.tsx +1 -0
- package/templates/storefront-services/app/page.tsx +1 -1
- package/templates/storefront-services/components/auth-error-toast.tsx +2 -2
- package/templates/storefront-services/package.json +1 -1
- package/dist/agent-CEYZNYXA.mjs +0 -25
- package/dist/chunk-KNTFZ6LD.mjs +0 -2090
- package/dist/chunk-YPC4VU65.mjs +0 -76
- package/dist/chunk-ZPVN6UXL.mjs +0 -74
- package/dist/introspect-D4473WPV.mjs +0 -9
- package/dist/repo-OK6CVG3G.mjs +0 -9
package/README.md
CHANGED
|
@@ -25,6 +25,8 @@ cimplify rollback <deploy-id> # re-deploy a previous SHA
|
|
|
25
25
|
cimplify env push # upload .env.local to the linked project
|
|
26
26
|
cimplify domains add shop.example.com # add a custom domain (prints DNS records)
|
|
27
27
|
cimplify status # latest deployment summary
|
|
28
|
+
cimplify lint [paths...] # SDK-aware storefront correctness checks
|
|
29
|
+
cimplify lint --fix --format json # safe fixes + stable machine-readable report
|
|
28
30
|
```
|
|
29
31
|
|
|
30
32
|
`cimplify --help` lists every subcommand and flag.
|
|
@@ -34,6 +36,7 @@ cimplify status # latest deployment summary
|
|
|
34
36
|
- **Project link:** `cimplify link <project-id>` writes `.cimplify/project.json` in the working directory. Subsequent commands read it to know which project to act on — no `--project` flag needed for the common case.
|
|
35
37
|
- **Auth:** credentials persist at `~/.config/cimplify/auth.json`. CI uses `--api-key dk_live_…` to skip the browser.
|
|
36
38
|
- **JSON mode:** pass `--json` (or set `CIMPLIFY_JSON=1`) for `{ ok, data | error }` machine-readable output on stdout.
|
|
39
|
+
- **Lint rules:** `cimplify lint` reads the current project's `@cimplify/sdk/lint-rules` JSON as bounded, validated data and falls back to the rule set bundled with the CLI when an older SDK has no rules asset. It never imports project code. Exit 0 means clean, 1 means diagnostics remain, and 2 means the lint run itself could not start.
|
|
37
40
|
- **Yes/no prompts:** pass `--yes` (or `-y`) to auto-confirm.
|
|
38
41
|
|
|
39
42
|
## How it talks to Cimplify
|
|
@@ -49,14 +52,14 @@ Every cloud command is a thin HTTP client over `https://api.cimplify.io` (overri
|
|
|
49
52
|
|
|
50
53
|
`cimplify init` ships with six designs out of the box:
|
|
51
54
|
|
|
52
|
-
| Template
|
|
53
|
-
|
|
54
|
-
| `bakery` (default) | Warm food-style storefront
|
|
55
|
-
| `restaurant`
|
|
56
|
-
| `retail`
|
|
57
|
-
| `services`
|
|
58
|
-
| `grocery`
|
|
59
|
-
| `fashion`
|
|
55
|
+
| Template | Use case |
|
|
56
|
+
| ------------------ | ------------------------------ |
|
|
57
|
+
| `bakery` (default) | Warm food-style storefront |
|
|
58
|
+
| `restaurant` | Menu + ordering UI |
|
|
59
|
+
| `retail` | Product-grid retail |
|
|
60
|
+
| `services` | Booking-style storefront |
|
|
61
|
+
| `grocery` | Catalogue-heavy grocery layout |
|
|
62
|
+
| `fashion` | Editorial fashion layout |
|
|
60
63
|
|
|
61
64
|
Each is a full Next.js project wired to `@cimplify/sdk` with the design system pre-applied.
|
|
62
65
|
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { REGISTRY_INDEX, REGISTRY } from './chunk-
|
|
3
|
-
import { promptYesNo } from './chunk-
|
|
4
|
-
import { parseArgs, flagString, flagBool } from './chunk-
|
|
5
|
-
import { CliError, CLI_ERROR_CODE } from './chunk-
|
|
6
|
-
import { info, bold, dim, success, result, yellow } from './chunk-ZPVN6UXL.mjs';
|
|
2
|
+
import { REGISTRY_INDEX, REGISTRY } from './chunk-VCDGYXFU.mjs';
|
|
3
|
+
import { promptYesNo } from './chunk-5ZQURRIM.mjs';
|
|
4
|
+
import { parseArgs, flagString, flagBool } from './chunk-5KYR6WJB.mjs';
|
|
5
|
+
import { CliError, CLI_ERROR_CODE, info, bold, dim, success, result, yellow } from './chunk-4O4G2CDE.mjs';
|
|
7
6
|
import { mkdirSync, existsSync, writeFileSync } from 'fs';
|
|
8
7
|
import { resolve, join, dirname } from 'path';
|
|
9
8
|
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { parseArgs, flagString, flagBool } from './chunk-
|
|
3
|
-
import { ApiClient } from './chunk-
|
|
4
|
-
import { readAuth } from './chunk-
|
|
5
|
-
import { CliError, CLI_ERROR_CODE } from './chunk-
|
|
6
|
-
import { step, yellow, dim, success, info, result, bold, green } from './chunk-ZPVN6UXL.mjs';
|
|
2
|
+
import { parseArgs, flagString, flagBool } from './chunk-5KYR6WJB.mjs';
|
|
3
|
+
import { ApiClient } from './chunk-TOQGLBWF.mjs';
|
|
4
|
+
import { readAuth } from './chunk-6CHBU7O4.mjs';
|
|
5
|
+
import { CliError, CLI_ERROR_CODE, step, yellow, dim, success, info, result, bold, green } from './chunk-4O4G2CDE.mjs';
|
|
7
6
|
import { createHash } from 'crypto';
|
|
8
7
|
import { promises } from 'fs';
|
|
9
8
|
import path from 'path';
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { startLoopbackServer, generateState, openBrowser } from './chunk-
|
|
3
|
-
import { parseArgs, flagString, flagBool } from './chunk-
|
|
4
|
-
import { resolveBaseUrl } from './chunk-
|
|
5
|
-
import { readAuth, writeStepUp } from './chunk-
|
|
6
|
-
import { CliError, CLI_ERROR_CODE } from './chunk-
|
|
7
|
-
import { isJsonMode, step, info, dim, success, result } from './chunk-ZPVN6UXL.mjs';
|
|
2
|
+
import { startLoopbackServer, generateState, openBrowser } from './chunk-IK6NQHTG.mjs';
|
|
3
|
+
import { parseArgs, flagString, flagBool } from './chunk-5KYR6WJB.mjs';
|
|
4
|
+
import { resolveBaseUrl } from './chunk-TOQGLBWF.mjs';
|
|
5
|
+
import { readAuth, writeStepUp } from './chunk-6CHBU7O4.mjs';
|
|
6
|
+
import { isJsonMode, CliError, CLI_ERROR_CODE, step, info, dim, success, result } from './chunk-4O4G2CDE.mjs';
|
|
8
7
|
|
|
9
8
|
// src/commands/auth-step-up.ts
|
|
10
9
|
var FLAG_NO_BROWSER = "no-browser";
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { parseArgs } from './chunk-
|
|
3
|
-
import { ApiClient } from './chunk-
|
|
4
|
-
import { readAuth, readProjectLink } from './chunk-
|
|
5
|
-
import { CliError, CLI_ERROR_CODE } from './chunk-
|
|
6
|
-
import { success, result } from './chunk-ZPVN6UXL.mjs';
|
|
2
|
+
import { parseArgs } from './chunk-5KYR6WJB.mjs';
|
|
3
|
+
import { ApiClient } from './chunk-TOQGLBWF.mjs';
|
|
4
|
+
import { readAuth, readProjectLink } from './chunk-6CHBU7O4.mjs';
|
|
5
|
+
import { CliError, CLI_ERROR_CODE, success, result } from './chunk-4O4G2CDE.mjs';
|
|
7
6
|
|
|
8
7
|
// src/commands/cancel.ts
|
|
9
8
|
function cancelEndpoint(businessId, projectId, deploymentId) {
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// src/errors.ts
|
|
3
|
+
var CLI_ERROR_CODE = {
|
|
4
|
+
NOT_LOGGED_IN: "NOT_LOGGED_IN",
|
|
5
|
+
NOT_LINKED: "NOT_LINKED",
|
|
6
|
+
NETWORK_ERROR: "NETWORK_ERROR",
|
|
7
|
+
AUTH_FAILED: "AUTH_FAILED",
|
|
8
|
+
PROJECT_NOT_FOUND: "PROJECT_NOT_FOUND",
|
|
9
|
+
GIT_ERROR: "GIT_ERROR",
|
|
10
|
+
INVALID_INPUT: "INVALID_INPUT",
|
|
11
|
+
ALREADY_LINKED: "ALREADY_LINKED",
|
|
12
|
+
SERVER_ERROR: "SERVER_ERROR",
|
|
13
|
+
ABORTED: "ABORTED",
|
|
14
|
+
UNAUTHORIZED: "UNAUTHORIZED",
|
|
15
|
+
TIMEOUT: "TIMEOUT",
|
|
16
|
+
/** Operation needs interactive confirmation and the shell is non-interactive. */
|
|
17
|
+
INTERACTIVE_REQUIRED: "INTERACTIVE_REQUIRED",
|
|
18
|
+
/** Generic resource-not-found (e.g. unknown registry component, missing local fixture). */
|
|
19
|
+
NOT_FOUND: "NOT_FOUND",
|
|
20
|
+
/** Destructive op needs a fresh user re-auth — run `cimplify auth step-up`. */
|
|
21
|
+
STEP_UP_REQUIRED: "STEP_UP_REQUIRED"
|
|
22
|
+
};
|
|
23
|
+
var EXIT_CODE = {
|
|
24
|
+
OK: 0,
|
|
25
|
+
ERROR: 1,
|
|
26
|
+
SUPERSEDED: 2,
|
|
27
|
+
ABORTED: 3,
|
|
28
|
+
NOT_LINKED: 4,
|
|
29
|
+
ALREADY_LINKED: 5,
|
|
30
|
+
GIT_ERROR: 6,
|
|
31
|
+
INTERACTIVE_REQUIRED: 7,
|
|
32
|
+
PROJECT_NOT_FOUND: 8,
|
|
33
|
+
NOT_FOUND: 9,
|
|
34
|
+
NETWORK_ERROR: 10,
|
|
35
|
+
SERVER_ERROR: 11,
|
|
36
|
+
TIMEOUT: 12,
|
|
37
|
+
NOT_LOGGED_IN: 20,
|
|
38
|
+
AUTH_FAILED: 21,
|
|
39
|
+
UNAUTHORIZED: 22,
|
|
40
|
+
STEP_UP_REQUIRED: 23,
|
|
41
|
+
INVALID_INPUT: 30
|
|
42
|
+
};
|
|
43
|
+
var EXIT_CODE_FOR = {
|
|
44
|
+
NOT_LOGGED_IN: EXIT_CODE.NOT_LOGGED_IN,
|
|
45
|
+
NOT_LINKED: EXIT_CODE.NOT_LINKED,
|
|
46
|
+
NETWORK_ERROR: EXIT_CODE.NETWORK_ERROR,
|
|
47
|
+
AUTH_FAILED: EXIT_CODE.AUTH_FAILED,
|
|
48
|
+
PROJECT_NOT_FOUND: EXIT_CODE.PROJECT_NOT_FOUND,
|
|
49
|
+
GIT_ERROR: EXIT_CODE.GIT_ERROR,
|
|
50
|
+
INVALID_INPUT: EXIT_CODE.INVALID_INPUT,
|
|
51
|
+
ALREADY_LINKED: EXIT_CODE.ALREADY_LINKED,
|
|
52
|
+
SERVER_ERROR: EXIT_CODE.SERVER_ERROR,
|
|
53
|
+
ABORTED: EXIT_CODE.ABORTED,
|
|
54
|
+
UNAUTHORIZED: EXIT_CODE.UNAUTHORIZED,
|
|
55
|
+
TIMEOUT: EXIT_CODE.TIMEOUT,
|
|
56
|
+
INTERACTIVE_REQUIRED: EXIT_CODE.INTERACTIVE_REQUIRED,
|
|
57
|
+
NOT_FOUND: EXIT_CODE.NOT_FOUND,
|
|
58
|
+
STEP_UP_REQUIRED: EXIT_CODE.STEP_UP_REQUIRED
|
|
59
|
+
};
|
|
60
|
+
var CliError = class extends Error {
|
|
61
|
+
code;
|
|
62
|
+
exitCode;
|
|
63
|
+
remediation;
|
|
64
|
+
constructor(code, message, options = {}) {
|
|
65
|
+
super(message);
|
|
66
|
+
this.name = "CliError";
|
|
67
|
+
this.code = code;
|
|
68
|
+
this.exitCode = options.exitCode ?? EXIT_CODE_FOR[code];
|
|
69
|
+
this.remediation = options.remediation;
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
function isCliError(err) {
|
|
73
|
+
return err instanceof CliError || typeof err === "object" && err !== null && err.name === "CliError" && typeof err.code === "string" && typeof err.exitCode === "number";
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// src/output.ts
|
|
77
|
+
var RESET = "\x1B[0m";
|
|
78
|
+
var BOLD_OPEN = "\x1B[1m";
|
|
79
|
+
var DIM_OPEN = "\x1B[2m";
|
|
80
|
+
var RED_OPEN = "\x1B[31m";
|
|
81
|
+
var GREEN_OPEN = "\x1B[32m";
|
|
82
|
+
var YELLOW_OPEN = "\x1B[33m";
|
|
83
|
+
var CYAN_OPEN = "\x1B[36m";
|
|
84
|
+
var PREFIX_STEP = "\u25B8";
|
|
85
|
+
var PREFIX_SUCCESS = "\u2713";
|
|
86
|
+
var PREFIX_FAILURE = "\u2717";
|
|
87
|
+
var OUTPUT_MODE = {
|
|
88
|
+
HUMAN: "human",
|
|
89
|
+
JSON: "json"
|
|
90
|
+
};
|
|
91
|
+
var ENV_JSON = "CIMPLIFY_JSON";
|
|
92
|
+
var ENV_YES = "CIMPLIFY_YES";
|
|
93
|
+
function envFlag(name) {
|
|
94
|
+
const v = process.env[name];
|
|
95
|
+
return v === "1" || v === "true";
|
|
96
|
+
}
|
|
97
|
+
function configureOutput(options) {
|
|
98
|
+
if (options.mode !== void 0) {
|
|
99
|
+
if (options.mode === OUTPUT_MODE.JSON) process.env[ENV_JSON] = "1";
|
|
100
|
+
else delete process.env[ENV_JSON];
|
|
101
|
+
}
|
|
102
|
+
if (options.autoYes !== void 0) {
|
|
103
|
+
if (options.autoYes) process.env[ENV_YES] = "1";
|
|
104
|
+
else delete process.env[ENV_YES];
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
function isJsonMode() {
|
|
108
|
+
return envFlag(ENV_JSON);
|
|
109
|
+
}
|
|
110
|
+
function isAutoYes() {
|
|
111
|
+
return envFlag(ENV_YES);
|
|
112
|
+
}
|
|
113
|
+
function isInteractive() {
|
|
114
|
+
return Boolean(process.stdout.isTTY) && Boolean(process.stdin.isTTY);
|
|
115
|
+
}
|
|
116
|
+
function wrap(open, value) {
|
|
117
|
+
return `${open}${value}${RESET}`;
|
|
118
|
+
}
|
|
119
|
+
function bold(value) {
|
|
120
|
+
return isJsonMode() ? value : wrap(BOLD_OPEN, value);
|
|
121
|
+
}
|
|
122
|
+
function dim(value) {
|
|
123
|
+
return isJsonMode() ? value : wrap(DIM_OPEN, value);
|
|
124
|
+
}
|
|
125
|
+
function red(value) {
|
|
126
|
+
return isJsonMode() ? value : wrap(RED_OPEN, value);
|
|
127
|
+
}
|
|
128
|
+
function green(value) {
|
|
129
|
+
return isJsonMode() ? value : wrap(GREEN_OPEN, value);
|
|
130
|
+
}
|
|
131
|
+
function yellow(value) {
|
|
132
|
+
return isJsonMode() ? value : wrap(YELLOW_OPEN, value);
|
|
133
|
+
}
|
|
134
|
+
function cyan(value) {
|
|
135
|
+
return isJsonMode() ? value : wrap(CYAN_OPEN, value);
|
|
136
|
+
}
|
|
137
|
+
function step(message) {
|
|
138
|
+
if (isJsonMode()) return;
|
|
139
|
+
console.log(`${cyan(PREFIX_STEP)} ${message}`);
|
|
140
|
+
}
|
|
141
|
+
function success(message) {
|
|
142
|
+
if (isJsonMode()) return;
|
|
143
|
+
console.log(`${green(PREFIX_SUCCESS)} ${message}`);
|
|
144
|
+
}
|
|
145
|
+
function failure(message) {
|
|
146
|
+
if (isJsonMode()) return;
|
|
147
|
+
console.error(`${red(PREFIX_FAILURE)} ${message}`);
|
|
148
|
+
}
|
|
149
|
+
function info(message) {
|
|
150
|
+
if (isJsonMode()) return;
|
|
151
|
+
console.log(message);
|
|
152
|
+
}
|
|
153
|
+
var ENV_EMITTED = "__CIMPLIFY_RESULT_EMITTED";
|
|
154
|
+
function result(data) {
|
|
155
|
+
if (!isJsonMode()) return;
|
|
156
|
+
if (process.env[ENV_EMITTED] === "1") return;
|
|
157
|
+
process.env[ENV_EMITTED] = "1";
|
|
158
|
+
process.stdout.write(`${JSON.stringify({ ok: true, data })}
|
|
159
|
+
`);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export { CLI_ERROR_CODE, CliError, EXIT_CODE, OUTPUT_MODE, bold, configureOutput, dim, failure, green, info, isAutoYes, isCliError, isInteractive, isJsonMode, red, result, step, success, yellow };
|
|
@@ -34,17 +34,25 @@ var BOOLEAN_FLAGS = /* @__PURE__ */ new Set([
|
|
|
34
34
|
"no-browser",
|
|
35
35
|
"follow",
|
|
36
36
|
// Doctor
|
|
37
|
-
"offline"
|
|
37
|
+
"offline",
|
|
38
|
+
// Lint / common command help
|
|
39
|
+
"fix",
|
|
40
|
+
"help"
|
|
38
41
|
]);
|
|
39
42
|
function parseArgs(argv) {
|
|
40
43
|
const positional = [];
|
|
41
44
|
const flags = /* @__PURE__ */ new Map();
|
|
45
|
+
let optionsEnded = false;
|
|
42
46
|
for (let i = 0; i < argv.length; i++) {
|
|
43
47
|
const arg = argv[i];
|
|
44
|
-
if (!arg.startsWith("--")) {
|
|
48
|
+
if (optionsEnded || !arg.startsWith("--")) {
|
|
45
49
|
positional.push(arg);
|
|
46
50
|
continue;
|
|
47
51
|
}
|
|
52
|
+
if (arg === "--") {
|
|
53
|
+
optionsEnded = true;
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
48
56
|
const eq = arg.indexOf("=");
|
|
49
57
|
if (eq !== -1) {
|
|
50
58
|
flags.set(arg.slice(2, eq), arg.slice(eq + 1));
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { CliError, CLI_ERROR_CODE } from './chunk-
|
|
3
|
-
import { isAutoYes, isInteractive } from './chunk-ZPVN6UXL.mjs';
|
|
2
|
+
import { isAutoYes, isInteractive, CliError, CLI_ERROR_CODE } from './chunk-4O4G2CDE.mjs';
|
|
4
3
|
import readline from 'readline';
|
|
5
4
|
|
|
6
5
|
async function promptLine(question) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// package.json
|
|
3
3
|
var package_default = {
|
|
4
4
|
name: "@cimplify/cli",
|
|
5
|
-
version: "0.13.
|
|
5
|
+
version: "0.13.4",
|
|
6
6
|
description: "Cimplify CLI \u2014 deploy, manage env vars, link projects, and scaffold storefronts",
|
|
7
7
|
keywords: [
|
|
8
8
|
"cimplify",
|
|
@@ -43,7 +43,8 @@ var package_default = {
|
|
|
43
43
|
"@babel/parser": "^8.0.4",
|
|
44
44
|
"@babel/traverse": "^8.0.4",
|
|
45
45
|
"@babel/types": "^8.0.4",
|
|
46
|
-
"@cimplify/sdk": "^0.
|
|
46
|
+
"@cimplify/sdk": "^0.100.4",
|
|
47
|
+
re2js: "^1.4.0"
|
|
47
48
|
},
|
|
48
49
|
devDependencies: {
|
|
49
50
|
"@aws-sdk/client-s3": "^3.1070.0",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { gitDetectRoot, gitCurrentBranch, gitCurrentSha, gitStatusPorcelain } from './chunk-
|
|
3
|
-
import { parseEnvFile } from './chunk-
|
|
4
|
-
import { package_default } from './chunk-
|
|
5
|
-
import { parseArgs } from './chunk-
|
|
6
|
-
import { readAuthOrNull, readProjectLinkOrNull, readProjectState } from './chunk-
|
|
7
|
-
import { bold, dim, yellow, green, info, result, red } from './chunk-
|
|
2
|
+
import { gitDetectRoot, gitCurrentBranch, gitCurrentSha, gitStatusPorcelain } from './chunk-MLVBE5V2.mjs';
|
|
3
|
+
import { parseEnvFile } from './chunk-RU53TQLZ.mjs';
|
|
4
|
+
import { package_default } from './chunk-7NUSJVN3.mjs';
|
|
5
|
+
import { parseArgs } from './chunk-5KYR6WJB.mjs';
|
|
6
|
+
import { readAuthOrNull, readProjectLinkOrNull, readProjectState } from './chunk-6CHBU7O4.mjs';
|
|
7
|
+
import { bold, dim, yellow, green, info, result, red } from './chunk-4O4G2CDE.mjs';
|
|
8
8
|
import { promises } from 'fs';
|
|
9
9
|
import path from 'path';
|
|
10
10
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { CliError, CLI_ERROR_CODE } from './chunk-
|
|
2
|
+
import { CliError, CLI_ERROR_CODE } from './chunk-4O4G2CDE.mjs';
|
|
3
3
|
import { randomBytes, createHash } from 'crypto';
|
|
4
4
|
import { createServer } from 'http';
|
|
5
5
|
import { spawn } from 'child_process';
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { promptYesNo } from './chunk-
|
|
2
|
+
import { promptYesNo } from './chunk-5ZQURRIM.mjs';
|
|
3
3
|
import { TOKEN_PURPOSE, REPO_PROVIDER, REPO_PROVIDER_VALUES } from './chunk-MXYUAJEW.mjs';
|
|
4
|
-
import { parseArgs, flagString, flagBool } from './chunk-
|
|
5
|
-
import { ApiClient } from './chunk-
|
|
6
|
-
import { readAuth, readProjectLink } from './chunk-
|
|
7
|
-
import { CliError, CLI_ERROR_CODE } from './chunk-
|
|
8
|
-
import { isJsonMode, result, dim, success, info, bold } from './chunk-ZPVN6UXL.mjs';
|
|
4
|
+
import { parseArgs, flagString, flagBool } from './chunk-5KYR6WJB.mjs';
|
|
5
|
+
import { ApiClient } from './chunk-TOQGLBWF.mjs';
|
|
6
|
+
import { readAuth, readProjectLink } from './chunk-6CHBU7O4.mjs';
|
|
7
|
+
import { CliError, CLI_ERROR_CODE, isJsonMode, result, dim, success, info, bold } from './chunk-4O4G2CDE.mjs';
|
|
9
8
|
|
|
10
9
|
// src/commands/repo.ts
|
|
11
10
|
var SUB_PROVISION = "provision";
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { TERMINAL_DEPLOYMENT_STATUSES, DEPLOYMENT_STATUS } from './chunk-MXYUAJEW.mjs';
|
|
3
|
-
import { CliError, CLI_ERROR_CODE } from './chunk-
|
|
4
|
-
import { dim, failure, success, isJsonMode } from './chunk-ZPVN6UXL.mjs';
|
|
3
|
+
import { dim, CliError, CLI_ERROR_CODE, failure, success, isJsonMode } from './chunk-4O4G2CDE.mjs';
|
|
5
4
|
|
|
6
5
|
// src/progress.ts
|
|
7
6
|
var POLL_INTERVAL_MS = 1e3;
|