@bigbinary/neeto-playwright-commons 6.1.1 → 6.1.3-beta1
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.
- package/index.js +14 -2
- package/package.json +8 -9
package/index.js
CHANGED
|
@@ -11096,6 +11096,15 @@ class ProductServer {
|
|
|
11096
11096
|
}
|
|
11097
11097
|
|
|
11098
11098
|
const { name, paths, webpackDevFile, setupScript, baseUrl, readyUrl, maxWaitMs, } = CHAT_WIDGET;
|
|
11099
|
+
// A product on Yarn 4 puts its own yarn first on PATH for the scripts it runs, so it's dropped to let the widget use its own Yarn.
|
|
11100
|
+
const widgetEnv = (extraEnv = {}) => {
|
|
11101
|
+
const { BERRY_BIN_FOLDER, ...env } = process.env;
|
|
11102
|
+
const PATH = (env.PATH ?? "")
|
|
11103
|
+
.split(path.delimiter)
|
|
11104
|
+
.filter(dir => !BERRY_BIN_FOLDER || dir !== BERRY_BIN_FOLDER)
|
|
11105
|
+
.join(path.delimiter);
|
|
11106
|
+
return { ...env, PATH, ...extraEnv };
|
|
11107
|
+
};
|
|
11099
11108
|
// Runs neeto-chat-widget's webpack dev server, as it isn't a Rails product; workers share it like ProductServer.
|
|
11100
11109
|
class WidgetServer {
|
|
11101
11110
|
log = (msg) => console.log(`[LocalServer:${name}] ${msg}`);
|
|
@@ -11130,7 +11139,8 @@ class WidgetServer {
|
|
|
11130
11139
|
fs.writeFileSync(webpackDevFile, content.replace(oldConfig, newConfig));
|
|
11131
11140
|
};
|
|
11132
11141
|
ensureSetup = async () => {
|
|
11133
|
-
|
|
11142
|
+
// The marker is written only after setup succeeds, so a clone whose install failed is set up again.
|
|
11143
|
+
if (!fs.existsSync(paths.PREPARED_MARKER)) {
|
|
11134
11144
|
this.log("Running first-time setup...");
|
|
11135
11145
|
const [githubToken] = await Promise.all([
|
|
11136
11146
|
getGithubToken(),
|
|
@@ -11140,8 +11150,9 @@ class WidgetServer {
|
|
|
11140
11150
|
command: "bash",
|
|
11141
11151
|
args: [setupScript, paths.DIR],
|
|
11142
11152
|
logFile: paths.SETUP_LOG,
|
|
11143
|
-
env: {
|
|
11153
|
+
env: widgetEnv({ GITHUB_TOKEN: githubToken }),
|
|
11144
11154
|
});
|
|
11155
|
+
fs.writeFileSync(paths.PREPARED_MARKER, "");
|
|
11145
11156
|
}
|
|
11146
11157
|
this.patchWebpackPublicPath();
|
|
11147
11158
|
};
|
|
@@ -11158,6 +11169,7 @@ class WidgetServer {
|
|
|
11158
11169
|
args: ["start"],
|
|
11159
11170
|
logFile: paths.LOG,
|
|
11160
11171
|
cwd: paths.DIR,
|
|
11172
|
+
env: widgetEnv(),
|
|
11161
11173
|
});
|
|
11162
11174
|
fs.writeFileSync(paths.STATE_FILE, JSON.stringify({ pid }));
|
|
11163
11175
|
this.log("Server ready.");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigbinary/neeto-playwright-commons",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.3-beta1",
|
|
4
4
|
"description": "A package encapsulating common playwright code across neeto projects.",
|
|
5
5
|
"repository": "git@github.com:bigbinary/neeto-playwright-commons.git",
|
|
6
6
|
"license": "apache-2.0",
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
"build:jsdoc": "node ./.scripts/jsdoc-builder.mjs",
|
|
20
20
|
"audit": "yarn npm audit --recursive --severity high"
|
|
21
21
|
},
|
|
22
|
+
"packageManager": "yarn@4.18.1",
|
|
22
23
|
"engines": {
|
|
23
|
-
"node": ">=
|
|
24
|
-
"
|
|
25
|
-
"yarn": ">=1.22"
|
|
24
|
+
"node": ">=24",
|
|
25
|
+
"yarn": ">=4"
|
|
26
26
|
},
|
|
27
27
|
"files": [
|
|
28
28
|
"/index.js",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"scripts/**"
|
|
32
32
|
],
|
|
33
33
|
"nano-staged": {
|
|
34
|
-
"**/*.{js,
|
|
34
|
+
"**/*.{js,ts,json,mjs}": [
|
|
35
35
|
"prettier --write",
|
|
36
36
|
"eslint --fix",
|
|
37
37
|
"git add"
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@rollup/plugin-node-resolve": "16.0.3",
|
|
53
53
|
"@types/js-yaml": "4.0.9",
|
|
54
54
|
"@types/mailparser": "^3.4.6",
|
|
55
|
-
"@types/node": "
|
|
55
|
+
"@types/node": "24.19.2",
|
|
56
56
|
"@types/proper-lockfile": "^4.1.4",
|
|
57
57
|
"@types/ramda": "0.31.1",
|
|
58
58
|
"@typescript-eslint/eslint-plugin": "^8.70.0",
|
|
@@ -103,6 +103,5 @@
|
|
|
103
103
|
"playwright-extra": "4.3.6",
|
|
104
104
|
"proper-lockfile": "4.1.2",
|
|
105
105
|
"puppeteer-extra-plugin-stealth": "2.11.2"
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
}
|
|
106
|
+
}
|
|
107
|
+
}
|