@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,71 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { keyLabel } from './chunk-TYR4Q37L.mjs';
|
|
3
|
+
import { loadSigningKey, registrationFor, generateSigningKey, writeSigningKey, withRegistration, removeSigningKey, remoteFromEnv, signingKeyDir } from './chunk-XZG3DTXV.mjs';
|
|
4
|
+
import { remoteCall } from './chunk-JNCEKW2Y.mjs';
|
|
5
|
+
import './chunk-BTNVYAC4.mjs';
|
|
6
|
+
import './chunk-VHK7WBO3.mjs';
|
|
7
|
+
import './chunk-454RQ6NR.mjs';
|
|
8
|
+
import './chunk-JKECUAAV.mjs';
|
|
9
|
+
import './chunk-HQPZQIWW.mjs';
|
|
10
|
+
import './chunk-KQNZKV6E.mjs';
|
|
11
|
+
import './chunk-QVR6V6QP.mjs';
|
|
12
|
+
import './chunk-N2WZJX5P.mjs';
|
|
13
|
+
import './chunk-EYEMPIMP.mjs';
|
|
14
|
+
import './chunk-BGM7CH5G.mjs';
|
|
15
|
+
import './chunk-25ZPFHLF.mjs';
|
|
16
|
+
import './chunk-SGT5IJVW.mjs';
|
|
17
|
+
import { parseArgs } from './chunk-XQAHREKO.mjs';
|
|
18
|
+
import './chunk-XBQ4LO2N.mjs';
|
|
19
|
+
import './chunk-GGPN4QYQ.mjs';
|
|
20
|
+
import { CliError, CLI_ERROR_CODE, success, bold, result, info, dim } from './chunk-I7GEHLDD.mjs';
|
|
21
|
+
|
|
22
|
+
// src/interactives/commands/keys.ts
|
|
23
|
+
var USAGE = "usage: cimplify keys list, cimplify keys rotate, or cimplify keys revoke <key_id>";
|
|
24
|
+
var LIST = "list";
|
|
25
|
+
var ROTATE = "rotate";
|
|
26
|
+
var REVOKE = "revoke";
|
|
27
|
+
function parseKeysCommand(positional) {
|
|
28
|
+
const [action, keyId] = positional;
|
|
29
|
+
if (action === LIST || action === ROTATE) return { action };
|
|
30
|
+
if (action === REVOKE && keyId) return { action, keyId };
|
|
31
|
+
throw new CliError(CLI_ERROR_CODE.INVALID_INPUT, USAGE);
|
|
32
|
+
}
|
|
33
|
+
async function rotateSigningKey(remote, keyDir) {
|
|
34
|
+
const current = await loadSigningKey(keyDir);
|
|
35
|
+
const previous = current === null ? null : registrationFor(current, remote.origin);
|
|
36
|
+
const next = generateSigningKey();
|
|
37
|
+
const registered = await remoteCall(
|
|
38
|
+
() => previous === null ? remote.registerSigningKey(next.rawPublicKey, keyLabel()) : remote.rotateSigningKey(previous.keyId, next.rawPublicKey, keyLabel())
|
|
39
|
+
);
|
|
40
|
+
await writeSigningKey(keyDir, withRegistration(next, { origin: remote.origin, keyId: registered.keyId }));
|
|
41
|
+
return registered;
|
|
42
|
+
}
|
|
43
|
+
async function revokeSigningKey(remote, keyDir, keyId) {
|
|
44
|
+
await remoteCall(() => remote.revokeSigningKey(keyId));
|
|
45
|
+
const local = await loadSigningKey(keyDir);
|
|
46
|
+
if (local !== null && registrationFor(local, remote.origin)?.keyId === keyId) await removeSigningKey(keyDir);
|
|
47
|
+
}
|
|
48
|
+
async function run(argv) {
|
|
49
|
+
const command = parseKeysCommand(parseArgs(argv).positional);
|
|
50
|
+
const remote = await remoteFromEnv();
|
|
51
|
+
const keyDir = signingKeyDir();
|
|
52
|
+
if (command.action === ROTATE) {
|
|
53
|
+
const rotated = await rotateSigningKey(remote, keyDir);
|
|
54
|
+
success(`Signing with new key ${bold(rotated.keyId)}`);
|
|
55
|
+
result(rotated);
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
if (command.action === REVOKE) {
|
|
59
|
+
await revokeSigningKey(remote, keyDir, command.keyId);
|
|
60
|
+
success(`Revoked signing key ${bold(command.keyId)}`);
|
|
61
|
+
result({ revoked: command.keyId });
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
const local = await loadSigningKey(keyDir);
|
|
65
|
+
const localId = local === null ? null : registrationFor(local, remote.origin)?.keyId ?? null;
|
|
66
|
+
const keys = await remoteCall(() => remote.listSigningKeys());
|
|
67
|
+
for (const k of keys) info(`${k.keyId}${k.keyId === localId ? ` ${bold("(this machine)")}` : ""} ${dim(k.label ?? "")} ${dim(k.createdAt)}`);
|
|
68
|
+
result(keys);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export { run as default, parseKeysCommand, revokeSigningKey, rotateSigningKey };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { fileProject } from './chunk-74QZQSCL.mjs';
|
|
3
|
+
import { requireInteractiveProject } from './chunk-BTNVYAC4.mjs';
|
|
4
|
+
import './chunk-VHK7WBO3.mjs';
|
|
5
|
+
import './chunk-454RQ6NR.mjs';
|
|
6
|
+
import './chunk-JKECUAAV.mjs';
|
|
7
|
+
import './chunk-HQPZQIWW.mjs';
|
|
8
|
+
import './chunk-KQNZKV6E.mjs';
|
|
9
|
+
import './chunk-N2WZJX5P.mjs';
|
|
10
|
+
import './chunk-EYEMPIMP.mjs';
|
|
11
|
+
import './chunk-BGM7CH5G.mjs';
|
|
12
|
+
import './chunk-25ZPFHLF.mjs';
|
|
13
|
+
import './chunk-SGT5IJVW.mjs';
|
|
14
|
+
import { parseArgs } from './chunk-XQAHREKO.mjs';
|
|
15
|
+
import './chunk-GGPN4QYQ.mjs';
|
|
16
|
+
import { bold, info, dim, result } from './chunk-I7GEHLDD.mjs';
|
|
17
|
+
import path from 'path';
|
|
18
|
+
import { TEMPLATE_LINE_CEILINGS, measureGameLines } from '@cimplify/sdk/interactives/authoring';
|
|
19
|
+
|
|
20
|
+
var TEMPLATES_FLAG = "templates";
|
|
21
|
+
var COLUMN_GAP = 2;
|
|
22
|
+
var TOTAL_LABEL = "total";
|
|
23
|
+
function templateLineTable() {
|
|
24
|
+
return Object.entries(TEMPLATE_LINE_CEILINGS).map(([template, lines]) => ({ template, lines })).sort((a, b) => a.lines - b.lines || (a.template < b.template ? -1 : 1));
|
|
25
|
+
}
|
|
26
|
+
function renderLineTable(rows, total) {
|
|
27
|
+
const width = Math.max(TOTAL_LABEL.length, ...rows.map((r) => r.name.length)) + COLUMN_GAP;
|
|
28
|
+
const digits = Math.max(String(total ?? 0).length, ...rows.map((r) => String(r.lines).length));
|
|
29
|
+
const out = rows.map((r) => `${r.name.padEnd(width)}${String(r.lines).padStart(digits)}`);
|
|
30
|
+
if (total !== null) out.push(bold(`${TOTAL_LABEL.padEnd(width)}${String(total).padStart(digits)}`));
|
|
31
|
+
return out;
|
|
32
|
+
}
|
|
33
|
+
function describeLines(lines) {
|
|
34
|
+
return renderLineTable(
|
|
35
|
+
lines.files.map((f) => ({ name: f.path, lines: f.lines })),
|
|
36
|
+
lines.total
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
async function run(argv) {
|
|
40
|
+
const args = parseArgs(argv);
|
|
41
|
+
if (args.flags.has(TEMPLATES_FLAG)) {
|
|
42
|
+
const rows = templateLineTable();
|
|
43
|
+
info(dim("game code lines per shipped template (non-blank, non-comment; the SDK ratchet ceiling)"));
|
|
44
|
+
for (const line of renderLineTable(rows.map((r) => ({ name: r.template, lines: r.lines })), null)) info(line);
|
|
45
|
+
result(rows);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const root = path.resolve(args.positional[0] ?? process.cwd());
|
|
49
|
+
requireInteractiveProject(root, "lines");
|
|
50
|
+
const lines = await measureGameLines(fileProject(root));
|
|
51
|
+
info(dim("game code lines under src (non-blank, non-comment; tests excluded)"));
|
|
52
|
+
for (const line of describeLines(lines)) info(line);
|
|
53
|
+
result(lines);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export { run as default, describeLines, renderLineTable, templateLineTable };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { gitDetectRoot, gitGetRemoteUrl, gitAddRemote } from './chunk-
|
|
3
|
-
import './chunk-
|
|
4
|
-
import { parseArgs } from './chunk-
|
|
5
|
-
import { ApiClient } from './chunk-
|
|
6
|
-
import { readAuth, writeProjectLink } from './chunk-
|
|
7
|
-
import { CliError, CLI_ERROR_CODE, success, info, dim, result } from './chunk-
|
|
2
|
+
import { gitDetectRoot, gitGetRemoteUrl, gitAddRemote } from './chunk-EOOOXVHR.mjs';
|
|
3
|
+
import './chunk-LLRUOIMU.mjs';
|
|
4
|
+
import { parseArgs } from './chunk-XQAHREKO.mjs';
|
|
5
|
+
import { ApiClient } from './chunk-XBQ4LO2N.mjs';
|
|
6
|
+
import { readAuth, writeProjectLink } from './chunk-GGPN4QYQ.mjs';
|
|
7
|
+
import { CliError, CLI_ERROR_CODE, success, info, dim, result } from './chunk-I7GEHLDD.mjs';
|
|
8
8
|
|
|
9
9
|
// src/commands/link.ts
|
|
10
10
|
function projectEndpoint(businessId, projectId) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { parseArgs, flagBool, flagString } from './chunk-
|
|
3
|
-
import { isJsonMode, result, info, CliError, CLI_ERROR_CODE, configureOutput, OUTPUT_MODE } from './chunk-
|
|
2
|
+
import { parseArgs, flagBool, flagString } from './chunk-XQAHREKO.mjs';
|
|
3
|
+
import { isJsonMode, result, info, CliError, CLI_ERROR_CODE, configureOutput, OUTPUT_MODE } from './chunk-I7GEHLDD.mjs';
|
|
4
4
|
import { promises } from 'fs';
|
|
5
5
|
import path from 'path';
|
|
6
6
|
import { parse } from '@babel/parser';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { REGISTRY_INDEX } from './chunk-
|
|
3
|
-
import { parseArgs, flagBool } from './chunk-
|
|
4
|
-
import { CliError, CLI_ERROR_CODE, info, bold, dim,
|
|
2
|
+
import { REGISTRY_INDEX } from './chunk-LJDIQ4PF.mjs';
|
|
3
|
+
import { parseArgs, flagBool } from './chunk-XQAHREKO.mjs';
|
|
4
|
+
import { CliError, CLI_ERROR_CODE, info, bold, dim, honey, result } from './chunk-I7GEHLDD.mjs';
|
|
5
5
|
|
|
6
6
|
// src/commands/list.ts
|
|
7
7
|
async function run(argv) {
|
|
@@ -10,13 +10,9 @@ async function run(argv) {
|
|
|
10
10
|
const componentsOnly = flagBool(args, "components");
|
|
11
11
|
const index = REGISTRY_INDEX;
|
|
12
12
|
if (!index || !Array.isArray(index.components)) {
|
|
13
|
-
throw new CliError(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
{
|
|
17
|
-
remediation: "Rebuild the CLI with the SDK present: `cd packages/sdk && bun run build && cd ../cli && bun run build`."
|
|
18
|
-
}
|
|
19
|
-
);
|
|
13
|
+
throw new CliError(CLI_ERROR_CODE.NOT_FOUND, "Embedded SDK component registry is empty.", {
|
|
14
|
+
remediation: "Rebuild the CLI with the SDK present: `cd packages/sdk && bun run build && cd ../cli && bun run build`."
|
|
15
|
+
});
|
|
20
16
|
}
|
|
21
17
|
const filtered = index.components.filter((entry) => {
|
|
22
18
|
if (utilitiesOnly) return entry.type === "utility";
|
|
@@ -29,7 +25,7 @@ async function run(argv) {
|
|
|
29
25
|
info("");
|
|
30
26
|
for (const entry of filtered) {
|
|
31
27
|
const tag = entry.type === "utility" ? dim(" (utility)") : "";
|
|
32
|
-
info(` ${
|
|
28
|
+
info(` ${honey(entry.name.padEnd(maxName))} ${entry.description}${tag}`);
|
|
33
29
|
}
|
|
34
30
|
info("");
|
|
35
31
|
info(dim("Eject a component into your project with `cimplify add <name>`."));
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { requireInteractiveProject } from './chunk-BTNVYAC4.mjs';
|
|
3
|
+
import './chunk-VHK7WBO3.mjs';
|
|
4
|
+
import './chunk-454RQ6NR.mjs';
|
|
5
|
+
import './chunk-JKECUAAV.mjs';
|
|
6
|
+
import { LOCKFILE, parseLockfile, lockedMissingOperations, withCurrentContract, serializeLockfile } from './chunk-HQPZQIWW.mjs';
|
|
7
|
+
import './chunk-KQNZKV6E.mjs';
|
|
8
|
+
import './chunk-N2WZJX5P.mjs';
|
|
9
|
+
import './chunk-EYEMPIMP.mjs';
|
|
10
|
+
import './chunk-BGM7CH5G.mjs';
|
|
11
|
+
import './chunk-25ZPFHLF.mjs';
|
|
12
|
+
import './chunk-SGT5IJVW.mjs';
|
|
13
|
+
import { parseArgs, flagBool } from './chunk-XQAHREKO.mjs';
|
|
14
|
+
import './chunk-GGPN4QYQ.mjs';
|
|
15
|
+
import { CliError, CLI_ERROR_CODE, success, info, dim, warn, result } from './chunk-I7GEHLDD.mjs';
|
|
16
|
+
import { existsSync, promises } from 'fs';
|
|
17
|
+
import path from 'path';
|
|
18
|
+
import { CTX_CONTRACT_VERSION, CTX_CONTRACT_FINGERPRINT } from '@cimplify/sdk/interactives';
|
|
19
|
+
|
|
20
|
+
async function lockStatus(root, update) {
|
|
21
|
+
const lockPath = path.join(root, LOCKFILE);
|
|
22
|
+
if (!existsSync(lockPath)) {
|
|
23
|
+
throw new CliError(CLI_ERROR_CODE.INVALID_INPUT, `${LOCKFILE} is missing; run cimplify dev or cimplify test to create it`);
|
|
24
|
+
}
|
|
25
|
+
const parsed = parseLockfile(await promises.readFile(lockPath, "utf8"));
|
|
26
|
+
if (parsed.lockfile === null) {
|
|
27
|
+
throw new CliError(CLI_ERROR_CODE.INVALID_INPUT, `${LOCKFILE} has errors; fix it before updating the lock`);
|
|
28
|
+
}
|
|
29
|
+
const lock = parsed.lockfile;
|
|
30
|
+
const missing = lockedMissingOperations(lock);
|
|
31
|
+
const next = update ? withCurrentContract(lock) : lock;
|
|
32
|
+
const updated = next !== lock;
|
|
33
|
+
if (updated) await promises.writeFile(lockPath, serializeLockfile(next));
|
|
34
|
+
return {
|
|
35
|
+
contractVersion: next.ctxContractVersion,
|
|
36
|
+
fingerprint: next.ctxFingerprint,
|
|
37
|
+
current: next.ctxContractVersion === CTX_CONTRACT_VERSION && next.ctxFingerprint === CTX_CONTRACT_FINGERPRINT,
|
|
38
|
+
known: updated || missing !== null,
|
|
39
|
+
missingOperations: updated ? [] : [...missing ?? []].sort(),
|
|
40
|
+
updated
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
async function run(argv) {
|
|
44
|
+
const args = parseArgs(argv);
|
|
45
|
+
const root = process.cwd();
|
|
46
|
+
requireInteractiveProject(root, "lock");
|
|
47
|
+
const status = await lockStatus(root, flagBool(args, "update"));
|
|
48
|
+
if (status.updated) success(`${LOCKFILE} now pins ctx contract ${status.contractVersion} (${status.fingerprint})`);
|
|
49
|
+
else if (status.current) success(`${LOCKFILE} pins the current ctx contract (${status.fingerprint})`);
|
|
50
|
+
else if (status.known) {
|
|
51
|
+
info(`${LOCKFILE} pins ctx ${status.fingerprint}, an earlier compatible fingerprint; it still builds`);
|
|
52
|
+
if (status.missingOperations.length > 0) info(dim(`Not in it: ${status.missingOperations.join(", ")}. Run cimplify lock --update to use them`));
|
|
53
|
+
} else warn(`${LOCKFILE} pins an unknown ctx fingerprint ${status.fingerprint}; run cimplify lock --update`);
|
|
54
|
+
result(status);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export { run as default, lockStatus };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { generatePkcePair, openBrowser } from './chunk-
|
|
3
|
-
import { parseArgs, flagString, flagBool } from './chunk-
|
|
4
|
-
import { resolveBaseUrl, ApiClient } from './chunk-
|
|
5
|
-
import { writeAuth } from './chunk-
|
|
6
|
-
import { CliError, CLI_ERROR_CODE, success, result, isJsonMode, step, info, dim } from './chunk-
|
|
2
|
+
import { generatePkcePair, openBrowser } from './chunk-V3R2NYQR.mjs';
|
|
3
|
+
import { parseArgs, flagString, flagBool } from './chunk-XQAHREKO.mjs';
|
|
4
|
+
import { resolveBaseUrl, ApiClient } from './chunk-XBQ4LO2N.mjs';
|
|
5
|
+
import { writeAuth } from './chunk-GGPN4QYQ.mjs';
|
|
6
|
+
import { CliError, CLI_ERROR_CODE, success, result, isJsonMode, step, info, dim } from './chunk-I7GEHLDD.mjs';
|
|
7
7
|
import os from 'os';
|
|
8
8
|
|
|
9
9
|
var FLAG_API_KEY = "api-key";
|
|
@@ -23,10 +23,12 @@ async function run(argv) {
|
|
|
23
23
|
const explicitKey = flagString(args, FLAG_API_KEY);
|
|
24
24
|
if (explicitKey) {
|
|
25
25
|
await loginWithKey(baseUrl, explicitKey);
|
|
26
|
-
|
|
26
|
+
} else {
|
|
27
|
+
const scopes = parseScopeFlag(flagString(args, FLAG_SCOPE));
|
|
28
|
+
await loginWithBrowser(baseUrl, flagBool(args, FLAG_NO_BROWSER), scopes);
|
|
27
29
|
}
|
|
28
|
-
const
|
|
29
|
-
await
|
|
30
|
+
const { refreshEngineRuntime } = await import('./engine-runtime-fetch-QVKJVC3W.mjs');
|
|
31
|
+
await refreshEngineRuntime(null);
|
|
30
32
|
}
|
|
31
33
|
function parseScopeFlag(raw) {
|
|
32
34
|
if (!raw) return [];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { clearAuth } from './chunk-
|
|
3
|
-
import { success, info, result } from './chunk-
|
|
2
|
+
import { clearAuth } from './chunk-GGPN4QYQ.mjs';
|
|
3
|
+
import { success, info, result } from './chunk-I7GEHLDD.mjs';
|
|
4
4
|
|
|
5
5
|
// src/commands/logout.ts
|
|
6
6
|
async function run(_argv) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { TERMINAL_DEPLOYMENT_STATUSES } from './chunk-
|
|
3
|
-
import { parseArgs, flagString, flagBool } from './chunk-
|
|
4
|
-
import { ApiClient } from './chunk-
|
|
5
|
-
import { readAuth, readProjectLink, readProjectState } from './chunk-
|
|
6
|
-
import { CliError, CLI_ERROR_CODE, isJsonMode, failure, result, red } from './chunk-
|
|
2
|
+
import { TERMINAL_DEPLOYMENT_STATUSES } from './chunk-LLRUOIMU.mjs';
|
|
3
|
+
import { parseArgs, flagString, flagBool } from './chunk-XQAHREKO.mjs';
|
|
4
|
+
import { ApiClient } from './chunk-XBQ4LO2N.mjs';
|
|
5
|
+
import { readAuth, readProjectLink, readProjectState } from './chunk-GGPN4QYQ.mjs';
|
|
6
|
+
import { CliError, CLI_ERROR_CODE, isJsonMode, failure, result, red } from './chunk-I7GEHLDD.mjs';
|
|
7
7
|
|
|
8
8
|
// src/commands/logs.ts
|
|
9
9
|
var FLAG_DEPLOYMENT = "deployment";
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { remoteFromEnv } from './chunk-XZG3DTXV.mjs';
|
|
3
|
+
import { readInteractiveId, remoteCall } from './chunk-JNCEKW2Y.mjs';
|
|
4
|
+
import { requireInteractiveProject } from './chunk-BTNVYAC4.mjs';
|
|
5
|
+
import './chunk-VHK7WBO3.mjs';
|
|
6
|
+
import './chunk-454RQ6NR.mjs';
|
|
7
|
+
import './chunk-JKECUAAV.mjs';
|
|
8
|
+
import './chunk-HQPZQIWW.mjs';
|
|
9
|
+
import './chunk-KQNZKV6E.mjs';
|
|
10
|
+
import './chunk-N2WZJX5P.mjs';
|
|
11
|
+
import './chunk-EYEMPIMP.mjs';
|
|
12
|
+
import './chunk-BGM7CH5G.mjs';
|
|
13
|
+
import './chunk-25ZPFHLF.mjs';
|
|
14
|
+
import './chunk-SGT5IJVW.mjs';
|
|
15
|
+
import { parseArgs, flagString } from './chunk-XQAHREKO.mjs';
|
|
16
|
+
import './chunk-XBQ4LO2N.mjs';
|
|
17
|
+
import './chunk-GGPN4QYQ.mjs';
|
|
18
|
+
import { CliError, CLI_ERROR_CODE, info, dim, result } from './chunk-I7GEHLDD.mjs';
|
|
19
|
+
|
|
20
|
+
// src/interactives/commands/logs.ts
|
|
21
|
+
var DEFAULT_LIMIT = 100;
|
|
22
|
+
var MAX_LIMIT = 1e3;
|
|
23
|
+
async function interactiveLogs(root, remote, revision, limit) {
|
|
24
|
+
const id = await readInteractiveId(root);
|
|
25
|
+
return remoteCall(() => remote.logs(id, { revision, limit }));
|
|
26
|
+
}
|
|
27
|
+
function parseLimit(value) {
|
|
28
|
+
if (value === void 0) return DEFAULT_LIMIT;
|
|
29
|
+
const n = Number(value);
|
|
30
|
+
if (!Number.isInteger(n) || n < 1 || n > MAX_LIMIT) {
|
|
31
|
+
throw new CliError(CLI_ERROR_CODE.INVALID_INPUT, `--limit must be a whole number from 1 to ${MAX_LIMIT}`);
|
|
32
|
+
}
|
|
33
|
+
return n;
|
|
34
|
+
}
|
|
35
|
+
async function run(argv) {
|
|
36
|
+
const args = parseArgs(argv);
|
|
37
|
+
const root = process.cwd();
|
|
38
|
+
requireInteractiveProject(root, "logs");
|
|
39
|
+
const entries = await interactiveLogs(root, await remoteFromEnv(), flagString(args, "revision") ?? null, parseLimit(flagString(args, "limit")));
|
|
40
|
+
for (const e of entries) info(`${dim(e.at)} ${e.revision} ${e.level} ${e.message}`);
|
|
41
|
+
result(entries);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export { run as default, interactiveLogs, parseLimit };
|