@neocompose/cli 0.89.8 → 0.89.10
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 +19 -0
- package/dist/neo-runtime.mjs +1713 -483
- package/dist/test-worker.mjs +263 -44
- package/package.json +1 -1
- package/skills/neocompose-cli/SKILL.md +1 -1
- package/skills/neocompose-cli/references/cli-development.md +1 -1
- package/skills/neocompose-cli/references/declarations/constructors.md +20 -0
- package/skills/neocompose-cli/references/declarations/declarations.md +3 -0
- package/skills/neocompose-cli/references/neoscript/collections.md +2 -0
- package/skills/neocompose-cli/references/neoscript/delegates-and-listeners.md +2 -0
- package/skills/neocompose-cli/references/values/identities.md +9 -8
- package/skills/neocompose-cli/references/world/variants.md +28 -2
|
@@ -70,7 +70,6 @@ stored instance rather than building a copy. Its owning placement keeps it,
|
|
|
70
70
|
so a constructor that stores it needs a `Reference` field:
|
|
71
71
|
|
|
72
72
|
```neo
|
|
73
|
-
@id("86ac7c7d-8d3b-4642-9def-cdf32643bdc5")
|
|
74
73
|
DeliveryQuest HARD_AS_STONE = new();
|
|
75
74
|
// The core quest list owns HARD_AS_STONE.
|
|
76
75
|
WorkflowStep UNLOCK = new QuestUnlockStep(HARD_AS_STONE);
|
|
@@ -82,13 +81,15 @@ class QuestUnlockStep(DeliveryQuest quest) : WorkflowStep {
|
|
|
82
81
|
|
|
83
82
|
- The local needs exactly one owning placement. Unowned locals, ambiguous
|
|
84
83
|
placements, and cycles are source errors.
|
|
85
|
-
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
84
|
+
- New nested locals can be referenced before their first push or export, including
|
|
85
|
+
inside lists, dictionaries, and constructor-backed owners. Preparation resolves
|
|
86
|
+
each reference to the row its unique owner creates. Aliases share that identity.
|
|
87
|
+
Sibling constructor arguments and explicit `Reference(LOCAL)` calls reuse the
|
|
88
|
+
child within the same owning tree. A parent constructor may borrow a child
|
|
89
|
+
that one of its field overrides owns; pull preserves both uses.
|
|
90
|
+
Direct `Reference(LOCAL)` fields resolve after the owning constructor runs.
|
|
91
|
+
- Push writes assigned IDs back to source. Dry-run and export prepare the same
|
|
92
|
+
references without requiring hand-written IDs or an earlier push.
|
|
92
93
|
- A member default is a construction template, so its local is not a single
|
|
93
94
|
stored instance.
|
|
94
95
|
- Owned locals inside evaluated initializers need directly addressable fields,
|
|
@@ -25,6 +25,29 @@ NeoVariant<ExampleObject> Down = new(
|
|
|
25
25
|
written `new { ... }` or `new Partial<T> { ... }`. They never pass
|
|
26
26
|
constructor arguments, even when `T` has a required constructor.
|
|
27
27
|
|
|
28
|
+
A child override's explicit `NeoAnimationChildOverride<TChild>` argument
|
|
29
|
+
selects the child type and its `Partial<TChild>` payload. The child type may
|
|
30
|
+
extend `NeoObjectBase`; it does not have to equal the list's base type.
|
|
31
|
+
Returning a local variable from the selector preserves that explicit type.
|
|
32
|
+
The selector takes no parameters. Its `this` is the variant target instance,
|
|
33
|
+
so `() => this.SelectFirstSprite()` and `this.SelectFirstSprite` both work
|
|
34
|
+
when that method takes no arguments and returns `TChild`. A search through
|
|
35
|
+
`Children` returns an optional `NeoObjectBase`; narrow it to `TChild` and
|
|
36
|
+
handle the missing-child case before returning it.
|
|
37
|
+
|
|
38
|
+
```neo
|
|
39
|
+
new NeoAnimationChildOverride<AnimationSpriteObject>(() => {
|
|
40
|
+
if (this.Children.FirstOrDefault((child) => child.Name == "Sprite")
|
|
41
|
+
is not AnimationSpriteObject sprite) {
|
|
42
|
+
throw new NeoError("Expected a sprite child");
|
|
43
|
+
}
|
|
44
|
+
return sprite;
|
|
45
|
+
}, new Partial<AnimationSpriteObject> { Sprite = Images.OreVeins.Slice(1) })
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
VSCode and `neo status` validate selector bodies and constructor delegate
|
|
49
|
+
arguments, including names, parameter counts, return paths, and return types.
|
|
50
|
+
|
|
28
51
|
A nested class partial changes only named members. A list override replaces
|
|
29
52
|
the whole list; it does not patch entries by index. In particular, overriding
|
|
30
53
|
a clip's `Frames` requires the complete desired list, not just the changed
|
|
@@ -44,6 +67,8 @@ frame. For editing an existing clip, see [frame overrides](animation.md).
|
|
|
44
67
|
- Selections compare equal when class, variant, and bound lookup row match.
|
|
45
68
|
An unset optional selection differs from `Base`.
|
|
46
69
|
|
|
70
|
+
Variant selections can also be [constructor parameters](../declarations/constructors.md#variant-parameters). A constructor can retain a named, base, or bound lookup selection in a member initializer.
|
|
71
|
+
|
|
47
72
|
## Folders
|
|
48
73
|
|
|
49
74
|
```neo
|
|
@@ -112,8 +137,9 @@ NeoLookupVariant<ExampleObject, NeoSortingLayer> Layered = new(
|
|
|
112
137
|
## Type restrictions
|
|
113
138
|
|
|
114
139
|
`NeoVariantFolder` and `NeoLookupVariantFolder` are top-level records, never
|
|
115
|
-
member or parameter types. Variant handles are valid as Variant members
|
|
116
|
-
not as collection entries, lookup targets,
|
|
140
|
+
member or parameter types. Variant handles are valid as Variant members and
|
|
141
|
+
constructor parameters, not as collection entries, lookup targets, ordinary
|
|
142
|
+
function parameters, or generic bindings.
|
|
117
143
|
|
|
118
144
|
## Stored overrides
|
|
119
145
|
|