@volter/twin-world 0.1.1 → 0.1.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volter/twin-world",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
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",
@@ -59,7 +59,7 @@
59
59
  "bun": ">=1.2.0"
60
60
  },
61
61
  "peerDependencies": {
62
- "@volter/twin": "0.1.1"
62
+ "@volter/twin": "^0.1.2"
63
63
  },
64
64
  "dependencies": {
65
65
  "@electric-sql/pglite": "0.5.8",
package/src/pack-facts.ts CHANGED
@@ -10,6 +10,7 @@
10
10
 
11
11
  import { readFileSync } from 'node:fs';
12
12
  import { join } from 'node:path';
13
+ import { fileURLToPath } from 'node:url';
13
14
 
14
15
  export type PackAdoption = { sdks?: string[]; pypi?: string[]; scopes?: string[]; envStems?: string[]; worldIds?: string[] };
15
16
  export type PackFacts = {
@@ -24,9 +25,13 @@ export type PackFacts = {
24
25
  serveExport?: string;
25
26
  };
26
27
 
27
- // world-runtime and control-plane are sibling workspace packages; the artifact is committed,
28
- // so a missing file is a broken checkout (or an unbuilt generator change), never a soft state.
29
- const FACTS_PATH = join(import.meta.dir, '..', '..', 'control-plane', 'generated', 'pack-facts.json');
28
+ // The artifact is committed in the control plane and shipped with it: resolved through the package (@volter/twin,
29
+ // installed or workspace-linked), else the sibling workspace path. A missing file is a broken checkout (or an
30
+ // unbuilt generator change), never a soft state.
31
+ const FACTS_PATH = (() => {
32
+ try { return fileURLToPath(import.meta.resolve('@volter/twin/generated/pack-facts.json')); } catch { /* not resolvable: a checkout without node_modules */ }
33
+ return join(import.meta.dir, '..', '..', 'control-plane', 'generated', 'pack-facts.json');
34
+ })();
30
35
 
31
36
  let cached: Record<string, PackFacts> | null = null;
32
37
  export function packFacts(): Record<string, PackFacts> {