@buoy-gg/assets 7.0.38 → 7.0.40

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.
Files changed (161) hide show
  1. package/lib/commonjs/capture/expo.js +46 -1
  2. package/lib/commonjs/capture/expo.js.map +1 -0
  3. package/lib/commonjs/capture/install.js +91 -1
  4. package/lib/commonjs/capture/install.js.map +1 -0
  5. package/lib/commonjs/capture/isBuoyAsset.js +23 -1
  6. package/lib/commonjs/capture/isBuoyAsset.js.map +1 -0
  7. package/lib/commonjs/capture/measure.js +186 -1
  8. package/lib/commonjs/capture/measure.js.map +1 -0
  9. package/lib/commonjs/capture/metroGraph.js +175 -1
  10. package/lib/commonjs/capture/metroGraph.js.map +1 -0
  11. package/lib/commonjs/capture/registry.js +127 -1
  12. package/lib/commonjs/capture/registry.js.map +1 -0
  13. package/lib/commonjs/components/AssetDetail.js +211 -1
  14. package/lib/commonjs/components/AssetDetail.js.map +1 -0
  15. package/lib/commonjs/components/AssetImage.js +66 -1
  16. package/lib/commonjs/components/AssetImage.js.map +1 -0
  17. package/lib/commonjs/components/AssetRow.js +232 -1
  18. package/lib/commonjs/components/AssetRow.js.map +1 -0
  19. package/lib/commonjs/components/AssetsFilterBar.js +105 -1
  20. package/lib/commonjs/components/AssetsFilterBar.js.map +1 -0
  21. package/lib/commonjs/components/AssetsHeader.js +73 -1
  22. package/lib/commonjs/components/AssetsHeader.js.map +1 -0
  23. package/lib/commonjs/components/AssetsIcon.js +19 -1
  24. package/lib/commonjs/components/AssetsIcon.js.map +1 -0
  25. package/lib/commonjs/components/AssetsListControls.js +81 -1
  26. package/lib/commonjs/components/AssetsListControls.js.map +1 -0
  27. package/lib/commonjs/components/AssetsModal.js +378 -1
  28. package/lib/commonjs/components/AssetsModal.js.map +1 -0
  29. package/lib/commonjs/components/ScanNotice.js +85 -1
  30. package/lib/commonjs/components/ScanNotice.js.map +1 -0
  31. package/lib/commonjs/components/optionalExpoImage.js +16 -1
  32. package/lib/commonjs/components/optionalExpoImage.js.map +1 -0
  33. package/lib/commonjs/components/optionalExpoImage.web.js +11 -1
  34. package/lib/commonjs/components/optionalExpoImage.web.js.map +1 -0
  35. package/lib/commonjs/export.js +62 -1
  36. package/lib/commonjs/export.js.map +1 -0
  37. package/lib/commonjs/format.js +59 -1
  38. package/lib/commonjs/format.js.map +1 -0
  39. package/lib/commonjs/hooks/useAssetRecords.js +22 -1
  40. package/lib/commonjs/hooks/useAssetRecords.js.map +1 -0
  41. package/lib/commonjs/hooks/useAssetScanStatus.js +28 -1
  42. package/lib/commonjs/hooks/useAssetScanStatus.js.map +1 -0
  43. package/lib/commonjs/index.js +313 -1
  44. package/lib/commonjs/index.js.map +1 -0
  45. package/lib/commonjs/preset.js +39 -1
  46. package/lib/commonjs/preset.js.map +1 -0
  47. package/lib/commonjs/remote.js +68 -1
  48. package/lib/commonjs/remote.js.map +1 -0
  49. package/lib/commonjs/state.js +51 -1
  50. package/lib/commonjs/state.js.map +1 -0
  51. package/lib/commonjs/store/assetStore.js +256 -1
  52. package/lib/commonjs/store/assetStore.js.map +1 -0
  53. package/lib/commonjs/store/baseline.js +175 -1
  54. package/lib/commonjs/store/baseline.js.map +1 -0
  55. package/lib/commonjs/store/insights.js +120 -1
  56. package/lib/commonjs/store/insights.js.map +1 -0
  57. package/lib/commonjs/sync/assetsSyncAdapter.js +157 -1
  58. package/lib/commonjs/sync/assetsSyncAdapter.js.map +1 -0
  59. package/lib/commonjs/types.js +2 -1
  60. package/lib/commonjs/types.js.map +1 -0
  61. package/lib/commonjs/utils/deviceScale.js +50 -1
  62. package/lib/commonjs/utils/deviceScale.js.map +1 -0
  63. package/lib/commonjs/utils/testIDs.js +110 -1
  64. package/lib/commonjs/utils/testIDs.js.map +1 -0
  65. package/lib/module/capture/expo.js +41 -1
  66. package/lib/module/capture/expo.js.map +1 -0
  67. package/lib/module/capture/install.js +85 -1
  68. package/lib/module/capture/install.js.map +1 -0
  69. package/lib/module/capture/isBuoyAsset.js +18 -1
  70. package/lib/module/capture/isBuoyAsset.js.map +1 -0
  71. package/lib/module/capture/measure.js +179 -1
  72. package/lib/module/capture/measure.js.map +1 -0
  73. package/lib/module/capture/metroGraph.js +168 -1
  74. package/lib/module/capture/metroGraph.js.map +1 -0
  75. package/lib/module/capture/registry.js +120 -1
  76. package/lib/module/capture/registry.js.map +1 -0
  77. package/lib/module/components/AssetDetail.js +207 -1
  78. package/lib/module/components/AssetDetail.js.map +1 -0
  79. package/lib/module/components/AssetImage.js +62 -1
  80. package/lib/module/components/AssetImage.js.map +1 -0
  81. package/lib/module/components/AssetRow.js +228 -1
  82. package/lib/module/components/AssetRow.js.map +1 -0
  83. package/lib/module/components/AssetsFilterBar.js +101 -1
  84. package/lib/module/components/AssetsFilterBar.js.map +1 -0
  85. package/lib/module/components/AssetsHeader.js +69 -1
  86. package/lib/module/components/AssetsHeader.js.map +1 -0
  87. package/lib/module/components/AssetsIcon.js +12 -1
  88. package/lib/module/components/AssetsIcon.js.map +1 -0
  89. package/lib/module/components/AssetsListControls.js +77 -1
  90. package/lib/module/components/AssetsListControls.js.map +1 -0
  91. package/lib/module/components/AssetsModal.js +373 -1
  92. package/lib/module/components/AssetsModal.js.map +1 -0
  93. package/lib/module/components/ScanNotice.js +81 -1
  94. package/lib/module/components/ScanNotice.js.map +1 -0
  95. package/lib/module/components/optionalExpoImage.js +12 -1
  96. package/lib/module/components/optionalExpoImage.js.map +1 -0
  97. package/lib/module/components/optionalExpoImage.web.js +7 -1
  98. package/lib/module/components/optionalExpoImage.web.js.map +1 -0
  99. package/lib/module/export.js +57 -1
  100. package/lib/module/export.js.map +1 -0
  101. package/lib/module/format.js +51 -1
  102. package/lib/module/format.js.map +1 -0
  103. package/lib/module/hooks/useAssetRecords.js +18 -1
  104. package/lib/module/hooks/useAssetRecords.js.map +1 -0
  105. package/lib/module/hooks/useAssetScanStatus.js +23 -1
  106. package/lib/module/hooks/useAssetScanStatus.js.map +1 -0
  107. package/lib/module/index.js +63 -1
  108. package/lib/module/index.js.map +1 -0
  109. package/lib/module/preset.js +35 -1
  110. package/lib/module/preset.js.map +1 -0
  111. package/lib/module/remote.js +61 -1
  112. package/lib/module/remote.js.map +1 -0
  113. package/lib/module/state.js +47 -1
  114. package/lib/module/state.js.map +1 -0
  115. package/lib/module/store/assetStore.js +240 -1
  116. package/lib/module/store/assetStore.js.map +1 -0
  117. package/lib/module/store/baseline.js +167 -1
  118. package/lib/module/store/baseline.js.map +1 -0
  119. package/lib/module/store/insights.js +116 -1
  120. package/lib/module/store/insights.js.map +1 -0
  121. package/lib/module/sync/assetsSyncAdapter.js +153 -1
  122. package/lib/module/sync/assetsSyncAdapter.js.map +1 -0
  123. package/lib/module/types.js +2 -1
  124. package/lib/module/types.js.map +1 -0
  125. package/lib/module/utils/deviceScale.js +46 -1
  126. package/lib/module/utils/deviceScale.js.map +1 -0
  127. package/lib/module/utils/testIDs.js +99 -1
  128. package/lib/module/utils/testIDs.js.map +1 -0
  129. package/lib/typescript/capture/expo.d.ts.map +1 -0
  130. package/lib/typescript/capture/install.d.ts.map +1 -0
  131. package/lib/typescript/capture/isBuoyAsset.d.ts.map +1 -0
  132. package/lib/typescript/capture/measure.d.ts.map +1 -0
  133. package/lib/typescript/capture/metroGraph.d.ts.map +1 -0
  134. package/lib/typescript/capture/registry.d.ts.map +1 -0
  135. package/lib/typescript/components/AssetDetail.d.ts.map +1 -0
  136. package/lib/typescript/components/AssetImage.d.ts.map +1 -0
  137. package/lib/typescript/components/AssetRow.d.ts.map +1 -0
  138. package/lib/typescript/components/AssetsFilterBar.d.ts.map +1 -0
  139. package/lib/typescript/components/AssetsHeader.d.ts.map +1 -0
  140. package/lib/typescript/components/AssetsIcon.d.ts.map +1 -0
  141. package/lib/typescript/components/AssetsListControls.d.ts.map +1 -0
  142. package/lib/typescript/components/AssetsModal.d.ts.map +1 -0
  143. package/lib/typescript/components/ScanNotice.d.ts.map +1 -0
  144. package/lib/typescript/components/optionalExpoImage.d.ts.map +1 -0
  145. package/lib/typescript/components/optionalExpoImage.web.d.ts.map +1 -0
  146. package/lib/typescript/export.d.ts.map +1 -0
  147. package/lib/typescript/format.d.ts.map +1 -0
  148. package/lib/typescript/hooks/useAssetRecords.d.ts.map +1 -0
  149. package/lib/typescript/hooks/useAssetScanStatus.d.ts.map +1 -0
  150. package/lib/typescript/index.d.ts.map +1 -0
  151. package/lib/typescript/preset.d.ts.map +1 -0
  152. package/lib/typescript/remote.d.ts.map +1 -0
  153. package/lib/typescript/state.d.ts.map +1 -0
  154. package/lib/typescript/store/assetStore.d.ts.map +1 -0
  155. package/lib/typescript/store/baseline.d.ts.map +1 -0
  156. package/lib/typescript/store/insights.d.ts.map +1 -0
  157. package/lib/typescript/sync/assetsSyncAdapter.d.ts.map +1 -0
  158. package/lib/typescript/types.d.ts.map +1 -0
  159. package/lib/typescript/utils/deviceScale.d.ts.map +1 -0
  160. package/lib/typescript/utils/testIDs.d.ts.map +1 -0
  161. package/package.json +2 -2
