@lssm/lib.presentation-runtime-core 0.0.0-canary-20251217063201 → 0.0.0-canary-20251217073102
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/index.js +52 -1
- package/package.json +3 -1
package/dist/index.js
CHANGED
|
@@ -1 +1,52 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/index.ts
|
|
2
|
+
function withPresentationNextAliases(config, opts = {}) {
|
|
3
|
+
const uiWeb = opts.uiKitWeb ?? "@lssm/lib.ui-kit-web";
|
|
4
|
+
const uiNative = opts.uiKitNative ?? "@lssm/lib.ui-kit";
|
|
5
|
+
const presReact = opts.presentationReact ?? "@lssm/lib.presentation-runtime-react";
|
|
6
|
+
const presNative = opts.presentationNative ?? "@lssm/lib.presentation-runtime-react-native";
|
|
7
|
+
config.resolve ??= {};
|
|
8
|
+
config.resolve.alias = {
|
|
9
|
+
...config.resolve.alias || {},
|
|
10
|
+
[uiNative]: uiWeb,
|
|
11
|
+
[presNative]: presReact
|
|
12
|
+
};
|
|
13
|
+
config.resolve.extensions = [
|
|
14
|
+
".web.js",
|
|
15
|
+
".web.jsx",
|
|
16
|
+
".web.ts",
|
|
17
|
+
".web.tsx",
|
|
18
|
+
...config.resolve.extensions || []
|
|
19
|
+
];
|
|
20
|
+
return config;
|
|
21
|
+
}
|
|
22
|
+
function withPresentationMetroAliases(config, opts = {}) {
|
|
23
|
+
const uiWeb = opts.uiKitWeb ?? "@lssm/lib.ui-kit-web";
|
|
24
|
+
const uiNative = opts.uiKitNative ?? "@lssm/lib.ui-kit";
|
|
25
|
+
const presReact = opts.presentationReact ?? "@lssm/lib.presentation-runtime-react";
|
|
26
|
+
const presNative = opts.presentationNative ?? "@lssm/lib.presentation-runtime-react-native";
|
|
27
|
+
config.resolver ??= {};
|
|
28
|
+
config.resolver.unstable_enablePackageExports = true;
|
|
29
|
+
config.resolver.platforms = [
|
|
30
|
+
"ios",
|
|
31
|
+
"android",
|
|
32
|
+
"native",
|
|
33
|
+
"mobile",
|
|
34
|
+
"web",
|
|
35
|
+
...config.resolver.platforms || []
|
|
36
|
+
];
|
|
37
|
+
const original = config.resolver.resolveRequest;
|
|
38
|
+
config.resolver.resolveRequest = (ctx, moduleName, platform) => {
|
|
39
|
+
if (platform === "ios" || platform === "android" || platform === "native") {
|
|
40
|
+
if (typeof moduleName === "string" && moduleName.startsWith(uiWeb + "/ui")) {
|
|
41
|
+
const mapped = moduleName.replace(uiWeb + "/ui", uiNative + "/ui");
|
|
42
|
+
return (original ?? ctx.resolveRequest)(ctx, mapped, platform);
|
|
43
|
+
}
|
|
44
|
+
if (moduleName === presReact) return (original ?? ctx.resolveRequest)(ctx, presNative, platform);
|
|
45
|
+
}
|
|
46
|
+
return (original ?? ctx.resolveRequest)(ctx, moduleName, platform);
|
|
47
|
+
};
|
|
48
|
+
return config;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
//#endregion
|
|
52
|
+
export { withPresentationMetroAliases, withPresentationNextAliases };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lssm/lib.presentation-runtime-core",
|
|
3
|
-
"version": "0.0.0-canary-
|
|
3
|
+
"version": "0.0.0-canary-20251217073102",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -21,6 +21,8 @@
|
|
|
21
21
|
"typescript": "^5.9.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
+
"@lssm/tool.tsdown": "0.0.0-canary-20251217073102",
|
|
25
|
+
"@lssm/tool.typescript": "0.0.0-canary-20251217073102",
|
|
24
26
|
"tsdown": "^0.17.4",
|
|
25
27
|
"typescript": "^5.9.3"
|
|
26
28
|
},
|