@percy/core 1.30.3-alpha.3 → 1.30.3-beta.0

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/api.js CHANGED
@@ -1,19 +1,13 @@
1
1
  import fs from 'fs';
2
- import path, { dirname, resolve } from 'path';
2
+ import path from 'path';
3
+ import { createRequire } from 'module';
3
4
  import logger from '@percy/logger';
4
5
  import { normalize } from '@percy/config/utils';
5
6
  import { getPackageJSON, Server, percyAutomateRequestHandler, percyBuildEventHandler } from './utils.js';
6
7
  import WebdriverUtils from '@percy/webdriver-utils';
7
8
  import { handleSyncJob } from './snapshot.js';
8
- // Previously, we used `createRequire(import.meta.url).resolve` to resolve the path to the module.
9
- // This approach relied on `createRequire`, which is Node.js-specific and less compatible with modern ESM (ECMAScript Module) standards.
10
- // This was leading to hard coded paths when CLI is used as a dependency in another project.
11
- // Now, we use `fileURLToPath` and `path.resolve` to determine the absolute path in a way that's more aligned with ESM conventions.
12
- // This change ensures better compatibility and avoids relying on Node.js-specific APIs that might cause issues in ESM environments.
13
- import { fileURLToPath } from 'url';
14
- const __filename = fileURLToPath(import.meta.url);
15
- const __dirname = dirname(__filename);
16
- export const PERCY_DOM = resolve(__dirname, 'node_modules/@percy/dom');
9
+ // need require.resolve until import.meta.resolve can be transpiled
10
+ export const PERCY_DOM = createRequire(import.meta.url).resolve('@percy/dom');
17
11
 
18
12
  // Returns a URL encoded string of nested query params
19
13
  function encodeURLSearchParams(subj, prefix) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@percy/core",
3
- "version": "1.30.3-alpha.3",
3
+ "version": "1.30.3-beta.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -9,7 +9,7 @@
9
9
  },
10
10
  "publishConfig": {
11
11
  "access": "public",
12
- "tag": "alpha"
12
+ "tag": "beta"
13
13
  },
14
14
  "engines": {
15
15
  "node": ">=14"
@@ -43,11 +43,11 @@
43
43
  "test:types": "tsd"
44
44
  },
45
45
  "dependencies": {
46
- "@percy/client": "1.30.3-alpha.3",
47
- "@percy/config": "1.30.3-alpha.3",
48
- "@percy/dom": "1.30.3-alpha.3",
49
- "@percy/logger": "1.30.3-alpha.3",
50
- "@percy/webdriver-utils": "1.30.3-alpha.3",
46
+ "@percy/client": "1.30.3-beta.0",
47
+ "@percy/config": "1.30.3-beta.0",
48
+ "@percy/dom": "1.30.3-beta.0",
49
+ "@percy/logger": "1.30.3-beta.0",
50
+ "@percy/webdriver-utils": "1.30.3-beta.0",
51
51
  "content-disposition": "^0.5.4",
52
52
  "cross-spawn": "^7.0.3",
53
53
  "extract-zip": "^2.0.1",
@@ -60,5 +60,5 @@
60
60
  "ws": "^8.17.1",
61
61
  "yaml": "^2.4.1"
62
62
  },
63
- "gitHead": "4d36bd849268e2aa9987509c9fdd5d1224ce5157"
63
+ "gitHead": "8f5a9cb4b287900c4b053302452ea6f84d20c2f1"
64
64
  }
@@ -1,37 +0,0 @@
1
- #!/bin/bash
2
-
3
- function download_url {
4
- if [[ "$OS" == "Linux" ]]; then
5
- echo "https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o/Linux_x64%2F${1}%2Fchrome-linux.zip?alt=media"
6
- elif [[ "$OS" == "Mac" ]] || [[ "$OS" == "Mac_Arm" ]]; then
7
- echo "https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o/$OS%2F${1}%2Fchrome-mac.zip?alt=media"
8
- elif [[ "$OS" == "Win" ]] || [[ "$OS" == "Win_x64" ]]; then
9
- echo "https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o/$OS%2F${1}%2Fchrome-win.zip?alt=media"
10
- fi
11
- }
12
-
13
- function get_closest_rev {
14
- while true; do
15
- curl -I 2>/dev/null `download_url $REVISION` | head -1 | grep 404 >/dev/null
16
- if (($? == 1)); then
17
- break
18
- fi
19
- REVISION=$(($REVISION-1))
20
- done
21
- echo $REVISION
22
- }
23
-
24
-
25
- if (($# < 1)); then
26
- printf "usage: \n"
27
- printf " ./get_chromuim [-r] rev - will get chromium by revision\n"
28
- exit 1
29
- fi
30
-
31
- export REVISION=$1
32
-
33
- for os in "Linux" "Mac" "Mac_Arm" "Win" "Win_x64";
34
- do
35
- export OS=$os
36
- echo "$OS" `get_closest_rev`
37
- done
package/dist/timing.js DELETED
@@ -1,21 +0,0 @@
1
- import logger from '@percy/logger';
2
- export default class TimeIt {
3
- log = logger('timer');
4
- // returns a singleton instance
5
- constructor() {
6
- let {
7
- instance = this
8
- } = this.constructor;
9
- this.constructor.instance = instance;
10
- return instance;
11
- }
12
- async measure(name, identifier, callback) {
13
- const startTime = Date.now();
14
- try {
15
- return await callback();
16
- } finally {
17
- const duration = Date.now() - startTime;
18
- this.log.debug(`${name} - ${identifier} - ${duration / 1000}s`);
19
- }
20
- }
21
- }