@argos-ci/cli 5.0.5 → 5.1.0

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/index.mjs +3 -1
  2. package/package.json +3 -3
package/dist/index.mjs CHANGED
@@ -12,11 +12,12 @@ import open from "open";
12
12
  //#region src/options.ts
13
13
  const parallelNonceOption = new Option("--parallel-nonce <string>", "A unique ID for this parallel build").env("ARGOS_PARALLEL_NONCE");
14
14
  const tokenOption = new Option("--token <token>", "Repository token").env("ARGOS_TOKEN");
15
+ const projectOption = new Option("--project <slug>", "Argos project slug (account/project), used to disambiguate tokenless authentication when multiple projects are linked to the same repository").env("ARGOS_PROJECT");
15
16
  const buildNameOption = new Option("--build-name <string>", "Name of the build, in case you want to run multiple Argos builds in a single CI job").env("ARGOS_BUILD_NAME");
16
17
  //#endregion
17
18
  //#region src/commands/upload.ts
18
19
  function uploadCommand(program) {
19
- program.command("upload").argument("<directory>", "Directory to upload").description("Upload screenshots to Argos").option("-f, --files <patterns...>", "One or more globs matching image file paths to upload", "**/*.{png,jpg,jpeg}").option("-i, --ignore <patterns...>", "One or more globs matching image file paths to ignore (ex: \"**/*.png **/diff.jpg\")").addOption(tokenOption).addOption(buildNameOption).addOption(new Option("--mode <string>", "Mode of comparison applied. CI for visual regression testing, monitoring for visual monitoring.").default("ci").choices(["ci", "monitoring"]).env("ARGOS_MODE")).addOption(new Option("--parallel", "Enable parallel mode. Run multiple Argos builds and combine them at the end").env("ARGOS_PARALLEL")).addOption(new Option("--parallel-total <number>", "The number of parallel nodes being ran").env("ARGOS_PARALLEL_TOTAL")).addOption(parallelNonceOption).addOption(new Option("--parallel-index <number>", "The index of the parallel node being ran (must be at least 1)").env("ARGOS_PARALLEL_INDEX")).addOption(new Option("--reference-branch <string>", "Branch used as baseline for screenshot comparison").env("ARGOS_REFERENCE_BRANCH")).addOption(new Option("--reference-commit <string>", "Commit used as baseline for screenshot comparison").env("ARGOS_REFERENCE_COMMIT")).addOption(new Option("--threshold <number>", "Sensitivity threshold between 0 and 1. The higher the threshold, the less sensitive the diff will be. Default to 0.5").env("ARGOS_THRESHOLD")).addOption(new Option("--subset", "Whether this build contains only a subset of screenshots.\nThis is useful when a build is created from an incomplete test suite where some tests are skipped.").env("ARGOS_SUBSET")).action(async (directory, options) => {
20
+ program.command("upload").argument("<directory>", "Directory to upload").description("Upload screenshots to Argos").option("-f, --files <patterns...>", "One or more globs matching image file paths to upload", "**/*.{png,jpg,jpeg}").option("-i, --ignore <patterns...>", "One or more globs matching image file paths to ignore (ex: \"**/*.png **/diff.jpg\")").addOption(tokenOption).addOption(projectOption).addOption(buildNameOption).addOption(new Option("--mode <string>", "Mode of comparison applied. CI for visual regression testing, monitoring for visual monitoring.").default("ci").choices(["ci", "monitoring"]).env("ARGOS_MODE")).addOption(new Option("--parallel", "Enable parallel mode. Run multiple Argos builds and combine them at the end").env("ARGOS_PARALLEL")).addOption(new Option("--parallel-total <number>", "The number of parallel nodes being ran").env("ARGOS_PARALLEL_TOTAL")).addOption(parallelNonceOption).addOption(new Option("--parallel-index <number>", "The index of the parallel node being ran (must be at least 1)").env("ARGOS_PARALLEL_INDEX")).addOption(new Option("--reference-branch <string>", "Branch used as baseline for screenshot comparison").env("ARGOS_REFERENCE_BRANCH")).addOption(new Option("--reference-commit <string>", "Commit used as baseline for screenshot comparison").env("ARGOS_REFERENCE_COMMIT")).addOption(new Option("--threshold <number>", "Sensitivity threshold between 0 and 1. The higher the threshold, the less sensitive the diff will be. Default to 0.5").env("ARGOS_THRESHOLD")).addOption(new Option("--subset", "Whether this build contains only a subset of screenshots.\nThis is useful when a build is created from an incomplete test suite where some tests are skipped.").env("ARGOS_SUBSET")).action(async (directory, options) => {
20
21
  const spinner = ora("Uploading screenshots").start();
21
22
  try {
22
23
  const parallel = (() => {
@@ -37,6 +38,7 @@ function uploadCommand(program) {
37
38
  })();
38
39
  const result = await upload({
39
40
  token: options.token,
41
+ project: options.project,
40
42
  root: directory,
41
43
  buildName: options.buildName,
42
44
  files: options.files,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@argos-ci/cli",
3
3
  "description": "Command-line (CLI) for visual testing with Argos.",
4
- "version": "5.0.5",
4
+ "version": "5.1.0",
5
5
  "bin": {
6
6
  "argos": "./bin/argos-cli.js"
7
7
  },
@@ -35,7 +35,7 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@argos-ci/api-client": "0.22.0",
38
- "@argos-ci/core": "6.1.1",
38
+ "@argos-ci/core": "6.2.0",
39
39
  "commander": "^14.0.3",
40
40
  "open": "^11.0.0",
41
41
  "ora": "^9.4.0",
@@ -53,5 +53,5 @@
53
53
  "check-format": "prettier --check --ignore-unknown --ignore-path=../../.gitignore --ignore-path=../../.prettierignore .",
54
54
  "lint": "eslint ."
55
55
  },
56
- "gitHead": "ee8cfb3ab17cb541f8c3456a271d32c3411077c6"
56
+ "gitHead": "1787fe78cba46f408493e02114150f2d73f47fa4"
57
57
  }