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.
- 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 +9 -1
- package/src/client/compiler.js +1 -0
- 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,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validates that a Server Island component follows all rules
|
|
3
|
+
* @param {string} sourceCode - The component source code
|
|
4
|
+
* @param {string} filePath - Path to the file (for error messages)
|
|
5
|
+
* @returns {{ valid: boolean, errors: string[] }}
|
|
6
|
+
*/
|
|
7
|
+
export function validateServerIsland(sourceCode: string, filePath: string): {
|
|
8
|
+
valid: boolean;
|
|
9
|
+
errors: string[];
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Display validation errors in a clear format
|
|
13
|
+
*/
|
|
14
|
+
export function displayValidationErrors(filePath: any, errors: any): void;
|
|
15
|
+
/**
|
|
16
|
+
* Extract and validate all Server Islands in a project
|
|
17
|
+
*/
|
|
18
|
+
export function validateAllServerIslands(routes: any): Promise<{
|
|
19
|
+
serverIslands: any[];
|
|
20
|
+
validationResults: {
|
|
21
|
+
valid: boolean;
|
|
22
|
+
errors: string[];
|
|
23
|
+
route: any;
|
|
24
|
+
path: any;
|
|
25
|
+
}[];
|
|
26
|
+
}>;
|
|
27
|
+
//# sourceMappingURL=server-island-validator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server-island-validator.d.ts","sourceRoot":"","sources":["../../../src/build/server-island-validator.js"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH,iDAJW,MAAM,YACN,MAAM,GACJ;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAoGhD;AAED;;GAEG;AACH,0EAYC;AAED;;GAEG;AACH;;;eA1HsB,OAAO;gBAAU,MAAM,EAAE;;;;GAkJ9C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/build.js"],"names":[],"mappings":"AAqBA;;GAkGC;AAqHD,mDAQC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/cli.js"],"names":[],"mappings":"AASA,gCA+EC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export function compileProject(root: any): Promise<{
|
|
2
|
+
outDir: any;
|
|
3
|
+
stats: {
|
|
4
|
+
files: number;
|
|
5
|
+
skipped: number;
|
|
6
|
+
};
|
|
7
|
+
routes: any[];
|
|
8
|
+
}>;
|
|
9
|
+
export function compileFile(srcPath: any, root: any): Promise<{
|
|
10
|
+
success: boolean;
|
|
11
|
+
outputPath?: never;
|
|
12
|
+
} | {
|
|
13
|
+
outputPath: any;
|
|
14
|
+
success: boolean;
|
|
15
|
+
}>;
|
|
16
|
+
//# sourceMappingURL=compiler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compiler.d.ts","sourceRoot":"","sources":["../../../src/client/compiler.js"],"names":[],"mappings":"AAQA;;;;;;;GAoFC;AAED;;;;;;GAiDC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fast-refresh.d.ts","sourceRoot":"","sources":["../../../src/client/fast-refresh.js"],"names":[],"mappings":"AA4DO,wCAKN;AAEM,4CAIN"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hmr-runtime.d.ts","sourceRoot":"","sources":["../../../src/client/hmr-runtime.js"],"names":[],"mappings":";IA0D8B,yBAAQ"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export function transformJSX(sourceCode: any, options?: {}): Promise<any>;
|
|
2
|
+
export { compileProject } from "../client/compiler.js";
|
|
3
|
+
export { compileForBuild } from "../build/compiler/index.js";
|
|
4
|
+
export { discoverRoutes } from "../build/compiler/route-discoverer.js";
|
|
5
|
+
export { validateServerIsland } from "../build/server-island-validator.js";
|
|
6
|
+
export { generateRouterCode } from "./router-generator-pure.js";
|
|
7
|
+
export { transformJSX, transformJSXSync, containsJSX, removeCSSImports, removeDotenvImports, fixRelativeImports } from "./transform.js";
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/compiler/index.js"],"names":[],"mappings":"AAOA,0EASC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"router-generator-pure.d.ts","sourceRoot":"","sources":["../../../src/compiler/router-generator-pure.js"],"names":[],"mappings":"AAGA,wDAoGC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transform JSX/TSX code to JavaScript
|
|
3
|
+
* @param {string} sourceCode - The source code to transform
|
|
4
|
+
* @param {Object} options - Transformation options
|
|
5
|
+
* @param {string} options.loader - 'jsx', 'tsx', 'ts', 'js' (default: 'tsx')
|
|
6
|
+
* @param {string} options.env - 'development' or 'production' (default: 'development')
|
|
7
|
+
* @param {boolean} options.addReactImport - Automatically add React import if missing (default: true)
|
|
8
|
+
* @returns {Promise<string>} Transformed JavaScript code
|
|
9
|
+
*/
|
|
10
|
+
export function transformJSX(sourceCode: string, options?: {
|
|
11
|
+
loader: string;
|
|
12
|
+
env: string;
|
|
13
|
+
addReactImport: boolean;
|
|
14
|
+
}): Promise<string>;
|
|
15
|
+
/**
|
|
16
|
+
* Synchronous version of transformJSX
|
|
17
|
+
* Use only when you know the code is small and you need sync execution
|
|
18
|
+
*/
|
|
19
|
+
export function transformJSXSync(sourceCode: any, options?: {}): any;
|
|
20
|
+
/**
|
|
21
|
+
* Check if code contains JSX syntax
|
|
22
|
+
*/
|
|
23
|
+
export function containsJSX(code: any): any;
|
|
24
|
+
/**
|
|
25
|
+
* Remove CSS imports from code (for production builds)
|
|
26
|
+
*/
|
|
27
|
+
export function removeCSSImports(code: any): any;
|
|
28
|
+
/**
|
|
29
|
+
* Remove dotenv imports (for browser)
|
|
30
|
+
*/
|
|
31
|
+
export function removeDotenvImports(code: any): any;
|
|
32
|
+
/**
|
|
33
|
+
* Fix relative imports to include .js extension
|
|
34
|
+
*/
|
|
35
|
+
export function fixRelativeImports(code: any): any;
|
|
36
|
+
//# sourceMappingURL=transform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../../src/compiler/transform.js"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,yCAPW,MAAM,YAEd;IAAwB,MAAM,EAAtB,MAAM;IACU,GAAG,EAAnB,MAAM;IACW,cAAc,EAA/B,OAAO;CACf,GAAU,OAAO,CAAC,MAAM,CAAC,CAqD3B;AAED;;;GAGG;AACH,qEAkCC;AAED;;GAEG;AACH,4CAOC;AAED;;GAEG;AACH,iDAIC;AAED;;GAEG;AACH,oDAKC;AAED;;GAEG;AACH,mDASC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export namespace defaultConfig {
|
|
2
|
+
let siteName: string;
|
|
3
|
+
let baseUrl: string;
|
|
4
|
+
let importhow: {};
|
|
5
|
+
namespace meta {
|
|
6
|
+
let title: string;
|
|
7
|
+
let description: string;
|
|
8
|
+
let keywords: string;
|
|
9
|
+
let author: string;
|
|
10
|
+
let themeColor: string;
|
|
11
|
+
let lang: string;
|
|
12
|
+
let ogTitle: string;
|
|
13
|
+
let ogDescription: string;
|
|
14
|
+
let ogImage: string;
|
|
15
|
+
}
|
|
16
|
+
namespace appShell {
|
|
17
|
+
let loading: boolean;
|
|
18
|
+
let loadingText: string;
|
|
19
|
+
let backgroundColor: string;
|
|
20
|
+
}
|
|
21
|
+
namespace robots {
|
|
22
|
+
let disallow: never[];
|
|
23
|
+
let crawlDelay: null;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=defaultConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaultConfig.d.ts","sourceRoot":"","sources":["../../../src/config/defaultConfig.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/config/index.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loadConfig.d.ts","sourceRoot":"","sources":["../../../src/config/loadConfig.js"],"names":[],"mappings":"AAMA,oDA8CC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export function minifyCSS(css: any, options?: {}): Promise<any>;
|
|
2
|
+
export function combineCSS(files: any): any;
|
|
3
|
+
export { buildAllCSS } from "../build/processors/css-builder.js";
|
|
4
|
+
export { minifyCSS, combineCSS, minifyCSSSync, extractCSSImports, isCSSFile } from "./processor.js";
|
|
5
|
+
export { buildCSS, copyCSS } from "../build/css-builder.js";
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/css/index.js"],"names":[],"mappings":"AAMA,gEA4BC;AAED,4CAIC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minify CSS using Lightning CSS with fallback
|
|
3
|
+
*/
|
|
4
|
+
export function minifyCSS(css: any, options?: {}): Promise<any>;
|
|
5
|
+
/**
|
|
6
|
+
* Synchronous version for build scripts
|
|
7
|
+
*/
|
|
8
|
+
export function minifyCSSSync(css: any, options?: {}): any;
|
|
9
|
+
/**
|
|
10
|
+
* Combine multiple CSS files into one
|
|
11
|
+
*/
|
|
12
|
+
export function combineCSS(files: any): string;
|
|
13
|
+
/**
|
|
14
|
+
* Extract CSS imports from JavaScript
|
|
15
|
+
*/
|
|
16
|
+
export function extractCSSImports(code: any): (string | undefined)[];
|
|
17
|
+
/**
|
|
18
|
+
* Check if file is CSS
|
|
19
|
+
*/
|
|
20
|
+
export function isCSSFile(filename: any): any;
|
|
21
|
+
export function processSCSS(scssCode: any, options?: {}): Promise<any>;
|
|
22
|
+
export function compileSCSSFile(filePath: any, options?: {}): Promise<any>;
|
|
23
|
+
//# sourceMappingURL=processor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processor.d.ts","sourceRoot":"","sources":["../../../src/css/processor.js"],"names":[],"mappings":"AAIA;;GAEG;AACH,gEAmCC;AAED;;GAEG;AACH,2DAyBC;AAED;;GAEG;AACH,+CAUC;AAmBD;;GAEG;AACH,qEAUC;AAED;;GAEG;AACH,8CAEC;AAQD,uEAkBC;AAED,2EAiBC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/dev.js"],"names":[],"mappings":"AAYA,sDAuDC"}
|
|
@@ -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"}
|