@onceworlds/cli 0.6.0 → 0.7.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.
Files changed (3) hide show
  1. package/README.md +19 -2
  2. package/dist/cli.js +1187 -491
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -60,6 +60,10 @@ with the link) or Public (also listed on Onceworlds).
60
60
  }
61
61
  ```
62
62
 
63
+ `engine` (`"1"`, `"1.2"` or an exact `"1.2.3"`) makes a game run on the engine the platform hosts: it adds an import map
64
+ so `import { createGame } from '@onceworlds/engine'` works in a page with no build step. `"1"` is the newest 1.x, which gets
65
+ fixes without a redeploy; an exact version never changes. A deploy fails, saying what is available, for a version that doesn't exist.
66
+
63
67
  `dir` is the folder to publish (for example `dist` after a build); it must contain
64
68
  `index.html`. `productionBranch` (default `main`) picks the branch that goes live;
65
69
  the dashboard can change it too, and the file wins again only when this value changes.
@@ -79,6 +83,18 @@ from the running game and commit them under `store/`. `onceworlds doctor` says w
79
83
 
80
84
  ## Commands
81
85
 
86
+ - `onceworlds new [folder] --kit <name>` starts a game from a kit: a complete game on the engine, one per kind of game
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) and the engine guide as `AGENTS.md` and `CLAUDE.md`. `--template party` or `starter` starts a
89
+ small game on the SDK alone.
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
+ (`npm test`) and simulated matches played with no browser, with a reloaded host, a dropped player, the host changing (also while
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
+ 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.
95
+ - `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/`, naming them in `onceworlds.json` when it has no icon or thumbnails.
97
+ `--only cover,icon` picks some.
82
98
  - `onceworlds init [dir]` sets a game folder up, with the files the dashboard's import commits. It writes
83
99
  `onceworlds.json` (the link and name come from `package.json`'s name or the folder's; `dir` is your build's
84
100
  output folder when `package.json` has a build script, else `.` or the folder with your `index.html`),
@@ -94,8 +110,9 @@ from the running game and commit them under `store/`. `onceworlds doctor` says w
94
110
  - `onceworlds doctor [dir]` looks through the game's files for what games often ship with: no viewport
95
111
  tag, text fields under 16px (Safari zooms the page when one is focused), `confirm()` and other dialogs
96
112
  (blocked in the game frame), localStorage (gone on reload), and, for games with rooms, `Date.now()` for
97
- shared time and no use of the platform's lobby. It only suggests: nothing in it stops a deploy
98
- (`--strict` exits with an error on likely bugs, for CI).
113
+ shared time and no use of the platform's lobby. For an engine game it also reads the action map
114
+ (`Input.axis2d`, `Input.button`) and offers the `controls` it implies: `--fix` writes them into `onceworlds.json` when it has
115
+ none. It only suggests: nothing in it stops a deploy (`--strict` exits with an error on likely bugs, for CI).
99
116
 
100
117
  Games talk to the platform through the injected `window.onceworlds` SDK. The
101
118
  starter template's `AGENTS.md` documents it for AI coding tools.