@omgbase/oqx 0.25.0 → 0.26.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 +7 -0
- package/README.md +243 -207
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +38 -35
- package/dist/engine.js.map +1 -1
- package/dist/optimize/analysis.d.ts +3 -2
- package/dist/optimize/analysis.d.ts.map +1 -1
- package/dist/optimize/analysis.js +3 -2
- package/dist/optimize/analysis.js.map +1 -1
- package/dist/parser.d.ts.map +1 -1
- package/dist/parser.js +133 -32
- package/dist/parser.js.map +1 -1
- package/dist/print.d.ts +2 -2
- package/dist/print.d.ts.map +1 -1
- package/dist/print.js +79 -25
- package/dist/print.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/src/engine.ts +32 -28
- package/src/optimize/analysis.ts +3 -2
- package/src/parser.ts +121 -30
- package/src/print.ts +81 -28
- package/src/version.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,13 @@ All notable changes to `@omgbase/oqx` are recorded here. The format follows
|
|
|
4
4
|
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versions follow
|
|
5
5
|
[Semantic Versioning](https://semver.org/) (pre-1.0: a minor bump may break).
|
|
6
6
|
|
|
7
|
+
## [0.26.0] - 2026-10-22
|
|
8
|
+
|
|
9
|
+
### Minor
|
|
10
|
+
- **OQX 0.26 — collection-scoped queries** (`spec/oqx` 0.25 → 0.26; new suite `collection-scoped`, 28 cases: 1498 → 1526 fixtures). A query names its source as the collection before its body — `modules { select id, name where id == "launch" follow distinct ^modules { where id in ^needs depth 2 } order by $depth, name }` — instead of a `from` clause inside it. The form is the 0.17 receiver block with the implicit `collect`, so it parses to the identical tree and nothing in evaluation, planning, scoping or the AST changed; what moved is what is canonical. GRAMMAR §2 now leads with `<collection> [<consumer>] [distinct] { body }`; a body never names its source (the receiver supplied the rows), so `from E` inside a body keeps its one meaning, the re-projection (`people count { from jobs where !end }`, `follow _out_links { from _dst }`); the clause form `select … from S …` stays an accepted legacy spelling of the same tree and is no longer written anywhere. **The canonical printer** (AST.md §6) writes every query whose source can head a block collection-scoped and `collect` as the bare brace (`x collect { … }` → `x { … }`, `x collect distinct { … }` → `x distinct { … }`, the projection leading without `select`; a `collect` over a directive receiver keeps the word, `jobs first { offset 0 } collect { … }`; a literal, range, operator or aggregate source still prints in the clause form) — so `references` steps print `follow kids { … }`. The source hints were reworded (`a query must name its source before its body: \`<collection> { … }\` …`; the top-level predicate error points at `<collection> { <predicate> }`). Two more sugars desugar in the parser (suite `directive-sugar`, 28 cases): **a consumer word with no block is the directive over the empty block** — `people count`, `jobs first.employer`, `_nodes exists`, `jobs count distinct >= 1`, `follow kids first` — since a consumer word right after a complete receiver can be nothing else (the printer writes the braceless form whenever the word is written and the block is empty; the clause form's top-level `from people count` keeps its whole-query hint); and **a projection-only block over a lookup is the lookup's projection** — `jobs[0] { name }` ≡ `jobs first { name offset 0 }`, `jobs[p] { name }` ≡ `jobs first { name where p }` — refused when the outer block carries a clause of its own (it runs after the pick), when the inner directive is `distinct`, or when an outer alias would shadow a name the inner `where` reads; one consequence: `jobs[0] { name }` over no jobs is now `null` (`first` of none) where the two-directive tree gave `[]`. And **`follow` is legal in every body**: a where-position directive's block yields its walk's occurrences for the consumer to reduce (`children count { follow children } > 2`, `children { ^desc: id follow children }`; `exists`/`none` over a walk are the seeds' existence) — through 0.25 it was the eval error `` `follow` is only valid on a select-position collect ``; both engines route every consumer through one row path, so the walk, `flatten`, `group by`, ordering, `distinct` and the bound apply alike. `LANGUAGE_VERSION` 0.26 in both implementations and in `@omgbase/oqx-syntax` (assets regenerated; no lexical change — `from` stays reserved).
|
|
11
|
+
|
|
12
|
+
- omgbase surface (patch, both engines): the `query_syntax` card and manual teach the collection-scoped form (byte-identical in TS and Rust), the tool descriptions' examples and the `omg query` help examples are respelled, the `graph` macro's `queries` text prints collection-scoped (`docs { … follow distinct _out_links { from _dst depth 2 } }`), the selector's root error reads `` `docs { … }`, `blocks { … }` or `nodes { … }` ``, the selector's expression wrapper is `docs { select __omg_x: <e> }` (a malformed slot now reports `unexpected '}'` where the leaked `from` was); `spec/surface` fixtures regenerated (`reads`, `examples`, `interop`, `tool-descriptions`), `spec/cli` `invoke` regenerated. `@omgbase/dataview` emits `<source> { select … }`. Documentation, READMEs and every example converted.
|
|
13
|
+
|
|
7
14
|
## [0.25.0] - 2026-10-16
|
|
8
15
|
|
|
9
16
|
### Minor
|