@percy/core 1.30.3-alpha.4 → 1.30.3-alpha.5

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.
Files changed (2) hide show
  1. package/dist/api.js +16 -3
  2. package/package.json +7 -7
package/dist/api.js CHANGED
@@ -11,9 +11,22 @@ import { handleSyncJob } from './snapshot.js';
11
11
  // Now, we use `fileURLToPath` and `path.resolve` to determine the absolute path in a way that's more aligned with ESM conventions.
12
12
  // This change ensures better compatibility and avoids relying on Node.js-specific APIs that might cause issues in ESM environments.
13
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');
14
+ const getPercyDomPath = () => {
15
+ try {
16
+ const {
17
+ createRequire
18
+ } = require('module');
19
+ return createRequire(import.meta.url).resolve('@percy/dom');
20
+ } catch (error) {
21
+ logger('core:server').warn(['Failed to resolve @percy/dom path using createRequire.', 'Falling back to using fileURLToPath and path.resolve.'].join(' '));
22
+ }
23
+ const __filename = fileURLToPath(import.meta.url);
24
+ const __dirname = dirname(__filename);
25
+ return resolve(__dirname, 'node_modules/@percy/dom');
26
+ };
27
+
28
+ // Resolved path for PERCY_DOM
29
+ export const PERCY_DOM = getPercyDomPath();
17
30
 
18
31
  // Returns a URL encoded string of nested query params
19
32
  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.4",
3
+ "version": "1.30.3-alpha.5",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -43,11 +43,11 @@
43
43
  "test:types": "tsd"
44
44
  },
45
45
  "dependencies": {
46
- "@percy/client": "1.30.3-alpha.4",
47
- "@percy/config": "1.30.3-alpha.4",
48
- "@percy/dom": "1.30.3-alpha.4",
49
- "@percy/logger": "1.30.3-alpha.4",
50
- "@percy/webdriver-utils": "1.30.3-alpha.4",
46
+ "@percy/client": "1.30.3-alpha.5",
47
+ "@percy/config": "1.30.3-alpha.5",
48
+ "@percy/dom": "1.30.3-alpha.5",
49
+ "@percy/logger": "1.30.3-alpha.5",
50
+ "@percy/webdriver-utils": "1.30.3-alpha.5",
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": "c524e283ea199ee9169fa7f5c50a796d46864c3e"
63
+ "gitHead": "b996f30c92e3c9423352d8d31c230ebe21e99e1a"
64
64
  }