@swmansion/argent 0.35.1-next.6 → 0.35.1-next.8

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
@@ -38585,7 +38585,7 @@ function isCi(env = process.env) {
38585
38585
  var SESSION_ID2 = randomUUID5();
38586
38586
  function readCliVersion() {
38587
38587
  if (true) {
38588
- return "0.35.1-next.6";
38588
+ return "0.35.1-next.7";
38589
38589
  }
38590
38590
  return "0.0.0";
38591
38591
  }
@@ -39602,7 +39602,12 @@ function parseCommandArgs(argv, specs) {
39602
39602
  if (spec.choices && !spec.choices.includes(value)) {
39603
39603
  throw new UsageError(`${display} must be ${listChoices(spec.choices)}, got "${value}"`);
39604
39604
  }
39605
- options[name] = value;
39605
+ if (spec.repeatable) {
39606
+ const seen = options[name];
39607
+ options[name] = Array.isArray(seen) ? [...seen, value] : [value];
39608
+ } else {
39609
+ options[name] = value;
39610
+ }
39606
39611
  }
39607
39612
  return { positionals, options };
39608
39613
  }
@@ -39875,6 +39880,8 @@ Options (run):
39875
39880
  --update-baselines Write/refresh screenshot baselines instead of diffing,
39876
39881
  also those of tests that tool: e2e-execute steps run,
39877
39882
  unless such a step sets updateBaselines
39883
+ --env NAME=value Override a script environment value for this run.
39884
+ Repeatable. Values may contain {{secret:NAME}}
39878
39885
  --output <dir> Also write failed snapshot images (baseline/current/diff)
39879
39886
  and failed-step screenshots (step-<n>-screen.png)
39880
39887
  under <dir>/<test>/ \u2014 a stable path for CI artifact
@@ -39897,6 +39904,7 @@ Examples:
39897
39904
  argent e2e run .argent/e2e/checkout.yaml --output e2e-artifacts --json
39898
39905
  argent e2e run ~/shared-e2e/checkout.yaml --device <UDID> --update-baselines
39899
39906
  argent e2e run .argent/e2e --recursive
