@wildwinter/toolkit 0.2.6 → 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/CHANGELOG.md +16 -0
- package/conformance/extensions/defaults.json +1 -1
- package/conformance/extensions/manifest.json +121 -172
- package/conformance/extensions/values.json +0 -86
- package/dist/extensions.cjs +28 -134
- package/dist/extensions.cjs.map +1 -1
- package/dist/extensions.d.cts +2 -48
- package/dist/extensions.d.ts +2 -48
- package/dist/extensions.js +29 -131
- package/dist/extensions.js.map +1 -1
- package/extensions.md +15 -27
- package/package.json +1 -1
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 |
|
|
44
|
-
|
|
45
|
-
| `patter` | `scene`, `block`, `snippet`, `line`, `text`, `gameEvent`, `option`, `project` | `cast`, `scene`, `block`, `snippet`, `line` |
|
|
46
|
-
| `storylets` | `box`, `tagGroup`, `tag`, `deck`, `card`, `outcome`, `handTemplate`, `hand`, `project` | `box`, `deck`, `card`, `outcome`, `tag` |
|
|
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
|
-
|
|
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
|
|
|
@@ -87,27 +83,17 @@ reads: ["patterstage"],
|
|
|
87
83
|
}
|
|
88
84
|
```
|
|
89
85
|
|
|
90
|
-
- `label`, `help`, `valueHelp` (one sentence per enum or flags value
|
|
91
|
-
editor, and never reach a bundle.
|
|
86
|
+
- `label`, `help`, `valueHelp` (one sentence per enum or flags value, quality stage, or a pick's fixed word) and
|
|
87
|
+
`group` are for the editor, and never reach a bundle.
|
|
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
|
-
###
|
|
91
|
+
### Removed keys
|
|
96
92
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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
|
|
|
@@ -152,6 +138,8 @@ A pick is a single choice whose choices come from sources the manifest names, in
|
|
|
152
138
|
Empty is automatic: no word for it is stored, and an editor shows it as "auto". A pick isn't an `enum` whose values
|
|
153
139
|
change: an enum's values are fixed and checked against the manifest, a pick's are the project's.
|
|
154
140
|
|
|
141
|
+
`valueHelp` may describe a pick's fixed `words`, never its nodes or lists, which are the project's.
|
|
142
|
+
|
|
155
143
|
`valueProblems` reports a value no source holds (`not-a-choice`, an error), given the host's nodes (`exists`) and
|
|
156
144
|
lists (`list`) in its context; a source it can't see is not checked, so a value is reported missing only when every
|
|
157
145
|
source can say. A value two sources hold is ambiguous (`pick-ambiguous`, a warning), and `pickClashes` reports each
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wildwinter/toolkit",
|
|
3
|
-
"version": "0.
|
|
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",
|