miaoda-expo-devkit 0.1.1-beta.63 → 0.1.1-beta.64

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.d.mts CHANGED
@@ -437,7 +437,8 @@ declare function withTransformLogger(config: MetroConfig): MetroConfig;
437
437
  /**
438
438
  * withPersistentCache — 将 Metro transform cache 固定到项目目录
439
439
  *
440
- * 默认 Metro cache 位于系统临时目录,重启后丢失,每次都是冷启动。
440
+ * Metro 默认将 transform cache 写入系统临时目录(os.tmpdir()/metro-cache),
441
+ * 系统随时可以清理,导致每次重启都是冷启动。
441
442
  * 此 wrapper 将 cacheStores 替换为项目根目录下的 .metro-cache/,持久保留。
442
443
  *
443
444
  * cache key 由文件内容 sha1 + 相对路径 + Babel/Metro 版本共同决定,
package/dist/metro.d.ts CHANGED
@@ -437,7 +437,8 @@ declare function withTransformLogger(config: MetroConfig): MetroConfig;
437
437
  /**
438
438
  * withPersistentCache — 将 Metro transform cache 固定到项目目录
439
439
  *
440
- * 默认 Metro cache 位于系统临时目录,重启后丢失,每次都是冷启动。
440
+ * Metro 默认将 transform cache 写入系统临时目录(os.tmpdir()/metro-cache),
441
+ * 系统随时可以清理,导致每次重启都是冷启动。
441
442
  * 此 wrapper 将 cacheStores 替换为项目根目录下的 .metro-cache/,持久保留。
442
443
  *
443
444
  * cache key 由文件内容 sha1 + 相对路径 + Babel/Metro 版本共同决定,
package/dist/metro.js CHANGED
@@ -563,9 +563,12 @@ function withPersistentCache(config, options = {}) {
563
563
  const projectRoot = config.projectRoot ?? process.cwd();
564
564
  const { cacheDir = ".metro-cache" } = options;
565
565
  const cacheRoot = import_path13.default.join(projectRoot, cacheDir);
566
+ const existingStores = config.cacheStores;
567
+ const firstStore = Array.isArray(existingStores) ? existingStores[0] : void 0;
568
+ const StoreClass = firstStore ? Object.getPrototypeOf(firstStore).constructor : import_metro_cache.FileStore;
566
569
  return {
567
570
  ...config,
568
- cacheStores: [new import_metro_cache.FileStore({ root: cacheRoot })]
571
+ cacheStores: [new StoreClass({ root: cacheRoot })]
569
572
  };
570
573
  }
571
574
 
package/dist/metro.mjs CHANGED
@@ -515,9 +515,12 @@ function withPersistentCache(config, options = {}) {
515
515
  const projectRoot = config.projectRoot ?? process.cwd();
516
516
  const { cacheDir = ".metro-cache" } = options;
517
517
  const cacheRoot = path14.join(projectRoot, cacheDir);
518
+ const existingStores = config.cacheStores;
519
+ const firstStore = Array.isArray(existingStores) ? existingStores[0] : void 0;
520
+ const StoreClass = firstStore ? Object.getPrototypeOf(firstStore).constructor : FileStore;
518
521
  return {
519
522
  ...config,
520
- cacheStores: [new FileStore({ root: cacheRoot })]
523
+ cacheStores: [new StoreClass({ root: cacheRoot })]
521
524
  };
522
525
  }
523
526
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "miaoda-expo-devkit",
3
- "version": "0.1.1-beta.63",
3
+ "version": "0.1.1-beta.64",
4
4
  "description": "Expo 应用开发工具集:Sentry DSN 替换 stub、错误/网络捕获、Metro 符号化",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.js",