@wildwinter/toolkit 0.2.7 → 0.3.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/extensions.md CHANGED
@@ -23,14 +23,10 @@ read the same one. It is JSON (JSON5 is read too), and is called `<id>.extension
23
23
  name: "Pattershot",
24
24
  version: "1.2.0", // major.minor.patch
25
25
  docs: "https://example.com/pattershot",
26
- settings: [ // project settings, each naming a host field a claim presents
27
- { name: "moodField", label: "Mood field", help: "The card field holding the mood.", default: "mood" },
28
- ],
29
26
  targets: {
30
27
  storylets: { // a host: "patter" or "storylets"
31
28
  card: { // a node kind of that host
32
29
  fields: [ /* field declarations, below */ ],
33
- claims: [ /* claims on host fields, below */ ],
34
30
  },
35
31
  },
36
32
  },
@@ -40,13 +36,13 @@ read the same one. It is JSON (JSON5 is read too), and is called `<id>.extension
40
36
  - **Identity**: `id`, `name`, `version`, and optionally `docs`, a link to the extension's own documentation.
41
37
  - **Targets**, by host and node kind:
42
38
 
43
- | Host | Node kinds | References | Kinds with host fields (claimable) |
44
- |---|---|---|---|
45
- | `patter` | `scene`, `block`, `snippet`, `line`, `text`, `gameEvent`, `option`, `project` | `cast`, `scene`, `block`, `snippet`, `line` | every kind but `project` (game data) |
46
- | `storylets` | `box`, `tagGroup`, `tag`, `deck`, `card`, `outcome`, `handTemplate`, `hand`, `project` | `box`, `deck`, `card`, `outcome`, `tag` | `card`, `outcome` (fields) |
39
+ | Host | Node kinds | References |
40
+ |---|---|---|
41
+ | `patter` | `scene`, `block`, `snippet`, `line`, `text`, `gameEvent`, `option`, `project` | `cast`, `scene`, `block`, `snippet`, `line` |
42
+ | `storylets` | `box`, `tagGroup`, `tag`, `deck`, `card`, `outcome`, `handTemplate`, `hand`, `project` | `box`, `deck`, `card`, `outcome`, `tag` |
47
43
 
48
- - **Fields** per target, in the order the editor shows them.
49
- - **Claims** on host fields, named through a project setting.
44
+ - **Fields** per target, in the order the editor shows them. An extension's data is always its own: it never puts
45
+ its control on a field the host already has. A value the whole project shares is a field on the `project` target.
50
46
 
51
47
  ### Views and reads
52
48
 
@@ -92,22 +88,12 @@ reads: ["patterstage"],
92
88
  - `required`, `min` and `max` (numbers only) are validation.
93
89
  - `editorOnly` is allowed on a target's own fields only, not inside a record.
94
90
 
95
- ### Claims on host fields
91
+ ### Removed keys
96
92
 
97
- A claim presents a field the host already has, with this manifest's control, help and validation, without moving the
98
- data. It names the field through a setting, so a project whose field has another name says so once:
99
-
100
- ```json5
101
- { setting: "moodField", type: "enum", values: ["calm", "tense"], label: "Mood", help: "..." }
102
- ```
103
-
104
- A claim is a scalar. It may leave out an enum's or flags' `values` and a quality's `stages`: the host's
105
- declaration is then the vocabulary, as the host's ladder always is, and the claim adds its label, help and
106
- `valueHelp`, which may describe values the host does not declare (they are simply unused). `effectiveClaim(claim,
107
- hostDecl)` gives the declaration a host draws and checks the field with. The project names the extension's settings when it opts in (each host's project shard says
108
- how); a setting the project leaves out takes the setting's `default`. A claimed field keeps the host's own merge
109
- rule, ladder and renames. Two extensions claiming one field is an error naming both (`claimClashes`); a host
110
- whose field has a type other than the claim's is an error naming where (the host checks: in Storylets, per box).
93
+ Earlier versions of the spec had `settings`, each naming a host field, and `claims` on a target, presenting that
94
+ host field with the manifest's control. Both are gone: a manifest that still carries one is warned of by name
95
+ (`removed-key`) and the key is ignored. Declare a field of the extension's own instead, which the runtimes hand
96
+ the game with every other extension value.
111
97
 
112
98
  ## The types
113
99
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wildwinter/toolkit",
3
- "version": "0.2.7",
3
+ "version": "0.3.0",
4
4
  "description": "Small shared pieces of the authoring tooling: opaque ids, a stable hash, JSON5 source parsing, find/replace matching, the archive guards, and (in ./extensions) the spec and merge for Patter extensions and Storylet extensions. Nothing here runs in a game.",
5
5
  "type": "module",
6
6
  "license": "MIT",