bertui 1.2.3 → 1.2.4

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 (124) hide show
  1. package/index.js +1 -1
  2. package/package.json +43 -25
  3. package/src/build/compiler/file-transpiler.js +1 -0
  4. package/src/build/generators/html-generator.js +24 -9
  5. package/src/build.js +9 -1
  6. package/src/client/compiler.js +1 -0
  7. package/src/server/dev-server-utils.js +2 -1
  8. package/types/bin/bertui.d.ts +3 -0
  9. package/types/bin/bertui.d.ts.map +1 -0
  10. package/types/error-overlay.d.ts +2 -0
  11. package/types/error-overlay.d.ts.map +1 -0
  12. package/types/index.d.ts +26 -177
  13. package/types/index.d.ts.map +1 -0
  14. package/types/scripts/fix-wasm-exports.d.ts +2 -0
  15. package/types/scripts/fix-wasm-exports.d.ts.map +1 -0
  16. package/types/src/analyzer/index.d.ts +8 -0
  17. package/types/src/analyzer/index.d.ts.map +1 -0
  18. package/types/src/build/compiler/file-transpiler.d.ts +5 -0
  19. package/types/src/build/compiler/file-transpiler.d.ts.map +1 -0
  20. package/types/src/build/compiler/index.d.ts +12 -0
  21. package/types/src/build/compiler/index.d.ts.map +1 -0
  22. package/types/src/build/compiler/route-discoverer.d.ts +2 -0
  23. package/types/src/build/compiler/route-discoverer.d.ts.map +1 -0
  24. package/types/src/build/compiler/router-generator.d.ts +2 -0
  25. package/types/src/build/compiler/router-generator.d.ts.map +1 -0
  26. package/types/src/build/css-builder.d.ts +18 -0
  27. package/types/src/build/css-builder.d.ts.map +1 -0
  28. package/types/src/build/generators/html-generator.d.ts +2 -0
  29. package/types/src/build/generators/html-generator.d.ts.map +1 -0
  30. package/types/src/build/generators/robots-generator.d.ts +11 -0
  31. package/types/src/build/generators/robots-generator.d.ts.map +1 -0
  32. package/types/src/build/generators/sitemap-generator.d.ts +5 -0
  33. package/types/src/build/generators/sitemap-generator.d.ts.map +1 -0
  34. package/types/src/build/image-optimizer.d.ts +11 -0
  35. package/types/src/build/image-optimizer.d.ts.map +1 -0
  36. package/types/src/build/processors/asset-processor.d.ts +2 -0
  37. package/types/src/build/processors/asset-processor.d.ts.map +1 -0
  38. package/types/src/build/processors/css-builder.d.ts +2 -0
  39. package/types/src/build/processors/css-builder.d.ts.map +1 -0
  40. package/types/src/build/server-island-validator.d.ts +27 -0
  41. package/types/src/build/server-island-validator.d.ts.map +1 -0
  42. package/types/src/build.d.ts +5 -0
  43. package/types/src/build.d.ts.map +1 -0
  44. package/types/src/cli.d.ts +2 -0
  45. package/types/src/cli.d.ts.map +1 -0
  46. package/types/src/client/compiler.d.ts +16 -0
  47. package/types/src/client/compiler.d.ts.map +1 -0
  48. package/types/src/client/fast-refresh.d.ts +3 -0
  49. package/types/src/client/fast-refresh.d.ts.map +1 -0
  50. package/types/src/client/hmr-runtime.d.ts +4 -0
  51. package/types/src/client/hmr-runtime.d.ts.map +1 -0
  52. package/types/src/compiler/index.d.ts +8 -0
  53. package/types/src/compiler/index.d.ts.map +1 -0
  54. package/types/src/compiler/router-generator-pure.d.ts +2 -0
  55. package/types/src/compiler/router-generator-pure.d.ts.map +1 -0
  56. package/types/src/compiler/transform.d.ts +36 -0
  57. package/types/src/compiler/transform.d.ts.map +1 -0
  58. package/types/src/config/defaultConfig.d.ts +26 -0
  59. package/types/src/config/defaultConfig.d.ts.map +1 -0
  60. package/types/src/config/index.d.ts +3 -0
  61. package/types/src/config/index.d.ts.map +1 -0
  62. package/types/src/config/loadConfig.d.ts +2 -0
  63. package/types/src/config/loadConfig.d.ts.map +1 -0
  64. package/types/src/css/index.d.ts +6 -0
  65. package/types/src/css/index.d.ts.map +1 -0
  66. package/types/src/css/processor.d.ts +23 -0
  67. package/types/src/css/processor.d.ts.map +1 -0
  68. package/types/src/dev.d.ts +2 -0
  69. package/types/src/dev.d.ts.map +1 -0
  70. package/types/src/hydration/index.d.ts +33 -0
  71. package/types/src/hydration/index.d.ts.map +1 -0
  72. package/types/src/image-optimizer/index.d.ts +24 -0
  73. package/types/src/image-optimizer/index.d.ts.map +1 -0
  74. package/types/src/images/index.d.ts +12 -0
  75. package/types/src/images/index.d.ts.map +1 -0
  76. package/types/src/images/processor.d.ts +30 -0
  77. package/types/src/images/processor.d.ts.map +1 -0
  78. package/types/src/layouts/index.d.ts +28 -0
  79. package/types/src/layouts/index.d.ts.map +1 -0
  80. package/types/src/loading/index.d.ts +28 -0
  81. package/types/src/loading/index.d.ts.map +1 -0
  82. package/types/src/logger/logger.d.ts +30 -0
  83. package/types/src/logger/logger.d.ts.map +1 -0
  84. package/types/src/middleware/index.d.ts +61 -0
  85. package/types/src/middleware/index.d.ts.map +1 -0
  86. package/types/src/router/Router.d.ts +16 -0
  87. package/types/src/router/Router.d.ts.map +1 -0
  88. package/types/src/router/SSRRouter.d.ts +20 -0
  89. package/types/src/router/SSRRouter.d.ts.map +1 -0
  90. package/types/src/router/index.d.ts +3 -0
  91. package/types/src/router/index.d.ts.map +1 -0
  92. package/types/src/scaffolder/index.d.ts +14 -0
  93. package/types/src/scaffolder/index.d.ts.map +1 -0
  94. package/types/src/serve.d.ts +3 -0
  95. package/types/src/serve.d.ts.map +1 -0
  96. package/types/src/server/dev-handler.d.ts +13 -0
  97. package/types/src/server/dev-handler.d.ts.map +1 -0
  98. package/types/src/server/dev-server-utils.d.ts +6 -0
  99. package/types/src/server/dev-server-utils.d.ts.map +1 -0
  100. package/types/src/server/dev-server.d.ts +18 -0
  101. package/types/src/server/dev-server.d.ts.map +1 -0
  102. package/types/src/server/hmr-handler.d.ts +19 -0
  103. package/types/src/server/hmr-handler.d.ts.map +1 -0
  104. package/types/src/server/index.d.ts +4 -0
  105. package/types/src/server/index.d.ts.map +1 -0
  106. package/types/src/server/request-handler.d.ts +19 -0
  107. package/types/src/server/request-handler.d.ts.map +1 -0
  108. package/types/src/server-islands/extractor.d.ts +16 -0
  109. package/types/src/server-islands/extractor.d.ts.map +1 -0
  110. package/types/src/server-islands/index.d.ts +3 -0
  111. package/types/src/server-islands/index.d.ts.map +1 -0
  112. package/types/src/utils/cache.d.ts +52 -0
  113. package/types/src/utils/cache.d.ts.map +1 -0
  114. package/types/src/utils/env.d.ts +20 -0
  115. package/types/src/utils/env.d.ts.map +1 -0
  116. package/types/src/utils/importhow.d.ts +15 -0
  117. package/types/src/utils/importhow.d.ts.map +1 -0
  118. package/types/src/utils/index.d.ts +3 -0
  119. package/types/src/utils/index.d.ts.map +1 -0
  120. package/types/src/utils/meta-extractor.d.ts +13 -0
  121. package/types/src/utils/meta-extractor.d.ts.map +1 -0
  122. package/types/config.d.ts +0 -33
  123. package/types/react.d.ts +0 -16
  124. package/types/router.d.ts +0 -79
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- // bertui/index.js - v1.3.0
1
+ // bertui/index.js - v1.2.2
2
2
 
