@percy/cli-snapshot
Advanced tools
Comparing version 1.12.0 to 1.13.0
@@ -65,16 +65,16 @@ import fs from 'fs'; | ||
sitemap | ||
} = args; // parse and validate the --base-url flag after args are parsed | ||
} = args; | ||
if (file || serve) baseUrl && (baseUrl = parseBaseUrl(baseUrl, !!serve)); // only continue if percy is not disabled | ||
// parse and validate the --base-url flag after args are parsed | ||
if (file || serve) baseUrl && (baseUrl = parseBaseUrl(baseUrl, !!serve)); | ||
// only continue if percy is not disabled | ||
if (!percy) exit(0, 'Percy is disabled'); | ||
try { | ||
let options; | ||
/* istanbul ignore else: arg is required and always one of these */ | ||
if (file) { | ||
// load snapshots file | ||
let snapshots = yield loadSnapshotFile(file); // remove any references and accept an array of snapshots instead of an config object | ||
let snapshots = yield loadSnapshotFile(file); | ||
// remove any references and accept an array of snapshots instead of an config object | ||
let { | ||
@@ -110,3 +110,2 @@ references, | ||
} | ||
yield* percy.yield.start(); | ||
@@ -119,5 +118,6 @@ yield* percy.yield.snapshot(options); | ||
} | ||
}); // Validates the provided `--base-url` flag and returns a `baseUrl` string if valid. The flag is | ||
}); | ||
// Validates the provided `--base-url` flag and returns a `baseUrl` string if valid. The flag is | ||
// validated and parsed differently for static directories and snapshot files. | ||
function parseBaseUrl(baseUrl, pathOnly) { | ||
@@ -131,17 +131,15 @@ try { | ||
} | ||
} // Small shallow merge util that does not merge null or undefined values. | ||
} | ||
// Small shallow merge util that does not merge null or undefined values. | ||
function merge(...objs) { | ||
return objs.reduce((target, obj) => { | ||
for (let k in obj) target[k] = obj[k] ?? target[k]; | ||
return target; | ||
}, {}); | ||
} // Loads snapshot options from a js, json, or yaml file. | ||
} | ||
// Loads snapshot options from a js, json, or yaml file. | ||
async function loadSnapshotFile(file) { | ||
let ext = path.extname(file); | ||
if (/\.(c|m)?js$/.test(ext)) { | ||
@@ -163,3 +161,2 @@ let { | ||
} | ||
export default snapshot; |
{ | ||
"name": "@percy/cli-snapshot", | ||
"version": "1.12.0", | ||
"version": "1.13.0", | ||
"license": "MIT", | ||
@@ -35,6 +35,6 @@ "repository": { | ||
"dependencies": { | ||
"@percy/cli-command": "1.12.0", | ||
"@percy/cli-command": "1.13.0", | ||
"yaml": "^2.0.0" | ||
}, | ||
"gitHead": "4303b74df91f60e36065141289d2ef2277d1d6fc" | ||
"gitHead": "d2e812d14aa446fa580ffa75144a6280627b5a27" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16763
192
+ Added@percy/cli-command@1.13.0(transitive)
+ Added@percy/client@1.13.0(transitive)
+ Added@percy/config@1.13.0(transitive)
+ Added@percy/core@1.13.0(transitive)
+ Added@percy/dom@1.13.0(transitive)
+ Added@percy/env@1.13.0(transitive)
+ Added@percy/logger@1.13.0(transitive)
- Removed@percy/cli-command@1.12.0(transitive)
- Removed@percy/client@1.12.0(transitive)
- Removed@percy/config@1.12.0(transitive)
- Removed@percy/core@1.12.0(transitive)
- Removed@percy/dom@1.12.0(transitive)
- Removed@percy/env@1.12.0(transitive)
- Removed@percy/logger@1.12.0(transitive)
Updated@percy/cli-command@1.13.0