creevey 0.10.0-beta.1 → 0.10.0-beta.2

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.
@@ -5,10 +5,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.playwrightDockerFile = playwrightDockerFile;
7
7
  const semver_1 = __importDefault(require("semver"));
8
+ const shelljs_1 = require("shelljs");
8
9
  // TODO Support custom docker images
9
- // TODO Support nexus
10
10
  function playwrightDockerFile(browser, version) {
11
11
  const sv = semver_1.default.coerce(version);
12
+ let npmRegistry;
13
+ try {
14
+ npmRegistry = (0, shelljs_1.exec)('npm config get registry', { silent: true }).stdout.trim();
15
+ }
16
+ catch {
17
+ /* noop */
18
+ }
12
19
  return `
13
20
  FROM mcr.microsoft.com/playwright:v${sv?.format() ?? version}
14
21
 
@@ -16,7 +23,10 @@ WORKDIR /creevey
16
23
 
17
24
  RUN echo "{ \\"type\\": \\"module\\" }" > package.json && \\
18
25
  echo "import { ${browser} as browser } from 'playwright-core';" >> index.js && \\
19
- echo "const ws = await browser.launchServer({ port: 4444, wsPath: 'creevey' })" >> index.js && \\
26
+ echo "const ws = await browser.launchServer({ port: 4444, wsPath: 'creevey' })" >> index.js && \\${npmRegistry
27
+ ? `
28
+ echo "registry=${npmRegistry}" > .npmrc && \\`
29
+ : ''}
20
30
  npm i playwright-core${sv ? `@${sv.format()}` : ''}
21
31
 
22
32
  EXPOSE 4444
@@ -1 +1 @@
1
- {"version":3,"file":"docker-file.js","sourceRoot":"","sources":["../../../src/server/playwright/docker-file.ts"],"names":[],"mappings":";;;;;AAIA,oDAiBC;AArBD,oDAA4B;AAE5B,oCAAoC;AACpC,qBAAqB;AACrB,SAAgB,oBAAoB,CAAC,OAAe,EAAE,OAAe;IACnE,MAAM,EAAE,GAAG,gBAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAElC,OAAO;qCAC4B,EAAE,EAAE,MAAM,EAAE,IAAI,OAAO;;;;;qBAKvC,OAAO;;2BAED,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE;;;;;CAKrD,CAAC;AACF,CAAC"}
1
+ {"version":3,"file":"docker-file.js","sourceRoot":"","sources":["../../../src/server/playwright/docker-file.ts"],"names":[],"mappings":";;;;;AAIA,oDA6BC;AAjCD,oDAA4B;AAC5B,qCAA+B;AAE/B,oCAAoC;AACpC,SAAgB,oBAAoB,CAAC,OAAe,EAAE,OAAe;IACnE,MAAM,EAAE,GAAG,gBAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAElC,IAAI,WAAW,CAAC;IAChB,IAAI,CAAC;QACH,WAAW,GAAG,IAAA,cAAI,EAAC,yBAAyB,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IAChF,CAAC;IAAC,MAAM,CAAC;QACP,UAAU;IACZ,CAAC;IAED,OAAO;qCAC4B,EAAE,EAAE,MAAM,EAAE,IAAI,OAAO;;;;;qBAKvC,OAAO;uGAEtB,WAAW;QACT,CAAC,CAAC;qBACW,WAAW,kBAAkB;QAC1C,CAAC,CAAC,EACN;2BACuB,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE;;;;;CAKrD,CAAC;AACF,CAAC"}
package/package.json CHANGED
@@ -1,11 +1,9 @@
1
1
  {
2
2
  "name": "creevey",
3
3
  "description": "Cross-browser screenshot testing tool for Storybook with fancy UI Runner",
4
- "version": "0.10.0-beta.1",
4
+ "version": "0.10.0-beta.2",
5
5
  "type": "commonjs",
6
- "bin": {
7
- "creevey": "dist/cli.js"
8
- },
6
+ "bin": "dist/cli.js",
9
7
  "main": "./dist/index.js",
10
8
  "types": "./dist/index.d.ts",
11
9
  "exports": {
@@ -90,14 +88,6 @@
90
88
  "dependencies": {
91
89
  "@koa/cors": "^5.0.0",
92
90
  "@octokit/core": "^6.1.2",
93
- "@storybook/components": "^8.4.1",
94
- "@storybook/core-events": "^8.4.1",
95
- "@storybook/csf": "^0.1.11",
96
- "@storybook/icons": "^1.2.12",
97
- "@storybook/manager-api": "^8.4.1",
98
- "@storybook/preview-api": "^8.4.1",
99
- "@storybook/theming": "^8.4.1",
100
- "@storybook/types": "^8.4.1",
101
91
  "@types/chai": "^4.3.20",
102
92
  "@types/dockerode": "^3.3.31",
103
93
  "@types/koa": "^2.15.0",
@@ -152,11 +142,19 @@
152
142
  "@storybook/blocks": "^8.4.1",
153
143
  "@storybook/channels": "^8.4.1",
154
144
  "@storybook/client-logger": "^8.4.1",
145
+ "@storybook/components": "^8.4.1",
155
146
  "@storybook/core-common": "^8.4.1",
147
+ "@storybook/core-events": "^8.4.1",
156
148
  "@storybook/core-server": "^8.4.1",
149
+ "@storybook/csf": "^0.1.11",
150
+ "@storybook/icons": "^1.2.12",
151
+ "@storybook/manager-api": "^8.4.1",
152
+ "@storybook/preview-api": "^8.4.1",
157
153
  "@storybook/react": "^8.4.1",
158
154
  "@storybook/react-vite": "^8.4.1",
159
155
  "@storybook/test": "^8.4.1",
156
+ "@storybook/theming": "^8.4.1",
157
+ "@storybook/types": "^8.4.1",
160
158
  "@types/eslint": "^9.6.1",
161
159
  "@types/eslint__js": "^8.42.3",
162
160
  "@types/node": "^18.19.64",
@@ -1,10 +1,17 @@
1
1
  import semver from 'semver';
2
+ import { exec } from 'shelljs';
2
3
 
3
4
  // TODO Support custom docker images
4
- // TODO Support nexus
5
5
  export function playwrightDockerFile(browser: string, version: string): string {
6
6
  const sv = semver.coerce(version);
7
7
 
8
+ let npmRegistry;
9
+ try {
10
+ npmRegistry = exec('npm config get registry', { silent: true }).stdout.trim();
11
+ } catch {
12
+ /* noop */
13
+ }
14
+
8
15
  return `
9
16
  FROM mcr.microsoft.com/playwright:v${sv?.format() ?? version}
10
17
 
@@ -12,7 +19,12 @@ WORKDIR /creevey
12
19
 
13
20
  RUN echo "{ \\"type\\": \\"module\\" }" > package.json && \\
14
21
  echo "import { ${browser} as browser } from 'playwright-core';" >> index.js && \\
15
- echo "const ws = await browser.launchServer({ port: 4444, wsPath: 'creevey' })" >> index.js && \\
22
+ echo "const ws = await browser.launchServer({ port: 4444, wsPath: 'creevey' })" >> index.js && \\${
23
+ npmRegistry
24
+ ? `
25
+ echo "registry=${npmRegistry}" > .npmrc && \\`
26
+ : ''
27
+ }
16
28
  npm i playwright-core${sv ? `@${sv.format()}` : ''}
17
29
 
18
30
  EXPOSE 4444