miaoda-expo-devkit 0.1.1-beta.22 → 0.1.1-beta.24
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/babel/plugin-lucide-react-native.js +44 -1
- package/dist/metro.d.mts +1 -0
- package/dist/metro.d.ts +1 -0
- package/dist/metro.js +36 -0
- package/dist/metro.mjs +36 -0
- package/package.json +1 -1
|
@@ -14611,6 +14611,43 @@ function resolveIconsLocation(moduleDir) {
|
|
|
14611
14611
|
};
|
|
14612
14612
|
}
|
|
14613
14613
|
var iconMapCache = /* @__PURE__ */ new Map();
|
|
14614
|
+
var aliasMap = null;
|
|
14615
|
+
function buildAliasMap(moduleDir) {
|
|
14616
|
+
if (aliasMap) return aliasMap;
|
|
14617
|
+
const { map: fileMap } = buildIconMap(moduleDir);
|
|
14618
|
+
const map = /* @__PURE__ */ new Map();
|
|
14619
|
+
const lucideDistPath = import_node_path.default.dirname(import_node_path.default.dirname(require.resolve(LUCIDE_REACT_NATIVE)));
|
|
14620
|
+
const cjsBundle = import_node_path.default.join(lucideDistPath, "cjs/lucide-react-native.js");
|
|
14621
|
+
if (import_node_fs.default.existsSync(cjsBundle)) {
|
|
14622
|
+
const content = import_node_fs.default.readFileSync(cjsBundle, "utf-8");
|
|
14623
|
+
const varToExportNames = /* @__PURE__ */ new Map();
|
|
14624
|
+
const re = /^exports\.(\w+)\s*=\s*(\w+);/gm;
|
|
14625
|
+
let m;
|
|
14626
|
+
while ((m = re.exec(content)) !== null) {
|
|
14627
|
+
const [, exportName, varName] = m;
|
|
14628
|
+
const group = varToExportNames.get(varName);
|
|
14629
|
+
if (group) {
|
|
14630
|
+
group.push(exportName);
|
|
14631
|
+
} else {
|
|
14632
|
+
varToExportNames.set(varName, [exportName]);
|
|
14633
|
+
}
|
|
14634
|
+
}
|
|
14635
|
+
for (const names of varToExportNames.values()) {
|
|
14636
|
+
if (names.length < 2) continue;
|
|
14637
|
+
const canonical = names.find((n) => fileMap.has(n.toLowerCase()));
|
|
14638
|
+
if (!canonical) continue;
|
|
14639
|
+
const canonicalLower = canonical.toLowerCase();
|
|
14640
|
+
for (const name of names) {
|
|
14641
|
+
const lower = name.toLowerCase();
|
|
14642
|
+
if (lower !== canonicalLower) {
|
|
14643
|
+
map.set(lower, canonicalLower);
|
|
14644
|
+
}
|
|
14645
|
+
}
|
|
14646
|
+
}
|
|
14647
|
+
}
|
|
14648
|
+
aliasMap = map;
|
|
14649
|
+
return map;
|
|
14650
|
+
}
|
|
14614
14651
|
function buildIconMap(moduleDir) {
|
|
14615
14652
|
const cached = iconMapCache.get(moduleDir);
|
|
14616
14653
|
if (cached) return cached;
|
|
@@ -14628,7 +14665,13 @@ function buildIconMap(moduleDir) {
|
|
|
14628
14665
|
function resolveModule(useES, name) {
|
|
14629
14666
|
const moduleDir = useES ? "esm" : "cjs";
|
|
14630
14667
|
const { map, importBasePath } = buildIconMap(moduleDir);
|
|
14631
|
-
|
|
14668
|
+
let slug = map.get(name.toLowerCase());
|
|
14669
|
+
if (!slug) {
|
|
14670
|
+
const canonical = buildAliasMap(moduleDir).get(name.toLowerCase());
|
|
14671
|
+
if (canonical) {
|
|
14672
|
+
slug = map.get(canonical);
|
|
14673
|
+
}
|
|
14674
|
+
}
|
|
14632
14675
|
if (slug) {
|
|
14633
14676
|
return `${importBasePath}/${slug}`;
|
|
14634
14677
|
}
|
package/dist/metro.d.mts
CHANGED
|
@@ -134,6 +134,7 @@ declare function withRouteEndpoint(config: MetroConfig, options: RouteEndpointOp
|
|
|
134
134
|
*
|
|
135
135
|
* withWorkspaceNodeModules — 修复沙箱中 node_modules 不在 projectRoot 内的问题
|
|
136
136
|
* withCssInterop — 为 expo-image / expo-camera 注入 NativeWind cssInterop
|
|
137
|
+
* withLucideResolver — 消除 lucide 子路径未在 exports 中声明的警告
|
|
137
138
|
* withExpoNotificationsStub — Android:expo-notifications → stub(Expo Go no-op,Dev Build 透传)
|
|
138
139
|
* withEntryInjection — 在 expo-router 启动前注入脚本(仅 __DEV__)
|
|
139
140
|
* withDevStubs — 替换 Sentry DSN / 屏蔽 LogBox(仅 __DEV__)
|
package/dist/metro.d.ts
CHANGED
|
@@ -134,6 +134,7 @@ declare function withRouteEndpoint(config: MetroConfig, options: RouteEndpointOp
|
|
|
134
134
|
*
|
|
135
135
|
* withWorkspaceNodeModules — 修复沙箱中 node_modules 不在 projectRoot 内的问题
|
|
136
136
|
* withCssInterop — 为 expo-image / expo-camera 注入 NativeWind cssInterop
|
|
137
|
+
* withLucideResolver — 消除 lucide 子路径未在 exports 中声明的警告
|
|
137
138
|
* withExpoNotificationsStub — Android:expo-notifications → stub(Expo Go no-op,Dev Build 透传)
|
|
138
139
|
* withEntryInjection — 在 expo-router 启动前注入脚本(仅 __DEV__)
|
|
139
140
|
* withDevStubs — 替换 Sentry DSN / 屏蔽 LogBox(仅 __DEV__)
|
package/dist/metro.js
CHANGED
|
@@ -284,6 +284,7 @@ function withCssInterop(config) {
|
|
|
284
284
|
}
|
|
285
285
|
|
|
286
286
|
// src/metro/withDevkit.ts
|
|
287
|
+
var import_fs3 = __toESM(require("fs"));
|
|
287
288
|
var import_path7 = __toESM(require("path"));
|
|
288
289
|
|
|
289
290
|
// src/metro/withEsbuildMinify.ts
|
|
@@ -300,6 +301,40 @@ function withEsbuildMinify(config) {
|
|
|
300
301
|
}
|
|
301
302
|
|
|
302
303
|
// src/metro/withDevkit.ts
|
|
304
|
+
var LUCIDE_PKG = "lucide-react-native";
|
|
305
|
+
var LUCIDE_DIST_PREFIX = `${LUCIDE_PKG}/dist/`;
|
|
306
|
+
var lucidePkgRoot = null;
|
|
307
|
+
function getLucidePkgRoot() {
|
|
308
|
+
if (lucidePkgRoot) return lucidePkgRoot;
|
|
309
|
+
let dir = import_path7.default.dirname(require.resolve(LUCIDE_PKG));
|
|
310
|
+
while (true) {
|
|
311
|
+
const pkgJson = import_path7.default.join(dir, "package.json");
|
|
312
|
+
if (import_fs3.default.existsSync(pkgJson)) {
|
|
313
|
+
const { name } = require(pkgJson);
|
|
314
|
+
if (name === LUCIDE_PKG) {
|
|
315
|
+
lucidePkgRoot = dir;
|
|
316
|
+
return dir;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
const parent = import_path7.default.dirname(dir);
|
|
320
|
+
if (parent === dir) throw new Error(`[withLucideResolver] Cannot locate package root for "${LUCIDE_PKG}"`);
|
|
321
|
+
dir = parent;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
function withLucideResolver(config) {
|
|
325
|
+
const upstream = config.resolver?.resolveRequest ?? null;
|
|
326
|
+
const resolveRequest = (context, moduleName, platform) => {
|
|
327
|
+
if (moduleName.startsWith(LUCIDE_DIST_PREFIX)) {
|
|
328
|
+
const subpath = moduleName.slice(LUCIDE_PKG.length + 1);
|
|
329
|
+
const ext = subpath.startsWith("dist/esm/") ? ".mjs" : ".js";
|
|
330
|
+
const filePath = import_path7.default.join(getLucidePkgRoot(), subpath + ext);
|
|
331
|
+
return { filePath, type: "sourceFile" };
|
|
332
|
+
}
|
|
333
|
+
if (upstream) return upstream(context, moduleName, platform);
|
|
334
|
+
return context.resolveRequest(context, moduleName, platform);
|
|
335
|
+
};
|
|
336
|
+
return { ...config, resolver: { ...config.resolver, resolveRequest } };
|
|
337
|
+
}
|
|
303
338
|
var EXPO_NOTIFICATIONS_STUB_FILENAME = "expo-notifications-stub.js";
|
|
304
339
|
var EXPO_NOTIFICATIONS_STUB_PATH = import_path7.default.resolve(__dirname, "stubs", EXPO_NOTIFICATIONS_STUB_FILENAME);
|
|
305
340
|
function withExpoNotificationsStub(config) {
|
|
@@ -319,6 +354,7 @@ function withDevkit(config, options = {}) {
|
|
|
319
354
|
config = withWorkspaceNodeModules(config);
|
|
320
355
|
config = withCssInterop(config);
|
|
321
356
|
config = withEsbuildMinify(config);
|
|
357
|
+
config = withLucideResolver(config);
|
|
322
358
|
config = withExpoNotificationsStub(config);
|
|
323
359
|
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
324
360
|
config = withEntryInjection(config);
|
package/dist/metro.mjs
CHANGED
|
@@ -246,6 +246,7 @@ function withCssInterop(config) {
|
|
|
246
246
|
}
|
|
247
247
|
|
|
248
248
|
// src/metro/withDevkit.ts
|
|
249
|
+
import fs3 from "fs";
|
|
249
250
|
import path7 from "path";
|
|
250
251
|
|
|
251
252
|
// src/metro/withEsbuildMinify.ts
|
|
@@ -262,6 +263,40 @@ function withEsbuildMinify(config) {
|
|
|
262
263
|
}
|
|
263
264
|
|
|
264
265
|
// src/metro/withDevkit.ts
|
|
266
|
+
var LUCIDE_PKG = "lucide-react-native";
|
|
267
|
+
var LUCIDE_DIST_PREFIX = `${LUCIDE_PKG}/dist/`;
|
|
268
|
+
var lucidePkgRoot = null;
|
|
269
|
+
function getLucidePkgRoot() {
|
|
270
|
+
if (lucidePkgRoot) return lucidePkgRoot;
|
|
271
|
+
let dir = path7.dirname(__require.resolve(LUCIDE_PKG));
|
|
272
|
+
while (true) {
|
|
273
|
+
const pkgJson = path7.join(dir, "package.json");
|
|
274
|
+
if (fs3.existsSync(pkgJson)) {
|
|
275
|
+
const { name } = __require(pkgJson);
|
|
276
|
+
if (name === LUCIDE_PKG) {
|
|
277
|
+
lucidePkgRoot = dir;
|
|
278
|
+
return dir;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
const parent = path7.dirname(dir);
|
|
282
|
+
if (parent === dir) throw new Error(`[withLucideResolver] Cannot locate package root for "${LUCIDE_PKG}"`);
|
|
283
|
+
dir = parent;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
function withLucideResolver(config) {
|
|
287
|
+
const upstream = config.resolver?.resolveRequest ?? null;
|
|
288
|
+
const resolveRequest = (context, moduleName, platform) => {
|
|
289
|
+
if (moduleName.startsWith(LUCIDE_DIST_PREFIX)) {
|
|
290
|
+
const subpath = moduleName.slice(LUCIDE_PKG.length + 1);
|
|
291
|
+
const ext = subpath.startsWith("dist/esm/") ? ".mjs" : ".js";
|
|
292
|
+
const filePath = path7.join(getLucidePkgRoot(), subpath + ext);
|
|
293
|
+
return { filePath, type: "sourceFile" };
|
|
294
|
+
}
|
|
295
|
+
if (upstream) return upstream(context, moduleName, platform);
|
|
296
|
+
return context.resolveRequest(context, moduleName, platform);
|
|
297
|
+
};
|
|
298
|
+
return { ...config, resolver: { ...config.resolver, resolveRequest } };
|
|
299
|
+
}
|
|
265
300
|
var EXPO_NOTIFICATIONS_STUB_FILENAME = "expo-notifications-stub.js";
|
|
266
301
|
var EXPO_NOTIFICATIONS_STUB_PATH = path7.resolve(__dirname, "stubs", EXPO_NOTIFICATIONS_STUB_FILENAME);
|
|
267
302
|
function withExpoNotificationsStub(config) {
|
|
@@ -281,6 +316,7 @@ function withDevkit(config, options = {}) {
|
|
|
281
316
|
config = withWorkspaceNodeModules(config);
|
|
282
317
|
config = withCssInterop(config);
|
|
283
318
|
config = withEsbuildMinify(config);
|
|
319
|
+
config = withLucideResolver(config);
|
|
284
320
|
config = withExpoNotificationsStub(config);
|
|
285
321
|
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
286
322
|
config = withEntryInjection(config);
|