@recordreplay/playwright-config
Advanced tools
Comparing version 0.1.1 to 0.2.0
@@ -1,7 +0,7 @@ | ||
declare type BrowserName = 'chromium' | 'firefox' | 'webkit'; | ||
export declare function getExecutablePath(browserName: BrowserName): string | undefined; | ||
import { BrowserName } from "@recordreplay/recordings-cli"; | ||
export declare function getExecutablePath(browserName: BrowserName): string | null; | ||
export declare const devices: { | ||
readonly "Replay Firefox": { | ||
launchOptions: { | ||
executablePath: string | undefined; | ||
executablePath: string | null; | ||
env: { | ||
@@ -15,3 +15,3 @@ RECORD_ALL_CONTENT: number; | ||
launchOptions: { | ||
executablePath: string | undefined; | ||
executablePath: string | null; | ||
env: { | ||
@@ -24,3 +24,2 @@ RECORD_ALL_CONTENT: number; | ||
}; | ||
export {}; | ||
//# sourceMappingURL=index.d.ts.map |
39
index.js
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.devices = exports.getExecutablePath = void 0; | ||
const path_1 = __importDefault(require("path")); | ||
const EXECUTABLE_PATHS = { | ||
"darwin:firefox": ["firefox", "Nightly.app", "Contents", "MacOS", "firefox"], | ||
"linux:chromium": ["chrome-linux", "chrome"], | ||
"linux:firefox": ["firefox", "firefox"], | ||
}; | ||
function getPlatformKey(browserName) { | ||
const key = `${process.platform}:${browserName}`; | ||
switch (key) { | ||
case "darwin:firefox": | ||
case "linux:firefox": | ||
case "linux:chromium": | ||
return key; | ||
} | ||
return undefined; | ||
} | ||
function getExecutablePath(browserName) { | ||
// Override with replay specific browsers. | ||
const replayDir = process.env.RECORD_REPLAY_DIRECTORY || | ||
path_1.default.join(process.env.HOME, ".replay"); | ||
const key = getPlatformKey(browserName); | ||
if (!key) { | ||
return; | ||
} | ||
return path_1.default.join(replayDir, "playwright", ...EXECUTABLE_PATHS[key]); | ||
} | ||
exports.getExecutablePath = getExecutablePath; | ||
const recordings_cli_1 = require("@recordreplay/recordings-cli"); | ||
function getDeviceConfig(browserName) { | ||
const executablePath = getExecutablePath(browserName); | ||
const executablePath = (0, recordings_cli_1.getPlaywrightBrowserPath)(browserName); | ||
if (!executablePath) { | ||
@@ -43,3 +14,3 @@ console.warn(`${browserName} is not supported on this platform`); | ||
env: { | ||
RECORD_ALL_CONTENT: 1 | ||
RECORD_ALL_CONTENT: 1, | ||
}, | ||
@@ -50,2 +21,6 @@ }, | ||
} | ||
function getExecutablePath(browserName) { | ||
return (0, recordings_cli_1.getPlaywrightBrowserPath)(browserName); | ||
} | ||
exports.getExecutablePath = getExecutablePath; | ||
exports.devices = { | ||
@@ -52,0 +27,0 @@ get "Replay Firefox"() { |
{ | ||
"name": "@recordreplay/playwright-config", | ||
"version": "0.1.1", | ||
"version": "0.2.0", | ||
"description": "Configuration utilities for using the Replay browsers with playwright", | ||
"main": "index.js", | ||
"scripts": { | ||
"install": "node -e 'process.exit(require(\"fs\").existsSync(\"./install.js\") ? 1 : 0)' || node ./install.js", | ||
"build": "tsc && cp package.json dist/", | ||
@@ -14,3 +15,6 @@ "test": "echo \"Error: no test specified\" && exit 1" | ||
"@types/node": "^17.0.21" | ||
}, | ||
"dependencies": { | ||
"@recordreplay/recordings-cli": "^0.10.1" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
6055
10
1
64
1
1
58
1
+ Added@recordreplay/recordings-cli@0.10.3(transitive)
+ Addedcommander@7.2.0(transitive)
+ Addedws@7.5.10(transitive)