New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@percy/core

Package Overview
Dependencies
Maintainers
1
Versions
266
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@percy/core - npm Package Compare versions

Comparing version 1.30.6 to 1.30.7-beta.0

25

dist/api.js
import fs from 'fs';
import path from 'path';
import { createRequire } from 'module';
import path, { dirname, resolve } from 'path';
import logger from '@percy/logger';

@@ -9,5 +8,23 @@ import { normalize } from '@percy/config/utils';

import { handleSyncJob } from './snapshot.js';
// need require.resolve until import.meta.resolve can be transpiled
export const PERCY_DOM = createRequire(import.meta.url).resolve('@percy/dom');
// Previously, we used `createRequire(import.meta.url).resolve` to resolve the path to the module.
// This approach relied on `createRequire`, which is Node.js-specific and less compatible with modern ESM (ECMAScript Module) standards.
// This was leading to hard coded paths when CLI is used as a dependency in another project.
// Now, we use `fileURLToPath` and `path.resolve` to determine the absolute path in a way that's more aligned with ESM conventions.
// This change ensures better compatibility and avoids relying on Node.js-specific APIs that might cause issues in ESM environments.
import { fileURLToPath } from 'url';
import { createRequire } from 'module';
export const getPercyDomPath = url => {
try {
return createRequire(url).resolve('@percy/dom');
} catch (error) {
logger('core:server').warn(['Failed to resolve @percy/dom path using createRequire.', 'Falling back to using fileURLToPath and path.resolve.'].join(' '));
}
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
return resolve(__dirname, 'node_modules/@percy/dom');
};
// Resolved path for PERCY_DOM
export const PERCY_DOM = getPercyDomPath(import.meta.url);
// Returns a URL encoded string of nested query params

@@ -14,0 +31,0 @@ function encodeURLSearchParams(subj, prefix) {

16

package.json
{
"name": "@percy/core",
"version": "1.30.6",
"version": "1.30.7-beta.0",
"license": "MIT",

@@ -12,3 +12,3 @@ "repository": {

"access": "public",
"tag": "latest"
"tag": "beta"
},

@@ -47,7 +47,7 @@ "engines": {

"dependencies": {
"@percy/client": "1.30.6",
"@percy/config": "1.30.6",
"@percy/dom": "1.30.6",
"@percy/logger": "1.30.6",
"@percy/webdriver-utils": "1.30.6",
"@percy/client": "1.30.7-beta.0",
"@percy/config": "1.30.7-beta.0",
"@percy/dom": "1.30.7-beta.0",
"@percy/logger": "1.30.7-beta.0",
"@percy/webdriver-utils": "1.30.7-beta.0",
"content-disposition": "^0.5.4",

@@ -65,3 +65,3 @@ "cross-spawn": "^7.0.3",

},
"gitHead": "4f08c2841c452d1d445077a8e465641100b712de"
"gitHead": "4d589cecf982efeab69ea82881844447369a2af4"
}
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