@patterkit/cli 0.3.9 → 0.5.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 +37 -4
  2. package/dist/cli.js +1885 -1342
  3. package/package.json +3 -3
package/README.md CHANGED
@@ -57,6 +57,15 @@ expressions, encoding + line-endings (UTF-8 no-BOM, LF), and **bundle staleness*
57
57
  (any committed `.patterc` whose embedded hash no longer matches source). Exits
58
58
  non-zero if there are any issues. Ideal as a pre-commit hook and in CI.
59
59
 
60
+ Where the game keeps a shared `game-scopes/` folder (found by walking up from the
61
+ project, or named by the project's `gameScopes`), it also checks the names and
62
+ types the project uses from other tools' scopes against their files, and reports
63
+ the folder (`[game-scopes]`): a file that won't parse or a scope two files claim is
64
+ an issue; another tool's undeclared name, a type mismatch, a write to a read-only
65
+ property, `patter.scopes.json` out of date, or the project's copy of a game scope
66
+ differing from `game.scopes.json` is a **warning**, printed as one, which never
67
+ fails the run.
68
+
60
69
  ```sh
61
70
  patter validate
62
71
  patter validate my-game
@@ -93,11 +102,18 @@ patter export -o build/game.patterc
93
102
  patter export -o - | gzip > game.patterc.gz
94
103
  ```
95
104
 
105
+ Where the game keeps a shared `game-scopes/` folder, `export` also writes
106
+ `game-scopes/patter.scopes.json` (the project's shared `@patter` properties), and
107
+ only when its content would change. Not with `-o -`.
108
+
96
109
  ### `patter play [path]`
97
110
 
98
111
  Play a project through the reference runtime and print a transcript - lines,
99
112
  text, game events, and choices. Exits non-zero if the playthrough cannot finish
100
- (a stall / max-steps), which makes it usable as a smoke test.
113
+ (a stall / max-steps), which makes it usable as a smoke test. A line naming another
114
+ engine's scope (`@story.act`) plays where the game's `game-scopes/` folder declares
115
+ it, standing that engine in from its declared defaults; without the folder it is
116
+ refused, since Patter is playing alone. `patter coverage` does the same.
101
117
 
102
118
  | Option | Values | Meaning |
103
119
  |--------|--------|---------|
@@ -141,11 +157,26 @@ patter stats --xlsx report.xlsx
141
157
  patter report --json | jq '.totals'
142
158
  ```
143
159
 
160
+ ### `patter share-scopes [path] [--at <dir>]`
161
+
162
+ Share the project's scopes with the game's other editing tools, as Patterpad's **File > Share Scopes
163
+ with Other Tools** does: makes the game's `game-scopes/` folder (in `--at`, else at the
164
+ version-control root above the project, else beside it) with `patter.scopes.json` and a
165
+ `game.scopes.json` holding the project's own game scopes (its World properties), which the project
166
+ keeps as its synced copy. A folder another tool already made is joined, not replaced: its
167
+ `game.scopes.json` keeps every scope it holds and gains only the ones it lacks. When looking up from
168
+ the project wouldn't find the folder, the project names it in `gameScopes`. A project that already
169
+ shares its scopes is refused.
170
+
144
171
  ### `patter pack [path] -o <file.patterpack>`
145
172
 
146
173
  Pack a project (the `.patter` folder) into a single portable **`.patterpack`** - a
147
174
  binary zip envelope, the send-and-return artifact for collaborators without VCS
148
- (you cannot email a folder; this is the zip of it). `-o` is required.
175
+ (you cannot email a folder; this is the zip of it). `-o` is required. When the
176
+ project has a game scopes folder (`game-scopes/`, found as every command finds it),
177
+ the pack also carries a read-only snapshot of every `*.scopes.json` in it, as
178
+ `game-scopes/<name>` entries listed in the manifest's `gameScopes`. A project with
179
+ no folder packs to exactly the same bytes as before.
149
180
 
150
181
  ```sh
151
182
  patter pack my-game.patter -o my-game.patterpack
@@ -155,11 +186,13 @@ patter pack my-game.patter -o my-game.patterpack
155
186
 
156
187
  Explode a `.patterpack` back into source shards under `<dir>`. Both the input
157
188
  file and `-o <dir>` are required. Entry paths that would escape the target
158
- directory are rejected.
189
+ directory are rejected. A pack's game scopes snapshot is written to
190
+ `<dir>/game-scopes/`, where the unpacked project finds it first, so `validate`,
191
+ `play`, and `coverage` there know the other tools' scopes.
159
192
 
160
193
  | Option | Meaning |
161
194
  |--------|---------|
162
- | `--merge --base <sent.patterpack>` | Instead of extracting, **fold a returned document's edits back into the existing project** at `<dir>` via the 3-way merge engine. `--base` is the `.patterpack` you originally packed and sent (the common ancestor). Per shard: a clean merge updates the file, a conflict writes a `.patterconflict` sidecar; a file only in the returned document is added. Exits non-zero if any shard conflicts. |
195
+ | `--merge --base <sent.patterpack>` | Instead of extracting, **fold a returned document's edits back into the existing project** at `<dir>` via the 3-way merge engine. `--base` is the `.patterpack` you originally packed and sent (the common ancestor). Per shard: a clean merge updates the file, a conflict writes a `.patterconflict` sidecar; a file only in the returned document is added. Exits non-zero if any shard conflicts. The returned pack's game scopes snapshot is never written. When the project has a game scopes folder and the returned project file's copy of the game's scopes (World properties) differs from the base pack's, the scopes they changed are written to `game.scopes.json` (the rest of the file is kept) and a `game scopes:` line says so. |
163
196
 
164
197
  ```sh
165
198
  patter unpack returned.patterpack -o ./my-game.patter --merge --base sent.patterpack