@buoy-gg/assets 7.0.16

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 (179) hide show
  1. package/LICENSE +58 -0
  2. package/README.md +55 -0
  3. package/lib/commonjs/capture/expo.js +46 -0
  4. package/lib/commonjs/capture/expo.js.map +1 -0
  5. package/lib/commonjs/capture/install.js +78 -0
  6. package/lib/commonjs/capture/install.js.map +1 -0
  7. package/lib/commonjs/capture/measure.js +186 -0
  8. package/lib/commonjs/capture/measure.js.map +1 -0
  9. package/lib/commonjs/capture/metroGraph.js +148 -0
  10. package/lib/commonjs/capture/metroGraph.js.map +1 -0
  11. package/lib/commonjs/capture/registry.js +124 -0
  12. package/lib/commonjs/capture/registry.js.map +1 -0
  13. package/lib/commonjs/components/AssetDetail.js +205 -0
  14. package/lib/commonjs/components/AssetDetail.js.map +1 -0
  15. package/lib/commonjs/components/AssetRow.js +246 -0
  16. package/lib/commonjs/components/AssetRow.js.map +1 -0
  17. package/lib/commonjs/components/AssetsFilterBar.js +92 -0
  18. package/lib/commonjs/components/AssetsFilterBar.js.map +1 -0
  19. package/lib/commonjs/components/AssetsHeader.js +66 -0
  20. package/lib/commonjs/components/AssetsHeader.js.map +1 -0
  21. package/lib/commonjs/components/AssetsIcon.js +19 -0
  22. package/lib/commonjs/components/AssetsIcon.js.map +1 -0
  23. package/lib/commonjs/components/AssetsListControls.js +94 -0
  24. package/lib/commonjs/components/AssetsListControls.js.map +1 -0
  25. package/lib/commonjs/components/AssetsModal.js +338 -0
  26. package/lib/commonjs/components/AssetsModal.js.map +1 -0
  27. package/lib/commonjs/components/BaselineBar.js +110 -0
  28. package/lib/commonjs/components/BaselineBar.js.map +1 -0
  29. package/lib/commonjs/export.js +62 -0
  30. package/lib/commonjs/export.js.map +1 -0
  31. package/lib/commonjs/format.js +59 -0
  32. package/lib/commonjs/format.js.map +1 -0
  33. package/lib/commonjs/hooks/useAssetRecords.js +22 -0
  34. package/lib/commonjs/hooks/useAssetRecords.js.map +1 -0
  35. package/lib/commonjs/index.js +260 -0
  36. package/lib/commonjs/index.js.map +1 -0
  37. package/lib/commonjs/package.json +1 -0
  38. package/lib/commonjs/preset.js +45 -0
  39. package/lib/commonjs/preset.js.map +1 -0
  40. package/lib/commonjs/remote.js +65 -0
  41. package/lib/commonjs/remote.js.map +1 -0
  42. package/lib/commonjs/state.js +51 -0
  43. package/lib/commonjs/state.js.map +1 -0
  44. package/lib/commonjs/store/assetStore.js +234 -0
  45. package/lib/commonjs/store/assetStore.js.map +1 -0
  46. package/lib/commonjs/store/baseline.js +165 -0
  47. package/lib/commonjs/store/baseline.js.map +1 -0
  48. package/lib/commonjs/store/insights.js +129 -0
  49. package/lib/commonjs/store/insights.js.map +1 -0
  50. package/lib/commonjs/sync/assetsSyncAdapter.js +157 -0
  51. package/lib/commonjs/sync/assetsSyncAdapter.js.map +1 -0
  52. package/lib/commonjs/types.js +2 -0
  53. package/lib/commonjs/types.js.map +1 -0
  54. package/lib/module/capture/expo.js +41 -0
  55. package/lib/module/capture/expo.js.map +1 -0
  56. package/lib/module/capture/install.js +72 -0
  57. package/lib/module/capture/install.js.map +1 -0
  58. package/lib/module/capture/measure.js +179 -0
  59. package/lib/module/capture/measure.js.map +1 -0
  60. package/lib/module/capture/metroGraph.js +141 -0
  61. package/lib/module/capture/metroGraph.js.map +1 -0
  62. package/lib/module/capture/registry.js +117 -0
  63. package/lib/module/capture/registry.js.map +1 -0
  64. package/lib/module/components/AssetDetail.js +201 -0
  65. package/lib/module/components/AssetDetail.js.map +1 -0
  66. package/lib/module/components/AssetRow.js +242 -0
  67. package/lib/module/components/AssetRow.js.map +1 -0
  68. package/lib/module/components/AssetsFilterBar.js +88 -0
  69. package/lib/module/components/AssetsFilterBar.js.map +1 -0
  70. package/lib/module/components/AssetsHeader.js +62 -0
  71. package/lib/module/components/AssetsHeader.js.map +1 -0
  72. package/lib/module/components/AssetsIcon.js +12 -0
  73. package/lib/module/components/AssetsIcon.js.map +1 -0
  74. package/lib/module/components/AssetsListControls.js +90 -0
  75. package/lib/module/components/AssetsListControls.js.map +1 -0
  76. package/lib/module/components/AssetsModal.js +333 -0
  77. package/lib/module/components/AssetsModal.js.map +1 -0
  78. package/lib/module/components/BaselineBar.js +106 -0
  79. package/lib/module/components/BaselineBar.js.map +1 -0
  80. package/lib/module/export.js +57 -0
  81. package/lib/module/export.js.map +1 -0
  82. package/lib/module/format.js +51 -0
  83. package/lib/module/format.js.map +1 -0
  84. package/lib/module/hooks/useAssetRecords.js +18 -0
  85. package/lib/module/hooks/useAssetRecords.js.map +1 -0
  86. package/lib/module/index.js +59 -0
  87. package/lib/module/index.js.map +1 -0
  88. package/lib/module/preset.js +40 -0
  89. package/lib/module/preset.js.map +1 -0
  90. package/lib/module/remote.js +58 -0
  91. package/lib/module/remote.js.map +1 -0
  92. package/lib/module/state.js +47 -0
  93. package/lib/module/state.js.map +1 -0
  94. package/lib/module/store/assetStore.js +219 -0
  95. package/lib/module/store/assetStore.js.map +1 -0
  96. package/lib/module/store/baseline.js +157 -0
  97. package/lib/module/store/baseline.js.map +1 -0
  98. package/lib/module/store/insights.js +125 -0
  99. package/lib/module/store/insights.js.map +1 -0
  100. package/lib/module/sync/assetsSyncAdapter.js +153 -0
  101. package/lib/module/sync/assetsSyncAdapter.js.map +1 -0
  102. package/lib/module/types.js +2 -0
  103. package/lib/module/types.js.map +1 -0
  104. package/lib/typescript/capture/expo.d.ts +18 -0
  105. package/lib/typescript/capture/expo.d.ts.map +1 -0
  106. package/lib/typescript/capture/install.d.ts +17 -0
  107. package/lib/typescript/capture/install.d.ts.map +1 -0
  108. package/lib/typescript/capture/measure.d.ts +38 -0
  109. package/lib/typescript/capture/measure.d.ts.map +1 -0
  110. package/lib/typescript/capture/metroGraph.d.ts +33 -0
  111. package/lib/typescript/capture/metroGraph.d.ts.map +1 -0
  112. package/lib/typescript/capture/registry.d.ts +45 -0
  113. package/lib/typescript/capture/registry.d.ts.map +1 -0
  114. package/lib/typescript/components/AssetDetail.d.ts +17 -0
  115. package/lib/typescript/components/AssetDetail.d.ts.map +1 -0
  116. package/lib/typescript/components/AssetRow.d.ts +32 -0
  117. package/lib/typescript/components/AssetRow.d.ts.map +1 -0
  118. package/lib/typescript/components/AssetsFilterBar.d.ts +16 -0
  119. package/lib/typescript/components/AssetsFilterBar.d.ts.map +1 -0
  120. package/lib/typescript/components/AssetsHeader.d.ts +22 -0
  121. package/lib/typescript/components/AssetsHeader.d.ts.map +1 -0
  122. package/lib/typescript/components/AssetsIcon.d.ts +9 -0
  123. package/lib/typescript/components/AssetsIcon.d.ts.map +1 -0
  124. package/lib/typescript/components/AssetsListControls.d.ts +18 -0
  125. package/lib/typescript/components/AssetsListControls.d.ts.map +1 -0
  126. package/lib/typescript/components/AssetsModal.d.ts +24 -0
  127. package/lib/typescript/components/AssetsModal.d.ts.map +1 -0
  128. package/lib/typescript/components/BaselineBar.d.ts +13 -0
  129. package/lib/typescript/components/BaselineBar.d.ts.map +1 -0
  130. package/lib/typescript/export.d.ts +8 -0
  131. package/lib/typescript/export.d.ts.map +1 -0
  132. package/lib/typescript/format.d.ts +13 -0
  133. package/lib/typescript/format.d.ts.map +1 -0
  134. package/lib/typescript/hooks/useAssetRecords.d.ts +11 -0
  135. package/lib/typescript/hooks/useAssetRecords.d.ts.map +1 -0
  136. package/lib/typescript/index.d.ts +26 -0
  137. package/lib/typescript/index.d.ts.map +1 -0
  138. package/lib/typescript/preset.d.ts +38 -0
  139. package/lib/typescript/preset.d.ts.map +1 -0
  140. package/lib/typescript/remote.d.ts +17 -0
  141. package/lib/typescript/remote.d.ts.map +1 -0
  142. package/lib/typescript/state.d.ts +41 -0
  143. package/lib/typescript/state.d.ts.map +1 -0
  144. package/lib/typescript/store/assetStore.d.ts +51 -0
  145. package/lib/typescript/store/assetStore.d.ts.map +1 -0
  146. package/lib/typescript/store/baseline.d.ts +22 -0
  147. package/lib/typescript/store/baseline.d.ts.map +1 -0
  148. package/lib/typescript/store/insights.d.ts +7 -0
  149. package/lib/typescript/store/insights.d.ts.map +1 -0
  150. package/lib/typescript/sync/assetsSyncAdapter.d.ts +83 -0
  151. package/lib/typescript/sync/assetsSyncAdapter.d.ts.map +1 -0
  152. package/lib/typescript/types.d.ts +162 -0
  153. package/lib/typescript/types.d.ts.map +1 -0
  154. package/package.json +77 -0
  155. package/src/capture/expo.ts +45 -0
  156. package/src/capture/install.ts +73 -0
  157. package/src/capture/measure.ts +167 -0
  158. package/src/capture/metroGraph.ts +146 -0
  159. package/src/capture/registry.ts +134 -0
  160. package/src/components/AssetDetail.tsx +207 -0
  161. package/src/components/AssetRow.tsx +243 -0
  162. package/src/components/AssetsFilterBar.tsx +99 -0
  163. package/src/components/AssetsHeader.tsx +75 -0
  164. package/src/components/AssetsIcon.tsx +9 -0
  165. package/src/components/AssetsListControls.tsx +101 -0
  166. package/src/components/AssetsModal.tsx +368 -0
  167. package/src/components/BaselineBar.tsx +98 -0
  168. package/src/export.ts +108 -0
  169. package/src/format.ts +53 -0
  170. package/src/hooks/useAssetRecords.ts +26 -0
  171. package/src/index.tsx +87 -0
  172. package/src/preset.tsx +35 -0
  173. package/src/remote.ts +65 -0
  174. package/src/state.ts +84 -0
  175. package/src/store/assetStore.ts +209 -0
  176. package/src/store/baseline.ts +152 -0
  177. package/src/store/insights.ts +145 -0
  178. package/src/sync/assetsSyncAdapter.ts +151 -0
  179. package/src/types.ts +160 -0
@@ -0,0 +1,141 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * Metro dev-server graph fetch.
5
+ *
6
+ * The dev server serves `<entry>.assets` next to `<entry>.bundle` — the full
7
+ * dependency graph's AssetData[], INCLUDING assets never required at runtime
8
+ * and the `fileSystemLocation`/`files` fields Metro strips from runtime
9
+ * records. Deriving the URL by swapping `.bundle` → `.assets` on the running
10
+ * bundle's scriptURL keeps the entry path and platform/dev query params
11
+ * intact for both RN CLI (index.bundle) and Expo (…/entry.bundle) layouts.
12
+ *
13
+ * Graph-only records (in the graph, not the registry) are exactly the
14
+ * "shipped but never loaded" set. Dev-only: no server, no graph.
15
+ */
16
+
17
+ import { assetsState } from "../state";
18
+ import { assetKey, invalidate, upsertRecord } from "../store/assetStore";
19
+ export function getScriptURL() {
20
+ try {
21
+ const {
22
+ NativeModules
23
+ } = require("react-native");
24
+ const sourceCode = NativeModules?.SourceCode;
25
+ const url = sourceCode?.getConstants?.().scriptURL ?? sourceCode?.scriptURL;
26
+ return typeof url === "string" ? url : null;
27
+ } catch {
28
+ return null;
29
+ }
30
+ }
31
+
32
+ /** http(s) origin of the Metro dev server, or null when running embedded. */
33
+ export function getDevServerOrigin() {
34
+ const scriptURL = getScriptURL();
35
+ const match = scriptURL?.match(/^https?:\/\/[^/]+/);
36
+ return match ? match[0] : null;
37
+ }
38
+
39
+ /**
40
+ * Candidate graph URLs, most-likely first. The straight `.bundle`→`.assets`
41
+ * swap works for RN CLI, but Expo dev builds serve a VIRTUAL entry
42
+ * (.expo/.virtual-metro-entry.bundle) that only exists for .bundle requests —
43
+ * its .assets twin 404s — so the real entry modules are tried next, keeping
44
+ * the original query string (platform/dev/etc.) intact.
45
+ */
46
+ export function getGraphURLCandidates() {
47
+ const scriptURL = getScriptURL();
48
+ if (!scriptURL || !/^https?:\/\//.test(scriptURL)) return [];
49
+ const origin = getDevServerOrigin();
50
+ const queryIndex = scriptURL.indexOf("?");
51
+ const query = queryIndex >= 0 ? scriptURL.slice(queryIndex) : "?platform=ios&dev=true";
52
+ const candidates = [];
53
+ if (scriptURL.includes(".bundle")) {
54
+ candidates.push(scriptURL.replace(".bundle", ".assets"));
55
+ }
56
+ if (origin) {
57
+ candidates.push(`${origin}/node_modules/expo-router/entry.assets${query}`, `${origin}/node_modules/expo/AppEntry.assets${query}`, `${origin}/index.assets${query}`);
58
+ }
59
+ return candidates;
60
+ }
61
+
62
+ /** Fetch the full asset graph from the dev server and merge it into the store. */
63
+ export async function fetchAssetGraph() {
64
+ const s = assetsState();
65
+ const candidates = getGraphURLCandidates();
66
+ if (!candidates.length) {
67
+ s.graphSupported = false;
68
+ s.graphError = "No Metro dev server (embedded bundle)";
69
+ invalidate();
70
+ return {
71
+ ok: false,
72
+ message: s.graphError
73
+ };
74
+ }
75
+ if (s.graphFetchInFlight) return {
76
+ ok: false,
77
+ message: "Graph fetch already running"
78
+ };
79
+ s.graphFetchInFlight = true;
80
+ try {
81
+ let data = null;
82
+ let lastError = "";
83
+ for (const url of candidates) {
84
+ try {
85
+ const response = await fetch(url);
86
+ if (!response.ok) {
87
+ lastError = `Metro responded ${response.status} for ${url}`;
88
+ continue;
89
+ }
90
+ const parsed = await response.json();
91
+ if (Array.isArray(parsed)) {
92
+ data = parsed;
93
+ break;
94
+ }
95
+ lastError = "Unexpected .assets payload shape";
96
+ } catch (error) {
97
+ lastError = String(error?.message ?? error);
98
+ }
99
+ }
100
+ if (!Array.isArray(data)) throw new Error(lastError || "No graph endpoint answered");
101
+ const graph = data;
102
+ for (const asset of graph) {
103
+ if (!asset || typeof asset.name !== "string" || typeof asset.type !== "string") {
104
+ continue;
105
+ }
106
+ upsertRecord({
107
+ key: assetKey(asset.httpServerLocation, asset.name, asset.type),
108
+ name: asset.name,
109
+ type: asset.type,
110
+ origin: "graph",
111
+ hash: asset.hash,
112
+ httpServerLocation: asset.httpServerLocation,
113
+ width: asset.width ?? undefined,
114
+ height: asset.height ?? undefined,
115
+ scales: asset.scales,
116
+ fileSystemLocation: asset.fileSystemLocation,
117
+ files: asset.files,
118
+ fileHashes: asset.fileHashes
119
+ });
120
+ }
121
+ s.graphSupported = true;
122
+ s.graphCount = graph.length;
123
+ s.graphError = null;
124
+ invalidate();
125
+ return {
126
+ ok: true,
127
+ count: graph.length
128
+ };
129
+ } catch (error) {
130
+ s.graphSupported = getDevServerOrigin() != null;
131
+ s.graphError = String(error?.message ?? error);
132
+ invalidate();
133
+ return {
134
+ ok: false,
135
+ message: s.graphError
136
+ };
137
+ } finally {
138
+ s.graphFetchInFlight = false;
139
+ }
140
+ }
141
+ //# sourceMappingURL=metroGraph.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["assetsState","assetKey","invalidate","upsertRecord","getScriptURL","NativeModules","require","sourceCode","SourceCode","url","getConstants","scriptURL","getDevServerOrigin","match","getGraphURLCandidates","test","origin","queryIndex","indexOf","query","slice","candidates","includes","push","replace","fetchAssetGraph","s","length","graphSupported","graphError","ok","message","graphFetchInFlight","data","lastError","response","fetch","status","parsed","json","Array","isArray","error","String","Error","graph","asset","name","type","key","httpServerLocation","hash","width","undefined","height","scales","fileSystemLocation","files","fileHashes","graphCount","count"],"sourceRoot":"../../../src","sources":["capture/metroGraph.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,WAAW,QAAQ,UAAU;AACtC,SAASC,QAAQ,EAAEC,UAAU,EAAEC,YAAY,QAAQ,qBAAqB;AAgBxE,OAAO,SAASC,YAAYA,CAAA,EAAkB;EAC5C,IAAI;IACF,MAAM;MAAEC;IAAc,CAAC,GAAGC,OAAO,CAAC,cAAc,CAAC;IACjD,MAAMC,UAAU,GAAGF,aAAa,EAAEG,UAAU;IAC5C,MAAMC,GAAY,GAChBF,UAAU,EAAEG,YAAY,GAAG,CAAC,CAACC,SAAS,IAAIJ,UAAU,EAAEI,SAAS;IACjE,OAAO,OAAOF,GAAG,KAAK,QAAQ,GAAGA,GAAG,GAAG,IAAI;EAC7C,CAAC,CAAC,MAAM;IACN,OAAO,IAAI;EACb;AACF;;AAEA;AACA,OAAO,SAASG,kBAAkBA,CAAA,EAAkB;EAClD,MAAMD,SAAS,GAAGP,YAAY,CAAC,CAAC;EAChC,MAAMS,KAAK,GAAGF,SAAS,EAAEE,KAAK,CAAC,mBAAmB,CAAC;EACnD,OAAOA,KAAK,GAAGA,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI;AAChC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,qBAAqBA,CAAA,EA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K,CAACK,IAAI;QAChBD,kBAAkB,EAAEJ,KAAK,CAACI,kBAAkB;QAC5CE,KAAK,EAAEN,KAAK,CAACM,KAAK,IAAIC,SAAS;QAC/BC,MAAM,EAAER,KAAK,CAACQ,MAAM,IAAID,SAAS;QACjCE,MAAM,EAAET,KAAK,CAACS,MAAM;QACpBC,kBAAkB,EAAEV,KAAK,CAACU,kBAAkB;QAC5CC,KAAK,EAAEX,KAAK,CAACW,KAAK;QAClBC,UAAU,EAAEZ,KAAK,CAACY;MACpB,CAAC,CAAC;IACJ;IACAhC,CAAC,CAACE,cAAc,GAAG,IAAI;IACvBF,CAAC,CAACiC,UAAU,GAAGd,KAAK,CAAClB,MAAM;IAC3BD,CAAC,CAACG,UAAU,GAAG,IAAI;IACnB3B,UAAU,CAAC,CAAC;IACZ,OAAO;MAAE4B,EAAE,EAAE,IAAI;MAAE8B,KAAK,EAAEf,KAAK,CAAClB;IAAO,CAAC;EAC1C,CAAC,CAAC,OAAOe,KAAK,EAAE;IACdhB,CAAC,CAACE,cAAc,GAAGhB,kBAAkB,CAAC,CAAC,IAAI,IAAI;IAC/Cc,CAAC,CAACG,UAAU,GAAGc,MAAM,CAAED,KAAK,EAAYX,OAAO,IAAIW,KAAK,CAAC;IACzDxC,UAAU,CAAC,CAAC;IACZ,OAAO;MAAE4B,EAAE,EAAE,KAAK;MAAEC,OAAO,EAAEL,CAAC,CAACG;IAAW,CAAC;EAC7C,CAAC,SAAS;IACRH,CAAC,CAACM,kBAAkB,GAAG,KAAK;EAC9B;AACF","ignoreList":[]}
@@ -0,0 +1,117 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * Runtime access to @react-native/assets-registry.
5
+ *
6
+ * Asset ids are contiguous 1..N (`assets.push` return value), so a plain
7
+ * getAssetByID walk enumerates every asset registered so far — including
8
+ * everything registered BEFORE this tool was evaluated. That's why, unlike
9
+ * the images tool, there is no "must be the first import" requirement here:
10
+ * the walk backfills whatever the patch missed.
11
+ *
12
+ * registerAsset is patched (plain non-frozen CommonJS export, looked up at
13
+ * call time by Metro's generated asset modules) purely for LIVE updates as
14
+ * lazily-required assets register later.
15
+ */
16
+
17
+ import { upsertRecord, assetKey } from "../store/assetStore";
18
+
19
+ /** Runtime shape of a registry entry (fileSystemLocation/files are stripped by Metro). */
20
+
21
+ let cachedRegistry;
22
+ export function getRegistryModule() {
23
+ if (cachedRegistry !== undefined) return cachedRegistry;
24
+ let mod = null;
25
+ try {
26
+ mod = require("@react-native/assets-registry/registry");
27
+ } catch {
28
+ try {
29
+ // Older RN layouts re-export from here; same module instance when both exist.
30
+ mod = require("react-native/Libraries/Image/AssetRegistry");
31
+ } catch {
32
+ mod = null;
33
+ }
34
+ }
35
+ cachedRegistry = mod && typeof mod.getAssetByID === "function" ? mod : null;
36
+ return cachedRegistry;
37
+ }
38
+
39
+ /** resolveAssetSource(id) → this environment's URI (dev URL / file:// / res id). */
40
+ export function resolveRegistryAsset(registryId) {
41
+ try {
42
+ const {
43
+ Image
44
+ } = require("react-native");
45
+ const resolved = Image.resolveAssetSource(registryId);
46
+ if (resolved && typeof resolved.uri === "string") {
47
+ return {
48
+ uri: resolved.uri,
49
+ scale: resolved.scale ?? 1
50
+ };
51
+ }
52
+ } catch {
53
+ // resolution is enrichment — never let it break the walk
54
+ }
55
+ return null;
56
+ }
57
+ export function upsertFromPackagerAsset(registryId, asset) {
58
+ const resolved = resolveRegistryAsset(registryId);
59
+ return upsertRecord({
60
+ key: assetKey(asset.httpServerLocation, asset.name, asset.type),
61
+ name: asset.name,
62
+ type: asset.type,
63
+ origin: "registry",
64
+ registryId,
65
+ hash: asset.hash,
66
+ httpServerLocation: asset.httpServerLocation,
67
+ width: asset.width ?? undefined,
68
+ height: asset.height ?? undefined,
69
+ scales: asset.scales,
70
+ resolvedUri: resolved?.uri,
71
+ resolvedScale: resolved?.scale,
72
+ loaded: true
73
+ });
74
+ }
75
+
76
+ /** Enumerate every asset registered so far. Returns the highest id seen. */
77
+ export function walkRegistry() {
78
+ const registry = getRegistryModule();
79
+ if (!registry) return 0;
80
+ let id = 0;
81
+ for (;;) {
82
+ const asset = registry.getAssetByID(id + 1);
83
+ if (!asset) break;
84
+ id++;
85
+ upsertFromPackagerAsset(id, asset);
86
+ }
87
+ return id;
88
+ }
89
+ const PATCH_MARKER = "__buoyAssetsPatched";
90
+
91
+ /**
92
+ * Wrap registerAsset so future registrations stream in live. Safe to call
93
+ * more than once (marker guard); the walk covers anything registered before.
94
+ */
95
+ export function patchRegisterAsset() {
96
+ const registry = getRegistryModule();
97
+ if (!registry) return false;
98
+ const original = registry.registerAsset;
99
+ if (original[PATCH_MARKER]) return true;
100
+ const wrapped = asset => {
101
+ const id = original.call(registry, asset);
102
+ try {
103
+ upsertFromPackagerAsset(id, asset);
104
+ } catch {
105
+ // never break app asset registration
106
+ }
107
+ return id;
108
+ };
109
+ wrapped[PATCH_MARKER] = true;
110
+ try {
111
+ registry.registerAsset = wrapped;
112
+ } catch {
113
+ return false;
114
+ }
115
+ return true;
116
+ }
117
+ //# sourceMappingURL=registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["upsertRecord","assetKey","cachedRegistry","getRegistryModule","undefined","mod","require","getAssetByID","resolveRegistryAsset","registryId","Image","resolved","resolveAssetSource","uri","scale","upsertFromPackagerAsset","asset","key","httpServerLocation","name","type","origin","hash","width","height","scales","resolvedUri","resolvedScale","loaded","walkRegistry","registry","id","PATCH_MARKER","patchRegisterAsset","original","registerAsset","wrapped","call"],"sourceRoot":"../../../src","sources":["capture/registry.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,YAAY,EAAEC,QAAQ,QAAQ,qBAAqB;;AAG5D;;AAiBA,IAAIC,cAAiD;AAErD,OAAO,SAASC,iBAAiBA,CAAA,EAA0B;EACzD,IAAID,cAAc,KAAKE,SAAS,EAAE,OAAOF,cAAc;EACvD,IAAIG,GAA0B,GAAG,IAAI;EACrC,IAA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I;IACFF,QAAQ,CAACK,aAAa,GAAGC,OAAO;EAClC,CAAC,CAAC,MAAM;IACN,OAAO,KAAK;EACd;EACA,OAAO,IAAI;AACb","ignoreList":[]}
@@ -0,0 +1,201 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * AssetDetail — full metadata for one asset: preview, identity, dimensions,
5
+ * per-scale sizes, resolution info, and which audit findings apply.
6
+ *
7
+ * Image previews render through the numeric registry id (works in every
8
+ * environment); fonts render a pangram with fontFamily set to the asset name
9
+ * — a best-effort guess (family ≠ filename for many fonts) that falls back
10
+ * to the system font silently when it misses.
11
+ */
12
+
13
+ import { Image, ScrollView, StyleSheet, Text, View } from "react-native";
14
+ import { macOSColors } from "@buoy-gg/shared-ui";
15
+ import { displaySource } from "../capture/measure";
16
+ import { formatBytes, formatDimensions, formatScales } from "../format";
17
+ import { estDecodedBytes } from "../store/assetStore";
18
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
19
+ function Row({
20
+ label,
21
+ value
22
+ }) {
23
+ return /*#__PURE__*/_jsxs(View, {
24
+ style: styles.kvRow,
25
+ children: [/*#__PURE__*/_jsx(Text, {
26
+ style: styles.kvLabel,
27
+ children: label
28
+ }), /*#__PURE__*/_jsx(Text, {
29
+ style: styles.kvValue,
30
+ selectable: true,
31
+ children: value
32
+ })]
33
+ });
34
+ }
35
+ function Preview({
36
+ record
37
+ }) {
38
+ if (record.kind === "image") {
39
+ const source = displaySource(record);
40
+ if (source == null) return null;
41
+ return /*#__PURE__*/_jsx(View, {
42
+ style: styles.previewBox,
43
+ children: /*#__PURE__*/_jsx(Image, {
44
+ testID: "buoy-internal-assets-preview",
45
+ source: source,
46
+ style: styles.previewImage,
47
+ resizeMode: "contain"
48
+ })
49
+ });
50
+ }
51
+ if (record.kind === "font") {
52
+ return /*#__PURE__*/_jsx(View, {
53
+ style: styles.previewBox,
54
+ children: /*#__PURE__*/_jsx(Text, {
55
+ style: [styles.fontPreview, {
56
+ fontFamily: record.name
57
+ }],
58
+ children: "The quick brown fox jumps over the lazy dog 0123456789"
59
+ })
60
+ });
61
+ }
62
+ return null;
63
+ }
64
+ export function AssetDetail({
65
+ record,
66
+ insights
67
+ }) {
68
+ const findings = [];
69
+ if (insights.neverLoaded.includes(record.id)) {
70
+ findings.push("Never loaded — shipped in the bundle but no code required it");
71
+ }
72
+ if (insights.scaleGaps.includes(record.id)) {
73
+ findings.push("Scale gap — no variant covers this device's pixel ratio");
74
+ }
75
+ if (insights.webpCandidates.includes(record.id)) {
76
+ findings.push("WebP candidate — large png/jpeg, converting typically saves 20–40%");
77
+ }
78
+ const duplicate = insights.duplicates.find(d => d.ids.includes(record.id));
79
+ if (duplicate) {
80
+ findings.push(`Duplicate content — identical bytes shipped ${duplicate.ids.length} times`);
81
+ }
82
+ if (insights.overDecode.includes(record.id)) {
83
+ findings.push("Decodes larger than 2× this entire screen — resize the source, no view can need this many pixels");
84
+ }
85
+ if (insights.heavyGifs.includes(record.id)) {
86
+ findings.push("Heavy GIF — every frame decodes into memory; a video or Lottie is typically ~90% smaller");
87
+ }
88
+ if (insights.heavyFonts.includes(record.id)) {
89
+ findings.push("Heavy font — likely an unsubset icon font; subsetting to used glyphs usually saves most of it");
90
+ }
91
+ if (insights.scaleAnomalies.includes(record.id)) {
92
+ findings.push("Scale anomaly — a higher-resolution variant is smaller in bytes than a lower one; check the exports");
93
+ }
94
+ const estimate = estDecodedBytes(record);
95
+ return /*#__PURE__*/_jsxs(ScrollView, {
96
+ style: styles.scroll,
97
+ contentContainerStyle: styles.content,
98
+ children: [/*#__PURE__*/_jsx(Preview, {
99
+ record: record
100
+ }), findings.length > 0 ? /*#__PURE__*/_jsx(View, {
101
+ style: styles.findings,
102
+ children: findings.map(finding => /*#__PURE__*/_jsx(Text, {
103
+ style: styles.findingText,
104
+ children: finding
105
+ }, finding))
106
+ }) : null, /*#__PURE__*/_jsx(Row, {
107
+ label: "Name",
108
+ value: `${record.name}.${record.type}`
109
+ }), /*#__PURE__*/_jsx(Row, {
110
+ label: "Kind",
111
+ value: record.kind
112
+ }), /*#__PURE__*/_jsx(Row, {
113
+ label: "Status",
114
+ value: record.loaded ? "Loaded (registered at runtime)" : "In bundle, never loaded"
115
+ }), record.kind === "image" ? /*#__PURE__*/_jsx(Row, {
116
+ label: "Dimensions",
117
+ value: `${formatDimensions(record)} (logical)`
118
+ }) : null, record.kind === "image" && record.scales.length ? /*#__PURE__*/_jsx(Row, {
119
+ label: "Scales",
120
+ value: formatScales(record.scales)
121
+ }) : null, record.sizesByScale ? Object.entries(record.sizesByScale).map(([scale, bytes]) => /*#__PURE__*/_jsx(Row, {
122
+ label: `Size @${scale}x`,
123
+ value: formatBytes(bytes)
124
+ }, scale)) : null, record.sizeBytes != null && record.sizeSource === "measured" ? /*#__PURE__*/_jsx(Row, {
125
+ label: "Total size",
126
+ value: formatBytes(record.sizeBytes)
127
+ }) : null, estimate > 0 ? /*#__PURE__*/_jsx(Row, {
128
+ label: "Decoded memory",
129
+ value: `~${formatBytes(estimate)} (RGBA)`
130
+ }) : null, record.registryId != null ? /*#__PURE__*/_jsx(Row, {
131
+ label: "Registry id",
132
+ value: String(record.registryId)
133
+ }) : null, record.hash ? /*#__PURE__*/_jsx(Row, {
134
+ label: "Hash",
135
+ value: record.hash
136
+ }) : null, record.httpServerLocation ? /*#__PURE__*/_jsx(Row, {
137
+ label: "Location",
138
+ value: record.httpServerLocation
139
+ }) : null, record.fileSystemLocation ? /*#__PURE__*/_jsx(Row, {
140
+ label: "Source dir",
141
+ value: record.fileSystemLocation
142
+ }) : null, record.resolvedUri ? /*#__PURE__*/_jsx(Row, {
143
+ label: "Resolved URI",
144
+ value: record.resolvedUri
145
+ }) : null]
146
+ });
147
+ }
148
+ const styles = StyleSheet.create({
149
+ scroll: {
150
+ flex: 1
151
+ },
152
+ content: {
153
+ padding: 12,
154
+ gap: 8
155
+ },
156
+ previewBox: {
157
+ borderRadius: 8,
158
+ backgroundColor: macOSColors.background.input,
159
+ padding: 12,
160
+ alignItems: "center",
161
+ justifyContent: "center",
162
+ minHeight: 96
163
+ },
164
+ previewImage: {
165
+ width: "100%",
166
+ height: 140
167
+ },
168
+ fontPreview: {
169
+ color: macOSColors.text.primary,
170
+ fontSize: 16,
171
+ textAlign: "center"
172
+ },
173
+ findings: {
174
+ borderRadius: 8,
175
+ borderWidth: 1,
176
+ borderColor: macOSColors.border.default,
177
+ backgroundColor: macOSColors.background.card,
178
+ padding: 10,
179
+ gap: 6
180
+ },
181
+ findingText: {
182
+ color: macOSColors.text.secondary,
183
+ fontSize: 11,
184
+ lineHeight: 15
185
+ },
186
+ kvRow: {
187
+ gap: 2
188
+ },
189
+ kvLabel: {
190
+ color: macOSColors.text.muted,
191
+ fontSize: 9,
192
+ fontWeight: "700",
193
+ letterSpacing: 0.5,
194
+ textTransform: "uppercase"
195
+ },
196
+ kvValue: {
197
+ color: macOSColors.text.primary,
198
+ fontSize: 12
199
+ }
200
+ });
201
+ //# sourceMappingURL=AssetDetail.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Image","ScrollView","StyleSheet","Text","View","macOSColors","displaySource","formatBytes","formatDimensions","formatScales","estDecodedBytes","jsx","_jsx","jsxs","_jsxs","Row","label","value","style","styles","kvRow","children","kvLabel","kvValue","selectable","Preview","record","kind","source","previewBox","testID","previewImage","resizeMode","fontPreview","fontFamily","name","AssetDetail","insights","findings","neverLoaded","includes","id","push","scaleGaps","webpCandidates","duplicate","duplicates","find","d","ids","length","overDecode","heavyGifs","heavyFonts","scaleAnomalies","estimate","scroll","contentContainerStyle","content","map","finding","findingText","type","loaded","scales","sizesByScale","Object","entries","scale","bytes","sizeBytes","sizeSource","registryId","String","hash","httpServerLocation","fileSystemLocation","resolvedUri","create","flex","padding","gap","borderRadius","backgroundColor","background","input","alignItems","justifyContent","minHeight","width","height","color","text","primary","fontSize","textAlign","borderWidth","borderColor","border","default","card","secondary","lineHeight","muted","fontWeight","letterSpacing","textTransform"],"sourceRoot":"../../../src","sources":["components/AssetDetail.t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