bertui 1.2.4 → 1.2.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bertui",
3
- "version": "1.2.4",
3
+ "version": "1.2.6",
4
4
  "description": "Lightning-fast React dev server powered by Bun - Now with Rust image optimization (WASM, no Rust required for users)",
5
5
  "type": "module",
6
6
  "main": "./index.js",
@@ -318,11 +318,13 @@ ${bertuiAnimateCSS}
318
318
  <script type="importmap">
319
319
  {
320
320
  "imports": {
321
- "react": "https://esm.sh/react@18.2.0",
322
- "react-dom": "https://esm.sh/react-dom@18.2.0",
323
- "@bunnyx/api": "/bunnyx-api/api-client.js",
324
- "react-dom/client": "https://esm.sh/react-dom@18.2.0/client",
325
- "react/jsx-runtime": "https://esm.sh/react@18.2.0/jsx-runtime"${bertuiIconsImport}${elysiaEdenImport}
321
+ 'react': 'https://esm.sh/react@18.2.0',
322
+ 'react-dom': 'https://esm.sh/react-dom@18.2.0',
323
+ 'react-dom/client': 'https://esm.sh/react-dom@18.2.0/client',
324
+ 'react/jsx-runtime': 'https://esm.sh/react@18.2.0/jsx-runtime',
325
+ 'react/jsx-dev-runtime': 'https://esm.sh/react@18.2.0/jsx-dev-runtime', // ADD THIS
326
+ '@bunnyx/api': '/bunnyx-api/api-client.js',
327
+ '@elysiajs/eden': '/node_modules/@elysiajs/eden/dist/index.mjs',
326
328
  }
327
329
  }
328
330
  </script>
@@ -145,10 +145,10 @@ export async function createDevHandler(options = {}) {
145
145
  const filepath = join(root, 'node_modules', url.pathname.replace('/node_modules/', ''));
146
146
  const file = Bun.file(filepath);
147
147
  if (await file.exists()) {
148
- const ext = extname(filepath).toLowerCase();
149
148
  const contentType = ext === '.css' ? 'text/css' :
150
- ['.js', '.mjs'].includes(ext) ? 'application/javascript; charset=utf-8' :
151
- getContentType(ext);
149
+ ['.js', '.mjs', '.jsx', '.ts', '.tsx'].includes(ext) ? 'application/javascript; charset=utf-8' :
150
+ ext === '.json' ? 'application/json' :
151
+ getContentType(ext);
152
152
  return new Response(file, {
153
153
  headers: { 'Content-Type': contentType, 'Cache-Control': 'no-cache' },
154
154
  });
@@ -72,14 +72,13 @@ export async function buildDevImportMap(root) {
72
72
 
73
73
  logger.info('🔄 Rebuilding dev import map (new packages detected)...');
74
74
 
75
- const importMap = {
76
- 'react': 'https://esm.sh/react@18.2.0',
77
- 'react-dom': 'https://esm.sh/react-dom@18.2.0',
78
- 'react-dom/client': 'https://esm.sh/react-dom@18.2.0/client',
79
- 'react/jsx-runtime': 'https://esm.sh/react@18.2.0/jsx-runtime',
80
- '@bunnyx/api': '/bunnyx-api/api-client.js',
81
- '@elysiajs/eden': '/node_modules/@elysiajs/eden/dist/index.mjs',
82
- };
75
+ 'react': 'https://esm.sh/react@18.2.0',
76
+ 'react-dom': 'https://esm.sh/react-dom@18.2.0',
77
+ 'react-dom/client': 'https://esm.sh/react-dom@18.2.0/client',
78
+ 'react/jsx-runtime': 'https://esm.sh/react@18.2.0/jsx-runtime',
79
+ 'react/jsx-dev-runtime': 'https://esm.sh/react@18.2.0/jsx-dev-runtime', // ADD THIS
80
+ '@bunnyx/api': '/bunnyx-api/api-client.js',
81
+ '@elysiajs/eden': '/node_modules/@elysiajs/eden/dist/index.mjs',
83
82
  const SKIP = new Set(['react', 'react-dom', '.bin', '.cache', '.package-lock.json', '.yarn']);
84
83
 
85
84
  if (existsSync(nodeModulesDir)) {