@argos-ci/cli 0.3.3-alpha.1 → 0.3.3-alpha.2

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 +28 -7
  2. package/package.json +3 -3
package/dist/index.mjs CHANGED
@@ -130,6 +130,25 @@ const createConfig = ()=>{
130
130
  return result;
131
131
  };
132
132
 
133
+ const service$4 = {
134
+ detect: ({ env })=>Boolean(env.BUILDKITE),
135
+ config: ({ env })=>{
136
+ const ciProps = envCiDetection({
137
+ env
138
+ });
139
+ return {
140
+ name: "Buildkite",
141
+ commit: ciProps?.commit || null,
142
+ branch: env.BUILDKITE_BRANCH || null,
143
+ owner: env.BUILDKITE_ORGANIZATION_SLUG || null,
144
+ repository: env.BUILDKITE_PROJECT_SLUG || null,
145
+ jobId: env.BUILDKITE_JOB_ID || null,
146
+ runId: ciProps?.runId || null,
147
+ prNumber: env.BUILDKITE_PULL_REQUEST ? Number(env.BUILDKITE_PULL_REQUEST) : null
148
+ };
149
+ }
150
+ };
151
+
133
152
  const service$3 = {
134
153
  detect: ({ env })=>Boolean(env.HEROKU_TEST_RUN_ID),
135
154
  config: ({ env })=>({
@@ -196,7 +215,7 @@ const getPrNumber$1 = ({ env })=>{
196
215
  const branchRegex = /refs\/pull\/(\d+)/;
197
216
  const branchMatches = branchRegex.exec(env.GITHUB_REF || "");
198
217
  if (branchMatches) {
199
- branchMatches[1];
218
+ return Number(branchMatches[1]);
200
219
  }
201
220
  return null;
202
221
  };
@@ -226,7 +245,7 @@ const getPrNumber = ({ env })=>{
226
245
  const branchRegex = /pull\/(\d+)/;
227
246
  const branchMatches = branchRegex.exec(env.CIRCLE_PULL_REQUEST || "");
228
247
  if (branchMatches) {
229
- branchMatches[1];
248
+ return Number(branchMatches[1]);
230
249
  }
231
250
  return null;
232
251
  };
@@ -265,7 +284,7 @@ const service = {
265
284
  repository: ciProps?.repository || null,
266
285
  jobId: ciProps?.jobId || null,
267
286
  runId: ciProps?.runId || null,
268
- prNumber: env.TRAVIS_PULL_REQUEST || null
287
+ prNumber: env.TRAVIS_PULL_REQUEST ? Number(env.TRAVIS_PULL_REQUEST) : null
269
288
  };
270
289
  }
271
290
  };
@@ -274,7 +293,8 @@ const services = [
274
293
  service$3,
275
294
  service$2,
276
295
  service$1,
277
- service
296
+ service,
297
+ service$4
278
298
  ];
279
299
  const envCiDetection = (ctx)=>{
280
300
  const ciContext = envCi(ctx);
@@ -486,7 +506,8 @@ const getConfigFromOptions = (options)=>{
486
506
  name: config.buildName,
487
507
  parallel: config.parallel,
488
508
  parallelNonce: config.parallelNonce,
489
- screenshotKeys: Array.from(new Set(screenshots.map((screenshot)=>screenshot.hash)))
509
+ screenshotKeys: Array.from(new Set(screenshots.map((screenshot)=>screenshot.hash))),
510
+ prNumber: config.prNumber
490
511
  });
491
512
  debug("Got screenshots", result);
492
513
  // Upload screenshots
@@ -522,7 +543,7 @@ const __dirname = fileURLToPath(new URL(".", import.meta.url));
522
543
  const rawPkg = await readFile(resolve(__dirname, "..", "package.json"), "utf8");
523
544
  const pkg = JSON.parse(rawPkg);
524
545
  program.name(pkg.name).description("Interact with and upload screenshots to argos-ci.com via command line.").version(pkg.version);
525
- program.command("upload").argument("<directory>", "Directory to upload").description("Upload screenshots to argos-ci.com").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")').option("--token <token>", "Repository token").option("--prNumber <number>", "Pull-request number").option("--build-name <string>", "Name of the build, in case you want to run multiple Argos builds in a single CI job").option("--parallel", "Enable parallel mode. Run multiple Argos builds and combine them at the end").option("--parallel-total <number>", "The number of parallel nodes being ran").option("--parallel-nonce <string>", "A unique ID for this parallel build").action(async (directory, options)=>{
546
+ program.command("upload").argument("<directory>", "Directory to upload").description("Upload screenshots to argos-ci.com").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")').option("--token <token>", "Repository token").option("--pull-request <number>", "Pull-request number").option("--build-name <string>", "Name of the build, in case you want to run multiple Argos builds in a single CI job").option("--parallel", "Enable parallel mode. Run multiple Argos builds and combine them at the end").option("--parallel-total <number>", "The number of parallel nodes being ran").option("--parallel-nonce <string>", "A unique ID for this parallel build").action(async (directory, options)=>{
526
547
  const spinner = ora("Uploading screenshots").start();
527
548
  try {
528
549
  const result = await upload({
@@ -530,7 +551,7 @@ program.command("upload").argument("<directory>", "Directory to upload").descrip
530
551
  buildName: options.buildName,
531
552
  files: options.files,
532
553
  ignore: options.ignore,
533
- prNumber: options.prNumber,
554
+ prNumber: options.pullRequest,
534
555
  parallel: options.parallel ? {
535
556
  nonce: options.parallelNonce,
536
557
  total: options.parallelTotal
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@argos-ci/cli",
3
3
  "description": "Visual testing solution to avoid visual regression. Argos CLI is used to interact with and upload screenshots to argos-ci.com via command line.",
4
- "version": "0.3.3-alpha.1+46d7443",
4
+ "version": "0.3.3-alpha.2+760abb1",
5
5
  "bin": {
6
6
  "argos": "./bin/argos-cli.js"
7
7
  },
@@ -40,7 +40,7 @@
40
40
  "access": "public"
41
41
  },
42
42
  "dependencies": {
43
- "@argos-ci/core": "^0.6.3-alpha.1+46d7443",
43
+ "@argos-ci/core": "^0.6.3-alpha.2+760abb1",
44
44
  "commander": "^9.4.1",
45
45
  "ora": "^6.1.2",
46
46
  "update-notifier": "^6.0.2"
@@ -49,5 +49,5 @@
49
49
  "rollup": "^2.79.1",
50
50
  "rollup-plugin-swc3": "^0.6.0"
51
51
  },
52
- "gitHead": "46d7443fe360fe5d42482e404bd3ab5c05116567"
52
+ "gitHead": "760abb140949348929f833a68929744de146e127"
53
53
  }