Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@scalar/helpers

Package Overview
Dependencies
Maintainers
8
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@scalar/helpers - npm Package Compare versions

Comparing version
0.5.2
to
0.5.3
+20
dist/playwright/docker.d.ts
import type { FullConfig } from '@playwright/test';
export type WebServer = NonNullable<FullConfig['webServer']>;
/** Default playwright version */
export declare const DEFAULT_PLAYWRIGHT_VERSION = "1.59.1";
/** Options for getting a docker server */
type GetDockerServerOptions = {
version: string;
port: number;
} & Partial<WebServer>;
/**
* Builds a Playwright {@link https://playwright.dev/docs/test-webserver | webServer} config
* that starts the browser-side `playwright run-server` inside
* {@link https://hub.docker.com/r/scalarapi/playwright-runner | `scalarapi/playwright-runner`}.
*
* **Important:** The `version` must stay aligned with the workspace `@playwright/test` major/minor
* so the client and container speak the same protocol.
*/
export declare const getDockerServer: (opts?: Partial<GetDockerServerOptions>) => WebServer;
export {};
//# sourceMappingURL=docker.d.ts.map
{"version":3,"file":"docker.d.ts","sourceRoot":"","sources":["../../src/playwright/docker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD,MAAM,MAAM,SAAS,GAAG,WAAW,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAAA;AAE5D,iCAAiC;AACjC,eAAO,MAAM,0BAA0B,WAAW,CAAA;AAElD,0CAA0C;AAC1C,KAAK,sBAAsB,GAAG;IAC5B,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;CACb,GAAG,OAAO,CAAC,SAAS,CAAC,CAAA;AAQtB;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,GAAI,OAAM,OAAO,CAAC,sBAAsB,CAAM,KAAG,SAe5E,CAAA"}
/** Default playwright version */
export const DEFAULT_PLAYWRIGHT_VERSION = '1.59.1';
/** Default options for getting a docker server */
const DEFAULT_OPTS = {
version: DEFAULT_PLAYWRIGHT_VERSION,
port: 5001,
};
/**
* Builds a Playwright {@link https://playwright.dev/docs/test-webserver | webServer} config
* that starts the browser-side `playwright run-server` inside
* {@link https://hub.docker.com/r/scalarapi/playwright-runner | `scalarapi/playwright-runner`}.
*
* **Important:** The `version` must stay aligned with the workspace `@playwright/test` major/minor
* so the client and container speak the same protocol.
*/
export const getDockerServer = (opts = {}) => {
const { version, port, ...rest } = { ...DEFAULT_OPTS, ...opts };
return {
name: 'Playwright',
command: `docker run --name scalar-playwright --rm --platform linux/amd64 --entrypoint="playwright" --network=host scalarapi/playwright-runner:${version} run-server --port ${port} --host 0.0.0.0`,
url: `http://localhost:${port}`,
timeout: 120 * 1000,
reuseExistingServer: !process.env.CI,
gracefulShutdown: {
signal: 'SIGTERM',
timeout: 10 * 1000,
},
// Apply any additional option overrides
...rest,
};
};
+6
-0
# @scalar/helpers
## 0.5.3
### Patch Changes
- [#8971](https://github.com/scalar/scalar/pull/8971): feat(helpers): add a helper playwright utilities
## 0.5.2

@@ -4,0 +10,0 @@

+7
-1

@@ -17,3 +17,3 @@ {

],
"version": "0.5.2",
"version": "0.5.3",
"engines": {

@@ -86,2 +86,7 @@ "node": ">=22"

},
"./playwright/*": {
"import": "./dist/playwright/*.js",
"types": "./dist/playwright/*.d.ts",
"default": "./dist/playwright/*.js"
},
"./regex/*": {

@@ -119,2 +124,3 @@ "import": "./dist/regex/*.js",

"devDependencies": {
"@playwright/test": "1.59.1",
"jsdom": "27.4.0",

@@ -121,0 +127,0 @@ "vitest": "4.1.0"