@maravilla-labs/adapter-astro 0.2.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 +12 -0
- package/README.md +92 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +184 -0
- package/dist/index.js.map +1 -0
- package/dist/server-entrypoint.d.ts +12 -0
- package/dist/server-entrypoint.d.ts.map +1 -0
- package/dist/server-entrypoint.js +37 -0
- package/dist/server-entrypoint.js.map +1 -0
- package/dist/session-driver.d.ts +27 -0
- package/dist/session-driver.d.ts.map +1 -0
- package/dist/session-driver.js +65 -0
- package/dist/session-driver.js.map +1 -0
- package/dist/shims/buffer.d.ts +23 -0
- package/dist/shims/buffer.d.ts.map +1 -0
- package/dist/shims/buffer.js +96 -0
- package/dist/shims/buffer.js.map +1 -0
- package/dist/shims/crypto.d.ts +31 -0
- package/dist/shims/crypto.d.ts.map +1 -0
- package/dist/shims/crypto.js +54 -0
- package/dist/shims/crypto.js.map +1 -0
- package/dist/shims/fs-promises.d.ts +7 -0
- package/dist/shims/fs-promises.d.ts.map +1 -0
- package/dist/shims/fs-promises.js +7 -0
- package/dist/shims/fs-promises.js.map +1 -0
- package/dist/shims/fs.d.ts +37 -0
- package/dist/shims/fs.d.ts.map +1 -0
- package/dist/shims/fs.js +48 -0
- package/dist/shims/fs.js.map +1 -0
- package/dist/shims/module.d.ts +9 -0
- package/dist/shims/module.d.ts.map +1 -0
- package/dist/shims/module.js +10 -0
- package/dist/shims/module.js.map +1 -0
- package/dist/shims/os.d.ts +17 -0
- package/dist/shims/os.d.ts.map +1 -0
- package/dist/shims/os.js +18 -0
- package/dist/shims/os.js.map +1 -0
- package/dist/shims/path.d.ts +65 -0
- package/dist/shims/path.d.ts.map +1 -0
- package/dist/shims/path.js +99 -0
- package/dist/shims/path.js.map +1 -0
- package/dist/shims/process.d.ts +15 -0
- package/dist/shims/process.d.ts.map +1 -0
- package/dist/shims/process.js +29 -0
- package/dist/shims/process.js.map +1 -0
- package/dist/shims/url.d.ts +37 -0
- package/dist/shims/url.d.ts.map +1 -0
- package/dist/shims/url.js +30 -0
- package/dist/shims/url.js.map +1 -0
- package/dist/worker-template.d.ts +14 -0
- package/dist/worker-template.d.ts.map +1 -0
- package/dist/worker-template.js +37 -0
- package/dist/worker-template.js.map +1 -0
- package/package.json +61 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal `node:crypto` shim over WebCrypto for the Maravilla isolate.
|
|
3
|
+
* Astro's render path uses WebCrypto (`crypto.subtle`) directly; this shim
|
|
4
|
+
* exists for stray `node:crypto` imports in bundled dependencies.
|
|
5
|
+
*/
|
|
6
|
+
import { Buffer } from './buffer.js';
|
|
7
|
+
export declare const webcrypto: Crypto;
|
|
8
|
+
export declare const subtle: SubtleCrypto;
|
|
9
|
+
export declare function randomUUID(): string;
|
|
10
|
+
export declare function getRandomValues<T extends ArrayBufferView>(array: T): T;
|
|
11
|
+
export declare function randomBytes(size: number, callback?: (err: Error | null, buf: InstanceType<typeof Buffer>) => void): InstanceType<typeof Buffer>;
|
|
12
|
+
export declare function timingSafeEqual(a: Uint8Array, b: Uint8Array): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Synchronous `createHash` cannot be implemented over the async WebCrypto
|
|
15
|
+
* API. Fail loudly so the offending code path is visible instead of
|
|
16
|
+
* producing silent bad hashes.
|
|
17
|
+
*/
|
|
18
|
+
export declare function createHash(algorithm: string): never;
|
|
19
|
+
export declare function createHmac(algorithm: string): never;
|
|
20
|
+
declare const _default: {
|
|
21
|
+
webcrypto: Crypto;
|
|
22
|
+
subtle: SubtleCrypto;
|
|
23
|
+
randomUUID: typeof randomUUID;
|
|
24
|
+
getRandomValues: typeof getRandomValues;
|
|
25
|
+
randomBytes: typeof randomBytes;
|
|
26
|
+
timingSafeEqual: typeof timingSafeEqual;
|
|
27
|
+
createHash: typeof createHash;
|
|
28
|
+
createHmac: typeof createHmac;
|
|
29
|
+
};
|
|
30
|
+
export default _default;
|
|
31
|
+
//# sourceMappingURL=crypto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src/shims/crypto.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,eAAO,MAAM,SAAS,EAAE,MAA0B,CAAC;AACnD,eAAO,MAAM,MAAM,EAAE,YAAuC,CAAC;AAE7D,wBAAgB,UAAU,IAAI,MAAM,CAEnC;AAED,wBAAgB,eAAe,CAAC,CAAC,SAAS,eAAe,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAEtE;AAED,wBAAgB,WAAW,CACzB,IAAI,EAAE,MAAM,EACZ,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,YAAY,CAAC,OAAO,MAAM,CAAC,KAAK,IAAI,GACvE,YAAY,CAAC,OAAO,MAAM,CAAC,CAK7B;AAED,wBAAgB,eAAe,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,GAAG,OAAO,CAKrE;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,KAAK,CAKnD;AAED,wBAAgB,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,KAAK,CAKnD;;;;;;;;;;;AAED,wBASE"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal `node:crypto` shim over WebCrypto for the Maravilla isolate.
|
|
3
|
+
* Astro's render path uses WebCrypto (`crypto.subtle`) directly; this shim
|
|
4
|
+
* exists for stray `node:crypto` imports in bundled dependencies.
|
|
5
|
+
*/
|
|
6
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
7
|
+
import { Buffer } from './buffer.js';
|
|
8
|
+
export const webcrypto = globalThis.crypto;
|
|
9
|
+
export const subtle = globalThis.crypto.subtle;
|
|
10
|
+
export function randomUUID() {
|
|
11
|
+
return globalThis.crypto.randomUUID();
|
|
12
|
+
}
|
|
13
|
+
export function getRandomValues(array) {
|
|
14
|
+
return globalThis.crypto.getRandomValues(array);
|
|
15
|
+
}
|
|
16
|
+
export function randomBytes(size, callback) {
|
|
17
|
+
const bytes = new Buffer(size);
|
|
18
|
+
globalThis.crypto.getRandomValues(bytes);
|
|
19
|
+
if (callback)
|
|
20
|
+
callback(null, bytes);
|
|
21
|
+
return bytes;
|
|
22
|
+
}
|
|
23
|
+
export function timingSafeEqual(a, b) {
|
|
24
|
+
if (a.byteLength !== b.byteLength)
|
|
25
|
+
return false;
|
|
26
|
+
let diff = 0;
|
|
27
|
+
for (let i = 0; i < a.byteLength; i++)
|
|
28
|
+
diff |= a[i] ^ b[i];
|
|
29
|
+
return diff === 0;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Synchronous `createHash` cannot be implemented over the async WebCrypto
|
|
33
|
+
* API. Fail loudly so the offending code path is visible instead of
|
|
34
|
+
* producing silent bad hashes.
|
|
35
|
+
*/
|
|
36
|
+
export function createHash(algorithm) {
|
|
37
|
+
throw new Error(`[maravilla] node:crypto createHash('${algorithm}') is not supported in the isolate. ` +
|
|
38
|
+
'Use the async WebCrypto API (crypto.subtle.digest) instead.');
|
|
39
|
+
}
|
|
40
|
+
export function createHmac(algorithm) {
|
|
41
|
+
throw new Error(`[maravilla] node:crypto createHmac('${algorithm}') is not supported in the isolate. ` +
|
|
42
|
+
'Use the async WebCrypto API (crypto.subtle.sign) instead.');
|
|
43
|
+
}
|
|
44
|
+
export default {
|
|
45
|
+
webcrypto,
|
|
46
|
+
subtle,
|
|
47
|
+
randomUUID,
|
|
48
|
+
getRandomValues,
|
|
49
|
+
randomBytes,
|
|
50
|
+
timingSafeEqual,
|
|
51
|
+
createHash,
|
|
52
|
+
createHmac,
|
|
53
|
+
};
|
|
54
|
+
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AU,CAAC,SAAiB;IAC1C,MAAM,IAAI,KAAK,CACb,uCAAuC,SAAS,sCAAsC;QACpF,6DAA6D,CAChE,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,SAAiB;IAC1C,MAAM,IAAI,KAAK,CACb,uCAAuC,SAAS,sCAAsC;QACpF,2DAA2D,CAC9D,CAAC;AACJ,CAAC;AAED,eAAe;IACb,SAAS;IACT,MAAM;IACN,UAAU;IACV,eAAe;IACf,WAAW;IACX,eAAe;IACf,UAAU;IACV,UAAU;CACX,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Throwing `node:fs/promises` shim for the Maravilla isolate.
|
|
3
|
+
*/
|
|
4
|
+
import { promises } from './fs.js';
|
|
5
|
+
export declare const readFile: () => Promise<never>, writeFile: () => Promise<never>, readdir: () => Promise<never>, stat: () => Promise<never>, mkdir: () => Promise<never>;
|
|
6
|
+
export default promises;
|
|
7
|
+
//# sourceMappingURL=fs-promises.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fs-promises.d.ts","sourceRoot":"","sources":["../../src/shims/fs-promises.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,eAAO,MAAQ,QAAQ,wBAAE,SAAS,wBAAE,OAAO,wBAAE,IAAI,wBAAE,KAAK,sBAAa,CAAC;AAEtE,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fs-promises.js","sourceRoot":"","sources":["../../src/shims/fs-promises.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,MAAM,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,QAAQ,CAAC;AAEtE,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Throwing `node:fs` shim for the Maravilla isolate. The Astro render path
|
|
3
|
+
* never touches the filesystem (prerendered error pages are fetched, not
|
|
4
|
+
* read); any dependency that does must fail loudly rather than corrupt state.
|
|
5
|
+
*/
|
|
6
|
+
export declare function existsSync(): boolean;
|
|
7
|
+
export declare function readFileSync(): never;
|
|
8
|
+
export declare function writeFileSync(): never;
|
|
9
|
+
export declare function readdirSync(): never;
|
|
10
|
+
export declare function statSync(): never;
|
|
11
|
+
export declare function mkdirSync(): never;
|
|
12
|
+
export declare function createReadStream(): never;
|
|
13
|
+
export declare const promises: {
|
|
14
|
+
readFile: () => Promise<never>;
|
|
15
|
+
writeFile: () => Promise<never>;
|
|
16
|
+
readdir: () => Promise<never>;
|
|
17
|
+
stat: () => Promise<never>;
|
|
18
|
+
mkdir: () => Promise<never>;
|
|
19
|
+
};
|
|
20
|
+
declare const _default: {
|
|
21
|
+
existsSync: typeof existsSync;
|
|
22
|
+
readFileSync: typeof readFileSync;
|
|
23
|
+
writeFileSync: typeof writeFileSync;
|
|
24
|
+
readdirSync: typeof readdirSync;
|
|
25
|
+
statSync: typeof statSync;
|
|
26
|
+
mkdirSync: typeof mkdirSync;
|
|
27
|
+
createReadStream: typeof createReadStream;
|
|
28
|
+
promises: {
|
|
29
|
+
readFile: () => Promise<never>;
|
|
30
|
+
writeFile: () => Promise<never>;
|
|
31
|
+
readdir: () => Promise<never>;
|
|
32
|
+
stat: () => Promise<never>;
|
|
33
|
+
mkdir: () => Promise<never>;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
export default _default;
|
|
37
|
+
//# sourceMappingURL=fs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../../src/shims/fs.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,wBAAgB,UAAU,IAAI,OAAO,CAEpC;AAED,wBAAgB,YAAY,IAAI,KAAK,CAEpC;AAED,wBAAgB,aAAa,IAAI,KAAK,CAErC;AAED,wBAAgB,WAAW,IAAI,KAAK,CAEnC;AAED,wBAAgB,QAAQ,IAAI,KAAK,CAEhC;AAED,wBAAgB,SAAS,IAAI,KAAK,CAEjC;AAED,wBAAgB,gBAAgB,IAAI,KAAK,CAExC;AAED,eAAO,MAAM,QAAQ;;;;;;CAMpB,CAAC;;;;;;;;;;;;;;;;;AAEF,wBASE"}
|
package/dist/shims/fs.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Throwing `node:fs` shim for the Maravilla isolate. The Astro render path
|
|
3
|
+
* never touches the filesystem (prerendered error pages are fetched, not
|
|
4
|
+
* read); any dependency that does must fail loudly rather than corrupt state.
|
|
5
|
+
*/
|
|
6
|
+
function unsupported(name) {
|
|
7
|
+
throw new Error(`[maravilla] node:fs ${name}() is not available in the isolate. ` +
|
|
8
|
+
'File system access is not part of the web-APIs-only bundle contract.');
|
|
9
|
+
}
|
|
10
|
+
export function existsSync() {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
export function readFileSync() {
|
|
14
|
+
return unsupported('readFileSync');
|
|
15
|
+
}
|
|
16
|
+
export function writeFileSync() {
|
|
17
|
+
return unsupported('writeFileSync');
|
|
18
|
+
}
|
|
19
|
+
export function readdirSync() {
|
|
20
|
+
return unsupported('readdirSync');
|
|
21
|
+
}
|
|
22
|
+
export function statSync() {
|
|
23
|
+
return unsupported('statSync');
|
|
24
|
+
}
|
|
25
|
+
export function mkdirSync() {
|
|
26
|
+
return unsupported('mkdirSync');
|
|
27
|
+
}
|
|
28
|
+
export function createReadStream() {
|
|
29
|
+
return unsupported('createReadStream');
|
|
30
|
+
}
|
|
31
|
+
export const promises = {
|
|
32
|
+
readFile: async () => unsupported('promises.readFile'),
|
|
33
|
+
writeFile: async () => unsupported('promises.writeFile'),
|
|
34
|
+
readdir: async () => unsupported('promises.readdir'),
|
|
35
|
+
stat: async () => unsupported('promises.stat'),
|
|
36
|
+
mkdir: async () => unsupported('promises.mkdir'),
|
|
37
|
+
};
|
|
38
|
+
export default {
|
|
39
|
+
existsSync,
|
|
40
|
+
readFileSync,
|
|
41
|
+
writeFileSync,
|
|
42
|
+
readdirSync,
|
|
43
|
+
statSync,
|
|
44
|
+
mkdirSync,
|
|
45
|
+
createReadStream,
|
|
46
|
+
promises,
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=fs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fs.js","sourceRoot":"","sources":["../../src/shims/fs.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,SAAS,WAAW,CAAC,IAAY;IAC/B,MAAM,IAAI,KAAK,CACb,uBAAuB,IAAI,sCAAsC;QAC/D,sEAAsE,CACzE,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,UAAU;IACxB,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,YAAY;IAC1B,OAAO,WAAW,CAAC,cAAc,CAAC,CAAC;AACrC,CAAC;AAED,MAAM,UAAU,aAAa;IAC3B,OAAO,WAAW,CAAC,eAAe,CAAC,CAAC;AACtC,CAAC;AAED,MAAM,UAAU,WAAW;IACzB,OAAO,WAAW,CAAC,aAAa,CAAC,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,QAAQ;IACtB,OAAO,WAAW,CAAC,UAAU,CAAC,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,SAAS;IACvB,OAAO,WAAW,CAAC,WAAW,CAAC,CAAC;AAClC,CAAC;AAED,MAAM,UAAU,gBAAgB;IAC9B,OAAO,WAAW,CAAC,kBAAkB,CAAC,CAAC;AACzC,CAAC;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,QAAQ,EAAE,KAAK,IAAI,EAAE,CAAC,WAAW,CAAC,mBAAmB,CAAC;IACtD,SAAS,EAAE,KAAK,IAAI,EAAE,CAAC,WAAW,CAAC,oBAAoB,CAAC;IACxD,OAAO,EAAE,KAAK,IAAI,EAAE,CAAC,WAAW,CAAC,kBAAkB,CAAC;IACpD,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC,WAAW,CAAC,eAAe,CAAC;IAC9C,KAAK,EAAE,KAAK,IAAI,EAAE,CAAC,WAAW,CAAC,gBAAgB,CAAC;CACjD,CAAC;AAEF,eAAe;IACb,UAAU;IACV,YAAY;IACZ,aAAa;IACb,WAAW;IACX,QAAQ;IACR,SAAS;IACT,gBAAgB;IAChB,QAAQ;CACT,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal `node:module` shim for the Maravilla isolate.
|
|
3
|
+
*/
|
|
4
|
+
export declare function createRequire(): (id: string) => never;
|
|
5
|
+
declare const _default: {
|
|
6
|
+
createRequire: typeof createRequire;
|
|
7
|
+
};
|
|
8
|
+
export default _default;
|
|
9
|
+
//# sourceMappingURL=module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../src/shims/module.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,wBAAgB,aAAa,IAAI,CAAC,EAAE,EAAE,MAAM,KAAK,KAAK,CAIrD;;;;AAED,wBAAiC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal `node:module` shim for the Maravilla isolate.
|
|
3
|
+
*/
|
|
4
|
+
export function createRequire() {
|
|
5
|
+
return (id) => {
|
|
6
|
+
throw new Error(`[maravilla] require('${id}') is not available in the isolate.`);
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export default { createRequire };
|
|
10
|
+
//# sourceMappingURL=module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../src/shims/module.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,UAAU,aAAa;IAC3B,OAAO,CAAC,EAAU,EAAE,EAAE;QACpB,MAAM,IAAI,KAAK,CAAC,wBAAwB,EAAE,qCAAqC,CAAC,CAAC;IACnF,CAAC,CAAC;AACJ,CAAC;AAED,eAAe,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal `node:os` shim for the Maravilla isolate.
|
|
3
|
+
*/
|
|
4
|
+
export declare const EOL = "\n";
|
|
5
|
+
export declare function platform(): string;
|
|
6
|
+
export declare function tmpdir(): string;
|
|
7
|
+
export declare function homedir(): string;
|
|
8
|
+
export declare function hostname(): string;
|
|
9
|
+
declare const _default: {
|
|
10
|
+
EOL: string;
|
|
11
|
+
platform: typeof platform;
|
|
12
|
+
tmpdir: typeof tmpdir;
|
|
13
|
+
homedir: typeof homedir;
|
|
14
|
+
hostname: typeof hostname;
|
|
15
|
+
};
|
|
16
|
+
export default _default;
|
|
17
|
+
//# sourceMappingURL=os.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"os.d.ts","sourceRoot":"","sources":["../../src/shims/os.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,eAAO,MAAM,GAAG,OAAO,CAAC;AAExB,wBAAgB,QAAQ,IAAI,MAAM,CAEjC;AAED,wBAAgB,MAAM,IAAI,MAAM,CAE/B;AAED,wBAAgB,OAAO,IAAI,MAAM,CAEhC;AAED,wBAAgB,QAAQ,IAAI,MAAM,CAEjC;;;;;;;;AAED,wBAA4D"}
|
package/dist/shims/os.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal `node:os` shim for the Maravilla isolate.
|
|
3
|
+
*/
|
|
4
|
+
export const EOL = '\n';
|
|
5
|
+
export function platform() {
|
|
6
|
+
return 'linux';
|
|
7
|
+
}
|
|
8
|
+
export function tmpdir() {
|
|
9
|
+
return '/tmp';
|
|
10
|
+
}
|
|
11
|
+
export function homedir() {
|
|
12
|
+
return '/';
|
|
13
|
+
}
|
|
14
|
+
export function hostname() {
|
|
15
|
+
return 'maravilla';
|
|
16
|
+
}
|
|
17
|
+
export default { EOL, platform, tmpdir, homedir, hostname };
|
|
18
|
+
//# sourceMappingURL=os.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"os.js","sourceRoot":"","sources":["../../src/shims/os.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,CAAC,MAAM,GAAG,GAAG,IAAI,CAAC;AAExB,MAAM,UAAU,QAAQ;IACtB,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,MAAM;IACpB,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,OAAO;IACrB,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,UAAU,QAAQ;IACtB,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,eAAe,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure-JS posix `node:path` shim for the Maravilla isolate (path joins in
|
|
3
|
+
* Astro's generated manifest and bundled dependencies).
|
|
4
|
+
*/
|
|
5
|
+
export declare const sep = "/";
|
|
6
|
+
export declare const delimiter = ":";
|
|
7
|
+
export declare function normalize(path: string): string;
|
|
8
|
+
export declare function join(...parts: string[]): string;
|
|
9
|
+
export declare function resolve(...parts: string[]): string;
|
|
10
|
+
export declare function dirname(path: string): string;
|
|
11
|
+
export declare function basename(path: string, ext?: string): string;
|
|
12
|
+
export declare function extname(path: string): string;
|
|
13
|
+
export declare function isAbsolute(path: string): boolean;
|
|
14
|
+
export declare function relative(from: string, to: string): string;
|
|
15
|
+
declare const posix: {
|
|
16
|
+
sep: string;
|
|
17
|
+
delimiter: string;
|
|
18
|
+
normalize: typeof normalize;
|
|
19
|
+
join: typeof join;
|
|
20
|
+
resolve: typeof resolve;
|
|
21
|
+
dirname: typeof dirname;
|
|
22
|
+
basename: typeof basename;
|
|
23
|
+
extname: typeof extname;
|
|
24
|
+
isAbsolute: typeof isAbsolute;
|
|
25
|
+
relative: typeof relative;
|
|
26
|
+
};
|
|
27
|
+
export { posix, posix as win32 };
|
|
28
|
+
declare const _default: {
|
|
29
|
+
posix: {
|
|
30
|
+
sep: string;
|
|
31
|
+
delimiter: string;
|
|
32
|
+
normalize: typeof normalize;
|
|
33
|
+
join: typeof join;
|
|
34
|
+
resolve: typeof resolve;
|
|
35
|
+
dirname: typeof dirname;
|
|
36
|
+
basename: typeof basename;
|
|
37
|
+
extname: typeof extname;
|
|
38
|
+
isAbsolute: typeof isAbsolute;
|
|
39
|
+
relative: typeof relative;
|
|
40
|
+
};
|
|
41
|
+
win32: {
|
|
42
|
+
sep: string;
|
|
43
|
+
delimiter: string;
|
|
44
|
+
normalize: typeof normalize;
|
|
45
|
+
join: typeof join;
|
|
46
|
+
resolve: typeof resolve;
|
|
47
|
+
dirname: typeof dirname;
|
|
48
|
+
basename: typeof basename;
|
|
49
|
+
extname: typeof extname;
|
|
50
|
+
isAbsolute: typeof isAbsolute;
|
|
51
|
+
relative: typeof relative;
|
|
52
|
+
};
|
|
53
|
+
sep: string;
|
|
54
|
+
delimiter: string;
|
|
55
|
+
normalize: typeof normalize;
|
|
56
|
+
join: typeof join;
|
|
57
|
+
resolve: typeof resolve;
|
|
58
|
+
dirname: typeof dirname;
|
|
59
|
+
basename: typeof basename;
|
|
60
|
+
extname: typeof extname;
|
|
61
|
+
isAbsolute: typeof isAbsolute;
|
|
62
|
+
relative: typeof relative;
|
|
63
|
+
};
|
|
64
|
+
export default _default;
|
|
65
|
+
//# sourceMappingURL=path.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../src/shims/path.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,GAAG,MAAM,CAAC;AACvB,eAAO,MAAM,SAAS,MAAM,CAAC;AAgB7B,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAO9C;AAED,wBAAgB,IAAI,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAG/C;AAED,wBAAgB,OAAO,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAWlD;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAO5C;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAG3D;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAI5C;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEhD;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CASzD;AAED,QAAA,MAAM,KAAK;;;;;;;;;;;CAWV,CAAC;AAEF,OAAO,EAAE,KAAK,EAAE,KAAK,IAAI,KAAK,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACjC,wBAAiD"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure-JS posix `node:path` shim for the Maravilla isolate (path joins in
|
|
3
|
+
* Astro's generated manifest and bundled dependencies).
|
|
4
|
+
*/
|
|
5
|
+
export const sep = '/';
|
|
6
|
+
export const delimiter = ':';
|
|
7
|
+
function normalizeParts(parts, allowAboveRoot) {
|
|
8
|
+
const res = [];
|
|
9
|
+
for (const part of parts) {
|
|
10
|
+
if (!part || part === '.')
|
|
11
|
+
continue;
|
|
12
|
+
if (part === '..') {
|
|
13
|
+
if (res.length && res[res.length - 1] !== '..')
|
|
14
|
+
res.pop();
|
|
15
|
+
else if (allowAboveRoot)
|
|
16
|
+
res.push('..');
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
res.push(part);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return res;
|
|
23
|
+
}
|
|
24
|
+
export function normalize(path) {
|
|
25
|
+
const isAbs = path.startsWith('/');
|
|
26
|
+
const trailing = path.endsWith('/') && path.length > 1;
|
|
27
|
+
let result = normalizeParts(path.split('/'), !isAbs).join('/');
|
|
28
|
+
if (!result && !isAbs)
|
|
29
|
+
result = '.';
|
|
30
|
+
if (result && trailing)
|
|
31
|
+
result += '/';
|
|
32
|
+
return isAbs ? `/${result}` : result;
|
|
33
|
+
}
|
|
34
|
+
export function join(...parts) {
|
|
35
|
+
const joined = parts.filter(Boolean).join('/');
|
|
36
|
+
return joined ? normalize(joined) : '.';
|
|
37
|
+
}
|
|
38
|
+
export function resolve(...parts) {
|
|
39
|
+
let resolved = '';
|
|
40
|
+
let isAbs = false;
|
|
41
|
+
for (let i = parts.length - 1; i >= 0 && !isAbs; i--) {
|
|
42
|
+
const part = parts[i];
|
|
43
|
+
if (!part)
|
|
44
|
+
continue;
|
|
45
|
+
resolved = resolved ? `${part}/${resolved}` : part;
|
|
46
|
+
isAbs = part.startsWith('/');
|
|
47
|
+
}
|
|
48
|
+
if (!isAbs)
|
|
49
|
+
resolved = `/${resolved}`;
|
|
50
|
+
return `/${normalizeParts(resolved.split('/'), false).join('/')}` || '/';
|
|
51
|
+
}
|
|
52
|
+
export function dirname(path) {
|
|
53
|
+
if (!path.includes('/'))
|
|
54
|
+
return '.';
|
|
55
|
+
const trimmed = path.replace(/\/+$/, '');
|
|
56
|
+
const idx = trimmed.lastIndexOf('/');
|
|
57
|
+
if (idx === -1)
|
|
58
|
+
return '.';
|
|
59
|
+
if (idx === 0)
|
|
60
|
+
return '/';
|
|
61
|
+
return trimmed.slice(0, idx);
|
|
62
|
+
}
|
|
63
|
+
export function basename(path, ext) {
|
|
64
|
+
const base = path.replace(/\/+$/, '').split('/').pop() ?? '';
|
|
65
|
+
return ext && base.endsWith(ext) ? base.slice(0, -ext.length) : base;
|
|
66
|
+
}
|
|
67
|
+
export function extname(path) {
|
|
68
|
+
const base = basename(path);
|
|
69
|
+
const idx = base.lastIndexOf('.');
|
|
70
|
+
return idx > 0 ? base.slice(idx) : '';
|
|
71
|
+
}
|
|
72
|
+
export function isAbsolute(path) {
|
|
73
|
+
return path.startsWith('/');
|
|
74
|
+
}
|
|
75
|
+
export function relative(from, to) {
|
|
76
|
+
const fromParts = resolve(from).split('/').filter(Boolean);
|
|
77
|
+
const toParts = resolve(to).split('/').filter(Boolean);
|
|
78
|
+
let common = 0;
|
|
79
|
+
while (common < fromParts.length && common < toParts.length && fromParts[common] === toParts[common]) {
|
|
80
|
+
common++;
|
|
81
|
+
}
|
|
82
|
+
const up = fromParts.slice(common).map(() => '..');
|
|
83
|
+
return [...up, ...toParts.slice(common)].join('/');
|
|
84
|
+
}
|
|
85
|
+
const posix = {
|
|
86
|
+
sep,
|
|
87
|
+
delimiter,
|
|
88
|
+
normalize,
|
|
89
|
+
join,
|
|
90
|
+
resolve,
|
|
91
|
+
dirname,
|
|
92
|
+
basename,
|
|
93
|
+
extname,
|
|
94
|
+
isAbsolute,
|
|
95
|
+
relative,
|
|
96
|
+
};
|
|
97
|
+
export { posix, posix as win32 };
|
|
98
|
+
export default { ...posix, posix, win32: posix };
|
|
99
|
+
//# sourceMappingURL=path.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path.js","sourceRoot":"","sources":["../../src/shims/path.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,CAAC,MAAM,GAAG,GAAG,GAAG,CAAC;AACvB,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,CAAC;AAE7B,SAAS,cAAc,CAAC,KAAe,EAAE,cAAuB;IAC9D,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,CAAC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GAAG,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;IACnD,OAAO,CAAC,GAAG,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACrD,CAAC;AAED,MAAM,KAAK,GAAG;IACZ,GAAG;IACH,SAAS;IACT,SAAS;IACT,IAAI;IACJ,OAAO;IACP,OAAO;IACP,QAAQ;IACR,OAAO;IACP,UAAU;IACV,QAAQ;CACT,CAAC;AAEF,OAAO,EAAE,KAAK,EAAE,KAAK,IAAI,KAAK,EAAE,CAAC;AACjC,eAAe,EAAE,GAAG,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal `node:process` shim for the Maravilla isolate. The runtime installs
|
|
3
|
+
* a `globalThis.process` with a real `env`; delegate to it when present so
|
|
4
|
+
* environment sniffing in Astro internals sees tenant-scoped variables.
|
|
5
|
+
*/
|
|
6
|
+
declare const processShim: any;
|
|
7
|
+
export declare const env: Record<string, string | undefined>;
|
|
8
|
+
export declare const argv: string[];
|
|
9
|
+
export declare const platform: string;
|
|
10
|
+
export declare const version: string;
|
|
11
|
+
export declare const versions: Record<string, string>;
|
|
12
|
+
export declare const cwd: () => string;
|
|
13
|
+
export declare const nextTick: (fn: (...args: any[]) => void, ...args: any[]) => void;
|
|
14
|
+
export default processShim;
|
|
15
|
+
//# sourceMappingURL=process.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process.d.ts","sourceRoot":"","sources":["../../src/shims/process.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,QAAA,MAAM,WAAW,EAAE,GAYlB,CAAC;AAEF,eAAO,MAAM,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAmB,CAAC;AACvE,eAAO,MAAM,IAAI,EAAE,MAAM,EAA2B,CAAC;AACrD,eAAO,MAAM,QAAQ,EAAE,MAAwC,CAAC;AAChE,eAAO,MAAM,OAAO,EAAE,MAAyC,CAAC;AAChE,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAA8C,CAAC;AAC3F,eAAO,MAAM,GAAG,EAAE,MAAM,MAAuC,CAAC;AAChE,eAAO,MAAM,QAAQ,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IACiB,CAAC;AAE3F,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal `node:process` shim for the Maravilla isolate. The runtime installs
|
|
3
|
+
* a `globalThis.process` with a real `env`; delegate to it when present so
|
|
4
|
+
* environment sniffing in Astro internals sees tenant-scoped variables.
|
|
5
|
+
*/
|
|
6
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
7
|
+
const existing = globalThis.process;
|
|
8
|
+
const processShim = existing ?? {
|
|
9
|
+
env: {},
|
|
10
|
+
argv: [],
|
|
11
|
+
platform: 'linux',
|
|
12
|
+
version: 'v22.0.0',
|
|
13
|
+
versions: { node: '22.0.0' },
|
|
14
|
+
cwd: () => '/',
|
|
15
|
+
nextTick: (fn, ...args) => queueMicrotask(() => fn(...args)),
|
|
16
|
+
on: () => processShim,
|
|
17
|
+
once: () => processShim,
|
|
18
|
+
off: () => processShim,
|
|
19
|
+
exit: () => undefined,
|
|
20
|
+
};
|
|
21
|
+
export const env = processShim.env;
|
|
22
|
+
export const argv = processShim.argv ?? [];
|
|
23
|
+
export const platform = processShim.platform ?? 'linux';
|
|
24
|
+
export const version = processShim.version ?? 'v22.0.0';
|
|
25
|
+
export const versions = processShim.versions ?? { node: '22.0.0' };
|
|
26
|
+
export const cwd = processShim.cwd ?? (() => '/');
|
|
27
|
+
export const nextTick = processShim.nextTick ?? ((fn, ...args) => queueMicrotask(() => fn(...args)));
|
|
28
|
+
export default processShim;
|
|
29
|
+
//# sourceMappingURL=process.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process.js","sourceRoot":"","sources":["../../src/shims/process.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,uDAAuD;AAEvD,MAAM,QAAQ,GAAS,UAAkB,CAAC,OAAO,CAAC;AAElD,MAAM,WAAW,GAAQ,QAAQ,IAAI;IACnC,GAAG,EAAE,EAAE;IACP,IAAI,EAAE,EAAc;IACpB,QAAQ,EAAE,OAAO;IACjB,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC5B,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG;IACd,QAAQ,EAAE,CAAC,EAA4B,EAAE,GAAG,IAAW,EAAE,EAAE,CAAC,cAAc,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;IAC7F,EAAE,EAAE,GAAG,EAAE,CAAC,WAAW;IACrB,IAAI,EAAE,GAAG,EAAE,CAAC,WAAW;IACvB,GAAG,EAAE,GAAG,EAAE,CAAC,WAAW;IACtB,IAAI,EAAE,GAAG,EAAE,CAAC,SAAS;CACtB,CAAC;AAEF,MAAM,CAAC,MAAM,GAAG,GAAuC,WAAW,CAAC,GAAG,CAAC;AACvE,MAAM,CAAC,MAAM,IAAI,GAAa,WAAW,CAAC,IAAI,IAAI,EAAE,CAAC;AACrD,MAAM,CAAC,MAAM,QAAQ,GAAW,WAAW,CAAC,QAAQ,IAAI,OAAO,CAAC;AAChE,MAAM,CAAC,MAAM,OAAO,GAAW,WAAW,CAAC,OAAO,IAAI,SAAS,CAAC;AAChE,MAAM,CAAC,MAAM,QAAQ,GAA2B,WAAW,CAAC,QAAQ,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;AAC3F,MAAM,CAAC,MAAM,GAAG,GAAiB,WAAW,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;AAChE,MAAM,CAAC,MAAM,QAAQ,GACnB,WAAW,CAAC,QAAQ,IAAI,CAAC,CAAC,EAAO,EAAE,GAAG,IAAW,EAAE,EAAE,CAAC,cAAc,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;AAE3F,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal `node:url` shim over the web URL API for the Maravilla isolate.
|
|
3
|
+
*/
|
|
4
|
+
export declare const URL: {
|
|
5
|
+
new (url: string | URL, base?: string | URL): URL;
|
|
6
|
+
prototype: URL;
|
|
7
|
+
canParse(url: string | URL, base?: string | URL): boolean;
|
|
8
|
+
createObjectURL(obj: Blob | MediaSource): string;
|
|
9
|
+
parse(url: string | URL, base?: string | URL): URL | null;
|
|
10
|
+
revokeObjectURL(url: string): void;
|
|
11
|
+
};
|
|
12
|
+
export declare const URLSearchParams: {
|
|
13
|
+
new (init?: string[][] | Record<string, string> | string | URLSearchParams): URLSearchParams;
|
|
14
|
+
prototype: URLSearchParams;
|
|
15
|
+
};
|
|
16
|
+
export declare function fileURLToPath(url: string | InstanceType<typeof URL>): string;
|
|
17
|
+
export declare function pathToFileURL(path: string): InstanceType<typeof URL>;
|
|
18
|
+
export declare function parse(input: string): Record<string, unknown>;
|
|
19
|
+
declare const _default: {
|
|
20
|
+
URL: {
|
|
21
|
+
new (url: string | URL, base?: string | URL): URL;
|
|
22
|
+
prototype: URL;
|
|
23
|
+
canParse(url: string | URL, base?: string | URL): boolean;
|
|
24
|
+
createObjectURL(obj: Blob | MediaSource): string;
|
|
25
|
+
parse(url: string | URL, base?: string | URL): URL | null;
|
|
26
|
+
revokeObjectURL(url: string): void;
|
|
27
|
+
};
|
|
28
|
+
URLSearchParams: {
|
|
29
|
+
new (init?: string[][] | Record<string, string> | string | URLSearchParams): URLSearchParams;
|
|
30
|
+
prototype: URLSearchParams;
|
|
31
|
+
};
|
|
32
|
+
fileURLToPath: typeof fileURLToPath;
|
|
33
|
+
pathToFileURL: typeof pathToFileURL;
|
|
34
|
+
parse: typeof parse;
|
|
35
|
+
};
|
|
36
|
+
export default _default;
|
|
37
|
+
//# sourceMappingURL=url.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../src/shims/url.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,eAAO,MAAM,GAAG;;;;;;;CAAiB,CAAC;AAClC,eAAO,MAAM,eAAe;;;CAA6B,CAAC;AAE1D,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,CAAC,OAAO,GAAG,CAAC,GAAG,MAAM,CAM5E;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAAC,OAAO,GAAG,CAAC,CAEpE;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAY5D;;;;;;;;;;;;;;;;;;AAED,wBAA6E"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal `node:url` shim over the web URL API for the Maravilla isolate.
|
|
3
|
+
*/
|
|
4
|
+
export const URL = globalThis.URL;
|
|
5
|
+
export const URLSearchParams = globalThis.URLSearchParams;
|
|
6
|
+
export function fileURLToPath(url) {
|
|
7
|
+
const u = typeof url === 'string' ? new globalThis.URL(url) : url;
|
|
8
|
+
if (u.protocol !== 'file:') {
|
|
9
|
+
throw new TypeError('The URL must be of scheme file');
|
|
10
|
+
}
|
|
11
|
+
return decodeURIComponent(u.pathname);
|
|
12
|
+
}
|
|
13
|
+
export function pathToFileURL(path) {
|
|
14
|
+
return new globalThis.URL(`file://${encodeURI(path).replace(/[?#]/g, encodeURIComponent)}`);
|
|
15
|
+
}
|
|
16
|
+
export function parse(input) {
|
|
17
|
+
const u = new globalThis.URL(input, 'http://localhost');
|
|
18
|
+
return {
|
|
19
|
+
protocol: u.protocol,
|
|
20
|
+
host: u.host,
|
|
21
|
+
hostname: u.hostname,
|
|
22
|
+
port: u.port,
|
|
23
|
+
pathname: u.pathname,
|
|
24
|
+
search: u.search,
|
|
25
|
+
hash: u.hash,
|
|
26
|
+
href: u.href,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export default { URL, URLSearchParams, fileURLToPath, pathToFileURL, parse };
|
|
30
|
+
//# sourceMappingURL=url.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url.js","sourceRoot":"","sources":["../../src/shims/url.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,CAAC,MAAM,GAAG,GAAG,UAAU,CAAC,GAAG,CAAC;AAClC,MAAM,CAAC,MAAM,eAAe,GAAG,UAAU,CAAC,eAAe,CAAC;AAE1D,MAAM,UAAU,aAAa,CAAC,GAAsC;IAClE,MAAM,CAAC,GAAG,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;IAClE,IAAI,CAAC,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;QAC3B,MAAM,IAAI,SAAS,CAAC,gCAAgC,CAAC,CAAC;IACxD,CAAC;IACD,OAAO,kBAAkB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;AACxC,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,OAAO,IAAI,UAAU,CAAC,GAAG,CAAC,UAAU,SAAS,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,kBAAkB,CAAC,EAAE,CAAC,CAAC;AAC9F,CAAC;AAED,MAAM,UAAU,KAAK,CAAC,KAAa;IACjC,MAAM,CAAC,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,KAAK,EAAE,kBAAkB,CAAC,CAAC;IACxD,OAAO;QACL,QAAQ,EAAE,CAAC,CAAC,QAAQ;QACpB,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,QAAQ,EAAE,CAAC,CAAC,QAAQ;QACpB,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,QAAQ,EAAE,CAAC,CAAC,QAAQ;QACpB,MAAM,EAAE,CAAC,CAAC,MAAM;QAChB,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,IAAI,EAAE,CAAC,CAAC,IAAI;KACb,CAAC;AACJ,CAAC;AAED,eAAe,EAAE,GAAG,EAAE,eAAe,EAAE,aAAa,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Worker template for Astro on Maravilla Runtime.
|
|
3
|
+
*
|
|
4
|
+
* The __SERVER_ENTRY__ placeholder is replaced at build time with the path to
|
|
5
|
+
* Astro's built server entry (dist/server/entry.mjs), which is our
|
|
6
|
+
* `server-entrypoint.ts` bound to the generated SSR manifest.
|
|
7
|
+
*
|
|
8
|
+
* NOTE: No top-level await and no ES module syntax may survive to the output —
|
|
9
|
+
* the runtime wraps bundles in an IIFE. esbuild resolves the import below at
|
|
10
|
+
* bundle time; Astro's `createApp` is synchronous so no lazy init is needed,
|
|
11
|
+
* but we still guard the polyfill re-application for worker reuse.
|
|
12
|
+
*/
|
|
13
|
+
export declare const WORKER_TEMPLATE = "// 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\n\n// Import the Astro server build (resolved by esbuild at bundle time)\nimport { handler } from '__SERVER_ENTRY__';\n\nasync function handleRequest(request) {\n // Re-apply polyfills if needed (worker reuse)\n if (globalThis.Request !== EnhancedRequest) {\n globalThis.Request = EnhancedRequest;\n globalThis.fetch = enhancedFetch;\n }\n\n try {\n return await handler(request);\n } catch (error) {\n console.error('[maravilla] handleRequest error:', error?.message || error);\n console.error('[maravilla] stack:', error?.stack || 'no stack');\n throw error;\n }\n}\n\nglobalThis.handleRequest = handleRequest;\n";
|
|
14
|
+
//# sourceMappingURL=worker-template.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worker-template.d.ts","sourceRoot":"","sources":["../src/worker-template.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,eAAe,02GAsB3B,CAAC"}
|