@neocompose/cli 0.60.1 → 0.61.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 +15 -0
- package/dist/neo.mjs +5950 -5481
- package/package.json +3 -3
- package/skills/neocompose-cli/SKILL.md +1 -1
- package/skills/neocompose-cli/references/cli-development.md +11 -2
- package/skills/neocompose-cli/references/declarations-and-construction.md +4 -1
- package/skills/neocompose-cli/references/neoscript.md +41 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neocompose/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.61.0",
|
|
4
4
|
"description": "Neo Compose native project-source CLI with bidirectional sync.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"access": "public"
|
|
18
18
|
},
|
|
19
19
|
"scripts": {
|
|
20
|
-
"contract:generate": "node schema-contract/generate.mjs",
|
|
21
|
-
"contract:check": "node schema-contract/generate.mjs --check",
|
|
20
|
+
"contract:generate": "node ../packages/manifest/schema-contract/generate.mjs",
|
|
21
|
+
"contract:check": "node ../packages/manifest/schema-contract/generate.mjs --check",
|
|
22
22
|
"fixtures:update": "node schema-contract/generate-corpus-fixtures.mjs",
|
|
23
23
|
"fixtures:check": "node schema-contract/generate-corpus-fixtures.mjs --check",
|
|
24
24
|
"build": "npm run build:local",
|
|
@@ -53,8 +53,17 @@ authoring capability. P52's document header still says proposed, but try/catch
|
|
|
53
53
|
shipped in CLI 0.18; implementation and parity tests take precedence over that
|
|
54
54
|
stale header.
|
|
55
55
|
|
|
56
|
+
CLI 0.61 adds `while` and `do / while` loops, ordinal string `Replace`,
|
|
57
|
+
ordered-list `Insert`, and method calls whose results may be discarded.
|
|
58
|
+
See the [NeoScript reference](neoscript.md) for authoring syntax and limits.
|
|
59
|
+
|
|
56
60
|
## Shared implementation contract
|
|
57
61
|
|
|
62
|
+
Manifest contracts, document comparison, normalization, and three-way merge
|
|
63
|
+
live in `packages/manifest`. Contract generation and its registry live in
|
|
64
|
+
`packages/manifest/schema-contract`. Web, backend, and CLI consumers import
|
|
65
|
+
`@neocompose/manifest`; production application code must not import CLI internals.
|
|
66
|
+
|
|
58
67
|
The CLI uses plain document snapshots and shared runtime functions. Keep Retree and web view models out of its imports. The headless architecture check follows CLI imports, and `cli/build.mjs` rejects UI modules and packages in the actual bundle metadata.
|
|
59
68
|
|
|
60
69
|
Keep parsing, strict resolution, formatting, diagnostics, symbols, and
|
|
@@ -80,7 +89,7 @@ compiler revision and re-checks the head, authorization, row shapes, and CAS
|
|
|
80
89
|
bases. A modified CLI can therefore write bad rows to a project its user may
|
|
81
90
|
already write; keep preparation in shared `src/database` code rather than
|
|
82
91
|
forking it in the CLI. The server still verifies a push's uploaded
|
|
83
|
-
project-file bytes, and web editor commits
|
|
92
|
+
project-file bytes, and web editor commits use the shared client preparation protocol.
|
|
84
93
|
Unrelated source files are not uploaded or recompiled on every push. A CLI lowering mismatch on a normal push is exposed by the next
|
|
85
94
|
canonical pull; `neo push --dry-run` remains the complete source-to-record
|
|
86
95
|
rehearsal.
|
|
@@ -101,7 +110,7 @@ wrappers.
|
|
|
101
110
|
The marker near the top of `SKILL.md` must exactly match the package version:
|
|
102
111
|
|
|
103
112
|
```html
|
|
104
|
-
<!-- reviewed-through-cli: 0.
|
|
113
|
+
<!-- reviewed-through-cli: 0.61.0 -->
|
|
105
114
|
```
|
|
106
115
|
|
|
107
116
|
The quoted version above is checked too, so this instruction cannot go stale
|
|
@@ -140,7 +140,10 @@ undeclared static member of such a class is Session.
|
|
|
140
140
|
`@column(member: Field, width: ..., visibility: ..., pin: ..., overflow: ...)`
|
|
141
141
|
are repeatable List annotations. `member:` is a bare field name on the entry
|
|
142
142
|
class. An index accepts a non-localizable string or single-select enum. A column
|
|
143
|
-
may target `__other__` for the default layout of subclass-added fields.
|
|
143
|
+
may target `__other__` for the default layout of subclass-added fields. Declare
|
|
144
|
+
indexes only on the original List member. Overrides inherit its indexes, and
|
|
145
|
+
`@index` on an override is a source error. A List field may override an abstract
|
|
146
|
+
List getter.
|
|
144
147
|
|
|
145
148
|
Use `.EnumCase` only when context fixes one enum type; otherwise write
|
|
146
149
|
`EnumType.Case`. Defaults and settings must be statically analyzable.
|
|
@@ -82,6 +82,16 @@ neo script eval --returns string 'return root.Assets.Outposts[0].FullDisplayText
|
|
|
82
82
|
neo script eval --function Outpost.RefreshUnlock --this-value <id> --args '[3]'
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
+
Method calls may be used as statements even when they return a value. The
|
|
86
|
+
runtime evaluates the call and discards the result. This also applies to
|
|
87
|
+
collection methods, delegates, actions, and fluent calls:
|
|
88
|
+
|
|
89
|
+
```neo
|
|
90
|
+
this.TryRefresh();
|
|
91
|
+
this.Items.Insert(0, item);
|
|
92
|
+
this.Items.Remove(item);
|
|
93
|
+
```
|
|
94
|
+
|
|
85
95
|
Prefer `--json` for automation.
|
|
86
96
|
|
|
87
97
|
`neo script check --all` reconstructs the prospective project entirely from
|
|
@@ -198,6 +208,17 @@ enum, parameter, or local may shadow it. Qualified members use their owner's
|
|
|
198
208
|
namespace and may be named `Math`; access one as `this.Math` or
|
|
199
209
|
`SomeValue.Math` without colliding with the builtin qualifier.
|
|
200
210
|
|
|
211
|
+
## String builtins
|
|
212
|
+
|
|
213
|
+
Use `text.Replace(search, replacement)` to return a string with every
|
|
214
|
+
non-overlapping occurrence replaced. Matching is ordinal and case-sensitive.
|
|
215
|
+
The search must be nonempty; an empty search throws an error. Neither argument
|
|
216
|
+
may be null. The receiver stays unchanged.
|
|
217
|
+
|
|
218
|
+
```neo
|
|
219
|
+
return "banana".Replace("a", "o"); // "bonono"
|
|
220
|
+
```
|
|
221
|
+
|
|
201
222
|
## Collection builtins
|
|
202
223
|
|
|
203
224
|
Lists expose their size as either `items.Count` or `items.Count()`. Use
|
|
@@ -210,6 +231,10 @@ Use `items.IndexOf(value)` to return the zero-based index of the first equal
|
|
|
210
231
|
list entry, or `-1` when the value is absent. `IndexOf` is list-only and uses
|
|
211
232
|
the same value/reference equality as `Contains`.
|
|
212
233
|
|
|
234
|
+
Use `items.Insert(index, value)` to insert an entry into a writable ordered
|
|
235
|
+
list. The index may range from zero through `items.Count`; the count appends
|
|
236
|
+
the entry. Other indices throw an error. `Insert` returns void.
|
|
237
|
+
|
|
213
238
|
Use `List.Repeat(value, count)` to build a list of `count` copies of a value
|
|
214
239
|
instead of hand-counting a literal or looping around `Add`:
|
|
215
240
|
|
|
@@ -298,7 +323,22 @@ Use `break` for the nearest loop or switch and `continue` for the nearest
|
|
|
298
323
|
loop. A `continue` inside a switch nested in a loop continues the loop.
|
|
299
324
|
|
|
300
325
|
All nested loops and called NeoScript bodies share a 10,000-iteration budget.
|
|
301
|
-
|
|
326
|
+
A `while` loop checks its boolean condition before each iteration. A
|
|
327
|
+
`do / while` loop runs its body once before checking the condition. Both
|
|
328
|
+
require braces; the `do / while` condition ends with a semicolon.
|
|
329
|
+
|
|
330
|
+
```neo
|
|
331
|
+
while (this.HasWork()) {
|
|
332
|
+
this.ProcessNext();
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
do {
|
|
336
|
+
this.ProcessNext();
|
|
337
|
+
} while (this.HasWork());
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
`continue` checks the condition again in both loops. Each executed body counts
|
|
341
|
+
against the shared iteration budget.
|
|
302
342
|
|
|
303
343
|
## Switch
|
|
304
344
|
|