@percy/agent
Advanced tools
Comparing version 0.1.8 to 0.1.9
@@ -1,1 +0,1 @@ | ||
{"version":"0.1.8","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":{"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","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":[]},"percy-command":{"id":"percy-command","pluginName":"@percy/agent","pluginType":"core","hidden":true,"aliases":[],"flags":{},"args":[]},"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},"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":[]}}} | ||
{"version":"0.1.9","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":{"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","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":[]},"percy-command":{"id":"percy-command","pluginName":"@percy/agent","pluginType":"core","hidden":true,"aliases":[],"flags":{},"args":[]},"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},"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":[]}}} |
@@ -16,2 +16,3 @@ import * as puppeteer from 'puppeteer'; | ||
discoverResources(rootResourceUrl: string, domSnapshot: string, enableJavaScript?: boolean): Promise<any[]>; | ||
shouldRequestResolve(request: puppeteer.Request): boolean; | ||
teardown(): Promise<void>; | ||
@@ -18,0 +19,0 @@ private closeBrowser; |
@@ -40,2 +40,6 @@ "use strict"; | ||
this.page.on('request', async (request) => { | ||
if (!this.shouldRequestResolve(request)) { | ||
await request.abort(); | ||
return; | ||
} | ||
if (request.url() === rootResourceUrl) { | ||
@@ -48,5 +52,3 @@ await request.respond({ | ||
} | ||
else { | ||
await request.continue(); | ||
} | ||
await request.continue(); | ||
}); | ||
@@ -83,2 +85,16 @@ this.page.on('response', async (response) => { | ||
} | ||
shouldRequestResolve(request) { | ||
const requestPurpose = request.headers().purpose; | ||
switch (requestPurpose) { | ||
case 'prefetch': | ||
case 'preload': | ||
case 'dns-prefetch': | ||
case 'prerender': | ||
case 'preconnect': | ||
case 'subresource': | ||
return false; | ||
default: | ||
return true; | ||
} | ||
} | ||
async teardown() { | ||
@@ -85,0 +101,0 @@ await this.closePage(); |
{ | ||
"name": "@percy/agent", | ||
"description": "An agent process for integrating with Percy.", | ||
"version": "0.1.8", | ||
"version": "0.1.9", | ||
"author": "Perceptual Inc", | ||
@@ -9,2 +9,12 @@ "bin": { | ||
}, | ||
"watch": { | ||
"build": { | ||
"patterns": [ | ||
"src/percy-agent-client" | ||
], | ||
"extensions": "ts", | ||
"legacyWatch": true, | ||
"delay": 1000 | ||
} | ||
}, | ||
"bugs": "https://github.com/percy/percy-agent/issues", | ||
@@ -53,2 +63,3 @@ "dependencies": { | ||
"nock": "^9.6.1", | ||
"npm-watch": "^0.5.0", | ||
"prettier": "1.14.2", | ||
@@ -108,5 +119,6 @@ "pryjs": "^1.0.3", | ||
"test-client": "mkdir -p dist-test/ && npm run build-client-test && testem ci --file ./test/percy-agent-client/testem.js", | ||
"version": "oclif-dev readme && git add README.md" | ||
"version": "oclif-dev readme && git add README.md", | ||
"watch": "npm-watch" | ||
}, | ||
"types": "dist/index.d.ts" | ||
} |
@@ -24,3 +24,3 @@ @percy/agent | ||
$ percy (-v|--version|version) | ||
@percy/agent/0.1.8 darwin-x64 node-v8.10.0 | ||
@percy/agent/0.1.9 darwin-x64 node-v8.10.0 | ||
$ percy --help [COMMAND] | ||
@@ -55,3 +55,3 @@ USAGE | ||
_See code: [dist/commands/exec.ts](https://github.com/percy/percy-agent/blob/v0.1.8/dist/commands/exec.ts)_ | ||
_See code: [dist/commands/exec.ts](https://github.com/percy/percy-agent/blob/v0.1.9/dist/commands/exec.ts)_ | ||
@@ -74,3 +74,3 @@ ## `percy finalize` | ||
_See code: [dist/commands/finalize.ts](https://github.com/percy/percy-agent/blob/v0.1.8/dist/commands/finalize.ts)_ | ||
_See code: [dist/commands/finalize.ts](https://github.com/percy/percy-agent/blob/v0.1.9/dist/commands/finalize.ts)_ | ||
@@ -77,0 +77,0 @@ ## `percy help [COMMAND]` |
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
60708
1325
31