miaoda-expo-devkit 0.1.1-beta.23 → 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/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,11 +301,34 @@ 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
+ }
303
324
  function withLucideResolver(config) {
304
325
  const upstream = config.resolver?.resolveRequest ?? null;
305
326
  const resolveRequest = (context, moduleName, platform) => {
306
- if (moduleName.startsWith("lucide-react-native/dist/")) {
307
- return { filePath: require.resolve(moduleName), type: "sourceFile" };
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" };
308
332
  }
309
333
  if (upstream) return upstream(context, moduleName, platform);
310
334
  return context.resolveRequest(context, moduleName, platform);
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,11 +263,34 @@ 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
+ }
265
286
  function withLucideResolver(config) {
266
287
  const upstream = config.resolver?.resolveRequest ?? null;
267
288
  const resolveRequest = (context, moduleName, platform) => {
268
- if (moduleName.startsWith("lucide-react-native/dist/")) {
269
- return { filePath: __require.resolve(moduleName), type: "sourceFile" };
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" };
270
294
  }
271
295
  if (upstream) return upstream(context, moduleName, platform);
272
296
  return context.resolveRequest(context, moduleName, platform);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "miaoda-expo-devkit",
3
- "version": "0.1.1-beta.23",
3
+ "version": "0.1.1-beta.24",
4
4
  "description": "Expo 应用开发工具集:Sentry DSN 替换 stub、错误/网络捕获、Metro 符号化",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.js",