Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@percy/agent

Package Overview
Dependencies
Maintainers
6
Versions
179
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@percy/agent - npm Package Compare versions

Comparing version 0.1.7 to 0.1.8

2

.oclif.manifest.json

@@ -1,1 +0,1 @@

{"version":"0.1.7","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.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":[]}}}
export interface ClientOptions {
clientInfo?: string;
environmentInfo?: string;
handleAgentCommunication?: boolean;
xhr?: any;

@@ -5,0 +6,0 @@ domTransformation?: any;

@@ -8,8 +8,9 @@ import { ClientOptions } from './client-options';

xhr: any;
handleAgentCommunication: boolean;
port: number;
domTransformation: any | null;
client: PercyAgentClient;
client: PercyAgentClient | null;
readonly defaultDoctype: string;
constructor(options?: ClientOptions);
snapshot(name: string, options?: SnapshotOptions): void;
snapshot(name: string, options?: SnapshotOptions): string;
private domSnapshot;

@@ -16,0 +17,0 @@ private getDoctype;

@@ -6,9 +6,14 @@ "use strict";

constructor(options = {}) {
this.client = null;
this.defaultDoctype = '<!DOCTYPE html>';
this.clientInfo = options.clientInfo || null;
this.environmentInfo = options.environmentInfo || null;
this.xhr = options.xhr || XMLHttpRequest;
// Default to 'true' unless explicitly disabled.
this.handleAgentCommunication = options.handleAgentCommunication !== false;
this.domTransformation = options.domTransformation || null;
this.port = options.port || 5338;
this.client = new percy_agent_client_1.PercyAgentClient(`http://localhost:${this.port}`, this.xhr);
if (this.handleAgentCommunication) {
this.xhr = options.xhr || XMLHttpRequest;
this.client = new percy_agent_client_1.PercyAgentClient(`http://localhost:${this.port}`, this.xhr);
}
}

@@ -18,14 +23,17 @@ snapshot(name, options = {}) {

const domSnapshot = this.domSnapshot(documentObject);
this.client.post('/percy/snapshot', {
name,
url: documentObject.URL,
// enableJavascript is deprecated. Use enableJavaScript
enableJavaScript: options.enableJavaScript || options.enableJavascript,
widths: options.widths,
// minimumHeight is deprecated. Use minHeight
minHeight: options.minHeight || options.minimumHeight,
clientInfo: this.clientInfo,
environmentInfo: this.environmentInfo,
domSnapshot,
});
if (this.handleAgentCommunication && this.client) {
this.client.post('/percy/snapshot', {
name,
url: documentObject.URL,
// enableJavascript is deprecated. Use enableJavaScript
enableJavaScript: options.enableJavaScript || options.enableJavascript,
widths: options.widths,
// minimumHeight is deprecated. Use minHeight
minHeight: options.minHeight || options.minimumHeight,
clientInfo: this.clientInfo,
environmentInfo: this.environmentInfo,
domSnapshot,
});
}
return domSnapshot;
}

@@ -32,0 +40,0 @@ domSnapshot(documentObject) {

@@ -50,9 +50,14 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.PercyAgent = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){

constructor(options = {}) {
this.client = null;
this.defaultDoctype = '<!DOCTYPE html>';
this.clientInfo = options.clientInfo || null;
this.environmentInfo = options.environmentInfo || null;
this.xhr = options.xhr || XMLHttpRequest;
// Default to 'true' unless explicitly disabled.
this.handleAgentCommunication = options.handleAgentCommunication !== false;
this.domTransformation = options.domTransformation || null;
this.port = options.port || 5338;
this.client = new percy_agent_client_1.PercyAgentClient(`http://localhost:${this.port}`, this.xhr);
if (this.handleAgentCommunication) {
this.xhr = options.xhr || XMLHttpRequest;
this.client = new percy_agent_client_1.PercyAgentClient(`http://localhost:${this.port}`, this.xhr);
}
}

@@ -62,14 +67,17 @@ snapshot(name, options = {}) {

const domSnapshot = this.domSnapshot(documentObject);
this.client.post('/percy/snapshot', {
name,
url: documentObject.URL,
// enableJavascript is deprecated. Use enableJavaScript
enableJavaScript: options.enableJavaScript || options.enableJavascript,
widths: options.widths,
// minimumHeight is deprecated. Use minHeight
minHeight: options.minHeight || options.minimumHeight,
clientInfo: this.clientInfo,
environmentInfo: this.environmentInfo,
domSnapshot,
});
if (this.handleAgentCommunication && this.client) {
this.client.post('/percy/snapshot', {
name,
url: documentObject.URL,
// enableJavascript is deprecated. Use enableJavaScript
enableJavaScript: options.enableJavaScript || options.enableJavascript,
widths: options.widths,
// minimumHeight is deprecated. Use minHeight
minHeight: options.minHeight || options.minimumHeight,
clientInfo: this.clientInfo,
environmentInfo: this.environmentInfo,
domSnapshot,
});
}
return domSnapshot;
}

@@ -76,0 +84,0 @@ domSnapshot(documentObject) {

{
"name": "@percy/agent",
"description": "An agent process for integrating with Percy.",
"version": "0.1.7",
"version": "0.1.8",
"author": "Perceptual Inc",

@@ -44,3 +44,3 @@ "bin": {

"@types/sinon-chai": "^3.2.0",
"browserify": "^16.2.2",
"browserify": "^16.2.3",
"chai": "^4.1.2",

@@ -47,0 +47,0 @@ "chai-http": "^4.0.0",

@@ -24,3 +24,3 @@ @percy/agent

$ percy (-v|--version|version)
@percy/agent/0.1.7 darwin-x64 node-v8.7.0
@percy/agent/0.1.8 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.7/dist/commands/exec.ts)_
_See code: [dist/commands/exec.ts](https://github.com/percy/percy-agent/blob/v0.1.8/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.7/dist/commands/finalize.ts)_
_See code: [dist/commands/finalize.ts](https://github.com/percy/percy-agent/blob/v0.1.8/dist/commands/finalize.ts)_

@@ -77,0 +77,0 @@ ## `percy help [COMMAND]`

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