@arcgis/node-toolkit 5.2.0-next.153 → 5.2.0-next.154
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.
|
@@ -2,7 +2,7 @@ import { mkdir, rm, stat } from "node:fs/promises";
|
|
|
2
2
|
import { homedir } from "node:os";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
import { findPath, existsAsync } from "../file.js";
|
|
5
|
-
import { runCommand } from "../shell.js";
|
|
5
|
+
import { runCommand, collectOutput } from "../shell.js";
|
|
6
6
|
import { pathToFileURL } from "node:url";
|
|
7
7
|
let installPromise;
|
|
8
8
|
function installPlaywright() {
|
|
@@ -26,7 +26,20 @@ async function ensureInstalled() {
|
|
|
26
26
|
throw new Error("Playwright not found in node_modules. Please install it first.");
|
|
27
27
|
}
|
|
28
28
|
const { chromium } = await import(pathToFileURL(join(playwrightCwd, "index.mjs")).href);
|
|
29
|
-
|
|
29
|
+
const executablePath = chromium.executablePath();
|
|
30
|
+
const isReady = async () => {
|
|
31
|
+
if (!await existsAsync(executablePath)) {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
if (process.platform === "linux" && process.env.CI) {
|
|
35
|
+
const dependencies = await collectOutput("ldd", [executablePath], {
|
|
36
|
+
env: { ...process.env, [`LC_ALL`]: "C" }
|
|
37
|
+
});
|
|
38
|
+
return !dependencies.includes("=> not found");
|
|
39
|
+
}
|
|
40
|
+
return true;
|
|
41
|
+
};
|
|
42
|
+
if (await isReady()) {
|
|
30
43
|
return;
|
|
31
44
|
}
|
|
32
45
|
const home = homedir();
|
|
@@ -36,7 +49,7 @@ async function ensureInstalled() {
|
|
|
36
49
|
await mkdir(stateDir, { recursive: true });
|
|
37
50
|
const releaseLock = await acquireLock(lockPath);
|
|
38
51
|
try {
|
|
39
|
-
if (await
|
|
52
|
+
if (await isReady()) {
|
|
40
53
|
return;
|
|
41
54
|
}
|
|
42
55
|
const installArgs = [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/node-toolkit",
|
|
3
|
-
"version": "5.2.0-next.
|
|
3
|
+
"version": "5.2.0-next.154",
|
|
4
4
|
"description": "Collection of common internal build-time patterns and utilities for ArcGIS Maps SDK for JavaScript components.",
|
|
5
5
|
"homepage": "https://developers.arcgis.com/javascript/latest/",
|
|
6
6
|
"type": "module",
|