@volter/world 2.0.0
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/README.md +27 -0
- package/dist/src/cli.d.ts +2 -0
- package/dist/src/cli.js +669 -0
- package/dist/src/credentials.d.ts +12 -0
- package/dist/src/credentials.js +64 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.js +6 -0
- package/dist/src/locate.d.ts +18 -0
- package/dist/src/locate.js +60 -0
- package/dist/src/serve-shutdown.d.ts +6 -0
- package/dist/src/serve-shutdown.js +27 -0
- package/dist/src/world.d.ts +299 -0
- package/dist/src/world.js +491 -0
- package/package.json +37 -0
- package/src/cli.ts +486 -0
- package/src/credentials.ts +56 -0
- package/src/handlers-in-repo.test.ts +45 -0
- package/src/index.ts +6 -0
- package/src/journeys/kit.ts +12 -0
- package/src/journeys/tutorial-runner.test.ts +180 -0
- package/src/journeys/tutorial.ts +345 -0
- package/src/journeys/tutorials.test.ts +39 -0
- package/src/locate.ts +61 -0
- package/src/sdk.test.ts +92 -0
- package/src/serve-shutdown.test.ts +40 -0
- package/src/serve-shutdown.ts +26 -0
- package/src/world.ts +448 -0
package/README.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# @volter/world
|
|
2
|
+
|
|
3
|
+
Run your app against a world of twins. This package is the `volter` command and the SDK behind
|
|
4
|
+
it: `World` and `TwinLog`, one method per verb.
|
|
5
|
+
|
|
6
|
+
```bash
|
|
7
|
+
bun add -d @volter/world @volter/twin-stripe
|
|
8
|
+
volter world init # reads the app, writes .volter/world.json beside the code
|
|
9
|
+
volter world up # starts the twins, loads their default data
|
|
10
|
+
volter world run -- npm test
|
|
11
|
+
volter world log # every write the app made
|
|
12
|
+
volter world down
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { World } from '@volter/world';
|
|
17
|
+
|
|
18
|
+
const world = World.open(); // the world of the cwd, on its checked-out branch
|
|
19
|
+
await world.up();
|
|
20
|
+
world.run(['npm', 'test']);
|
|
21
|
+
console.log(world.log());
|
|
22
|
+
await world.down();
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
- [Getting started](https://github.com/volter-ai/twin/blob/main/docs/getting-started.md)
|
|
26
|
+
- [CLI reference](https://github.com/volter-ai/twin/blob/main/docs/reference/cli.md)
|
|
27
|
+
- [SDK reference](https://github.com/volter-ai/twin/blob/main/docs/reference/sdk.md)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
export declare const HELP = "volter \u2014 run your app against a world of twins\n\nworld \u2014 the twins your app needs, running together (the world of the current directory)\n volter world init [--name <world>] [--allow-unknown] detect the app's vendors, write .volter/world.json\n volter world up [--sandbox] [--no-seed] start the twins on this branch (loads the default data the first time)\n volter world run [--verbose] -- <command...> run the app or its tests inside the world\n volter world activate eval \"$(volter world activate)\": vendor CLIs and curl in this shell reach the twins\n volter world shell a subshell with the world active\n volter world init --bare <org>/<world> --twins a,b a world with no app: a shared world for a team, or one standing in for a vendor\n volter world serve [--port <p>] [--console-port <c>] serve this world on a URL under /<org>/<world>/; prints the token and the console (its own origin, port p+1 by default)\n volter world console [<https://host/org/world>] [--port <p>] the console on this machine for a World served elsewhere (default: this world's origin); needs @volter/world-console\n volter world status world, branch, origin, unpushed changes, what is running\n volter world log [--receipts] [--json] every write the app made; --receipts adds each change's receipt\n volter world diff [--json] what changed since the default data (or the last mark)\n volter world seed load the default data\n volter world reset back to the default data\n volter world down [--purge] stop the twins (--purge forgets this branch's state)\n volter world branch [<name>] list branches, or make one from here and check it out\n volter world checkout <name> switch branches\n volter world replay <changeset> --into <branch> feed a changeset's changes into another branch's twins\n volter world clock show | set <iso> | advance <N s|m|h|d> the world's clock: set, not observed\n volter world clone <url> --token <token> [--admin-token <t>] connect this world to a remote and fetch its history (the admin token copies the whole tree at once)\n volter world fetch what the remote observed since the last fetch\n volter world origin where this world clones from and pushes to\n volter world changeset [<name>] -m \"<message>\" cut the unpushed changes into a reviewable changeset\n volter world pull [--token <token>] fetch, then move this branch onto what came in (git's pull)\n volter world push [<name>] [--token <token>] [--force] push to the remote, which deploys and answers with receipts\n volter world rebase [<changeset>] rebase this branch onto its moved base, or a changeset onto the moved mirror\n volter world verify <changeset> run the world's checks over a changeset and record the result\n volter world approve <changeset> --as <principal> sign a changeset's current hash\n volter world deploy [<changeset>] perform landed changes against each twin's root, by its policy\n\ntwin \u2014 one twin: in this world, or on its own\n volter twin <vendor> the twin's URL, root, deploy policy, whether a credential is sealed\n volter twin <vendor> root <url> [--deploy auto|gated|hold] [--scope <path>] the vendor's real account behind this twin (--none clears it)\n volter twin <vendor> credential seal a credential read from stdin beside the world; never readable back\n volter twin <vendor> refresh observe the root now\n volter twin <vendor> serve [--port <p>] [--read-only] serve the twin; your SDK talks to it at http://127.0.0.1:<p>\n volter twin <vendor> mirror [--port <p>] the twin's UI mirror\n volter twin <vendor> conformance check the twin against the vendor's spec\n\nremote \u2014 the worlds this one pushes to and fetches from, by name\n volter login <platform url> --token <personal token> sign the CLI into the hosted platform (a personal token from the console)\n volter remote add <name> <url|path|org/world> [--token <token>] name a remote; org/world resolves through the platform you logged into\n volter remote remove <name> forget it\n volter remote list every remote, with its URL and whether a token is stored\n (the hosting product's serve answers here for one release: volter remote serve)\n\n --world <dir> the world root, when the cwd is not inside it\n --branch <name> act on that branch instead of the checked-out one\n --json machine-readable output where offered\n";
|