ptech-preset 1.5.2 → 1.5.3
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.d.ts +0 -2
- package/dist/index.js +24 -16
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -13,9 +13,7 @@ type MfAutoOptions = {
|
|
|
13
13
|
stylesExposeKey?: string;
|
|
14
14
|
separateExposes?: boolean;
|
|
15
15
|
separateExposeChunkPrefix?: string;
|
|
16
|
-
/** thư mục chứa types đã consume; mặc định "@mf-types" */
|
|
17
16
|
typesFolder?: string;
|
|
18
|
-
/** env để ép refresh types ở dev (khởi động lại dev) */
|
|
19
17
|
devTypesRefreshEnvVar?: string;
|
|
20
18
|
mf: Record<string, any>;
|
|
21
19
|
isHost?: boolean;
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
2
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
3
|
+
}) : x)(function(x) {
|
|
4
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
5
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
6
|
+
});
|
|
7
|
+
|
|
1
8
|
// src/index.ts
|
|
2
9
|
import path3 from "path";
|
|
3
10
|
import fs3 from "fs";
|
|
@@ -130,30 +137,31 @@ async function collectAutoRemotes(opts = {}) {
|
|
|
130
137
|
import { createRequire } from "module";
|
|
131
138
|
import { fileURLToPath } from "url";
|
|
132
139
|
var esmRequire = createRequire(import.meta.url);
|
|
140
|
+
var pkg = __require(process.cwd() + "/package.json");
|
|
141
|
+
var deps = pkg.dependencies ?? {};
|
|
133
142
|
var HERE = typeof __dirname !== "undefined" ? __dirname : path3.dirname(fileURLToPath(import.meta.url));
|
|
134
143
|
var DEFAULT_SHARED = {
|
|
135
|
-
react: { singleton: true,
|
|
136
|
-
"react-dom": {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
"react
|
|
142
|
-
"@azure/msal-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
}
|
|
144
|
+
react: { singleton: true, requiredVersion: deps.react },
|
|
145
|
+
"react-dom": { singleton: true, requiredVersion: deps["react-dom"] },
|
|
146
|
+
// Router unify ở host
|
|
147
|
+
"react-router": { singleton: true, requiredVersion: deps["react-router"] },
|
|
148
|
+
"react-router-dom": { singleton: true, requiredVersion: deps["react-router-dom"] },
|
|
149
|
+
// MSAL unify ở host
|
|
150
|
+
"@azure/msal-react": { singleton: true, requiredVersion: deps["@azure/msal-react"] },
|
|
151
|
+
"@azure/msal-browser": { singleton: true, requiredVersion: deps["@azure/msal-browser"] },
|
|
152
|
+
// React Query unify ở host
|
|
153
|
+
"@tanstack/react-query": { singleton: true, requiredVersion: deps["@tanstack/react-query"] },
|
|
154
|
+
// Zustand: chỉ share nếu anh muốn "cross-remote shared store"
|
|
155
|
+
zustand: { singleton: true, requiredVersion: deps.zustand }
|
|
148
156
|
};
|
|
149
157
|
var CDN_BASE = "https://oneportal-ehckg7axe3dacxhw.a01.azurefd.net/external/ts/";
|
|
150
158
|
function getPackageName(root) {
|
|
151
159
|
try {
|
|
152
160
|
const pkgPath = path3.resolve(root, "package.json");
|
|
153
161
|
if (fs3.existsSync(pkgPath)) {
|
|
154
|
-
const
|
|
155
|
-
if (
|
|
156
|
-
return
|
|
162
|
+
const pkg2 = JSON.parse(fs3.readFileSync(pkgPath, "utf8"));
|
|
163
|
+
if (pkg2.name && typeof pkg2.name === "string") {
|
|
164
|
+
return pkg2.name.replace(/\W+/g, "");
|
|
157
165
|
}
|
|
158
166
|
}
|
|
159
167
|
} catch (err) {
|