39907
+ argent e2e run checkout --env API_URL=https://staging.example.com
39900
39908
  `);
39901
39909
  }
39902
39910
  var RUN_OPTIONS = {
@@ -39908,7 +39916,8 @@ var RUN_OPTIONS = {
39908
39916
  // The tool-server's schema rejection carries no error_kind, so in a directory
39909
39917
  // run it would stop the whole batch.
39910
39918
  "platform": { kind: "value", choices: SELECTABLE_PLATFORMS },
39911
- "output": { kind: "value" }
39919
+ "output": { kind: "value" },
39920
+ "env": { kind: "value", repeatable: true }
39912
39921
  };
39913
39922
  var LIST_OPTIONS = {
39914
39923
  json: { kind: "boolean" },
@@ -39941,11 +39950,28 @@ function parseRunArgs(argv) {
39941
39950
  if (options.device !== void 0) out.device = options.device;
39942
39951
  if (options.platform !== void 0) out.platform = options.platform;
39943
39952
  if (options.output !== void 0) out.output = options.output;
39953
+ if (options.env !== void 0) out.env = parseEnvFlags(options.env);
39944
39954
  if (out.json && out.jsonStream) {
39945
39955
  throw new FlagParseException("--json and --json-stream cannot be combined");
39946
39956
  }
39947
39957
  return out;
39948
39958
  }
39959
+ var ENV_NAME_RE = /^[A-Za-z_][A-Za-z0-9_]*$/;
39960
+ function parseEnvFlags(values) {
39961
+ const env = {};
39962
+ for (const entry of values) {
39963
+ const eq = entry.indexOf("=");
39964
+ const name = eq === -1 ? entry : entry.slice(0, eq);
39965
+ if (eq === -1 || !ENV_NAME_RE.test(name) || name === "__proto__") {
39966
+ throw new FlagParseException(
39967
+ `--env takes NAME=value with a name of letters, digits and _, not starting with a digit; got ${JSON.stringify(entry)}`
39968
+ );
39969
+ }
39970
+ delete env[name];
39971
+ env[name] = entry.slice(eq + 1);
39972
+ }
39973
+ return env;
39974
+ }
39949
39975
  function renderEchoLine(s) {
39950
39976
  if (!s.message) return void 0;
39951
39977
  const indent = stepIndent(s.depth);
@@ -40087,6 +40113,9 @@ function rerunCommand(flowPath, rel, projectRoot, args) {
40087
40113
  if (args.platform) parts.push("--platform", shellQuoteArg(args.platform));
40088
40114
  if (args.updateBaselines) parts.push("--update-baselines");
40089
40115
  if (args.output) parts.push("--output", pathArg(path19.join(args.output, path19.dirname(rel))));
40116
+ for (const [name, value] of Object.entries(args.env ?? {})) {
40117
+ parts.push("--env", shellQuoteArg(`${name}=${value}`));
40118
+ }
40090
40119
  return parts.join(" ");
40091
40120
  }
40092
40121
  var EXPORT_SOURCE_MARKER = ".argent-e2e-source";
@@ -40371,6 +40400,7 @@ function buildRunPayload(flowPath, projectRoot, args) {
40371
40400
  if (args.device) payload.device = args.device;
40372
40401
  if (args.platform) payload.platform = args.platform;
40373
40402
  if (args.updateBaselines) payload.updateBaselines = true;
40403
+ if (args.env) payload.env = args.env;
40374
40404
  return payload;
40375
40405
  }
40376
40406
  function writeJsonStreamRecord(record2) {
@@ -17103,7 +17103,7 @@ function isCi(env = process.env) {
17103
17103
  var SESSION_ID = randomUUID4();
17104
17104
  function readCliVersion() {
17105
17105
  if (true) {
17106
- return "0.35.1-next.6";
17106
+ return "0.35.1-next.7";
17107
17107
  }
17108
17108
  return "0.0.0";
17109
17109
  }
@@ -38044,7 +38044,7 @@ async function startMcpServer(options) {
38044
38044
  const autoDescribeOn = autoDescribeEnabled();
38045
38045
  const whatsNewOn = whatsNewEnabled();
38046
38046
  const installedVersion = getInstalledVersion();
38047
- const highlightsVersion = true ? "0.35.1-next.6" : installedVersion;
38047
+ const highlightsVersion = true ? "0.35.1-next.7" : installedVersion;
38048
38048
  const captureTimeoutMs = options.captureTimeoutMs ?? CAPTURE_TIMEOUT_MS;
38049
38049
  const trees = createTreeMemory();
38050
38050
  const screenshots = createScreenshotMemory();
@@ -257,6 +257,10 @@ export interface ArgentToolArgs {
257
257
  path: string;
258
258
  /** Time limit in milliseconds. The default is 30000 and the minimum is 100. */
259
259
  timeout?: number;
260
+ /** Environment overrides for this script. Argent uses them immediately and saves them on the step. Values can include {{secret:NAME}}. */
261
+ env?: {
262
+ [key: string]: string;
263
+ };
260
264
  };
261
265
  "e2e-add-step": {
262
266
  /** Name of the e2e test being recorded: the one passed to e2e-start-recording. */
@@ -287,6 +291,10 @@ export interface ArgentToolArgs {
287
291
  updateBaselines?: boolean;
288
292
  /** Set to true to confirm the execution prerequisite has been met. Required when a fragment defines an executionPrerequisite: without it, the call runs no step and returns the prerequisite text. Not a dry run: an e2e test with no prerequisite runs in full. To read a prerequisite without running, read executionPrerequisite in the YAML file. */
289
293
  prerequisiteAcknowledged?: boolean;
294
+ /** Script environment overrides for this run, including run: fragments. Names match [A-Za-z_][A-Za-z0-9_]*, except __proto__. Values can include {{secret:NAME}}. A missing secret rejects the run before any step. */
295
+ env?: {
296
+ [key: string]: string;
297
+ };
290
298
  /** @deprecated Renamed to `e2e_test_path`. */
291
299
  flow_path?: string;
292
300
  /** @deprecated Renamed to `e2e_test_file`. */
@@ -312,6 +320,16 @@ export interface ArgentToolArgs {
312
320
  /** @deprecated Renamed to `e2e_test_file`. */
313
321
  flow_file?: string;
314
322
  };
323
+ "e2e-set-env": {
324
+ /** Test name passed to e2e-start-recording. */
325
+ name: string;
326
+ /** Absolute project root passed to e2e-start-recording. */
327
+ project_root: string;
328
+ /** Variable names to update. A null value removes that name. Omitted names keep their values. Use {{secret:NAME}} for credentials. */
329
+ env: {
330
+ [key: string]: string | null;
331
+ };
332
+ };
315
333
  "e2e-start-recording": {
316
334
  /** Name for this e2e test (e.g. "settings-explore"): letters, digits, underscore and hyphen only. */
317
335
  name: string;
@@ -324,6 +342,10 @@ export interface ArgentToolArgs {
324
342
  platform?: "ios" | "android" | "chromium" | "vega" | "macos" | Array<"ios" | "android" | "chromium" | "vega" | "macos">;
325
343
  runtimeKind?: "mobile" | "tv";
326
344
  };
345
+ /** Default script environment values saved in the test's top-level env. Use {{secret:NAME}} for credentials. */
346
+ env?: {
347
+ [key: string]: string;
348
+ };
327
349
  };
328
350
  "file-panel": {
329
351
  /** Mac app id from `list-devices` (macos-app-<bundle id>). */