dh-remixer-sdk 0.0.23 → 0.0.24-2c7ffc0
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dh-remixer-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.24-2c7ffc0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"templates",
|
|
@@ -12,11 +12,15 @@
|
|
|
12
12
|
"sdk-update": "./scripts/sdk-update/index.mjs"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"sucrase": "
|
|
15
|
+
"acorn": "8.14.0",
|
|
16
|
+
"acorn-jsx": "5.3.2",
|
|
17
|
+
"chrome-launcher": "1.2.1",
|
|
18
|
+
"chrome-remote-interface": "0.34.0",
|
|
19
|
+
"estree-walker": "3.0.3",
|
|
20
|
+
"sucrase": "3.35.0"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"eslint": "10.0.3",
|
|
24
|
+
"eslint-plugin-n": "^17.24.0"
|
|
21
25
|
}
|
|
22
26
|
}
|
|
@@ -2,6 +2,7 @@ import http from "node:http";
|
|
|
2
2
|
import fs from "node:fs/promises";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { URL } from "node:url";
|
|
5
|
+
import { setTimeout } from "node:timers/promises";
|
|
5
6
|
|
|
6
7
|
import * as chromeLauncher from "chrome-launcher";
|
|
7
8
|
import CDP from "chrome-remote-interface";
|
|
@@ -17,8 +18,20 @@ export class Prerenderer {
|
|
|
17
18
|
const r = this.#normalize(route);
|
|
18
19
|
|
|
19
20
|
// Create a fresh tab (CDP target) for isolation + parallelism
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
// Retry connection to allow CDP server to initialize
|
|
22
|
+
let target, client;
|
|
23
|
+
for (let attempt = 1; attempt <= 5; attempt++) {
|
|
24
|
+
try {
|
|
25
|
+
target = await CDP.New({ port: this.#cdpPort });
|
|
26
|
+
client = await CDP({ port: this.#cdpPort, target });
|
|
27
|
+
break;
|
|
28
|
+
} catch (e) {
|
|
29
|
+
if (attempt === 5) throw e;
|
|
30
|
+
const delay = attempt * 500; // 500ms, 1000ms, 1500ms, 2000ms
|
|
31
|
+
console.log(`[ssg-helmet] CDP connection attempt ${attempt} failed, retrying in ${delay}ms...`);
|
|
32
|
+
await setTimeout(delay);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
22
35
|
|
|
23
36
|
const { Page, Runtime } = client;
|
|
24
37
|
|
|
@@ -26,12 +26,6 @@
|
|
|
26
26
|
"@types/node": "22.19.1",
|
|
27
27
|
"@vitejs/plugin-react": "5.1.1",
|
|
28
28
|
"typescript": "5.8.3",
|
|
29
|
-
"vite": "6.4.1"
|
|
30
|
-
"chrome-launcher": "1.2.1",
|
|
31
|
-
"chrome-remote-interface": "0.34.0",
|
|
32
|
-
"acorn": "^8.16.0",
|
|
33
|
-
"acorn-jsx": "^5.3.2",
|
|
34
|
-
"sucrase": "^3.35.1",
|
|
35
|
-
"estree-walker": "^3.0.3"
|
|
29
|
+
"vite": "6.4.1"
|
|
36
30
|
}
|
|
37
31
|
}
|