@swmansion/argent 0.34.1-next.5 → 0.34.1-next.6

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.
Files changed (2) hide show
  1. package/dist/cli-cmds.mjs +44 -11
  2. package/package.json +1 -1
package/dist/cli-cmds.mjs CHANGED
@@ -37025,6 +37025,7 @@ function isValidationIssue(value) {
37025
37025
  }
37026
37026
 
37027
37027
  // ../argent-cli/src/e2e.ts
37028
+ var import_yaml3 = __toESM(require_dist(), 1);
37028
37029
  import * as fsp from "node:fs/promises";
37029
37030
  import { constants as fsConstants2 } from "node:fs";
37030
37031
  import { createHash as createHash5 } from "node:crypto";
@@ -37161,7 +37162,8 @@ warning, and each script step's output), then its outcome. After the last test
37161
37162
  it lists every failed test with its reason and a command that re-runs that test
37162
37163
  alone, then a final summary; --recursive walks subdirectories too
37163
37164
  (__baselines__, node_modules and dot-directories other than .argent are
37164
- skipped). A test that fails its steps keeps the batch running, as does one the
37165
+ skipped). A directory run and list skip a YAML file that is not an e2e test.
37166
+ A test that fails its steps keeps the batch running, as does one the
37165
37167
  server rejects up front \u2014 an invalid file, or a device it cannot resolve. A
37166
37168
  transport failure, a rejection the server does not mark as validation, or a
37167
37169
  reply that is not a report stops the batch and counts the remaining tests
@@ -37201,8 +37203,8 @@ Subcommands:
37201
37203
  subdirectories), or in .argent/e2e and
37202
37204
  .argent/flows (legacy) with notes on stderr.
37203
37205
  --json prints { "e2eTests": [...] } instead, with
37204
- path per entry, plus name, legacy and shadowedBy
37205
- when no dir is given
37206
+ path and an optional warning per entry, plus name,
37207
+ legacy and shadowedBy when no dir is given
37206
37208
 
37207
37209
  Options (run):
37208
37210
  --device <id> Device id to run against (auto-detected when omitted)
@@ -37603,6 +37605,29 @@ async function isRunnableFlowFile(filePath) {
37603
37605
  return false;
37604
37606
  }
37605
37607
  }
37608
+ var E2E_FILE_WARNING_TEXT = {
37609
+ "syntax-error": "has a YAML syntax error",
37610
+ "empty": "is empty"
37611
+ };
37612
+ async function checkE2eTestShape(filePath) {
37613
+ let content;
37614
+ try {
37615
+ content = (await fsp.readFile(filePath, "utf8")).trim();
37616
+ } catch {
37617
+ return "ok";
37618
+ }
37619
+ if (content.length === 0) return "empty";
37620
+ if (!content.includes("steps") && !/^version:/m.test(content)) return "skip";
37621
+ let parsed;
37622
+ try {
37623
+ parsed = (0, import_yaml3.parse)(content, { logLevel: "error" });
37624
+ } catch {
37625
+ return "syntax-error";
37626
+ }
37627
+ if (typeof parsed !== "object" || parsed === null) return "skip";
37628
+ const { version: version2 } = parsed;
37629
+ return Number.isInteger(version2) && Number(version2) > 1 || "steps" in parsed ? "ok" : "skip";
37630
+ }
37606
37631
  async function resolveFlowRef(ref, projectRoot) {
37607
37632
  if (!SAFE_FLOW_NAME.test(ref)) return { suppliedPath: ref, fromName: false };
37608
37633
  const picked = await resolveE2eFile(projectRoot, ref);
@@ -37646,11 +37671,15 @@ async function collectFlowFiles(dir, recursive2) {
37646
37671
  }
37647
37672
  if (!entry.name.endsWith(".yaml")) continue;
37648
37673
  if (!SAFE_FLOW_NAME.test(path17.basename(entry.name, ".yaml"))) continue;
37649
- if (await isRunnableFlowFile(path17.join(current, entry.name))) found.push(entryRel);
37674
+ const filePath = path17.join(current, entry.name);
37675
+ if (!await isRunnableFlowFile(filePath)) continue;
37676
+ const shape = await checkE2eTestShape(filePath);
37677
+ if (shape === "skip") continue;
37678
+ found.push({ path: entryRel, ...shape !== "ok" && { warning: shape } });
37650
37679
  }
