@percy/client 1.28.9 → 1.29.1-alpha.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/client.js +9 -6
  2. package/package.json +5 -5
package/dist/client.js CHANGED
@@ -315,7 +315,7 @@ export class PercyClient {
315
315
  // Uploads a single resource to the active build. If `filepath` is provided,
316
316
  // `content` is read from the filesystem. The sha is optional and will be
317
317
  // created from `content` if one is not provided.
318
- async uploadResource(buildId, {
318
+ async uploadResource(buildId, snapshotId, {
319
319
  url,
320
320
  sha,
321
321
  filepath,
@@ -329,7 +329,7 @@ export class PercyClient {
329
329
  }
330
330
  }
331
331
  let encodedContent = base64encode(content);
332
- this.log.debug(`Uploading ${formatBytes(encodedContent.length)} resource: ${url}...`);
332
+ this.log.debug(`Uploading ${formatBytes(encodedContent.length)} resource for snapshotId ${snapshotId}: ${url}...`);
333
333
  this.mayBeLogUploadSize(encodedContent.length);
334
334
  return this.post(`builds/${buildId}/resources`, {
335
335
  data: {
@@ -343,12 +343,12 @@ export class PercyClient {
343
343
  }
344
344
 
345
345
  // Uploads resources to the active build concurrently, two at a time.
346
- async uploadResources(buildId, resources) {
346
+ async uploadResources(buildId, snapshotId, resources) {
347
347
  validateId('build', buildId);
348
- this.log.debug(`Uploading resources for ${buildId}...`);
348
+ this.log.debug(`Uploading resources for BuildId: ${buildId} and SnapshotId: ${snapshotId}...`);
349
349
  return pool(function* () {
350
350
  for (let resource of resources) {
351
- yield this.uploadResource(buildId, resource);
351
+ yield this.uploadResource(buildId, snapshotId, resource);
352
352
  }
353
353
  }, this, 2);
354
354
  }
@@ -428,12 +428,15 @@ export class PercyClient {
428
428
  async sendSnapshot(buildId, options) {
429
429
  var _snapshot$data$relati, _snapshot$data$relati2;
430
430
  let snapshot = await this.createSnapshot(buildId, options);
431
+ let snapshotId = snapshot.data.id;
432
+ this.log.debug(`Created snapshot with Id: ${snapshotId}...`);
431
433
  let missing = (_snapshot$data$relati = snapshot.data.relationships) === null || _snapshot$data$relati === void 0 ? void 0 : (_snapshot$data$relati2 = _snapshot$data$relati['missing-resources']) === null || _snapshot$data$relati2 === void 0 ? void 0 : _snapshot$data$relati2.data;
434
+ this.log.debug(`Found ${missing === null || missing === void 0 ? void 0 : missing.length} missing resources for snapshotId: ${snapshotId}...`);
432
435
  if (missing !== null && missing !== void 0 && missing.length) {
433
436
  let resources = options.resources.reduce((acc, r) => Object.assign(acc, {
434
437
  [r.sha]: r
435
438
  }), {});
436
- await this.uploadResources(buildId, missing.map(({
439
+ await this.uploadResources(buildId, snapshotId, missing.map(({
437
440
  id
438
441
  }) => resources[id]));
439
442
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@percy/client",
3
- "version": "1.28.9",
3
+ "version": "1.29.1-alpha.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -9,7 +9,7 @@
9
9
  },
10
10
  "publishConfig": {
11
11
  "access": "public",
12
- "tag": "latest"
12
+ "tag": "alpha"
13
13
  },
14
14
  "engines": {
15
15
  "node": ">=14"
@@ -32,9 +32,9 @@
32
32
  "test:coverage": "yarn test --coverage"
33
33
  },
34
34
  "dependencies": {
35
- "@percy/env": "1.28.9",
36
- "@percy/logger": "1.28.9",
35
+ "@percy/env": "1.29.1-alpha.0",
36
+ "@percy/logger": "1.29.1-alpha.0",
37
37
  "pako": "^2.1.0"
38
38
  },
39
- "gitHead": "03253ef16a5125469773797b4ff126649371d133"
39
+ "gitHead": "5044adb5caa7507fdec629eda8f33d6ddde07997"
40
40
  }