xpe 1.0.8 → 1.0.9
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/dist/kernel/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { XpeRuntimeError, } from "../core/index.js";
|
|
2
|
+
import { createRuntimeFetch } from "./runtime-fetch.js";
|
|
2
3
|
let runtimeEngineModule;
|
|
3
4
|
let runtimeEngineModulePromise;
|
|
4
5
|
export function createRuntimeKernel() {
|
|
@@ -46,7 +47,7 @@ function toEnginePreloadOptions(manifest) {
|
|
|
46
47
|
alive: runtime.alive,
|
|
47
48
|
sync: runtime.sync,
|
|
48
49
|
prefix: toRuntimePrefix(runtime),
|
|
49
|
-
fetch:
|
|
50
|
+
fetch: createRuntimeFetch(runtime.credentials),
|
|
50
51
|
props: {
|
|
51
52
|
appCode: manifest.appCode,
|
|
52
53
|
manifest,
|
|
@@ -82,8 +83,3 @@ function toRuntimePrefix(runtime) {
|
|
|
82
83
|
return undefined;
|
|
83
84
|
return { [runtime.name]: runtime.basename };
|
|
84
85
|
}
|
|
85
|
-
function toRuntimeFetch(credentials) {
|
|
86
|
-
if (!credentials)
|
|
87
|
-
return undefined;
|
|
88
|
-
return (input, init) => window.fetch(input, { ...init, credentials: init?.credentials ?? credentials });
|
|
89
|
-
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export function createRuntimeFetch(runtimeCredentials, browserFetch = window.fetch.bind(window)) {
|
|
2
|
+
if (!runtimeCredentials)
|
|
3
|
+
return undefined;
|
|
4
|
+
return (input, init) => {
|
|
5
|
+
const requestCredentials = input instanceof Request ? input.credentials : undefined;
|
|
6
|
+
return browserFetch(input, {
|
|
7
|
+
...init,
|
|
8
|
+
credentials: init?.credentials ?? requestCredentials ?? runtimeCredentials,
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xpe",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"description": "下一代微前端应用运行底座",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -37,21 +37,6 @@
|
|
|
37
37
|
},
|
|
38
38
|
"./package.json": "./package.json"
|
|
39
39
|
},
|
|
40
|
-
"keywords": [
|
|
41
|
-
"micro-frontend",
|
|
42
|
-
"xpe"
|
|
43
|
-
],
|
|
44
|
-
"devDependencies": {
|
|
45
|
-
"@playwright/test": "^1.60.0",
|
|
46
|
-
"@types/node": "^25.9.3",
|
|
47
|
-
"@vitejs/plugin-vue": "^6.0.7",
|
|
48
|
-
"jsdom": "^29.1.1",
|
|
49
|
-
"typescript": "^5.8.3",
|
|
50
|
-
"vite": "^8.0.16",
|
|
51
|
-
"vitest": "^4.1.8",
|
|
52
|
-
"vue": "^3.5.38",
|
|
53
|
-
"vue-router": "^5.1.0"
|
|
54
|
-
},
|
|
55
40
|
"scripts": {
|
|
56
41
|
"clean": "node scripts/clean-dist.mjs",
|
|
57
42
|
"build": "node scripts/clean-dist.mjs && tsc -p tsconfig.build.json && node scripts/fix-dist-imports.mjs && node scripts/check-dist-surface.mjs",
|
|
@@ -66,6 +51,8 @@
|
|
|
66
51
|
"check:public-surface": "node scripts/check-public-surface.mjs",
|
|
67
52
|
"check:release-metadata": "node scripts/check-release-metadata.mjs",
|
|
68
53
|
"verify": "pnpm run check:release-metadata && pnpm run typecheck && pnpm test && pnpm run build && pnpm run check:pack",
|
|
54
|
+
"prepack": "pnpm run build",
|
|
55
|
+
"prepublishOnly": "pnpm run verify",
|
|
69
56
|
"test": "vitest run",
|
|
70
57
|
"test:watch": "vitest",
|
|
71
58
|
"typecheck": "pnpm run typecheck:public && pnpm run typecheck:kernel && pnpm run check:host-child-smoke",
|
|
@@ -74,5 +61,20 @@
|
|
|
74
61
|
"typecheck:kernel": "node scripts/check-kernel-typecheck.mjs",
|
|
75
62
|
"typecheck:public": "tsc -p tsconfig.json --noEmit",
|
|
76
63
|
"upstream:status": "node scripts/upstream-status.mjs"
|
|
64
|
+
},
|
|
65
|
+
"keywords": [
|
|
66
|
+
"micro-frontend",
|
|
67
|
+
"xpe"
|
|
68
|
+
],
|
|
69
|
+
"devDependencies": {
|
|
70
|
+
"@playwright/test": "^1.60.0",
|
|
71
|
+
"@types/node": "^25.9.3",
|
|
72
|
+
"@vitejs/plugin-vue": "^6.0.7",
|
|
73
|
+
"jsdom": "^29.1.1",
|
|
74
|
+
"typescript": "^5.8.3",
|
|
75
|
+
"vite": "^8.0.16",
|
|
76
|
+
"vitest": "^4.1.8",
|
|
77
|
+
"vue": "^3.5.38",
|
|
78
|
+
"vue-router": "^5.1.0"
|
|
77
79
|
}
|
|
78
|
-
}
|
|
80
|
+
}
|