3
3
  // Compiler
4
4
  export { compileProject, compileFile } from './src/client/compiler.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bertui",
3
- "version": "1.2.3",
3
+ "version": "1.2.4",
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",
@@ -8,31 +8,49 @@
8
8
  "bin": {
9
9
  "bertui": "./bin/bertui.js"
10
10
  },
11
- "exports": {
12
- ".": {
13
- "types": "./types/index.d.ts",
14
- "import": "./index.js",
15
- "default": "./index.js"
16
- },
17
- "./hmr": {
18
- "import": "./src/client/hmr-runtime.js"
19
- },
20
- "./image-optimizer": {
21
- "import": "./src/image-optimizer/index.js"
22
- },
23
- "./router": {
24
- "types": "./types/router.d.ts",
25
- "import": "./src/router/index.js"
26
- },
27
- "./config": {
28
- "types": "./types/config.d.ts",
29
- "import": "./src/config/index.js"
30
- },
31
- "./logger": {
32
- "import": "./src/logger/logger.js"
33
- },
34
- "./styles": "./src/styles/bertui.css"
11
+ "exports": {
12
+ ".": {
13
+ "types": "./types/index.d.ts",
14
+ "import": "./index.js",
15
+ "default": "./index.js"
35
16
  },
17
+ "./hmr": {
18
+ "import": "./src/client/hmr-runtime.js"
19
+ },
20
+ "./image-optimizer": {
21
+ "import": "./src/image-optimizer/index.js"
22
+ },
23
+ "./router": {
24
+ "types": "./types/router.d.ts",
25
+ "import": "./src/router/index.js"
26
+ },
27
+ "./config": {
28
+ "types": "./types/config.d.ts",
29
+ "import": "./src/config/index.js"
30
+ },
31
+ "./logger": {
32
+ "import": "./src/logger/logger.js"
33
+ },
34
+ "./styles": "./src/styles/bertui.css",
35
+ "./compiler": {
36
+ "import": "./src/client/compiler.js"
37
+ },
38
+ "./layouts": {
39
+ "import": "./src/layouts/index.js"
40
+ },
41
+ "./loading": {
42
+ "import": "./src/loading/index.js"
43
+ },
44
+ "./hydration": {
45
+ "import": "./src/hydration/index.js"
46
+ },
47
+ "./dev": {
48
+ "import": "./src/server/dev-server-utils.js"
49
+ },
50
+ "./build": {
51
+ "import": "./src/build.js"
52
+ }
53
+ },
36
54
  "files": [
37
55
  "bin",
38
56
  "src",
@@ -49,6 +49,7 @@ async function _compileDir(srcDir, buildDir, root, envVars, aliasMap) {
49
49
  const stat = statSync(srcPath);
50
50
 
51
51
  if (stat.isDirectory()) {
52
+ if (file === 'api') { logger.debug('⏭️ Skipping api/'); continue; }
52
53
  const subBuildDir = join(buildDir, file);
53
54
  mkdirSync(subBuildDir, { recursive: true });
54
55
  await _compileDir(srcPath, subBuildDir, root, envVars, aliasMap);
@@ -17,7 +17,6 @@ export async function generateProductionHTML(root, outDir, buildResult, routes,
17
17
  const bundlePath = relative(outDir, mainBundle.path).replace(/\\/g, '/');
18
18
  const defaultMeta = config.meta || {};
19
19
 
20
- // ✅ Copy bertui-icons AND bertui-animate to dist/
21
20
  const bertuiPackages = await copyBertuiPackagesToProduction(root, outDir);
22
21
 
23
22
  logger.info(`📄 Generating HTML for ${routes.length} routes...`);
@@ -36,12 +35,12 @@ export async function generateProductionHTML(root, outDir, buildResult, routes,
36
35
  logger.success(`✅ HTML generation complete for ${routes.length} routes`);
37
36
  }
38
37
 
39
- // ✅ UPDATED: Copy ALL bertui-* packages to dist/
40
38
  async function copyBertuiPackagesToProduction(root, outDir) {
41
39
  const nodeModulesDir = join(root, 'node_modules');
42
40
  const packages = {
43
41
  bertuiIcons: false,
44
- bertuiAnimate: false
42
+ bertuiAnimate: false,
43
+ elysiaEden: false
45
44
  };
46
45
 
47
46
  if (!existsSync(nodeModulesDir)) {
@@ -63,14 +62,13 @@ async function copyBertuiPackagesToProduction(root, outDir) {
63
62
  }
64
63
  }
65
64
 
66
- // ✅ NEW: Copy ONLY bertui-animate CSS files (not the whole package)
65
+ // Copy bertui-animate CSS files
67
66
  const bertuiAnimateSource = join(nodeModulesDir, 'bertui-animate', 'dist');
68
67
  if (existsSync(bertuiAnimateSource)) {
69
68
  try {
70
69
  const bertuiAnimateDest = join(outDir, 'css');
71
70
  mkdirSync(bertuiAnimateDest, { recursive: true });
72
71
 
73
- // Copy minified CSS
74
72
  const minCSSPath = join(bertuiAnimateSource, 'bertui-animate.min.css');
75
73
  if (existsSync(minCSSPath)) {
76
74
  cpSync(minCSSPath, join(bertuiAnimateDest, 'bertui-animate.min.css'));
@@ -81,6 +79,20 @@ async function copyBertuiPackagesToProduction(root, outDir) {
81
79
  logger.error(`Failed to copy bertui-animate: ${error.message}`);
82
80
  }
83
81
  }
82
+
83
+ // Copy @elysiajs/eden
84
+ const elysiaEdenSource = join(nodeModulesDir, '@elysiajs', 'eden');
85
+ if (existsSync(elysiaEdenSource)) {
86
+ try {
87
+ const elysiaEdenDest = join(outDir, 'node_modules', '@elysiajs', 'eden');
88
+ mkdirSync(join(outDir, 'node_modules', '@elysiajs'), { recursive: true });
89
+ cpSync(elysiaEdenSource, elysiaEdenDest, { recursive: true });
90
+ logger.success('✅ Copied @elysiajs/eden to dist/node_modules/');
91
+ packages.elysiaEden = true;
92
+ } catch (error) {
93
+ logger.error(`Failed to copy @elysiajs/eden: ${error.message}`);
94
+ }
95
+ }
84
96
 
85
97
  return packages;
86
98
  }
@@ -261,7 +273,6 @@ async function extractStaticHTMLFromComponent(sourceCode, filePath) {
261
273
  }
262
274
  }
263
275
 
264
- // ✅ UPDATED: Add bertui-animate CSS to production HTML
265
276
  function generateHTML(meta, route, bundlePath, staticHTML = '', isServerIsland = false, bertuiPackages = {}) {
266
277
  const rootContent = staticHTML
267
278
  ? `<div id="root">${staticHTML}</div>`
@@ -271,15 +282,18 @@ function generateHTML(meta, route, bundlePath, staticHTML = '', isServerIsland =
271
282
  ? '<!-- 🏝️ Server Island: Static content rendered at build time -->'
272
283
  : '<!-- ⚡ Client-only: Content rendered by JavaScript -->';
273
284
 
274
- // ✅ Add bertui-icons to import map
275
285
  const bertuiIconsImport = bertuiPackages.bertuiIcons
276
286
  ? ',\n "bertui-icons": "/node_modules/bertui-icons/generated/index.js"'
277
287
  : '';
278
288
 
279
- // ✅ Add bertui-animate CSS link
280
289
  const bertuiAnimateCSS = bertuiPackages.bertuiAnimate
281
290
  ? ' <link rel="stylesheet" href="/css/bertui-animate.min.css">'
282
291
  : '';
292
+
293
+ // ✅ NEW: @elysiajs/eden local import map
294
+ const elysiaEdenImport = bertuiPackages.elysiaEden
295
+ ? ',\n "@elysiajs/eden": "/node_modules/@elysiajs/eden/dist/index.mjs"'
296
+ : '';
283
297
 
284
298
  return `<!DOCTYPE html>
285
299
  <html lang="${meta.lang || 'en'}">
@@ -306,8 +320,9 @@ ${bertuiAnimateCSS}
306
320
  "imports": {
307
321
  "react": "https://esm.sh/react@18.2.0",
308
322
  "react-dom": "https://esm.sh/react-dom@18.2.0",
323
+ "@bunnyx/api": "/bunnyx-api/api-client.js",
309
324
  "react-dom/client": "https://esm.sh/react-dom@18.2.0/client",
310
- "react/jsx-runtime": "https://esm.sh/react@18.2.0/jsx-runtime"${bertuiIconsImport}
325
+ "react/jsx-runtime": "https://esm.sh/react@18.2.0/jsx-runtime"${bertuiIconsImport}${elysiaEdenImport}
311
326
  }
312
327
  }
313
328
  </script>
package/src/build.js CHANGED
@@ -127,6 +127,7 @@ async function generateProductionImportMap(root, config) {
127
127
  'react-dom': 'https://esm.sh/react-dom@18.2.0',
128
128
  'react-dom/client': 'https://esm.sh/react-dom@18.2.0/client',
129
129
  'react/jsx-runtime': 'https://esm.sh/react@18.2.0/jsx-runtime',
130
+ '@bunnyx/api': '/bunnyx-api/api-client.js',
130
131
  };
131
132
 
132
133
  const nodeModulesDir = join(root, 'node_modules');
@@ -184,6 +185,13 @@ async function bundleJavaScript(buildEntry, routerPath, outDir, envVars, buildDi
184
185
  await Bun.write(join(outDir, 'import-map.json'), JSON.stringify({ imports: importMap }, null, 2));
185
186
  await copyNodeModulesToDist(root, outDir, importMap);
186
187
 
188
+ // Copy @bunnyx/api client to dist so the importmap entry resolves
189
+ const bunnyxSrc = join(root, 'bunnyx-api', 'api-client.js');
190
+ if (existsSync(bunnyxSrc)) {
191
+ mkdirSync(join(outDir, 'bunnyx-api'), { recursive: true });
192
+ await Bun.write(join(outDir, 'bunnyx-api', 'api-client.js'), Bun.file(bunnyxSrc));
193
+ }
194
+
187
195
  const result = await Bun.build({
188
196
  entrypoints,
189
197
  outdir: join(outDir, 'assets'),
@@ -202,7 +210,7 @@ async function bundleJavaScript(buildEntry, routerPath, outDir, envVars, buildDi
202
210
  chunk: 'js/chunks/[name]-[hash].js',
203
211
  asset: 'assets/[name]-[hash].[ext]',
204
212
  },
205
- external: ['react', 'react-dom', 'react-dom/client', 'react/jsx-runtime'],
213
+ external: ['react', 'react-dom', 'react-dom/client', 'react/jsx-runtime', '@bunnyx/api'],
206
214
  define: {
207
215
  'process.env.NODE_ENV': '"production"',
208
216
  ...Object.fromEntries(
@@ -302,6 +302,7 @@ async function compileDirectory(srcDir, outDir, root, envVars, aliasMap) {
302
302
 
303
303
  if (stat.isDirectory()) {
304
304
  if (file === 'templates') { logger.debug('⏭️ Skipping src/templates/'); continue; }
305
+ if (file === 'api') { logger.debug('⏭️ Skipping src/api/'); continue; }
305
306
  const subOutDir = join(outDir, file);
306
307
  mkdirSync(subOutDir, { recursive: true });
307
308
  const subStats = await compileDirectory(srcPath, subOutDir, root, envVars, aliasMap);
@@ -77,8 +77,9 @@ export async function buildDevImportMap(root) {
77
77
  'react-dom': 'https://esm.sh/react-dom@18.2.0',
78
78
  'react-dom/client': 'https://esm.sh/react-dom@18.2.0/client',
79
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',
80
82
  };
81
-
82
83
  const SKIP = new Set(['react', 'react-dom', '.bin', '.cache', '.package-lock.json', '.yarn']);
83
84
 
84
85
  if (existsSync(nodeModulesDir)) {
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env bun
2
+ export {};
3
+ //# sourceMappingURL=bertui.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bertui.d.ts","sourceRoot":"","sources":["../../bin/bertui.js"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=error-overlay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-overlay.d.ts","sourceRoot":"","sources":["../error-overlay.js"],"names":[],"mappings":""}
package/types/index.d.ts CHANGED
@@ -1,177 +1,26 @@
1
- // bertui/types/index.d.ts
2
-
3
- // Import React types
4
- import React from 'react';
5
-
6
- declare global {
7
- // Global React namespace
8
- namespace React {
9
- type ReactNode = import('react').ReactNode;
10
- }
11
-
12
- // JSX namespace
13
- namespace JSX {
14
- type Element = React.ReactElement;
15
- interface ElementClass extends React.Component<any> {
16
- render(): React.ReactNode;
17
- }
18
- interface ElementAttributesProperty {
19
- props: {};
20
- }
21
- interface ElementChildrenAttribute {
22
- children: {};
23
- }
24
-
25
- interface IntrinsicElements {
26
- // HTML elements
27
- a: React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>;
28
- div: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
29
- span: React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>;
30
- h1: React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
31
- h2: React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
32
- h3: React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
33
- h4: React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
34
- h5: React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
35
- h6: React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
36
- p: React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>;
37
- img: React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>;
38
- button: React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>;
39
- input: React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
40
- textarea: React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>;
41
- form: React.DetailedHTMLProps<React.FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>;
42
- label: React.DetailedHTMLProps<React.LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>;
43
- select: React.DetailedHTMLProps<React.SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>;
44
- option: React.DetailedHTMLProps<React.OptionHTMLAttributes<HTMLOptionElement>, HTMLOptionElement>;
45
- ul: React.DetailedHTMLProps<React.HTMLAttributes<HTMLUListElement>, HTMLUListElement>;
46
- ol: React.DetailedHTMLProps<React.HTMLAttributes<HTMLOListElement>, HTMLOListElement>;
47
- li: React.DetailedHTMLProps<React.HTMLAttributes<HTMLLIElement>, HTMLLIElement>;
48
- table: React.DetailedHTMLProps<React.TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>;
49
- tr: React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>;
50
- td: React.DetailedHTMLProps<React.TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>;
51
- th: React.DetailedHTMLProps<React.ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement>;
52
- header: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
53
- footer: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
54
- nav: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
55
- main: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
56
- section: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
57
- article: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
58
- aside: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
59
-
60
- // SVG elements
61
- svg: React.SVGProps<SVGSVGElement>;
62
- path: React.SVGProps<SVGPathElement>;
63
- circle: React.SVGProps<SVGCircleElement>;
64
- rect: React.SVGProps<SVGRectElement>;
65
-
66
- // Allow any other element with generic props
67
- [elemName: string]: any;
68
- }
69
- }
70
-
71
- // Global React variable for JSX transform
72
- const React: typeof import('react');
73
- }
74
-
75
- declare module 'bertui' {
76
- import { BertuiConfig } from 'bertui/config';
77
- import React from 'react';
78
-
79
- /**
80
- * Logger utility
81
- */
82
- export interface Logger {
83
- info(message: string): void;
84
- success(message: string): void;
85
- warn(message: string): void;
86
- error(message: string): void;
87
- debug(message: string): void;
88
- bigLog(message: string, options?: { color?: string }): void;
89
- table(data: any[]): void;
90
- }
91
-
92
- /**
93
- * Build options
94
- */
95
- export interface BuildOptions {
96
- /** Project root directory */
97
- root?: string;
98
- }
99
-
100
- /**
101
- * Dev server options
102
- */
103
- export interface DevOptions {
104
- /** Server port */
105
- port?: number;
106
- /** Project root directory */
107
- root?: string;
108
- }
109
-
110
- /**
111
- * Compile options
112
- */
113
- export interface CompileOptions {
114
- /** Project root directory */
115
- root?: string;
116
- }
117
-
118
- /**
119
- * Logger instance
120
- */
121
- export const logger: Logger;
122
-
123
- /**
124
- * Default configuration
125
- */
126
- export const defaultConfig: BertuiConfig;
127
-
128
- /**
129
- * Load configuration
130
- */
131
- export function loadConfig(root: string): Promise<BertuiConfig>;
132
-
133
- /**
134
- * Start development server
135
- */
136
- export function startDev(options?: DevOptions): Promise<void>;
137
-
138
- /**
139
- * Build for production
140
- */
141
- export function buildProduction(options?: BuildOptions): Promise<void>;
142
-
143
- /**
144
- * Compile project
145
- */
146
- export function compileProject(root: string): Promise<{
147
- outDir: string;
148
- stats: { files: number; skipped: number };
149
- routes: any[];
150
- }>;
151
-
152
- /**
153
- * CLI program
154
- */
155
- export function program(): void;
156
-
157
- /**
158
- * BertUI version
159
- */
160
- export const version: string;
161
- }
162
-
163
- // Global declarations for Server Islands
164
- declare global {
165
- /**
166
- * Mark a page component as a Server Island (SSG)
167
- * Add this export to any page to enable static generation:
168
- *
169
- * @example
170
- * ```tsx
171
- * export const render = "server";
172
- * ```
173
- */
174
- export const render: "server" | "client";
175
- }
176
-
177
- export {};
1
+ export { compileForBuild } from "./src/build/compiler/index.js";
2
+ export { discoverRoutes } from "./src/build/compiler/route-discoverer.js";
3
+ export { hmr } from "./src/client/hmr-runtime.js";
4
+ export { buildProduction } from "./src/build.js";
5
+ export { optimizeImages } from "./src/build/image-optimizer.js";
6
+ export { SSRRouter } from "./src/router/SSRRouter.js";
7
+ export { default as logger } from "./src/logger/logger.js";
8
+ export { program } from "./src/cli.js";
9
+ export { analyzeBuild } from "./src/analyzer/index.js";
10
+ export { createDevHandler } from "./src/server/dev-handler.js";
11
+ export { startDevServer } from "./src/server/dev-server.js";
12
+ export const version: "1.2.2";
13
+ export { compileProject, compileFile } from "./src/client/compiler.js";
14
+ export { optimizeImage, optimizeImagesBatch, hasWasm, version as optimizerVersion } from "./src/image-optimizer/index.js";
15
+ export { Router, Link, useRouter } from "./src/router/index.js";
16
+ export { loadConfig, defaultConfig } from "./src/config/index.js";
17
+ export { MiddlewareManager, loadMiddleware, runMiddleware, MiddlewareContext } from "./src/middleware/index.js";
18
+ export { discoverLayouts, compileLayouts, matchLayout, generateLayoutWrapper, injectLayoutsIntoRouter } from "./src/layouts/index.js";
19
+ export { discoverLoadingComponents, compileLoadingComponents, generateLoadingAwareRouter, getLoadingScript, DEFAULT_LOADING_HTML } from "./src/loading/index.js";
20
+ export { needsHydration, getInteractiveFeatures, analyzeRoutes, generatePartialHydrationCode, logHydrationReport } from "./src/hydration/index.js";
21
+ export { scaffold, parseCreateArgs } from "./src/scaffolder/index.js";
22
+ export { minifyCSS, combineCSS } from "./src/css/processor.js";
23
+ export { copyImagesSync, isImageFile } from "./src/images/index.js";
24
+ export { extractStaticHTML, isServerIsland, validateServerIsland } from "./src/server-islands/index.js";
25
+ export { buildAliasMap, rewriteAliasImports, getAliasDirs } from "./src/utils/importhow.js";
26
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.js"],"names":[],"mappings":";;;;;;;;;;;AAsGA,sBAAuB,OAAO,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=fix-wasm-exports.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fix-wasm-exports.d.ts","sourceRoot":"","sources":["../../scripts/fix-wasm-exports.js"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Analyze build output and generate HTML report
3
+ */
4
+ export function analyzeBuild(outDir: any, options?: {}): Promise<{
5
+ outputFile: any;
6
+ files: any[];
7
+ } | null>;
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/analyzer/index.js"],"names":[],"mappings":"AAOA;;GAEG;AACH;;;UA8BC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Compile src/ + alias dirs into buildDir.
3
+ */
4
+ export function compileBuildDirectory(srcDir: any, buildDir: any, root: any, envVars: any, importhow?: {}): Promise<void>;
5
+ //# sourceMappingURL=file-transpiler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-transpiler.d.ts","sourceRoot":"","sources":["../../../../src/build/compiler/file-transpiler.js"],"names":[],"mappings":"AAOA;;GAEG;AACH,0HA4BC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @param {string} root
3
+ * @param {string} buildDir
4
+ * @param {Object} envVars
5
+ * @param {Object} config - full bertui config (includes importhow)
6
+ */
7
+ export function compileForBuild(root: string, buildDir: string, envVars: Object, config?: Object): Promise<{
8
+ routes: any[];
9
+ serverIslands: any[];
10
+ clientRoutes: any[];
11
+ }>;
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/build/compiler/index.js"],"names":[],"mappings":"AAQA;;;;;GAKG;AACH,sCALW,MAAM,YACN,MAAM,WACN,MAAM,WACN,MAAM;;;;GAwChB"}
@@ -0,0 +1,2 @@
1
+ export function discoverRoutes(pagesDir: any): Promise<any[]>;
2
+ //# sourceMappingURL=route-discoverer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"route-discoverer.d.ts","sourceRoot":"","sources":["../../../../src/build/compiler/route-discoverer.js"],"names":[],"mappings":"AAIA,8DA4CC"}
@@ -0,0 +1,2 @@
1
+ export function generateBuildRouter(routes: any, buildDir: any): Promise<void>;
2
+ //# sourceMappingURL=router-generator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"router-generator.d.ts","sourceRoot":"","sources":["../../../../src/build/compiler/router-generator.js"],"names":[],"mappings":"AAGA,+EAoGC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Build and minify CSS for production using Lightning CSS
3
+ * @param {string} srcPath - Source CSS file path
4
+ * @param {string} destPath - Destination CSS file path
5
+ */
6
+ export function buildCSS(srcPath: string, destPath: string): Promise<{
7
+ success: boolean;
8
+ size: string;
9
+ }>;
10
+ /**
11
+ * Copy CSS without minification (for dev)
12
+ * @param {string} srcPath - Source CSS file path
13
+ * @param {string} destPath - Destination CSS file path
14
+ */
15
+ export function copyCSS(srcPath: string, destPath: string): Promise<{
16
+ success: boolean;
17
+ }>;
18
+ //# sourceMappingURL=css-builder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"css-builder.d.ts","sourceRoot":"","sources":["../../../src/build/css-builder.js"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,kCAHW,MAAM,YACN,MAAM;;;GAkDhB;AAED;;;;GAIG;AACH,iCAHW,MAAM,YACN,MAAM;;GAiBhB"}
@@ -0,0 +1,2 @@
1
+ export function generateProductionHTML(root: any, outDir: any, buildResult: any, routes: any, serverIslands: any, config: any): Promise<void>;
2
+ //# sourceMappingURL=html-generator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"html-generator.d.ts","sourceRoot":"","sources":["../../../../src/build/generators/html-generator.js"],"names":[],"mappings":"AAMA,8IA6BC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Generate robots.txt from sitemap data
3
+ * @param {Object} config - BertUI config with baseUrl
4
+ * @param {string} outDir - Output directory (dist/)
5
+ * @param {Array} routes - Optional: routes to disallow (e.g., admin pages)
6
+ */
7
+ export function generateRobots(config: Object, outDir: string, routes?: any[]): Promise<{
8
+ path: any;
9
+ content: string;
10
+ }>;
11
+ //# sourceMappingURL=robots-generator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"robots-generator.d.ts","sourceRoot":"","sources":["../../../../src/build/generators/robots-generator.js"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,uCAJW,MAAM,UACN,MAAM;;;GAkDhB"}
@@ -0,0 +1,5 @@
1
+ export function generateSitemap(routes: any, config: any, outDir: any): Promise<{
2
+ routes: any;
3
+ path: any;
4
+ }>;
5
+ //# sourceMappingURL=sitemap-generator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sitemap-generator.d.ts","sourceRoot":"","sources":["../../../../src/build/generators/sitemap-generator.js"],"names":[],"mappings":"AA8BA;;;GAgCC"}
@@ -0,0 +1,11 @@
1
+ export function optimizeImages(srcDir: any, outDir: any, options?: {}): Promise<{
2
+ optimized: number;
3
+ copied: number;
4
+ saved: number;
5
+ results: any[];
6
+ }>;
7
+ export function copyImages(srcDir: any, outDir: any): {
8
+ copied: number;
9
+ skipped: number;
10
+ };
11
+ //# sourceMappingURL=image-optimizer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image-optimizer.d.ts","sourceRoot":"","sources":["../../../src/build/image-optimizer.js"],"names":[],"mappings":"AAOA;;;;;GAqHC;AAED;;;EAEC"}
@@ -0,0 +1,2 @@
1
+ export function copyAllStaticAssets(root: any, outDir: any): Promise<void>;
2
+ //# sourceMappingURL=asset-processor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asset-processor.d.ts","sourceRoot":"","sources":["../../../../src/build/processors/asset-processor.js"],"names":[],"mappings":"AAKA,2EAaC"}
@@ -0,0 +1,2 @@
1
+ export function buildAllCSS(root: any, outDir: any): Promise<void>;
2
+ //# sourceMappingURL=css-builder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"css-builder.d.ts","sourceRoot":"","sources":["../../../../src/build/processors/css-builder.js"],"names":[],"mappings":"AAOA,mEA2FC"}