openxiangda-cli 2.0.0-alpha.76 → 2.0.0-alpha.77
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,7 +1,8 @@
|
|
|
1
1
|
import { defineConfig } from '@playwright/test';
|
|
2
2
|
|
|
3
|
+
const e2ePort = resolveE2ePort();
|
|
3
4
|
const baseURL =
|
|
4
|
-
process.env.OPENXIANGDA_E2E_BASE_URL ||
|
|
5
|
+
process.env.OPENXIANGDA_E2E_BASE_URL || `http://127.0.0.1:${e2ePort}`;
|
|
5
6
|
|
|
6
7
|
export default defineConfig({
|
|
7
8
|
testDir: './e2e',
|
|
@@ -13,9 +14,28 @@ export default defineConfig({
|
|
|
13
14
|
url: baseURL,
|
|
14
15
|
reuseExistingServer: false,
|
|
15
16
|
env: {
|
|
16
|
-
OPENXIANGDA_WEB_PORT:
|
|
17
|
+
OPENXIANGDA_WEB_PORT: String(e2ePort),
|
|
17
18
|
OPENXIANGDA_ENVIRONMENT_KEY: 'production',
|
|
18
19
|
OPENXIANGDA_DEV_PROXY: 'http://127.0.0.1:7001',
|
|
19
20
|
},
|
|
20
21
|
},
|
|
21
22
|
});
|
|
23
|
+
|
|
24
|
+
function resolveE2ePort() {
|
|
25
|
+
const configured = process.env.OPENXIANGDA_E2E_PORT;
|
|
26
|
+
if (configured !== undefined) {
|
|
27
|
+
const port = Number(configured);
|
|
28
|
+
if (!Number.isInteger(port) || port < 1024 || port > 65535) {
|
|
29
|
+
throw new Error(
|
|
30
|
+
'OPENXIANGDA_E2E_PORT must be an integer between 1024 and 65535'
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
return port;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
let hash = 2166136261;
|
|
37
|
+
for (const character of process.cwd()) {
|
|
38
|
+
hash = Math.imul(hash ^ character.charCodeAt(0), 16777619);
|
|
39
|
+
}
|
|
40
|
+
return 30_000 + ((hash >>> 0) % 30_000);
|
|
41
|
+
}
|
package/template/package.json
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"build": "pnpm --recursive build"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"openxiangda-cli": "2.0.0-alpha.
|
|
25
|
+
"openxiangda-cli": "2.0.0-alpha.77",
|
|
26
26
|
"openxiangda-contracts": "2.0.0-alpha.35",
|
|
27
27
|
"openxiangda-devkit-core": "2.0.0-alpha.46",
|
|
28
28
|
"typescript": "5.9.3"
|