@scelar/nodepod 1.0.6 → 1.0.7

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.
@@ -8,7 +8,7 @@ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot
8
8
  var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
9
9
  var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
10
10
  var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
11
- let watcherPolyfill, ProcessWorkerAdapter, Buffer2, RequestProxy, DEFAULT_ENV, EventEmitter, SANDBOX_DEPLOYMENT_GUIDE, SharedVFSController, SharedVFSReader, IframeSandbox, SyncChannelController, SyncChannelWorker, LS_BLOCK_SIZE, MOCK_PID, NPM_REGISTRY_URL_SLASH, VFSBridge, ProcessHandle, WorkerSandbox, Readable, ScriptEngine, TIMEOUTS, WorkerVFS, VERSIONS, Writable, assert$1, YES_REPEAT_COUNT, buildFileSystemBridge, buildProcessEnv, relative, createProcessContext, createWorkspace, esbuildPolyfill, events, executeCode, macEventsPolyfill, generateSandboxDeployment, getProxyInstance, getSandboxHostingConfig, getSandboxPageHtml, httpPolyfill, install, isSharedArrayBufferAvailable, module$1, tcpPolyfill, installer, pathPolyfill, perfPolyfill, qsPolyfill, scannerPolyfill, resetProxy, rollupPolyfill, setActiveContext, spawnEngine, spawnProcessWorkerEngine, stream, urlPolyfill, helpersPolyfill, threadPoolPolyfill, wsPolyfill, registryClient, basename, createHash, dirname, extname, format, getAllServers, ref$1, addDrainListener, closeAllServers, resetRefCount, getActiveContext, getRefCount, normalize, resetActiveInterfaceCount, DependencyInstaller, LRUCache, resolve$2, MemoryHandler, MemoryVolume, unref, Nodepod, NodepodFS, NodepodProcess, NodepodTerminal, ProcessManager;
11
+ let watcherPolyfill, ProcessWorkerAdapter, Buffer2, RequestProxy, DEFAULT_ENV, EventEmitter, SANDBOX_DEPLOYMENT_GUIDE, SharedVFSController, SharedVFSReader, IframeSandbox, SyncChannelController, SyncChannelWorker, LS_BLOCK_SIZE, MOCK_PID, NPM_REGISTRY_URL_SLASH, VFSBridge, ProcessHandle, WorkerSandbox, Readable, ScriptEngine, TIMEOUTS, WorkerVFS, VERSIONS, Writable, assert$1, YES_REPEAT_COUNT, buildFileSystemBridge, buildProcessEnv, relative, createProcessContext, createWorkspace, esbuildPolyfill, events, executeCode, macEventsPolyfill, generateSandboxDeployment, getProxyInstance, getSandboxHostingConfig, getSandboxPageHtml, httpPolyfill, install, isSharedArrayBufferAvailable, module$1, tcpPolyfill, installer, pathPolyfill, perfPolyfill, qsPolyfill, scannerPolyfill, resetProxy, rollupPolyfill, setActiveContext, spawnEngine, spawnProcessWorkerEngine, stream, urlPolyfill, helpersPolyfill, threadPoolPolyfill, wsPolyfill, registryClient, basename, createHash, dirname, extname, format, getAllServers, ref$1, addDrainListener, closeAllServers, resetRefCount, resetActiveInterfaceCount, getActiveContext, normalize, getRefCount, DependencyInstaller, LRUCache, resolve$2, MemoryHandler, MemoryVolume, unref, Nodepod, NodepodFS, NodepodProcess, NodepodTerminal, ProcessManager;
12
12
  let __tla = (async () => {
13
13
  var _a, _b, _c;
14
14
  const SEGMENT_SIZE = 8192;
@@ -30263,7 +30263,7 @@ ${scanErr.stack}` : "";
30263
30263
  });
30264
30264
  this.fsBridge = buildFileSystemBridge(vol, () => this.proc.cwd());
30265
30265
  this.opts = opts;
30266
- import("./child_process-4ZrgCVFu.js").then(async (m) => {
30266
+ import("./child_process-CgnmoilU.js").then(async (m) => {
30267
30267
  await m.__tla;
30268
30268
  return m;
30269
30269
  }).then((mod) => {
@@ -36117,19 +36117,10 @@ miniExpose(endpoint);
36117
36117
  }
36118
36118
  };
36119
36119
  }
36120
- let _shellMod$1 = null;
36121
- async function getShellMod$1() {
36122
- if (!_shellMod$1) _shellMod$1 = await import("./child_process-4ZrgCVFu.js").then(async (m) => {
36123
- await m.__tla;
36124
- return m;
36125
- });
36126
- return _shellMod$1;
36127
- }
36128
36120
  Nodepod = (_c = class {
36129
- constructor(volume, engine2, packages, proxy2, cwd, handler) {
36121
+ constructor(volume, packages, proxy2, cwd, handler) {
36130
36122
  __publicField(this, "fs");
36131
36123
  __publicField(this, "_volume");
36132
- __publicField(this, "_engine");
36133
36124
  __publicField(this, "_packages");
36134
36125
  __publicField(this, "_proxy");
36135
36126
  __publicField(this, "_cwd");
@@ -36140,7 +36131,6 @@ miniExpose(endpoint);
36140
36131
  __publicField(this, "_unwatchVFS", null);
36141
36132
  __publicField(this, "_handler");
36142
36133
  this._volume = volume;
36143
- this._engine = engine2;
36144
36134
  this._packages = packages;
36145
36135
  this._proxy = proxy2;
36146
36136
  this._cwd = cwd;
@@ -36205,11 +36195,6 @@ miniExpose(endpoint);
36205
36195
  const handler = new MemoryHandler(opts.memory);
36206
36196
  handler.startMonitoring();
36207
36197
  const volume = new MemoryVolume(handler);
36208
- const engine2 = new ScriptEngine(volume, {
36209
- cwd,
36210
- env: opts.env,
36211
- handler
36212
- });
36213
36198
  let snapshotCache = null;
36214
36199
  if (opts.enableSnapshotCache !== false) {
36215
36200
  try {
@@ -36223,8 +36208,7 @@ miniExpose(endpoint);
36223
36208
  const proxy2 = getProxyInstance({
36224
36209
  onServerReady: opts.onServerReady
36225
36210
  });
36226
- const nodepod = new Nodepod(volume, engine2, packages, proxy2, cwd, handler);
36227
- handler.onPressure(() => engine2.clearCache());
36211
+ const nodepod = new Nodepod(volume, packages, proxy2, cwd, handler);
36228
36212
  if (opts.files) {
36229
36213
  for (const [path2, content] of Object.entries(opts.files)) {
36230
36214
  const dir = path2.substring(0, path2.lastIndexOf("/")) || "/";
@@ -36251,11 +36235,6 @@ miniExpose(endpoint);
36251
36235
  });
36252
36236
  }
36253
36237
  }
36254
- const shell = await getShellMod$1();
36255
- shell.initShellExec(volume, {
36256
- cwd,
36257
- env: opts.env
36258
- });
36259
36238
  if (opts.swUrl && typeof navigator !== "undefined" && "serviceWorker" in navigator) {
36260
36239
  try {
36261
36240
  await proxy2.initServiceWorker({
@@ -36525,18 +36504,15 @@ miniExpose(endpoint);
36525
36504
  this._unwatchVFS();
36526
36505
  this._unwatchVFS = null;
36527
36506
  }
36528
- this._engine.clearCache();
36529
36507
  this._processManager.teardown();
36530
36508
  this._volume.dispose();
36531
36509
  this._handler.destroy();
36532
36510
  }
36533
36511
  memoryStats() {
36534
36512
  const vfs = this._volume.getStats();
36535
- const moduleRegistry = this._engine.moduleRegistry ?? {};
36536
- const transformCache = this._engine.transformCache;
36537
36513
  const engine2 = {
36538
- moduleCacheSize: Object.keys(moduleRegistry).length,
36539
- transformCacheSize: (transformCache == null ? void 0 : transformCache.size) ?? 0
36514
+ moduleCacheSize: 0,
36515
+ transformCacheSize: 0
36540
36516
  };
36541
36517
  let heap = null;
36542
36518
  const perf = typeof performance !== "undefined" ? performance : null;
@@ -36557,7 +36533,7 @@ miniExpose(endpoint);
36557
36533
  return this._volume;
36558
36534
  }
36559
36535
  get engine() {
36560
- return this._engine;
36536
+ throw new Error("[Nodepod] Main-thread engine removed for security. All code now runs in isolated Web Workers via spawn().");
36561
36537
  }
36562
36538
  get packages() {
36563
36539
  return this._packages;
@@ -36767,7 +36743,7 @@ miniExpose(endpoint);
36767
36743
  };
36768
36744
  let _shellMod = null;
36769
36745
  async function getShellMod() {
36770
- if (!_shellMod) _shellMod = await import("./child_process-4ZrgCVFu.js").then(async (m) => {
36746
+ if (!_shellMod) _shellMod = await import("./child_process-CgnmoilU.js").then(async (m) => {
36771
36747
  await m.__tla;
36772
36748
  return m;
36773
36749
  });
@@ -36905,10 +36881,10 @@ export {
36905
36881
  addDrainListener as i,
36906
36882
  closeAllServers as j,
36907
36883
  resetRefCount as k,
36908
- getActiveContext as l,
36909
- getRefCount as m,
36884
+ resetActiveInterfaceCount as l,
36885
+ getActiveContext as m,
36910
36886
  normalize as n,
36911
- resetActiveInterfaceCount as o,
36887
+ getRefCount as o,
36912
36888
  DependencyInstaller as p,
36913
36889
  LRUCache as q,
36914
36890
  resolve$2 as r,