@swmansion/argent 0.34.0 → 0.34.1-next.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.
Binary file
Binary file
Binary file
Binary file
Binary file
package/dist/cli-cmds.mjs CHANGED
@@ -32311,7 +32311,7 @@ function configuredRecordingsDir() {
32311
32311
  const expanded = trimmed === "~" ? home : trimmed.startsWith("~/") || trimmed.startsWith(`~${sep4}`) ? join13(home, trimmed.slice(2)) : trimmed;
32312
32312
  return resolve8(durableBaseDir(), expanded);
32313
32313
  }
32314
- var MAX_DURABLE_BYTES = 2 * 1024 * 1024 * 1024;
32314
+ var MAX_ARTIFACT_BYTES = 2 * 1024 * 1024 * 1024;
32315
32315
  async function readCapped(res, cap) {
32316
32316
  const headers = res.headers;
32317
32317
  const declared = Number(headers?.get?.("content-length"));
@@ -32452,7 +32452,7 @@ async function materializeArtifacts(result, ctx) {
32452
32452
  }
32453
32453
  return finalPath2;
32454
32454
  }
32455
- if (!Number.isInteger(value.size) || value.size <= 0 || value.size > MAX_DURABLE_BYTES) {
32455
+ if (!Number.isInteger(value.size) || value.size <= 0 || value.size > MAX_ARTIFACT_BYTES) {
32456
32456
  return null;
32457
32457
  }
32458
32458
  const res = await fetchFn(`${ctx.toolsUrl}/artifacts/${value.id}`, {
@@ -32491,7 +32491,9 @@ async function materializeArtifacts(result, ctx) {
32491
32491
  signal: ctx.signal
32492
32492
  });
32493
32493
  if (!res.ok) return null;
32494
- const data = Buffer.from(await res.arrayBuffer());
32494
+ const cap = !value.archive && Number.isInteger(value.size) && value.size > 0 ? Math.min(value.size, MAX_ARTIFACT_BYTES) : MAX_ARTIFACT_BYTES;
32495
+ const data = await readCapped(res, cap);
32496
+ if (!data) return null;
32495
32497
  await ensureDir();
32496
32498
  if (value.archive === "tar.gz") {
32497
32499
  return await downloadAndExtractArchive(value, data, dir);
@@ -36072,7 +36074,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
36072
36074
  var SESSION_ID2 = randomUUID5();
36073
36075
  function readCliVersion() {
36074
36076
  if (true) {
36075
- return "0.34.0";
36077
+ return "0.34.1-next.1";
36076
36078
  }
36077
36079
  return "0.0.0";
36078
36080
  }
@@ -37147,11 +37149,12 @@ A directory run prints only the steps that need attention (each failure, each
37147
37149
  warning, and each script step's output), then its outcome. After the last test
37148
37150
  it lists every failed test with its reason and a command that re-runs that test
37149
37151
  alone, then a final summary; --recursive walks subdirectories too
37150
- (dot-directories and node_modules are skipped). A test that fails its steps
37151
- keeps the batch running, as does one the server rejects up front \u2014 an invalid
37152
- file, or a device it cannot resolve. A transport failure, a rejection the server
37153
- does not mark as validation, or a reply that is not a report stops the batch and
37154
- counts the remaining tests skipped.
37152
+ (__baselines__, node_modules and dot-directories other than .argent are
37153
+ skipped). A test that fails its steps keeps the batch running, as does one the
37154
+ server rejects up front \u2014 an invalid file, or a device it cannot resolve. A
37155
+ transport failure, a rejection the server does not mark as validation, or a
37156
+ reply that is not a report stops the batch and counts the remaining tests
37157
+ skipped.
37155
37158
 
37156
37159
  A test can declare a \`requires:\` block (platform, runtimeKind) that names the
37157
37160
  targets it supports. A directory run skips each test whose requirements the
@@ -37183,10 +37186,12 @@ Subcommands:
37183
37186
  run <test|test.yaml|dir> Run a saved e2e test by name, a YAML file by path,
37184
37187
  or every test in a directory, and report pass/fail
37185
37188
  (exit reflects result)
37186
- list [--json] List runnable YAML paths in .argent/e2e and
37187
- .argent/flows (legacy); notes go to stderr.
37189
+ list [dir] [-r] [--json] List runnable YAML paths in dir (-r: also in its
37190
+ subdirectories), or in .argent/e2e and
37191
+ .argent/flows (legacy) with notes on stderr.
37188
37192
  --json prints { "e2eTests": [...] } instead, with
37189
- path, name, legacy and shadowedBy per entry
37193
+ path per entry, plus name, legacy and shadowedBy
37194
+ when no dir is given
37190
37195
 
37191
37196
  Options (run):
37192
37197
  --device <id> Device id to run against (auto-detected when omitted)
@@ -37228,7 +37233,10 @@ var RUN_OPTIONS = {
37228
37233
  "platform": { kind: "value" },
37229
37234
  "output": { kind: "value" }
37230
37235
  };
37231
- var LIST_OPTIONS = { json: { kind: "boolean" } };
37236
+ var LIST_OPTIONS = {
37237
+ json: { kind: "boolean" },
37238
+ recursive: { kind: "boolean", alias: "r" }
37239
+ };
37232
37240
  function parseRunArgs(argv) {
37233
37241
  let parsed;
37234
37242
  try {
@@ -37383,8 +37391,11 @@ function shellQuoteArg(arg) {
37383
37391
  if (SHELL_SAFE_ARG.test(arg)) return arg;
37384
37392
  return `'${arg.replaceAll("'", "'\\''")}'`;
37385
37393
  }
37394
+ function optionSafePath(p) {
37395
+ return p.startsWith("-") ? `.${path17.sep}${p}` : p;
37396
+ }
37386
37397
  function rerunCommand(flowPath, rel, projectRoot, args) {
37387
- const pathArg = (p) => shellQuoteArg(p.startsWith("-") ? `.${path17.sep}${p}` : p);
37398
+ const pathArg = (p) => shellQuoteArg(optionSafePath(p));
37388
37399
  const fromCwd = path17.relative(projectRoot, flowPath);
37389
37400
  const shown = path17.isAbsolute(fromCwd) || fromCwd.split(/[\\/]+/).includes("..") ? flowPath : fromCwd;
37390
37401
  const parts = ["argent e2e run", pathArg(shown)];
@@ -37581,24 +37592,6 @@ async function isRunnableFlowFile(filePath) {
37581
37592
  return false;
37582
37593
  }
37583
37594
  }
37584
- async function collectRunnableFlowPaths(dir, relDir = "") {
37585
- const found = [];
37586
- const entries = await fsp.readdir(dir, { withFileTypes: true });
37587
- for (const entry of entries) {
37588
- const rel = relDir ? path17.join(relDir, entry.name) : entry.name;
37589
- if (entry.isDirectory()) {
37590
- if (entry.name === "__baselines__") continue;
37591
- found.push(
37592
- ...await collectRunnableFlowPaths(path17.join(dir, entry.name), rel).catch(() => [])
37593
- );
37594
- continue;
37595
- }
37596
- if (!entry.name.endsWith(".yaml")) continue;
37597
- if (!SAFE_FLOW_NAME.test(path17.basename(entry.name, ".yaml"))) continue;
37598
- if (await isRunnableFlowFile(path17.join(dir, entry.name))) found.push(rel);
37599
- }
37600
- return found;
37601
- }
37602
37595
  async function resolveFlowRef(ref, projectRoot) {
37603
37596
  if (!SAFE_FLOW_NAME.test(ref)) return { suppliedPath: ref, fromName: false };
37604
37597
  const picked = await resolveE2eFile(projectRoot, ref);
@@ -37634,7 +37627,7 @@ async function collectFlowFiles(dir, recursive2) {
37634
37627
  for (const entry of await fsp.readdir(current, { withFileTypes: true })) {
37635
37628
  const entryRel = rel ? path17.join(rel, entry.name) : entry.name;
37636
37629
  if (entry.isDirectory()) {
37637
- if (recursive2 && !entry.name.startsWith(".") && entry.name !== "node_modules") {
37630
+ if (recursive2 && entry.name !== "__baselines__" && entry.name !== "node_modules" && (entry.name === ".argent" || !entry.name.startsWith("."))) {
37638
37631
  await walk(path17.join(current, entry.name), entryRel).catch(() => {
37639
37632
  });
37640
37633
  }
@@ -37908,14 +37901,22 @@ async function e2e(argv, options) {
37908
37901
  return;
37909
37902
  }
37910
37903
  let json3;
37904
+ let listDir;
37905
+ let recursive2;
37911
37906
  try {
37912
37907
  const parsed = parseCommandArgs(rest, LIST_OPTIONS);
37913
- if (parsed.positionals.length > 0) {
37908
+ if (parsed.positionals.length > 1) {
37914
37909
  throw new UsageError(
37915
- `unexpected argument ${JSON.stringify(parsed.positionals[0])}; e2e list takes no arguments`
37910
+ `unexpected argument ${JSON.stringify(parsed.positionals[1])}; e2e list takes at most one directory path`
37916
37911
  );
37917
37912
  }
37918
37913
  json3 = parsed.options.json === true;
37914
+ listDir = parsed.positionals[0];
37915
+ if (listDir === "") throw new UsageError("e2e list requires a non-empty directory path");
37916
+ recursive2 = parsed.options.recursive === true;
37917
+ if (recursive2 && listDir === void 0) {
37918
+ throw new UsageError("e2e list --recursive requires a directory path");
37919
+ }
37919
37920
  } catch (err) {
37920
37921
  if (!(err instanceof UsageError)) throw err;
37921
37922
  console.error(
@@ -37928,21 +37929,34 @@ Run \`argent e2e --help\`.`
37928
37929
  console.error(json3 ? JSON.stringify(errorRecord(message)) : message);
37929
37930
  return exitAfterFlush(2);
37930
37931
  };
37932
+ if (listDir?.split(/[\\/]+/).includes("..")) {
37933
+ return listFail(
37934
+ `E2E test directory must not contain ".." segments - they are collapsed without following symlinks, so the path can name a different directory than the one your shell opens: ${listDir}
37935
+ Pass the fully resolved path to the directory.`
37936
+ );
37937
+ }
37931
37938
  const entries = [];
37932
37939
  const byName = /* @__PURE__ */ new Map();
37933
37940
  let anyDir = false;
37934
- for (const dir of E2E_DIRS) {
37941
+ const dirs = listDir === void 0 ? E2E_DIRS : [listDir];
37942
+ for (const dir of dirs) {
37935
37943
  let rels;
37936
37944
  try {
37937
- rels = (await collectRunnableFlowPaths(path17.join(process.cwd(), dir))).sort();
37945
+ rels = await collectFlowFiles(path17.resolve(dir), listDir === void 0 || recursive2);
37938
37946
  } catch (err) {
37939
37947
  const code = err.code;
37940
- if (code === "ENOENT" || code === "ENOTDIR") continue;
37941
- return listFail(`Could not read e2e test directory: ${dir}`);
37948
+ if (listDir === void 0 && (code === "ENOENT" || code === "ENOTDIR")) continue;
37949
+ return listFail(
37950
+ code === "ENOENT" ? `E2E test directory not found: ${dir}` : code === "ENOTDIR" ? `E2E test path is not a directory: ${dir}` : `Could not read e2e test directory: ${dir}`
37951
+ );
37942
37952
  }
37943
37953
  anyDir = true;
37944
37954
  for (const rel of rels) {
37945
37955
  const shown = path17.join(dir, rel);
37956
+ if (listDir !== void 0) {
37957
+ entries.push({ path: optionSafePath(shown) });
37958
+ continue;
37959
+ }
37946
37960
  const name = path17.dirname(rel) === "." ? path17.basename(rel, ".yaml") : void 0;
37947
37961
  const shadowedBy = name === void 0 ? void 0 : byName.get(name);
37948
37962
  if (name !== void 0 && shadowedBy === void 0) byName.set(name, shown);
@@ -37963,9 +37977,11 @@ Run \`argent e2e --help\`.`
37963
37977
  console.error(
37964
37978
  `warning: no ${E2E_DIRS.join(" or ")} directory in the current working directory`
37965
37979
  );
37966
- } else if (entries.length === 0)
37967
- console.error(`No e2e tests found in ${E2E_DIRS.join(" or ")}`);
37968
- else {
37980
+ } else if (entries.length === 0) {
37981
+ console.error(
37982
+ `No e2e tests found in ${listDir ?? E2E_DIRS.join(" or ")}` + (listDir === void 0 || recursive2 ? "" : "\nPass -r/--recursive to include subdirectories.")
37983
+ );
37984
+ } else {
37969
37985
  console.log(entries.map((entry) => entry.path).join("\n"));
37970
37986
  for (const entry of entries) {
37971
37987
  if (entry.shadowedBy !== void 0)
package/dist/client.js CHANGED
@@ -11057,7 +11057,7 @@ function configuredRecordingsDir() {
11057
11057
  const expanded = trimmed === "~" ? home : trimmed.startsWith("~/") || trimmed.startsWith(`~${sep4}`) ? join13(home, trimmed.slice(2)) : trimmed;
11058
11058
  return resolve8(durableBaseDir(), expanded);
11059
11059
  }
11060
- var MAX_DURABLE_BYTES = 2 * 1024 * 1024 * 1024;
11060
+ var MAX_ARTIFACT_BYTES = 2 * 1024 * 1024 * 1024;
11061
11061
  async function readCapped(res, cap) {
11062
11062
  const headers = res.headers;
11063
11063
  const declared = Number(headers?.get?.("content-length"));
@@ -11198,7 +11198,7 @@ async function materializeArtifacts(result, ctx) {
11198
11198
  }
11199
11199
  return finalPath2;
11200
11200
  }
11201
- if (!Number.isInteger(value.size) || value.size <= 0 || value.size > MAX_DURABLE_BYTES) {
11201
+ if (!Number.isInteger(value.size) || value.size <= 0 || value.size > MAX_ARTIFACT_BYTES) {
11202
11202
  return null;
11203
11203
  }
11204
11204
  const res = await fetchFn(`${ctx.toolsUrl}/artifacts/${value.id}`, {
@@ -11237,7 +11237,9 @@ async function materializeArtifacts(result, ctx) {
11237
11237
  signal: ctx.signal
11238
11238
  });
11239
11239
  if (!res.ok) return null;
11240
- const data = Buffer.from(await res.arrayBuffer());
11240
+ const cap = !value.archive && Number.isInteger(value.size) && value.size > 0 ? Math.min(value.size, MAX_ARTIFACT_BYTES) : MAX_ARTIFACT_BYTES;
11241
+ const data = await readCapped(res, cap);
11242
+ if (!data) return null;
11241
11243
  await ensureDir();
11242
11244
  if (value.archive === "tar.gz") {
11243
11245
  return await downloadAndExtractArchive(value, data, dir);
@@ -16989,7 +16989,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
16989
16989
  var SESSION_ID = randomUUID4();
16990
16990
  function readCliVersion() {
16991
16991
  if (true) {
16992
- return "0.34.0";
16992
+ return "0.34.1-next.1";
16993
16993
  }
16994
16994
  return "0.0.0";
16995
16995
  }
@@ -24222,7 +24222,7 @@ import { basename as basename7, dirname as dirname17, extname as extname2, isAbs
24222
24222
  import { createHash as createHash5 } from "node:crypto";
24223
24223
  var ALLOWED_SAVE_DIRS = /* @__PURE__ */ new Set([normalize2(".argent/recordings")]);
24224
24224
  var RECORDINGS_SAVE_DIR = normalize2(".argent/recordings");
24225
- var MAX_DURABLE_BYTES = 2 * 1024 * 1024 * 1024;
24225
+ var MAX_ARTIFACT_BYTES = 2 * 1024 * 1024 * 1024;
24226
24226
 
24227
24227
  // ../argent-installer/src/update.ts
24228
24228
  function getRequestedVersion(args) {
@@ -27811,7 +27811,7 @@ function configuredRecordingsDir() {
27811
27811
  const expanded = trimmed === "~" ? home : trimmed.startsWith("~/") || trimmed.startsWith(`~${sep4}`) ? join13(home, trimmed.slice(2)) : trimmed;
27812
27812
  return resolve8(durableBaseDir(), expanded);
27813
27813
  }
27814
- var MAX_DURABLE_BYTES = 2 * 1024 * 1024 * 1024;
27814
+ var MAX_ARTIFACT_BYTES = 2 * 1024 * 1024 * 1024;
27815
27815
  async function readCapped(res, cap) {
27816
27816
  const headers = res.headers;
27817
27817
  const declared = Number(headers?.get?.("content-length"));
@@ -27952,7 +27952,7 @@ async function materializeArtifacts(result, ctx) {
27952
27952
  }
27953
27953
  return finalPath2;
27954
27954
  }
27955
- if (!Number.isInteger(value.size) || value.size <= 0 || value.size > MAX_DURABLE_BYTES) {
27955
+ if (!Number.isInteger(value.size) || value.size <= 0 || value.size > MAX_ARTIFACT_BYTES) {
27956
27956
  return null;
27957
27957
  }
27958
27958
  const res = await fetchFn(`${ctx.toolsUrl}/artifacts/${value.id}`, {
@@ -27991,7 +27991,9 @@ async function materializeArtifacts(result, ctx) {
27991
27991
  signal: ctx.signal
27992
27992
  });
27993
27993
  if (!res.ok) return null;
27994
- const data = Buffer.from(await res.arrayBuffer());
27994
+ const cap = !value.archive && Number.isInteger(value.size) && value.size > 0 ? Math.min(value.size, MAX_ARTIFACT_BYTES) : MAX_ARTIFACT_BYTES;
27995
+ const data = await readCapped(res, cap);
27996
+ if (!data) return null;
27995
27997
  await ensureDir();
27996
27998
  if (value.archive === "tar.gz") {
27997
27999
  return await downloadAndExtractArchive(value, data, dir);
@@ -101281,7 +101281,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
101281
101281
  var SESSION_ID = (0, import_node_crypto3.randomUUID)();
101282
101282
  function readCliVersion() {
101283
101283
  if (true) {
101284
- return "0.34.0";
101284
+ return "0.34.1-next.1";
101285
101285
  }
101286
101286
  return "0.0.0";
101287
101287
  }
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swmansion/argent",
3
- "version": "0.34.0",
3
+ "version": "0.34.1-next.1",
4
4
  "mcpName": "io.github.software-mansion/argent",
5
5
  "description": "MCP server for iOS Simulator, Android Emulator, Chromium app and Mac app control",
6
6
  "license": "Apache-2.0",