@cimplify/cli 0.12.1 → 0.13.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/dist/{add-5ODVFWVR.mjs → add-Q4OFUCNB.mjs} +3 -2
- package/dist/agent-3PAQPC7W.mjs +25 -0
- package/dist/{assets-4D7VXRUE.mjs → assets-Y4JE6MSG.mjs} +4 -3
- package/dist/{auth-step-up-NOSM4PUR.mjs → auth-step-up-EHL5PM2L.mjs} +5 -4
- package/dist/{cancel-PPNH6K67.mjs → cancel-QSZE2XC2.mjs} +4 -3
- package/dist/{dev-6OWQ2FZ7.mjs → chunk-3UV4P4DM.mjs} +57 -158
- package/dist/{chunk-ITAFAORS.mjs → chunk-4YIFBYBV.mjs} +2 -1
- package/dist/{chunk-JPUGWNVY.mjs → chunk-5GYD3EHJ.mjs} +5 -5
- package/dist/{chunk-DBZ3UOQ2.mjs → chunk-5U5OXOPN.mjs} +1 -1
- package/dist/{chunk-FOJVWJ57.mjs → chunk-5XXUHANH.mjs} +1 -1
- package/dist/{chunk-F4S5KETY.mjs → chunk-JPXK5BLA.mjs} +1 -1
- package/dist/{chunk-K5464A3L.mjs → chunk-OVHZV57L.mjs} +1 -1
- package/dist/{chunk-UBAI443T.mjs → chunk-QA36VSLX.mjs} +1 -1
- package/dist/{chunk-6C2QY3ZP.mjs → chunk-RR4NOZGY.mjs} +5 -4
- package/dist/{chunk-GLXONXS3.mjs → chunk-UP7N53C4.mjs} +1 -1
- package/dist/{chunk-VTR5R5NQ.mjs → chunk-VJJDGHZC.mjs} +2 -1
- package/dist/{chunk-E2T2SBP5.mjs → chunk-YPC4VU65.mjs} +1 -73
- package/dist/chunk-ZPVN6UXL.mjs +74 -0
- package/dist/{deploy-H7245HMP.mjs → deploy-UTAYLZOM.mjs} +8 -7
- package/dist/dev-QC55VHDI.mjs +165 -0
- package/dist/dispatcher.mjs +29 -27
- package/dist/{doctor-UMR72TNV.mjs → doctor-4BHP3JT7.mjs} +8 -7
- package/dist/{domains-H3K2WW55.mjs → domains-OS3DXSDN.mjs} +5 -4
- package/dist/{env-3HY7HFVT.mjs → env-UVO4OIEO.mjs} +6 -5
- package/dist/{explain-RD6TURI3.mjs → explain-OQZKABWP.mjs} +3 -2
- package/dist/{inspect-CGYX4DDF.mjs → inspect-ULWQHT7J.mjs} +3 -2
- package/dist/introspect-X7GQ7XUE.mjs +9 -0
- package/dist/{link-O4WAUWWE.mjs → link-VQN2WPZO.mjs} +4 -3
- package/dist/{list-27TS2L47.mjs → list-3OGYEBKV.mjs} +2 -1
- package/dist/{login-SCWIIEGR.mjs → login-UZ5Y7GIO.mjs} +5 -4
- package/dist/{logout-3RLBZ33M.mjs → logout-XYWZR6QJ.mjs} +3 -2
- package/dist/{logs-2ECJQ3MU.mjs → logs-YNXDXAF7.mjs} +4 -3
- package/dist/{mock-TSUKCLWU.mjs → mock-HFVAAYK2.mjs} +2 -1
- package/dist/{projects-2BITX2YE.mjs → projects-RJ44DJKZ.mjs} +4 -3
- package/dist/repo-OK6CVG3G.mjs +9 -0
- package/dist/{rollback-4YLTZRXP.mjs → rollback-Z2PRL7FS.mjs} +5 -4
- package/dist/{status-IA7PJ4TV.mjs → status-RR3GGTVU.mjs} +4 -3
- package/dist/{unlink-RFK74SFP.mjs → unlink-JBVZYOA3.mjs} +3 -2
- package/dist/{update-MCTGCQIY.mjs → update-6DO57SJN.mjs} +4 -3
- package/dist/{whoami-6GFMOY2M.mjs → whoami-5G32NNEP.mjs} +4 -3
- package/package.json +1 -1
- package/dist/introspect-M2KNI7TW.mjs +0 -8
- package/dist/repo-WSUAHXWO.mjs +0 -8
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { REGISTRY_INDEX, REGISTRY } from './chunk-W3WLADJP.mjs';
|
|
3
|
-
import { promptYesNo } from './chunk-
|
|
3
|
+
import { promptYesNo } from './chunk-4YIFBYBV.mjs';
|
|
4
4
|
import { parseArgs, flagString, flagBool } from './chunk-C4M3DXKC.mjs';
|
|
5
|
-
import { CliError, CLI_ERROR_CODE
|
|
5
|
+
import { CliError, CLI_ERROR_CODE } from './chunk-YPC4VU65.mjs';
|
|
6
|
+
import { info, bold, dim, success, result, yellow } from './chunk-ZPVN6UXL.mjs';
|
|
6
7
|
import { mkdirSync, existsSync, writeFileSync } from 'fs';
|
|
7
8
|
import { resolve, join, dirname } from 'path';
|
|
8
9
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { startTunnelRuntime } from './chunk-3UV4P4DM.mjs';
|
|
3
|
+
import { info } from './chunk-ZPVN6UXL.mjs';
|
|
4
|
+
|
|
5
|
+
// src/commands/agent.ts
|
|
6
|
+
var FLAG_CHECK = "--check";
|
|
7
|
+
async function run(argv) {
|
|
8
|
+
if (argv.includes(FLAG_CHECK)) {
|
|
9
|
+
info("ok");
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
const cwd = process.cwd();
|
|
13
|
+
info("cimplify agent: supervising the preview tunnel");
|
|
14
|
+
const stop = startTunnelRuntime(cwd);
|
|
15
|
+
await new Promise((resolve) => {
|
|
16
|
+
const shutdown = () => {
|
|
17
|
+
stop();
|
|
18
|
+
resolve();
|
|
19
|
+
};
|
|
20
|
+
process.once("SIGINT", shutdown);
|
|
21
|
+
process.once("SIGTERM", shutdown);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export { run as default };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { parseArgs, flagString, flagBool } from './chunk-C4M3DXKC.mjs';
|
|
3
|
-
import { ApiClient } from './chunk-
|
|
4
|
-
import { readAuth } from './chunk-
|
|
5
|
-
import { CliError, CLI_ERROR_CODE
|
|
3
|
+
import { ApiClient } from './chunk-JPXK5BLA.mjs';
|
|
4
|
+
import { readAuth } from './chunk-QA36VSLX.mjs';
|
|
5
|
+
import { CliError, CLI_ERROR_CODE } from './chunk-YPC4VU65.mjs';
|
|
6
|
+
import { step, yellow, dim, success, info, result, bold, green } from './chunk-ZPVN6UXL.mjs';
|
|
6
7
|
import { createHash } from 'crypto';
|
|
7
8
|
import { promises } from 'fs';
|
|
8
9
|
import path from 'path';
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { startLoopbackServer, generateState, openBrowser } from './chunk-
|
|
2
|
+
import { startLoopbackServer, generateState, openBrowser } from './chunk-UP7N53C4.mjs';
|
|
3
3
|
import { parseArgs, flagString, flagBool } from './chunk-C4M3DXKC.mjs';
|
|
4
|
-
import { resolveBaseUrl } from './chunk-
|
|
5
|
-
import { readAuth, writeStepUp } from './chunk-
|
|
6
|
-
import {
|
|
4
|
+
import { resolveBaseUrl } from './chunk-JPXK5BLA.mjs';
|
|
5
|
+
import { readAuth, writeStepUp } from './chunk-QA36VSLX.mjs';
|
|
6
|
+
import { CliError, CLI_ERROR_CODE } from './chunk-YPC4VU65.mjs';
|
|
7
|
+
import { isJsonMode, step, info, dim, success, result } from './chunk-ZPVN6UXL.mjs';
|
|
7
8
|
|
|
8
9
|
// src/commands/auth-step-up.ts
|
|
9
10
|
var FLAG_NO_BROWSER = "no-browser";
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { parseArgs } from './chunk-C4M3DXKC.mjs';
|
|
3
|
-
import { ApiClient } from './chunk-
|
|
4
|
-
import { readAuth, readProjectLink } from './chunk-
|
|
5
|
-
import { CliError, CLI_ERROR_CODE
|
|
3
|
+
import { ApiClient } from './chunk-JPXK5BLA.mjs';
|
|
4
|
+
import { readAuth, readProjectLink } from './chunk-QA36VSLX.mjs';
|
|
5
|
+
import { CliError, CLI_ERROR_CODE } from './chunk-YPC4VU65.mjs';
|
|
6
|
+
import { success, result } from './chunk-ZPVN6UXL.mjs';
|
|
6
7
|
|
|
7
8
|
// src/commands/cancel.ts
|
|
8
9
|
function cancelEndpoint(businessId, projectId, deploymentId) {
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import { parseArgs, flagBool } from './chunk-C4M3DXKC.mjs';
|
|
5
|
-
import { ApiClient } from './chunk-F4S5KETY.mjs';
|
|
6
|
-
import { readAuth, readProjectLink } from './chunk-UBAI443T.mjs';
|
|
7
|
-
import { info, CliError, CLI_ERROR_CODE, dim } from './chunk-E2T2SBP5.mjs';
|
|
2
|
+
import { info, dim } from './chunk-ZPVN6UXL.mjs';
|
|
3
|
+
import http from 'http';
|
|
8
4
|
import { spawn } from 'child_process';
|
|
9
5
|
import { promises, watch } from 'fs';
|
|
10
6
|
import path from 'path';
|
|
11
|
-
import http from 'http';
|
|
12
7
|
|
|
13
8
|
// src/tunnel/v2/codec.ts
|
|
14
9
|
var HEADER_LEN = 9;
|
|
@@ -418,6 +413,8 @@ function isRequest(message) {
|
|
|
418
413
|
return typeof message.op === "string";
|
|
419
414
|
}
|
|
420
415
|
var MessageFramer = class {
|
|
416
|
+
// Annotated Uint8Array (ArrayBufferLike) so concat/subarray/slice results
|
|
417
|
+
// assign back cleanly under TS 5.7's Uint8Array<ArrayBuffer> generic.
|
|
421
418
|
buffer = new Uint8Array(0);
|
|
422
419
|
push(bytes) {
|
|
423
420
|
this.buffer = concat(this.buffer, bytes);
|
|
@@ -1304,6 +1301,9 @@ var StreamHandleV2 = class {
|
|
|
1304
1301
|
}
|
|
1305
1302
|
};
|
|
1306
1303
|
var CONNECTION_STREAM_ID = 0;
|
|
1304
|
+
var LIVENESS_PING_INTERVAL_MS = 15e3;
|
|
1305
|
+
var LIVENESS_TIMEOUT_MS = 45e3;
|
|
1306
|
+
var FROZEN_TICK_GAP_MS = 6e4;
|
|
1307
1307
|
var textEncoder6 = new TextEncoder();
|
|
1308
1308
|
var textDecoder5 = new TextDecoder();
|
|
1309
1309
|
var SessionV2 = class {
|
|
@@ -1313,6 +1313,10 @@ var SessionV2 = class {
|
|
|
1313
1313
|
this.nextStreamId = options.role === "service" ? 1 : 2;
|
|
1314
1314
|
this.connectionSend = new SendWindow(0);
|
|
1315
1315
|
this.connectionRecv = new RecvWindow(options.local.connection_window);
|
|
1316
|
+
this.lastInboundAt = Date.now();
|
|
1317
|
+
this.lastTickAt = Date.now();
|
|
1318
|
+
this.livenessTimer = setInterval(() => this.onLivenessTick(), LIVENESS_PING_INTERVAL_MS);
|
|
1319
|
+
this.livenessTimer.unref?.();
|
|
1316
1320
|
transport.onMessage((bytes) => this.onMessage(bytes));
|
|
1317
1321
|
transport.onClose((reason) => this.teardown(reason));
|
|
1318
1322
|
}
|
|
@@ -1327,6 +1331,37 @@ var SessionV2 = class {
|
|
|
1327
1331
|
draining = false;
|
|
1328
1332
|
closed = false;
|
|
1329
1333
|
sending = Promise.resolve();
|
|
1334
|
+
lastInboundAt;
|
|
1335
|
+
lastTickAt;
|
|
1336
|
+
livenessTimer;
|
|
1337
|
+
onLivenessTick() {
|
|
1338
|
+
if (this.closed) return;
|
|
1339
|
+
const now = Date.now();
|
|
1340
|
+
const tickGap = now - this.lastTickAt;
|
|
1341
|
+
this.lastTickAt = now;
|
|
1342
|
+
if (tickGap < 0 || now < this.lastInboundAt) {
|
|
1343
|
+
this.lastInboundAt = now;
|
|
1344
|
+
return;
|
|
1345
|
+
}
|
|
1346
|
+
if (tickGap > FROZEN_TICK_GAP_MS) {
|
|
1347
|
+
this.abort(`process froze ${Math.round(tickGap / 1e3)}s (suspend/resume); redialing`);
|
|
1348
|
+
return;
|
|
1349
|
+
}
|
|
1350
|
+
if (now - this.lastInboundAt > LIVENESS_TIMEOUT_MS) {
|
|
1351
|
+
this.abort(`no inbound frames for ${Math.round((now - this.lastInboundAt) / 1e3)}s`);
|
|
1352
|
+
return;
|
|
1353
|
+
}
|
|
1354
|
+
void this.enqueueSend({
|
|
1355
|
+
streamId: CONNECTION_STREAM_ID,
|
|
1356
|
+
frameType: FRAME_TYPE_V2.PING,
|
|
1357
|
+
payload: new Uint8Array(0)
|
|
1358
|
+
});
|
|
1359
|
+
}
|
|
1360
|
+
/** Presumed-dead teardown: no farewell frames — the socket is a zombie. */
|
|
1361
|
+
abort(reason) {
|
|
1362
|
+
this.teardown(reason);
|
|
1363
|
+
this.transport.close(1001, reason.slice(0, 100));
|
|
1364
|
+
}
|
|
1330
1365
|
/** Send our HELLO; the peer's must arrive as its first frame. */
|
|
1331
1366
|
async start() {
|
|
1332
1367
|
const payload = textEncoder6.encode(JSON.stringify(this.options.local));
|
|
@@ -1383,6 +1418,7 @@ var SessionV2 = class {
|
|
|
1383
1418
|
this.fail(`undecodable frame: ${error.message}`);
|
|
1384
1419
|
return;
|
|
1385
1420
|
}
|
|
1421
|
+
this.lastInboundAt = Date.now();
|
|
1386
1422
|
if (!this.peer) {
|
|
1387
1423
|
this.onHandshakeFrame(frame);
|
|
1388
1424
|
return;
|
|
@@ -1670,6 +1706,7 @@ var SessionV2 = class {
|
|
|
1670
1706
|
teardown(reason) {
|
|
1671
1707
|
if (this.closed) return;
|
|
1672
1708
|
this.closed = true;
|
|
1709
|
+
clearInterval(this.livenessTimer);
|
|
1673
1710
|
for (const streamId of this.streams.keys()) {
|
|
1674
1711
|
this.dropStream(streamId);
|
|
1675
1712
|
}
|
|
@@ -1868,6 +1905,7 @@ function sameTunnelEndpoint(a, b) {
|
|
|
1868
1905
|
var CONFIG_POLL_MS = 2e3;
|
|
1869
1906
|
var RECONNECT_MIN_MS = 1e3;
|
|
1870
1907
|
var RECONNECT_MAX_MS = 3e4;
|
|
1908
|
+
var STAND_DOWN_RETRY_MS = 5 * 6e4;
|
|
1871
1909
|
var CLOSE_CODE_REPLACED = 4e3;
|
|
1872
1910
|
function makeDefaultCreateClient(workspaceRoot) {
|
|
1873
1911
|
return (config, events) => new NegotiatingAgentClient({
|
|
@@ -1897,6 +1935,7 @@ function startTunnelRuntime(cwd, options = {}) {
|
|
|
1897
1935
|
reconnectTimer = null;
|
|
1898
1936
|
}
|
|
1899
1937
|
};
|
|
1938
|
+
let backoffResetTimer = null;
|
|
1900
1939
|
const startClient = (config) => {
|
|
1901
1940
|
generation += 1;
|
|
1902
1941
|
standDown = false;
|
|
@@ -1905,7 +1944,14 @@ function startTunnelRuntime(cwd, options = {}) {
|
|
|
1905
1944
|
onConnected: () => {
|
|
1906
1945
|
if (stopped || myGeneration !== generation) return;
|
|
1907
1946
|
connected = true;
|
|
1908
|
-
|
|
1947
|
+
if (backoffResetTimer) clearTimeout(backoffResetTimer);
|
|
1948
|
+
backoffResetTimer = setTimeout(() => {
|
|
1949
|
+
backoffResetTimer = null;
|
|
1950
|
+
if (!stopped && connected && myGeneration === generation) {
|
|
1951
|
+
reconnectDelay = RECONNECT_MIN_MS;
|
|
1952
|
+
}
|
|
1953
|
+
}, 1e4);
|
|
1954
|
+
backoffResetTimer.unref?.();
|
|
1909
1955
|
onStatus("(preview tunnel: connected)");
|
|
1910
1956
|
},
|
|
1911
1957
|
onClosed: (reason, closeCode) => {
|
|
@@ -1914,6 +1960,8 @@ function startTunnelRuntime(cwd, options = {}) {
|
|
|
1914
1960
|
if (closeCode === CLOSE_CODE_REPLACED) {
|
|
1915
1961
|
standDown = true;
|
|
1916
1962
|
onStatus("(preview tunnel: replaced by a newer agent; standing down)");
|
|
1963
|
+
reconnectDelay = STAND_DOWN_RETRY_MS;
|
|
1964
|
+
scheduleReconnect();
|
|
1917
1965
|
return;
|
|
1918
1966
|
}
|
|
1919
1967
|
onStatus(`(preview tunnel: disconnected \u2014 ${reason})`);
|
|
@@ -1981,153 +2029,4 @@ function startTunnelRuntime(cwd, options = {}) {
|
|
|
1981
2029
|
};
|
|
1982
2030
|
}
|
|
1983
2031
|
|
|
1984
|
-
|
|
1985
|
-
var FLAG_REMOTE = "remote";
|
|
1986
|
-
var PACKAGE_JSON = "package.json";
|
|
1987
|
-
var ENV_LOCAL_FILE = ".env.local";
|
|
1988
|
-
var PUBLIC_API_URL_KEY = "NEXT_PUBLIC_CIMPLIFY_API_URL";
|
|
1989
|
-
var SCRIPT_DEV = "dev";
|
|
1990
|
-
var PREVIEW_ORIGIN_ENV = "CIMPLIFY_PREVIEW_ORIGIN";
|
|
1991
|
-
async function applyPreviewOrigin(cwd, originList) {
|
|
1992
|
-
const { ensurePreviewOrigin } = await import('./preview-config-344CUZLO.mjs');
|
|
1993
|
-
const origins = originList.split(",").map((origin) => origin.trim()).filter((origin) => origin.length > 0);
|
|
1994
|
-
if (origins.length === 0) return;
|
|
1995
|
-
try {
|
|
1996
|
-
const result = await ensurePreviewOrigin(cwd, origins);
|
|
1997
|
-
if (result.status === "unrecognized") {
|
|
1998
|
-
info(
|
|
1999
|
-
dim(
|
|
2000
|
-
`(preview: could not resolve ${result.file} config shape; hot-reload may be limited)`
|
|
2001
|
-
)
|
|
2002
|
-
);
|
|
2003
|
-
}
|
|
2004
|
-
} catch (err) {
|
|
2005
|
-
info(dim(`(preview: dev-origin setup skipped: ${err.message})`));
|
|
2006
|
-
}
|
|
2007
|
-
}
|
|
2008
|
-
var PM_BUN = "bun";
|
|
2009
|
-
var PM_PNPM = "pnpm";
|
|
2010
|
-
var PM_YARN = "yarn";
|
|
2011
|
-
var PM_NPM = "npm";
|
|
2012
|
-
var LOCKFILE_BUN = "bun.lock";
|
|
2013
|
-
var LOCKFILE_BUN_BINARY = "bun.lockb";
|
|
2014
|
-
var LOCKFILE_PNPM = "pnpm-lock.yaml";
|
|
2015
|
-
var LOCKFILE_YARN = "yarn.lock";
|
|
2016
|
-
var BUNFIG = "bunfig.toml";
|
|
2017
|
-
function envEndpoint(businessId, projectId) {
|
|
2018
|
-
return `/v1/businesses/${encodeURIComponent(businessId)}/projects/${encodeURIComponent(projectId)}/env-vars`;
|
|
2019
|
-
}
|
|
2020
|
-
async function detectPackageManager(cwd) {
|
|
2021
|
-
if (await pathExists(path.join(cwd, LOCKFILE_BUN))) return PM_BUN;
|
|
2022
|
-
if (await pathExists(path.join(cwd, LOCKFILE_BUN_BINARY))) return PM_BUN;
|
|
2023
|
-
if (await pathExists(path.join(cwd, BUNFIG))) return PM_BUN;
|
|
2024
|
-
if (await pathExists(path.join(cwd, LOCKFILE_PNPM))) return PM_PNPM;
|
|
2025
|
-
if (await pathExists(path.join(cwd, LOCKFILE_YARN))) return PM_YARN;
|
|
2026
|
-
return PM_NPM;
|
|
2027
|
-
}
|
|
2028
|
-
async function pathExists(target) {
|
|
2029
|
-
try {
|
|
2030
|
-
await promises.stat(target);
|
|
2031
|
-
return true;
|
|
2032
|
-
} catch (err) {
|
|
2033
|
-
if (err.code === "ENOENT") return false;
|
|
2034
|
-
throw err;
|
|
2035
|
-
}
|
|
2036
|
-
}
|
|
2037
|
-
async function readPackageJson(cwd) {
|
|
2038
|
-
const pkgPath = path.join(cwd, PACKAGE_JSON);
|
|
2039
|
-
let raw;
|
|
2040
|
-
try {
|
|
2041
|
-
raw = await promises.readFile(pkgPath, "utf8");
|
|
2042
|
-
} catch (err) {
|
|
2043
|
-
if (err.code === "ENOENT") {
|
|
2044
|
-
throw new CliError(
|
|
2045
|
-
CLI_ERROR_CODE.INVALID_INPUT,
|
|
2046
|
-
`No package.json in ${cwd}. \`cimplify dev\` runs your project's dev script.`
|
|
2047
|
-
);
|
|
2048
|
-
}
|
|
2049
|
-
throw err;
|
|
2050
|
-
}
|
|
2051
|
-
return JSON.parse(raw);
|
|
2052
|
-
}
|
|
2053
|
-
function mergeEnvEntries(existing, incoming) {
|
|
2054
|
-
const seen = new Set(existing.map((e) => e.key));
|
|
2055
|
-
const merged = [...existing];
|
|
2056
|
-
for (const entry of incoming) {
|
|
2057
|
-
if (seen.has(entry.key)) continue;
|
|
2058
|
-
merged.push(entry);
|
|
2059
|
-
seen.add(entry.key);
|
|
2060
|
-
}
|
|
2061
|
-
return merged;
|
|
2062
|
-
}
|
|
2063
|
-
async function applyRemoteEnv(client, businessId, projectId, apiBaseUrl, cwd) {
|
|
2064
|
-
const records = await client.get(envEndpoint(businessId, projectId), {
|
|
2065
|
-
query: { scope: ENV_SCOPE.PRODUCTION }
|
|
2066
|
-
});
|
|
2067
|
-
const incoming = records.filter((r) => r.value !== null && !r.is_secret).map((r) => ({ key: r.key, value: r.value }));
|
|
2068
|
-
incoming.push({ key: PUBLIC_API_URL_KEY, value: apiBaseUrl });
|
|
2069
|
-
const envPath = path.join(cwd, ENV_LOCAL_FILE);
|
|
2070
|
-
let existing = [];
|
|
2071
|
-
try {
|
|
2072
|
-
const raw = await promises.readFile(envPath, "utf8");
|
|
2073
|
-
existing = parseEnvFile(raw);
|
|
2074
|
-
} catch (err) {
|
|
2075
|
-
if (err.code !== "ENOENT") throw err;
|
|
2076
|
-
}
|
|
2077
|
-
const merged = mergeEnvEntries(existing, incoming);
|
|
2078
|
-
await promises.writeFile(envPath, formatEnvFile(merged), "utf8");
|
|
2079
|
-
const publicCount = incoming.filter((e) => e.key.startsWith(PUBLIC_ENV_PREFIX)).length;
|
|
2080
|
-
return publicCount;
|
|
2081
|
-
}
|
|
2082
|
-
async function run(argv) {
|
|
2083
|
-
const args = parseArgs(argv);
|
|
2084
|
-
const remote = flagBool(args, FLAG_REMOTE);
|
|
2085
|
-
const cwd = process.cwd();
|
|
2086
|
-
const previewOrigin = process.env[PREVIEW_ORIGIN_ENV];
|
|
2087
|
-
if (remote) {
|
|
2088
|
-
const auth = await readAuth();
|
|
2089
|
-
const link = await readProjectLink();
|
|
2090
|
-
const client = ApiClient.fromAuth(auth);
|
|
2091
|
-
const publicCount = await applyRemoteEnv(
|
|
2092
|
-
client,
|
|
2093
|
-
link.businessId,
|
|
2094
|
-
link.projectId,
|
|
2095
|
-
auth.apiBaseUrl,
|
|
2096
|
-
cwd
|
|
2097
|
-
);
|
|
2098
|
-
const label = link.businessHandle ?? auth.businessHandle ?? auth.businessId;
|
|
2099
|
-
info(`Dev mode: connected to ${label} production data (${publicCount} public var${publicCount === 1 ? "" : "s"} merged)`);
|
|
2100
|
-
} else if (previewOrigin) {
|
|
2101
|
-
info("Dev mode: hosted preview");
|
|
2102
|
-
} else {
|
|
2103
|
-
info("Dev mode: using local mock (`cimplify mock`)");
|
|
2104
|
-
}
|
|
2105
|
-
const pkg = await readPackageJson(cwd);
|
|
2106
|
-
if (!pkg.scripts || !pkg.scripts[SCRIPT_DEV]) {
|
|
2107
|
-
throw new CliError(
|
|
2108
|
-
CLI_ERROR_CODE.INVALID_INPUT,
|
|
2109
|
-
`No "${SCRIPT_DEV}" script in package.json. Add one (e.g. "next dev") and re-run.`
|
|
2110
|
-
);
|
|
2111
|
-
}
|
|
2112
|
-
let stopTunnel = null;
|
|
2113
|
-
if (previewOrigin) {
|
|
2114
|
-
await applyPreviewOrigin(cwd, previewOrigin);
|
|
2115
|
-
stopTunnel = startTunnelRuntime(cwd);
|
|
2116
|
-
}
|
|
2117
|
-
const pm = await detectPackageManager(cwd);
|
|
2118
|
-
info(dim(`(running: ${pm} run ${SCRIPT_DEV})`));
|
|
2119
|
-
const child = spawn(pm, ["run", SCRIPT_DEV], { cwd, stdio: "inherit" });
|
|
2120
|
-
try {
|
|
2121
|
-
await new Promise((resolve, reject) => {
|
|
2122
|
-
child.on("error", (err) => reject(new CliError(CLI_ERROR_CODE.INVALID_INPUT, `Failed to spawn ${pm}: ${err.message}`)));
|
|
2123
|
-
child.on("close", (code) => {
|
|
2124
|
-
process.exitCode = code ?? 0;
|
|
2125
|
-
resolve();
|
|
2126
|
-
});
|
|
2127
|
-
});
|
|
2128
|
-
} finally {
|
|
2129
|
-
stopTunnel?.();
|
|
2130
|
-
}
|
|
2131
|
-
}
|
|
2132
|
-
|
|
2133
|
-
export { run as default, detectPackageManager, mergeEnvEntries };
|
|
2032
|
+
export { startTunnelRuntime };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
2
|
+
import { CliError, CLI_ERROR_CODE } from './chunk-YPC4VU65.mjs';
|
|
3
|
+
import { isAutoYes, isInteractive } from './chunk-ZPVN6UXL.mjs';
|
|
3
4
|
import readline from 'readline';
|
|
4
5
|
|
|
5
6
|
async function promptLine(question) {
|
|
@@ -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-
|
|
2
|
+
import { gitDetectRoot, gitCurrentBranch, gitCurrentSha, gitStatusPorcelain } from './chunk-OVHZV57L.mjs';
|
|
3
|
+
import { parseEnvFile } from './chunk-5U5OXOPN.mjs';
|
|
4
|
+
import { package_default } from './chunk-5XXUHANH.mjs';
|
|
5
5
|
import { parseArgs } from './chunk-C4M3DXKC.mjs';
|
|
6
|
-
import { readAuthOrNull, readProjectLinkOrNull, readProjectState } from './chunk-
|
|
7
|
-
import { bold, dim, yellow, green, info, result, red } from './chunk-
|
|
6
|
+
import { readAuthOrNull, readProjectLinkOrNull, readProjectState } from './chunk-QA36VSLX.mjs';
|
|
7
|
+
import { bold, dim, yellow, green, info, result, red } from './chunk-ZPVN6UXL.mjs';
|
|
8
8
|
import { promises } from 'fs';
|
|
9
9
|
import path from 'path';
|
|
10
10
|
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { promptYesNo } from './chunk-
|
|
2
|
+
import { promptYesNo } from './chunk-4YIFBYBV.mjs';
|
|
3
3
|
import { TOKEN_PURPOSE, REPO_PROVIDER, REPO_PROVIDER_VALUES } from './chunk-MXYUAJEW.mjs';
|
|
4
4
|
import { parseArgs, flagString, flagBool } from './chunk-C4M3DXKC.mjs';
|
|
5
|
-
import { ApiClient } from './chunk-
|
|
6
|
-
import { readAuth, readProjectLink } from './chunk-
|
|
7
|
-
import { CliError, CLI_ERROR_CODE
|
|
5
|
+
import { ApiClient } from './chunk-JPXK5BLA.mjs';
|
|
6
|
+
import { readAuth, readProjectLink } from './chunk-QA36VSLX.mjs';
|
|
7
|
+
import { CliError, CLI_ERROR_CODE } from './chunk-YPC4VU65.mjs';
|
|
8
|
+
import { isJsonMode, result, dim, success, info, bold } from './chunk-ZPVN6UXL.mjs';
|
|
8
9
|
|
|
9
10
|
// src/commands/repo.ts
|
|
10
11
|
var SUB_PROVISION = "provision";
|
|
@@ -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-YPC4VU65.mjs';
|
|
3
3
|
import { randomBytes, createHash } from 'crypto';
|
|
4
4
|
import { createServer } from 'http';
|
|
5
5
|
import { spawn } from 'child_process';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { TERMINAL_DEPLOYMENT_STATUSES, DEPLOYMENT_STATUS } from './chunk-MXYUAJEW.mjs';
|
|
3
|
-
import {
|
|
3
|
+
import { CliError, CLI_ERROR_CODE } from './chunk-YPC4VU65.mjs';
|
|
4
|
+
import { dim, failure, success, isJsonMode } from './chunk-ZPVN6UXL.mjs';
|
|
4
5
|
|
|
5
6
|
// src/progress.ts
|
|
6
7
|
var POLL_INTERVAL_MS = 1e3;
|
|
@@ -73,76 +73,4 @@ function isCliError(err) {
|
|
|
73
73
|
return err instanceof CliError || typeof err === "object" && err !== null && err.name === "CliError" && typeof err.code === "string" && typeof err.exitCode === "number";
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
|
|
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 ENV_JSON = "CIMPLIFY_JSON";
|
|
88
|
-
var ENV_YES = "CIMPLIFY_YES";
|
|
89
|
-
function envFlag(name) {
|
|
90
|
-
const v = process.env[name];
|
|
91
|
-
return v === "1" || v === "true";
|
|
92
|
-
}
|
|
93
|
-
function isJsonMode() {
|
|
94
|
-
return envFlag(ENV_JSON);
|
|
95
|
-
}
|
|
96
|
-
function isAutoYes() {
|
|
97
|
-
return envFlag(ENV_YES);
|
|
98
|
-
}
|
|
99
|
-
function isInteractive() {
|
|
100
|
-
return Boolean(process.stdout.isTTY) && Boolean(process.stdin.isTTY);
|
|
101
|
-
}
|
|
102
|
-
function wrap(open, value) {
|
|
103
|
-
return `${open}${value}${RESET}`;
|
|
104
|
-
}
|
|
105
|
-
function bold(value) {
|
|
106
|
-
return isJsonMode() ? value : wrap(BOLD_OPEN, value);
|
|
107
|
-
}
|
|
108
|
-
function dim(value) {
|
|
109
|
-
return isJsonMode() ? value : wrap(DIM_OPEN, value);
|
|
110
|
-
}
|
|
111
|
-
function red(value) {
|
|
112
|
-
return isJsonMode() ? value : wrap(RED_OPEN, value);
|
|
113
|
-
}
|
|
114
|
-
function green(value) {
|
|
115
|
-
return isJsonMode() ? value : wrap(GREEN_OPEN, value);
|
|
116
|
-
}
|
|
117
|
-
function yellow(value) {
|
|
118
|
-
return isJsonMode() ? value : wrap(YELLOW_OPEN, value);
|
|
119
|
-
}
|
|
120
|
-
function cyan(value) {
|
|
121
|
-
return isJsonMode() ? value : wrap(CYAN_OPEN, value);
|
|
122
|
-
}
|
|
123
|
-
function step(message) {
|
|
124
|
-
if (isJsonMode()) return;
|
|
125
|
-
console.log(`${cyan(PREFIX_STEP)} ${message}`);
|
|
126
|
-
}
|
|
127
|
-
function success(message) {
|
|
128
|
-
if (isJsonMode()) return;
|
|
129
|
-
console.log(`${green(PREFIX_SUCCESS)} ${message}`);
|
|
130
|
-
}
|
|
131
|
-
function failure(message) {
|
|
132
|
-
if (isJsonMode()) return;
|
|
133
|
-
console.error(`${red(PREFIX_FAILURE)} ${message}`);
|
|
134
|
-
}
|
|
135
|
-
function info(message) {
|
|
136
|
-
if (isJsonMode()) return;
|
|
137
|
-
console.log(message);
|
|
138
|
-
}
|
|
139
|
-
var ENV_EMITTED = "__CIMPLIFY_RESULT_EMITTED";
|
|
140
|
-
function result(data) {
|
|
141
|
-
if (!isJsonMode()) return;
|
|
142
|
-
if (process.env[ENV_EMITTED] === "1") return;
|
|
143
|
-
process.env[ENV_EMITTED] = "1";
|
|
144
|
-
process.stdout.write(`${JSON.stringify({ ok: true, data })}
|
|
145
|
-
`);
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
export { CLI_ERROR_CODE, CliError, EXIT_CODE, bold, dim, failure, green, info, isAutoYes, isCliError, isInteractive, isJsonMode, red, result, step, success, yellow };
|
|
76
|
+
export { CLI_ERROR_CODE, CliError, EXIT_CODE, isCliError };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// src/output.ts
|
|
3
|
+
var RESET = "\x1B[0m";
|
|
4
|
+
var BOLD_OPEN = "\x1B[1m";
|
|
5
|
+
var DIM_OPEN = "\x1B[2m";
|
|
6
|
+
var RED_OPEN = "\x1B[31m";
|
|
7
|
+
var GREEN_OPEN = "\x1B[32m";
|
|
8
|
+
var YELLOW_OPEN = "\x1B[33m";
|
|
9
|
+
var CYAN_OPEN = "\x1B[36m";
|
|
10
|
+
var PREFIX_STEP = "\u25B8";
|
|
11
|
+
var PREFIX_SUCCESS = "\u2713";
|
|
12
|
+
var PREFIX_FAILURE = "\u2717";
|
|
13
|
+
var ENV_JSON = "CIMPLIFY_JSON";
|
|
14
|
+
var ENV_YES = "CIMPLIFY_YES";
|
|
15
|
+
function envFlag(name) {
|
|
16
|
+
const v = process.env[name];
|
|
17
|
+
return v === "1" || v === "true";
|
|
18
|
+
}
|
|
19
|
+
function isJsonMode() {
|
|
20
|
+
return envFlag(ENV_JSON);
|
|
21
|
+
}
|
|
22
|
+
function isAutoYes() {
|
|
23
|
+
return envFlag(ENV_YES);
|
|
24
|
+
}
|
|
25
|
+
function isInteractive() {
|
|
26
|
+
return Boolean(process.stdout.isTTY) && Boolean(process.stdin.isTTY);
|
|
27
|
+
}
|
|
28
|
+
function wrap(open, value) {
|
|
29
|
+
return `${open}${value}${RESET}`;
|
|
30
|
+
}
|
|
31
|
+
function bold(value) {
|
|
32
|
+
return isJsonMode() ? value : wrap(BOLD_OPEN, value);
|
|
33
|
+
}
|
|
34
|
+
function dim(value) {
|
|
35
|
+
return isJsonMode() ? value : wrap(DIM_OPEN, value);
|
|
36
|
+
}
|
|
37
|
+
function red(value) {
|
|
38
|
+
return isJsonMode() ? value : wrap(RED_OPEN, value);
|
|
39
|
+
}
|
|
40
|
+
function green(value) {
|
|
41
|
+
return isJsonMode() ? value : wrap(GREEN_OPEN, value);
|
|
42
|
+
}
|
|
43
|
+
function yellow(value) {
|
|
44
|
+
return isJsonMode() ? value : wrap(YELLOW_OPEN, value);
|
|
45
|
+
}
|
|
46
|
+
function cyan(value) {
|
|
47
|
+
return isJsonMode() ? value : wrap(CYAN_OPEN, value);
|
|
48
|
+
}
|
|
49
|
+
function step(message) {
|
|
50
|
+
if (isJsonMode()) return;
|
|
51
|
+
console.log(`${cyan(PREFIX_STEP)} ${message}`);
|
|
52
|
+
}
|
|
53
|
+
function success(message) {
|
|
54
|
+
if (isJsonMode()) return;
|
|
55
|
+
console.log(`${green(PREFIX_SUCCESS)} ${message}`);
|
|
56
|
+
}
|
|
57
|
+
function failure(message) {
|
|
58
|
+
if (isJsonMode()) return;
|
|
59
|
+
console.error(`${red(PREFIX_FAILURE)} ${message}`);
|
|
60
|
+
}
|
|
61
|
+
function info(message) {
|
|
62
|
+
if (isJsonMode()) return;
|
|
63
|
+
console.log(message);
|
|
64
|
+
}
|
|
65
|
+
var ENV_EMITTED = "__CIMPLIFY_RESULT_EMITTED";
|
|
66
|
+
function result(data) {
|
|
67
|
+
if (!isJsonMode()) return;
|
|
68
|
+
if (process.env[ENV_EMITTED] === "1") return;
|
|
69
|
+
process.env[ENV_EMITTED] = "1";
|
|
70
|
+
process.stdout.write(`${JSON.stringify({ ok: true, data })}
|
|
71
|
+
`);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export { bold, dim, failure, green, info, isAutoYes, isInteractive, isJsonMode, red, result, step, success, yellow };
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { isFreestyleRemote, gitDetectRoot, gitStatusPorcelain, gitCurrentBranch, gitCurrentSha, gitGetRemoteUrl, gitPushToUrl, gitPush } from './chunk-
|
|
3
|
-
import { pollDeployment } from './chunk-
|
|
4
|
-
import { fetchRepoRecord, fetchCloneToken } from './chunk-
|
|
5
|
-
import { promptYesNo } from './chunk-
|
|
2
|
+
import { isFreestyleRemote, gitDetectRoot, gitStatusPorcelain, gitCurrentBranch, gitCurrentSha, gitGetRemoteUrl, gitPushToUrl, gitPush } from './chunk-OVHZV57L.mjs';
|
|
3
|
+
import { pollDeployment } from './chunk-VJJDGHZC.mjs';
|
|
4
|
+
import { fetchRepoRecord, fetchCloneToken } from './chunk-RR4NOZGY.mjs';
|
|
5
|
+
import { promptYesNo } from './chunk-4YIFBYBV.mjs';
|
|
6
6
|
import { REPO_PROVIDER, ENV_SCOPE, DEPLOY_TRIGGER, DEPLOYMENT_STATUS, TOKEN_PURPOSE } from './chunk-MXYUAJEW.mjs';
|
|
7
7
|
import { parseArgs, flagBool, flagString } from './chunk-C4M3DXKC.mjs';
|
|
8
|
-
import { ApiClient } from './chunk-
|
|
9
|
-
import { readAuth, readProjectLink, writeProjectState } from './chunk-
|
|
10
|
-
import { CliError, CLI_ERROR_CODE,
|
|
8
|
+
import { ApiClient } from './chunk-JPXK5BLA.mjs';
|
|
9
|
+
import { readAuth, readProjectLink, writeProjectState } from './chunk-QA36VSLX.mjs';
|
|
10
|
+
import { CliError, CLI_ERROR_CODE, EXIT_CODE } from './chunk-YPC4VU65.mjs';
|
|
11
|
+
import { info, dim, step, success, result } from './chunk-ZPVN6UXL.mjs';
|
|
11
12
|
|
|
12
13
|
// src/commands/deploy.ts
|
|
13
14
|
var FLAG_PROD = "prod";
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { startTunnelRuntime } from './chunk-3UV4P4DM.mjs';
|
|
3
|
+
import { parseEnvFile, formatEnvFile } from './chunk-5U5OXOPN.mjs';
|
|
4
|
+
import { ENV_SCOPE, PUBLIC_ENV_PREFIX } from './chunk-MXYUAJEW.mjs';
|
|
5
|
+
import { parseArgs, flagBool } from './chunk-C4M3DXKC.mjs';
|
|
6
|
+
import { ApiClient } from './chunk-JPXK5BLA.mjs';
|
|
7
|
+
import { readAuth, readProjectLink } from './chunk-QA36VSLX.mjs';
|
|
8
|
+
import { CliError, CLI_ERROR_CODE } from './chunk-YPC4VU65.mjs';
|
|
9
|
+
import { info, dim } from './chunk-ZPVN6UXL.mjs';
|
|
10
|
+
import { spawn } from 'child_process';
|
|
11
|
+
import { promises } from 'fs';
|
|
12
|
+
import path from 'path';
|
|
13
|
+
|
|
14
|
+
var FLAG_REMOTE = "remote";
|
|
15
|
+
var PACKAGE_JSON = "package.json";
|
|
16
|
+
var ENV_LOCAL_FILE = ".env.local";
|
|
17
|
+
var PUBLIC_API_URL_KEY = "NEXT_PUBLIC_CIMPLIFY_API_URL";
|
|
18
|
+
var SCRIPT_DEV = "dev";
|
|
19
|
+
var PREVIEW_ORIGIN_ENV = "CIMPLIFY_PREVIEW_ORIGIN";
|
|
20
|
+
var AGENT_EXTERNAL_ENV = "CIMPLIFY_AGENT_EXTERNAL";
|
|
21
|
+
async function applyPreviewOrigin(cwd, originList) {
|
|
22
|
+
const { ensurePreviewOrigin } = await import('./preview-config-344CUZLO.mjs');
|
|
23
|
+
const origins = originList.split(",").map((origin) => origin.trim()).filter((origin) => origin.length > 0);
|
|
24
|
+
if (origins.length === 0) return;
|
|
25
|
+
try {
|
|
26
|
+
const result = await ensurePreviewOrigin(cwd, origins);
|
|
27
|
+
if (result.status === "unrecognized") {
|
|
28
|
+
info(
|
|
29
|
+
dim(
|
|
30
|
+
`(preview: could not resolve ${result.file} config shape; hot-reload may be limited)`
|
|
31
|
+
)
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
} catch (err) {
|
|
35
|
+
info(dim(`(preview: dev-origin setup skipped: ${err.message})`));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
var PM_BUN = "bun";
|
|
39
|
+
var PM_PNPM = "pnpm";
|
|
40
|
+
var PM_YARN = "yarn";
|
|
41
|
+
var PM_NPM = "npm";
|
|
42
|
+
var LOCKFILE_BUN = "bun.lock";
|
|
43
|
+
var LOCKFILE_BUN_BINARY = "bun.lockb";
|
|
44
|
+
var LOCKFILE_PNPM = "pnpm-lock.yaml";
|
|
45
|
+
var LOCKFILE_YARN = "yarn.lock";
|
|
46
|
+
var BUNFIG = "bunfig.toml";
|
|
47
|
+
function envEndpoint(businessId, projectId) {
|
|
48
|
+
return `/v1/businesses/${encodeURIComponent(businessId)}/projects/${encodeURIComponent(projectId)}/env-vars`;
|
|
49
|
+
}
|
|
50
|
+
async function detectPackageManager(cwd) {
|
|
51
|
+
if (await pathExists(path.join(cwd, LOCKFILE_BUN))) return PM_BUN;
|
|
52
|
+
if (await pathExists(path.join(cwd, LOCKFILE_BUN_BINARY))) return PM_BUN;
|
|
53
|
+
if (await pathExists(path.join(cwd, BUNFIG))) return PM_BUN;
|
|
54
|
+
if (await pathExists(path.join(cwd, LOCKFILE_PNPM))) return PM_PNPM;
|
|
55
|
+
if (await pathExists(path.join(cwd, LOCKFILE_YARN))) return PM_YARN;
|
|
56
|
+
return PM_NPM;
|
|
57
|
+
}
|
|
58
|
+
async function pathExists(target) {
|
|
59
|
+
try {
|
|
60
|
+
await promises.stat(target);
|
|
61
|
+
return true;
|
|
62
|
+
} catch (err) {
|
|
63
|
+
if (err.code === "ENOENT") return false;
|
|
64
|
+
throw err;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
async function readPackageJson(cwd) {
|
|
68
|
+
const pkgPath = path.join(cwd, PACKAGE_JSON);
|
|
69
|
+
let raw;
|
|
70
|
+
try {
|
|
71
|
+
raw = await promises.readFile(pkgPath, "utf8");
|
|
72
|
+
} catch (err) {
|
|
73
|
+
if (err.code === "ENOENT") {
|
|
74
|
+
throw new CliError(
|
|
75
|
+
CLI_ERROR_CODE.INVALID_INPUT,
|
|
76
|
+
`No package.json in ${cwd}. \`cimplify dev\` runs your project's dev script.`
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
throw err;
|
|
80
|
+
}
|
|
81
|
+
return JSON.parse(raw);
|
|
82
|
+
}
|
|
83
|
+
function mergeEnvEntries(existing, incoming) {
|
|
84
|
+
const seen = new Set(existing.map((e) => e.key));
|
|
85
|
+
const merged = [...existing];
|
|
86
|
+
for (const entry of incoming) {
|
|
87
|
+
if (seen.has(entry.key)) continue;
|
|
88
|
+
merged.push(entry);
|
|
89
|
+
seen.add(entry.key);
|
|
90
|
+
}
|
|
91
|
+
return merged;
|
|
92
|
+
}
|
|
93
|
+
async function applyRemoteEnv(client, businessId, projectId, apiBaseUrl, cwd) {
|
|
94
|
+
const records = await client.get(envEndpoint(businessId, projectId), {
|
|
95
|
+
query: { scope: ENV_SCOPE.PRODUCTION }
|
|
96
|
+
});
|
|
97
|
+
const incoming = records.filter((r) => r.value !== null && !r.is_secret).map((r) => ({ key: r.key, value: r.value }));
|
|
98
|
+
incoming.push({ key: PUBLIC_API_URL_KEY, value: apiBaseUrl });
|
|
99
|
+
const envPath = path.join(cwd, ENV_LOCAL_FILE);
|
|
100
|
+
let existing = [];
|
|
101
|
+
try {
|
|
102
|
+
const raw = await promises.readFile(envPath, "utf8");
|
|
103
|
+
existing = parseEnvFile(raw);
|
|
104
|
+
} catch (err) {
|
|
105
|
+
if (err.code !== "ENOENT") throw err;
|
|
106
|
+
}
|
|
107
|
+
const merged = mergeEnvEntries(existing, incoming);
|
|
108
|
+
await promises.writeFile(envPath, formatEnvFile(merged), "utf8");
|
|
109
|
+
const publicCount = incoming.filter((e) => e.key.startsWith(PUBLIC_ENV_PREFIX)).length;
|
|
110
|
+
return publicCount;
|
|
111
|
+
}
|
|
112
|
+
async function run(argv) {
|
|
113
|
+
const args = parseArgs(argv);
|
|
114
|
+
const remote = flagBool(args, FLAG_REMOTE);
|
|
115
|
+
const cwd = process.cwd();
|
|
116
|
+
const previewOrigin = process.env[PREVIEW_ORIGIN_ENV];
|
|
117
|
+
if (remote) {
|
|
118
|
+
const auth = await readAuth();
|
|
119
|
+
const link = await readProjectLink();
|
|
120
|
+
const client = ApiClient.fromAuth(auth);
|
|
121
|
+
const publicCount = await applyRemoteEnv(
|
|
122
|
+
client,
|
|
123
|
+
link.businessId,
|
|
124
|
+
link.projectId,
|
|
125
|
+
auth.apiBaseUrl,
|
|
126
|
+
cwd
|
|
127
|
+
);
|
|
128
|
+
const label = link.businessHandle ?? auth.businessHandle ?? auth.businessId;
|
|
129
|
+
info(`Dev mode: connected to ${label} production data (${publicCount} public var${publicCount === 1 ? "" : "s"} merged)`);
|
|
130
|
+
} else if (previewOrigin) {
|
|
131
|
+
info("Dev mode: hosted preview");
|
|
132
|
+
} else {
|
|
133
|
+
info("Dev mode: using local mock (`cimplify mock`)");
|
|
134
|
+
}
|
|
135
|
+
const pkg = await readPackageJson(cwd);
|
|
136
|
+
if (!pkg.scripts || !pkg.scripts[SCRIPT_DEV]) {
|
|
137
|
+
throw new CliError(
|
|
138
|
+
CLI_ERROR_CODE.INVALID_INPUT,
|
|
139
|
+
`No "${SCRIPT_DEV}" script in package.json. Add one (e.g. "next dev") and re-run.`
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
let stopTunnel = null;
|
|
143
|
+
if (previewOrigin) {
|
|
144
|
+
await applyPreviewOrigin(cwd, previewOrigin);
|
|
145
|
+
if (!process.env[AGENT_EXTERNAL_ENV]) {
|
|
146
|
+
stopTunnel = startTunnelRuntime(cwd);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
const pm = await detectPackageManager(cwd);
|
|
150
|
+
info(dim(`(running: ${pm} run ${SCRIPT_DEV})`));
|
|
151
|
+
const child = spawn(pm, ["run", SCRIPT_DEV], { cwd, stdio: "inherit" });
|
|
152
|
+
try {
|
|
153
|
+
await new Promise((resolve, reject) => {
|
|
154
|
+
child.on("error", (err) => reject(new CliError(CLI_ERROR_CODE.INVALID_INPUT, `Failed to spawn ${pm}: ${err.message}`)));
|
|
155
|
+
child.on("close", (code) => {
|
|
156
|
+
process.exitCode = code ?? 0;
|
|
157
|
+
resolve();
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
} finally {
|
|
161
|
+
stopTunnel?.();
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export { run as default, detectPackageManager, mergeEnvEntries };
|
package/dist/dispatcher.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { package_default } from './chunk-FOJVWJ57.mjs';
|
|
3
2
|
import { TEMPLATES } from './chunk-W3WLADJP.mjs';
|
|
3
|
+
import { package_default } from './chunk-5XXUHANH.mjs';
|
|
4
4
|
|
|
5
5
|
// src/dispatcher.ts
|
|
6
6
|
var VERSION = package_default.version ?? "unknown";
|
|
@@ -33,6 +33,7 @@ Deploy:
|
|
|
33
33
|
cimplify status Show the latest deployment for the linked project
|
|
34
34
|
cimplify logs [flags] Stream build logs for the latest (or given) deployment
|
|
35
35
|
cimplify dev [--remote] Run your project's dev script (optionally with prod env)
|
|
36
|
+
cimplify agent Supervise the preview tunnel (dev VMs; runs in its own unit)
|
|
36
37
|
cimplify mock [flags] Boot the local Cimplify API mock (custom seeds welcome)
|
|
37
38
|
cimplify mock init [--from <seed>] Scaffold a cimplify.seed.ts (or --format json) to customise
|
|
38
39
|
|
|
@@ -129,32 +130,33 @@ Local mock server (custom demo data, no fork needed):
|
|
|
129
130
|
cimplify mock --seed-module ./seed.ts Boot from a seed module (defineSeed from @cimplify/sdk/mock)
|
|
130
131
|
`;
|
|
131
132
|
var COMMANDS = {
|
|
132
|
-
login: () => import('./login-
|
|
133
|
-
logout: () => import('./logout-
|
|
134
|
-
whoami: () => import('./whoami-
|
|
135
|
-
projects: () => import('./projects-
|
|
136
|
-
link: () => import('./link-
|
|
137
|
-
unlink: () => import('./unlink-
|
|
138
|
-
deploy: () => import('./deploy-
|
|
139
|
-
cancel: () => import('./cancel-
|
|
140
|
-
rollback: () => import('./rollback-
|
|
141
|
-
env: () => import('./env-
|
|
142
|
-
domains: () => import('./domains-
|
|
143
|
-
logs: () => import('./logs-
|
|
144
|
-
status: () => import('./status-
|
|
145
|
-
dev: () => import('./dev-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
133
|
+
login: () => import('./login-UZ5Y7GIO.mjs'),
|
|
134
|
+
logout: () => import('./logout-XYWZR6QJ.mjs'),
|
|
135
|
+
whoami: () => import('./whoami-5G32NNEP.mjs'),
|
|
136
|
+
projects: () => import('./projects-RJ44DJKZ.mjs'),
|
|
137
|
+
link: () => import('./link-VQN2WPZO.mjs'),
|
|
138
|
+
unlink: () => import('./unlink-JBVZYOA3.mjs'),
|
|
139
|
+
deploy: () => import('./deploy-UTAYLZOM.mjs'),
|
|
140
|
+
cancel: () => import('./cancel-QSZE2XC2.mjs'),
|
|
141
|
+
rollback: () => import('./rollback-Z2PRL7FS.mjs'),
|
|
142
|
+
env: () => import('./env-UVO4OIEO.mjs'),
|
|
143
|
+
domains: () => import('./domains-OS3DXSDN.mjs'),
|
|
144
|
+
logs: () => import('./logs-YNXDXAF7.mjs'),
|
|
145
|
+
status: () => import('./status-RR3GGTVU.mjs'),
|
|
146
|
+
dev: () => import('./dev-QC55VHDI.mjs'),
|
|
147
|
+
agent: () => import('./agent-3PAQPC7W.mjs'),
|
|
148
|
+
mock: () => import('./mock-HFVAAYK2.mjs'),
|
|
149
|
+
introspect: () => import('./introspect-X7GQ7XUE.mjs'),
|
|
150
|
+
inspect: () => import('./inspect-ULWQHT7J.mjs'),
|
|
151
|
+
doctor: () => import('./doctor-4BHP3JT7.mjs'),
|
|
152
|
+
explain: () => import('./explain-OQZKABWP.mjs'),
|
|
153
|
+
assets: () => import('./assets-Y4JE6MSG.mjs'),
|
|
154
|
+
repo: () => import('./repo-OK6CVG3G.mjs'),
|
|
155
|
+
list: () => import('./list-3OGYEBKV.mjs'),
|
|
156
|
+
add: () => import('./add-Q4OFUCNB.mjs'),
|
|
157
|
+
update: () => import('./update-6DO57SJN.mjs'),
|
|
158
|
+
upgrade: () => import('./update-6DO57SJN.mjs'),
|
|
159
|
+
"auth-step-up": () => import('./auth-step-up-EHL5PM2L.mjs')
|
|
158
160
|
};
|
|
159
161
|
var COMMAND_PREFIXES = {
|
|
160
162
|
auth: { "step-up": "auth-step-up" }
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { gatherIntrospection } from './chunk-
|
|
3
|
-
import './chunk-
|
|
4
|
-
import './chunk-
|
|
5
|
-
import './chunk-
|
|
2
|
+
import { gatherIntrospection } from './chunk-5GYD3EHJ.mjs';
|
|
3
|
+
import './chunk-OVHZV57L.mjs';
|
|
4
|
+
import './chunk-5U5OXOPN.mjs';
|
|
5
|
+
import './chunk-5XXUHANH.mjs';
|
|
6
6
|
import { parseArgs, flagBool } from './chunk-C4M3DXKC.mjs';
|
|
7
|
-
import { SDK_ENV_API_URL, DEFAULT_API_BASE_URL, ApiClient, ENV_API_BASE_URL } from './chunk-
|
|
8
|
-
import { readAuthOrNull } from './chunk-
|
|
9
|
-
import {
|
|
7
|
+
import { SDK_ENV_API_URL, DEFAULT_API_BASE_URL, ApiClient, ENV_API_BASE_URL } from './chunk-JPXK5BLA.mjs';
|
|
8
|
+
import { readAuthOrNull } from './chunk-QA36VSLX.mjs';
|
|
9
|
+
import { isCliError, CLI_ERROR_CODE } from './chunk-YPC4VU65.mjs';
|
|
10
|
+
import { bold, dim, info, result, red, yellow, green } from './chunk-ZPVN6UXL.mjs';
|
|
10
11
|
import { promises } from 'fs';
|
|
11
12
|
import path from 'path';
|
|
12
13
|
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { promptYesNo } from './chunk-
|
|
2
|
+
import { promptYesNo } from './chunk-4YIFBYBV.mjs';
|
|
3
3
|
import { ENV_SCOPE, DOMAIN_TYPE } from './chunk-MXYUAJEW.mjs';
|
|
4
4
|
import { parseArgs, flagBool, flagString } from './chunk-C4M3DXKC.mjs';
|
|
5
|
-
import { ApiClient } from './chunk-
|
|
6
|
-
import { readAuth, readProjectLink } from './chunk-
|
|
7
|
-
import { CliError, CLI_ERROR_CODE
|
|
5
|
+
import { ApiClient } from './chunk-JPXK5BLA.mjs';
|
|
6
|
+
import { readAuth, readProjectLink } from './chunk-QA36VSLX.mjs';
|
|
7
|
+
import { CliError, CLI_ERROR_CODE } from './chunk-YPC4VU65.mjs';
|
|
8
|
+
import { result, info, dim, bold, success } from './chunk-ZPVN6UXL.mjs';
|
|
8
9
|
|
|
9
10
|
// src/commands/domains.ts
|
|
10
11
|
var SUB_LS = "ls";
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { formatEnvFile, parseEnvFile, parseKeyValueArg } from './chunk-
|
|
3
|
-
import { promptYesNo } from './chunk-
|
|
2
|
+
import { formatEnvFile, parseEnvFile, parseKeyValueArg } from './chunk-5U5OXOPN.mjs';
|
|
3
|
+
import { promptYesNo } from './chunk-4YIFBYBV.mjs';
|
|
4
4
|
import { ENV_SCOPE, PUBLIC_ENV_PREFIX, SECRET_MASK } from './chunk-MXYUAJEW.mjs';
|
|
5
5
|
import { parseArgs, flagString, flagBool } from './chunk-C4M3DXKC.mjs';
|
|
6
|
-
import { ApiClient } from './chunk-
|
|
7
|
-
import { readAuth, readProjectLink } from './chunk-
|
|
8
|
-
import { CliError, CLI_ERROR_CODE
|
|
6
|
+
import { ApiClient } from './chunk-JPXK5BLA.mjs';
|
|
7
|
+
import { readAuth, readProjectLink } from './chunk-QA36VSLX.mjs';
|
|
8
|
+
import { CliError, CLI_ERROR_CODE } from './chunk-YPC4VU65.mjs';
|
|
9
|
+
import { info, dim, result, bold, success } from './chunk-ZPVN6UXL.mjs';
|
|
9
10
|
import { promises } from 'fs';
|
|
10
11
|
import path from 'path';
|
|
11
12
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { package_default } from './chunk-
|
|
2
|
+
import { package_default } from './chunk-5XXUHANH.mjs';
|
|
3
3
|
import { parseArgs } from './chunk-C4M3DXKC.mjs';
|
|
4
|
-
import {
|
|
4
|
+
import { CliError, CLI_ERROR_CODE } from './chunk-YPC4VU65.mjs';
|
|
5
|
+
import { bold, dim, info, result } from './chunk-ZPVN6UXL.mjs';
|
|
5
6
|
|
|
6
7
|
// src/embedded-docs.ts
|
|
7
8
|
var TOPICS = [
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { parseEnvFile } from './chunk-
|
|
2
|
+
import { parseEnvFile } from './chunk-5U5OXOPN.mjs';
|
|
3
3
|
import { parseArgs, flagString, flagBool } from './chunk-C4M3DXKC.mjs';
|
|
4
|
-
import { CliError, CLI_ERROR_CODE
|
|
4
|
+
import { CliError, CLI_ERROR_CODE } from './chunk-YPC4VU65.mjs';
|
|
5
|
+
import { isJsonMode, result, info, bold, dim, yellow, green, red } from './chunk-ZPVN6UXL.mjs';
|
|
5
6
|
import { promises } from 'fs';
|
|
6
7
|
import path from 'path';
|
|
7
8
|
import { createCimplifyClient } from '@cimplify/sdk';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
export { run as default, extractMockSeed, gatherIntrospection, renderIntrospection } from './chunk-5GYD3EHJ.mjs';
|
|
3
|
+
import './chunk-OVHZV57L.mjs';
|
|
4
|
+
import './chunk-5U5OXOPN.mjs';
|
|
5
|
+
import './chunk-5XXUHANH.mjs';
|
|
6
|
+
import './chunk-C4M3DXKC.mjs';
|
|
7
|
+
import './chunk-QA36VSLX.mjs';
|
|
8
|
+
import './chunk-YPC4VU65.mjs';
|
|
9
|
+
import './chunk-ZPVN6UXL.mjs';
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { parseArgs } from './chunk-C4M3DXKC.mjs';
|
|
3
|
-
import { ApiClient } from './chunk-
|
|
4
|
-
import { readAuth, writeProjectLink } from './chunk-
|
|
5
|
-
import { CliError, CLI_ERROR_CODE
|
|
3
|
+
import { ApiClient } from './chunk-JPXK5BLA.mjs';
|
|
4
|
+
import { readAuth, writeProjectLink } from './chunk-QA36VSLX.mjs';
|
|
5
|
+
import { CliError, CLI_ERROR_CODE } from './chunk-YPC4VU65.mjs';
|
|
6
|
+
import { success, info, dim, result } from './chunk-ZPVN6UXL.mjs';
|
|
6
7
|
|
|
7
8
|
// src/commands/link.ts
|
|
8
9
|
function projectEndpoint(businessId, projectId) {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { REGISTRY_INDEX } from './chunk-W3WLADJP.mjs';
|
|
3
3
|
import { parseArgs, flagBool } from './chunk-C4M3DXKC.mjs';
|
|
4
|
-
import { CliError, CLI_ERROR_CODE
|
|
4
|
+
import { CliError, CLI_ERROR_CODE } from './chunk-YPC4VU65.mjs';
|
|
5
|
+
import { info, bold, dim, green, result } from './chunk-ZPVN6UXL.mjs';
|
|
5
6
|
|
|
6
7
|
// src/commands/list.ts
|
|
7
8
|
async function run(argv) {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { generatePkcePair, openBrowser } from './chunk-
|
|
2
|
+
import { generatePkcePair, openBrowser } from './chunk-UP7N53C4.mjs';
|
|
3
3
|
import { parseArgs, flagString, flagBool } from './chunk-C4M3DXKC.mjs';
|
|
4
|
-
import { resolveBaseUrl, ApiClient } from './chunk-
|
|
5
|
-
import { writeAuth } from './chunk-
|
|
6
|
-
import { CliError, CLI_ERROR_CODE
|
|
4
|
+
import { resolveBaseUrl, ApiClient } from './chunk-JPXK5BLA.mjs';
|
|
5
|
+
import { writeAuth } from './chunk-QA36VSLX.mjs';
|
|
6
|
+
import { CliError, CLI_ERROR_CODE } from './chunk-YPC4VU65.mjs';
|
|
7
|
+
import { success, result, isJsonMode, step, info, dim } from './chunk-ZPVN6UXL.mjs';
|
|
7
8
|
import os from 'os';
|
|
8
9
|
|
|
9
10
|
var FLAG_API_KEY = "api-key";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { clearAuth } from './chunk-
|
|
3
|
-
import
|
|
2
|
+
import { clearAuth } from './chunk-QA36VSLX.mjs';
|
|
3
|
+
import './chunk-YPC4VU65.mjs';
|
|
4
|
+
import { success, info, result } from './chunk-ZPVN6UXL.mjs';
|
|
4
5
|
|
|
5
6
|
// src/commands/logout.ts
|
|
6
7
|
async function run(_argv) {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { TERMINAL_DEPLOYMENT_STATUSES } from './chunk-MXYUAJEW.mjs';
|
|
3
3
|
import { parseArgs, flagString, flagBool } from './chunk-C4M3DXKC.mjs';
|
|
4
|
-
import { ApiClient } from './chunk-
|
|
5
|
-
import { readAuth, readProjectLink, readProjectState } from './chunk-
|
|
6
|
-
import { CliError, CLI_ERROR_CODE
|
|
4
|
+
import { ApiClient } from './chunk-JPXK5BLA.mjs';
|
|
5
|
+
import { readAuth, readProjectLink, readProjectState } from './chunk-QA36VSLX.mjs';
|
|
6
|
+
import { CliError, CLI_ERROR_CODE } from './chunk-YPC4VU65.mjs';
|
|
7
|
+
import { isJsonMode, failure, result, red } from './chunk-ZPVN6UXL.mjs';
|
|
7
8
|
|
|
8
9
|
// src/commands/logs.ts
|
|
9
10
|
var FLAG_DEPLOYMENT = "deployment";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { parseArgs, flagString, flagBool } from './chunk-C4M3DXKC.mjs';
|
|
3
|
-
import { CliError, CLI_ERROR_CODE
|
|
3
|
+
import { CliError, CLI_ERROR_CODE } from './chunk-YPC4VU65.mjs';
|
|
4
|
+
import { info, dim } from './chunk-ZPVN6UXL.mjs';
|
|
4
5
|
import { spawn } from 'child_process';
|
|
5
6
|
import { existsSync, writeFileSync } from 'fs';
|
|
6
7
|
import path from 'path';
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { REPO_PROVIDER } from './chunk-MXYUAJEW.mjs';
|
|
3
3
|
import { parseArgs, flagString, flagBool } from './chunk-C4M3DXKC.mjs';
|
|
4
|
-
import { ApiClient } from './chunk-
|
|
5
|
-
import { readAuth } from './chunk-
|
|
6
|
-
import { CliError, CLI_ERROR_CODE
|
|
4
|
+
import { ApiClient } from './chunk-JPXK5BLA.mjs';
|
|
5
|
+
import { readAuth } from './chunk-QA36VSLX.mjs';
|
|
6
|
+
import { CliError, CLI_ERROR_CODE } from './chunk-YPC4VU65.mjs';
|
|
7
|
+
import { info, dim, result, bold, success } from './chunk-ZPVN6UXL.mjs';
|
|
7
8
|
|
|
8
9
|
// src/commands/projects.ts
|
|
9
10
|
var SUB_LS = "ls";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
export { run as default, fetchCloneToken, fetchRepoRecord } from './chunk-RR4NOZGY.mjs';
|
|
3
|
+
import './chunk-4YIFBYBV.mjs';
|
|
4
|
+
import './chunk-MXYUAJEW.mjs';
|
|
5
|
+
import './chunk-C4M3DXKC.mjs';
|
|
6
|
+
import './chunk-JPXK5BLA.mjs';
|
|
7
|
+
import './chunk-QA36VSLX.mjs';
|
|
8
|
+
import './chunk-YPC4VU65.mjs';
|
|
9
|
+
import './chunk-ZPVN6UXL.mjs';
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { pollDeployment } from './chunk-
|
|
2
|
+
import { pollDeployment } from './chunk-VJJDGHZC.mjs';
|
|
3
3
|
import { DEPLOYMENT_STATUS, DEPLOY_TRIGGER } from './chunk-MXYUAJEW.mjs';
|
|
4
4
|
import { parseArgs, flagBool } from './chunk-C4M3DXKC.mjs';
|
|
5
|
-
import { ApiClient } from './chunk-
|
|
6
|
-
import { readAuth, readProjectLink, writeProjectState } from './chunk-
|
|
7
|
-
import { CliError, CLI_ERROR_CODE,
|
|
5
|
+
import { ApiClient } from './chunk-JPXK5BLA.mjs';
|
|
6
|
+
import { readAuth, readProjectLink, writeProjectState } from './chunk-QA36VSLX.mjs';
|
|
7
|
+
import { CliError, CLI_ERROR_CODE, EXIT_CODE } from './chunk-YPC4VU65.mjs';
|
|
8
|
+
import { step, success, info, dim, result } from './chunk-ZPVN6UXL.mjs';
|
|
8
9
|
|
|
9
10
|
// src/commands/rollback.ts
|
|
10
11
|
var FLAG_NO_POLL = "no-poll";
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { DEPLOYMENT_STATUS } from './chunk-MXYUAJEW.mjs';
|
|
3
3
|
import { parseArgs } from './chunk-C4M3DXKC.mjs';
|
|
4
|
-
import { ApiClient } from './chunk-
|
|
5
|
-
import { readAuth, readProjectLink, readProjectState } from './chunk-
|
|
6
|
-
import
|
|
4
|
+
import { ApiClient } from './chunk-JPXK5BLA.mjs';
|
|
5
|
+
import { readAuth, readProjectLink, readProjectState } from './chunk-QA36VSLX.mjs';
|
|
6
|
+
import './chunk-YPC4VU65.mjs';
|
|
7
|
+
import { bold, dim, info, result } from './chunk-ZPVN6UXL.mjs';
|
|
7
8
|
|
|
8
9
|
// src/commands/status.ts
|
|
9
10
|
var QUERY_LIMIT = "limit";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { clearProjectLink } from './chunk-
|
|
3
|
-
import
|
|
2
|
+
import { clearProjectLink } from './chunk-QA36VSLX.mjs';
|
|
3
|
+
import './chunk-YPC4VU65.mjs';
|
|
4
|
+
import { success, info, result } from './chunk-ZPVN6UXL.mjs';
|
|
4
5
|
|
|
5
6
|
// src/commands/unlink.ts
|
|
6
7
|
async function run(_argv) {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { package_default } from './chunk-
|
|
3
|
-
import { promptYesNo } from './chunk-
|
|
2
|
+
import { package_default } from './chunk-5XXUHANH.mjs';
|
|
3
|
+
import { promptYesNo } from './chunk-4YIFBYBV.mjs';
|
|
4
4
|
import { parseArgs, flagBool, flagString } from './chunk-C4M3DXKC.mjs';
|
|
5
|
-
import {
|
|
5
|
+
import { CliError, CLI_ERROR_CODE } from './chunk-YPC4VU65.mjs';
|
|
6
|
+
import { success, bold, info, dim, result, failure, step, isJsonMode } from './chunk-ZPVN6UXL.mjs';
|
|
6
7
|
import { spawn } from 'child_process';
|
|
7
8
|
import { basename, dirname } from 'path';
|
|
8
9
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { ApiClient } from './chunk-
|
|
3
|
-
import { readAuth } from './chunk-
|
|
4
|
-
import
|
|
2
|
+
import { ApiClient } from './chunk-JPXK5BLA.mjs';
|
|
3
|
+
import { readAuth } from './chunk-QA36VSLX.mjs';
|
|
4
|
+
import './chunk-YPC4VU65.mjs';
|
|
5
|
+
import { info, bold, dim, result } from './chunk-ZPVN6UXL.mjs';
|
|
5
6
|
|
|
6
7
|
// src/commands/whoami.ts
|
|
7
8
|
var ENDPOINT_AUTH_ME = "/v1/auth/me";
|
package/package.json
CHANGED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
export { run as default, extractMockSeed, gatherIntrospection, renderIntrospection } from './chunk-JPUGWNVY.mjs';
|
|
3
|
-
import './chunk-K5464A3L.mjs';
|
|
4
|
-
import './chunk-DBZ3UOQ2.mjs';
|
|
5
|
-
import './chunk-FOJVWJ57.mjs';
|
|
6
|
-
import './chunk-C4M3DXKC.mjs';
|
|
7
|
-
import './chunk-UBAI443T.mjs';
|
|
8
|
-
import './chunk-E2T2SBP5.mjs';
|
package/dist/repo-WSUAHXWO.mjs
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
export { run as default, fetchCloneToken, fetchRepoRecord } from './chunk-6C2QY3ZP.mjs';
|
|
3
|
-
import './chunk-ITAFAORS.mjs';
|
|
4
|
-
import './chunk-MXYUAJEW.mjs';
|
|
5
|
-
import './chunk-C4M3DXKC.mjs';
|
|
6
|
-
import './chunk-F4S5KETY.mjs';
|
|
7
|
-
import './chunk-UBAI443T.mjs';
|
|
8
|
-
import './chunk-E2T2SBP5.mjs';
|