Socket
Socket
Sign inDemoInstall

@percy/cli-build

Package Overview
Dependencies
Maintainers
6
Versions
238
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@percy/cli-build - npm Package Compare versions

Comparing version 1.12.0 to 1.13.0

10

dist/finalize.js

@@ -11,6 +11,8 @@ import command from '@percy/cli-command';

}) => {
if (!percy) exit(0, 'Percy is disabled'); // automatically set parallel total to -1
if (!percy) exit(0, 'Percy is disabled');
env.PERCY_PARALLEL_TOTAL || (env.PERCY_PARALLEL_TOTAL = '-1'); // ensure that this command is not used for other parallel totals
// automatically set parallel total to -1
env.PERCY_PARALLEL_TOTAL || (env.PERCY_PARALLEL_TOTAL = '-1');
// ensure that this command is not used for other parallel totals
if (env.PERCY_PARALLEL_TOTAL !== '-1') {

@@ -21,5 +23,5 @@ log.error('This command should only be used with PERCY_PARALLEL_TOTAL=-1');

}
log.info('Finalizing parallel build...');
log.info('Finalizing parallel build...'); // rely on the parallel nonce to cause the API to return the current running build for the nonce
// rely on the parallel nonce to cause the API to return the current running build for the nonce
let {

@@ -26,0 +28,0 @@ data: build

3

dist/id.js

@@ -14,3 +14,2 @@ import command from '@percy/cli-command';

var _build;
if (!percy) exit(0, 'Percy is disabled');

@@ -22,3 +21,2 @@ let {

let build = null;
try {

@@ -36,3 +34,2 @@ ({

}
if ((_build = build) !== null && _build !== void 0 && _build.id) {

@@ -39,0 +36,0 @@ log.stdout.write(build.id.toString());

@@ -46,21 +46,22 @@ import command from '@percy/cli-command';

}) {
if (!percy) exit(0, 'Percy is disabled'); // do not wait directly on the promise as to not block the event loop
if (!percy) exit(0, 'Percy is disabled');
// do not wait directly on the promise as to not block the event loop
let waiting = percy.client.waitForBuild(flags, build => {
logProgress(build, log);
if (isFailing(build, flags)) exit(1);
}); // wait between event loops to allow process termination
});
// wait between event loops to allow process termination
let handleDone = () => waiting.done = true;
waiting.then(handleDone, handleDone);
while (!waiting.done) {
yield new Promise(r => setImmediate(r));
} // bubble errors
}
// bubble errors
yield waiting;
}); // Log build progress
});
// Log build progress
function logProgress({

@@ -82,23 +83,18 @@ attributes: {

return log.progress('Waiting for build...');
case 'pending':
return log.progress('Recieving snapshots...');
case 'processing':
return log.progress(`Processing ${count} snapshots - ` + (finished === total ? 'finishing up...' : `${finished} of ${total} comparisons finished...`));
case 'finished':
log.info(`Build #${number} finished! ${url}`);
return log.info(`Found ${diffs} changes`);
case 'failed':
log.error(`Build #${number} failed! ${url}`);
return log.error(failureMessage(failReason, failDetails));
default:
return log.error(`Build #${number} is ${state}. ${url}`);
}
} // Create failure messages
}
// Create failure messages
function failureMessage(type, {

@@ -112,18 +108,14 @@ missing_parallel_builds: missingParallel,

return 'Some snapshots in this build took too long ' + 'to render even after multiple retries.';
case 'no_snapshots':
return 'No snapshots were uploaded to this build.';
case 'missing_finalize':
return 'Failed to correctly finalize.';
case 'missing_resources':
return missingParallel ? `Only ${parallelCount} of ${parallelTotal} parallel builds were received.` : 'Some build or snapshot resources failed to correctly upload.';
default:
return `Error: ${type}`;
}
} // Return true or false if a build is considered failing or not
}
// Return true or false if a build is considered failing or not
function isFailing({

@@ -138,6 +130,6 @@ attributes: {

// not pending and not processing
return state != null && state !== 'pending' && state !== 'processing' && ( // not finished or finished with diffs
return state != null && state !== 'pending' && state !== 'processing' && (
// not finished or finished with diffs
state !== 'finished' || failOnChanges && !!diffs);
}
export default wait;
{
"name": "@percy/cli-build",
"version": "1.12.0",
"version": "1.13.0",
"license": "MIT",

@@ -35,5 +35,5 @@ "repository": {

"dependencies": {
"@percy/cli-command": "1.12.0"
"@percy/cli-command": "1.13.0"
},
"gitHead": "4303b74df91f60e36065141289d2ef2277d1d6fc"
"gitHead": "d2e812d14aa446fa580ffa75144a6280627b5a27"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc