Skip to content

Commit eac4385

Browse files
committed
test bun
1 parent ec307df commit eac4385

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

external/conversionService.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,11 @@ export async function initializeFormats() {
9898
return allOptions;
9999
}
100100

101+
/** Serialize format cache to JSON (same shape as src/main.ts for buildCache.js). */
102+
export function getFormatCacheJSON(): string {
103+
return JSON.stringify(Array.from(supportedFormatCache.entries()), null, 2);
104+
}
105+
101106
export function getFormats() {
102107
return allOptions;
103108
}

external/converter.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,7 @@ export default function App() {
764764
initializeFormats().then(() => {
765765
setFormats(getFormats());
766766
setLoading(false);
767+
console.log("Built initial format list.");
767768
});
768769
}, []);
769770

external/main.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
import React from 'react';
22
import { createRoot } from 'react-dom/client';
33
import App from './converter.jsx';
4+
import { getFormatCacheJSON } from './conversionService.ts';
5+
6+
// Expose for buildCache.js (puppeteer) when using external/main.tsx as entry
7+
if (typeof window !== 'undefined') {
8+
(window as unknown as { printSupportedFormatCache: () => string }).printSupportedFormatCache = getFormatCacheJSON;
9+
}
410

511
// ─── ERROR BOUNDARY ──────────────────────────────────────────────────────────
612

0 commit comments

Comments
 (0)