@onceworlds/cli 0.7.0 → 0.8.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 +11 -7
- package/dist/cli.js +608 -253
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -85,15 +85,18 @@ from the running game and commit them under `store/`. `onceworlds doctor` says w
|
|
|
85
85
|
|
|
86
86
|
- `onceworlds new [folder] --kit <name>` starts a game from a kit: a complete game on the engine, one per kind of game
|
|
87
87
|
(`--list` shows them). It writes the kit with an `onceworlds.json` for your game (`--name`, `--slug`, `--description`;
|
|
88
|
-
the folder's name by default)
|
|
89
|
-
small game on the SDK alone.
|
|
88
|
+
the folder's name by default), the engine guide as `AGENTS.md` and `CLAUDE.md`, and the kit's own notes (what each file
|
|
89
|
+
does, what to change, its tests) as `KIT.md`. `--template party` or `starter` starts a small game on the SDK alone.
|
|
90
90
|
- `onceworlds check [dir]` is what to run before a deploy: doctor's findings and, for an engine game, the game's own tests
|
|
91
91
|
(`npm test`) and simulated matches played with no browser, with a reloaded host, a dropped player, the host changing (also while
|
|
92
92
|
paused), a late joiner and garbage messages. A failing test or a match with errors exits with an error. The game's config is
|
|
93
93
|
read from `game.config.js` (or `src/game.config.js`, or `--config <file>`): `export const config = {...}`, and `export const actions`
|
|
94
|
-
lets check compare "How to play" with the action map exactly. Needs `npm install` in the game folder.
|
|
94
|
+
lets check compare "How to play" with the action map exactly. Needs `npm install` in the game folder. Simulated players only ready
|
|
95
|
+
up, so a game with long rounds or turn timers may not reach its results in the time check has: `export const quick = ...` from
|
|
96
|
+
the same file (the game with one short round and short timers) and check plays that. A process that outlives its time limit
|
|
97
|
+
is killed with everything it started.
|
|
95
98
|
- `onceworlds posters [dir]` draws each `game.poster()` scene of your latest draft (`?poster=<name>`) in a browser on this
|
|
96
|
-
computer and saves the pictures into `store
|
|
99
|
+
computer and saves the pictures into `store/` (a poster name is letters, digits, dashes, underscores and dots, as in the engine), naming them in `onceworlds.json` when it has no icon or thumbnails.
|
|
97
100
|
`--only cover,icon` picks some.
|
|
98
101
|
- `onceworlds init [dir]` sets a game folder up, with the files the dashboard's import commits. It writes
|
|
99
102
|
`onceworlds.json` (the link and name come from `package.json`'s name or the folder's; `dir` is your build's
|
|
@@ -103,7 +106,7 @@ from the running game and commit them under `store/`. `onceworlds doctor` says w
|
|
|
103
106
|
overwrites a file you have: `--force` replaces only what init writes, never your own `AGENTS.md` or `CLAUDE.md`.
|
|
104
107
|
Then commit, push, and import the repo at https://onceworlds.com/dashboard/new.
|
|
105
108
|
- `onceworlds deploy [dir]` uploads only the files that changed and publishes the game
|
|
106
|
-
(the workflow runs it). It lists every file it skipped because Onceworlds can't serve it.
|
|
109
|
+
(the workflow runs it). It lists every file it skipped because Onceworlds can't serve it. A game's tests never go up: `*.test.js`, `vitest.config.*` and the `test/` folder at the top of the game.
|
|
107
110
|
- `onceworlds dev [dir]` deploys to a local Onceworlds platform (for platform development)
|
|
108
111
|
and redeploys on every save. `--players 3` also prints links for players 2 and 3 (`?player=N`): on a
|
|
109
112
|
local platform each is another player, so one person can fill a lobby.
|
|
@@ -111,8 +114,9 @@ from the running game and commit them under `store/`. `onceworlds doctor` says w
|
|
|
111
114
|
tag, text fields under 16px (Safari zooms the page when one is focused), `confirm()` and other dialogs
|
|
112
115
|
(blocked in the game frame), localStorage (gone on reload), and, for games with rooms, `Date.now()` for
|
|
113
116
|
shared time and no use of the platform's lobby. For an engine game it also reads the action map
|
|
114
|
-
|
|
115
|
-
|
|
117
|
+
and offers the `controls` it implies: `--fix` writes them into `onceworlds.json` when it has none. For an installed engine
|
|
118
|
+
game the list is the engine's own (`controlsFromActions` on the `actions` that `game.config.js` exports); otherwise it is read
|
|
119
|
+
from the source text (`Input.axis2d`, `Input.button`) and may differ. It only suggests: nothing in it stops a deploy (`--strict` exits with an error on likely bugs, for CI).
|
|
116
120
|
|
|
117
121
|
Games talk to the platform through the injected `window.onceworlds` SDK. The
|
|
118
122
|
starter template's `AGENTS.md` documents it for AI coding tools.
|