@cimplify/cli 0.13.0 → 0.13.1
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-Q4OFUCNB.mjs → add-F7GKDXAD.mjs} +1 -1
- package/dist/{agent-3PAQPC7W.mjs → agent-UTARR75F.mjs} +1 -1
- package/dist/{chunk-5GYD3EHJ.mjs → chunk-2VK4UABO.mjs} +1 -1
- package/dist/{chunk-5XXUHANH.mjs → chunk-AMREB4KE.mjs} +2 -2
- package/dist/{chunk-W3WLADJP.mjs → chunk-SVJPU4K7.mjs} +8 -8
- package/dist/{chunk-3UV4P4DM.mjs → chunk-ZX5ZEOEU.mjs} +61 -60
- package/dist/{dev-QC55VHDI.mjs → dev-WSX75ELC.mjs} +6 -2
- package/dist/dispatcher.mjs +11 -11
- package/dist/{doctor-4BHP3JT7.mjs → doctor-QFCEYEEZ.mjs} +2 -2
- package/dist/{explain-OQZKABWP.mjs → explain-BZPONVN3.mjs} +1 -1
- package/dist/{introspect-X7GQ7XUE.mjs → introspect-HGX4I3XQ.mjs} +2 -2
- package/dist/{list-3OGYEBKV.mjs → list-DZTPWNU3.mjs} +1 -1
- package/dist/{update-6DO57SJN.mjs → update-2FSGAVDH.mjs} +1 -1
- package/package.json +3 -3
- package/templates/storefront-auto/package.json +1 -1
- package/templates/storefront-bakery/package.json +1 -1
- package/templates/storefront-fashion/package.json +1 -1
- package/templates/storefront-grocery/package.json +1 -1
- package/templates/storefront-pharmacy/package.json +1 -1
- package/templates/storefront-restaurant/package.json +1 -1
- package/templates/storefront-retail/package.json +1 -1
- package/templates/storefront-services/package.json +1 -1
|
@@ -1,9 +1,60 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { info, dim } from './chunk-ZPVN6UXL.mjs';
|
|
3
|
+
import { promises, watch } from 'fs';
|
|
4
|
+
import path2 from 'path';
|
|
3
5
|
import http from 'http';
|
|
4
6
|
import { spawn } from 'child_process';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
+
|
|
8
|
+
var TUNNEL_URL_ENV = "CIMPLIFY_TUNNEL_URL";
|
|
9
|
+
var TUNNEL_TOKEN_ENV = "CIMPLIFY_TUNNEL_TOKEN";
|
|
10
|
+
var TUNNEL_LOCAL_PORT_ENV = "CIMPLIFY_TUNNEL_LOCAL_PORT";
|
|
11
|
+
var TUNNEL_CONFIG_DIR = ".cimplify";
|
|
12
|
+
var TUNNEL_CONFIG_FILE = "tunnel.json";
|
|
13
|
+
var DEFAULT_DEV_SERVER_PORT = 3e3;
|
|
14
|
+
function tunnelConfigPath(cwd) {
|
|
15
|
+
return path2.join(cwd, TUNNEL_CONFIG_DIR, TUNNEL_CONFIG_FILE);
|
|
16
|
+
}
|
|
17
|
+
async function readTunnelConfig(cwd, env = process.env) {
|
|
18
|
+
const url = env[TUNNEL_URL_ENV];
|
|
19
|
+
const token = env[TUNNEL_TOKEN_ENV];
|
|
20
|
+
if (url && token) {
|
|
21
|
+
return { url, token, localPort: envPort(env) ?? DEFAULT_DEV_SERVER_PORT };
|
|
22
|
+
}
|
|
23
|
+
return readTunnelConfigFile(cwd);
|
|
24
|
+
}
|
|
25
|
+
function envPort(env) {
|
|
26
|
+
const raw = env[TUNNEL_LOCAL_PORT_ENV];
|
|
27
|
+
if (!raw) return null;
|
|
28
|
+
const port = Number.parseInt(raw, 10);
|
|
29
|
+
return Number.isInteger(port) && port > 0 && port < 65536 ? port : null;
|
|
30
|
+
}
|
|
31
|
+
async function readTunnelConfigFile(cwd) {
|
|
32
|
+
let raw;
|
|
33
|
+
try {
|
|
34
|
+
raw = await promises.readFile(tunnelConfigPath(cwd), "utf8");
|
|
35
|
+
} catch {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
let parsed;
|
|
39
|
+
try {
|
|
40
|
+
parsed = JSON.parse(raw);
|
|
41
|
+
} catch {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
if (typeof parsed !== "object" || parsed === null) return null;
|
|
45
|
+
const record = parsed;
|
|
46
|
+
if (typeof record.url !== "string" || record.url.length === 0) return null;
|
|
47
|
+
if (typeof record.token !== "string" || record.token.length === 0) return null;
|
|
48
|
+
const localPort = typeof record.port === "number" && Number.isInteger(record.port) && record.port > 0 ? record.port : DEFAULT_DEV_SERVER_PORT;
|
|
49
|
+
return { url: record.url, token: record.token, localPort };
|
|
50
|
+
}
|
|
51
|
+
function sameTunnelConfig(a, b) {
|
|
52
|
+
if (a === null || b === null) return a === b;
|
|
53
|
+
return a.url === b.url && a.token === b.token && a.localPort === b.localPort;
|
|
54
|
+
}
|
|
55
|
+
function sameTunnelEndpoint(a, b) {
|
|
56
|
+
return a.url === b.url && a.localPort === b.localPort;
|
|
57
|
+
}
|
|
7
58
|
|
|
8
59
|
// src/tunnel/v2/codec.ts
|
|
9
60
|
var HEADER_LEN = 9;
|
|
@@ -605,8 +656,8 @@ function execCommand(request) {
|
|
|
605
656
|
throw new ControlFsError(CONTROL_ERROR.INVALID_PATH, "exec requires a command");
|
|
606
657
|
}
|
|
607
658
|
function resolveInRoot(root, rel) {
|
|
608
|
-
const resolved =
|
|
609
|
-
const rootWithSep = root.endsWith(
|
|
659
|
+
const resolved = path2.resolve(root, rel);
|
|
660
|
+
const rootWithSep = root.endsWith(path2.sep) ? root : root + path2.sep;
|
|
610
661
|
if (resolved !== root && !resolved.startsWith(rootWithSep)) {
|
|
611
662
|
throw new ControlFsError(CONTROL_ERROR.INVALID_PATH, `path escapes workspace: ${rel}`);
|
|
612
663
|
}
|
|
@@ -628,7 +679,7 @@ var NodeControlFs = class {
|
|
|
628
679
|
}
|
|
629
680
|
async write(rel, content, encoding) {
|
|
630
681
|
const abs = resolveInRoot(this.root, rel);
|
|
631
|
-
await promises.mkdir(
|
|
682
|
+
await promises.mkdir(path2.dirname(abs), { recursive: true });
|
|
632
683
|
const bytes = encoding === ENCODING.BASE64 ? Buffer.from(content, "base64") : Buffer.from(content, "utf8");
|
|
633
684
|
await promises.writeFile(abs, bytes).catch(rethrow(rel));
|
|
634
685
|
}
|
|
@@ -644,7 +695,7 @@ var NodeControlFs = class {
|
|
|
644
695
|
async listTree() {
|
|
645
696
|
const out = [];
|
|
646
697
|
const walk = async (dir) => {
|
|
647
|
-
const dirents = await promises.readdir(
|
|
698
|
+
const dirents = await promises.readdir(path2.join(this.root, dir), { withFileTypes: true });
|
|
648
699
|
for (const dirent of dirents) {
|
|
649
700
|
if (DEFAULT_IGNORED.has(dirent.name)) continue;
|
|
650
701
|
const rel = dir ? `${dir}/${dirent.name}` : dirent.name;
|
|
@@ -670,7 +721,7 @@ var NodeControlFs = class {
|
|
|
670
721
|
async rename(from, to) {
|
|
671
722
|
const absFrom = resolveInRoot(this.root, from);
|
|
672
723
|
const absTo = resolveInRoot(this.root, to);
|
|
673
|
-
await promises.mkdir(
|
|
724
|
+
await promises.mkdir(path2.dirname(absTo), { recursive: true });
|
|
674
725
|
await promises.rename(absFrom, absTo).catch(rethrow(from));
|
|
675
726
|
}
|
|
676
727
|
};
|
|
@@ -685,7 +736,7 @@ var NodeControlWatcher = class {
|
|
|
685
736
|
const pending = /* @__PURE__ */ new Map();
|
|
686
737
|
const flush = (rel) => {
|
|
687
738
|
pending.delete(rel);
|
|
688
|
-
promises.stat(
|
|
739
|
+
promises.stat(path2.join(this.root, rel)).then(
|
|
689
740
|
(stat) => onEvent(stat.isDirectory() ? WATCH_EVENT.ADD : WATCH_EVENT.CHANGE, [rel]),
|
|
690
741
|
() => onEvent(WATCH_EVENT.REMOVE, [rel])
|
|
691
742
|
);
|
|
@@ -696,7 +747,7 @@ var NodeControlWatcher = class {
|
|
|
696
747
|
onResync();
|
|
697
748
|
return;
|
|
698
749
|
}
|
|
699
|
-
const rel = filename.toString().split(
|
|
750
|
+
const rel = filename.toString().split(path2.sep).join("/");
|
|
700
751
|
if (isIgnored(rel)) return;
|
|
701
752
|
const existing = pending.get(rel);
|
|
702
753
|
if (existing) clearTimeout(existing);
|
|
@@ -1850,56 +1901,6 @@ function makeAgentContext(localPort, hello, createLocalSocket) {
|
|
|
1850
1901
|
createLocalSocket: (url, protocols) => createLocalSocket(url, protocols)
|
|
1851
1902
|
};
|
|
1852
1903
|
}
|
|
1853
|
-
var TUNNEL_URL_ENV = "CIMPLIFY_TUNNEL_URL";
|
|
1854
|
-
var TUNNEL_TOKEN_ENV = "CIMPLIFY_TUNNEL_TOKEN";
|
|
1855
|
-
var TUNNEL_LOCAL_PORT_ENV = "CIMPLIFY_TUNNEL_LOCAL_PORT";
|
|
1856
|
-
var TUNNEL_CONFIG_DIR = ".cimplify";
|
|
1857
|
-
var TUNNEL_CONFIG_FILE = "tunnel.json";
|
|
1858
|
-
var DEFAULT_DEV_SERVER_PORT = 3e3;
|
|
1859
|
-
function tunnelConfigPath(cwd) {
|
|
1860
|
-
return path.join(cwd, TUNNEL_CONFIG_DIR, TUNNEL_CONFIG_FILE);
|
|
1861
|
-
}
|
|
1862
|
-
async function readTunnelConfig(cwd, env = process.env) {
|
|
1863
|
-
const url = env[TUNNEL_URL_ENV];
|
|
1864
|
-
const token = env[TUNNEL_TOKEN_ENV];
|
|
1865
|
-
if (url && token) {
|
|
1866
|
-
return { url, token, localPort: envPort(env) ?? DEFAULT_DEV_SERVER_PORT };
|
|
1867
|
-
}
|
|
1868
|
-
return readTunnelConfigFile(cwd);
|
|
1869
|
-
}
|
|
1870
|
-
function envPort(env) {
|
|
1871
|
-
const raw = env[TUNNEL_LOCAL_PORT_ENV];
|
|
1872
|
-
if (!raw) return null;
|
|
1873
|
-
const port = Number.parseInt(raw, 10);
|
|
1874
|
-
return Number.isInteger(port) && port > 0 && port < 65536 ? port : null;
|
|
1875
|
-
}
|
|
1876
|
-
async function readTunnelConfigFile(cwd) {
|
|
1877
|
-
let raw;
|
|
1878
|
-
try {
|
|
1879
|
-
raw = await promises.readFile(tunnelConfigPath(cwd), "utf8");
|
|
1880
|
-
} catch {
|
|
1881
|
-
return null;
|
|
1882
|
-
}
|
|
1883
|
-
let parsed;
|
|
1884
|
-
try {
|
|
1885
|
-
parsed = JSON.parse(raw);
|
|
1886
|
-
} catch {
|
|
1887
|
-
return null;
|
|
1888
|
-
}
|
|
1889
|
-
if (typeof parsed !== "object" || parsed === null) return null;
|
|
1890
|
-
const record = parsed;
|
|
1891
|
-
if (typeof record.url !== "string" || record.url.length === 0) return null;
|
|
1892
|
-
if (typeof record.token !== "string" || record.token.length === 0) return null;
|
|
1893
|
-
const localPort = typeof record.port === "number" && Number.isInteger(record.port) && record.port > 0 ? record.port : DEFAULT_DEV_SERVER_PORT;
|
|
1894
|
-
return { url: record.url, token: record.token, localPort };
|
|
1895
|
-
}
|
|
1896
|
-
function sameTunnelConfig(a, b) {
|
|
1897
|
-
if (a === null || b === null) return a === b;
|
|
1898
|
-
return a.url === b.url && a.token === b.token && a.localPort === b.localPort;
|
|
1899
|
-
}
|
|
1900
|
-
function sameTunnelEndpoint(a, b) {
|
|
1901
|
-
return a.url === b.url && a.localPort === b.localPort;
|
|
1902
|
-
}
|
|
1903
1904
|
|
|
1904
1905
|
// src/tunnel/manager.ts
|
|
1905
1906
|
var CONFIG_POLL_MS = 2e3;
|
|
@@ -2029,4 +2030,4 @@ function startTunnelRuntime(cwd, options = {}) {
|
|
|
2029
2030
|
};
|
|
2030
2031
|
}
|
|
2031
2032
|
|
|
2032
|
-
export { startTunnelRuntime };
|
|
2033
|
+
export { TUNNEL_URL_ENV, startTunnelRuntime };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { startTunnelRuntime } from './chunk-
|
|
2
|
+
import { startTunnelRuntime, TUNNEL_URL_ENV } from './chunk-ZX5ZEOEU.mjs';
|
|
3
3
|
import { parseEnvFile, formatEnvFile } from './chunk-5U5OXOPN.mjs';
|
|
4
4
|
import { ENV_SCOPE, PUBLIC_ENV_PREFIX } from './chunk-MXYUAJEW.mjs';
|
|
5
5
|
import { parseArgs, flagBool } from './chunk-C4M3DXKC.mjs';
|
|
@@ -148,7 +148,11 @@ async function run(argv) {
|
|
|
148
148
|
}
|
|
149
149
|
const pm = await detectPackageManager(cwd);
|
|
150
150
|
info(dim(`(running: ${pm} run ${SCRIPT_DEV})`));
|
|
151
|
-
const
|
|
151
|
+
const hosted = Boolean(process.env[AGENT_EXTERNAL_ENV] || process.env[TUNNEL_URL_ENV]);
|
|
152
|
+
const child = spawn(pm, ["run", SCRIPT_DEV], {
|
|
153
|
+
cwd,
|
|
154
|
+
stdio: [hosted ? "pipe" : "inherit", "inherit", "inherit"]
|
|
155
|
+
});
|
|
152
156
|
try {
|
|
153
157
|
await new Promise((resolve, reject) => {
|
|
154
158
|
child.on("error", (err) => reject(new CliError(CLI_ERROR_CODE.INVALID_INPUT, `Failed to spawn ${pm}: ${err.message}`)));
|
package/dist/dispatcher.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { TEMPLATES } from './chunk-
|
|
3
|
-
import { package_default } from './chunk-
|
|
2
|
+
import { TEMPLATES } from './chunk-SVJPU4K7.mjs';
|
|
3
|
+
import { package_default } from './chunk-AMREB4KE.mjs';
|
|
4
4
|
|
|
5
5
|
// src/dispatcher.ts
|
|
6
6
|
var VERSION = package_default.version ?? "unknown";
|
|
@@ -143,19 +143,19 @@ var COMMANDS = {
|
|
|
143
143
|
domains: () => import('./domains-OS3DXSDN.mjs'),
|
|
144
144
|
logs: () => import('./logs-YNXDXAF7.mjs'),
|
|
145
145
|
status: () => import('./status-RR3GGTVU.mjs'),
|
|
146
|
-
dev: () => import('./dev-
|
|
147
|
-
agent: () => import('./agent-
|
|
146
|
+
dev: () => import('./dev-WSX75ELC.mjs'),
|
|
147
|
+
agent: () => import('./agent-UTARR75F.mjs'),
|
|
148
148
|
mock: () => import('./mock-HFVAAYK2.mjs'),
|
|
149
|
-
introspect: () => import('./introspect-
|
|
149
|
+
introspect: () => import('./introspect-HGX4I3XQ.mjs'),
|
|
150
150
|
inspect: () => import('./inspect-ULWQHT7J.mjs'),
|
|
151
|
-
doctor: () => import('./doctor-
|
|
152
|
-
explain: () => import('./explain-
|
|
151
|
+
doctor: () => import('./doctor-QFCEYEEZ.mjs'),
|
|
152
|
+
explain: () => import('./explain-BZPONVN3.mjs'),
|
|
153
153
|
assets: () => import('./assets-Y4JE6MSG.mjs'),
|
|
154
154
|
repo: () => import('./repo-OK6CVG3G.mjs'),
|
|
155
|
-
list: () => import('./list-
|
|
156
|
-
add: () => import('./add-
|
|
157
|
-
update: () => import('./update-
|
|
158
|
-
upgrade: () => import('./update-
|
|
155
|
+
list: () => import('./list-DZTPWNU3.mjs'),
|
|
156
|
+
add: () => import('./add-F7GKDXAD.mjs'),
|
|
157
|
+
update: () => import('./update-2FSGAVDH.mjs'),
|
|
158
|
+
upgrade: () => import('./update-2FSGAVDH.mjs'),
|
|
159
159
|
"auth-step-up": () => import('./auth-step-up-EHL5PM2L.mjs')
|
|
160
160
|
};
|
|
161
161
|
var COMMAND_PREFIXES = {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { gatherIntrospection } from './chunk-
|
|
2
|
+
import { gatherIntrospection } from './chunk-2VK4UABO.mjs';
|
|
3
3
|
import './chunk-OVHZV57L.mjs';
|
|
4
4
|
import './chunk-5U5OXOPN.mjs';
|
|
5
|
-
import './chunk-
|
|
5
|
+
import './chunk-AMREB4KE.mjs';
|
|
6
6
|
import { parseArgs, flagBool } from './chunk-C4M3DXKC.mjs';
|
|
7
7
|
import { SDK_ENV_API_URL, DEFAULT_API_BASE_URL, ApiClient, ENV_API_BASE_URL } from './chunk-JPXK5BLA.mjs';
|
|
8
8
|
import { readAuthOrNull } from './chunk-QA36VSLX.mjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { package_default } from './chunk-
|
|
2
|
+
import { package_default } from './chunk-AMREB4KE.mjs';
|
|
3
3
|
import { parseArgs } from './chunk-C4M3DXKC.mjs';
|
|
4
4
|
import { CliError, CLI_ERROR_CODE } from './chunk-YPC4VU65.mjs';
|
|
5
5
|
import { bold, dim, info, result } from './chunk-ZPVN6UXL.mjs';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
export { run as default, extractMockSeed, gatherIntrospection, renderIntrospection } from './chunk-
|
|
2
|
+
export { run as default, extractMockSeed, gatherIntrospection, renderIntrospection } from './chunk-2VK4UABO.mjs';
|
|
3
3
|
import './chunk-OVHZV57L.mjs';
|
|
4
4
|
import './chunk-5U5OXOPN.mjs';
|
|
5
|
-
import './chunk-
|
|
5
|
+
import './chunk-AMREB4KE.mjs';
|
|
6
6
|
import './chunk-C4M3DXKC.mjs';
|
|
7
7
|
import './chunk-QA36VSLX.mjs';
|
|
8
8
|
import './chunk-YPC4VU65.mjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { REGISTRY_INDEX } from './chunk-
|
|
2
|
+
import { REGISTRY_INDEX } from './chunk-SVJPU4K7.mjs';
|
|
3
3
|
import { parseArgs, flagBool } from './chunk-C4M3DXKC.mjs';
|
|
4
4
|
import { CliError, CLI_ERROR_CODE } from './chunk-YPC4VU65.mjs';
|
|
5
5
|
import { info, bold, dim, green, result } from './chunk-ZPVN6UXL.mjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { package_default } from './chunk-
|
|
2
|
+
import { package_default } from './chunk-AMREB4KE.mjs';
|
|
3
3
|
import { promptYesNo } from './chunk-4YIFBYBV.mjs';
|
|
4
4
|
import { parseArgs, flagBool, flagString } from './chunk-C4M3DXKC.mjs';
|
|
5
5
|
import { CliError, CLI_ERROR_CODE } from './chunk-YPC4VU65.mjs';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cimplify/cli",
|
|
3
|
-
"version": "0.13.
|
|
4
|
-
"description": "Cimplify CLI
|
|
3
|
+
"version": "0.13.1",
|
|
4
|
+
"description": "Cimplify CLI \u2014 deploy, manage env vars, link projects, and scaffold storefronts",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cimplify",
|
|
7
7
|
"cli",
|
|
@@ -51,6 +51,6 @@
|
|
|
51
51
|
"@babel/parser": "^8.0.4",
|
|
52
52
|
"@babel/traverse": "^8.0.4",
|
|
53
53
|
"@babel/types": "^8.0.4",
|
|
54
|
-
"@cimplify/sdk": "^0.99.
|
|
54
|
+
"@cimplify/sdk": "^0.99.2"
|
|
55
55
|
}
|
|
56
56
|
}
|