@scelar/nodepod 1.0.3 → 1.0.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/dist/__sw__.js +642 -642
- package/dist/{child_process-D6oDN2MX.js → child_process-53fMkug_.js} +4 -4
- package/dist/child_process-53fMkug_.js.map +1 -0
- package/dist/{child_process-hmVqFcF7.cjs → child_process-lxSKECHq.cjs} +5 -5
- package/dist/child_process-lxSKECHq.cjs.map +1 -0
- package/dist/{index-Ale2oba_.js → index-B8lyh_ti.js} +1081 -428
- package/dist/index-B8lyh_ti.js.map +1 -0
- package/dist/{index-BO1i013L.cjs → index-C-TQIrdG.cjs} +1195 -430
- package/dist/index-C-TQIrdG.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/memory-volume.d.ts +1 -1
- package/dist/polyfills/wasi.d.ts +45 -4
- package/dist/sdk/nodepod.d.ts +4 -3
- package/dist/sdk/types.d.ts +6 -0
- package/dist/threading/process-manager.d.ts +1 -1
- package/dist/threading/worker-protocol.d.ts +1 -1
- package/package.json +97 -97
- package/src/index.ts +192 -192
- package/src/memory-volume.ts +10 -4
- package/src/packages/version-resolver.ts +12 -2
- package/src/polyfills/child_process.ts +2288 -2288
- package/src/polyfills/fs.ts +2888 -2888
- package/src/polyfills/http.ts +1450 -1449
- package/src/polyfills/process.ts +27 -1
- package/src/polyfills/stream.ts +1620 -1620
- package/src/polyfills/wasi.ts +1284 -22
- package/src/request-proxy.ts +716 -716
- package/src/script-engine.ts +3694 -3396
- package/src/sdk/nodepod.ts +525 -509
- package/src/sdk/types.ts +7 -0
- package/src/syntax-transforms.ts +2 -2
- package/src/threading/offload-worker.ts +383 -383
- package/src/threading/offload.ts +271 -271
- package/src/threading/process-manager.ts +956 -956
- package/src/threading/process-worker-entry.ts +858 -854
- package/src/threading/worker-protocol.ts +1 -1
- package/dist/child_process-D6oDN2MX.js.map +0 -1
- package/dist/child_process-hmVqFcF7.cjs.map +0 -1
- package/dist/index-Ale2oba_.js.map +0 -1
- package/dist/index-BO1i013L.cjs.map +0 -1
package/src/sdk/types.ts
CHANGED
|
@@ -61,6 +61,13 @@ export interface StatResult {
|
|
|
61
61
|
|
|
62
62
|
export type Snapshot = VolumeSnapshot;
|
|
63
63
|
|
|
64
|
+
export interface SnapshotOptions {
|
|
65
|
+
/** Exclude node_modules and other auto-installable dirs. Default: true */
|
|
66
|
+
shallow?: boolean;
|
|
67
|
+
/** Auto-install deps from package.json after restoring a shallow snapshot. Default: true */
|
|
68
|
+
autoInstall?: boolean;
|
|
69
|
+
}
|
|
70
|
+
|
|
64
71
|
/* ---- Spawn ---- */
|
|
65
72
|
|
|
66
73
|
export interface SpawnOptions {
|
package/src/syntax-transforms.ts
CHANGED
|
@@ -237,7 +237,7 @@ function esmToCjsViaAst(code: string): string {
|
|
|
237
237
|
collectEsmCjsPatches(ast as any, code, patches);
|
|
238
238
|
|
|
239
239
|
let output = code;
|
|
240
|
-
patches.sort((a, b) => b[0] - a[0]);
|
|
240
|
+
patches.sort((a, b) => b[0] - a[0] || b[1] - a[1]);
|
|
241
241
|
for (const [s, e, r] of patches)
|
|
242
242
|
output = output.slice(0, s) + r + output.slice(e);
|
|
243
243
|
return output;
|
|
@@ -439,7 +439,7 @@ export function stripTopLevelAwait(
|
|
|
439
439
|
if (patches.length === 0) return code;
|
|
440
440
|
|
|
441
441
|
let output = code;
|
|
442
|
-
patches.sort((a, b) => b[0] - a[0]);
|
|
442
|
+
patches.sort((a, b) => b[0] - a[0] || b[1] - a[1]);
|
|
443
443
|
for (const [start, end, replacement] of patches) {
|
|
444
444
|
output = output.slice(0, start) + replacement + output.slice(end);
|
|
445
445
|
}
|