@volter/world-runtime 3.0.55 → 3.0.56

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.
@@ -510,6 +510,15 @@ function injectPreloadSpecifier() {
510
510
  // resolved on use: importing the runtime has no side effects in a host without module resolution
511
511
  return createRequire(import.meta.url).resolve('@volter/world-core/inject');
512
512
  }
513
+ /** A World's NODE_OPTIONS: its own injector, then the launcher's options without an outer World's injector. One
514
+ * injector per process (the innermost World's, which already routes on to the outer World's twins); a second one
515
+ * patches the same doors twice, and tools that re-serialize NODE_OPTIONS (Next.js's build workers) merge the two
516
+ * `--require` paths into one filename. */
517
+ function worldNodeOptions(inherited) {
518
+ const own = `--require ${injectPreloadSpecifier()}`;
519
+ const rest = (inherited ?? '').replace(/(^|\s)(?:--require|-r)[ =]\S*[\\/]world-core[\\/]inject\.cjs(?=\s|$)/g, ' ').trim();
520
+ return rest ? `${own} ${rest}` : own;
521
+ }
513
522
  function writeProxyEnv(root, name, env) {
514
523
  writeTextAtomic(proxyEnvFile(root, name), `${JSON.stringify(env, null, 2)}\n`);
515
524
  }
@@ -2162,7 +2171,7 @@ export async function upWorld(configId, options = {}, abort) {
2162
2171
  // non-loopback host once this is set. Without it "sealed" only records intent and every
2163
2172
  // untwinned host is blind-tunneled to the real internet (TWIN-60).
2164
2173
  ...(mode === 'sealed' ? { VOLTER_WORLD_SEALED: '1', VOLTER_TWIN_STRICT_EGRESS: '1' } : {}),
2165
- NODE_OPTIONS: `--require ${injectPreloadSpecifier()}${inheritedEnv.NODE_OPTIONS ? ` ${inheritedEnv.NODE_OPTIONS}` : ''}`,
2174
+ NODE_OPTIONS: worldNodeOptions(inheritedEnv.NODE_OPTIONS),
2166
2175
  };
2167
2176
  env.NO_PROXY = `127.0.0.1,localhost${env.NO_PROXY || inheritedEnv.NO_PROXY ? `,${env.NO_PROXY ?? inheritedEnv.NO_PROXY}` : ''}`;
2168
2177
  env.no_proxy = `127.0.0.1,localhost${env.no_proxy || inheritedEnv.no_proxy ? `,${env.no_proxy ?? inheritedEnv.no_proxy}` : ''}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volter/world-runtime",
3
- "version": "3.0.55",
3
+ "version": "3.0.56",
4
4
  "description": "World configs for twins: boot named local runtimes, allocate ports, generate world.env/instance.json, and run apps against fake-key twin worlds.",
5
5
  "keywords": [
6
6
  "twin",
@@ -69,14 +69,14 @@
69
69
  "node": ">=22.3"
70
70
  },
71
71
  "peerDependencies": {
72
- "@volter/world-core": "3.0.55",
73
- "@volter/world-console": "3.0.50"
72
+ "@volter/world-core": "3.0.56",
73
+ "@volter/world-console": "3.0.51"
74
74
  },
75
75
  "dependencies": {
76
76
  "@electric-sql/pglite": "0.5.8",
77
77
  "@electric-sql/pglite-pgvector": "0.0.9",
78
78
  "@volter/world-access": "3.0.1",
79
- "@volter/world-core": "3.0.55",
79
+ "@volter/world-core": "3.0.56",
80
80
  "mongodb": "~6.20.0",
81
81
  "pg-gateway": "0.3.0-beta.4",
82
82
  "smol-toml": "^1.8.0",
package/src/runtime.ts CHANGED
@@ -553,6 +553,16 @@ function injectPreloadSpecifier(): string {
553
553
  return createRequire(import.meta.url).resolve('@volter/world-core/inject');
554
554
  }
555
555
 
556
+ /** A World's NODE_OPTIONS: its own injector, then the launcher's options without an outer World's injector. One
557
+ * injector per process (the innermost World's, which already routes on to the outer World's twins); a second one
558
+ * patches the same doors twice, and tools that re-serialize NODE_OPTIONS (Next.js's build workers) merge the two
559
+ * `--require` paths into one filename. */
560
+ function worldNodeOptions(inherited: string | undefined): string {
561
+ const own = `--require ${injectPreloadSpecifier()}`;
562
+ const rest = (inherited ?? '').replace(/(^|\s)(?:--require|-r)[ =]\S*[\\/]world-core[\\/]inject\.cjs(?=\s|$)/g, ' ').trim();
563
+ return rest ? `${own} ${rest}` : own;
564
+ }
565
+
556
566
  function writeProxyEnv(root: string, name: string, env: Record<string, string>): void {
557
567
  writeTextAtomic(proxyEnvFile(root, name), `${JSON.stringify(env, null, 2)}\n`);
558
568
  }
@@ -2049,7 +2059,7 @@ export async function upWorld(configId: string, options: UpWorldOptions = {}, ab
2049
2059
  // non-loopback host once this is set. Without it "sealed" only records intent and every
2050
2060
  // untwinned host is blind-tunneled to the real internet (TWIN-60).
2051
2061
  ...(mode === 'sealed' ? { VOLTER_WORLD_SEALED: '1', VOLTER_TWIN_STRICT_EGRESS: '1' } : {}),
2052
- NODE_OPTIONS: `--require ${injectPreloadSpecifier()}${inheritedEnv.NODE_OPTIONS ? ` ${inheritedEnv.NODE_OPTIONS}` : ''}`,
2062
+ NODE_OPTIONS: worldNodeOptions(inheritedEnv.NODE_OPTIONS),
2053
2063
  };
2054
2064
  env.NO_PROXY = `127.0.0.1,localhost${env.NO_PROXY || inheritedEnv.NO_PROXY ? `,${env.NO_PROXY ?? inheritedEnv.NO_PROXY}` : ''}`;
2055
2065
  env.no_proxy = `127.0.0.1,localhost${env.no_proxy || inheritedEnv.no_proxy ? `,${env.no_proxy ?? inheritedEnv.no_proxy}` : ''}`;