@patterkit/cli 0.3.8 → 0.4.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 +26 -4
  2. package/dist/cli.js +2260 -1483
  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
  |--------|--------|---------|
@@ -145,7 +161,11 @@ patter report --json | jq '.totals'
145
161
 
146
162
  Pack a project (the `.patter` folder) into a single portable **`.patterpack`** - a
147
163
  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.
164
+ (you cannot email a folder; this is the zip of it). `-o` is required. When the
165
+ project has a game scopes folder (`game-scopes/`, found as every command finds it),
166
+ the pack also carries a read-only snapshot of every `*.scopes.json` in it, as
167
+ `game-scopes/<name>` entries listed in the manifest's `gameScopes`. A project with
168
+ no folder packs to exactly the same bytes as before.
149
169
 
150
170
  ```sh
151
171
  patter pack my-game.patter -o my-game.patterpack
@@ -155,11 +175,13 @@ patter pack my-game.patter -o my-game.patterpack
155
175
 
156
176
  Explode a `.patterpack` back into source shards under `<dir>`. Both the input
157
177
  file and `-o <dir>` are required. Entry paths that would escape the target
158
- directory are rejected.
178
+ directory are rejected. A pack's game scopes snapshot is written to
179
+ `<dir>/game-scopes/`, where the unpacked project finds it first, so `validate`,
180
+ `play`, and `coverage` there know the other tools' scopes.
159
181
 
160
182
  | Option | Meaning |
161
183
  |--------|---------|
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. |
184
+ | `--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
185
 
164
186
  ```sh
165
187
  patter unpack returned.patterpack -o ./my-game.patter --merge --base sent.patterpack