@neocompose/cli 0.27.1 → 0.29.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 +46 -0
- package/dist/neo.mjs +1291 -165
- package/package.json +1 -1
- package/skills/neocompose-cli/SKILL.md +1 -1
- package/skills/neocompose-cli/references/animation-and-world-authoring.md +13 -11
- package/skills/neocompose-cli/references/cli-development.md +1 -1
- package/skills/neocompose-cli/references/declarations-and-construction.md +35 -0
- package/skills/neocompose-cli/references/values-identities-and-references.md +9 -2
package/package.json
CHANGED
|
@@ -109,12 +109,14 @@ override replaces the whole leaf.
|
|
|
109
109
|
Frame overrides may change `Enabled`, `FlipX`, and `SortingOrder`; they may
|
|
110
110
|
not add, remove, or reorder `Children`.
|
|
111
111
|
|
|
112
|
-
Address direct children through selector delegates.
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
112
|
+
Address direct children through selector delegates. Prefer the project's own
|
|
113
|
+
stable identity contract, such as an immutable `Name`, slug, or semantic
|
|
114
|
+
position. When a selector means one specific authored child slot whose
|
|
115
|
+
placement clones carry `sourceValueId`, return
|
|
116
|
+
`Reference<T>(id: "<authored-child-id>", withProvenance: true)`. The flag is
|
|
117
|
+
opt-in and defaults to `false`; without it the ID is matched exactly. Missing
|
|
118
|
+
optional child slots are skipped with diagnostics when the authored slot is
|
|
119
|
+
absent, while stale pre-provenance placements may still fail closed.
|
|
118
120
|
|
|
119
121
|
A placement row carries its `assetClassId` binding and optional `assetValueId`
|
|
120
122
|
override beside its schema keys. They are row provenance, not declared schema:
|
|
@@ -176,11 +178,11 @@ class LegPart : NeoObject {
|
|
|
176
178
|
```
|
|
177
179
|
|
|
178
180
|
Selectors may also be compatible inline closures. Prefer a named function when
|
|
179
|
-
the identity rule is reused or deserves an explicit failure message.
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
pulled rows.
|
|
181
|
+
the identity rule is reused or deserves an explicit failure message. An exact
|
|
182
|
+
`Reference<T>(id: "...")` recreates the row-ID coupling selectors were
|
|
183
|
+
introduced to remove; use `withProvenance: true` only for a deliberately
|
|
184
|
+
authored slot identity. For new track rows, omit `@id` and let the successful
|
|
185
|
+
push assign it. Preserve IDs already present on pulled rows.
|
|
184
186
|
|
|
185
187
|
A selector argument such as `this.SelectPants` is evaluated in the lexical
|
|
186
188
|
scope of the class that declares the clip. Here `this` is the `LegPart`, not
|
|
@@ -83,7 +83,7 @@ wrappers.
|
|
|
83
83
|
The marker near the top of `SKILL.md` must exactly match the package version:
|
|
84
84
|
|
|
85
85
|
```html
|
|
86
|
-
<!-- reviewed-through-cli: 0.
|
|
86
|
+
<!-- reviewed-through-cli: 0.29.0 -->
|
|
87
87
|
```
|
|
88
88
|
|
|
89
89
|
The quoted version above is checked too, so this instruction cannot go stale
|
|
@@ -152,6 +152,41 @@ them from member initializers. Each declared constructor must settle every
|
|
|
152
152
|
required member on its own; a call-site block cannot repair an invalid
|
|
153
153
|
constructor declaration.
|
|
154
154
|
|
|
155
|
+
## Parameter default values
|
|
156
|
+
|
|
157
|
+
Default a parameter with `= <constant>` on class headers, declared
|
|
158
|
+
constructors, native functions, NSFunctions, and interface functions:
|
|
159
|
+
|
|
160
|
+
```neo
|
|
161
|
+
class Foo(string bar = "BAR", int volume = 3) {
|
|
162
|
+
public string Bar = bar;
|
|
163
|
+
|
|
164
|
+
public string Shout(string text = "hey", bool loud = true) {
|
|
165
|
+
return loud ? text.ToUpper() : text;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
Foo a = new(); // fully defaulted header: all defaults apply
|
|
170
|
+
Foo b = new(bar: "bar"); // volume fills from its default
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
Use only constants: bool, int, float, and decimal literals (optional leading
|
|
174
|
+
`-`), string literals without interpolation, leading-dot enum options
|
|
175
|
+
(`.North`), and `null` on a nullable parameter. Place every defaulted
|
|
176
|
+
parameter after every non-defaulted one. `Type? name` stays nullable-and-
|
|
177
|
+
mandatory unless it also declares a default — nullability and defaultedness
|
|
178
|
+
are independent.
|
|
179
|
+
|
|
180
|
+
Omit defaulted arguments at call sites: function calls bind positionally and
|
|
181
|
+
drop only a trailing suffix; constructor calls name a subset that covers
|
|
182
|
+
every non-defaulted parameter. When several overloads match, the one filling
|
|
183
|
+
in the fewest defaults wins, and a residual tie is a declaration-time error.
|
|
184
|
+
Implementations of an interface function restate its defaults exactly.
|
|
185
|
+
|
|
186
|
+
Do not default parameters of deferred functions, delegates, actions,
|
|
187
|
+
closures, or overrides. Enum defaults store the option id, so renaming the
|
|
188
|
+
option changes the emitted `.Option` spelling without a record change.
|
|
189
|
+
|
|
155
190
|
## Required constructors and settlement
|
|
156
191
|
|
|
157
192
|
Put one required constructor on the class header when the entire class body
|
|
@@ -83,6 +83,7 @@ supports:
|
|
|
83
83
|
Reference(Assets.Capitol)
|
|
84
84
|
Reference(root.Assets.Cosmetics.Pants)
|
|
85
85
|
Reference<Outpost>(id: "capitol-value-id")
|
|
86
|
+
Reference<NeoSpriteObject>(id: "authored-child-id", withProvenance: true)
|
|
86
87
|
Reference<PantsAsset>(key: "pants.long")
|
|
87
88
|
Reference<PantsAsset>(key: "pants.long", index: Slug)
|
|
88
89
|
Reference<Dialogue>(id: "capitol-dialogue-id")
|
|
@@ -95,14 +96,20 @@ Reference<Dialogue>(id: "capitol-dialogue-id")
|
|
|
95
96
|
- Use the generic `id:` form when the ID is the only target information. A
|
|
96
97
|
`Reference` call whose argument is neither `id:` nor `key:` is rejected by
|
|
97
98
|
name rather than read as an ID.
|
|
99
|
+
- Inside executable NeoScript, add `withProvenance: true` when the ID names an
|
|
100
|
+
authored row and the reference must select its nearest `sourceValueId` clone
|
|
101
|
+
in the lexical receiver's ownership graph. The parameter defaults to `false`;
|
|
102
|
+
absent or explicit `false` keeps exact-ID behavior. This option is not a
|
|
103
|
+
persisted member-default form.
|
|
98
104
|
- Both forms are legal in a member's declaration default, not only inside a
|
|
99
105
|
value graph. A key written there resolves after every pass has run, so it may
|
|
100
106
|
name a row the same push creates.
|
|
101
107
|
- Keep genuine structural references ID-based when their collection has no
|
|
102
108
|
stable symbol, path, or key surface. Animation track and frame-override
|
|
103
109
|
targets are selectors, not structural references: encode a stable
|
|
104
|
-
project-owned identity such as `Name` or slug
|
|
105
|
-
|
|
110
|
+
project-owned identity such as `Name` or slug. The exception is an authored
|
|
111
|
+
child slot whose placement clones retain `sourceValueId`: select that slot
|
|
112
|
+
with `Reference<T>(id: "...", withProvenance: true)`.
|
|
106
113
|
|
|
107
114
|
Declaration and file order do not affect resolution within one push. Cyclic
|
|
108
115
|
identity references are legal because they resolve IDs rather than evaluate a
|