File tree Expand file tree Collapse file tree 3 files changed +12
-0
lines changed
Expand file tree Collapse file tree 3 files changed +12
-0
lines changed Original file line number Diff line number Diff 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+
101106export function getFormats ( ) {
102107 return allOptions ;
103108}
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 11import React from 'react' ;
22import { createRoot } from 'react-dom/client' ;
33import 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
You can’t perform that action at this time.
0 commit comments