@maravilla-labs/adapter-core 0.1.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.
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Recursively collect all file paths under a directory.
3
+ * Returns paths relative to the root, prefixed with '/'.
4
+ */
5
+ export declare function collectAssets(dir: string, prefix?: string): string[];
6
+ //# sourceMappingURL=assets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../src/assets.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,SAAK,GAAG,MAAM,EAAE,CAsBhE"}
package/dist/assets.js ADDED
@@ -0,0 +1,28 @@
1
+ import { existsSync, readdirSync, statSync } from 'node:fs';
2
+ /**
3
+ * Recursively collect all file paths under a directory.
4
+ * Returns paths relative to the root, prefixed with '/'.
5
+ */
6
+ export function collectAssets(dir, prefix = '') {
7
+ const assets = [];
8
+ if (!existsSync(dir))
9
+ return assets;
10
+ const files = readdirSync(dir);
11
+ for (const file of files) {
12
+ const fullPath = `${dir}/${file}`;
13
+ const relativePath = prefix ? `${prefix}/${file}` : file;
14
+ try {
15
+ if (statSync(fullPath).isDirectory()) {
16
+ assets.push(...collectAssets(fullPath, relativePath));
17
+ }
18
+ else {
19
+ assets.push(`/${relativePath}`);
20
+ }
21
+ }
22
+ catch (_) {
23
+ // Skip inaccessible files
24
+ }
25
+ }
26
+ return assets;
27
+ }
28
+ //# sourceMappingURL=assets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assets.js","sourceRoot":"","sources":["../src/assets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAE5D;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,GAAW,EAAE,MAAM,GAAG,EAAE;IACpD,MAAM,MAAM,GAAa,EAAE,CAAC;IAE5B,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,OAAO,MAAM,CAAC;IAEpC,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;IAC/B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,QAAQ,GAAG,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;QAClC,MAAM,YAAY,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;QAEzD,IAAI,CAAC;YACH,IAAI,QAAQ,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC;gBACrC,MAAM,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC;YACxD,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,IAAI,CAAC,IAAI,YAAY,EAAE,CAAC,CAAC;YAClC,CAAC;QACH,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,0BAA0B;QAC5B,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,12 @@
1
+ import * as esbuild from 'esbuild';
2
+ import type { BundleOptions } from './types.js';
3
+ /**
4
+ * Bundle a server entry point with esbuild for the Maravilla Runtime.
5
+ * Uses consistent settings across all framework adapters.
6
+ */
7
+ export declare function bundleServerEntry(options: BundleOptions): Promise<esbuild.BuildResult>;
8
+ /**
9
+ * Analyze and return a human-readable summary of the bundle.
10
+ */
11
+ export declare function analyzeBundle(result: esbuild.BuildResult): Promise<string | null>;
12
+ //# sourceMappingURL=bundle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bundle.d.ts","sourceRoot":"","sources":["../src/bundle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD;;;GAGG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,CAoC5F;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAC,MAAM,EAAE,OAAO,CAAC,WAAW,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAKvF"}
package/dist/bundle.js ADDED
@@ -0,0 +1,43 @@
1
+ import * as esbuild from 'esbuild';
2
+ /**
3
+ * Bundle a server entry point with esbuild for the Maravilla Runtime.
4
+ * Uses consistent settings across all framework adapters.
5
+ */
6
+ export async function bundleServerEntry(options) {
7
+ const { entrypoint, outfile, external = [], define = {}, minify = true, treeShaking = false, } = options;
8
+ const result = await esbuild.build({
9
+ entryPoints: [entrypoint],
10
+ outfile,
11
+ bundle: true,
12
+ platform: 'neutral',
13
+ format: 'esm',
14
+ target: 'es2022',
15
+ mainFields: ['module', 'main'],
16
+ conditions: ['worker', 'webworker'],
17
+ external: [
18
+ ...external,
19
+ '@maravilla/platform',
20
+ ],
21
+ define: {
22
+ 'process.env.NODE_ENV': '"production"',
23
+ ...define,
24
+ },
25
+ minify,
26
+ sourcemap: true,
27
+ metafile: true,
28
+ logLevel: 'info',
29
+ keepNames: true,
30
+ treeShaking,
31
+ });
32
+ return result;
33
+ }
34
+ /**
35
+ * Analyze and return a human-readable summary of the bundle.
36
+ */
37
+ export async function analyzeBundle(result) {
38
+ if (result.metafile) {
39
+ return esbuild.analyzeMetafile(result.metafile);
40
+ }
41
+ return null;
42
+ }
43
+ //# sourceMappingURL=bundle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bundle.js","sourceRoot":"","sources":["../src/bundle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAGnC;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,OAAsB;IAC5D,MAAM,EACJ,UAAU,EACV,OAAO,EACP,QAAQ,GAAG,EAAE,EACb,MAAM,GAAG,EAAE,EACX,MAAM,GAAG,IAAI,EACb,WAAW,GAAG,KAAK,GACpB,GAAG,OAAO,CAAC;IAEZ,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,KAAK,CAAC;QACjC,WAAW,EAAE,CAAC,UAAU,CAAC;QACzB,OAAO;QACP,MAAM,EAAE,IAAI;QACZ,QAAQ,EAAE,SAAS;QACnB,MAAM,EAAE,KAAK;QACb,MAAM,EAAE,QAAQ;QAChB,UAAU,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC;QAC9B,UAAU,EAAE,CAAC,QAAQ,EAAE,WAAW,CAAC;QACnC,QAAQ,EAAE;YACR,GAAG,QAAQ;YACX,qBAAqB;SACtB;QACD,MAAM,EAAE;YACN,sBAAsB,EAAE,cAAc;YACtC,GAAG,MAAM;SACV;QACD,MAAM;QACN,SAAS,EAAE,IAAI;QACf,QAAQ,EAAE,IAAI;QACd,QAAQ,EAAE,MAAM;QAChB,SAAS,EAAE,IAAI;QACf,WAAW;KACZ,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,MAA2B;IAC7D,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;QACpB,OAAO,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAClD,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,19 @@
1
+ type FunctionsAPI = {
2
+ buildFunctions: (opts: any) => Promise<any>;
3
+ integrateWithManifest: (manifestPath: string, fm: any) => Promise<void>;
4
+ };
5
+ /**
6
+ * Dynamically load the functions API.
7
+ * Prefers installed package, falls back to local workspace paths, else provides no-op shims.
8
+ */
9
+ export declare function loadFunctionsAPI(): Promise<FunctionsAPI>;
10
+ /**
11
+ * Build edge functions from a project's functions directory and integrate into manifest.
12
+ */
13
+ export declare function buildAndIntegrateFunctions(projectDir: string, outDir: string, log?: {
14
+ minor: (msg: string) => void;
15
+ error: (msg: string) => void;
16
+ warn: (msg: string) => void;
17
+ }): Promise<void>;
18
+ export {};
19
+ //# sourceMappingURL=functions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"functions.d.ts","sourceRoot":"","sources":["../src/functions.ts"],"names":[],"mappings":"AAGA,KAAK,YAAY,GAAG;IAClB,cAAc,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IAC5C,qBAAqB,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACzE,CAAC;AAEF;;;GAGG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,YAAY,CAAC,CAkB9D;AAED;;GAEG;AACH,wBAAsB,0BAA0B,CAC9C,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,GAAG,CAAC,EAAE;IAAE,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAAC,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAAC,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;CAAE,GAChG,OAAO,CAAC,IAAI,CAAC,CA4Bf"}
@@ -0,0 +1,104 @@
1
+ import { existsSync, readFileSync, writeFileSync } from 'node:fs';
2
+ import { join } from 'node:path';
3
+ /**
4
+ * Dynamically load the functions API.
5
+ * Prefers installed package, falls back to local workspace paths, else provides no-op shims.
6
+ */
7
+ export async function loadFunctionsAPI() {
8
+ const fallbacks = [
9
+ '@maravilla-labs/functions',
10
+ '../../functions/dist/index.js',
11
+ '../../functions/src/index.ts',
12
+ ];
13
+ for (const spec of fallbacks) {
14
+ try {
15
+ const mod = await import(spec);
16
+ if (mod.buildFunctions && mod.integrateWithManifest) {
17
+ return { buildFunctions: mod.buildFunctions, integrateWithManifest: mod.integrateWithManifest };
18
+ }
19
+ }
20
+ catch (_) { /* try next */ }
21
+ }
22
+ return {
23
+ buildFunctions: async () => null,
24
+ integrateWithManifest: async () => { },
25
+ };
26
+ }
27
+ /**
28
+ * Build edge functions from a project's functions directory and integrate into manifest.
29
+ */
30
+ export async function buildAndIntegrateFunctions(projectDir, outDir, log) {
31
+ const functionsDir = `${projectDir}/functions`;
32
+ if (!existsSync(functionsDir)) {
33
+ log?.minor('No functions directory found, skipping functions build');
34
+ return;
35
+ }
36
+ const { buildFunctions, integrateWithManifest } = await loadFunctionsAPI();
37
+ log?.minor('Building edge functions from: ' + functionsDir);
38
+ let functionsManifest;
39
+ try {
40
+ functionsManifest = await buildFunctions({
41
+ functionsDir,
42
+ outputDir: outDir,
43
+ production: true,
44
+ minify: true,
45
+ });
46
+ }
47
+ catch (error) {
48
+ log?.error('Failed to build functions: ' + (error?.message || error));
49
+ return;
50
+ }
51
+ if (!functionsManifest)
52
+ return;
53
+ await integrateWithManifest(`${outDir}/manifest.json`, functionsManifest);
54
+ mergeFunctions(outDir);
55
+ augmentRoutingFunctions(outDir, log);
56
+ }
57
+ /**
58
+ * Keep functions separate from server bundle for proper routing.
59
+ */
60
+ function mergeFunctions(buildDir) {
61
+ const functionsPath = join(buildDir, 'functions.js');
62
+ const manifestPath = join(buildDir, 'manifest.json');
63
+ if (!existsSync(functionsPath))
64
+ return;
65
+ const manifest = JSON.parse(readFileSync(manifestPath, 'utf8'));
66
+ if (manifest.functions) {
67
+ manifest.functions.integrated = false;
68
+ manifest.functions.available = true;
69
+ }
70
+ writeFileSync(manifestPath, JSON.stringify(manifest, null, 2));
71
+ }
72
+ /**
73
+ * Augment routing.functions with name/file from functions.routes.
74
+ */
75
+ function augmentRoutingFunctions(outDir, log) {
76
+ try {
77
+ const mPath = join(outDir, 'manifest.json');
78
+ const raw = readFileSync(mPath, 'utf8');
79
+ const m = JSON.parse(raw);
80
+ if (m.functions?.routes) {
81
+ const routeMap = new Map(m.functions.routes.map((r) => [r.path, r]));
82
+ if (Array.isArray(m.routing?.functions)) {
83
+ m.routing.functions = m.routing.functions.map((r) => {
84
+ const full = routeMap.get(r.path) || {};
85
+ return { ...r, name: full.name, file: full.file };
86
+ });
87
+ }
88
+ else {
89
+ m.routing.functions = m.functions.routes.map((r) => ({
90
+ path: r.path,
91
+ name: r.name,
92
+ methods: r.methods,
93
+ file: r.file,
94
+ handler: 'function',
95
+ }));
96
+ }
97
+ writeFileSync(mPath, JSON.stringify(m, null, 2));
98
+ }
99
+ }
100
+ catch (e) {
101
+ log?.warn('Failed to augment routing.functions with name/file: ' + e?.message);
102
+ }
103
+ }
104
+ //# sourceMappingURL=functions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"functions.js","sourceRoot":"","sources":["../src/functions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAOjC;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB;IACpC,MAAM,SAAS,GAAG;QAChB,2BAA2B;QAC3B,+BAA+B;QAC/B,8BAA8B;KAC/B,CAAC;IACF,KAAK,MAAM,IAAI,IAAI,SAAS,EAAE,CAAC;QAC7B,IAAI,CAAC;YACH,MAAM,GAAG,GAAQ,MAAM,MAAM,CAAC,IAAI,CAAC,CAAC;YACpC,IAAI,GAAG,CAAC,cAAc,IAAI,GAAG,CAAC,qBAAqB,EAAE,CAAC;gBACpD,OAAO,EAAE,cAAc,EAAE,GAAG,CAAC,cAAc,EAAE,qBAAqB,EAAE,GAAG,CAAC,qBAAqB,EAAE,CAAC;YAClG,CAAC;QACH,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC,CAAC,cAAc,CAAC,CAAC;IAChC,CAAC;IACD,OAAO;QACL,cAAc,EAAE,KAAK,IAAI,EAAE,CAAC,IAAI;QA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O,EAAE,GAAG,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;gBACpD,CAAC,CAAC,CAAC;YACL,CAAC;iBAAM,CAAC;gBACN,CAAC,CAAC,OAAO,CAAC,SAAS,GAAG,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,CAAC;oBACxD,IAAI,EAAE,CAAC,CAAC,IAAI;oBACZ,IAAI,EAAE,CAAC,CAAC,IAAI;oBACZ,OAAO,EAAE,CAAC,CAAC,OAAO;oBAClB,IAAI,EAAE,CAAC,CAAC,IAAI;oBACZ,OAAO,EAAE,UAAU;iBACpB,CAAC,CAAC,CAAC;YACN,CAAC;YACD,aAAa,CAAC,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QACnD,CAAC;IACH,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,GAAG,EAAE,IAAI,CAAC,sDAAsD,GAAI,CAAS,EAAE,OAAO,CAAC,CAAC;IAC1F,CAAC;AACH,CAAC"}
@@ -0,0 +1,7 @@
1
+ export { bundleServerEntry, analyzeBundle } from './bundle.js';
2
+ export { generateManifest, writeManifest, filterStaticAssets } from './manifest.js';
3
+ export { collectAssets } from './assets.js';
4
+ export { loadFunctionsAPI, buildAndIntegrateFunctions } from './functions.js';
5
+ export { WORKER_POLYFILLS } from './polyfills.js';
6
+ export type { ManifestV2, RoutingConfig, DynamicRoutes, RouteConfig, EnvConfig, Features, FunctionsConfig, FunctionRoute, FunctionsMetadata, AdapterOptions, BundleOptions, ManifestOptions, } from './types.js';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,YAAY,EACV,UAAU,EACV,aAAa,EACb,aAAa,EACb,WAAW,EACX,SAAS,EACT,QAAQ,EACR,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,eAAe,GAChB,MAAM,YAAY,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,6 @@
1
+ export { bundleServerEntry, analyzeBundle } from './bundle.js';
2
+ export { generateManifest, writeManifest, filterStaticAssets } from './manifest.js';
3
+ export { collectAssets } from './assets.js';
4
+ export { loadFunctionsAPI, buildAndIntegrateFunctions } from './functions.js';
5
+ export { WORKER_POLYFILLS } from './polyfills.js';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { ManifestV2, ManifestOptions } from './types.js';
2
+ /**
3
+ * Filter static assets from a list of all files.
4
+ * Identifies framework client assets and common static files.
5
+ */
6
+ export declare function filterStaticAssets(allAssets: string[]): string[];
7
+ /**
8
+ * Generate a Maravilla manifest.json conforming to the Rust Manifest struct.
9
+ */
10
+ export declare function generateManifest(options: ManifestOptions): ManifestV2;
11
+ /**
12
+ * Write a manifest to disk as JSON.
13
+ */
14
+ export declare function writeManifest(outDir: string, manifest: ManifestV2): void;
15
+ //# sourceMappingURL=manifest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAiB9D;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAOhE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,eAAe,GAAG,UAAU,CA2DrE;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,GAAG,IAAI,CAKxE"}
@@ -0,0 +1,80 @@
1
+ import { writeFileSync } from 'node:fs';
2
+ /** Default asset file extensions to auto-detect from static directory */
3
+ const STATIC_ASSET_PATTERNS = [
4
+ '/_app/',
5
+ '/favicon',
6
+ '/assets/',
7
+ '/_nuxt/',
8
+ '/_build/',
9
+ ];
10
+ const STATIC_ASSET_EXTENSIONS = [
11
+ '.txt', '.svg', '.png', '.jpg', '.jpeg', '.webp', '.gif', '.ico',
12
+ '.woff', '.woff2', '.ttf', '.eot',
13
+ '.css', '.js', '.mjs',
14
+ ];
15
+ /**
16
+ * Filter static assets from a list of all files.
17
+ * Identifies framework client assets and common static files.
18
+ */
19
+ export function filterStaticAssets(allAssets) {
20
+ return allAssets.filter(path => {
21
+ if (STATIC_ASSET_PATTERNS.some(pattern => path.startsWith(pattern))) {
22
+ return true;
23
+ }
24
+ return STATIC_ASSET_EXTENSIONS.some(ext => path.endsWith(ext));
25
+ });
26
+ }
27
+ /**
28
+ * Generate a Maravilla manifest.json conforming to the Rust Manifest struct.
29
+ */
30
+ export function generateManifest(options) {
31
+ const { adapterName, prerenderedPaths, staticAssets, include = ['/*'], exclude = [], envPrefix = 'PUBLIC_', features, extraMetadata = {}, } = options;
32
+ const prerendered = prerenderedPaths.map(path => {
33
+ if (path === '/')
34
+ return '/index.html';
35
+ return path.replace(/\/$/, '') + '.html';
36
+ });
37
+ const assets = filterStaticAssets(staticAssets);
38
+ return {
39
+ version: 2,
40
+ runtime: 'maravilla',
41
+ entrypoint: 'server.js',
42
+ static: 'static',
43
+ routing: {
44
+ prerendered,
45
+ assets,
46
+ dynamic: {
47
+ api: '/api/*',
48
+ serverRoutes: '/*',
49
+ },
50
+ },
51
+ routes: {
52
+ include: include.length > 0 ? include : ['/*'],
53
+ exclude: exclude.length > 0 ? exclude : [],
54
+ },
55
+ env: {
56
+ prefix: envPrefix,
57
+ },
58
+ features: {
59
+ ssr: features.ssr ?? true,
60
+ prerendering: features.prerendering ?? prerenderedPaths.length > 0,
61
+ polyfill: features.polyfill ?? true,
62
+ streaming: features.streaming ?? true,
63
+ compression: features.compression ?? false,
64
+ },
65
+ metadata: {
66
+ adapter: adapterName,
67
+ build_date: new Date().toISOString(),
68
+ prerendered_count: prerenderedPaths.length,
69
+ asset_count: staticAssets.length,
70
+ ...extraMetadata,
71
+ },
72
+ };
73
+ }
74
+ /**
75
+ * Write a manifest to disk as JSON.
76
+ */
77
+ export function writeManifest(outDir, manifest) {
78
+ writeFileSync(`${outDir}/manifest.json`, JSON.stringify(manifest, null, 2));
79
+ }
80
+ //# sourceMappingURL=manifest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.js","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAGxC,yEAAyE;AACzE,MAAM,qBAAqB,GAAG;IAC5B,QAAQ;IACR,UAAU;IACV,UAAU;IACV,SAAS;IACT,UAAU;CACX,CAA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handles relative URLs, plain objects)
5
+ * and enhancedFetch (resolves relative URLs via globalThis.location).
6
+ *
7
+ * All framework adapters should include this at the top of their worker template.
8
+ */
9
+ export declare const WORKER_POLYFILLS = "// Maravilla Runtime Worker Polyfills\n// Shared across all framework adapters\n\nconst originalFetch = globalThis.fetch;\nconst OriginalRequest = globalThis.Request;\n\nclass EnhancedRequest extends OriginalRequest {\n constructor(input, init) {\n if (typeof input === 'string') {\n try {\n super(input, init);\n } catch (e) {\n if (globalThis.location && e.message && e.message.includes('relative')) {\n try {\n const absoluteUrl = new URL(input, globalThis.location.href);\n super(absoluteUrl.href, init);\n } catch (e2) {\n throw e;\n }\n } else {\n throw e;\n }\n }\n return;\n }\n\n if (input && typeof input === 'object' && !(input instanceof OriginalRequest)) {\n const url = input.url || input.href || input.toString();\n if (!url) {\n throw new TypeError('Request must have a URL');\n }\n const newInit = {\n method: input.method || init?.method || 'GET',\n headers: input.headers || init?.headers,\n body: input.body || init?.body,\n mode: input.mode || init?.mode,\n credentials: input.credentials || init?.credentials,\n cache: input.cache || init?.cache,\n redirect: input.redirect || init?.redirect,\n referrer: input.referrer || init?.referrer,\n referrerPolicy: input.referrerPolicy || init?.referrerPolicy,\n integrity: input.integrity || init?.integrity,\n keepalive: input.keepalive || init?.keepalive,\n signal: input.signal || init?.signal,\n ...init\n };\n super(url, newInit);\n return;\n }\n\n super(input, init);\n }\n}\n\nglobalThis.Request = EnhancedRequest;\n\nglobalThis.fetch = function enhancedFetch(input, init) {\n let request;\n\n if (input instanceof Request) {\n request = input;\n } else if (typeof input === 'string') {\n if (input.startsWith('http://') || input.startsWith('https://')) {\n request = new Request(input, init);\n } else if (globalThis.location) {\n try {\n const absoluteUrl = new URL(input, globalThis.location.href);\n request = new Request(absoluteUrl.href, init);\n } catch (e) {\n console.error('Failed to resolve relative URL:', input, 'against', globalThis.location.href);\n throw e;\n }\n } else {\n console.error('Cannot resolve relative URL without globalThis.location:', input);\n throw new Error('Cannot resolve relative URL without a base URL');\n }\n } else if (input && typeof input === 'object') {\n request = new Request(input, init);\n } else {\n throw new TypeError('First argument must be a string, Request, or URL');\n }\n\n return originalFetch(request);\n};\n";
10
+ //# sourceMappingURL=polyfills.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"polyfills.d.ts","sourceRoot":"","sources":["../src/polyfills.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,2uFAoF5B,CAAC"}
@@ -0,0 +1,94 @@
1
+ /**
2
+ * Worker polyfill template code for Maravilla Runtime V8 isolates.
3
+ *
4
+ * This provides EnhancedRequest (handles relative URLs, plain objects)
5
+ * and enhancedFetch (resolves relative URLs via globalThis.location).
6
+ *
7
+ * All framework adapters should include this at the top of their worker template.
8
+ */
9
+ export const WORKER_POLYFILLS = `// Maravilla Runtime Worker Polyfills
10
+ // Shared across all framework adapters
11
+
12
+ const originalFetch = globalThis.fetch;
13
+ const OriginalRequest = globalThis.Request;
14
+
15
+ class EnhancedRequest extends OriginalRequest {
16
+ constructor(input, init) {
17
+ if (typeof input === 'string') {
18
+ try {
19
+ super(input, init);
20
+ } catch (e) {
21
+ if (globalThis.location && e.message && e.message.includes('relative')) {
22
+ try {
23
+ const absoluteUrl = new URL(input, globalThis.location.href);
24
+ super(absoluteUrl.href, init);
25
+ } catch (e2) {
26
+ throw e;
27
+ }
28
+ } else {
29
+ throw e;
30
+ }
31
+ }
32
+ return;
33
+ }
34
+
35
+ if (input && typeof input === 'object' && !(input instanceof OriginalRequest)) {
36
+ const url = input.url || input.href || input.toString();
37
+ if (!url) {
38
+ throw new TypeError('Request must have a URL');
39
+ }
40
+ const newInit = {
41
+ method: input.method || init?.method || 'GET',
42
+ headers: input.headers || init?.headers,
43
+ body: input.body || init?.body,
44
+ mode: input.mode || init?.mode,
45
+ credentials: input.credentials || init?.credentials,
46
+ cache: input.cache || init?.cache,
47
+ redirect: input.redirect || init?.redirect,
48
+ referrer: input.referrer || init?.referrer,
49
+ referrerPolicy: input.referrerPolicy || init?.referrerPolicy,
50
+ integrity: input.integrity || init?.integrity,
51
+ keepalive: input.keepalive || init?.keepalive,
52
+ signal: input.signal || init?.signal,
53
+ ...init
54
+ };
55
+ super(url, newInit);
56
+ return;
57
+ }
58
+
59
+ super(input, init);
60
+ }
61
+ }
62
+
63
+ globalThis.Request = EnhancedRequest;
64
+
65
+ globalThis.fetch = function enhancedFetch(input, init) {
66
+ let request;
67
+
68
+ if (input instanceof Request) {
69
+ request = input;
70
+ } else if (typeof input === 'string') {
71
+ if (input.startsWith('http://') || input.startsWith('https://')) {
72
+ request = new Request(input, init);
73
+ } else if (globalThis.location) {
74
+ try {
75
+ const absoluteUrl = new URL(input, globalThis.location.href);
76
+ request = new Request(absoluteUrl.href, init);
77
+ } catch (e) {
78
+ console.error('Failed to resolve relative URL:', input, 'against', globalThis.location.href);
79
+ throw e;
80
+ }
81
+ } else {
82
+ console.error('Cannot resolve relative URL without globalThis.location:', input);
83
+ throw new Error('Cannot resolve relative URL without a base URL');
84
+ }
85
+ } else if (input && typeof input === 'object') {
86
+ request = new Request(input, init);
87
+ } else {
88
+ throw new TypeError('First argument must be a string, Request, or URL');
89
+ }
90
+
91
+ return originalFetch(request);
92
+ };
93
+ `;
94
+ //# sourceMappingURL=polyfills.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"polyfills.js","sourceRoot":"","sources":["../src/polyfills.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoF/B,CAAC"}
@@ -0,0 +1,92 @@
1
+ /**
2
+ * Manifest types matching the Rust Manifest struct in
3
+ * crates/server-integration/src/manifest/types.rs
4
+ */
5
+ export interface ManifestV2 {
6
+ version: 2;
7
+ runtime: 'maravilla';
8
+ entrypoint: string;
9
+ static: string;
10
+ routing: RoutingConfig;
11
+ routes: RouteConfig;
12
+ env: EnvConfig;
13
+ features: Features;
14
+ metadata: Record<string, unknown>;
15
+ functions?: FunctionsConfig;
16
+ }
17
+ export interface RoutingConfig {
18
+ prerendered: string[];
19
+ assets: string[];
20
+ dynamic: DynamicRoutes;
21
+ functions?: FunctionRoute[];
22
+ }
23
+ export interface DynamicRoutes {
24
+ api?: string;
25
+ serverRoutes?: string;
26
+ }
27
+ export interface RouteConfig {
28
+ include: string[];
29
+ exclude: string[];
30
+ }
31
+ export interface EnvConfig {
32
+ prefix: string;
33
+ }
34
+ export interface Features {
35
+ ssr: boolean;
36
+ prerendering: boolean;
37
+ polyfill: boolean;
38
+ streaming: boolean;
39
+ compression: boolean;
40
+ }
41
+ export interface FunctionsConfig {
42
+ enabled: boolean;
43
+ bundle: string;
44
+ routes: FunctionRoute[];
45
+ metadata: FunctionsMetadata;
46
+ }
47
+ export interface FunctionRoute {
48
+ path: string;
49
+ name?: string;
50
+ methods: string[];
51
+ file?: string;
52
+ handler?: string;
53
+ }
54
+ export interface FunctionsMetadata {
55
+ count: number;
56
+ buildTime: string;
57
+ }
58
+ export interface AdapterOptions {
59
+ /** Output directory (default: '.maravilla') */
60
+ out?: string;
61
+ /** Whether to gzip/brotli compress static assets */
62
+ precompress?: boolean;
63
+ /** Environment variable prefix for public vars */
64
+ envPrefix?: string;
65
+ /** Whether to inject global polyfills */
66
+ polyfill?: boolean;
67
+ /** Route patterns to include */
68
+ include?: string[];
69
+ /** Route patterns to exclude */
70
+ exclude?: string[];
71
+ /** Modules to mark as external in esbuild */
72
+ external?: string[];
73
+ }
74
+ export interface BundleOptions {
75
+ entrypoint: string;
76
+ outfile: string;
77
+ external?: string[];
78
+ define?: Record<string, string>;
79
+ minify?: boolean;
80
+ treeShaking?: boolean;
81
+ }
82
+ export interface ManifestOptions {
83
+ adapterName: string;
84
+ prerenderedPaths: string[];
85
+ staticAssets: string[];
86
+ include?: string[];
87
+ exclude?: string[];
88
+ envPrefix?: string;
89
+ features: Partial<Features>;
90
+ extraMetadata?: Record<string, unknown>;
91
+ }
92
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,CAAC,CAAC;IACX,OAAO,EAAE,WAAW,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,aAAa,CAAC;IACvB,MAAM,EAAE,WAAW,CAAC;IACpB,GAAG,EAAE,SAAS,CAAC;IACf,QAAQ,EAAE,QAAQ,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,SAAS,CAAC,EAAE,eAAe,CAAC;CAC7B;AAED,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,EAAE,aAAa,CAAC;IACvB,SAAS,CAAC,EAAE,aAAa,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,aAAa;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,OAAO,CAAC;IACb,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM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AC;IACnB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACzC"}
package/dist/types.js ADDED
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Manifest types matching the Rust Manifest struct in
3
+ * crates/server-integration/src/manifest/types.rs
4
+ */
5
+ export {};
6
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@maravilla-labs/adapter-core",
3
+ "version": "0.1.0",
4
+ "description": "Shared utilities for Maravilla Runtime framework adapters",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "files": [
9
+ "dist"
10
+ ],
11
+ "scripts": {
12
+ "build": "tsc",
13
+ "dev": "tsc --watch",
14
+ "prepublishOnly": "npm run build"
15
+ },
16
+ "keywords": [
17
+ "maravilla",
18
+ "adapter",
19
+ "edge",
20
+ "runtime"
21
+ ],
22
+ "author": "SOLUTAS GmbH",
23
+ "license": "Proprietary",
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "git+https://github.com/maravilla-labs/maravilla-runtime.git",
27
+ "directory": "packages/adapter-core"
28
+ },
29
+ "publishConfig": {
30
+ "access": "public"
31
+ },
32
+ "peerDependencies": {
33
+ "@maravilla-labs/functions": "*"
34
+ },
35
+ "peerDependenciesMeta": {
36
+ "@maravilla-labs/functions": {
37
+ "optional": true
38
+ }
39
+ },
40
+ "dependencies": {
41
+ "esbuild": "^0.25.0"
42
+ },
43
+ "devDependencies": {
44
+ "@types/node": "^20.0.0",
45
+ "typescript": "^5.0.0"
46
+ }
47
+ }