@cimplify/cli 0.15.3 → 0.17.0
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/LICENSE +21 -0
- package/README.md +2 -2
- package/dist/add-C3DPTVH3.mjs +140 -0
- package/dist/{add-KRIIKAS4.mjs → add-JX2GXWXU.mjs} +4 -4
- package/dist/ai-HUZTVJIQ.mjs +17 -0
- package/dist/{assets-CWB72PZG.mjs → assets-MPESJSUV.mjs} +12 -7
- package/dist/{auth-step-up-Z6KOTTV7.mjs → auth-step-up-VJAFGSW6.mjs} +5 -5
- package/dist/build-E7RRQWVF.mjs +616 -0
- package/dist/{cancel-ZHVVILOU.mjs → cancel-UMKR274A.mjs} +4 -4
- package/dist/capture-TK4NIUYM.mjs +69 -0
- package/dist/chunk-25ZPFHLF.mjs +51 -0
- package/dist/{chunk-OLZKNUMK.mjs → chunk-3LJG22FS.mjs} +6 -6
- package/dist/chunk-454RQ6NR.mjs +10614 -0
- package/dist/{chunk-O2TO2J4I.mjs → chunk-6CQMRZ2W.mjs} +2 -2
- package/dist/chunk-6KKLF5KG.mjs +32 -0
- package/dist/chunk-74QZQSCL.mjs +84 -0
- package/dist/chunk-BGM7CH5G.mjs +81 -0
- package/dist/chunk-BTNVYAC4.mjs +5557 -0
- package/dist/{chunk-I2UP7YTG.mjs → chunk-ECGDRU56.mjs} +1 -1
- package/dist/{chunk-UTD34C2H.mjs → chunk-EOOOXVHR.mjs} +2 -4
- package/dist/chunk-EYEMPIMP.mjs +74 -0
- package/dist/{chunk-3RPR33MO.mjs → chunk-FV273ECI.mjs} +11 -7
- package/dist/{chunk-MLE4MVYC.mjs → chunk-GGPN4QYQ.mjs} +2 -2
- package/dist/chunk-HQPZQIWW.mjs +1456 -0
- package/dist/{chunk-3QUK5BPY.mjs → chunk-I7GEHLDD.mjs} +16 -1
- package/dist/chunk-ITDAICBY.mjs +363 -0
- package/dist/chunk-JKECUAAV.mjs +2169 -0
- package/dist/chunk-JNCEKW2Y.mjs +41 -0
- package/dist/chunk-JTYVGORV.mjs +101 -0
- package/dist/chunk-KQNZKV6E.mjs +535 -0
- package/dist/chunk-LJDIQ4PF.mjs +6463 -0
- package/dist/{chunk-2MKZKUVH.mjs → chunk-LLRUOIMU.mjs} +1 -2
- package/dist/chunk-MJMRIMR7.mjs +86 -0
- package/dist/chunk-N2WZJX5P.mjs +1989 -0
- package/dist/chunk-NEB372WD.mjs +1152 -0
- package/dist/chunk-OPX7KPOU.mjs +68 -0
- package/dist/chunk-PHUBMRAS.mjs +623 -0
- package/dist/chunk-PQBALZUH.mjs +1941 -0
- package/dist/chunk-PVW5D5AW.mjs +42 -0
- package/dist/{chunk-LZEG3FEY.mjs → chunk-QQWYQ2HS.mjs} +7 -7
- package/dist/chunk-QVR6V6QP.mjs +46 -0
- package/dist/chunk-SGT5IJVW.mjs +28 -0
- package/dist/chunk-SZXO6YSX.mjs +502 -0
- package/dist/chunk-THATLMEX.mjs +1227 -0
- package/dist/chunk-TYR4Q37L.mjs +391 -0
- package/dist/{chunk-DMLQBAGC.mjs → chunk-V3R2NYQR.mjs} +1 -1
- package/dist/chunk-VHK7WBO3.mjs +189 -0
- package/dist/{chunk-TH4XENKH.mjs → chunk-XASDB7YS.mjs} +1 -1
- package/dist/{chunk-NYXA6X56.mjs → chunk-XBQ4LO2N.mjs} +31 -11
- package/dist/chunk-XF3MGADK.mjs +2946 -0
- package/dist/{chunk-5KYR6WJB.mjs → chunk-XQAHREKO.mjs} +17 -1
- package/dist/chunk-XZG3DTXV.mjs +696 -0
- package/dist/chunk-Y4YGR2NY.mjs +52 -0
- package/dist/{chunk-LJEKKFC7.mjs → chunk-YS2JUNSQ.mjs} +19 -11
- package/dist/chunk-ZG7NJLXN.mjs +104 -0
- package/dist/create-3TGG7B3X.mjs +10 -0
- package/dist/credits-MEG7V5DI.mjs +33 -0
- package/dist/{deploy-STWZ3OSM.mjs → deploy-CNRORHJ7.mjs} +11 -11
- package/dist/dev-RXSBY7U4.mjs +8 -0
- package/dist/dev-YLYC6B7R.mjs +401 -0
- package/dist/dispatcher.mjs +131 -30
- package/dist/{doctor-3RW3OGZJ.mjs → doctor-XRTNG2IT.mjs} +13 -21
- package/dist/{domains-FTNK4IKY.mjs → domains-JIHFKDWR.mjs} +6 -6
- package/dist/engine-runtime-fetch-QVKJVC3W.mjs +10 -0
- package/dist/{env-TNCYUAMT.mjs → env-LJ3DCAA5.mjs} +7 -7
- package/dist/env-R72AHBT2.mjs +19 -0
- package/dist/explain-32RSXEXC.mjs +251 -0
- package/dist/inspect-PYLYN45K.mjs +86 -0
- package/dist/{inspect-X3M7WSTL.mjs → inspect-ZOLZHNSZ.mjs} +28 -13
- package/dist/introspect-27MMTACH.mjs +9 -0
- package/dist/kernel-IC4ZC54Z.mjs +662 -0
- package/dist/kernel-plugin.js +6862 -0
- package/dist/keys-WKOQ4KQE.mjs +71 -0
- package/dist/lines-I6ZB2IOU.mjs +56 -0
- package/dist/{link-76Z6V6CJ.mjs → link-TE2FUX74.mjs} +6 -6
- package/dist/{lint-DDZ7HUQN.mjs → lint-735IPMC6.mjs} +2 -2
- package/dist/{list-2MFOQKKQ.mjs → list-CHYY2P4T.mjs} +7 -11
- package/dist/lock-XVR3RRZ6.mjs +57 -0
- package/dist/{login-RLMDEWAL.mjs → login-LW7CHZDZ.mjs} +10 -8
- package/dist/{logout-Z57X6HPE.mjs → logout-6U6OP5DM.mjs} +2 -2
- package/dist/{logs-TNDM4RFE.mjs → logs-HKH4H6PT.mjs} +5 -5
- package/dist/logs-SCQC5HNO.mjs +44 -0
- package/dist/mcp-VRHQOEGG.mjs +1077 -0
- package/dist/{mock-EVER34IX.mjs → mock-5H3CVPHC.mjs} +2 -2
- package/dist/outdated-T7QW6F3Z.mjs +58 -0
- package/dist/port-24R7ZNP4.mjs +2408 -0
- package/dist/{projects-YL4T24VV.mjs → projects-HYITVEXS.mjs} +6 -6
- package/dist/publish-DZRR5A5X.mjs +20 -0
- package/dist/remix-4HVXRIEB.mjs +125 -0
- package/dist/repo-FG3CMZQS.mjs +9 -0
- package/dist/report-M7F4ZYP7.mjs +2 -0
- package/dist/rollback-H7Q4XYGX.mjs +43 -0
- package/dist/{rollback-47VQ4HJK.mjs → rollback-OM64O67F.mjs} +6 -6
- package/dist/scene-QTHT3ZPL.mjs +324 -0
- package/dist/{status-TWPOMWNA.mjs → status-5D4RR3MM.mjs} +5 -5
- package/dist/status-AKI6E3JK.mjs +18 -0
- package/dist/test-W6MURUGZ.mjs +233 -0
- package/dist/testers-EI32JB5F.mjs +49 -0
- package/dist/{unlink-H3BO3DOQ.mjs → unlink-BND47IWW.mjs} +2 -2
- package/dist/{update-FLY46XI3.mjs → update-XKKFREKH.mjs} +4 -4
- package/dist/{whoami-CQPPARRS.mjs → whoami-WHLGCVRC.mjs} +3 -3
- package/dist/workshop-F2T4IDOU.mjs +1703 -0
- package/package.json +11 -7
- package/templates/storefront-auto/app/products/[slug]/page.tsx +1 -1
- package/templates/storefront-auto/package.json +1 -1
- package/templates/storefront-bakery/package.json +1 -1
- package/templates/storefront-fashion/app/products/[slug]/page.tsx +1 -1
- package/templates/storefront-fashion/package.json +1 -1
- package/templates/storefront-grocery/package.json +1 -1
- package/templates/storefront-pharmacy/app/products/[slug]/page.tsx +1 -1
- package/templates/storefront-pharmacy/package.json +1 -1
- package/templates/storefront-restaurant/package.json +1 -1
- package/templates/storefront-retail/app/products/[slug]/page.tsx +1 -1
- package/templates/storefront-retail/package.json +1 -1
- package/templates/storefront-services/package.json +1 -1
- package/dist/chunk-ARIDYKLO.mjs +0 -6463
- package/dist/dev-7O65HY6C.mjs +0 -8
- package/dist/explain-DLRUUCNS.mjs +0 -251
- package/dist/introspect-RC265ACF.mjs +0 -9
- package/dist/repo-UUT3AZ3L.mjs +0 -9
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { commonOptions } from './chunk-PVW5D5AW.mjs';
|
|
3
|
+
import { readinessSummary } from './chunk-Y4YGR2NY.mjs';
|
|
4
|
+
import { FINAL_CAPTURE, prepareSession, runSession, writeCapture, CAPTURE_SCHEMA } from './chunk-JTYVGORV.mjs';
|
|
5
|
+
import { SessionError } from './chunk-SZXO6YSX.mjs';
|
|
6
|
+
import { EMPTY_READINESS } from './chunk-XF3MGADK.mjs';
|
|
7
|
+
import './chunk-74QZQSCL.mjs';
|
|
8
|
+
import './chunk-NEB372WD.mjs';
|
|
9
|
+
import './chunk-TYR4Q37L.mjs';
|
|
10
|
+
import './chunk-XZG3DTXV.mjs';
|
|
11
|
+
import './chunk-JNCEKW2Y.mjs';
|
|
12
|
+
import { workPath, requireInteractiveProject } from './chunk-BTNVYAC4.mjs';
|
|
13
|
+
import './chunk-VHK7WBO3.mjs';
|
|
14
|
+
import './chunk-454RQ6NR.mjs';
|
|
15
|
+
import './chunk-JKECUAAV.mjs';
|
|
16
|
+
import './chunk-THATLMEX.mjs';
|
|
17
|
+
import './chunk-HQPZQIWW.mjs';
|
|
18
|
+
import './chunk-KQNZKV6E.mjs';
|
|
19
|
+
import './chunk-QVR6V6QP.mjs';
|
|
20
|
+
import './chunk-N2WZJX5P.mjs';
|
|
21
|
+
import './chunk-EYEMPIMP.mjs';
|
|
22
|
+
import './chunk-BGM7CH5G.mjs';
|
|
23
|
+
import './chunk-25ZPFHLF.mjs';
|
|
24
|
+
import './chunk-SGT5IJVW.mjs';
|
|
25
|
+
import { parseArgs, flagString, flagBool } from './chunk-XQAHREKO.mjs';
|
|
26
|
+
import './chunk-XBQ4LO2N.mjs';
|
|
27
|
+
import './chunk-GGPN4QYQ.mjs';
|
|
28
|
+
import { success, warn, info, dim, result, CliError, CLI_ERROR_CODE } from './chunk-I7GEHLDD.mjs';
|
|
29
|
+
import path from 'path';
|
|
30
|
+
|
|
31
|
+
var CAPTURE_DIR = "captures";
|
|
32
|
+
var PNG = ".png";
|
|
33
|
+
function capturePath(root, out, device, frame, name) {
|
|
34
|
+
const base = out === void 0 ? workPath(root, CAPTURE_DIR, `${device}-f${frame}${PNG}`) : path.resolve(root, out.endsWith(PNG) ? out : `${out}${PNG}`);
|
|
35
|
+
if (name === FINAL_CAPTURE) return base;
|
|
36
|
+
return `${base.slice(0, -PNG.length)}-${name}${PNG}`;
|
|
37
|
+
}
|
|
38
|
+
async function run(argv) {
|
|
39
|
+
const args = parseArgs(argv);
|
|
40
|
+
const root = process.cwd();
|
|
41
|
+
requireInteractiveProject(root, "capture");
|
|
42
|
+
const options = await commonOptions(args, root);
|
|
43
|
+
const out = flagString(args, "out");
|
|
44
|
+
try {
|
|
45
|
+
const setup = await prepareSession(root);
|
|
46
|
+
const frames = await runSession(setup, { ...options, screenshots: true, inspect: !flagBool(args, "no-inspect") });
|
|
47
|
+
const final = frames.find((f) => f.sidecar.name === FINAL_CAPTURE)?.sidecar.frame ?? options.frame;
|
|
48
|
+
const captures = [];
|
|
49
|
+
const files = [];
|
|
50
|
+
for (const frame of frames) {
|
|
51
|
+
const file = capturePath(root, out, options.device.name, final, frame.sidecar.name);
|
|
52
|
+
captures.push(await writeCapture(frame, file));
|
|
53
|
+
files.push(path.relative(root, file));
|
|
54
|
+
success(`${frame.sidecar.name}: frame ${frame.sidecar.frame} on ${options.device.name} -> ${path.relative(root, file)}`);
|
|
55
|
+
if (frame.inspect !== null && frame.inspect.checks.findings.length > 0) warn(`${frame.inspect.checks.findings.length} UI findings; run \`cimplify inspect\` for the list`);
|
|
56
|
+
}
|
|
57
|
+
info(dim("Each PNG has a JSON sidecar with the frame, clock, seed, device, back-end, readiness and the UI tree"));
|
|
58
|
+
const readiness = frames.find((f) => f.sidecar.name === FINAL_CAPTURE)?.sidecar.readiness ?? frames[frames.length - 1]?.sidecar.readiness ?? EMPTY_READINESS;
|
|
59
|
+
info(readinessSummary(readiness));
|
|
60
|
+
if (readiness.stall_frames > 0) warn(`${readiness.stall_frames} streaming stall frames (a needed chunk was not resident), first at frame ${readiness.stalls[0]}`);
|
|
61
|
+
const body = { schema: CAPTURE_SCHEMA, captures, files, readiness };
|
|
62
|
+
result(body);
|
|
63
|
+
} catch (error) {
|
|
64
|
+
if (error instanceof SessionError) throw new CliError(CLI_ERROR_CODE.BUILD_FAILED, error.message);
|
|
65
|
+
throw error;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export { capturePath, run as default };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createHash } from 'crypto';
|
|
3
|
+
|
|
4
|
+
var DIGEST_PATTERN = /^[0-9a-f]{64}$/;
|
|
5
|
+
function sha256(bytes) {
|
|
6
|
+
return createHash("sha256").update(bytes).digest("hex");
|
|
7
|
+
}
|
|
8
|
+
function hasher() {
|
|
9
|
+
return createHash("sha256");
|
|
10
|
+
}
|
|
11
|
+
function finish(hash) {
|
|
12
|
+
return hash.digest("hex");
|
|
13
|
+
}
|
|
14
|
+
function isDigest(value) {
|
|
15
|
+
return DIGEST_PATTERN.test(value);
|
|
16
|
+
}
|
|
17
|
+
function digestHex(digest) {
|
|
18
|
+
if (!isDigest(digest)) throw new Error(`not a lowercase hex sha256 digest: ${digest}`);
|
|
19
|
+
return digest;
|
|
20
|
+
}
|
|
21
|
+
function canonicalJson(value) {
|
|
22
|
+
if (value === null || typeof value === "boolean" || typeof value === "string") return JSON.stringify(value);
|
|
23
|
+
if (typeof value === "number") {
|
|
24
|
+
if (!Number.isFinite(value)) throw new Error("canonical JSON cannot hold a non-finite number");
|
|
25
|
+
return JSON.stringify(value);
|
|
26
|
+
}
|
|
27
|
+
if (Array.isArray(value)) {
|
|
28
|
+
let out2 = "[";
|
|
29
|
+
for (let i = 0; i < value.length; i++) out2 += (i === 0 ? "" : ",") + canonicalJson(value[i]);
|
|
30
|
+
return `${out2}]`;
|
|
31
|
+
}
|
|
32
|
+
const record = value;
|
|
33
|
+
const keys = Object.keys(record).sort(compareStrings);
|
|
34
|
+
let out = "{";
|
|
35
|
+
for (let i = 0; i < keys.length; i++) {
|
|
36
|
+
out += `${i === 0 ? "" : ","}${JSON.stringify(keys[i])}:${canonicalJson(record[keys[i]])}`;
|
|
37
|
+
}
|
|
38
|
+
return `${out}}`;
|
|
39
|
+
}
|
|
40
|
+
function compareStrings(a, b) {
|
|
41
|
+
const n = a.length < b.length ? a.length : b.length;
|
|
42
|
+
for (let i = 0; i < n; i++) {
|
|
43
|
+
const ca = a.codePointAt(i);
|
|
44
|
+
const cb = b.codePointAt(i);
|
|
45
|
+
if (ca !== cb) return ca < cb ? -1 : 1;
|
|
46
|
+
if (ca > 65535) i++;
|
|
47
|
+
}
|
|
48
|
+
return a.length - b.length;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export { canonicalJson, compareStrings, digestHex, finish, hasher, isDigest, sha256 };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { parseEnvFile, formatEnvFile } from './chunk-
|
|
3
|
-
import { ENV_SCOPE, PUBLIC_ENV_PREFIX } from './chunk-
|
|
4
|
-
import { parseArgs, flagBool } from './chunk-
|
|
5
|
-
import { ApiClient } from './chunk-
|
|
6
|
-
import { readAuth, readProjectLink } from './chunk-
|
|
7
|
-
import { info, CliError, CLI_ERROR_CODE, dim } from './chunk-
|
|
2
|
+
import { parseEnvFile, formatEnvFile } from './chunk-ECGDRU56.mjs';
|
|
3
|
+
import { ENV_SCOPE, PUBLIC_ENV_PREFIX } from './chunk-LLRUOIMU.mjs';
|
|
4
|
+
import { parseArgs, flagBool } from './chunk-XQAHREKO.mjs';
|
|
5
|
+
import { ApiClient } from './chunk-XBQ4LO2N.mjs';
|
|
6
|
+
import { readAuth, readProjectLink } from './chunk-GGPN4QYQ.mjs';
|
|
7
|
+
import { info, CliError, CLI_ERROR_CODE, dim } from './chunk-I7GEHLDD.mjs';
|
|
8
8
|
import { spawn } from 'child_process';
|
|
9
9
|
import { promises } from 'fs';
|
|
10
10
|
import path from 'path';
|