@@ -1 +1,46 @@
1
- "use strict";function expoModules(){return globalThis.expo?.modules}function getLoadedFontFamilies(){try{const e=expoModules()?.ExpoFontLoader?.getLoadedFonts?.();return Array.isArray(e)?[...new Set(e)].sort():[]}catch{return[]}}function getLocalAssets(){try{const e=expoModules()?.ExpoUpdates?.localAssets;return e&&"object"==typeof e&&Object.keys(e).length>0?e:null}catch{return null}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.getLoadedFontFamilies=getLoadedFontFamilies,exports.getLocalAssets=getLocalAssets;
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getLoadedFontFamilies = getLoadedFontFamilies;
7
+ exports.getLocalAssets = getLocalAssets;
8
+ /**
9
+ * Expo enrichment — all optional, all read through globalThis.expo guards so
10
+ * bare RN apps (no expo-modules) silently get none of it and no imports are
11
+ * added for anyone.
12
+ */
13
+
14
+ function expoModules() {
15
+ return globalThis.expo?.modules;
16
+ }
17
+
18
+ /**
19
+ * Every loaded font family — build-time embedded (config plugin / UIAppFonts /
20
+ * android assets/fonts) AND runtime Font.loadAsync, straight from the native
21
+ * module Expo documents as a stable global. [] when unavailable (bare RN).
22
+ */
23
+ function getLoadedFontFamilies() {
24
+ try {
25
+ const fonts = expoModules()?.ExpoFontLoader?.getLoadedFonts?.();
26
+ return Array.isArray(fonts) ? [...new Set(fonts)].sort() : [];
27
+ } catch {
28
+ return [];
29
+ }
30
+ }
31
+
32
+ /**
33
+ * expo-updates' per-file-hash → local URI map: the COMPLETE shipped asset set
34
+ * in Expo Go / OTA environments, independent of what JS has evaluated.
35
+ * null when not running in an updates-managed environment.
36
+ */
37
+ function getLocalAssets() {
38
+ try {
39
+ const map = expoModules()?.ExpoUpdates?.localAssets;
40
+ if (map && typeof map === "object" && Object.keys(map).length > 0) return map;
41
+ return null;
42
+ } catch {
43
+ return null;
44
+ }
45
+ }
46
+ //# sourceMappingURL=expo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["expoModules","globalThis","expo","modules","getLoadedFontFamilies","fonts","ExpoFontLoader","getLoadedFonts","Array","isArray","Set","sort","getLocalAssets","map","ExpoUpdates","localAssets","Object","keys","length"],"sourceRoot":"../../../src","sources":["capture/expo.ts"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;;AASA,SAASA,WAAWA,CAAA,EAA0B;EAC5C,OAAQC,UAAU,CAA2BC,IAAI,EAAEC,OAAO;AAC5D;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASC,qBAAqBA,CAAA,EAAa;EAChD,IAAI;IACF,MAAMC,KAAK,GAAGL,WAAW,CAAC,CAAC,EAAEM,cAAc,EAAEC,cAAc,GAAG,CAAC;IAC/D,OAAOC,KAAK,CAACC,OAAO,CAACJ,KAAK,CAAC,GAAG,CAAC,GAAG,IAAIK,GAAG,CAACL,KAAK,CAAC,CAAC,CAACM,IAAI,CAAC,CAAC,GAAG,EAAE;EAC/D,CAAC,CAAC,MAAM;IACN,OAAO,EAAE;EACX;AACF;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASC,cAAcA,CAAA,EAAkC;EAC9D,IAAI;IACF,MAAMC,GAAG,GAAGb,WAAW,CAAC,CAAC,EAAEc,WAAW,EAAEC,WAAW;IACnD,IAAIF,GAAG,IAAI,OAAOA,GAAG,KAAK,QAAQ,IAAIG,MAAM,CAACC,IAAI,CAACJ,GAAG,CAAC,CAACK,MAAM,GAAG,CAAC,EAAE,OAAOL,GAAG;IAC7E,OAAO,IAAI;EACb,CAAC,CAAC,MAAM;IACN,OAAO,IAAI;EACb;AACF","ignoreList":[]}
@@ -1 +1,91 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getScanStatus=getScanStatus,exports.installAssetCapture=installAssetCapture,exports.rescan=rescan;var _state=require("../state"),_assetStore=require("../store/assetStore"),_expo=require("./expo"),_measure=require("./measure"),_metroGraph=require("./metroGraph"),_registry=require("./registry");function installAssetCapture(){const t=(0,_state.assetsState)();t.captureDisabled||t.installed||(t.installed=!0,t.registryAvailable=null!=(0,_registry.getRegistryModule)(),t.patched=(0,_registry.patchRegisterAsset)(),(0,_registry.walkRegistry)(),refreshEnrichment(),t.lastScanAt=Date.now(),(0,_assetStore.invalidate)())}function refreshEnrichment(){const t=(0,_state.assetsState)();t.fontFamilies=(0,_expo.getLoadedFontFamilies)();const e=(0,_expo.getLocalAssets)();t.localAssetCount=e?Object.keys(e).length:null}async function rescan(){const t=(0,_state.assetsState)();if(t.captureDisabled)return getScanStatus();if(t.scanPromise)return t.scanPromise;t.scanPromise=runScan();try{return await t.scanPromise}finally{t.scanPromise=void 0}}async function runScan(){const t=(0,_state.assetsState)();return(0,_assetStore.removeBuoyRecords)(),installAssetCapture(),(0,_registry.walkRegistry)(),refreshEnrichment(),await(0,_metroGraph.fetchAssetGraph)(),t.lastScanAt=Date.now(),(0,_assetStore.invalidate)(),(0,_measure.measureSizes)(),getScanStatus()}function getScanStatus(){const t=(0,_state.assetsState)();if(t.mirrorScanStatus)return t.mirrorScanStatus;let e=0;for(const r of t.records)null!=r.registryId&&e++;return{registryAvailable:t.registryAvailable,patched:t.patched,registryCount:e,graphSupported:t.graphSupported||null!=(0,_metroGraph.getDevServerOrigin)(),graphCount:t.graphCount,graphError:t.graphError,graphFetchInFlight:t.graphFetchInFlight,graphFetchStartedAt:t.graphFetchStartedAt??null,lastScanAt:t.lastScanAt,measuring:t.measuring,measuredCount:t.measuredCount,fontFamilies:t.fontFamilies,localAssetCount:t.localAssetCount}}
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getScanStatus = getScanStatus;
7
+ exports.installAssetCapture = installAssetCapture;
8
+ exports.rescan = rescan;
9
+ var _state = require("../state");
10
+ var _assetStore = require("../store/assetStore");
11
+ var _expo = require("./expo");
12
+ var _measure = require("./measure");
13
+ var _metroGraph = require("./metroGraph");
14
+ var _registry = require("./registry");
15
+ /**
16
+ * Capture install + scan orchestration.
17
+ *
18
+ * installAssetCapture() is cheap and synchronous (registry walk + patch) and
19
+ * runs at package import. The expensive passes — Metro graph fetch and byte
20
+ * measurement — run in rescan(), triggered when the modal opens or via the
21
+ * `rescan` sync action, so merely installing Buoy never hits the network.
22
+ */
23
+
24
+ function installAssetCapture() {
25
+ const s = (0, _state.assetsState)();
26
+ if (s.captureDisabled || s.installed) return;
27
+ s.installed = true;
28
+ s.registryAvailable = (0, _registry.getRegistryModule)() != null;
29
+ s.patched = (0, _registry.patchRegisterAsset)();
30
+ (0, _registry.walkRegistry)();
31
+ refreshEnrichment();
32
+ s.lastScanAt = Date.now();
33
+ (0, _assetStore.invalidate)();
34
+ }
35
+ function refreshEnrichment() {
36
+ const s = (0, _state.assetsState)();
37
+ s.fontFamilies = (0, _expo.getLoadedFontFamilies)();
38
+ const localAssets = (0, _expo.getLocalAssets)();
39
+ s.localAssetCount = localAssets ? Object.keys(localAssets).length : null;
40
+ }
41
+
42
+ /**
43
+ * Full scan: registry re-walk (catches anything the patch missed), Metro
44
+ * graph merge (dev), Expo enrichment refresh, then size measurement.
45
+ */
46
+ async function rescan() {
47
+ const s = (0, _state.assetsState)();
48
+ if (s.captureDisabled) return getScanStatus();
49
+ if (s.scanPromise) return s.scanPromise;
50
+ s.scanPromise = runScan();
51
+ try {
52
+ return await s.scanPromise;
53
+ } finally {
54
+ s.scanPromise = undefined;
55
+ }
56
+ }
57
+ async function runScan() {
58
+ const s = (0, _state.assetsState)();
59
+ (0, _assetStore.removeBuoyRecords)();
60
+ installAssetCapture();
61
+ (0, _registry.walkRegistry)();
62
+ refreshEnrichment();
63
+ await (0, _metroGraph.fetchAssetGraph)();
64
+ s.lastScanAt = Date.now();
65
+ (0, _assetStore.invalidate)();
66
+ void (0, _measure.measureSizes)();
67
+ return getScanStatus();
68
+ }
69
+ function getScanStatus() {
70
+ const s = (0, _state.assetsState)();
71
+ // Mirrors report the synced DEVICE's status, not the dashboard's.
72
+ if (s.mirrorScanStatus) return s.mirrorScanStatus;
73
+ let registryCount = 0;
74
+ for (const record of s.records) if (record.registryId != null) registryCount++;
75
+ return {
76
+ registryAvailable: s.registryAvailable,
77
+ patched: s.patched,
78
+ registryCount,
79
+ graphSupported: s.graphSupported || (0, _metroGraph.getDevServerOrigin)() != null,
80
+ graphCount: s.graphCount,
81
+ graphError: s.graphError,
82
+ graphFetchInFlight: s.graphFetchInFlight,
83
+ graphFetchStartedAt: s.graphFetchStartedAt ?? null,
84
+ lastScanAt: s.lastScanAt,
85
+ measuring: s.measuring,
86
+ measuredCount: s.measuredCount,
87
+ fontFamilies: s.fontFamilies,
88
+ localAssetCount: s.localAssetCount
89
+ };
90
+ }
91
+ //# sourceMappingURL=install.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_state","require","_assetStore","_expo","_measure","_metroGraph","_registry","installAssetCapture","s","assetsState","captureDisabled","installed","registryAvailable","getRegistryModule","patched","patchRegisterAsset","walkRegistry","refreshEnrichment","lastScanAt","Date","now","invalidate","fontFamilies","getLoadedFontFamilies","localAssets","getLocalAssets","localAssetCount","Object","keys","length","rescan","getScanStatus","scanPromise","runScan","undefined","removeBuoyRecords","fetchAssetGraph","measureSizes","mirrorScanStatus","registryCount","record","records","registryId","graphSupported","getDevServerOrigin","graphCount","graphError","graphFetchInFlight","graphFetchStartedAt","measuring","measuredCount"],"sourceRoot":"../../../src","sources":["capture/install.ts"],"mappings":";;;;;;;;AASA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AAdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUO,SAASM,mBAAmBA,CAAA,EAAS;EAC1C,MAAMC,CAAC,GAAG,IAAAC,kBAAW,EAAC,CAAC;EACvB,IAAID,CAAC,CAACE,eAAe,IAAIF,CAAC,CAACG,SAAS,EAAE;EACtCH,CAAC,CAACG,SAAS,GAAG,IAAI;EAClBH,CAAC,CAACI,iBAAiB,GAAG,IAAAC,2BAAiB,EAAC,CAAC,IAAI,IAAI;EACjDL,CAAC,CAACM,OAAO,GAAG,IAAAC,4BAAkB,EAAC,CAAC;EAChC,IAAAC,sBAAY,EAAC,CAAC;EACdC,iBAAiB,CAAC,CAAC;EACnBT,CAAC,CAACU,UAAU,GAAGC,IAAI,CAACC,GAAG,CAAC,CAAC;EACzB,IAAAC,sBAAU,EAAC,CAAC;AACd;AAEA,SAASJ,iBAAiBA,CAAA,EAAS;EACjC,MAAMT,CAAC,GAAG,IAAAC,kBAAW,EAAC,CAAC;EACvBD,CAAC,CAACc,YAAY,GAAG,IAAAC,2BAAqB,EAAC,CAAC;EACxC,MAAMC,WAAW,GAAG,IAAAC,oBAAc,EAAC,CAAC;EACpCjB,CAAC,CAACkB,eAAe,GAAGF,WAAW,GAAGG,MAAM,CAACC,IAAI,CAACJ,WAAW,CAA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;IACtCE,OAAO,EAAEN,CAAC,CAACM,OAAO;IAClByB,aAAa;IACbI,cAAc,EAAEnC,CAAC,CAACmC,cAAc,IAAI,IAAAC,8BAAkB,EAAC,CAAC,IAAI,IAAI;IAChEC,UAAU,EAAErC,CAAC,CAACqC,UAAU;IACxBC,UAAU,EAAEtC,CAAC,CAACsC,UAAU;IACxBC,kBAAkB,EAAEvC,CAAC,CAACuC,kBAAkB;IACxCC,mBAAmB,EAAExC,CAAC,CAACwC,mBAAmB,IAAI,IAAI;IAClD9B,UAAU,EAAEV,CAAC,CAACU,UAAU;IACxB+B,SAAS,EAAEzC,CAAC,CAACyC,SAAS;IACtBC,aAAa,EAAE1C,CAAC,CAAC0C,aAAa;IAC9B5B,YAAY,EAAEd,CAAC,CAACc,YAAY;IAC5BI,eAAe,EAAElB,CAAC,CAACkB;EACrB,CAAC;AACH","ignoreList":[]}
@@ -1 +1,23 @@
1
- "use strict";function isBuoyAssetPath(e){if(!e)return!1;let s=e;try{s=decodeURIComponent(s)}catch{}return s=s.replace(/\\/g,"/"),/(?:^|\/)node_modules\/@buoy-gg\/[^/]+(?:\/|$)/.test(s)||/(?:^|\/)buoy-packages\/packages\/[^/]+(?:\/|$)/.test(s)||/(?:^|\/)packages\/floating-tools-core\/(?:src|lib\/(?:module|commonjs))\/icons\/assets(?:\/|$)/.test(s)}function isBuoyAsset(e){return[e.key,e.httpServerLocation,e.fileSystemLocation,...e.files??[]].some(isBuoyAssetPath)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.isBuoyAsset=isBuoyAsset,exports.isBuoyAssetPath=isBuoyAssetPath;
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isBuoyAsset = isBuoyAsset;
7
+ exports.isBuoyAssetPath = isBuoyAssetPath;
8
+ /** Identify Buoy-owned resources by package location, never by asset name. */
9
+ function isBuoyAssetPath(value) {
10
+ if (!value) return false;
11
+ let path = value;
12
+ try {
13
+ path = decodeURIComponent(path);
14
+ } catch {
15
+ // Keep readable path segments when an unrelated escape is malformed.
16
+ }
17
+ path = path.replace(/\\/g, "/");
18
+ return /(?:^|\/)node_modules\/@buoy-gg\/[^/]+(?:\/|$)/.test(path) || /(?:^|\/)buoy-packages\/packages\/[^/]+(?:\/|$)/.test(path) || /(?:^|\/)packages\/floating-tools-core\/(?:src|lib\/(?:module|commonjs))\/icons\/assets(?:\/|$)/.test(path);
19
+ }
20
+ function isBuoyAsset(asset) {
21
+ return [asset.key, asset.httpServerLocation, asset.fileSystemLocation, ...(asset.files ?? [])].some(isBuoyAssetPath);
22
+ }
23
+ //# sourceMappingURL=isBuoyAsset.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["isBuoyAssetPath","value","path","decodeURIComponent","replace","test","isBuoyAsset","asset","key","httpServerLocation","fileSystemLocation","files","some"],"sourceRoot":"../../../src","sources":["capture/isBuoyAsset.ts"],"mappings":";;;;;;;AAAA;AACO,SAASA,eAAeA,CAACC,KAAyB,EAAW;EAClE,IAAI,CAACA,KAAK,EAAE,OAAO,KAAK;EACxB,IAAIC,IAAI,GAAGD,KAAK;EAChB,IAAI;IACFC,IAAI,GAAGC,kBAAkB,CAACD,IAAI,CAAC;EACjC,CAAC,CAAC,MAAM;IACN;EAAA;EAEFA,IAAI,GAAGA,IAAI,CAACE,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;EAC/B,OAAO,+CAA+C,CAACC,IAAI,CAACH,IAAI,CAAC,IAC/D,gDAAgD,CAACG,IAAI,CAACH,IAAI,CAAC,IAC3D,gGAAgG,CAACG,IAAI,CAACH,IAAI,CAAC;AAC/G;AAEO,SAASI,WAAWA,CAACC,KAK3B,EAAW;EACV,OAAO,CAACA,KAAK,CAACC,GAAG,EAAED,KAAK,CAACE,kBAAkB,EAAEF,KAAK,CAACG,kBAAkB,EAAE,IAAIH,KAAK,CAACI,KAAK,IAAI,EAAE,CAAC,CAAC,CAC3FC,IAAI,CAACZ,eAAe,CAAC;AAC1B","ignoreList":[]}
@@ -1 +1,186 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.displaySource=displaySource,exports.measureSizes=measureSizes,exports.previewURL=previewURL,exports.variantURLs=variantURLs;var _state=require("../state"),_assetStore=require("../store/assetStore"),_metroGraph=require("./metroGraph");const CONCURRENCY=4;function previewURL(e){if(e.resolvedUri)return e.resolvedUri;const t=variantURLs(e);return t.length?t[0].url:null}function displaySource(e){const t=(0,_state.assetsState)().captureDisabled;if(!t&&null!=e.registryId)return e.registryId;const r=previewURL(e);return r?t&&!/^https?:\/\//.test(r)?null:{uri:r}:null}function variantURLs(e){const t=e.scales.length?e.scales:[1],r=e.resolvedUri;if(r&&/^https?:\/\//.test(r)&&null!=e.resolvedScale){const s=1===e.resolvedScale?"":`@${e.resolvedScale}x`,a=`${s}.${e.type}`;if(r.includes(a)||""===s)return t.map(t=>{const n=1===t?"":`@${t}x`;return{scale:t,url:(""===s?r.replace(`.${e.type}`,`${n}.${e.type}`):r.replace(a,`${n}.${e.type}`)).replace(/ /g,"%20")}})}const s=(0,_metroGraph.getDevServerOrigin)();return s&&e.httpServerLocation?t.map(t=>{const r=1===t?"":`@${t}x`,a=`${e.httpServerLocation}/${e.name}${r}.${e.type}`,n=a.includes("?")?"&":"?";return{scale:t,url:`${s}${a}${n}platform=${platformName()}${e.hash?`&hash=${e.hash}`:""}`.replace(/ /g,"%20")}}):[]}function platformName(){try{return require("react-native").Platform.OS}catch{return"ios"}}async function fetchSize(e){try{const t=await fetch(e,{method:"HEAD"});if(t.ok){const e=Number(t.headers.get("content-length"));if(Number.isFinite(e)&&e>0)return e}}catch{}try{const t=await fetch(e);if(!t.ok)return null;const r=await t.blob();return r.size>0?r.size:null}catch{return null}}async function measureRecord(e){const t=variantURLs(e);if(!t.length)return void(0,_assetStore.updateRecord)(e.id,{sizeSource:"estimate"});const r={};let s=0;for(const{scale:e,url:a}of t){const t=await fetchSize(a);null!=t&&(r[String(e)]=t,s+=t)}s>0?(0,_assetStore.updateRecord)(e.id,{sizesByScale:r,sizeBytes:s,sizeSource:"measured"}):(0,_assetStore.updateRecord)(e.id,{sizeSource:"estimate"})}async function measureSizes(){const e=(0,_state.assetsState)();if(e.measuring)return{measured:e.measuredCount,total:(0,_assetStore.getSnapshot)().length};const t=(0,_assetStore.getSnapshot)().filter(e=>"measured"!==e.sizeSource);e.measuring=!0,(0,_assetStore.invalidate)();try{let r=0;const s=async()=>{for(;;){const s=t[r++];if(!s)return;await measureRecord(s),e.measuredCount=(0,_assetStore.getSnapshot)().filter(e=>"measured"===e.sizeSource).length}};await Promise.all(Array.from({length:Math.min(CONCURRENCY,t.length)},s))}finally{e.measuring=!1,(0,_assetStore.invalidate)()}return{measured:e.measuredCount,total:(0,_assetStore.getSnapshot)().length}}
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.displaySource = displaySource;
7
+ exports.measureSizes = measureSizes;
8
+ exports.previewURL = previewURL;
9
+ exports.variantURLs = variantURLs;
10
+ var _state = require("../state");
11
+ var _assetStore = require("../store/assetStore");
12
+ var _metroGraph = require("./metroGraph");
13
+ /**
14
+ * Byte-size measurement.
15
+ *
16
+ * Dev only in practice: each scale variant is fetched from the Metro dev
17
+ * server (HEAD first for Content-Length, GET-blob fallback since Metro
18
+ * doesn't reliably answer HEAD) and the per-variant sizes are summed onto
19
+ * the record. Android release resource ids and iOS file:// URIs are not
20
+ * measurable from JS — those records keep `estDecodedBytes` as their only
21
+ * size signal and the UI marks them as estimates.
22
+ */
23
+
24
+ const CONCURRENCY = 4;
25
+
26
+ /**
27
+ * Best displayable URL for a record: the resolved runtime URI, or (dev) the
28
+ * same dev-server URL the measurement pass uses — this is what gives graph-
29
+ * only (never-loaded) images real thumbnails.
30
+ */
31
+ function previewURL(record) {
32
+ if (record.resolvedUri) return record.resolvedUri;
33
+ const variants = variantURLs(record);
34
+ return variants.length ? variants[0].url : null;
35
+ }
36
+
37
+ /**
38
+ * Image source for thumbnails/previews. On device the NUMERIC registry id is
39
+ * preferred (resolves natively — works for Android release resource ids too).
40
+ * On dashboard mirrors that id belongs to the DEVICE's registry and rn-web
41
+ * throws "asset with ID N could not be found" — use the device's http(s)
42
+ * URL instead (the Metro dev server is reachable from the desktop).
43
+ */
44
+ function displaySource(record) {
45
+ const mirror = (0, _state.assetsState)().captureDisabled;
46
+ if (!mirror && record.registryId != null) return record.registryId;
47
+ const uri = previewURL(record);
48
+ if (!uri) return null;
49
+ if (mirror && !/^https?:\/\//.test(uri)) return null;
50
+ return {
51
+ uri
52
+ };
53
+ }
54
+
55
+ /** All scale-variant URLs for a record, derived without re-encoding pitfalls. */
56
+ function variantURLs(record) {
57
+ const scales = record.scales.length ? record.scales : [1];
58
+
59
+ // Preferred: string surgery on the URL resolveAssetSource already proved
60
+ // works (handles Expo's ?unstable_path= form and monorepo rewrites).
61
+ const resolved = record.resolvedUri;
62
+ if (resolved && /^https?:\/\//.test(resolved) && record.resolvedScale != null) {
63
+ const pickedSuffix = record.resolvedScale === 1 ? "" : `@${record.resolvedScale}x`;
64
+ const marker = `${pickedSuffix}.${record.type}`;
65
+ if (resolved.includes(marker) || pickedSuffix === "") {
66
+ return scales.map(scale => {
67
+ const suffix = scale === 1 ? "" : `@${scale}x`;
68
+ const url = (pickedSuffix === "" ? resolved.replace(`.${record.type}`, `${suffix}.${record.type}`) : resolved.replace(marker, `${suffix}.${record.type}`)).replace(/ /g, "%20"); // RN's asset path builder doesn't encode spaces
69
+ return {
70
+ scale,
71
+ url
72
+ };
73
+ });
74
+ }
75
+ }
76
+
77
+ // Graph-only records: rebuild the dev-server URL the way Metro's
78
+ // AssetSourceResolver does (plain concatenation), encoding only spaces —
79
+ // full encodeURI would double-encode Expo's pre-escaped unstable_path.
80
+ const origin = (0, _metroGraph.getDevServerOrigin)();
81
+ if (!origin || !record.httpServerLocation) return [];
82
+ return scales.map(scale => {
83
+ const suffix = scale === 1 ? "" : `@${scale}x`;
84
+ const path = `${record.httpServerLocation}/${record.name}${suffix}.${record.type}`;
85
+ const sep = path.includes("?") ? "&" : "?";
86
+ const url = `${origin}${path}${sep}platform=${platformName()}${record.hash ? `&hash=${record.hash}` : ""}`.replace(/ /g, "%20");
87
+ return {
88
+ scale,
89
+ url
90
+ };
91
+ });
92
+ }
93
+ function platformName() {
94
+ try {
95
+ return require("react-native").Platform.OS;
96
+ } catch {
97
+ return "ios";
98
+ }
99
+ }
100
+ async function fetchSize(url) {
101
+ try {
102
+ const head = await fetch(url, {
103
+ method: "HEAD"
104
+ });
105
+ if (head.ok) {
106
+ const length = Number(head.headers.get("content-length"));
107
+ if (Number.isFinite(length) && length > 0) return length;
108
+ }
109
+ } catch {
110
+ // fall through to GET
111
+ }
112
+ try {
113
+ const response = await fetch(url);
114
+ if (!response.ok) return null;
115
+ const blob = await response.blob();
116
+ return blob.size > 0 ? blob.size : null;
117
+ } catch {
118
+ return null;
119
+ }
120
+ }
121
+ async function measureRecord(record) {
122
+ const variants = variantURLs(record);
123
+ if (!variants.length) {
124
+ (0, _assetStore.updateRecord)(record.id, {
125
+ sizeSource: "estimate"
126
+ });
127
+ return;
128
+ }
129
+ const sizesByScale = {};
130
+ let total = 0;
131
+ for (const {
132
+ scale,
133
+ url
134
+ } of variants) {
135
+ const size = await fetchSize(url);
136
+ if (size != null) {
137
+ sizesByScale[String(scale)] = size;
138
+ total += size;
139
+ }
140
+ }
141
+ if (total > 0) {
142
+ (0, _assetStore.updateRecord)(record.id, {
143
+ sizesByScale,
144
+ sizeBytes: total,
145
+ sizeSource: "measured"
146
+ });
147
+ } else {
148
+ (0, _assetStore.updateRecord)(record.id, {
149
+ sizeSource: "estimate"
150
+ });
151
+ }
152
+ }
153
+
154
+ /** Measure every unmeasured record; safe to re-run (skips measured ones). */
155
+ async function measureSizes() {
156
+ const s = (0, _state.assetsState)();
157
+ if (s.measuring) return {
158
+ measured: s.measuredCount,
159
+ total: (0, _assetStore.getSnapshot)().length
160
+ };
161
+ const pending = (0, _assetStore.getSnapshot)().filter(r => r.sizeSource !== "measured");
162
+ s.measuring = true;
163
+ (0, _assetStore.invalidate)();
164
+ try {
165
+ let index = 0;
166
+ const worker = async () => {
167
+ for (;;) {
168
+ const next = pending[index++];
169
+ if (!next) return;
170
+ await measureRecord(next);
171
+ s.measuredCount = (0, _assetStore.getSnapshot)().filter(r => r.sizeSource === "measured").length;
172
+ }
173
+ };
174
+ await Promise.all(Array.from({
175
+ length: Math.min(CONCURRENCY, pending.length)
176
+ }, worker));
177
+ } finally {
178
+ s.measuring = false;
179
+ (0, _assetStore.invalidate)();
180
+ }
181
+ return {
182
+ measured: s.measuredCount,
183
+ total: (0, _assetStore.getSnapshot)().length
184
+ };
185
+ }
186
+ //# sourceMappingURL=measure.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_state","require","_assetStore","_metroGraph","CONCURRENCY","previewURL","record","resolvedUri","variants","variantURLs","length","url","displaySource","mirror","assetsState","captureDisabled","registryId","uri","test","scales","resolved","resolvedScale","pickedSuffix","marker","type","includes","map","scale","suffix","replace","origin","getDevServerOrigin","httpServerLocation","path","name","sep","platformName","hash","Platform","OS","fetchSize","head","fetch","method","ok","Number","headers","get","isFinite","response","blob","size","measureRecord","updateRecord","id","sizeSource","sizesByScale","total","String","sizeBytes","measureSizes","s","measuring","measured","measuredCount","getSnapshot","pending","filter","r","invalidate","index","worker","next","Promise","all","Array","from","Math","min"],"sourceRoot":"../../../src","sources":["capture/measure.ts"],"mappings":";;;;;;;;;AAWA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAOA,MAAMG,WAAW,GAAG,CAAC;;AAErB;AACA;AACA;AACA;AACA;AACO,SAASC,UAAUA,CAACC,MAAmB,EAAiB;EAC7D,IAAIA,MAAM,CAACC,WAAW,EAAE,OAAOD,MAAM,CAACC,WAAW;EAC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AACoB,IAAI,CAAC;QACzBX,CAAC,CAACG,aAAa,GAAG,IAAAC,uBAAW,EAAC,CAAC,CAACE,MAAM,CACnCC,CAAC,IAAKA,CAAC,CAACb,UAAU,KAAK,UAC1B,CAAC,CAAC7C,MAAM;MACV;IACF,CAAC;IACD,MAAM+D,OAAO,CAACC,GAAG,CACfC,KAAK,CAACC,IAAI,CAAC;MAAElE,MAAM,EAAEmE,IAAI,CAACC,GAAG,CAAC1E,WAAW,EAAE8D,OAAO,CAACxD,MAAM;IAAE,CAAC,EAAE6D,MAAM,CACtE,CAAC;EACH,CAAC,SAAS;IACRV,CAAC,CAACC,SAAS,GAAG,KAAK;IACnB,IAAAO,sBAAU,EAAC,CAAC;EACd;EACA,OAAO;IACLN,QAAQ,EAAEF,CAAC,CAACG,aAAa;IACzBP,KAAK,EAAE,IAAAQ,uBAAW,EAAC,CAAC,CAACvD;EACvB,CAAC;AACH","ignoreList":[]}
@@ -1 +1,175 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.fetchAssetGraph=fetchAssetGraph,exports.getDevServerOrigin=getDevServerOrigin,exports.getGraphURLCandidates=getGraphURLCandidates,exports.getScriptURL=getScriptURL;var _state=require("../state"),_assetStore=require("../store/assetStore");const GRAPH_TIMEOUT_MS=9e4;async function fetchGraphPayload(e,t){const r=new AbortController;let a;try{return await Promise.race([(async()=>{const t=await fetch(e,{signal:r.signal});if(!t.ok)throw new Error(`Metro responded ${t.status} for ${e}`);return t.json()})(),new Promise((e,s)=>{a=setTimeout(()=>{s(new Error("Asset discovery timed out. Try again.")),r.abort()},Math.max(0,t))})])}finally{clearTimeout(a)}}function getScriptURL(){try{const{NativeModules:e}=require("react-native"),t=e?.SourceCode,r=t?.getConstants?.().scriptURL??t?.scriptURL;return"string"==typeof r?r:null}catch{return null}}function getDevServerOrigin(){const e=getScriptURL(),t=e?.match(/^https?:\/\/[^/]+/);return t?t[0]:null}function getGraphURLCandidates(){const e=getScriptURL();if(!e||!/^https?:\/\//.test(e))return[];const t=getDevServerOrigin(),r=e.indexOf("?"),a=r>=0?e.slice(r):"?platform=ios&dev=true",s=[];return e.includes(".bundle")&&s.push(e.replace(".bundle",".assets")),t&&s.push(`${t}/node_modules/expo-router/entry.assets${a}`,`${t}/node_modules/expo/AppEntry.assets${a}`,`${t}/index.assets${a}`),s}async function fetchAssetGraph(){const e=(0,_state.assetsState)(),t=getGraphURLCandidates();if(!t.length)return e.graphSupported=!1,e.graphError="No Metro dev server (embedded bundle)",(0,_assetStore.invalidate)(),{ok:!1,message:e.graphError};if(e.graphFetchInFlight)return{ok:!1,message:"Graph fetch already running"};e.graphFetchInFlight=!0,e.graphFetchStartedAt=Date.now(),e.graphError=null,(0,_assetStore.invalidate)();const r=e.graphFetchStartedAt+GRAPH_TIMEOUT_MS;try{let a=null,s="";for(const e of t)try{const t=await fetchGraphPayload(e,r-Date.now());if(Array.isArray(t)){a=t;break}s="Unexpected .assets payload shape"}catch(e){if(s=String(e?.message??e),Date.now()>=r)break}if(!Array.isArray(a))throw new Error(s||"No graph endpoint answered");const n=a;let o=0;for(const e of n)e&&"string"==typeof e.name&&"string"==typeof e.type&&(0,_assetStore.upsertRecord)({key:(0,_assetStore.assetKey)(e.httpServerLocation,e.name,e.type),name:e.name,type:e.type,origin:"graph",hash:e.hash,httpServerLocation:e.httpServerLocation,width:e.width??void 0,height:e.height??void 0,scales:e.scales,fileSystemLocation:e.fileSystemLocation,files:e.files,fileHashes:e.fileHashes})&&o++;return e.graphSupported=!0,e.graphCount=o,e.graphError=null,(0,_assetStore.invalidate)(),{ok:!0,count:o}}catch(t){return e.graphSupported=null!=getDevServerOrigin(),e.graphError=String(t?.message??t),(0,_assetStore.invalidate)(),{ok:!1,message:e.graphError}}finally{e.graphFetchInFlight=!1,e.graphFetchStartedAt=null,(0,_assetStore.invalidate)()}}
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.fetchAssetGraph = fetchAssetGraph;
7
+ exports.getDevServerOrigin = getDevServerOrigin;
8
+ exports.getGraphURLCandidates = getGraphURLCandidates;
9
+ exports.getScriptURL = getScriptURL;
10
+ var _state = require("../state");
11
+ var _assetStore = require("../store/assetStore");
12
+ /**
13
+ * Metro dev-server graph fetch.
14
+ *
15
+ * The dev server serves `<entry>.assets` next to `<entry>.bundle` — the full
16
+ * dependency graph's AssetData[], INCLUDING assets never required at runtime
17
+ * and the `fileSystemLocation`/`files` fields Metro strips from runtime
18
+ * records. Deriving the URL by swapping `.bundle` → `.assets` on the running
19
+ * bundle's scriptURL keeps the entry path and platform/dev query params
20
+ * intact for both RN CLI (index.bundle) and Expo (…/entry.bundle) layouts.
21
+ *
22
+ * Graph-only records (in the graph, not the registry) are exactly the
23
+ * "shipped but never loaded" set. Dev-only: no server, no graph.
24
+ */
25
+
26
+ const GRAPH_TIMEOUT_MS = 90_000;
27
+
28
+ /** Bound the whole discovery pass, including response body reads. */
29
+ async function fetchGraphPayload(url, remainingMs) {
30
+ const controller = new AbortController();
31
+ let timer;
32
+ try {
33
+ return await Promise.race([(async () => {
34
+ const response = await fetch(url, {
35
+ signal: controller.signal
36
+ });
37
+ if (!response.ok) throw new Error(`Metro responded ${response.status} for ${url}`);
38
+ return response.json();
39
+ })(), new Promise((_, reject) => {
40
+ timer = setTimeout(() => {
41
+ reject(new Error("Asset discovery timed out. Try again."));
42
+ controller.abort();
43
+ }, Math.max(0, remainingMs));
44
+ })]);
45
+ } finally {
46
+ clearTimeout(timer);
47
+ }
48
+ }
49
+ function getScriptURL() {
50
+ try {
51
+ const {
52
+ NativeModules
53
+ } = require("react-native");
54
+ const sourceCode = NativeModules?.SourceCode;
55
+ const url = sourceCode?.getConstants?.().scriptURL ?? sourceCode?.scriptURL;
56
+ return typeof url === "string" ? url : null;
57
+ } catch {
58
+ return null;
59
+ }
60
+ }
61
+
62
+ /** http(s) origin of the Metro dev server, or null when running embedded. */
63
+ function getDevServerOrigin() {
64
+ const scriptURL = getScriptURL();
65
+ const match = scriptURL?.match(/^https?:\/\/[^/]+/);
66
+ return match ? match[0] : null;
67
+ }
68
+
69
+ /**
70
+ * Candidate graph URLs, most-likely first. The straight `.bundle`→`.assets`
71
+ * swap works for RN CLI, but Expo dev builds serve a VIRTUAL entry
72
+ * (.expo/.virtual-metro-entry.bundle) that only exists for .bundle requests —
73
+ * its .assets twin 404s — so the real entry modules are tried next, keeping
74
+ * the original query string (platform/dev/etc.) intact.
75
+ */
76
+ function getGraphURLCandidates() {
77
+ const scriptURL = getScriptURL();
78
+ if (!scriptURL || !/^https?:\/\//.test(scriptURL)) return [];
79
+ const origin = getDevServerOrigin();
80
+ const queryIndex = scriptURL.indexOf("?");
81
+ const query = queryIndex >= 0 ? scriptURL.slice(queryIndex) : "?platform=ios&dev=true";
82
+ const candidates = [];
83
+ if (scriptURL.includes(".bundle")) {
84
+ candidates.push(scriptURL.replace(".bundle", ".assets"));
85
+ }
86
+ if (origin) {
87
+ candidates.push(`${origin}/node_modules/expo-router/entry.assets${query}`, `${origin}/node_modules/expo/AppEntry.assets${query}`, `${origin}/index.assets${query}`);
88
+ }
89
+ return candidates;
90
+ }
91
+
92
+ /** Fetch the full asset graph from the dev server and merge it into the store. */
93
+ async function fetchAssetGraph() {
94
+ const s = (0, _state.assetsState)();
95
+ const candidates = getGraphURLCandidates();
96
+ if (!candidates.length) {
97
+ s.graphSupported = false;
98
+ s.graphError = "No Metro dev server (embedded bundle)";
99
+ (0, _assetStore.invalidate)();
100
+ return {
101
+ ok: false,
102
+ message: s.graphError
103
+ };
104
+ }
105
+ if (s.graphFetchInFlight) return {
106
+ ok: false,
107
+ message: "Graph fetch already running"
108
+ };
109
+ s.graphFetchInFlight = true;
110
+ s.graphFetchStartedAt = Date.now();
111
+ s.graphError = null;
112
+ (0, _assetStore.invalidate)();
113
+ const deadline = s.graphFetchStartedAt + GRAPH_TIMEOUT_MS;
114
+ try {
115
+ let data = null;
116
+ let lastError = "";
117
+ for (const url of candidates) {
118
+ try {
119
+ const parsed = await fetchGraphPayload(url, deadline - Date.now());
120
+ if (Array.isArray(parsed)) {
121
+ data = parsed;
122
+ break;
123
+ }
124
+ lastError = "Unexpected .assets payload shape";
125
+ } catch (error) {
126
+ lastError = String(error?.message ?? error);
127
+ if (Date.now() >= deadline) break;
128
+ }
129
+ }
130
+ if (!Array.isArray(data)) throw new Error(lastError || "No graph endpoint answered");
131
+ const graph = data;
132
+ let count = 0;
133
+ for (const asset of graph) {
134
+ if (!asset || typeof asset.name !== "string" || typeof asset.type !== "string") {
135
+ continue;
136
+ }
137
+ const record = (0, _assetStore.upsertRecord)({
138
+ key: (0, _assetStore.assetKey)(asset.httpServerLocation, asset.name, asset.type),
139
+ name: asset.name,
140
+ type: asset.type,
141
+ origin: "graph",
142
+ hash: asset.hash,
143
+ httpServerLocation: asset.httpServerLocation,
144
+ width: asset.width ?? undefined,
145
+ height: asset.height ?? undefined,
146
+ scales: asset.scales,
147
+ fileSystemLocation: asset.fileSystemLocation,
148
+ files: asset.files,
149
+ fileHashes: asset.fileHashes
150
+ });
151
+ if (record) count++;
152
+ }
153
+ s.graphSupported = true;
154
+ s.graphCount = count;
155
+ s.graphError = null;
156
+ (0, _assetStore.invalidate)();
157
+ return {
158
+ ok: true,
159
+ count
160
+ };
161
+ } catch (error) {
162
+ s.graphSupported = getDevServerOrigin() != null;
163
+ s.graphError = String(error?.message ?? error);
164
+ (0, _assetStore.invalidate)();
165
+ return {
166
+ ok: false,
167
+ message: s.graphError
168
+ };
169
+ } finally {
170
+ s.graphFetchInFlight = false;
171
+ s.graphFetchStartedAt = null;
172
+ (0, _assetStore.invalidate)();
173
+ }
174
+ }
175
+ //# sourceMappingURL=metroGraph.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_state","require","_assetStore","GRAPH_TIMEOUT_MS","fetchGraphPayload","url","remainingMs","controller","AbortController","timer","Promise","race","response","fetch","signal","ok","Error","status","json","_","reject","setTimeout","abort","Math","max","clearTimeout","getScriptURL","NativeModules","sourceCode","SourceCode","getConstants","scriptURL","getDevServerOrigin","match","getGraphURLCandidates","test","origin","queryIndex","indexOf","query","slice","candidates","includes","push","replace","fetchAssetGraph","s","assetsState","length","graphSupported","graphError","invalidate","message","graphFetchInFlight","graphFetchStartedAt","Date","now","deadline","data","lastError","parsed","Array","isArray","error","String","graph","count","asset","name","type","record","upsertRecord","key","assetKey","httpServerLocation","hash","width","undefined","height","scales","fileSystemLocation","files","fileHashes","graphCount"],"sourceRoot":"../../../src","sources":["capture/metroGraph.ts"],"mappings":";;;;;;;;;AAcA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA,MAAME,gBAAgB,GAAG,MAAM;;AAE/B;AACA,eAAeC,iBAAiBA,CAACC,GAAW,EAAEC,WAAmB,EAAoB;EACnF,MAAMC,UAAU,GAAG,IAAIC,eAAe,CAAC,CAAC;EACxC,IAAIC,KAAgD;EACpD,IAAI;IACF,OAAO,MAAMC,OAAO,CAACC,IAAI,CAAC,CACxB,CAAC,YAAY;MACX,MAAMC,QAAQ,GAAG,MAAMC,KAAK,CAACR,GAAG,EAAE;QAAES,MAAM,EAAEP,UAAU,CAACO;MAAO,CAAC,CAAC;MAChE,IAAI,CAACF,QAAQ,CAACG,EAAE,EAAE,MAAM,IAAIC,KAAK,CAAC,mBAAmBJ,QAAQ,CAACK,MAAM,QAAQZ,GAAG,EAAE,CAAC;MAClF,OAAOO,QAAQ,CAACM,IAAI,CAAC,CAAC;IACxB,CAAC,EAAE,CAAC,EACJ,IAAIR,OAAO,CAAQ,CAACS,CAAC,EAAEC,MAAM,KAAK;MAChCX,KAAK,GAAGY,UAAU,CAAC,MAAM;QACvBD,MAAM,CAAC,IAAIJ,KAAK,CAAC,uCAAuC,CAAC,CAAC;QAC1DT,UAAU,CAACe,KAAK,CAAC,CAAC;MACpB,CAAC,EAAEC,IAAI,CAAC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