37651
37680
  };
37652
37681
  await walk(dir, "");
37653
- return found.sort();
37682
+ return found.sort((a2, b) => a2.path < b.path ? -1 : a2.path > b.path ? 1 : 0);
37654
37683
  }
37655
37684
  var RUN_TOOL_ID = "e2e-execute";
37656
37685
  function buildRunPayload(flowPath, projectRoot, args) {
@@ -37783,7 +37812,7 @@ async function runFlowDirectory(dir, args, projectRoot, options) {
37783
37812
  };
37784
37813
  let flows;
37785
37814
  try {
37786
- flows = await collectFlowFiles(dir, args.recursive);
37815
+ flows = (await collectFlowFiles(dir, args.recursive)).map((file2) => file2.path);
37787
37816
  } catch {
37788
37817
  return reject(`Could not read e2e test directory: ${dir}`);
37789
37818
  }
@@ -37951,9 +37980,9 @@ Pass the fully resolved path to the directory.`
37951
37980
  let anyDir = false;
37952
37981
  const dirs = listDir === void 0 ? E2E_DIRS : [listDir];
37953
37982
  for (const dir of dirs) {
37954
- let rels;
37983
+ let files;
37955
37984
  try {
37956
- rels = await collectFlowFiles(path17.resolve(dir), listDir === void 0 || recursive2);
37985
+ files = await collectFlowFiles(path17.resolve(dir), listDir === void 0 || recursive2);
37957
37986
  } catch (err) {
37958
37987
  const code = err.code;
37959
37988
  if (listDir === void 0 && (code === "ENOENT" || code === "ENOTDIR")) continue;
@@ -37962,10 +37991,11 @@ Pass the fully resolved path to the directory.`
37962
37991
  );
37963
37992
  }
37964
37993
  anyDir = true;
37965
- for (const rel of rels) {
37994
+ for (const { path: rel, warning } of files) {
37966
37995
  const shown = path17.join(dir, rel);
37996
+ const warningField = warning !== void 0 && { warning };
37967
37997
  if (listDir !== void 0) {
37968
- entries.push({ path: optionSafePath(shown) });
37998
+ entries.push({ path: optionSafePath(shown), ...warningField });
37969
37999
  continue;
37970
38000
  }
37971
38001
  const name = path17.dirname(rel) === "." ? path17.basename(rel, ".yaml") : void 0;
@@ -37975,7 +38005,8 @@ Pass the fully resolved path to the directory.`
37975
38005
  path: shown,
37976
38006
  ...name !== void 0 && { name },
37977
38007
  legacy: dir !== E2E_DIR,
37978
- ...shadowedBy !== void 0 && { shadowedBy }
38008
+ ...shadowedBy !== void 0 && { shadowedBy },
38009
+ ...warningField
37979
38010
  });
37980
38011
  }
37981
38012
  }
@@ -37999,6 +38030,8 @@ Pass the fully resolved path to the directory.`
37999
38030
  console.error(
38000
38031
  `warning: ${entry.path} is shadowed by ${entry.shadowedBy} when run by name`
38001
38032
  );
38033
+ if (entry.warning !== void 0)
38034
+ console.error(`warning: ${entry.path} ${E2E_FILE_WARNING_TEXT[entry.warning]}`);
38002
38035
  }
38003
38036
  const legacyCount = entries.filter((entry) => entry.legacy).length;
38004
38037
  if (legacyCount > 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swmansion/argent",
3
- "version": "0.34.1-next.5",
3
+ "version": "0.34.1-next.6",
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",