@axe-core/watcher 1.8.0-next.0a0e225f → 1.8.0-next.c6e643c9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/git.js CHANGED
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isDirty = exports.getCommitInfo = exports.getRemoteURL = exports.parseDefaultFromShowRemoteOutput = exports.getDefaultBranchName = exports.getBranchName = exports.isRepository = void 0;
4
- const child_process_1 = require("child_process");
4
+ var child_process_1 = require("child_process");
5
5
  /** Check if the given `dir` is contained by a Git repository. */
6
- const isRepository = (dir = process.cwd()) => {
6
+ var isRepository = function (dir) {
7
+ if (dir === void 0) { dir = process.cwd(); }
7
8
  try {
8
9
  (0, child_process_1.execSync)('git rev-parse --is-inside-work-tree', {
9
10
  cwd: dir,
@@ -12,13 +13,14 @@ const isRepository = (dir = process.cwd()) => {
12
13
  });
13
14
  return true;
14
15
  }
15
- catch {
16
+ catch (_a) {
16
17
  return false;
17
18
  }
18
19
  };
19
20
  exports.isRepository = isRepository;
20
21
  /** Get the current branch name. */
21
- const getBranchName = (dir = process.cwd()) => {
22
+ var getBranchName = function (dir) {
23
+ if (dir === void 0) { dir = process.cwd(); }
22
24
  try {
23
25
  return (0, child_process_1.execSync)('git rev-parse --abbrev-ref HEAD', {
24
26
  cwd: dir,
@@ -28,21 +30,22 @@ const getBranchName = (dir = process.cwd()) => {
28
30
  .toString()
29
31
  .trim();
30
32
  }
31
- catch {
33
+ catch (_a) {
32
34
  return null;
33
35
  }
34
36
  };
35
37
  exports.getBranchName = getBranchName;
36
38
  /** Get the default branch name. */
37
- const getDefaultBranchName = (dir = process.cwd()) => {
39
+ var getDefaultBranchName = function (dir) {
40
+ if (dir === void 0) { dir = process.cwd(); }
38
41
  try {
39
- const stdout = (0, child_process_1.execSync)('git remote show origin', {
42
+ var stdout = (0, child_process_1.execSync)('git remote show origin', {
40
43
  cwd: dir,
41
44
  stdio: ['ignore', 'pipe', 'ignore']
42
45
  }).toString();
43
46
  return (0, exports.parseDefaultFromShowRemoteOutput)(stdout);
44
47
  }
45
- catch {
48
+ catch (_a) {
46
49
  return null;
47
50
  }
48
51
  };
@@ -51,13 +54,14 @@ exports.getDefaultBranchName = getDefaultBranchName;
51
54
  * Parse the default branch name from the output of `git remote show origin`.
52
55
  * @private Exported only for testing.
53
56
  */
54
- const parseDefaultFromShowRemoteOutput = (output) => {
55
- const match = /HEAD branch:\s(.*)/.exec(output);
57
+ var parseDefaultFromShowRemoteOutput = function (output) {
58
+ var match = /HEAD branch:\s(.*)/.exec(output);
56
59
  return match ? match[1].trim() : null;
57
60
  };
58
61
  exports.parseDefaultFromShowRemoteOutput = parseDefaultFromShowRemoteOutput;
59
62
  /** Get the repository's remote URL. */
60
- const getRemoteURL = (dir = process.cwd()) => {
63
+ var getRemoteURL = function (dir) {
64
+ if (dir === void 0) { dir = process.cwd(); }
61
65
  try {
62
66
  return (0, child_process_1.execSync)('git config --get remote.origin.url', {
63
67
  cwd: dir,
@@ -66,38 +70,40 @@ const getRemoteURL = (dir = process.cwd()) => {
66
70
  .toString()
67
71
  .trim();
68
72
  }
69
- catch {
73
+ catch (_a) {
70
74
  return null;
71
75
  }
72
76
  };
73
77
  exports.getRemoteURL = getRemoteURL;
74
78
  /** Get info on the most recent commit. */
75
- const getCommitInfo = (dir = process.cwd()) => {
79
+ var getCommitInfo = function (dir) {
80
+ if (dir === void 0) { dir = process.cwd(); }
76
81
  try {
77
82
  // %s=subject (message), %H=hash, %an=author name, %ae=author email, %n=newline
78
83
  // See https://git-scm.com/docs/git-show#_pretty_formats
79
- const stdout = (0, child_process_1.execSync)('git show --no-patch --format="%s%n%H%n%an%n%ae"', {
84
+ var stdout = (0, child_process_1.execSync)('git show --no-patch --format="%s%n%H%n%an%n%ae"', {
80
85
  cwd: dir,
81
86
  stdio: ['ignore', 'pipe', 'ignore']
82
87
  });
83
- const [message, hash, author, email] = stdout.toString().trim().split('\n');
84
- return { message, hash, author, email };
88
+ var _a = stdout.toString().trim().split('\n'), message = _a[0], hash = _a[1], author = _a[2], email = _a[3];
89
+ return { message: message, hash: hash, author: author, email: email };
85
90
  }
86
- catch {
91
+ catch (_b) {
87
92
  return null;
88
93
  }
89
94
  };
90
95
  exports.getCommitInfo = getCommitInfo;
91
96
  /** Check if the repository contains unstaged changes. */
92
- const isDirty = (dir = process.cwd()) => {
97
+ var isDirty = function (dir) {
98
+ if (dir === void 0) { dir = process.cwd(); }
93
99
  try {
94
- const stdout = (0, child_process_1.execSync)('git status --short', {
100
+ var stdout = (0, child_process_1.execSync)('git status --short', {
95
101
  cwd: dir,
96
102
  stdio: ['ignore', 'pipe', 'ignore']
97
103
  });
98
104
  return stdout.length > 0;
99
105
  }
100
- catch {
106
+ catch (_a) {
101
107
  return false;
102
108
  }
103
109
  };
package/dist/git.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"git.js","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":";;;AAAA,iDAAwC;AAExC,iEAAiE;AAC1D,MAAM,YAAY,GAAG,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,EAAW,EAAE;IAC3D,IAAI;QACF,IAAA,wBAAQ,EAAC,qCAAqC,EAAE;YAC9C,GAAG,EAAE,GAAG;YACR,kDAAkD;YAClD,KAAK,EAAE,QAAQ;SAChB,CAAC,CAAA;QACF,OAAO,IAAI,CAAA;KACZ;IAAC,MAAM;QACN,OAAO,KAAK,CAAA;KACb;AACH,CAAC,CAAA;AAXY,QAAA,YAAY,gBAWxB;AAED,mCAAmC;AAC5B,MAAM,aAAa,GAAG,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,EAAiB,EAAE;IAClE,IAAI;QACF,OAAO,IAAA,wBAAQ,EAAC,iCAAiC,EAAE;YACjD,GAAG,EAAE,GAAG;YACR,4EAA4E;YAC5E,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM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BAAA,EAAA,MAAM,OAAO,CAAC,GAAG,EAAE;IACzC,IAAI;QACF,IAAM,MAAM,GAAG,IAAA,wBAAQ,EAAC,oBAAoB,EAAE;YAC5C,GAAG,EAAE,GAAG;YACR,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC;SACpC,CAAC,CAAA;QACF,OAAO,MAAM,CAAC,MAAM,GAAG,CAAC,CAAA;KACzB;IAAC,WAAM;QACN,OAAO,KAAK,CAAA;KACb;AACH,CAAC,CAAA;AAVY,QAAA,OAAO,WAUnB"}
@@ -1,39 +1,124 @@
1
1
  "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __assign = (this && this.__assign) || function () {
18
+ __assign = Object.assign || function(t) {
19
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
20
+ s = arguments[i];
21
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
22
+ t[p] = s[p];
23
+ }
24
+ return t;
25
+ };
26
+ return __assign.apply(this, arguments);
27
+ };
28
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
29
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
30
+ return new (P || (P = Promise))(function (resolve, reject) {
31
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
32
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
33
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
34
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
35
+ });
36
+ };
37
+ var __generator = (this && this.__generator) || function (thisArg, body) {
38
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
39
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
40
+ function verb(n) { return function (v) { return step([n, v]); }; }
41
+ function step(op) {
42
+ if (f) throw new TypeError("Generator is already executing.");
43
+ while (_) try {
44
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
45
+ if (y = 0, t) op = [op[0] & 2, t.value];
46
+ switch (op[0]) {
47
+ case 0: case 1: t = op; break;
48
+ case 4: _.label++; return { value: op[1], done: false };
49
+ case 5: _.label++; y = op[1]; op = [0]; continue;
50
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
51
+ default:
52
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
53
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
54
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
55
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
56
+ if (t[2]) _.ops.pop();
57
+ _.trys.pop(); continue;
58
+ }
59
+ op = body.call(thisArg, _);
60
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
61
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
62
+ }
63
+ };
64
+ var __rest = (this && this.__rest) || function (s, e) {
65
+ var t = {};
66
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
67
+ t[p] = s[p];
68
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
69
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
70
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
71
+ t[p[i]] = s[p[i]];
72
+ }
73
+ return t;
74
+ };
2
75
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
76
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
77
  };
5
78
  Object.defineProperty(exports, "__esModule", { value: true });
6
79
  exports.PlaywrightController = exports.playwrightConfig = void 0;
7
- const util_1 = require("./util");
8
- const Controller_1 = __importDefault(require("./Controller"));
80
+ var util_1 = require("./util");
81
+ var Controller_1 = __importDefault(require("./Controller"));
9
82
  /**
10
83
  * Creates a Playwright config that uses axe extension
11
84
  *
12
85
  * @param opts Playwright config to extend
13
86
  */
14
87
  function playwrightConfig(opts) {
15
- const { axe, ...config } = opts;
16
- let { args = [] } = config;
88
+ var axe = opts.axe, config = __rest(opts, ["axe"]);
89
+ var _a = config.args, args = _a === void 0 ? [] : _a;
17
90
  (0, util_1.writeVariables)(axe);
18
91
  if (config.headless) {
19
92
  throw new util_1.HeadlessNotSupportedError();
20
93
  }
21
94
  args = args.concat(util_1.extensionArgs);
22
- return {
23
- ...config,
24
- headless: false,
25
- args
26
- };
95
+ return __assign(__assign({}, config), { headless: false, args: args });
27
96
  }
28
97
  exports.playwrightConfig = playwrightConfig;
29
- class PlaywrightController extends Controller_1.default {
30
- constructor(driver) {
31
- super();
32
- this.driver = driver;
98
+ var PlaywrightController = /** @class */ (function (_super) {
99
+ __extends(PlaywrightController, _super);
100
+ function PlaywrightController(driver) {
101
+ var _this = _super.call(this) || this;
102
+ _this.driver = driver;
103
+ return _this;
33
104
  }
34
- async executeScript(fn, ...args) {
35
- await this.driver.evaluate(fn, args);
36
- }
37
- }
105
+ PlaywrightController.prototype.executeScript = function (fn) {
106
+ var args = [];
107
+ for (var _i = 1; _i < arguments.length; _i++) {
108
+ args[_i - 1] = arguments[_i];
109
+ }
110
+ return __awaiter(this, void 0, void 0, function () {
111
+ return __generator(this, function (_a) {
112
+ switch (_a.label) {
113
+ case 0: return [4 /*yield*/, this.driver.evaluate(fn, args)];
114
+ case 1:
115
+ _a.sent();
116
+ return [2 /*return*/];
117
+ }
118
+ });
119
+ });
120
+ };
121
+ return PlaywrightController;
122
+ }(Controller_1.default));
38
123
  exports.PlaywrightController = PlaywrightController;
39
124
  //# sourceMappingURL=playwright.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"playwright.js","sourceRoot":"","sources":["../src/playwright.ts"],"names":[],"mappings":";;;;;;AACA,iCAKe;AACf,8DAAqC;AAErC;;;;GAIG;AAEH,SAAgB,gBAAgB,CAC9B,IAAmC;IAEnC,MAAM,EAAE,GAAG,EAAE,GAAG,MAAM,EAAE,GAAG,IAAI,CAAA;IAC/B,IAAI,EAAE,IAAI,GAAG,EAAE,EAAE,GAAG,MAAM,CAAA;IAC1B,IAAA,qBAAc,EAAC,GAAG,CAAC,CAAA;IAEnB,IAAI,MAAM,CAAC,QAAQ,EAAE;QACnB,MAAM,IAAI,gCAAyB,EAAE,CAAA;KACtC;IAED,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,oBAAa,CAAC,CAAA;IAEjC,OAAO;QACL,GAAG,MAAM;QACT,QAAQ,EAAE,KAAK;QACf,IAAI;KACL,CAAA;AACH,CAAC;AAlBD,4CAkBC;AAED,MAAa,oBAAqB,SAAQ,oBAAU;IAGlD,YAAY,MAAY;QACtB,KAAK,EAAE,CAAA;QACP,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IAES,KAAK,CAAC,aAAa,CAC3B,EAAkC,EAClC,GAAG,IAAe;QAElB,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC,CAAA;IACtC,CAAC;CACF;AAdD,oDAcC"}
1
+ {"version":3,"file":"playwright.js","sourceRoot":"","sources":["../src/playwright.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,+BAKe;AACf,4DAAqC;AAErC;;;;GAIG;AAEH,SAAgB,gBAAgB,CAC9B,IAAmC;IAE3B,IAAA,GAAG,GAAgB,IAAI,IAApB,EAAK,MAAM,UAAK,IAAI,EAAzB,OAAkB,CAAF,CAAS;IACzB,IAAA,KAAc,MAAM,KAAX,EAAT,IAAI,mBAAG,EAAE,KAAA,CAAW;IAC1B,IAAA,qBAAc,EAAC,GAAG,CAAC,CAAA;IAEnB,IAAI,MAAM,CAAC,QAAQ,EAAE;QACnB,MAAM,IAAI,gCAAyB,EAAE,CAAA;KACtC;IAED,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,oBAAa,CAAC,CAAA;IAEjC,6BACK,MAAM,KACT,QAAQ,EAAE,KAAK,EACf,IAAI,MAAA,IACL;AACH,CAAC;AAlBD,4CAkBC;AAED;IAA0C,wCAAU;IAGlD,8BAAY,MAAY;QAAxB,YACE,iBAAO,SAER;QADC,KAAI,CAAC,MAAM,GAAG,MAAM,CAAA;;IACtB,CAAC;IAEe,4CAAa,GAA7B,UACE,EAAkC;QAClC,cAAkB;aAAlB,UAAkB,EAAlB,qBAAkB,EAAlB,IAAkB;YAAlB,6BAAkB;;;;;4BAElB,qBAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC,EAAA;;wBAApC,SAAoC,CAAA;;;;;KACrC;IACH,2BAAC;AAAD,CAAC,AAdD,CAA0C,oBAAU,GAcnD;AAdY,oDAAoB"}
package/dist/puppeteer.js CHANGED
@@ -1,39 +1,134 @@
1
1
  "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __assign = (this && this.__assign) || function () {
18
+ __assign = Object.assign || function(t) {
19
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
20
+ s = arguments[i];
21
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
22
+ t[p] = s[p];
23
+ }
24
+ return t;
25
+ };
26
+ return __assign.apply(this, arguments);
27
+ };
28
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
29
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
30
+ return new (P || (P = Promise))(function (resolve, reject) {
31
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
32
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
33
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
34
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
35
+ });
36
+ };
37
+ var __generator = (this && this.__generator) || function (thisArg, body) {
38
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
39
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
40
+ function verb(n) { return function (v) { return step([n, v]); }; }
41
+ function step(op) {
42
+ if (f) throw new TypeError("Generator is already executing.");
43
+ while (_) try {
44
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
45
+ if (y = 0, t) op = [op[0] & 2, t.value];
46
+ switch (op[0]) {
47
+ case 0: case 1: t = op; break;
48
+ case 4: _.label++; return { value: op[1], done: false };
49
+ case 5: _.label++; y = op[1]; op = [0]; continue;
50
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
51
+ default:
52
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
53
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
54
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
55
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
56
+ if (t[2]) _.ops.pop();
57
+ _.trys.pop(); continue;
58
+ }
59
+ op = body.call(thisArg, _);
60
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
61
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
62
+ }
63
+ };
64
+ var __rest = (this && this.__rest) || function (s, e) {
65
+ var t = {};
66
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
67
+ t[p] = s[p];
68
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
69
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
70
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
71
+ t[p[i]] = s[p[i]];
72
+ }
73
+ return t;
74
+ };
75
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
76
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
77
+ if (ar || !(i in from)) {
78
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
79
+ ar[i] = from[i];
80
+ }
81
+ }
82
+ return to.concat(ar || Array.prototype.slice.call(from));
83
+ };
2
84
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
85
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
86
  };
5
87
  Object.defineProperty(exports, "__esModule", { value: true });
6
88
  exports.PuppeteerController = exports.puppeteerConfig = void 0;
7
- const util_1 = require("./util");
8
- const Controller_1 = __importDefault(require("./Controller"));
89
+ var util_1 = require("./util");
90
+ var Controller_1 = __importDefault(require("./Controller"));
9
91
  /**
10
92
  * Creates a Puppeteer config that uses axe extension.
11
93
  *
12
94
  * @param opts Config to extend
13
95
  */
14
96
  function puppeteerConfig(opts) {
15
- const { axe, ...config } = opts;
16
- let { args = [] } = config;
97
+ var axe = opts.axe, config = __rest(opts, ["axe"]);
98
+ var _a = config.args, args = _a === void 0 ? [] : _a;
17
99
  (0, util_1.writeVariables)(axe);
18
100
  if (config.headless) {
19
101
  throw new util_1.HeadlessNotSupportedError();
20
102
  }
21
103
  args = args.concat(util_1.extensionArgs);
22
- return {
23
- ...config,
24
- headless: false,
25
- args
26
- };
104
+ return __assign(__assign({}, config), { headless: false, args: args });
27
105
  }
28
106
  exports.puppeteerConfig = puppeteerConfig;
29
- class PuppeteerController extends Controller_1.default {
30
- constructor(driver) {
31
- super();
32
- this.driver = driver;
107
+ var PuppeteerController = /** @class */ (function (_super) {
108
+ __extends(PuppeteerController, _super);
109
+ function PuppeteerController(driver) {
110
+ var _this = _super.call(this) || this;
111
+ _this.driver = driver;
112
+ return _this;
33
113
  }
34
- async executeScript(fn, ...args) {
35
- await this.driver.evaluate(fn, ...args);
36
- }
37
- }
114
+ PuppeteerController.prototype.executeScript = function (fn) {
115
+ var args = [];
116
+ for (var _i = 1; _i < arguments.length; _i++) {
117
+ args[_i - 1] = arguments[_i];
118
+ }
119
+ return __awaiter(this, void 0, void 0, function () {
120
+ var _a;
121
+ return __generator(this, function (_b) {
122
+ switch (_b.label) {
123
+ case 0: return [4 /*yield*/, (_a = this.driver).evaluate.apply(_a, __spreadArray([fn], args, false))];
124
+ case 1:
125
+ _b.sent();
126
+ return [2 /*return*/];
127
+ }
128
+ });
129
+ });
130
+ };
131
+ return PuppeteerController;
132
+ }(Controller_1.default));
38
133
  exports.PuppeteerController = PuppeteerController;
39
134
  //# sourceMappingURL=puppeteer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"puppeteer.js","sourceRoot":"","sources":["../src/puppeteer.ts"],"names":[],"mappings":";;;;;;AAMA,iCAKe;AACf,8DAAqC;AAMrC;;;;GAIG;AAEH,SAAgB,eAAe,CAAC,IAA6B;IAC3D,MAAM,EAAE,GAAG,EAAE,GAAG,MAAM,EAAE,GAAG,IAAI,CAAA;IAC/B,IAAI,EAAE,IAAI,GAAG,EAAE,EAAE,GAAG,MAAM,CAAA;IAC1B,IAAA,qBAAc,EAAC,GAAG,CAAC,CAAA;IAEnB,IAAI,MAAM,CAAC,QAAQ,EAAE;QACnB,MAAM,IAAI,gCAAyB,EAAE,CAAA;KACtC;IAED,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,oBAAa,CAAC,CAAA;IAEjC,OAAO;QACL,GAAG,MAAM;QACT,QAAQ,EAAE,KAAK;QACf,IAAI;KACL,CAAA;AACH,CAAC;AAhBD,0CAgBC;AAED,MAAa,mBAAoB,SAAQ,oBAAU;IAGjD,YAAY,MAAY;QACtB,KAAK,EAAE,CAAA;QACP,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IAES,KAAK,CAAC,aAAa,CAC3B,EAAkC,EAClC,GAAG,IAAe;QAElB,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,EAAE,GAAG,IAAI,CAAC,CAAA;IACzC,CAAC;CACF;AAdD,kDAcC"}
1
+ {"version":3,"file":"puppeteer.js","sourceRoot":"","sources":["../src/puppeteer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,+BAKe;AACf,4DAAqC;AAMrC;;;;GAIG;AAEH,SAAgB,eAAe,CAAC,IAA6B;IACnD,IAAA,GAAG,GAAgB,IAAI,IAApB,EAAK,MAAM,UAAK,IAAI,EAAzB,OAAkB,CAAF,CAAS;IACzB,IAAA,KAAc,MAAM,KAAX,EAAT,IAAI,mBAAG,EAAE,KAAA,CAAW;IAC1B,IAAA,qBAAc,EAAC,GAAG,CAAC,CAAA;IAEnB,IAAI,MAAM,CAAC,QAAQ,EAAE;QACnB,MAAM,IAAI,gCAAyB,EAAE,CAAA;KACtC;IAED,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,oBAAa,CAAC,CAAA;IAEjC,6BACK,MAAM,KACT,QAAQ,EAAE,KAAK,EACf,IAAI,MAAA,IACL;AACH,CAAC;AAhBD,0CAgBC;AAED;IAAyC,uCAAU;IAGjD,6BAAY,MAAY;QAAxB,YACE,iBAAO,SAER;QADC,KAAI,CAAC,MAAM,GAAG,MAAM,CAAA;;IACtB,CAAC;IAEe,2CAAa,GAA7B,UACE,EAAkC;QAClC,cAAkB;aAAlB,UAAkB,EAAlB,qBAAkB,EAAlB,IAAkB;YAAlB,6BAAkB;;;;;;4BAElB,qBAAM,CAAA,KAAA,IAAI,CAAC,MAAM,CAAA,CAAC,QAAQ,0BAAC,EAAE,GAAK,IAAI,WAAC;;wBAAvC,SAAuC,CAAA;;;;;KACxC;IACH,0BAAC;AAAD,CAAC,AAdD,CAAyC,oBAAU,GAclD;AAdY,kDAAmB"}
package/dist/util.js CHANGED
@@ -1,4 +1,19 @@
1
1
  "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
2
17
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
18
  if (k2 === undefined) k2 = k;
4
19
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -27,40 +42,44 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
27
42
  };
28
43
  Object.defineProperty(exports, "__esModule", { value: true });
29
44
  exports.writeManifest = exports.writeVariables = exports.HeadlessNotSupportedError = exports.extensionArgs = exports.PATH_TO_EXTENSION_VARIABLES = exports.PATH_TO_SESSION_FILE = exports.DEFAULT_SERVER_URL = exports.PATH_TO_EXTENSION = void 0;
30
- const fs_1 = __importDefault(require("fs"));
31
- const path_1 = __importDefault(require("path"));
32
- const os_1 = __importDefault(require("os"));
33
- const git = __importStar(require("./git"));
34
- const validateApiKey_1 = __importDefault(require("./validateApiKey"));
45
+ var fs_1 = __importDefault(require("fs"));
46
+ var path_1 = __importDefault(require("path"));
47
+ var os_1 = __importDefault(require("os"));
48
+ var git = __importStar(require("./git"));
49
+ var validateApiKey_1 = __importDefault(require("./validateApiKey"));
35
50
  exports.PATH_TO_EXTENSION = path_1.default.join(__dirname, '..', 'extension');
36
51
  exports.DEFAULT_SERVER_URL = 'https://axe.deque.com/';
37
52
  exports.PATH_TO_SESSION_FILE = path_1.default.join(os_1.default.tmpdir(), 'axe-watcher-session.json');
38
53
  exports.PATH_TO_EXTENSION_VARIABLES = path_1.default.join(exports.PATH_TO_EXTENSION, 'variables.json');
39
54
  exports.extensionArgs = [
40
- `--disable-extensions-except=${exports.PATH_TO_EXTENSION}`,
41
- `--load-extension=${exports.PATH_TO_EXTENSION}`
55
+ "--disable-extensions-except=".concat(exports.PATH_TO_EXTENSION),
56
+ "--load-extension=".concat(exports.PATH_TO_EXTENSION)
42
57
  ];
43
- class HeadlessNotSupportedError extends Error {
44
- constructor() {
45
- super('Cannot use extension while headless.');
46
- this.name = 'HeadlessNotSupportedError';
58
+ var HeadlessNotSupportedError = /** @class */ (function (_super) {
59
+ __extends(HeadlessNotSupportedError, _super);
60
+ function HeadlessNotSupportedError() {
61
+ var _this = _super.call(this, 'Cannot use extension while headless.') || this;
62
+ _this.name = 'HeadlessNotSupportedError';
63
+ return _this;
47
64
  }
48
- }
65
+ return HeadlessNotSupportedError;
66
+ }(Error));
49
67
  exports.HeadlessNotSupportedError = HeadlessNotSupportedError;
50
68
  /** Write the user's settings to the disk, so the extension can load them. */
51
- function writeVariables({ apiKey, serverURL, sessionId, autoAnalyze, cypress, takeScreenshots, validateApiKey: shouldValidateApiKey = true }) {
69
+ function writeVariables(_a) {
70
+ var apiKey = _a.apiKey, serverURL = _a.serverURL, sessionId = _a.sessionId, autoAnalyze = _a.autoAnalyze, cypress = _a.cypress, takeScreenshots = _a.takeScreenshots, _b = _a.validateApiKey, shouldValidateApiKey = _b === void 0 ? true : _b;
52
71
  if (!serverURL) {
53
72
  serverURL = exports.DEFAULT_SERVER_URL;
54
73
  }
55
- let urlString;
74
+ var urlString;
56
75
  try {
57
76
  urlString = new URL(serverURL).toString();
58
77
  }
59
78
  catch (err) {
60
- throw new Error(`Error when converting serverURL to URL. Ensure it is formatted properly: ${err}`);
79
+ throw new Error("Error when converting serverURL to URL. Ensure it is formatted properly: ".concat(err));
61
80
  }
62
81
  if (shouldValidateApiKey) {
63
- (0, validateApiKey_1.default)({ apiKey, serverURL: urlString });
82
+ (0, validateApiKey_1.default)({ apiKey: apiKey, serverURL: urlString });
64
83
  }
65
84
  if (typeof autoAnalyze === 'undefined') {
66
85
  autoAnalyze = true;
@@ -69,14 +88,14 @@ function writeVariables({ apiKey, serverURL, sessionId, autoAnalyze, cypress, ta
69
88
  // This enables multi-process/multi-browser test suites to all use the same session ID.
70
89
  if (!sessionId && fs_1.default.existsSync(exports.PATH_TO_SESSION_FILE)) {
71
90
  try {
72
- const data = JSON.parse(fs_1.default.readFileSync(exports.PATH_TO_SESSION_FILE, 'utf8'));
91
+ var data = JSON.parse(fs_1.default.readFileSync(exports.PATH_TO_SESSION_FILE, 'utf8'));
73
92
  sessionId = data.id;
74
93
  }
75
94
  catch (error) {
76
- throw new Error(`Unable to read session configuration: ${error}`);
95
+ throw new Error("Unable to read session configuration: ".concat(error));
77
96
  }
78
97
  }
79
- const variables = {
98
+ var variables = {
80
99
  api_key: apiKey,
81
100
  server_url: urlString,
82
101
  session_id: sessionId,
@@ -88,11 +107,11 @@ function writeVariables({ apiKey, serverURL, sessionId, autoAnalyze, cypress, ta
88
107
  if (git.isRepository()) {
89
108
  variables.git_branch = git.getBranchName();
90
109
  variables.git_default_branch = git.getDefaultBranchName();
91
- const info = git.getCommitInfo();
92
- variables.git_commit_sha = info?.hash;
93
- variables.git_commit_author = info?.author;
94
- variables.git_commit_email = info?.email;
95
- variables.git_commit_message = info?.message;
110
+ var info = git.getCommitInfo();
111
+ variables.git_commit_sha = info === null || info === void 0 ? void 0 : info.hash;
112
+ variables.git_commit_author = info === null || info === void 0 ? void 0 : info.author;
113
+ variables.git_commit_email = info === null || info === void 0 ? void 0 : info.email;
114
+ variables.git_commit_message = info === null || info === void 0 ? void 0 : info.message;
96
115
  variables.git_url = git.getRemoteURL();
97
116
  variables.git_is_dirty = git.isDirty();
98
117
  }
@@ -100,9 +119,10 @@ function writeVariables({ apiKey, serverURL, sessionId, autoAnalyze, cypress, ta
100
119
  }
101
120
  exports.writeVariables = writeVariables;
102
121
  /** Update the extension manifest file. */
103
- function writeManifest({ all_frames, exclude_globs }) {
104
- const manifestPath = path_1.default.join(exports.PATH_TO_EXTENSION, 'manifest.json');
105
- const manifest = JSON.parse(fs_1.default.readFileSync(manifestPath, 'utf-8'));
122
+ function writeManifest(_a) {
123
+ var all_frames = _a.all_frames, exclude_globs = _a.exclude_globs;
124
+ var manifestPath = path_1.default.join(exports.PATH_TO_EXTENSION, 'manifest.json');
125
+ var manifest = JSON.parse(fs_1.default.readFileSync(manifestPath, 'utf-8'));
106
126
  manifest.content_scripts[0].all_frames = all_frames;
107
127
  manifest.content_scripts[0].exclude_globs = exclude_globs;
108
128
  fs_1.default.writeFileSync(manifestPath, JSON.stringify(manifest, null, 2));
package/dist/util.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAAmB;AACnB,gDAAuB;AACvB,4CAAmB;AACnB,2CAA4B;AAC5B,sEAA6C;AAEhC,QAAA,iBAAiB,GAAG,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,WAAW,CAAC,CAAA;AAC3D,QAAA,kBAAkB,GAAG,wBAAwB,CAAA;AAC7C,QAAA,oBAAoB,GAAG,cAAI,CAAC,IAAI,CAC3C,YAAE,CAAC,MAAM,EAAE,EACX,0BAA0B,CAC3B,CAAA;AACY,QAAA,2BAA2B,GAAG,cAAI,CAAC,IAAI,CAClD,yBAAiB,EACjB,gBAAgB,CACjB,CAAA;AAEY,QAAA,aAAa,GAAG;IAC3B,+BAA+B,yBAAiB,EAAE;IAClD,oBAAoB,yBAAiB,EAAE;CAC/B,CAAA;AAEV,MAAa,yBAA0B,SAAQ,KAAK;IAGlD;QACE,KAAK,CAAC,sCAAsC,CAAC,CAAA;QAHxC,SAAI,GAAG,2BAA2B,CAAA;IAIzC,CAAC;CACF;AAND,8DAMC;AA8CD,6EAA6E;AAC7E,SAAgB,cAAc,CAAC,EAC7B,MAAM,EACN,SAAS,EACT,SAAS,EACT,WAAW,EACX,OAAO,EACP,eAAe,EACf,cAAc,EAAE,oBAAoB,GAAG,IAAI,EACtB;IACrB,IAAI,CAAC,SAAS,EAAE;QACd,SAAS,GAAG,0BAAkB,CAAA;KAC/B;IAED,IAAI,SAAS,CAAA;IACb,IAAI;QACF,SAAS,GAAG,IAAI,GAAG,CAAC,SAAS,C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mCAA2B,EAAE,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAA;AAC1E,CAAC;AAhED,wCAgEC;AAOD,0CAA0C;AAC1C,SAAgB,aAAa,CAAC,EAGR;QAFpB,UAAU,gBAAA,EACV,aAAa,mBAAA;IAEb,IAAM,YAAY,GAAG,cAAI,CAAC,IAAI,CAAC,yBAAiB,EAAE,eAAe,CAAC,CAAA;IAClE,IAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,YAAE,CAAC,YAAY,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC,CAAA;IACnE,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,UAAU,GAAG,UAAU,CAAA;IACnD,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,aAAa,GAAG,aAAa,CAAA;IACzD,YAAE,CAAC,aAAa,CAAC,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAA;AACnE,CAAC;AATD,sCASC"}
@@ -3,20 +3,21 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const sync_request_1 = __importDefault(require("sync-request"));
7
- const assert_1 = __importDefault(require("assert"));
6
+ var sync_request_1 = __importDefault(require("sync-request"));
7
+ var assert_1 = __importDefault(require("assert"));
8
8
  /** Validate the given `apiKey`. This method is blocking and should not be called unnecessarily. */
9
- const validateApiKey = ({ apiKey, serverURL }) => {
9
+ var validateApiKey = function (_a) {
10
+ var apiKey = _a.apiKey, serverURL = _a.serverURL;
10
11
  (0, assert_1.default)(apiKey, 'API key is required');
11
- const url = new URL(`/api/api-keys/${apiKey}/validate/axe-devtools-watcher`, serverURL);
12
- const res = (0, sync_request_1.default)('GET', url.toString(), {
12
+ var url = new URL("/api/api-keys/".concat(apiKey, "/validate/axe-devtools-watcher"), serverURL);
13
+ var res = (0, sync_request_1.default)('GET', url.toString(), {
13
14
  maxRedirects: 2,
14
15
  followRedirects: true,
15
16
  maxRetries: 2,
16
17
  retry: true,
17
18
  retryDelay: 100
18
19
  });
19
- const body = JSON.parse(res.getBody('utf8'));
20
+ var body = JSON.parse(res.getBody('utf8'));
20
21
  if (body.error) {
21
22
  throw new Error(body.error);
22
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"validateApiKey.js","sourceRoot":"","sources":["../src/validateApiKey.ts"],"names":[],"mappings":";;;;;AAAA,gEAAkC;AAClC,oDAA2B;AAO3B,mGAAmG;AACnG,MAAM,cAAc,GAAG,CAAC,EAAE,MAAM,EAAE,SAAS,EAAU,EAAQ,EAAE;IAC7D,IAAA,gBAAM,EAAC,MAAM,EAAE,qBAAqB,CAAC,CAAA;IACrC,MAAM,GAAG,GAAG,IAAI,GAAG,CACjB,iBAAiB,MAAM,gCAAgC,EACvD,SAAS,CACV,CAAA;IACD,MAAM,GAAG,GAAG,IAAA,sBAAO,EAAC,KAAK,EAAE,GAAG,CAAC,QAAQ,EAAE,EAAE;QACzC,YAAY,EAAE,CAAC;QACf,eAAe,EAAE,IAAI;QACrB,UAAU,EAAE,CAAC;QACb,KAAK,EAAE,IAAI;QACX,UAAU,EAAE,GAAG;KAChB,CAAC,CAAA;IACF,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAA;IAC5C,IAAI,IAAI,CAAC,KAAK,EAAE;QACd,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;KAC5B;AACH,CAAC,CAAA;AAED,kBAAe,cAAc,CAAA"}
1
+ {"version":3,"file":"validateApiKey.js","sourceRoot":"","sources":["../src/validateApiKey.ts"],"names":[],"mappings":";;;;;AAAA,8DAAkC;AAClC,kDAA2B;AAO3B,mGAAmG;AACnG,IAAM,cAAc,GAAG,UAAC,EAA6B;QAA3B,MAAM,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