@eserstack/laroux-bundler 0.0.0-bootstrap.0 → 5.0.0
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/LICENSE +13 -0
- package/README.md +432 -0
- package/dist/adapters/fonts/font-optimizer.d.ts +28 -0
- package/dist/adapters/fonts/font-optimizer.js +74 -0
- package/dist/adapters/fonts/index.d.ts +18 -0
- package/dist/adapters/fonts/index.js +78 -0
- package/dist/adapters/fonts/mod.d.ts +6 -0
- package/dist/adapters/fonts/mod.js +7 -0
- package/dist/adapters/lightningcss/css-processor.d.ts +39 -0
- package/dist/adapters/lightningcss/css-processor.js +103 -0
- package/dist/adapters/lightningcss/mod.d.ts +5 -0
- package/dist/adapters/lightningcss/mod.js +6 -0
- package/dist/adapters/mod.d.ts +13 -0
- package/dist/adapters/mod.js +21 -0
- package/dist/adapters/prebuilt-bundler/mod.d.ts +5 -0
- package/dist/adapters/prebuilt-bundler/mod.js +6 -0
- package/dist/adapters/prebuilt-bundler/prebuilt-bundler.d.ts +22 -0
- package/dist/adapters/prebuilt-bundler/prebuilt-bundler.js +60 -0
- package/dist/adapters/react/mod.d.ts +10 -0
- package/dist/adapters/react/mod.js +16 -0
- package/dist/adapters/react/plugin.d.ts +17 -0
- package/dist/adapters/react/plugin.js +62 -0
- package/dist/adapters/react/rsc-analyze.d.ts +29 -0
- package/dist/adapters/react/rsc-analyze.js +116 -0
- package/dist/adapters/react/rsc-client-entry.d.ts +26 -0
- package/dist/adapters/react/rsc-client-entry.js +145 -0
- package/dist/adapters/react/rsc-module-map.d.ts +41 -0
- package/dist/adapters/react/rsc-module-map.js +81 -0
- package/dist/adapters/react/rsc-rewrite-imports.d.ts +38 -0
- package/dist/adapters/react/rsc-rewrite-imports.js +409 -0
- package/dist/adapters/react/rsc-transform.d.ts +26 -0
- package/dist/adapters/react/rsc-transform.js +101 -0
- package/dist/adapters/runtime-bundler/mod.d.ts +6 -0
- package/dist/adapters/runtime-bundler/mod.js +6 -0
- package/dist/adapters/runtime-bundler/runtime-bundler.d.ts +85 -0
- package/dist/adapters/runtime-bundler/runtime-bundler.js +244 -0
- package/dist/adapters/sharp/image-optimizer.d.ts +52 -0
- package/dist/adapters/sharp/image-optimizer.js +261 -0
- package/dist/adapters/sharp/mod.d.ts +6 -0
- package/dist/adapters/sharp/mod.js +6 -0
- package/dist/adapters/tailwindcss/compile.d.ts +22 -0
- package/dist/adapters/tailwindcss/compile.js +29 -0
- package/dist/adapters/tailwindcss/critical-css-config.d.ts +46 -0
- package/dist/adapters/tailwindcss/critical-css-config.js +78 -0
- package/dist/adapters/tailwindcss/critical-page-css.d.ts +61 -0
- package/dist/adapters/tailwindcss/critical-page-css.js +431 -0
- package/dist/adapters/tailwindcss/critical-universal-css.d.ts +68 -0
- package/dist/adapters/tailwindcss/critical-universal-css.js +250 -0
- package/dist/adapters/tailwindcss/mod.d.ts +10 -0
- package/dist/adapters/tailwindcss/mod.js +11 -0
- package/dist/adapters/tailwindcss/plugin.d.ts +16 -0
- package/dist/adapters/tailwindcss/plugin.js +107 -0
- package/dist/adapters/tailwindcss/stylesheet-loader.d.ts +15 -0
- package/dist/adapters/tailwindcss/stylesheet-loader.js +83 -0
- package/dist/config.d.ts +27 -0
- package/dist/config.js +31 -0
- package/dist/css-modules.d.ts +49 -0
- package/dist/css-modules.js +146 -0
- package/dist/domain/build-cache.d.ts +107 -0
- package/dist/domain/build-cache.js +128 -0
- package/dist/domain/build-validator.d.ts +68 -0
- package/dist/domain/build-validator.js +207 -0
- package/dist/domain/bundler.d.ts +136 -0
- package/dist/domain/bundler.js +225 -0
- package/dist/domain/chunk-manifest.d.ts +40 -0
- package/dist/domain/chunk-manifest.js +188 -0
- package/dist/domain/client-action-stub.d.ts +30 -0
- package/dist/domain/client-action-stub.js +167 -0
- package/dist/domain/copy-path.d.ts +15 -0
- package/dist/domain/copy-path.js +29 -0
- package/dist/domain/css-plugin.d.ts +91 -0
- package/dist/domain/css-plugin.js +6 -0
- package/dist/domain/css-processor.d.ts +57 -0
- package/dist/domain/css-processor.js +33 -0
- package/dist/domain/font-optimizer.d.ts +46 -0
- package/dist/domain/font-optimizer.js +17 -0
- package/dist/domain/framework-plugin.d.ts +106 -0
- package/dist/domain/framework-plugin.js +20 -0
- package/dist/domain/image-optimizer.d.ts +74 -0
- package/dist/domain/image-optimizer.js +16 -0
- package/dist/domain/import-map.d.ts +90 -0
- package/dist/domain/import-map.js +187 -0
- package/dist/domain/mod.d.ts +32 -0
- package/dist/domain/mod.js +20 -0
- package/dist/domain/route-generator.d.ts +34 -0
- package/dist/domain/route-generator.js +305 -0
- package/dist/domain/route-scanner.d.ts +72 -0
- package/dist/domain/route-scanner.js +282 -0
- package/dist/domain/server-action-transform.d.ts +28 -0
- package/dist/domain/server-action-transform.js +147 -0
- package/dist/domain/virtual-source.d.ts +63 -0
- package/dist/domain/virtual-source.js +238 -0
- package/dist/import-map-resolver-plugin.d.ts +47 -0
- package/dist/import-map-resolver-plugin.js +109 -0
- package/dist/mod.d.ts +57 -0
- package/dist/mod.js +56 -0
- package/dist/server-externals-plugin.d.ts +29 -0
- package/dist/server-externals-plugin.js +63 -0
- package/dist/system.d.ts +157 -0
- package/dist/system.js +1401 -0
- package/dist/types.d.ts +60 -0
- package/dist/types.js +38 -0
- package/package.json +86 -1
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bundler Types
|
|
3
|
+
*
|
|
4
|
+
* Imports shared types from @eserstack/laroux/config and defines bundler-specific types.
|
|
5
|
+
* Core converts its AppConfig to BuildConfig when calling bundler functions.
|
|
6
|
+
*/
|
|
7
|
+
import type { FontDefinition, ResolvedBrowserShimsConfig, ResolvedImageConfig } from "@eserstack/laroux/config";
|
|
8
|
+
export type { FontDefinition, FontDisplay, FontProvider, FontStyle, FontWeight, ImageFormat, ImageOutputFormat, ImagePlaceholder, LogLevel, ResolvedBrowserShimsConfig, ResolvedImageConfig, ResolvedImageQuality, } from "@eserstack/laroux/config";
|
|
9
|
+
/**
|
|
10
|
+
* Build configuration for the bundler
|
|
11
|
+
*
|
|
12
|
+
* This interface contains only what the bundler needs to perform builds.
|
|
13
|
+
* Core's AppConfig is converted to BuildConfig when calling bundler functions.
|
|
14
|
+
*/
|
|
15
|
+
export type BuildConfig = {
|
|
16
|
+
/** Project root directory (absolute path) */
|
|
17
|
+
projectRoot: string;
|
|
18
|
+
/** Source directory containing components (absolute path) */
|
|
19
|
+
srcDir: string;
|
|
20
|
+
/** Distribution directory for built assets (absolute path) */
|
|
21
|
+
distDir: string;
|
|
22
|
+
/** Log level for build output */
|
|
23
|
+
logLevel: "trace" | "debug" | "info" | "warn" | "error" | "fatal";
|
|
24
|
+
/** Font configuration */
|
|
25
|
+
fonts: FontDefinition[];
|
|
26
|
+
/** Image optimization configuration */
|
|
27
|
+
images: ResolvedImageConfig;
|
|
28
|
+
/** Generate TypeScript .d.ts files for CSS modules */
|
|
29
|
+
cssModuleTypes: boolean;
|
|
30
|
+
/** Disable auto-injection of @reference directive in CSS modules */
|
|
31
|
+
noCssModuleAutoReference: boolean;
|
|
32
|
+
/** Browser shims for client-side bundling */
|
|
33
|
+
browserShims: ResolvedBrowserShimsConfig;
|
|
34
|
+
/**
|
|
35
|
+
* Server-side external packages (not bundled into server components).
|
|
36
|
+
* These packages resolve from the app's node_modules at runtime.
|
|
37
|
+
* Default: ["@eserstack/laroux", "@eserstack/laroux-server"]
|
|
38
|
+
*/
|
|
39
|
+
serverExternals: string[];
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Build error class for bundler errors
|
|
43
|
+
* Simple error class without external dependencies
|
|
44
|
+
*/
|
|
45
|
+
export declare class BuildError extends Error {
|
|
46
|
+
code: string;
|
|
47
|
+
hint?: string;
|
|
48
|
+
constructor(message: string, code: string, hint?: string, options?: ErrorOptions);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Error factories for common build errors
|
|
52
|
+
*/
|
|
53
|
+
export declare const buildErrors: {
|
|
54
|
+
/** CSS processing error; pass the underlying error as `options.cause` */
|
|
55
|
+
cssError: (reason: string, options?: ErrorOptions) => BuildError;
|
|
56
|
+
/** Module not found */
|
|
57
|
+
moduleNotFound: (modulePath: string) => BuildError;
|
|
58
|
+
/** Build failed */
|
|
59
|
+
buildFailed: (reason: string) => BuildError;
|
|
60
|
+
};
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// Copyright 2023-present Eser Ozvataf and other contributors. All rights reserved. Apache-2.0 license.
|
|
2
|
+
/**
|
|
3
|
+
* Bundler Types
|
|
4
|
+
*
|
|
5
|
+
* Imports shared types from @eserstack/laroux/config and defines bundler-specific types.
|
|
6
|
+
* Core converts its AppConfig to BuildConfig when calling bundler functions.
|
|
7
|
+
*/
|
|
8
|
+
// ============================================================================
|
|
9
|
+
// Build Errors (Bundler-specific)
|
|
10
|
+
// ============================================================================
|
|
11
|
+
/**
|
|
12
|
+
* Build error class for bundler errors
|
|
13
|
+
* Simple error class without external dependencies
|
|
14
|
+
*/
|
|
15
|
+
export class BuildError extends Error {
|
|
16
|
+
code;
|
|
17
|
+
hint;
|
|
18
|
+
// Explicit assignment, not parameter properties — see CommandError in
|
|
19
|
+
// @eserstack/shell/exec/types.ts: Node's erase-only type stripping cannot
|
|
20
|
+
// emit the implicit assignment a parameter property implies.
|
|
21
|
+
constructor(message, code, hint, options) {
|
|
22
|
+
super(message, options);
|
|
23
|
+
this.name = "BuildError";
|
|
24
|
+
this.code = code;
|
|
25
|
+
this.hint = hint;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Error factories for common build errors
|
|
30
|
+
*/
|
|
31
|
+
export const buildErrors = {
|
|
32
|
+
/** CSS processing error; pass the underlying error as `options.cause` */
|
|
33
|
+
cssError: (reason, options) => new BuildError(`CSS processing failed: ${reason}`, "BUILD104", "Check your CSS files and configuration.", options),
|
|
34
|
+
/** Module not found */
|
|
35
|
+
moduleNotFound: (modulePath) => new BuildError(`Module not found: ${modulePath}`, "BUILD100", "Check that the file exists and the import path is correct."),
|
|
36
|
+
/** Build failed */
|
|
37
|
+
buildFailed: (reason) => new BuildError(`Build failed: ${reason}`, "BUILD101", "Check the error details above and fix any syntax or type errors."),
|
|
38
|
+
};
|
package/package.json
CHANGED
|
@@ -1 +1,86 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"name": "@eserstack/laroux-bundler",
|
|
3
|
+
"version": "5.0.0",
|
|
4
|
+
"description": "Framework-agnostic bundler for the laroux.js framework with hexagonal architecture",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/eser/stack",
|
|
10
|
+
"directory": "pkg/@eserstack/laroux-bundler"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"dist/**/*.js",
|
|
14
|
+
"dist/**/*.d.ts",
|
|
15
|
+
"dist/**/*.json"
|
|
16
|
+
],
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./dist/mod.d.ts",
|
|
20
|
+
"import": "./dist/mod.js"
|
|
21
|
+
},
|
|
22
|
+
"./adapters": {
|
|
23
|
+
"types": "./dist/adapters/mod.d.ts",
|
|
24
|
+
"import": "./dist/adapters/mod.js"
|
|
25
|
+
},
|
|
26
|
+
"./adapters/react": {
|
|
27
|
+
"types": "./dist/adapters/react/mod.d.ts",
|
|
28
|
+
"import": "./dist/adapters/react/mod.js"
|
|
29
|
+
},
|
|
30
|
+
"./adapters/tailwindcss": {
|
|
31
|
+
"types": "./dist/adapters/tailwindcss/mod.d.ts",
|
|
32
|
+
"import": "./dist/adapters/tailwindcss/mod.js"
|
|
33
|
+
},
|
|
34
|
+
"./adapters/lightningcss": {
|
|
35
|
+
"types": "./dist/adapters/lightningcss/mod.d.ts",
|
|
36
|
+
"import": "./dist/adapters/lightningcss/mod.js"
|
|
37
|
+
},
|
|
38
|
+
"./adapters/sharp": {
|
|
39
|
+
"types": "./dist/adapters/sharp/mod.d.ts",
|
|
40
|
+
"import": "./dist/adapters/sharp/mod.js"
|
|
41
|
+
},
|
|
42
|
+
"./adapters/fonts": {
|
|
43
|
+
"types": "./dist/adapters/fonts/mod.d.ts",
|
|
44
|
+
"import": "./dist/adapters/fonts/mod.js"
|
|
45
|
+
},
|
|
46
|
+
"./adapters/runtime-bundler": {
|
|
47
|
+
"types": "./dist/adapters/runtime-bundler/mod.d.ts",
|
|
48
|
+
"import": "./dist/adapters/runtime-bundler/mod.js"
|
|
49
|
+
},
|
|
50
|
+
"./adapters/prebuilt-bundler": {
|
|
51
|
+
"types": "./dist/adapters/prebuilt-bundler/mod.d.ts",
|
|
52
|
+
"import": "./dist/adapters/prebuilt-bundler/mod.js"
|
|
53
|
+
},
|
|
54
|
+
"./system": {
|
|
55
|
+
"types": "./dist/system.d.ts",
|
|
56
|
+
"import": "./dist/system.js"
|
|
57
|
+
},
|
|
58
|
+
"./config": {
|
|
59
|
+
"types": "./dist/config.d.ts",
|
|
60
|
+
"import": "./dist/config.js"
|
|
61
|
+
},
|
|
62
|
+
"./types": {
|
|
63
|
+
"types": "./dist/types.d.ts",
|
|
64
|
+
"import": "./dist/types.js"
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"dependencies": {
|
|
68
|
+
"lightningcss": "^1.33.0",
|
|
69
|
+
"tailwindcss": "^4.3.5",
|
|
70
|
+
"@tailwindcss/oxide": "^4.3.5",
|
|
71
|
+
"sharp": "^0.35.5",
|
|
72
|
+
"@eserstack/bundler": "5.0.0",
|
|
73
|
+
"@eserstack/codebase": "5.0.0",
|
|
74
|
+
"@eserstack/collector": "5.0.0",
|
|
75
|
+
"@eserstack/laroux": "5.0.0",
|
|
76
|
+
"@eserstack/laroux-react": "5.0.0",
|
|
77
|
+
"@eserstack/logging": "5.0.0",
|
|
78
|
+
"@eserstack/standards": "5.0.0"
|
|
79
|
+
},
|
|
80
|
+
"devDependencies": {
|
|
81
|
+
"@eserstack/test-kit": "5.0.0"
|
|
82
|
+
},
|
|
83
|
+
"scripts": {
|
|
84
|
+
"build": "node ../../../etc/scripts/build-library.ts"
|
|
85
|
+
}
|
|
86
|
+
}
|