bertui 1.2.2 → 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.
- package/index.js +1 -1
- package/package.json +43 -25
- package/src/build/compiler/file-transpiler.js +1 -0
- package/src/build/generators/html-generator.js +24 -9
- package/src/build.js +12 -3
- package/src/client/compiler.js +1 -0
- package/src/dev.js +49 -218
- package/src/server/dev-server-utils.js +2 -1
- package/types/bin/bertui.d.ts +3 -0
- package/types/bin/bertui.d.ts.map +1 -0
- package/types/error-overlay.d.ts +2 -0
- package/types/error-overlay.d.ts.map +1 -0
- package/types/index.d.ts +26 -177
- package/types/index.d.ts.map +1 -0
- package/types/scripts/fix-wasm-exports.d.ts +2 -0
- package/types/scripts/fix-wasm-exports.d.ts.map +1 -0
- package/types/src/analyzer/index.d.ts +8 -0
- package/types/src/analyzer/index.d.ts.map +1 -0
- package/types/src/build/compiler/file-transpiler.d.ts +5 -0
- package/types/src/build/compiler/file-transpiler.d.ts.map +1 -0
- package/types/src/build/compiler/index.d.ts +12 -0
- package/types/src/build/compiler/index.d.ts.map +1 -0
- package/types/src/build/compiler/route-discoverer.d.ts +2 -0
- package/types/src/build/compiler/route-discoverer.d.ts.map +1 -0
- package/types/src/build/compiler/router-generator.d.ts +2 -0
- package/types/src/build/compiler/router-generator.d.ts.map +1 -0
- package/types/src/build/css-builder.d.ts +18 -0
- package/types/src/build/css-builder.d.ts.map +1 -0
- package/types/src/build/generators/html-generator.d.ts +2 -0
- package/types/src/build/generators/html-generator.d.ts.map +1 -0
- package/types/src/build/generators/robots-generator.d.ts +11 -0
- package/types/src/build/generators/robots-generator.d.ts.map +1 -0
- package/types/src/build/generators/sitemap-generator.d.ts +5 -0
- package/types/src/build/generators/sitemap-generator.d.ts.map +1 -0
- package/types/src/build/image-optimizer.d.ts +11 -0
- package/types/src/build/image-optimizer.d.ts.map +1 -0
- package/types/src/build/processors/asset-processor.d.ts +2 -0
- package/types/src/build/processors/asset-processor.d.ts.map +1 -0
- package/types/src/build/processors/css-builder.d.ts +2 -0
- package/types/src/build/processors/css-builder.d.ts.map +1 -0
- package/types/src/build/server-island-validator.d.ts +27 -0
- package/types/src/build/server-island-validator.d.ts.map +1 -0
- package/types/src/build.d.ts +5 -0
- package/types/src/build.d.ts.map +1 -0
- package/types/src/cli.d.ts +2 -0
- package/types/src/cli.d.ts.map +1 -0
- package/types/src/client/compiler.d.ts +16 -0
- package/types/src/client/compiler.d.ts.map +1 -0
- package/types/src/client/fast-refresh.d.ts +3 -0
- package/types/src/client/fast-refresh.d.ts.map +1 -0
- package/types/src/client/hmr-runtime.d.ts +4 -0
- package/types/src/client/hmr-runtime.d.ts.map +1 -0
- package/types/src/compiler/index.d.ts +8 -0
- package/types/src/compiler/index.d.ts.map +1 -0
- package/types/src/compiler/router-generator-pure.d.ts +2 -0
- package/types/src/compiler/router-generator-pure.d.ts.map +1 -0
- package/types/src/compiler/transform.d.ts +36 -0
- package/types/src/compiler/transform.d.ts.map +1 -0
- package/types/src/config/defaultConfig.d.ts +26 -0
- package/types/src/config/defaultConfig.d.ts.map +1 -0
- package/types/src/config/index.d.ts +3 -0
- package/types/src/config/index.d.ts.map +1 -0
- package/types/src/config/loadConfig.d.ts +2 -0
- package/types/src/config/loadConfig.d.ts.map +1 -0
- package/types/src/css/index.d.ts +6 -0
- package/types/src/css/index.d.ts.map +1 -0
- package/types/src/css/processor.d.ts +23 -0
- package/types/src/css/processor.d.ts.map +1 -0
- package/types/src/dev.d.ts +2 -0
- package/types/src/dev.d.ts.map +1 -0
- package/types/src/hydration/index.d.ts +33 -0
- package/types/src/hydration/index.d.ts.map +1 -0
- package/types/src/image-optimizer/index.d.ts +24 -0
- package/types/src/image-optimizer/index.d.ts.map +1 -0
- package/types/src/images/index.d.ts +12 -0
- package/types/src/images/index.d.ts.map +1 -0
- package/types/src/images/processor.d.ts +30 -0
- package/types/src/images/processor.d.ts.map +1 -0
- package/types/src/layouts/index.d.ts +28 -0
- package/types/src/layouts/index.d.ts.map +1 -0
- package/types/src/loading/index.d.ts +28 -0
- package/types/src/loading/index.d.ts.map +1 -0
- package/types/src/logger/logger.d.ts +30 -0
- package/types/src/logger/logger.d.ts.map +1 -0
- package/types/src/middleware/index.d.ts +61 -0
- package/types/src/middleware/index.d.ts.map +1 -0
- package/types/src/router/Router.d.ts +16 -0
- package/types/src/router/Router.d.ts.map +1 -0
- package/types/src/router/SSRRouter.d.ts +20 -0
- package/types/src/router/SSRRouter.d.ts.map +1 -0
- package/types/src/router/index.d.ts +3 -0
- package/types/src/router/index.d.ts.map +1 -0
- package/types/src/scaffolder/index.d.ts +14 -0
- package/types/src/scaffolder/index.d.ts.map +1 -0
- package/types/src/serve.d.ts +3 -0
- package/types/src/serve.d.ts.map +1 -0
- package/types/src/server/dev-handler.d.ts +13 -0
- package/types/src/server/dev-handler.d.ts.map +1 -0
- package/types/src/server/dev-server-utils.d.ts +6 -0
- package/types/src/server/dev-server-utils.d.ts.map +1 -0
- package/types/src/server/dev-server.d.ts +18 -0
- package/types/src/server/dev-server.d.ts.map +1 -0
- package/types/src/server/hmr-handler.d.ts +19 -0
- package/types/src/server/hmr-handler.d.ts.map +1 -0
- package/types/src/server/index.d.ts +4 -0
- package/types/src/server/index.d.ts.map +1 -0
- package/types/src/server/request-handler.d.ts +19 -0
- package/types/src/server/request-handler.d.ts.map +1 -0
- package/types/src/server-islands/extractor.d.ts +16 -0
- package/types/src/server-islands/extractor.d.ts.map +1 -0
- package/types/src/server-islands/index.d.ts +3 -0
- package/types/src/server-islands/index.d.ts.map +1 -0
- package/types/src/utils/cache.d.ts +52 -0
- package/types/src/utils/cache.d.ts.map +1 -0
- package/types/src/utils/env.d.ts +20 -0
- package/types/src/utils/env.d.ts.map +1 -0
- package/types/src/utils/importhow.d.ts +15 -0
- package/types/src/utils/importhow.d.ts.map +1 -0
- package/types/src/utils/index.d.ts +3 -0
- package/types/src/utils/index.d.ts.map +1 -0
- package/types/src/utils/meta-extractor.d.ts +13 -0
- package/types/src/utils/meta-extractor.d.ts.map +1 -0
- package/types/config.d.ts +0 -33
- package/types/react.d.ts +0 -16
- package/types/router.d.ts +0 -79
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scan source code to determine if a component needs hydration
|
|
3
|
+
*/
|
|
4
|
+
export function needsHydration(sourceCode: any): boolean;
|
|
5
|
+
/**
|
|
6
|
+
* Get which specific interactive features a component uses
|
|
7
|
+
*/
|
|
8
|
+
export function getInteractiveFeatures(sourceCode: any): {
|
|
9
|
+
type: string;
|
|
10
|
+
name: string;
|
|
11
|
+
}[];
|
|
12
|
+
/**
|
|
13
|
+
* Analyze all routes and classify them
|
|
14
|
+
* Returns: { static: [], interactive: [], mixed: [] }
|
|
15
|
+
*/
|
|
16
|
+
export function analyzeRoutes(routes: any): Promise<{
|
|
17
|
+
static: never[];
|
|
18
|
+
interactive: never[];
|
|
19
|
+
mixed: never[];
|
|
20
|
+
}>;
|
|
21
|
+
/**
|
|
22
|
+
* Generate hydration-aware router that skips JS for static routes
|
|
23
|
+
* Key insight: static routes still render HTML, just skip React.hydrate()
|
|
24
|
+
*/
|
|
25
|
+
export function generatePartialHydrationCode(routes: any, analyzedRoutes: any): {
|
|
26
|
+
imports: any;
|
|
27
|
+
routeConfigs: any;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Log hydration analysis results
|
|
31
|
+
*/
|
|
32
|
+
export function logHydrationReport(analyzedRoutes: any): void;
|
|
33
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hydration/index.js"],"names":[],"mappings":"AAuBA;;GAEG;AACH,yDAOC;AAED;;GAEG;AACH;;;IAmBC;AAED;;;GAGG;AACH;;;;GAkCC;AAED;;;GAGG;AACH;;;EA6BC;AAED;;GAEG;AACH,8DAaC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export function optimizeImage(buffer: any, options?: {}): Promise<{
|
|
2
|
+
data: any;
|
|
3
|
+
original_size: any;
|
|
4
|
+
optimized_size: any;
|
|
5
|
+
format: any;
|
|
6
|
+
savings_percent: number;
|
|
7
|
+
}>;
|
|
8
|
+
export function optimizeImagesBatch(images: any, format?: string, options?: {}): Promise<({
|
|
9
|
+
filename: any;
|
|
10
|
+
data: any;
|
|
11
|
+
original_size: any;
|
|
12
|
+
optimized_size: any;
|
|
13
|
+
format: any;
|
|
14
|
+
savings_percent: number;
|
|
15
|
+
error?: never;
|
|
16
|
+
success?: never;
|
|
17
|
+
} | {
|
|
18
|
+
filename: any;
|
|
19
|
+
error: any;
|
|
20
|
+
success: boolean;
|
|
21
|
+
})[]>;
|
|
22
|
+
export function hasWasm(): boolean;
|
|
23
|
+
export const version: "1.1.7";
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/image-optimizer/index.js"],"names":[],"mappings":"AASA;;;;;;GAaC;AAqDD;;;;;;;;;;;;;MAwBC;AAEM,mCAA2B;AAClC,sBAAuB,OAAO,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export function isImageFile(filename: any): boolean;
|
|
2
|
+
export function copyImagesSync(srcDir: any, destDir: any): {
|
|
3
|
+
copied: number;
|
|
4
|
+
skipped: number;
|
|
5
|
+
};
|
|
6
|
+
export function getImageContentType(ext: any): any;
|
|
7
|
+
export function getImageFiles(dir: any, baseDir?: any): any[];
|
|
8
|
+
export function getTotalImageSize(images: any): any;
|
|
9
|
+
export function formatBytes(bytes: any): string;
|
|
10
|
+
export const IMAGE_EXTENSIONS: string[];
|
|
11
|
+
export { optimizeImages, copyImages } from "../build/image-optimizer.js";
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/images/index.js"],"names":[],"mappings":"AAYA,oDAGC;AAED;;;EAmCC;AAED,mDAYC;AAED,8DAkBC;AAED,oDAEC;AAED,gDAMC;AA3FD,wCAGE"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check if a file is an image based on extension
|
|
3
|
+
*/
|
|
4
|
+
export function isImageFile(filename: any): boolean;
|
|
5
|
+
/**
|
|
6
|
+
* Get image content type for HTTP headers
|
|
7
|
+
*/
|
|
8
|
+
export function getImageContentType(ext: any): any;
|
|
9
|
+
/**
|
|
10
|
+
* Copy images synchronously from source to destination
|
|
11
|
+
*/
|
|
12
|
+
export function copyImagesSync(srcDir: any, destDir: any, options?: {}): {
|
|
13
|
+
copied: number;
|
|
14
|
+
skipped: number;
|
|
15
|
+
failed: number;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Get all image files from a directory recursively
|
|
19
|
+
*/
|
|
20
|
+
export function getImageFiles(dir: any, baseDir?: any): any[];
|
|
21
|
+
/**
|
|
22
|
+
* Calculate total size of images
|
|
23
|
+
*/
|
|
24
|
+
export function getTotalImageSize(images: any): any;
|
|
25
|
+
/**
|
|
26
|
+
* Format bytes to human readable
|
|
27
|
+
*/
|
|
28
|
+
export function formatBytes(bytes: any): string;
|
|
29
|
+
export const IMAGE_EXTENSIONS: string[];
|
|
30
|
+
//# sourceMappingURL=processor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processor.d.ts","sourceRoot":"","sources":["../../../src/images/processor.js"],"names":[],"mappings":"AAWA;;GAEG;AACH,oDAIC;AAED;;GAEG;AACH,mDAgBC;AAED;;GAEG;AACH;;;;EAuEC;AAED;;GAEG;AACH,8DA8BC;AAED;;GAEG;AACH,oDAEC;AAED;;GAEG;AACH,gDAMC;AAlKD,wCAGE"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Discover all layouts in src/layouts/
|
|
3
|
+
* Layout naming convention:
|
|
4
|
+
* default.tsx → wraps all pages (fallback)
|
|
5
|
+
* blog.tsx → wraps pages in /blog/*
|
|
6
|
+
* [route].tsx → wraps pages matching route prefix
|
|
7
|
+
*/
|
|
8
|
+
export function discoverLayouts(root: any): Promise<{}>;
|
|
9
|
+
/**
|
|
10
|
+
* Match which layout applies to a given route
|
|
11
|
+
* Priority: exact name match > default
|
|
12
|
+
*/
|
|
13
|
+
export function matchLayout(route: any, layouts: any): any;
|
|
14
|
+
/**
|
|
15
|
+
* Generate layout wrapper code for the compiler
|
|
16
|
+
* Wraps the page component with the layout component
|
|
17
|
+
*/
|
|
18
|
+
export function generateLayoutWrapper(pageImportPath: any, layoutImportPath: any, componentName?: string): string;
|
|
19
|
+
/**
|
|
20
|
+
* Compile layouts directory - transpiles layout files to .bertui/compiled/layouts/
|
|
21
|
+
*/
|
|
22
|
+
export function compileLayouts(root: any, compiledDir: any): Promise<{}>;
|
|
23
|
+
/**
|
|
24
|
+
* Inject layout into router generation
|
|
25
|
+
* Called by router-generator to wrap page components with their layouts
|
|
26
|
+
*/
|
|
27
|
+
export function injectLayoutsIntoRouter(routes: any, layouts: any, compiledDir: any): any;
|
|
28
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/layouts/index.js"],"names":[],"mappings":"AAOA;;;;;;GAMG;AACH,wDA8BC;AAED;;;GAGG;AACH,2DAiBC;AAED;;;GAGG;AACH,kHAcC;AAED;;GAEG;AACH,yEAqDC;AAED;;;GAGG;AACH,0FAaC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Discover per-route loading components from src/pages/
|
|
3
|
+
* Convention: create a loading.tsx next to your page file
|
|
4
|
+
* e.g., src/pages/blog/loading.tsx → shown while /blog loads
|
|
5
|
+
*/
|
|
6
|
+
export function discoverLoadingComponents(root: any): Promise<{}>;
|
|
7
|
+
/**
|
|
8
|
+
* Compile loading components to .bertui/compiled/loading/
|
|
9
|
+
*/
|
|
10
|
+
export function compileLoadingComponents(root: any, compiledDir: any): Promise<{}>;
|
|
11
|
+
/**
|
|
12
|
+
* Generate loading-aware router code
|
|
13
|
+
* Wraps each route component with Suspense + loading fallback
|
|
14
|
+
*/
|
|
15
|
+
export function generateLoadingAwareRouter(routes: any, loadingComponents: any): {
|
|
16
|
+
loadingImports: string;
|
|
17
|
+
getLoadingComponent: (route: any) => string | null;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Generate the default loading screen script to inject into HTML
|
|
21
|
+
*/
|
|
22
|
+
export function getLoadingScript(customText?: string, color?: string): string;
|
|
23
|
+
/**
|
|
24
|
+
* Default loading spinner HTML injected into pages
|
|
25
|
+
* Beautiful, zero-dependency, CSS-only spinner
|
|
26
|
+
*/
|
|
27
|
+
export const DEFAULT_LOADING_HTML: "\n<div id=\"bertui-loading\" style=\"\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: rgba(255,255,255,0.95);\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n z-index: 99999;\n font-family: system-ui, sans-serif;\n transition: opacity 0.2s ease;\n\">\n <div style=\"\n width: 40px;\n height: 40px;\n border: 3px solid #e5e7eb;\n border-top-color: #10b981;\n border-radius: 50%;\n animation: bertui-spin 0.7s linear infinite;\n \"></div>\n <p style=\"margin-top: 16px; color: #6b7280; font-size: 14px; font-weight: 500;\">Loading...</p>\n</div>\n<style>\n @keyframes bertui-spin {\n to { transform: rotate(360deg); }\n }\n</style>\n<script>\n // Remove loading screen once React mounts\n window.__BERTUI_HIDE_LOADING__ = function() {\n const el = document.getElementById('bertui-loading');\n if (el) {\n el.style.opacity = '0';\n setTimeout(() => el.remove(), 200);\n }\n };\n \n // Fallback: remove after 5s no matter what\n setTimeout(() => window.__BERTUI_HIDE_LOADING__?.(), 5000);\n \n // React root observer - hide when #root gets children\n const observer = new MutationObserver(() => {\n const root = document.getElementById('root');\n if (root && root.children.length > 0) {\n window.__BERTUI_HIDE_LOADING__?.();\n observer.disconnect();\n }\n });\n const root = document.getElementById('root');\n if (root) observer.observe(root, { childList: true, subtree: true });\n</script>\n";
|
|
28
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/loading/index.js"],"names":[],"mappings":"AAoEA;;;;GAIG;AACH,kEAqCC;AAED;;GAEG;AACH,mFA2CC;AAED;;;GAGG;AACH;;;EAoCC;AAED;;GAEG;AACH,8EAIC;AA1MD;;;GAGG;AACH,8jDAuDE"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export function printHeader(mode?: string): void;
|
|
2
|
+
export function step(index: any, total: any, label: any, detail?: string): void;
|
|
3
|
+
export function stepDone(label: any, detail?: string): void;
|
|
4
|
+
export function stepFail(label: any, detail?: string): void;
|
|
5
|
+
export function fileProgress(current: any, total: any, filename: any): void;
|
|
6
|
+
export function info(msg: any): void;
|
|
7
|
+
export function success(msg: any): void;
|
|
8
|
+
export function warn(msg: any): void;
|
|
9
|
+
export function error(msg: any): void;
|
|
10
|
+
export function debug(msg: any): void;
|
|
11
|
+
export function table(rows: any): void;
|
|
12
|
+
export function bigLog(title: any, opts?: {}): void;
|
|
13
|
+
export function printSummary(stats?: {}): void;
|
|
14
|
+
declare namespace _default {
|
|
15
|
+
export { printHeader };
|
|
16
|
+
export { step };
|
|
17
|
+
export { stepDone };
|
|
18
|
+
export { stepFail };
|
|
19
|
+
export { fileProgress };
|
|
20
|
+
export { info };
|
|
21
|
+
export { success };
|
|
22
|
+
export { warn };
|
|
23
|
+
export { error };
|
|
24
|
+
export { debug };
|
|
25
|
+
export { table };
|
|
26
|
+
export { bigLog };
|
|
27
|
+
export { printSummary };
|
|
28
|
+
}
|
|
29
|
+
export default _default;
|
|
30
|
+
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../src/logger/logger.js"],"names":[],"mappings":"AA8CA,iDA2BC;AAGD,gFAQC;AAED,4DASC;AAED,4DAQC;AAGD,4EAWC;AAGD,qCAGC;AAED,wCAGC;AAED,qCAMC;AAED,sCAKC;AAED,sCAEC;AAGD,uCAsBC;AAGD,oDAKC;AAGD,+CA0BC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Load and run user middleware from src/middleware.ts or src/middleware.js
|
|
3
|
+
*/
|
|
4
|
+
export function loadMiddleware(root: any): Promise<{
|
|
5
|
+
default: any;
|
|
6
|
+
onRequest: any;
|
|
7
|
+
onResponse: any;
|
|
8
|
+
onError: any;
|
|
9
|
+
} | null>;
|
|
10
|
+
/**
|
|
11
|
+
* Run middleware chain for a request
|
|
12
|
+
* Returns a Response if middleware intercepted, null to continue
|
|
13
|
+
*/
|
|
14
|
+
export function runMiddleware(middlewareMod: any, request: any, routeInfo?: {}): Promise<Response | null>;
|
|
15
|
+
/**
|
|
16
|
+
* Middleware context passed to every middleware function
|
|
17
|
+
*/
|
|
18
|
+
export class MiddlewareContext {
|
|
19
|
+
constructor(request: any, options?: {});
|
|
20
|
+
request: any;
|
|
21
|
+
url: URL;
|
|
22
|
+
pathname: string;
|
|
23
|
+
method: any;
|
|
24
|
+
headers: {
|
|
25
|
+
[k: string]: any;
|
|
26
|
+
};
|
|
27
|
+
params: any;
|
|
28
|
+
route: any;
|
|
29
|
+
_response: Response | null;
|
|
30
|
+
_redirectTo: any;
|
|
31
|
+
_stopped: boolean;
|
|
32
|
+
locals: {};
|
|
33
|
+
/** Respond early - stops further processing */
|
|
34
|
+
respond(body: any, init?: {}): void;
|
|
35
|
+
/** Redirect to another URL */
|
|
36
|
+
redirect(url: any, status?: number): void;
|
|
37
|
+
/** Set a response header (added to final response) */
|
|
38
|
+
setHeader(key: any, value: any): void;
|
|
39
|
+
_extraHeaders: {} | undefined;
|
|
40
|
+
/** Check if middleware stopped the chain */
|
|
41
|
+
get stopped(): boolean;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* MiddlewareManager - watches and reloads middleware on change
|
|
45
|
+
*/
|
|
46
|
+
export class MiddlewareManager {
|
|
47
|
+
constructor(root: any);
|
|
48
|
+
root: any;
|
|
49
|
+
middleware: {
|
|
50
|
+
default: any;
|
|
51
|
+
onRequest: any;
|
|
52
|
+
onResponse: any;
|
|
53
|
+
onError: any;
|
|
54
|
+
} | null;
|
|
55
|
+
watcher: any;
|
|
56
|
+
load(): Promise<this>;
|
|
57
|
+
run(request: any, routeInfo?: {}): Promise<Response | null>;
|
|
58
|
+
watch(): void;
|
|
59
|
+
dispose(): void;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/middleware/index.js"],"names":[],"mappings":"AAwDA;;GAEG;AACH;;;;;UA2CC;AAED;;;GAGG;AACH,0GA+BC;AApID;;GAEG;AACH;IACE,wCAYC;IAXC,aAAsB;IACtB,SAA+B;IAC/B,iBAAiC;IACjC,YAA4B;IAC5B;;MAA4D;IAC5D,YAAkC;IAClC,WAAkC;IAClC,2BAAqB;IACrB,iBAAuB;IACvB,kBAAqB;IACrB,WAAgB;IAGlB,+CAA+C;IAC/C,oCASC;IAED,8BAA8B;IAC9B,0CAIC;IAED,sDAAsD;IACtD,sCAGC;IAF0B,8BAAuB;IAIlD,4CAA4C;IAC5C,uBAEC;CACF;AAuFD;;GAEG;AACH;IACE,uBAIC;IAHC,UAAgB;IAChB;;;;;aAAsB;IACtB,aAAmB;IAGrB,sBAGC;IAED,4DAEC;IAED,cAgBC;IAED,gBAEC;CACF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export function useRouter(): {
|
|
2
|
+
pathname: string;
|
|
3
|
+
params: {};
|
|
4
|
+
navigate: () => void;
|
|
5
|
+
currentRoute: null;
|
|
6
|
+
isSSR: boolean;
|
|
7
|
+
};
|
|
8
|
+
export function Router({ routes }: {
|
|
9
|
+
routes: any;
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export function Link({ to, children, ...props }: {
|
|
12
|
+
[x: string]: any;
|
|
13
|
+
to: any;
|
|
14
|
+
children: any;
|
|
15
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
//# sourceMappingURL=Router.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Router.d.ts","sourceRoot":"","sources":["../../../src/router/Router.js"],"names":[],"mappings":"AAMA;;;;;;EAmBC;AAED;;4CAyEC;AAGD;;;;4CA2BC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export function useRouter(): {
|
|
2
|
+
pathname: string;
|
|
3
|
+
params: {};
|
|
4
|
+
navigate: () => void;
|
|
5
|
+
isSSR: boolean;
|
|
6
|
+
};
|
|
7
|
+
export function SSRRouter({ routes, initialPath }: {
|
|
8
|
+
routes: any;
|
|
9
|
+
initialPath?: string | undefined;
|
|
10
|
+
}): React.DetailedReactHTMLElement<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
|
|
11
|
+
export function Link({ to, children, ...props }: {
|
|
12
|
+
[x: string]: any;
|
|
13
|
+
to: any;
|
|
14
|
+
children: any;
|
|
15
|
+
}): React.DetailedReactHTMLElement<{
|
|
16
|
+
href: any;
|
|
17
|
+
onClick: (e: any) => void;
|
|
18
|
+
}, HTMLElement>;
|
|
19
|
+
import React from 'react';
|
|
20
|
+
//# sourceMappingURL=SSRRouter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SSRRouter.d.ts","sourceRoot":"","sources":["../../../src/router/SSRRouter.js"],"names":[],"mappings":"AAOA;;;;;EAcC;AAGD;;;kGA8FC;AAGD;;;;;;;gBAYC;kBAnIqE,OAAO"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/router/index.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export function scaffold(type: any, name: any, options?: {}): Promise<any>;
|
|
2
|
+
/**
|
|
3
|
+
* Parse CLI args for the create command
|
|
4
|
+
* Usage: bertui create component Button
|
|
5
|
+
* bertui create page About
|
|
6
|
+
* bertui create layout default
|
|
7
|
+
* bertui create loading blog
|
|
8
|
+
* bertui create middleware
|
|
9
|
+
*/
|
|
10
|
+
export function parseCreateArgs(args: any): {
|
|
11
|
+
type: any;
|
|
12
|
+
name: any;
|
|
13
|
+
} | null;
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/scaffolder/index.js"],"names":[],"mappings":"AAiJA,2EAsBC;AAuHD;;;;;;;GAOG;AACH;;;SAeC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../../src/serve.js"],"names":[],"mappings":"AA+BA,+DAgHC;AAGD,8DAwCC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export function createDevHandler(options?: {}): Promise<{
|
|
2
|
+
handleRequest: (request: any) => Promise<any>;
|
|
3
|
+
start: () => Promise<any>;
|
|
4
|
+
notifyClients: (message: any) => void;
|
|
5
|
+
dispose: () => void;
|
|
6
|
+
config: any;
|
|
7
|
+
hasRouter: any;
|
|
8
|
+
websocketHandler: {
|
|
9
|
+
open(ws: any): void;
|
|
10
|
+
close(ws: any): void;
|
|
11
|
+
};
|
|
12
|
+
}>;
|
|
13
|
+
//# sourceMappingURL=dev-handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-handler.d.ts","sourceRoot":"","sources":["../../../src/server/dev-handler.js"],"names":[],"mappings":"AAQA;;;;;;;;;;;GAoLC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export function getImageContentType(ext: any): any;
|
|
2
|
+
export function getContentType(ext: any): any;
|
|
3
|
+
export function buildDevImportMap(root: any): Promise<any>;
|
|
4
|
+
export function serveHTML(root: any, hasRouter: any, config: any, port: any): Promise<string>;
|
|
5
|
+
export function setupFileWatcher(root: any, compiledDir: any, clients: any, onRecompile: any): () => void;
|
|
6
|
+
//# sourceMappingURL=dev-server-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-server-utils.d.ts","sourceRoot":"","sources":["../../../src/server/dev-server-utils.js"],"names":[],"mappings":"AAQA,mDAYC;AAGD,8CAwBC;AAWD,2DAuFC;AAMD,8FAuHC;AAQD,0GA4HC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export function startDevServer(options?: {}): Promise<{
|
|
2
|
+
handler: {
|
|
3
|
+
handleRequest: (request: any) => Promise<any>;
|
|
4
|
+
start: () => Promise<any>;
|
|
5
|
+
notifyClients: (message: any) => void;
|
|
6
|
+
dispose: () => void;
|
|
7
|
+
config: any;
|
|
8
|
+
hasRouter: any;
|
|
9
|
+
websocketHandler: {
|
|
10
|
+
open(ws: any): void;
|
|
11
|
+
close(ws: any): void;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
server: any;
|
|
15
|
+
}>;
|
|
16
|
+
export { createDevHandler } from "./dev-handler.js";
|
|
17
|
+
export { handleRequest } from "./request-handler.js";
|
|
18
|
+
//# sourceMappingURL=dev-server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-server.d.ts","sourceRoot":"","sources":["../../../src/server/dev-server.js"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;GAIC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export class HMRHandler {
|
|
2
|
+
constructor(root: any);
|
|
3
|
+
root: any;
|
|
4
|
+
clients: Set<any>;
|
|
5
|
+
compilationQueue: Map<any, any>;
|
|
6
|
+
pendingUpdates: Set<any>;
|
|
7
|
+
isProcessing: boolean;
|
|
8
|
+
onOpen(ws: any): void;
|
|
9
|
+
onClose(ws: any): void;
|
|
10
|
+
onMessage(ws: any, message: any): void;
|
|
11
|
+
notifyAll(message: any): void;
|
|
12
|
+
queueRecompile(filename: any): void;
|
|
13
|
+
processQueue(): Promise<void>;
|
|
14
|
+
handleAccept(moduleId: any): void;
|
|
15
|
+
handleDecline(moduleId: any): void;
|
|
16
|
+
reload(): void;
|
|
17
|
+
dispose(): void;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=hmr-handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hmr-handler.d.ts","sourceRoot":"","sources":["../../../src/server/hmr-handler.js"],"names":[],"mappings":"AAMA;IACE,uBAMC;IALC,UAAgB;IAChB,kBAAwB;IACxB,gCAAiC;IACjC,yBAA+B;IAC/B,sBAAyB;IAI3B,sBASC;IAED,uBAGC;IAED,uCAeC;IAGD,8BAUC;IAGD,oCAMC;IAGD,8BAkDC;IAGD,kCAEC;IAGD,mCAGC;IAGD,eAEC;IAGD,gBAKC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/index.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Handle a single HTTP request with BertUI
|
|
3
|
+
* @param {Request} request - The HTTP request
|
|
4
|
+
* @param {Object} options - Options
|
|
5
|
+
* @param {string} options.root - Project root directory
|
|
6
|
+
* @param {number} options.port - Port number
|
|
7
|
+
* @returns {Promise<Response|null>} Response or null if not handled
|
|
8
|
+
*/
|
|
9
|
+
export function handleRequest(request: Request, options?: {
|
|
10
|
+
root: string;
|
|
11
|
+
port: number;
|
|
12
|
+
}): Promise<Response | null>;
|
|
13
|
+
/**
|
|
14
|
+
* Create a middleware function for Elysia
|
|
15
|
+
* @param {Object} options - Options
|
|
16
|
+
* @returns {Function} Elysia middleware
|
|
17
|
+
*/
|
|
18
|
+
export function createElysiaMiddleware(options?: Object): Function;
|
|
19
|
+
//# sourceMappingURL=request-handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-handler.d.ts","sourceRoot":"","sources":["../../../src/server/request-handler.js"],"names":[],"mappings":"AAKA;;;;;;;GAOG;AACH,uCANW,OAAO,YAEf;IAAwB,IAAI,EAApB,MAAM;IACU,IAAI,EAApB,MAAM;CACd,GAAU,OAAO,CAAC,QAAQ,GAAC,IAAI,CAAC,CAKlC;AAED;;;;GAIG;AACH,iDAHW,MAAM,YAehB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extract static HTML from a Server Island component
|
|
3
|
+
* @param {string} sourceCode - The component source code
|
|
4
|
+
* @param {string} filePath - Path to file (for error messages)
|
|
5
|
+
* @returns {string|null} Extracted HTML or null if extraction fails
|
|
6
|
+
*/
|
|
7
|
+
export function extractStaticHTML(sourceCode: string, filePath?: string): string | null;
|
|
8
|
+
/**
|
|
9
|
+
* Quick check if a file is a Server Island
|
|
10
|
+
*/
|
|
11
|
+
export function isServerIsland(sourceCode: any): any;
|
|
12
|
+
/**
|
|
13
|
+
* Extract component name from file
|
|
14
|
+
*/
|
|
15
|
+
export function extractComponentName(filePath: any): any;
|
|
16
|
+
//# sourceMappingURL=extractor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extractor.d.ts","sourceRoot":"","sources":["../../../src/server-islands/extractor.js"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH,8CAJW,MAAM,aACN,MAAM,GACJ,MAAM,GAAC,IAAI,CAqFvB;AA0FD;;GAEG;AACH,qDAEC;AAED;;GAEG;AACH,yDAGC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server-islands/index.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export function cached(options?: {}): (target: any, propertyKey: any, descriptor: any) => any;
|
|
2
|
+
export class BertuiCache {
|
|
3
|
+
constructor(options?: {});
|
|
4
|
+
maxSize: any;
|
|
5
|
+
ttl: any;
|
|
6
|
+
stats: {
|
|
7
|
+
hits: number;
|
|
8
|
+
misses: number;
|
|
9
|
+
sets: number;
|
|
10
|
+
evictions: number;
|
|
11
|
+
};
|
|
12
|
+
store: Map<any, any>;
|
|
13
|
+
fileCache: Map<any, any>;
|
|
14
|
+
fileTimestamps: Map<any, any>;
|
|
15
|
+
codeCache: Map<any, any>;
|
|
16
|
+
cssCache: Map<any, any>;
|
|
17
|
+
imageCache: Map<any, any>;
|
|
18
|
+
weakCache: Map<any, any> | undefined;
|
|
19
|
+
cleanupInterval: number;
|
|
20
|
+
get(key: any, options?: {}): any;
|
|
21
|
+
set(key: any, value: any, options?: {}): void;
|
|
22
|
+
getFile(filePath: any, options?: {}): Promise<any>;
|
|
23
|
+
getTransformed(sourceCode: any, options?: {}): any;
|
|
24
|
+
setTransformed(sourceCode: any, result: any, options?: {}): void;
|
|
25
|
+
getCSS(css: any, options?: {}): any;
|
|
26
|
+
setCSS(css: any, result: any, options?: {}): void;
|
|
27
|
+
mget(keys: any): any[];
|
|
28
|
+
mset(entries: any): void;
|
|
29
|
+
getStats(): {
|
|
30
|
+
hits: number;
|
|
31
|
+
misses: number;
|
|
32
|
+
sets: number;
|
|
33
|
+
evictions: number;
|
|
34
|
+
hitRate: string;
|
|
35
|
+
size: number;
|
|
36
|
+
fileCacheSize: number;
|
|
37
|
+
codeCacheSize: number;
|
|
38
|
+
cssCacheSize: number;
|
|
39
|
+
imageCacheSize: number;
|
|
40
|
+
memory: {
|
|
41
|
+
heapUsed: string;
|
|
42
|
+
heapTotal: string;
|
|
43
|
+
rss: string;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
getSize(value: any): any;
|
|
47
|
+
evictLRU(): void;
|
|
48
|
+
cleanup(): void;
|
|
49
|
+
dispose(): void;
|
|
50
|
+
}
|
|
51
|
+
export const globalCache: BertuiCache;
|
|
52
|
+
//# sourceMappingURL=cache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../../src/utils/cache.js"],"names":[],"mappings":"AAqRA,uCACkB,WAAM,EAAE,gBAAW,EAAE,eAAU,SAkBhD;AApSD;IACE,0BA4BC;IA3BC,aAAsC;IACtC,SAA+B;IAC/B;;;;;MAA0D;IAG1D,qBAAsB;IAGtB,yBAA0B;IAC1B,8BAA+B;IAG/B,yBAA0B;IAG1B,wBAAyB;IAGzB,0BAA2B;IAIzB,qCAA0B;IAI5B,wBAA+D;IAIjE,iCA8BC;IAED,8CA0BC;IAGD,mDA2CC;IAGD,mDAQC;IAED,iEAQC;IAGD,oCAOC;IAED,kDAOC;IAGD,uBAMC;IAED,yBAIC;IAGD;;;;;;;;;;;;;;;;MAwBC;IAGD,yBAKC;IAED,iBASC;IAED,gBAeC;IAED,gBAUC;CACF;AAGD,sCAA6C"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Load environment variables from .env file
|
|
3
|
+
* @param {string} root - Project root directory
|
|
4
|
+
* @returns {Object} Environment variables
|
|
5
|
+
*/
|
|
6
|
+
export function loadEnvVariables(root: string): Object;
|
|
7
|
+
/**
|
|
8
|
+
* Generate JavaScript code to expose environment variables
|
|
9
|
+
* @param {Object} envVars - Environment variables object
|
|
10
|
+
* @returns {string} JavaScript code
|
|
11
|
+
*/
|
|
12
|
+
export function generateEnvCode(envVars: Object): string;
|
|
13
|
+
/**
|
|
14
|
+
* Replace process.env references in code
|
|
15
|
+
* @param {string} code - Source code
|
|
16
|
+
* @param {Object} envVars - Environment variables
|
|
17
|
+
* @returns {string} Code with replaced env vars
|
|
18
|
+
*/
|
|
19
|
+
export function replaceEnvInCode(code: string, envVars: Object): string;
|
|
20
|
+
//# sourceMappingURL=env.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../../src/utils/env.js"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,uCAHW,MAAM,GACJ,MAAM,CAyClB;AAED;;;;GAIG;AACH,yCAHW,MAAM,GACJ,MAAM,CAclB;AAED;;;;;GAKG;AACH,uCAJW,MAAM,WACN,MAAM,GACJ,MAAM,CAYlB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {Object} importhow - { alias: relPath } from bertui.config.js
|
|
3
|
+
* @param {string} projectRoot - absolute project root
|
|
4
|
+
* @param {string} compiledDir - if set, aliases resolve to compiledDir/<alias>
|
|
5
|
+
* pass .bertui/compiled in dev mode
|
|
6
|
+
* leave null in build mode (uses raw source paths)
|
|
7
|
+
*/
|
|
8
|
+
export function buildAliasMap(importhow: Object | undefined, projectRoot: string, compiledDir?: string): Map<any, any>;
|
|
9
|
+
/**
|
|
10
|
+
* Rewrite alias import specifiers in compiled code.
|
|
11
|
+
* 'amani/button' → '../components/button.js'
|
|
12
|
+
*/
|
|
13
|
+
export function rewriteAliasImports(code: any, currentFile: any, aliasMap: any): any;
|
|
14
|
+
export function getAliasDirs(aliasMap: any): Set<any>;
|
|
15
|
+
//# sourceMappingURL=importhow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"importhow.d.ts","sourceRoot":"","sources":["../../../src/utils/importhow.js"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,yCANW,MAAM,2BACN,MAAM,gBACN,MAAM,iBAahB;AAED;;;GAGG;AACH,qFAoBC;AAED,sDAIC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extract meta information from page component source code
|
|
3
|
+
* @param {string} sourceCode - Component source code
|
|
4
|
+
* @returns {Object} Extracted meta information
|
|
5
|
+
*/
|
|
6
|
+
export function extractMetaFromSource(sourceCode: string): Object;
|
|
7
|
+
/**
|
|
8
|
+
* Generate HTML meta tags from meta object
|
|
9
|
+
* @param {Object} meta - Meta information object
|
|
10
|
+
* @returns {string} HTML meta tags
|
|
11
|
+
*/
|
|
12
|
+
export function generateMetaTags(meta: Object): string;
|
|
13
|
+
//# sourceMappingURL=meta-extractor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta-extractor.d.ts","sourceRoot":"","sources":["../../../src/utils/meta-extractor.js"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,kDAHW,MAAM,GACJ,MAAM,CA4DlB;AAED;;;;GAIG;AACH,uCAHW,MAAM,GACJ,MAAM,CAuClB"}
|