@neocompose/cli 0.77.0 → 0.78.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 CHANGED
@@ -1,5 +1,55 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.78.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 79bedea: Add `Set<T>` members: an insertion-ordered collection of unique values or class rows, with Set-typed queries and `ToSet()`. `Set<Enum>`, `Set<Reference<T>>`, and `Set<NeoDialogueReference>` are the multi-select spellings. `selection:` is now an error, and the language server offers a quick fix that rewrites the type to `Set<…>`. Unity projects need SDK 0.68.0.
8
+
9
+ `Reference<NeoAudioClip>(id: "…")`, which pull writes for an audio file no registry symbol names, now compiles and pushes as that file.
10
+
11
+ ### Patch Changes
12
+
13
+ - 1b6ec78: Accept nested Unity texture override paths so per-file platform and sprite settings retain template inheritance when saved from the web editor.
14
+
15
+ ## 0.77.1
16
+
17
+ ### Patch Changes
18
+
19
+ - 41b60cd: A generic class without a declared constructor can now be constructed with its type arguments, as in `new Box<int>()`, `new Box<int>(4)`, `new Box<string> { Item = "a" }`, or `Box<int> box = new();`, including in a static field such as `public static Box<int> Value = new() { Item = 6 };`. Before, each failed with "Cannot construct open generic Class 'Box'; construct a closed named descendant." A `T` field is required unless the type argument is nullable, so `new Box<int?>()` may omit it. `new Box()` with no type arguments is now rejected at compile time rather than at runtime. Stored constructions accept `List`, `Dictionary`, and enum type arguments, such as `new Box<List<int>> { Item = [4] }`; preparation used to reject them with "must be list, not List".
20
+
21
+ A generic class can construct with its own parameter: in a method, as in `return new Box<T>();`, and in a field initializer, as in `public Bag<T> B = new Bag<T>();`, `new()`, or `new SubBag<T>()`. Before, methods failed with "Construction type argument … has no matching type descriptor in the document." and initializers with "Unknown type 'T'". A type argument that wraps the parameter, such as `new Bag<List<T>>()`, is rejected at compile time with "type argument 'List<T>' wraps a type parameter". A subclass that forwards its parameter, such as `class Sub<U> : Box<U>`, reads its inherited `T` fields. A field initializer that fills an open slot, such as `public Bag<T> C = new Bag<T> { N = 3 };`, `[new Bag<T>()]`, or `{"a": new Bag<T>()}`, now runs per instance. Before, push and export failed with "Cannot create a value of open generic class".
22
+
23
+ Unity needs SDK 0.67.1 to run the constructions above.
24
+
25
+ A static `List<Base>` can hold an implicitly constructed generic entry such as `[new Box<int> { Item = 6 }]`; preparation used to reject it with "Class Box type argument T must be concrete, not int." NeoScript bodies now check `extends` constraints on type arguments, so `new Box<int>()` with `class Box<T extends Thing>` reports "Type argument 'int' does not satisfy 'T extends Thing' on 'Box'." as declarations already did.
26
+
27
+ User classes (`@storage(allowed: .User)`) now get the P104 checks in `neo status`, `neo test`, and push: their members, method bodies, and field initializers can name only User classes, enums, builtins, and User-safe interfaces. Before, the CLI skipped these checks.
28
+
29
+ - 6d5c243: A `NeoDelegate` can now be a generic type argument. This works stored, as in `public static Box<NeoDelegate<int>> Value = new(() => 1);` or `new Box<NeoDelegate<int, int>> { Item = (x) => x + 1 }`. It also works at runtime, including through a forwarded parameter such as `new Wrap<NeoDelegate<int>>().Make(() => 5)`. Before, preparation failed with "substituteMember: generic binding kind 25 cannot appear in a NeoScript callable type." Runtime construction failed with "Construction type argument … has no matching type descriptor in the document." Delegate type arguments with different signatures, such as `NeoDelegate<int>` and `NeoDelegate<string>`, are no longer treated as the same type. Unity needs SDK 0.67.1 for the runtime cases.
30
+
31
+ `NeoAction` as a type argument, such as `Wrap<NeoAction<int>>` or `List<NeoAction>`, is now reported at its declaration, since an action is never a value. Only a callable's parameter slots, such as `NeoDelegate<void, NeoAction<int>>`, may name one.
32
+
33
+ A method parameter named `value`, such as `public int Make(int value)`, no longer fails preparation with "NSFunction … argumentTypes are invalid." #1185 allowed the name, but push validation still rejected it.
34
+
35
+ The construction descriptor error now names the generic parameter and its kind, such as `"T" (Sprite)`. The callable-type error names the kind, such as `Sprite`, instead of a number. Unity's descriptor error names the parameter and its kind with SDK 0.67.2.
36
+
37
+ - ac5bafa: Field defaults can capture header constructor parameters. `class Holder(int n) { public NeoDelegate<int> Value = () => n; }` builds the closure for each new instance, including inside collections (`[() => n + 1]`), object initializers (`new Bar { Cb = () => n, X = n + 1 }`), and with generic parameter types. A capturing lambda still reads `this`, as in `() => n + this.M`. A List or Dictionary entry that reads a header parameter, such as `[n + 1, 0]`, no longer fails validation with "NeoScript getter expected 1 argument(s), got 0." A static field that constructs its own header class, such as `public static Holder Shared = new Holder(n: 9);`, now prepares and pushes. A closure that an object initializer assigns over a declared constructor's default, such as `new Pair(k: 1) { Cb = () => 2 }`, can now be called. Before, the call failed with "Stored NeoDelegate closure has no resolvable value row." A nullable delegate default such as `public NeoDelegate<int>? Cb = () => 7;` can now be called after a plain `new Bar()`; it failed with the same error. A derived class's `override NeoDelegate<int> Cb = () => 10;` now compiles its closure; calling it failed with "NeoDelegate closure has source code but no compiled action."
38
+ - 1ba032c: Delegate field defaults accept method groups. `public NeoDelegate<int> Value = Read;` and `= this.Read;` bind each new instance, and static functions can be named qualified (`Holder.Read`, `Other.Read`) or unqualified. A qualified static no longer crashes status and editor validation. Method groups use the same signature rule as in a body, so a mismatched return type, parameter list, or receiver is reported at the declaration in status, the editor, and push preparation.
39
+
40
+ A static field default that names another static, such as `public static int B = Holder.A;`, now prepares and pushes. Value types, strings, and delegates copy the value; a class, List, or Dictionary static shares the same object and pulls back as that name. A static delegate that copies another Class's delegate field is reported at its declaration with the `() => Other.Call()` alternative.
41
+
42
+ - 38198d4: Pulling a project into a fresh checkout now writes instance delegate field defaults, such as `public NeoDelegate<int> Value = () => 1;`, as their authored lambda instead of compiled closure data that failed the next status and push. Status no longer reports pushed delegate defaults as edited.
43
+ - be1f336: Stored generic instances whose constructor takes a collection of a type parameter now prepare. Example: `class Box<T>(List<T> value) { public List<T> Value = value; }` with `public static Box<int> Value = new([1, 2]);`. This also covers `Dictionary<string, T>`, nested `List<List<T>>`, and instances placed under a project root.
44
+
45
+ Previously, Push, Evaluation, and Export preparation failed with "Cannot substitute generic slot "Item"…" or "Collection value … has stale generic bindings." Stored replay now stamps argument collections with the constructing instance's bindings, as runtime construction does.
46
+
47
+ Also fixed:
48
+
49
+ - A generic base member settled from a base initializer block, as in `class Child<T>(T item) : Base<T> { Value = item } {}`, no longer fails with "has no resolvable declared type."
50
+ - Assigning a generic collection field in a stored instance's initializer block, as in `new() { Value = [1, 2] }`, no longer fails with "has no declared type for materialized settle comparison."
51
+ - A stored instance whose constructor takes a collection of class instances, as in `class Box(List<Item> value)` with `new([new() { V = 4 }])`, no longer fails with "NSFunction argument 1 does not match its declared runtime type." Storage no longer drops the entries when the field they settle matches its default.
52
+
3
53
  ## 0.77.0
4
54
 
5
55
  ### Minor Changes