@percy/agent
Advanced tools
Comparing version 0.16.0 to 0.16.1
@@ -1,1 +0,1 @@ | ||
{"version":"0.16.0","commands":{"exec":{"id":"exec","description":"Start and stop Percy around a supplied command.","pluginName":"@percy/agent","pluginType":"core","hidden":false,"aliases":[],"examples":["$ percy exec -- echo \"percy is running around this echo command\"","$ percy exec -- bash -c \"echo foo && echo bar\""],"flags":{"allowed-hostname":{"name":"allowed-hostname","type":"option","char":"h","description":"Allowable hostname(s) to capture assets from"},"network-idle-timeout":{"name":"network-idle-timeout","type":"option","char":"t","description":"asset discovery network idle timeout (in milliseconds)","default":50},"port":{"name":"port","type":"option","char":"p","description":"port","default":5338}},"args":[]},"finalize":{"id":"finalize","description":"Finalize a build. Commonly used for parallelized builds, especially when the number of parallelized processes is unknown.","pluginName":"@percy/agent","pluginType":"core","hidden":false,"aliases":[],"examples":["$ percy finalize --all\n[percy] Finalized parallel build."],"flags":{"all":{"name":"all","type":"boolean","char":"a","required":true,"allowNo":false}},"args":[]},"health-check":{"id":"health-check","description":"Determines if the Percy Agent process is currently running","pluginName":"@percy/agent","pluginType":"core","hidden":true,"aliases":[],"examples":["$ percy healthcheck","$ percy healthcheck --port 6884"],"flags":{"port":{"name":"port","type":"option","char":"p","description":"port","default":5338}},"args":[]},"percy-command":{"id":"percy-command","pluginName":"@percy/agent","pluginType":"core","hidden":true,"aliases":[],"flags":{},"args":[]},"snapshot":{"id":"snapshot","description":"Snapshot a directory containing a pre-built static website.","pluginName":"@percy/agent","pluginType":"core","hidden":false,"aliases":[],"examples":["$ percy snapshot _site/","$ percy snapshot _site/ --base-url \"/blog/\"","$ percy snapshot _site/ --ignore-files \"/blog/drafts/**\""],"flags":{"snapshot-files":{"name":"snapshot-files","type":"option","char":"s","description":"Glob or comma-seperated string of globs for matching the files and directories to snapshot.","default":"**/*.html,**/*.htm"},"ignore-files":{"name":"ignore-files","type":"option","char":"i","description":"Glob or comma-seperated string of globs for matching the files and directories to ignore.","default":""},"base-url":{"name":"base-url","type":"option","char":"b","description":"If your static files will be hosted in a subdirectory, instead \nof the webserver's root path, set that subdirectory with this flag.","default":"/"},"allowed-hostname":{"name":"allowed-hostname","type":"option","char":"h","description":"Allowable hostname(s) to capture assets from"},"network-idle-timeout":{"name":"network-idle-timeout","type":"option","char":"t","description":"Asset discovery network idle timeout (in milliseconds)","default":50},"port":{"name":"port","type":"option","char":"p","description":"Port","default":5338}},"args":[{"name":"snapshotDirectory","description":"A path to the directory you would like to snapshot","required":true}]},"start":{"id":"start","description":"Starts the percy process.","pluginName":"@percy/agent","pluginType":"core","hidden":true,"aliases":[],"examples":["$ percy start\ninfo: percy has started on port 5338."],"flags":{"detached":{"name":"detached","type":"boolean","char":"d","description":"start as a detached process","allowNo":false},"allowed-hostname":{"name":"allowed-hostname","type":"option","char":"h","description":"Allowable hostname(s) to capture assets from"},"network-idle-timeout":{"name":"network-idle-timeout","type":"option","char":"t","description":"asset discovery network idle timeout (in milliseconds)","default":50},"port":{"name":"port","type":"option","char":"p","description":"port","default":5338}},"args":[]},"stop":{"id":"stop","description":"Stops the percy process.","pluginName":"@percy/agent","pluginType":"core","hidden":true,"aliases":[],"examples":["$ percy stop\ninfo: percy has stopped."],"flags":{"port":{"name":"port","type":"option","char":"p","description":"port","default":5338}},"args":[]},"upload":{"id":"upload","description":"Upload a directory containing static snapshot images.","pluginName":"@percy/agent","pluginType":"core","hidden":false,"aliases":[],"examples":["$ percy upload _images/","$ percy upload _images/ --files **/*.png"],"flags":{"files":{"name":"files","type":"option","char":"f","description":"Glob or comma-seperated string of globs for matching the files and directories to snapshot.","default":"**/*.png,**/*.jpg,**/*.jpeg"},"ignore":{"name":"ignore","type":"option","char":"i","description":"Glob or comma-seperated string of globs for matching the files and directories to ignore.","default":""}},"args":[{"name":"uploadDirectory","description":"A path to the directory containing static snapshot images","required":true}]}}} | ||
{"version":"0.16.1","commands":{"exec":{"id":"exec","description":"Start and stop Percy around a supplied command.","pluginName":"@percy/agent","pluginType":"core","hidden":false,"aliases":[],"examples":["$ percy exec -- echo \"percy is running around this echo command\"","$ percy exec -- bash -c \"echo foo && echo bar\""],"flags":{"allowed-hostname":{"name":"allowed-hostname","type":"option","char":"h","description":"Allowable hostname(s) to capture assets from"},"network-idle-timeout":{"name":"network-idle-timeout","type":"option","char":"t","description":"asset discovery network idle timeout (in milliseconds)","default":50},"port":{"name":"port","type":"option","char":"p","description":"port","default":5338}},"args":[]},"finalize":{"id":"finalize","description":"Finalize a build. Commonly used for parallelized builds, especially when the number of parallelized processes is unknown.","pluginName":"@percy/agent","pluginType":"core","hidden":false,"aliases":[],"examples":["$ percy finalize --all\n[percy] Finalized parallel build."],"flags":{"all":{"name":"all","type":"boolean","char":"a","required":true,"allowNo":false}},"args":[]},"health-check":{"id":"health-check","description":"Determines if the Percy Agent process is currently running","pluginName":"@percy/agent","pluginType":"core","hidden":true,"aliases":[],"examples":["$ percy healthcheck","$ percy healthcheck --port 6884"],"flags":{"port":{"name":"port","type":"option","char":"p","description":"port","default":5338}},"args":[]},"percy-command":{"id":"percy-command","pluginName":"@percy/agent","pluginType":"core","hidden":true,"aliases":[],"flags":{},"args":[]},"snapshot":{"id":"snapshot","description":"Snapshot a directory containing a pre-built static website.","pluginName":"@percy/agent","pluginType":"core","hidden":false,"aliases":[],"examples":["$ percy snapshot _site/","$ percy snapshot _site/ --base-url \"/blog/\"","$ percy snapshot _site/ --ignore-files \"/blog/drafts/**\""],"flags":{"snapshot-files":{"name":"snapshot-files","type":"option","char":"s","description":"Glob or comma-seperated string of globs for matching the files and directories to snapshot.","default":"**/*.html,**/*.htm"},"ignore-files":{"name":"ignore-files","type":"option","char":"i","description":"Glob or comma-seperated string of globs for matching the files and directories to ignore.","default":""},"base-url":{"name":"base-url","type":"option","char":"b","description":"If your static files will be hosted in a subdirectory, instead \nof the webserver's root path, set that subdirectory with this flag.","default":"/"},"allowed-hostname":{"name":"allowed-hostname","type":"option","char":"h","description":"Allowable hostname(s) to capture assets from"},"network-idle-timeout":{"name":"network-idle-timeout","type":"option","char":"t","description":"Asset discovery network idle timeout (in milliseconds)","default":50},"port":{"name":"port","type":"option","char":"p","description":"Port","default":5338}},"args":[{"name":"snapshotDirectory","description":"A path to the directory you would like to snapshot","required":true}]},"start":{"id":"start","description":"Starts the percy process.","pluginName":"@percy/agent","pluginType":"core","hidden":true,"aliases":[],"examples":["$ percy start\ninfo: percy has started on port 5338."],"flags":{"detached":{"name":"detached","type":"boolean","char":"d","description":"start as a detached process","allowNo":false},"allowed-hostname":{"name":"allowed-hostname","type":"option","char":"h","description":"Allowable hostname(s) to capture assets from"},"network-idle-timeout":{"name":"network-idle-timeout","type":"option","char":"t","description":"asset discovery network idle timeout (in milliseconds)","default":50},"port":{"name":"port","type":"option","char":"p","description":"port","default":5338}},"args":[]},"stop":{"id":"stop","description":"Stops the percy process.","pluginName":"@percy/agent","pluginType":"core","hidden":true,"aliases":[],"examples":["$ percy stop\ninfo: percy has stopped."],"flags":{"port":{"name":"port","type":"option","char":"p","description":"port","default":5338}},"args":[]},"upload":{"id":"upload","description":"Upload a directory containing static snapshot images.","pluginName":"@percy/agent","pluginType":"core","hidden":false,"aliases":[],"examples":["$ percy upload _images/","$ percy upload _images/ --files **/*.png"],"flags":{"files":{"name":"files","type":"option","char":"f","description":"Glob or comma-seperated string of globs for matching the files and directories to snapshot.","default":"**/*.png,**/*.jpg,**/*.jpeg"},"ignore":{"name":"ignore","type":"option","char":"i","description":"Glob or comma-seperated string of globs for matching the files and directories to ignore.","default":""}},"args":[{"name":"uploadDirectory","description":"A path to the directory containing static snapshot images","required":true}]}}} |
@@ -0,1 +1,8 @@ | ||
## [0.16.1](https://github.com/percy/percy-agent/compare/v0.16.0...v0.16.1) (2019-09-25) | ||
### Bug Fixes | ||
* Handle 404 errors when capturing redirected assets ([#354](https://github.com/percy/percy-agent/issues/354)) ([aefcd17](https://github.com/percy/percy-agent/commit/aefcd17)) | ||
# [0.16.0](https://github.com/percy/percy-agent/compare/v0.15.2...v0.16.0) (2019-09-25) | ||
@@ -2,0 +9,0 @@ |
@@ -84,20 +84,27 @@ "use strict"; | ||
logger.debug(`Making local copy of redirected response: ${originalURL}`); | ||
const { data, headers } = await axios_1.default(originalURL, { responseType: 'arraybuffer' }); | ||
const buffer = Buffer.from(data); | ||
const sha = crypto.createHash('sha256').update(buffer).digest('hex'); | ||
const localCopy = path.join(os.tmpdir(), sha); | ||
const didWriteFile = this.maybeWriteFile(localCopy, buffer); | ||
const { fileIsTooLarge, responseBodySize } = this.checkFileSize(localCopy); | ||
if (!didWriteFile) { | ||
logger.debug(`Skipping file copy [already_copied]: ${originalURL}`); | ||
try { | ||
const { data, headers } = await axios_1.default(originalURL, { responseType: 'arraybuffer' }); | ||
const buffer = Buffer.from(data); | ||
const sha = crypto.createHash('sha256').update(buffer).digest('hex'); | ||
const localCopy = path.join(os.tmpdir(), sha); | ||
const didWriteFile = this.maybeWriteFile(localCopy, buffer); | ||
const { fileIsTooLarge, responseBodySize } = this.checkFileSize(localCopy); | ||
if (!didWriteFile) { | ||
logger.debug(`Skipping file copy [already_copied]: ${originalURL}`); | ||
} | ||
if (fileIsTooLarge) { | ||
logger.debug(`Skipping [max_file_size_exceeded_${responseBodySize}] [${width} px]: ${originalURL}`); | ||
return; | ||
} | ||
const contentType = headers['content-type']; | ||
const resource = this.resourceService.createResourceFromFile(originalURL, localCopy, contentType, logger); | ||
this.responsesProcessed.set(originalURL, resource); | ||
this.responsesProcessed.set(redirectedURL, resource); | ||
return resource; | ||
} | ||
if (fileIsTooLarge) { | ||
logger.debug(`Skipping [max_file_size_exceeded_${responseBodySize}] [${width} px]: ${originalURL}`); | ||
catch (err) { | ||
logger.debug(`${err}`); | ||
logger.debug(`Failed to make a local copy of redirected response: ${originalURL}`); | ||
return; | ||
} | ||
const contentType = headers['content-type']; | ||
const resource = this.resourceService.createResourceFromFile(originalURL, localCopy, contentType, logger); | ||
this.responsesProcessed.set(originalURL, resource); | ||
this.responsesProcessed.set(redirectedURL, resource); | ||
return resource; | ||
} | ||
@@ -104,0 +111,0 @@ /** |
{ | ||
"name": "@percy/agent", | ||
"description": "An agent process for integrating with Percy.", | ||
"version": "0.16.0", | ||
"version": "0.16.1", | ||
"author": "Perceptual Inc", | ||
@@ -6,0 +6,0 @@ "bin": { |
@@ -24,3 +24,3 @@ @percy/agent | ||
$ percy (-v|--version|version) | ||
@percy/agent/0.16.0 linux-x64 node-v10.16.3 | ||
@percy/agent/0.16.1 linux-x64 node-v10.16.3 | ||
$ percy --help [COMMAND] | ||
@@ -58,3 +58,3 @@ USAGE | ||
_See code: [dist/commands/exec.ts](https://github.com/percy/percy-agent/blob/v0.16.0/dist/commands/exec.ts)_ | ||
_See code: [dist/commands/exec.ts](https://github.com/percy/percy-agent/blob/v0.16.1/dist/commands/exec.ts)_ | ||
@@ -77,3 +77,3 @@ ## `percy finalize` | ||
_See code: [dist/commands/finalize.ts](https://github.com/percy/percy-agent/blob/v0.16.0/dist/commands/finalize.ts)_ | ||
_See code: [dist/commands/finalize.ts](https://github.com/percy/percy-agent/blob/v0.16.1/dist/commands/finalize.ts)_ | ||
@@ -131,3 +131,3 @@ ## `percy help [COMMAND]` | ||
_See code: [dist/commands/snapshot.ts](https://github.com/percy/percy-agent/blob/v0.16.0/dist/commands/snapshot.ts)_ | ||
_See code: [dist/commands/snapshot.ts](https://github.com/percy/percy-agent/blob/v0.16.1/dist/commands/snapshot.ts)_ | ||
@@ -156,3 +156,3 @@ ## `percy upload UPLOADDIRECTORY` | ||
_See code: [dist/commands/upload.ts](https://github.com/percy/percy-agent/blob/v0.16.0/dist/commands/upload.ts)_ | ||
_See code: [dist/commands/upload.ts](https://github.com/percy/percy-agent/blob/v0.16.1/dist/commands/upload.ts)_ | ||
<!-- commandsstop --> |
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
135849
2435