@volter/world-runtime 2.0.37 → 2.0.38
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.
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// parent through its own doors (its history cut at an instant, when one is asked), its clock frozen at
|
|
4
4
|
// that instant so no twin's catch-up walks it forward, and removed when its time runs out. world-host
|
|
5
5
|
// and `volter world view` both make them with this; a hosted World's supervisor makes its own.
|
|
6
|
-
import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
|
|
6
|
+
import { cpSync, existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
|
|
7
7
|
import { dirname, join } from 'node:path';
|
|
8
8
|
import { stateDirName, withStateRemoval } from '@volter/world-core';
|
|
9
9
|
import { clockFile } from "./runtime.js";
|
|
@@ -94,6 +94,13 @@ export class LocalBranches {
|
|
|
94
94
|
// the parent's config under the branch's own name: the same twins, served at the branch's place
|
|
95
95
|
mkdirSync(join(root, stateDirName()), { recursive: true });
|
|
96
96
|
writeFileSync(join(root, stateDirName(), 'world.json'), `${JSON.stringify(renamed(JSON.parse(readFileSync(join(from.root, stateDirName(), 'world.json'), 'utf8')), id, name), null, 2)}\n`);
|
|
97
|
+
// and what the config names beside it: the twins' scenarios (handlers/) and the checks a write passes (checks/), as the
|
|
98
|
+
// parent has them now; never its tokens, keys or sessions, which the branch has its own of
|
|
99
|
+
for (const part of ['handlers', 'checks']) {
|
|
100
|
+
const at = join(from.root, stateDirName(), part);
|
|
101
|
+
if (existsSync(at))
|
|
102
|
+
cpSync(at, join(root, stateDirName(), part), { recursive: true });
|
|
103
|
+
}
|
|
97
104
|
let mounted;
|
|
98
105
|
try {
|
|
99
106
|
mounted = await this.o.mount(root);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volter/world-runtime",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.38",
|
|
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",
|
package/src/local-branches.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// parent through its own doors (its history cut at an instant, when one is asked), its clock frozen at
|
|
4
4
|
// that instant so no twin's catch-up walks it forward, and removed when its time runs out. world-host
|
|
5
5
|
// and `volter world view` both make them with this; a hosted World's supervisor makes its own.
|
|
6
|
-
import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
|
|
6
|
+
import { cpSync, existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
|
|
7
7
|
import { dirname, join } from 'node:path';
|
|
8
8
|
import { stateDirName, withStateRemoval } from '@volter/world-core';
|
|
9
9
|
import { clockFile } from './runtime.ts';
|
|
@@ -96,6 +96,12 @@ export class LocalBranches {
|
|
|
96
96
|
// the parent's config under the branch's own name: the same twins, served at the branch's place
|
|
97
97
|
mkdirSync(join(root, stateDirName()), { recursive: true });
|
|
98
98
|
writeFileSync(join(root, stateDirName(), 'world.json'), `${JSON.stringify(renamed(JSON.parse(readFileSync(join(from.root, stateDirName(), 'world.json'), 'utf8')) as Record<string, unknown>, id, name), null, 2)}\n`);
|
|
99
|
+
// and what the config names beside it: the twins' scenarios (handlers/) and the checks a write passes (checks/), as the
|
|
100
|
+
// parent has them now; never its tokens, keys or sessions, which the branch has its own of
|
|
101
|
+
for (const part of ['handlers', 'checks']) {
|
|
102
|
+
const at = join(from.root, stateDirName(), part);
|
|
103
|
+
if (existsSync(at)) cpSync(at, join(root, stateDirName(), part), { recursive: true });
|
|
104
|
+
}
|
|
99
105
|
let mounted: MountedWorld | undefined;
|
|
100
106
|
try {
|
|
101
107
|
mounted = await this.o.mount(root);
|