@neocompose/cli 0.76.1 → 0.76.3
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 +56 -0
- package/dist/neo.mjs +45656 -41980
- package/dist/test-worker.mjs +2072 -1229
- package/package.json +1 -1
- package/skills/neocompose-cli/SKILL.md +6 -3
- package/skills/neocompose-cli/references/cli-development.md +1 -1
- package/skills/neocompose-cli/references/declarations-and-construction.md +25 -5
- package/skills/neocompose-cli/references/neoscript.md +32 -12
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@ description: >-
|
|
|
9
9
|
`@neocompose/cli` or `node cli/bin/neo.mjs` in the neo-compose repository.
|
|
10
10
|
---
|
|
11
11
|
|
|
12
|
-
<!-- reviewed-through-cli: 0.76.
|
|
12
|
+
<!-- reviewed-through-cli: 0.76.3 -->
|
|
13
13
|
|
|
14
14
|
# Neo Compose CLI
|
|
15
15
|
|
|
@@ -68,7 +68,8 @@ opaque JSON or guessed syntax.
|
|
|
68
68
|
its old parent no longer declares it. See the identity reference for limits.
|
|
69
69
|
- Omit `@id` on new ordinary declarations and nested rows unless a same-push
|
|
70
70
|
structural reference genuinely requires an explicit UUID. A successful push
|
|
71
|
-
assigns the durable IDs and
|
|
71
|
+
assigns the durable IDs and inserts them into the authored source. Files that
|
|
72
|
+
get no new IDs keep their bytes.
|
|
72
73
|
- Do not add a second `@id` to a root or static member initializer. The member
|
|
73
74
|
ID owns that stored binding. Existing nested class/list rows retain their
|
|
74
75
|
inline IDs; new rows normally omit them until push.
|
|
@@ -309,7 +310,9 @@ or server verification is involved.
|
|
|
309
310
|
The CLI and VS Code extension share NeoScript formatting and read `.editorconfig`
|
|
310
311
|
for `.neo` and `.neoflow` files. Set `indent_style`, `indent_size`, `end_of_line`,
|
|
311
312
|
and `insert_final_newline` there to keep regenerated source consistent with your
|
|
312
|
-
editor. Defaults are two spaces, LF, and a final newline.
|
|
313
|
+
editor. Defaults are two spaces, LF, and a final newline. A NeoFlow prose
|
|
314
|
+
block's content and closing `"""` lines follow its opening `"""`, so re-indenting
|
|
315
|
+
never changes the text. Push preserves authored
|
|
313
316
|
text when regeneration has the same tokens; pull preserves semantically unchanged
|
|
314
317
|
files. Formatting-only body or source-location changes do not create a subsequent
|
|
315
318
|
push, including stored initializer recipes, computed member defaults, and inline
|
|
@@ -129,7 +129,7 @@ wrappers.
|
|
|
129
129
|
The marker near the top of `SKILL.md` must exactly match the package version:
|
|
130
130
|
|
|
131
131
|
```html
|
|
132
|
-
<!-- reviewed-through-cli: 0.76.
|
|
132
|
+
<!-- reviewed-through-cli: 0.76.3 -->
|
|
133
133
|
```
|
|
134
134
|
|
|
135
135
|
The quoted version above is checked too, so this instruction cannot go stale
|
|
@@ -202,12 +202,27 @@ List getter.
|
|
|
202
202
|
Use `.EnumCase` only when context fixes one enum type; otherwise write
|
|
203
203
|
`EnumType.Case`. Constructor parameters supply this context for positional
|
|
204
204
|
and named arguments, including substituted generic parameter types. Defaults
|
|
205
|
-
and settings must be statically analyzable.
|
|
205
|
+
and settings must be statically analyzable. An integer is not an enum option.
|
|
206
|
+
Instance fields, static fields, and local value definitions report incompatible
|
|
207
|
+
enum initializers at the authored expression before value lowering. Extracting
|
|
208
|
+
a list or dictionary into a local preserves element validation. Errors point
|
|
209
|
+
to the entry in the local definition, including missing `.Option` or
|
|
210
|
+
`EnumType.Option` dictionary keys.
|
|
206
211
|
|
|
207
212
|
An explicit construction must be assignable to its receiving type. For example,
|
|
208
213
|
`List<Base>` accepts `new Derived()` when `Derived` inherits `Base`, but rejects
|
|
209
214
|
an unrelated class at `new`. Generic arguments must also be compatible.
|
|
210
215
|
|
|
216
|
+
Primary-constructor parameters can initialize generic collection fields directly:
|
|
217
|
+
|
|
218
|
+
```neo
|
|
219
|
+
class Box<T>(List<T> value) {
|
|
220
|
+
public List<T> Value = value;
|
|
221
|
+
}
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
The same rule applies to `Dictionary<string, T>` and nested collections.
|
|
225
|
+
|
|
211
226
|
## Member and relation rules
|
|
212
227
|
|
|
213
228
|
Infer member kind and optionality from its type and nullability. Treat the
|
|
@@ -275,10 +290,15 @@ Operator expressions are valid member defaults and store as computed
|
|
|
275
290
|
initializers, the same way calls do — `public float Derived =
|
|
276
291
|
Flags.Start / Flags.Scale;` is fine. Positions that store no rows still
|
|
277
292
|
require literals: dictionary keys must be string literals or enum option
|
|
278
|
-
literals for enum-keyed dictionaries, and
|
|
279
|
-
literals.
|
|
280
|
-
|
|
281
|
-
|
|
293
|
+
literals for enum-keyed dictionaries, and Color components must be numeric
|
|
294
|
+
literals. In a static member or its collection entries, a vector with a
|
|
295
|
+
computed component, such as `new Vector2(Probe.X, 1)`, stores as a computed
|
|
296
|
+
initializer. Instance member defaults, including their collection entries,
|
|
297
|
+
still require numeric literal vector components. When a computed list or
|
|
298
|
+
dictionary entry carries an authored `@id`, parenthesize the expression —
|
|
299
|
+
`@id("row") (A.B / A.C)` — so the annotation names the row rather than its left
|
|
300
|
+
operand.
|
|
301
|
+
A push that assigns such a row's ID adds those parentheses itself.
|
|
282
302
|
|
|
283
303
|
Numeric literals do not use C# suffixes: write `0` or `0.5`, not `0f` or
|
|
284
304
|
`0.5f`. The declared/contextual type determines whether a literal is stored as
|
|
@@ -55,12 +55,10 @@ such as `set(int value) => this.Raw = value;`. An expression whose value would
|
|
|
55
55
|
simply be discarded is rejected with a diagnostic that names the block body as
|
|
56
56
|
the fix.
|
|
57
57
|
|
|
58
|
-
`neo
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
choosing longhand for a one-line getter is stable; a fresh `neo pull` writes
|
|
63
|
-
the canonical shorthand.
|
|
58
|
+
`neo pull` and canonical emission write a body as the shorthand when it is
|
|
59
|
+
exactly one `return` statement that fits on one line, and anything else as a
|
|
60
|
+
block. Setters are always blocks. `neo push` keeps the body form you authored,
|
|
61
|
+
so choosing longhand for a one-line getter is stable.
|
|
64
62
|
|
|
65
63
|
Properties require a getter implementation. A bodyless `{ get; }` contract
|
|
66
64
|
requires `abstract` on the member, even inside an abstract class, for example
|
|
@@ -122,11 +120,33 @@ class and derived classes may invoke it or call `Clear()`; public external
|
|
|
122
120
|
callers may subscribe and unsubscribe with `+=` and `-=` but cannot raise or
|
|
123
121
|
reset the action.
|
|
124
122
|
|
|
125
|
-
Inline `NeoDelegate` lambdas may be returned or
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
123
|
+
Inline `NeoDelegate` lambdas may be returned, stored, or assigned to a typed
|
|
124
|
+
local such as `NeoDelegate<int, int> twice = (x) => x * 2;`, and may read
|
|
125
|
+
surrounding locals and parameters. Those values are captured when the lambda is
|
|
126
|
+
created, so later changes to the outer binding do not alter the closure.
|
|
127
|
+
Any non-null delegate expression can be called directly, including
|
|
128
|
+
`callbacks[0](value)`, `(condition ? first : second)()`, and `Factory.Make()()`.
|
|
129
|
+
Force-unwrap a nullable delegate before calling it, as in `callbacks["key"]!()`.
|
|
130
|
+
Void delegates can only be called as statements.
|
|
131
|
+
Instance delegate field defaults are compiled against their declared signature.
|
|
132
|
+
Each instance binds defaults that read `this` to itself; invalid lambda bodies
|
|
133
|
+
are reported at the declaration by status, editor validation, and preparation.
|
|
134
|
+
Static delegate fields use static class scope: they can read static members
|
|
135
|
+
without an instance owner, and cannot access `this` or instance members.
|
|
136
|
+
Other static fields can call them in their initializers, as in
|
|
137
|
+
`public static int First = Helper.Run();`. Outside a lambda body, a field
|
|
138
|
+
initializer qualifies the members it reads; a bare `Run()` or `Number` there is
|
|
139
|
+
an unknown name.
|
|
140
|
+
Collection type arguments in constructions, such as `new Box<List<int>>([1, 2])`,
|
|
141
|
+
work even when no field declares that collection type. Preparation includes the
|
|
142
|
+
needed type descriptors; spec-only types remain in the test candidate.
|
|
143
|
+
Generic primary constructors also accept stored collection arguments, such as
|
|
144
|
+
`public static Box<List<int>> Value = new([1, 2]);`. Stored replay uses the closed
|
|
145
|
+
parameter type to preserve collection references.
|
|
146
|
+
Typed locals also accept generic class types such as `Box<int> box = new(1);`.
|
|
147
|
+
Explicit lambda parameter annotations accept the same type grammar as
|
|
148
|
+
declarations, including `decimal`, generic parameters, collections, arrays, and
|
|
149
|
+
nullable types.
|
|
130
150
|
|
|
131
151
|
A lambda may use an expression body too: `(x) => x * 2` is the block body
|
|
132
152
|
`(x) => { return x * 2; }`. In a void delegate the expression is a statement,
|
|
@@ -549,7 +569,7 @@ locally, like push. If another commit lands while it runs, the run is refused:
|
|
|
549
569
|
run it again. `neo loc` writes work the same way: a write refused because
|
|
550
570
|
another commit landed is run again.
|
|
551
571
|
|
|
552
|
-
VS Code rename follows override families and class constructors, resolves contextual enum options such as `.Success`, and keeps local-variable renames scoped to their declaration. Assigned IDs are not required for these refactorings.
|
|
572
|
+
VS Code rename follows override families and class constructors, resolves contextual enum options such as `.Success`, renames a constructor parameter's named arguments (`new Item(count: 1)`) in bodies, initializers, specs, and base clauses, and keeps local-variable renames scoped to their declaration. Assigned IDs are not required for these refactorings. Inferred locals initialized with conditional expressions retain their common branch type for member completion, navigation, and rename. Typed delegate calls retain their return type too. Lambda returns use the delegate signature for target-typed constructors and enum argument suggestions. Member completion also follows optional access and null-forgiving receivers, including dictionary lookups.
|
|
553
573
|
|
|
554
574
|
## Member change listeners
|
|
555
575
|
|