@swmansion/argent 0.16.1-next.6 → 0.16.1-next.7
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/tool-server.cjs +52 -40
- package/package.json +1 -1
package/dist/tool-server.cjs
CHANGED
|
@@ -105217,7 +105217,7 @@ async function shutdown(timeoutMs = SHORT_FLUSH_TIMEOUT_MS) {
|
|
|
105217
105217
|
// ../tool-server/src/http.ts
|
|
105218
105218
|
var import_express3 = __toESM(require_express2());
|
|
105219
105219
|
var import_bytes2 = __toESM(require_bytes());
|
|
105220
|
-
var
|
|
105220
|
+
var import_node_fs11 = require("node:fs");
|
|
105221
105221
|
var import_promises9 = require("node:fs/promises");
|
|
105222
105222
|
var import_node_os8 = require("node:os");
|
|
105223
105223
|
var import_node_path9 = require("node:path");
|
|
@@ -105268,7 +105268,7 @@ init_android_binary();
|
|
|
105268
105268
|
// ../tool-server/src/utils/vega-cli.ts
|
|
105269
105269
|
var import_node_child_process4 = require("node:child_process");
|
|
105270
105270
|
var import_node_util3 = require("node:util");
|
|
105271
|
-
var
|
|
105271
|
+
var import_node_fs5 = require("node:fs");
|
|
105272
105272
|
var import_promises3 = require("node:fs/promises");
|
|
105273
105273
|
var import_node_os3 = require("node:os");
|
|
105274
105274
|
var import_node_path3 = require("node:path");
|
|
@@ -105278,7 +105278,9 @@ init_subprocess_error();
|
|
|
105278
105278
|
// ../tool-server/src/utils/vega-process.ts
|
|
105279
105279
|
var import_node_child_process3 = require("node:child_process");
|
|
105280
105280
|
var import_node_util2 = require("node:util");
|
|
105281
|
+
var import_node_fs4 = require("node:fs");
|
|
105281
105282
|
var execFileAsync2 = (0, import_node_util2.promisify)(import_node_child_process3.execFile);
|
|
105283
|
+
var PS_BIN = ["/bin/ps", "/usr/bin/ps"].find((p) => (0, import_node_fs4.existsSync)(p)) ?? "ps";
|
|
105282
105284
|
var PS_ARGS = ["-A", "-ww", "-o", "command="];
|
|
105283
105285
|
var PS_ARGS_WITH_PID = ["-A", "-ww", "-o", "pid=,command="];
|
|
105284
105286
|
var VVD_PROCESS_RE = /(?:^|\/)(?:vega|kepler)-virtual-device(?:\s|$)/;
|
|
@@ -105312,7 +105314,7 @@ function parseVvdPids(psOutput) {
|
|
|
105312
105314
|
}
|
|
105313
105315
|
async function listRunningVvdConsolePorts() {
|
|
105314
105316
|
try {
|
|
105315
|
-
const { stdout } = await execFileAsync2(
|
|
105317
|
+
const { stdout } = await execFileAsync2(PS_BIN, [...PS_ARGS], {
|
|
105316
105318
|
timeout: VVD_PS_PROBE_TIMEOUT_MS,
|
|
105317
105319
|
maxBuffer: 16 * 1024 * 1024
|
|
105318
105320
|
});
|
|
@@ -105327,7 +105329,7 @@ async function listRunningVvdConsolePorts() {
|
|
|
105327
105329
|
}
|
|
105328
105330
|
async function listRunningVvdPids() {
|
|
105329
105331
|
try {
|
|
105330
|
-
const { stdout } = await execFileAsync2(
|
|
105332
|
+
const { stdout } = await execFileAsync2(PS_BIN, [...PS_ARGS_WITH_PID], {
|
|
105331
105333
|
timeout: 5e3,
|
|
105332
105334
|
maxBuffer: 16 * 1024 * 1024
|
|
105333
105335
|
});
|
|
@@ -105347,7 +105349,7 @@ var VEGA_BINARY_TTL_MS = 6e4;
|
|
|
105347
105349
|
var cachedVegaBinary;
|
|
105348
105350
|
async function isExecutable(p) {
|
|
105349
105351
|
try {
|
|
105350
|
-
await (0, import_promises3.access)(p,
|
|
105352
|
+
await (0, import_promises3.access)(p, import_node_fs5.constants.X_OK);
|
|
105351
105353
|
return true;
|
|
105352
105354
|
} catch {
|
|
105353
105355
|
return false;
|
|
@@ -105410,10 +105412,15 @@ async function reapVegaGroup(child) {
|
|
|
105410
105412
|
}
|
|
105411
105413
|
}
|
|
105412
105414
|
async function collectDescendantPids(rootPid) {
|
|
105413
|
-
|
|
105414
|
-
|
|
105415
|
-
|
|
105416
|
-
|
|
105415
|
+
let stdout;
|
|
105416
|
+
try {
|
|
105417
|
+
({ stdout } = await execFileAsync3(PS_BIN, ["-A", "-o", "pid=,ppid="], {
|
|
105418
|
+
timeout: 1500,
|
|
105419
|
+
maxBuffer: 16 * 1024 * 1024
|
|
105420
|
+
}));
|
|
105421
|
+
} catch {
|
|
105422
|
+
return [];
|
|
105423
|
+
}
|
|
105417
105424
|
const childrenByParent = /* @__PURE__ */ new Map();
|
|
105418
105425
|
for (const line of stdout.split("\n")) {
|
|
105419
105426
|
const m = line.trim().match(/^(\d+)\s+(\d+)$/);
|
|
@@ -105439,10 +105446,15 @@ async function collectDescendantPids(rootPid) {
|
|
|
105439
105446
|
return descendants;
|
|
105440
105447
|
}
|
|
105441
105448
|
async function pgidMembers(pgid) {
|
|
105442
|
-
|
|
105443
|
-
|
|
105444
|
-
|
|
105445
|
-
|
|
105449
|
+
let stdout;
|
|
105450
|
+
try {
|
|
105451
|
+
({ stdout } = await execFileAsync3(PS_BIN, ["-A", "-o", "pid=,pgid="], {
|
|
105452
|
+
timeout: 1500,
|
|
105453
|
+
maxBuffer: 16 * 1024 * 1024
|
|
105454
|
+
}));
|
|
105455
|
+
} catch {
|
|
105456
|
+
return [];
|
|
105457
|
+
}
|
|
105446
105458
|
const members = [];
|
|
105447
105459
|
for (const line of stdout.split("\n")) {
|
|
105448
105460
|
const m = line.trim().match(/^(\d+)\s+(\d+)$/);
|
|
@@ -105467,7 +105479,7 @@ async function reapLingeringGroupMembers(pid) {
|
|
|
105467
105479
|
} catch {
|
|
105468
105480
|
}
|
|
105469
105481
|
}
|
|
105470
|
-
function resolveSpawnCwd(getCwd = () => process.cwd(), dirExists =
|
|
105482
|
+
function resolveSpawnCwd(getCwd = () => process.cwd(), dirExists = import_node_fs5.existsSync, fallback = (0, import_node_os3.tmpdir)()) {
|
|
105471
105483
|
try {
|
|
105472
105484
|
const cwd = getCwd();
|
|
105473
105485
|
if (dirExists(cwd)) return cwd;
|
|
@@ -105758,7 +105770,7 @@ function toSimulatorNetworkError(toolLabel, err, apiUrl, fallbackHint) {
|
|
|
105758
105770
|
}
|
|
105759
105771
|
|
|
105760
105772
|
// ../tool-server/src/utils/update-checker.ts
|
|
105761
|
-
var
|
|
105773
|
+
var import_node_fs6 = __toESM(require("node:fs"));
|
|
105762
105774
|
var import_node_os4 = __toESM(require("node:os"));
|
|
105763
105775
|
var import_node_path4 = __toESM(require("node:path"));
|
|
105764
105776
|
var import_semver = __toESM(require_semver2());
|
|
@@ -105776,7 +105788,7 @@ function getSuppressionFilePath() {
|
|
|
105776
105788
|
}
|
|
105777
105789
|
function loadSuppressUntil() {
|
|
105778
105790
|
try {
|
|
105779
|
-
const raw =
|
|
105791
|
+
const raw = import_node_fs6.default.readFileSync(getSuppressionFilePath(), "utf8");
|
|
105780
105792
|
const parsed = JSON.parse(raw);
|
|
105781
105793
|
const value = parsed.suppressUntil;
|
|
105782
105794
|
return typeof value === "number" && Number.isFinite(value) ? value : 0;
|
|
@@ -105786,8 +105798,8 @@ function loadSuppressUntil() {
|
|
|
105786
105798
|
}
|
|
105787
105799
|
function persistSuppressUntil(value) {
|
|
105788
105800
|
const filePath = getSuppressionFilePath();
|
|
105789
|
-
|
|
105790
|
-
|
|
105801
|
+
import_node_fs6.default.mkdirSync(import_node_path4.default.dirname(filePath), { recursive: true });
|
|
105802
|
+
import_node_fs6.default.writeFileSync(filePath, JSON.stringify({ suppressUntil: value }));
|
|
105791
105803
|
}
|
|
105792
105804
|
var state2 = {
|
|
105793
105805
|
updateAvailable: false,
|
|
@@ -105879,7 +105891,7 @@ ACTION REQUIRED: Save a note (via TODO, task list) that an Argent update to v${l
|
|
|
105879
105891
|
}
|
|
105880
105892
|
|
|
105881
105893
|
// ../tool-server/src/preview.ts
|
|
105882
|
-
var
|
|
105894
|
+
var import_node_fs9 = __toESM(require("node:fs"));
|
|
105883
105895
|
var import_node_os6 = __toESM(require("node:os"));
|
|
105884
105896
|
var import_node_path6 = __toESM(require("node:path"));
|
|
105885
105897
|
var import_express = __toESM(require_express2());
|
|
@@ -115922,7 +115934,7 @@ init_src();
|
|
|
115922
115934
|
|
|
115923
115935
|
// ../tool-server/src/utils/vega-sdk.ts
|
|
115924
115936
|
var import_promises4 = require("node:fs/promises");
|
|
115925
|
-
var
|
|
115937
|
+
var import_node_fs7 = require("node:fs");
|
|
115926
115938
|
var import_node_os5 = require("node:os");
|
|
115927
115939
|
var import_node_path5 = require("node:path");
|
|
115928
115940
|
var import_semver2 = __toESM(require_semver2());
|
|
@@ -115945,7 +115957,7 @@ function sdkComponentRoots(config2) {
|
|
|
115945
115957
|
return Array.from(new Set(roots));
|
|
115946
115958
|
}
|
|
115947
115959
|
async function resolveVersion(channelDir, preferred) {
|
|
115948
|
-
if (preferred && (0,
|
|
115960
|
+
if (preferred && (0, import_node_fs7.existsSync)((0, import_node_path5.join)(channelDir, preferred))) return preferred;
|
|
115949
115961
|
try {
|
|
115950
115962
|
const versions = (await (0, import_promises4.readdir)(channelDir)).filter((e) => import_semver2.default.valid(e)).sort(import_semver2.default.rcompare);
|
|
115951
115963
|
return versions[0] ?? null;
|
|
@@ -115963,7 +115975,7 @@ async function resolveVegaSdkImagesDir() {
|
|
|
115963
115975
|
const version4 = await resolveVersion(channelDir, preferred);
|
|
115964
115976
|
if (!version4) continue;
|
|
115965
115977
|
const imagesDir = (0, import_node_path5.join)(channelDir, version4, "vvd", "images");
|
|
115966
|
-
if ((0,
|
|
115978
|
+
if ((0, import_node_fs7.existsSync)(imagesDir)) return imagesDir;
|
|
115967
115979
|
}
|
|
115968
115980
|
return null;
|
|
115969
115981
|
}
|
|
@@ -117901,7 +117913,7 @@ var TraceProcessorUnavailableError = class _TraceProcessorUnavailableError exten
|
|
|
117901
117913
|
};
|
|
117902
117914
|
|
|
117903
117915
|
// ../native-devtools-android/src/wasm-trace-processor.ts
|
|
117904
|
-
var
|
|
117916
|
+
var import_node_fs8 = require("node:fs");
|
|
117905
117917
|
var import_promises5 = require("node:fs/promises");
|
|
117906
117918
|
var path13 = __toESM(require("node:path"));
|
|
117907
117919
|
var import_node_url2 = require("node:url");
|
|
@@ -117916,7 +117928,7 @@ function engineGlobals() {
|
|
|
117916
117928
|
function resolveTraceProcessorAssets() {
|
|
117917
117929
|
const dir = path13.join(__dirname, "..", "assets", "trace-processor");
|
|
117918
117930
|
const wasmOverride = process.env.ARGENT_TRACE_PROCESSOR_WASM;
|
|
117919
|
-
if (wasmOverride && !(0,
|
|
117931
|
+
if (wasmOverride && !(0, import_node_fs8.existsSync)(wasmOverride)) {
|
|
117920
117932
|
throw new TraceProcessorUnavailableError("wasm_path_invalid", { path: wasmOverride });
|
|
117921
117933
|
}
|
|
117922
117934
|
return {
|
|
@@ -118044,8 +118056,8 @@ async function createEngine() {
|
|
|
118044
118056
|
setupWorkerScope(dir);
|
|
118045
118057
|
silenceDecoderWarning();
|
|
118046
118058
|
const g = engineGlobals();
|
|
118047
|
-
g.__TP_WASM_BYTES = new Uint8Array((0,
|
|
118048
|
-
const src = patchGlueForNode((0,
|
|
118059
|
+
g.__TP_WASM_BYTES = new Uint8Array((0, import_node_fs8.readFileSync)(wasmPath));
|
|
118060
|
+
const src = patchGlueForNode((0, import_node_fs8.readFileSync)(gluePath, "utf8"));
|
|
118049
118061
|
import_node_vm.default.runInThisContext(src, { filename: "engine_bundle.node.patched.js" });
|
|
118050
118062
|
const bridge = g.__TP_bridge;
|
|
118051
118063
|
if (!bridge) throw new Error("patched glue did not expose globalThis.__TP_bridge");
|
|
@@ -118730,7 +118742,7 @@ function findUiFile(name) {
|
|
|
118730
118742
|
import_node_path6.default.resolve(__dirname, "..", "..", "ui", name)
|
|
118731
118743
|
];
|
|
118732
118744
|
for (const p of candidates) {
|
|
118733
|
-
if (
|
|
118745
|
+
if (import_node_fs9.default.existsSync(p)) return p;
|
|
118734
118746
|
}
|
|
118735
118747
|
return null;
|
|
118736
118748
|
}
|
|
@@ -119053,7 +119065,7 @@ data: ${JSON.stringify(data)}
|
|
|
119053
119065
|
const roots = /* @__PURE__ */ new Set();
|
|
119054
119066
|
for (const r of [import_node_os6.default.tmpdir(), process.cwd(), "/tmp"]) {
|
|
119055
119067
|
try {
|
|
119056
|
-
roots.add(
|
|
119068
|
+
roots.add(import_node_fs9.default.realpathSync(r));
|
|
119057
119069
|
} catch {
|
|
119058
119070
|
}
|
|
119059
119071
|
}
|
|
@@ -119072,8 +119084,8 @@ data: ${JSON.stringify(data)}
|
|
|
119072
119084
|
let real;
|
|
119073
119085
|
let size;
|
|
119074
119086
|
try {
|
|
119075
|
-
real =
|
|
119076
|
-
const st =
|
|
119087
|
+
real = import_node_fs9.default.realpathSync(src);
|
|
119088
|
+
const st = import_node_fs9.default.statSync(real);
|
|
119077
119089
|
if (!st.isFile()) throw new Error("not a file");
|
|
119078
119090
|
size = st.size;
|
|
119079
119091
|
} catch {
|
|
@@ -119090,7 +119102,7 @@ data: ${JSON.stringify(data)}
|
|
|
119090
119102
|
}
|
|
119091
119103
|
res.set("Cache-Control", "no-store");
|
|
119092
119104
|
res.type(mime);
|
|
119093
|
-
|
|
119105
|
+
import_node_fs9.default.createReadStream(real).on("error", () => {
|
|
119094
119106
|
if (!res.headersSent) res.status(404).end();
|
|
119095
119107
|
}).pipe(res);
|
|
119096
119108
|
});
|
|
@@ -119142,7 +119154,7 @@ data: ${JSON.stringify(data)}
|
|
|
119142
119154
|
}
|
|
119143
119155
|
|
|
119144
119156
|
// ../tool-server/src/artifacts.ts
|
|
119145
|
-
var
|
|
119157
|
+
var import_node_fs10 = require("node:fs");
|
|
119146
119158
|
var import_promises7 = require("node:fs/promises");
|
|
119147
119159
|
var import_node_child_process15 = require("node:child_process");
|
|
119148
119160
|
|
|
@@ -119270,7 +119282,7 @@ function makeArtifactRoute(registry2) {
|
|
|
119270
119282
|
res.setHeader("Content-Type", entry.mimeType);
|
|
119271
119283
|
res.setHeader("Content-Disposition", `attachment; filename="${entry.filename}"`);
|
|
119272
119284
|
if (entry.size > 0) res.setHeader("Content-Length", String(entry.size));
|
|
119273
|
-
const stream = (0,
|
|
119285
|
+
const stream = (0, import_node_fs10.createReadStream)(entry.path);
|
|
119274
119286
|
stream.on("error", () => {
|
|
119275
119287
|
if (!res.headersSent) res.status(500).json({ error: `Failed to read artifact "${id}"` });
|
|
119276
119288
|
else res.destroy();
|
|
@@ -119937,7 +119949,7 @@ function createHttpApp(registry2, options) {
|
|
|
119937
119949
|
}
|
|
119938
119950
|
const id = (0, import_node_crypto6.randomUUID)();
|
|
119939
119951
|
const tarPath = (0, import_node_path9.join)((0, import_node_os8.tmpdir)(), `argent-upload-${id}.tar.gz`);
|
|
119940
|
-
const ws = (0,
|
|
119952
|
+
const ws = (0, import_node_fs11.createWriteStream)(tarPath);
|
|
119941
119953
|
let received = 0;
|
|
119942
119954
|
let released = false;
|
|
119943
119955
|
const releaseInFlight = () => {
|
|
@@ -120275,15 +120287,15 @@ function createHttpApp(registry2, options) {
|
|
|
120275
120287
|
|
|
120276
120288
|
// ../tool-server/src/event-log.ts
|
|
120277
120289
|
var import_bunyan = __toESM(require_bunyan());
|
|
120278
|
-
var
|
|
120290
|
+
var import_node_fs12 = require("node:fs");
|
|
120279
120291
|
var import_node_path10 = require("node:path");
|
|
120280
120292
|
init_src();
|
|
120281
120293
|
function createToolServerEventLog({
|
|
120282
120294
|
filePath
|
|
120283
120295
|
}) {
|
|
120284
|
-
(0,
|
|
120285
|
-
(0,
|
|
120286
|
-
const fileStream = (0,
|
|
120296
|
+
(0, import_node_fs12.mkdirSync)((0, import_node_path10.dirname)(filePath), { recursive: true });
|
|
120297
|
+
(0, import_node_fs12.writeFileSync)(filePath, "");
|
|
120298
|
+
const fileStream = (0, import_node_fs12.createWriteStream)(filePath, { flags: "a" });
|
|
120287
120299
|
let disposed = false;
|
|
120288
120300
|
let disposePromise = null;
|
|
120289
120301
|
let streamError = null;
|
|
@@ -139144,7 +139156,7 @@ var nativeProfilerSessionBlueprint = {
|
|
|
139144
139156
|
var import_child_process4 = require("child_process");
|
|
139145
139157
|
init_src();
|
|
139146
139158
|
var import_fs9 = require("fs");
|
|
139147
|
-
var
|
|
139159
|
+
var import_node_fs13 = require("node:fs");
|
|
139148
139160
|
var path22 = __toESM(require("path"));
|
|
139149
139161
|
|
|
139150
139162
|
// ../tool-server/src/utils/ios-profiler/notify.ts
|
|
@@ -140793,7 +140805,7 @@ function resolveDefaultTemplatePath() {
|
|
|
140793
140805
|
)
|
|
140794
140806
|
];
|
|
140795
140807
|
for (const candidate of candidates) {
|
|
140796
|
-
if ((0,
|
|
140808
|
+
if ((0, import_node_fs13.existsSync)(candidate)) return candidate;
|
|
140797
140809
|
}
|
|
140798
140810
|
throw new FailureError(
|
|
140799
140811
|
`Argent.tracetemplate not found. Looked in:
|