@cimplify/cli 0.13.2 → 0.13.3
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/{agent-24IISIOQ.mjs → agent-CEYZNYXA.mjs} +1 -1
- package/dist/{chunk-D7DVYTVI.mjs → chunk-72VM62IN.mjs} +1 -1
- package/dist/{chunk-YTZ233XM.mjs → chunk-KNTFZ6LD.mjs} +63 -19
- package/dist/{chunk-QKRGKFHE.mjs → chunk-QKDCMUWP.mjs} +1 -1
- package/dist/{dev-3U6WW5D7.mjs → dev-SYFBDJSY.mjs} +1 -1
- package/dist/dispatcher.mjs +8 -8
- package/dist/{doctor-6NYHQ7YE.mjs → doctor-QPCWLW4L.mjs} +2 -2
- package/dist/{explain-O363MCQ2.mjs → explain-XB67PYQQ.mjs} +1 -1
- package/dist/{introspect-UKSR3JBF.mjs → introspect-D4473WPV.mjs} +2 -2
- package/dist/{update-QA5WJ6YL.mjs → update-B5HANRBK.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-OVHZV57L.mjs';
|
|
3
3
|
import { parseEnvFile } from './chunk-5U5OXOPN.mjs';
|
|
4
|
-
import { package_default } from './chunk-
|
|
4
|
+
import { package_default } from './chunk-QKDCMUWP.mjs';
|
|
5
5
|
import { parseArgs } from './chunk-C4M3DXKC.mjs';
|
|
6
6
|
import { readAuthOrNull, readProjectLinkOrNull, readProjectState } from './chunk-QA36VSLX.mjs';
|
|
7
7
|
import { bold, dim, yellow, green, info, result, red } from './chunk-ZPVN6UXL.mjs';
|
|
@@ -4,6 +4,7 @@ import { promises, watch } from 'fs';
|
|
|
4
4
|
import path2 from 'path';
|
|
5
5
|
import http from 'http';
|
|
6
6
|
import { spawn } from 'child_process';
|
|
7
|
+
import { createHash } from 'crypto';
|
|
7
8
|
|
|
8
9
|
var TUNNEL_URL_ENV = "CIMPLIFY_TUNNEL_URL";
|
|
9
10
|
var TUNNEL_TOKEN_ENV = "CIMPLIFY_TUNNEL_TOKEN";
|
|
@@ -437,6 +438,7 @@ var CONTROL_ERROR = {
|
|
|
437
438
|
IO: "io",
|
|
438
439
|
UNSUPPORTED: "unsupported"};
|
|
439
440
|
var WATCH_EVENT = {
|
|
441
|
+
ADD: "add",
|
|
440
442
|
CHANGE: "change",
|
|
441
443
|
REMOVE: "remove",
|
|
442
444
|
RESYNC: "resync"
|
|
@@ -616,10 +618,16 @@ var ControlSession = class {
|
|
|
616
618
|
const paths = Array.isArray(request.paths) ? request.paths : [WORKSPACE_ROOT];
|
|
617
619
|
this.watch = this.deps.watcher.start(
|
|
618
620
|
paths,
|
|
619
|
-
(type, changed) => {
|
|
621
|
+
(type, changed, hashes) => {
|
|
620
622
|
if (this.epoch !== epoch) return;
|
|
621
623
|
this.seq += 1;
|
|
622
|
-
this.send({
|
|
624
|
+
this.send({
|
|
625
|
+
event: type,
|
|
626
|
+
paths: changed,
|
|
627
|
+
...hashes ? { hashes } : {},
|
|
628
|
+
seq: this.seq,
|
|
629
|
+
epoch
|
|
630
|
+
});
|
|
623
631
|
},
|
|
624
632
|
() => {
|
|
625
633
|
if (this.epoch !== epoch) return;
|
|
@@ -725,6 +733,10 @@ var NodeControlFs = class {
|
|
|
725
733
|
}
|
|
726
734
|
};
|
|
727
735
|
var WATCH_DEBOUNCE_MS = 60;
|
|
736
|
+
var MAX_WATCH_PENDING_PATHS = 4096;
|
|
737
|
+
var MAX_WATCH_TRACKED_PATHS = 1e5;
|
|
738
|
+
var CONTENT_HASH_ALGORITHM = "sha256";
|
|
739
|
+
var CONTENT_HASH_ENCODING = "hex";
|
|
728
740
|
var NodeControlWatcher = class {
|
|
729
741
|
constructor(root) {
|
|
730
742
|
this.root = root;
|
|
@@ -733,35 +745,68 @@ var NodeControlWatcher = class {
|
|
|
733
745
|
start(_relPaths, onEvent, onResync) {
|
|
734
746
|
let watcher;
|
|
735
747
|
const pending = /* @__PURE__ */ new Map();
|
|
748
|
+
const versions = /* @__PURE__ */ new Map();
|
|
749
|
+
const observed = /* @__PURE__ */ new Map();
|
|
736
750
|
let stopped = false;
|
|
737
|
-
const
|
|
751
|
+
const clearTracking = () => {
|
|
752
|
+
for (const timer of pending.values()) clearTimeout(timer);
|
|
753
|
+
pending.clear();
|
|
754
|
+
versions.clear();
|
|
755
|
+
observed.clear();
|
|
756
|
+
};
|
|
757
|
+
const requestResync = () => {
|
|
758
|
+
clearTracking();
|
|
759
|
+
if (!stopped) onResync();
|
|
760
|
+
};
|
|
761
|
+
const flush = async (rel, version) => {
|
|
738
762
|
pending.delete(rel);
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
(stat)
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
(
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
763
|
+
try {
|
|
764
|
+
const absolute = path2.join(this.root, rel);
|
|
765
|
+
const stat = await promises.stat(absolute);
|
|
766
|
+
if (stat.isDirectory()) return;
|
|
767
|
+
const bytes = await promises.readFile(absolute);
|
|
768
|
+
if (stopped || versions.get(rel) !== version) return;
|
|
769
|
+
const hash = createHash(CONTENT_HASH_ALGORITHM).update(bytes).digest(CONTENT_HASH_ENCODING);
|
|
770
|
+
if (observed.get(rel) === hash) return;
|
|
771
|
+
observed.set(rel, hash);
|
|
772
|
+
onEvent(WATCH_EVENT.CHANGE, [rel], { [rel]: hash });
|
|
773
|
+
} catch (error) {
|
|
774
|
+
if (stopped || versions.get(rel) !== version) return;
|
|
775
|
+
if (error.code === "ENOENT") {
|
|
776
|
+
if (observed.get(rel) === null) return;
|
|
777
|
+
observed.set(rel, null);
|
|
778
|
+
onEvent(WATCH_EVENT.REMOVE, [rel]);
|
|
779
|
+
} else {
|
|
780
|
+
requestResync();
|
|
749
781
|
}
|
|
750
|
-
|
|
782
|
+
}
|
|
783
|
+
if (observed.size > MAX_WATCH_TRACKED_PATHS) {
|
|
784
|
+
requestResync();
|
|
785
|
+
}
|
|
751
786
|
};
|
|
752
787
|
try {
|
|
753
788
|
watcher = watch(this.root, { recursive: true }, (_type, filename) => {
|
|
754
789
|
if (filename === null) {
|
|
755
|
-
|
|
790
|
+
requestResync();
|
|
756
791
|
return;
|
|
757
792
|
}
|
|
758
793
|
const rel = filename.toString().split(path2.sep).join("/");
|
|
759
794
|
if (isIgnored(rel)) return;
|
|
760
795
|
const existing = pending.get(rel);
|
|
761
796
|
if (existing) clearTimeout(existing);
|
|
797
|
+
if (!existing && pending.size >= MAX_WATCH_PENDING_PATHS) {
|
|
798
|
+
requestResync();
|
|
799
|
+
return;
|
|
800
|
+
}
|
|
801
|
+
const version = (versions.get(rel) ?? 0) + 1;
|
|
802
|
+
versions.set(rel, version);
|
|
803
|
+
if (versions.size > MAX_WATCH_TRACKED_PATHS) {
|
|
804
|
+
requestResync();
|
|
805
|
+
return;
|
|
806
|
+
}
|
|
762
807
|
pending.set(
|
|
763
808
|
rel,
|
|
764
|
-
setTimeout(() => flush(rel), WATCH_DEBOUNCE_MS)
|
|
809
|
+
setTimeout(() => void flush(rel, version), WATCH_DEBOUNCE_MS)
|
|
765
810
|
);
|
|
766
811
|
});
|
|
767
812
|
} catch (error) {
|
|
@@ -771,13 +816,12 @@ var NodeControlWatcher = class {
|
|
|
771
816
|
);
|
|
772
817
|
}
|
|
773
818
|
watcher.on("error", () => {
|
|
774
|
-
|
|
819
|
+
requestResync();
|
|
775
820
|
});
|
|
776
821
|
return {
|
|
777
822
|
stop: () => {
|
|
778
823
|
stopped = true;
|
|
779
|
-
|
|
780
|
-
pending.clear();
|
|
824
|
+
clearTracking();
|
|
781
825
|
watcher.close();
|
|
782
826
|
}
|
|
783
827
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { startTunnelRuntime, TUNNEL_URL_ENV } from './chunk-
|
|
2
|
+
import { startTunnelRuntime, TUNNEL_URL_ENV } from './chunk-KNTFZ6LD.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';
|
package/dist/dispatcher.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { TEMPLATES } from './chunk-SVJPU4K7.mjs';
|
|
3
|
-
import { package_default } from './chunk-
|
|
3
|
+
import { package_default } from './chunk-QKDCMUWP.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-SYFBDJSY.mjs'),
|
|
147
|
+
agent: () => import('./agent-CEYZNYXA.mjs'),
|
|
148
148
|
mock: () => import('./mock-HFVAAYK2.mjs'),
|
|
149
|
-
introspect: () => import('./introspect-
|
|
149
|
+
introspect: () => import('./introspect-D4473WPV.mjs'),
|
|
150
150
|
inspect: () => import('./inspect-ULWQHT7J.mjs'),
|
|
151
|
-
doctor: () => import('./doctor-
|
|
152
|
-
explain: () => import('./explain-
|
|
151
|
+
doctor: () => import('./doctor-QPCWLW4L.mjs'),
|
|
152
|
+
explain: () => import('./explain-XB67PYQQ.mjs'),
|
|
153
153
|
assets: () => import('./assets-Y4JE6MSG.mjs'),
|
|
154
154
|
repo: () => import('./repo-OK6CVG3G.mjs'),
|
|
155
155
|
list: () => import('./list-DZTPWNU3.mjs'),
|
|
156
156
|
add: () => import('./add-F7GKDXAD.mjs'),
|
|
157
|
-
update: () => import('./update-
|
|
158
|
-
upgrade: () => import('./update-
|
|
157
|
+
update: () => import('./update-B5HANRBK.mjs'),
|
|
158
|
+
upgrade: () => import('./update-B5HANRBK.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-72VM62IN.mjs';
|
|
3
3
|
import './chunk-OVHZV57L.mjs';
|
|
4
4
|
import './chunk-5U5OXOPN.mjs';
|
|
5
|
-
import './chunk-
|
|
5
|
+
import './chunk-QKDCMUWP.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-QKDCMUWP.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-72VM62IN.mjs';
|
|
3
3
|
import './chunk-OVHZV57L.mjs';
|
|
4
4
|
import './chunk-5U5OXOPN.mjs';
|
|
5
|
-
import './chunk-
|
|
5
|
+
import './chunk-QKDCMUWP.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 { package_default } from './chunk-
|
|
2
|
+
import { package_default } from './chunk-QKDCMUWP.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';
|