miaoda-expo-devkit 0.1.1-beta.70 → 0.1.1-beta.72

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
@@ -448,11 +448,23 @@ declare function withWasmSupport(config: MetroConfig): MetroConfig;
448
448
  declare function withTransformLogger(config: MetroConfig): MetroConfig;
449
449
 
450
450
  /**
451
- * withPersistentCache — 将 Metro transform cache 固定到可持久化目录
451
+ * withPersistentCache — 将 Metro transform cache 和 FileMap cache 固定到可持久化目录
452
452
  *
453
- * Metro 默认将 transform cache 写入系统临时目录(os.tmpdir()/metro-cache),
454
- * 系统随时可以清理,导致每次重启都是冷启动。
455
- * 此 wrapper 将 cacheStores 替换为指定目录,持久保留。
453
+ * Metro 默认将两套缓存写入系统临时目录(os.tmpdir()),系统随时可以清理,
454
+ * 导致每次重启都是冷启动。此 wrapper 将它们统一固定到同一个持久化目录。
455
+ *
456
+ * 【两套缓存的作用】
457
+ * transform cache(cacheStores)
458
+ * — JS/TS 编译结果,命中后跳过 Babel transform,节省 bundling 时间。
459
+ * FileMap cache(fileMapCacheDirectory)
460
+ * — 文件系统索引快照 + Watchman clock。命中后:
461
+ * · 有 Watchman:Metro 发 since=<clock> 增量查询,只拿变化文件,O(changes)。
462
+ * · 无 Watchman:跳过 mtime 未变文件的重新处理,减少 hash/resolve 工作量。
463
+ * 两种情况都能显著加快 Metro 冷启动速度。
464
+ *
465
+ * 【autoSaveCache】
466
+ * 运行时每隔 debounceMs(默认 5s)将 FileMap cache 写回磁盘,保证进程意外退出
467
+ * 后下次启动仍能命中缓存(默认只在正常关闭时写入)。
456
468
  *
457
469
  * 缓存路径解析优先级(高到低):
458
470
  * 1. 环境变量 METRO_CACHE_DIR(绝对路径,适用于容器/CI 挂载外部持久目录)
@@ -466,7 +478,7 @@ declare function withTransformLogger(config: MetroConfig): MetroConfig;
466
478
  * {
467
479
  * "type": "CACHE_CONFIG",
468
480
  * "cache_root": "/workspace/.metro-cache",
469
- * "store_class": "ExpoFileStore", // 生效的 store 类名
481
+ * "store_class": "ExpoFileStore",
470
482
  * "source": "env" | "option" | "default",
471
483
  * "t": 1234567890
472
484
  * }
package/dist/metro.d.ts CHANGED
@@ -448,11 +448,23 @@ declare function withWasmSupport(config: MetroConfig): MetroConfig;
448
448
  declare function withTransformLogger(config: MetroConfig): MetroConfig;
449
449
 
450
450
  /**
451
- * withPersistentCache — 将 Metro transform cache 固定到可持久化目录
451
+ * withPersistentCache — 将 Metro transform cache 和 FileMap cache 固定到可持久化目录
452
452
  *
453
- * Metro 默认将 transform cache 写入系统临时目录(os.tmpdir()/metro-cache),
454
- * 系统随时可以清理,导致每次重启都是冷启动。
455
- * 此 wrapper 将 cacheStores 替换为指定目录,持久保留。
453
+ * Metro 默认将两套缓存写入系统临时目录(os.tmpdir()),系统随时可以清理,
454
+ * 导致每次重启都是冷启动。此 wrapper 将它们统一固定到同一个持久化目录。
455
+ *
456
+ * 【两套缓存的作用】
457
+ * transform cache(cacheStores)
458
+ * — JS/TS 编译结果,命中后跳过 Babel transform,节省 bundling 时间。
459
+ * FileMap cache(fileMapCacheDirectory)
460
+ * — 文件系统索引快照 + Watchman clock。命中后:
461
+ * · 有 Watchman:Metro 发 since=<clock> 增量查询,只拿变化文件,O(changes)。
462
+ * · 无 Watchman:跳过 mtime 未变文件的重新处理,减少 hash/resolve 工作量。
463
+ * 两种情况都能显著加快 Metro 冷启动速度。
464
+ *
465
+ * 【autoSaveCache】
466
+ * 运行时每隔 debounceMs(默认 5s)将 FileMap cache 写回磁盘,保证进程意外退出
467
+ * 后下次启动仍能命中缓存(默认只在正常关闭时写入)。
456
468
  *
457
469
  * 缓存路径解析优先级(高到低):
458
470
  * 1. 环境变量 METRO_CACHE_DIR(绝对路径,适用于容器/CI 挂载外部持久目录)
@@ -466,7 +478,7 @@ declare function withTransformLogger(config: MetroConfig): MetroConfig;
466
478
  * {
467
479
  * "type": "CACHE_CONFIG",
468
480
  * "cache_root": "/workspace/.metro-cache",
469
- * "store_class": "ExpoFileStore", // 生效的 store 类名
481
+ * "store_class": "ExpoFileStore",
470
482
  * "source": "env" | "option" | "default",
471
483
  * "t": 1234567890
472
484
  * }
package/dist/metro.js CHANGED
@@ -615,7 +615,17 @@ function withPersistentCache(config, options = {}) {
615
615
  }
616
616
  return {
617
617
  ...config,
618
- cacheStores: [new StoreClass({ root: cacheRoot })]
618
+ // transform cache:JS/TS 编译结果
619
+ cacheStores: [new StoreClass({ root: cacheRoot })],
620
+ // FileMap cache:文件系统索引快照 + Watchman clock
621
+ // 与 transform cache 放同一目录,文件名由 Metro 按 projectRoot+config hash 自动区分
622
+ fileMapCacheDirectory: cacheRoot,
623
+ watcher: {
624
+ ...config.watcher,
625
+ // 运行时文件变化后自动将 FileMap cache 写回磁盘(debounce 5s)
626
+ // 保证进程意外退出后下次启动仍能命中缓存
627
+ unstable_autoSaveCache: { enabled: true }
628
+ }
619
629
  };
620
630
  }
621
631
 
package/dist/metro.mjs CHANGED
@@ -566,7 +566,17 @@ function withPersistentCache(config, options = {}) {
566
566
  }
567
567
  return {
568
568
  ...config,
569
- cacheStores: [new StoreClass({ root: cacheRoot })]
569
+ // transform cache:JS/TS 编译结果
570
+ cacheStores: [new StoreClass({ root: cacheRoot })],
571
+ // FileMap cache:文件系统索引快照 + Watchman clock
572
+ // 与 transform cache 放同一目录,文件名由 Metro 按 projectRoot+config hash 自动区分
573
+ fileMapCacheDirectory: cacheRoot,
574
+ watcher: {
575
+ ...config.watcher,
576
+ // 运行时文件变化后自动将 FileMap cache 写回磁盘(debounce 5s)
577
+ // 保证进程意外退出后下次启动仍能命中缓存
578
+ unstable_autoSaveCache: { enabled: true }
579
+ }
570
580
  };
571
581
  }
572
582
 
@@ -126,7 +126,8 @@ var PACKAGES_WITHOUT_CONFIG_PLUGIN = /* @__PURE__ */ new Set([
126
126
  "expo-store-review",
127
127
  "expo-symbols",
128
128
  "expo-ui",
129
- "expo-video-thumbnails"
129
+ "expo-video-thumbnails",
130
+ "react-native-webview"
130
131
  ]);
131
132
  var pluginsCache = /* @__PURE__ */ new Map();
132
133
  var depsCache = /* @__PURE__ */ new Map();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "miaoda-expo-devkit",
3
- "version": "0.1.1-beta.70",
3
+ "version": "0.1.1-beta.72",
4
4
  "description": "Expo 应用开发工具集:Sentry DSN 替换 stub、错误/网络捕获、Metro 符号化",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.js",