@cimplify/cli 0.11.1 → 0.11.2
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/{chunk-3NDTR4GA.mjs → chunk-DL2YLGFV.mjs} +1 -1
- package/dist/{chunk-OMAF2H6T.mjs → chunk-YRP3RWYA.mjs} +1 -1
- package/dist/{dev-B4YUYQ4I.mjs → dev-JAIAEQFS.mjs} +11 -4
- package/dist/dispatcher.mjs +7 -7
- package/dist/{doctor-LAKJKBFU.mjs → doctor-Z3AXZUPV.mjs} +2 -2
- package/dist/{explain-EZ7DC4KE.mjs → explain-OLMEQJDY.mjs} +1 -1
- package/dist/{introspect-HVT3TMAM.mjs → introspect-HYNDDYSR.mjs} +2 -2
- package/dist/{preview-config-CHDYYWUY.mjs → preview-config-344CUZLO.mjs} +8 -4
- package/dist/{update-74UVN3R7.mjs → update-JWRQQYTM.mjs} +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { gitDetectRoot, gitCurrentBranch, gitCurrentSha, gitStatusPorcelain } from './chunk-K5464A3L.mjs';
|
|
3
3
|
import { parseEnvFile } from './chunk-DBZ3UOQ2.mjs';
|
|
4
|
-
import { package_default } from './chunk-
|
|
4
|
+
import { package_default } from './chunk-YRP3RWYA.mjs';
|
|
5
5
|
import { parseArgs } from './chunk-C4M3DXKC.mjs';
|
|
6
6
|
import { readAuthOrNull, readProjectLinkOrNull, readProjectState } from './chunk-UBAI443T.mjs';
|
|
7
7
|
import { bold, dim, yellow, green, info, result, red } from './chunk-E2T2SBP5.mjs';
|
|
@@ -369,7 +369,7 @@ var WsProxyStream = class {
|
|
|
369
369
|
this.local.addEventListener("close", (event) => {
|
|
370
370
|
if (this.done) return;
|
|
371
371
|
this.done = true;
|
|
372
|
-
this.ctx.fail({ code: event.code, reason: event.reason || void 0 });
|
|
372
|
+
this.ctx.fail({ code: sendableCloseCode(event.code), reason: event.reason || void 0 });
|
|
373
373
|
});
|
|
374
374
|
this.local.addEventListener("error", () => {
|
|
375
375
|
if (this.done || this.opened) return;
|
|
@@ -465,6 +465,11 @@ function sanitizeCloseCode(code) {
|
|
|
465
465
|
if (code === void 0) return void 0;
|
|
466
466
|
return code === WS_CLOSE_NORMAL || code >= 3e3 && code <= 4999 ? code : void 0;
|
|
467
467
|
}
|
|
468
|
+
function sendableCloseCode(code) {
|
|
469
|
+
if (code === void 0) return void 0;
|
|
470
|
+
const legal = code >= 1e3 && code <= 1003 || code >= 1007 && code <= 1014 || code >= 3e3 && code <= 4999;
|
|
471
|
+
return legal ? code : void 0;
|
|
472
|
+
}
|
|
468
473
|
var TUNNEL_URL_ENV = "CIMPLIFY_TUNNEL_URL";
|
|
469
474
|
var TUNNEL_TOKEN_ENV = "CIMPLIFY_TUNNEL_TOKEN";
|
|
470
475
|
var TUNNEL_LOCAL_PORT_ENV = "CIMPLIFY_TUNNEL_LOCAL_PORT";
|
|
@@ -639,10 +644,12 @@ var ENV_LOCAL_FILE = ".env.local";
|
|
|
639
644
|
var PUBLIC_API_URL_KEY = "NEXT_PUBLIC_CIMPLIFY_API_URL";
|
|
640
645
|
var SCRIPT_DEV = "dev";
|
|
641
646
|
var PREVIEW_ORIGIN_ENV = "CIMPLIFY_PREVIEW_ORIGIN";
|
|
642
|
-
async function applyPreviewOrigin(cwd,
|
|
643
|
-
const { ensurePreviewOrigin } = await import('./preview-config-
|
|
647
|
+
async function applyPreviewOrigin(cwd, originList) {
|
|
648
|
+
const { ensurePreviewOrigin } = await import('./preview-config-344CUZLO.mjs');
|
|
649
|
+
const origins = originList.split(",").map((origin) => origin.trim()).filter((origin) => origin.length > 0);
|
|
650
|
+
if (origins.length === 0) return;
|
|
644
651
|
try {
|
|
645
|
-
const result = await ensurePreviewOrigin(cwd,
|
|
652
|
+
const result = await ensurePreviewOrigin(cwd, origins);
|
|
646
653
|
if (result.status === "unrecognized") {
|
|
647
654
|
info(
|
|
648
655
|
dim(
|
package/dist/dispatcher.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { package_default } from './chunk-
|
|
2
|
+
import { package_default } from './chunk-YRP3RWYA.mjs';
|
|
3
3
|
import { TEMPLATES } from './chunk-W3WLADJP.mjs';
|
|
4
4
|
|
|
5
5
|
// src/dispatcher.ts
|
|
@@ -142,18 +142,18 @@ var COMMANDS = {
|
|
|
142
142
|
domains: () => import('./domains-H3K2WW55.mjs'),
|
|
143
143
|
logs: () => import('./logs-2ECJQ3MU.mjs'),
|
|
144
144
|
status: () => import('./status-IA7PJ4TV.mjs'),
|
|
145
|
-
dev: () => import('./dev-
|
|
145
|
+
dev: () => import('./dev-JAIAEQFS.mjs'),
|
|
146
146
|
mock: () => import('./mock-TSUKCLWU.mjs'),
|
|
147
|
-
introspect: () => import('./introspect-
|
|
147
|
+
introspect: () => import('./introspect-HYNDDYSR.mjs'),
|
|
148
148
|
inspect: () => import('./inspect-CGYX4DDF.mjs'),
|
|
149
|
-
doctor: () => import('./doctor-
|
|
150
|
-
explain: () => import('./explain-
|
|
149
|
+
doctor: () => import('./doctor-Z3AXZUPV.mjs'),
|
|
150
|
+
explain: () => import('./explain-OLMEQJDY.mjs'),
|
|
151
151
|
assets: () => import('./assets-4D7VXRUE.mjs'),
|
|
152
152
|
repo: () => import('./repo-WSUAHXWO.mjs'),
|
|
153
153
|
list: () => import('./list-27TS2L47.mjs'),
|
|
154
154
|
add: () => import('./add-5ODVFWVR.mjs'),
|
|
155
|
-
update: () => import('./update-
|
|
156
|
-
upgrade: () => import('./update-
|
|
155
|
+
update: () => import('./update-JWRQQYTM.mjs'),
|
|
156
|
+
upgrade: () => import('./update-JWRQQYTM.mjs'),
|
|
157
157
|
"auth-step-up": () => import('./auth-step-up-NOSM4PUR.mjs')
|
|
158
158
|
};
|
|
159
159
|
var COMMAND_PREFIXES = {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { gatherIntrospection } from './chunk-
|
|
2
|
+
import { gatherIntrospection } from './chunk-DL2YLGFV.mjs';
|
|
3
3
|
import './chunk-K5464A3L.mjs';
|
|
4
4
|
import './chunk-DBZ3UOQ2.mjs';
|
|
5
|
-
import './chunk-
|
|
5
|
+
import './chunk-YRP3RWYA.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-F4S5KETY.mjs';
|
|
8
8
|
import { readAuthOrNull } from './chunk-UBAI443T.mjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { package_default } from './chunk-
|
|
2
|
+
import { package_default } from './chunk-YRP3RWYA.mjs';
|
|
3
3
|
import { parseArgs } from './chunk-C4M3DXKC.mjs';
|
|
4
4
|
import { bold, dim, info, result, CliError, CLI_ERROR_CODE } from './chunk-E2T2SBP5.mjs';
|
|
5
5
|
|
|
@@ -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-DL2YLGFV.mjs';
|
|
3
3
|
import './chunk-K5464A3L.mjs';
|
|
4
4
|
import './chunk-DBZ3UOQ2.mjs';
|
|
5
|
-
import './chunk-
|
|
5
|
+
import './chunk-YRP3RWYA.mjs';
|
|
6
6
|
import './chunk-C4M3DXKC.mjs';
|
|
7
7
|
import './chunk-UBAI443T.mjs';
|
|
8
8
|
import './chunk-E2T2SBP5.mjs';
|
|
@@ -85,21 +85,25 @@ function upsertOrigin(config, origin) {
|
|
|
85
85
|
);
|
|
86
86
|
return true;
|
|
87
87
|
}
|
|
88
|
-
function injectAllowedDevOrigins(source,
|
|
88
|
+
function injectAllowedDevOrigins(source, origins) {
|
|
89
89
|
const ast = parse(source, {
|
|
90
90
|
sourceType: "module",
|
|
91
91
|
plugins: ["typescript"]
|
|
92
92
|
});
|
|
93
93
|
const config = findConfigObject(ast);
|
|
94
94
|
if (!config) return { code: source, changed: false, resolved: false };
|
|
95
|
-
|
|
95
|
+
let changed = false;
|
|
96
|
+
for (const origin of origins) {
|
|
97
|
+
if (upsertOrigin(config, origin)) changed = true;
|
|
98
|
+
}
|
|
99
|
+
if (!changed) return { code: source, changed: false, resolved: true };
|
|
96
100
|
return {
|
|
97
101
|
code: generate(ast, { retainLines: true }, source).code,
|
|
98
102
|
changed: true,
|
|
99
103
|
resolved: true
|
|
100
104
|
};
|
|
101
105
|
}
|
|
102
|
-
async function ensurePreviewOrigin(cwd,
|
|
106
|
+
async function ensurePreviewOrigin(cwd, origins) {
|
|
103
107
|
for (const filename of CONFIG_FILENAMES) {
|
|
104
108
|
const file = path.join(cwd, filename);
|
|
105
109
|
let source;
|
|
@@ -109,7 +113,7 @@ async function ensurePreviewOrigin(cwd, origin) {
|
|
|
109
113
|
if (err.code === "ENOENT") continue;
|
|
110
114
|
throw err;
|
|
111
115
|
}
|
|
112
|
-
const { code, changed, resolved } = injectAllowedDevOrigins(source,
|
|
116
|
+
const { code, changed, resolved } = injectAllowedDevOrigins(source, origins);
|
|
113
117
|
if (!resolved) return { status: "unrecognized", file: filename };
|
|
114
118
|
if (changed) await promises.writeFile(file, code, "utf8");
|
|
115
119
|
return { status: changed ? "injected" : "already-present", file: filename };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { package_default } from './chunk-
|
|
2
|
+
import { package_default } from './chunk-YRP3RWYA.mjs';
|
|
3
3
|
import { promptYesNo } from './chunk-ITAFAORS.mjs';
|
|
4
4
|
import { parseArgs, flagBool, flagString } from './chunk-C4M3DXKC.mjs';
|
|
5
5
|
import { success, bold, info, dim, result, failure, CliError, CLI_ERROR_CODE, step, isJsonMode } from './chunk-E2T2SBP5.mjs';
|