@hyperfixi/patterns-reference 3.0.0 → 3.1.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.
Files changed (2) hide show
  1. package/CHANGELOG.md +183 -3
  2. package/package.json +5 -5
package/CHANGELOG.md CHANGED
@@ -7,6 +7,183 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [3.1.0] - 2026-09-04
11
+
12
+ ### Added
13
+
14
+ - **`hyperscript.use(frontEnd)`** — register the multilingual front-end
15
+ `compile()` consults for a non-English program (and `toLSE`/`fromLSE` for
16
+ a semantic node and a renderer). The contract is `FrontEnd` in
17
+ `@hyperfixi/core` (`parseToAST`, optional `parse`/`render`);
18
+ `@lokascript/semantic` satisfies it through
19
+ `createBridgeFrontEnd(new SemanticGrammarBridge())` from
20
+ `@hyperfixi/core/multilingual`. The full browser bundle registers it at
21
+ boot. The library entry registers nothing and, through 3.x, builds the same
22
+ bridge lazily on the first non-English compile — so nothing changes for a
23
+ consumer with `@lokascript/semantic` installed. **4.0 will remove that
24
+ default:** a non-English `compile()` with no front-end registered will
25
+ return the same result the core-parser-only path returns today, and
26
+ `@lokascript/semantic` becomes an optional peer. Engine-migration plan
27
+ Arc 1, steps 2 and 3.
28
+
29
+ ### Fixed
30
+
31
+ - **Language server: valid non-English code no longer gets a `parse-error`.**
32
+ In `lokascript`/`hyperscript-i18n` mode the server ran core's English
33
+ parser on every region regardless of what the semantic front-end said, so
34
+ `al hacer clic alternar .activo` (accepted at 0.89 confidence) was published
35
+ as `Unexpected token: hacer`. Core's errors are now suppressed for a region
36
+ the front-end accepted in a non-English language. The integration suite
37
+ that claimed to cover this had been discarding every notification; it now
38
+ records `publishDiagnostics` and asserts on it.
39
+
40
+ - **Language server: settings actually reach the server.** Neither VS Code
41
+ extension set `synchronize.configurationSection`, so the client pushed
42
+ `settings: null` and every `mode`/`language`/`maxDiagnostics` value was
43
+ ignored; `initializationOptions` was ignored too. The server now reads
44
+ `initializationOptions`, a pushed `lokascript`/`hyperscript` section, or
45
+ pulls `workspace/configuration` when the push is empty — and merges partial
46
+ objects over the defaults instead of replacing them (a bare
47
+ `{ maxDiagnostics }` used to leave `language` undefined and error on every
48
+ document). Both extensions push their section, and the LokaScript one now
49
+ contributes `lokascript.mode`.
50
+
51
+ - **Both VS Code extension server bundles build and run.** The standalone
52
+ hyperscript extension's `bundle:server` had failed since #1016 (no shim for
53
+ `@hyperfixi/core/multilingual`); the LokaScript extension externalized
54
+ `@hyperfixi/core` without shipping it, so every install ran with core
55
+ absent ("diagnostics and hover degraded"). Core is bundled in now, and CI
56
+ runs both bundle scripts.
57
+
58
+ - **`@lokascript/language-server` declares what it imports.**
59
+ `@lokascript/semantic` was an optional peer but a static import (the
60
+ server crashed at startup without it); `@lokascript/framework` was
61
+ undeclared and got inlined together with `@lokascript/intent` (261 KB) —
62
+ and without `--clean`, `dist/` shipped every previous build's chunk (three
63
+ dead ones, 63% of the tarball). Both are regular dependencies now, the
64
+ build cleans, the 20-byte `--dts` output is gone, and `npm test` rebuilds
65
+ the server it spawns.
66
+
67
+ - **Hyperscript-compat mode stops flagging portable code.** `as Int`, `Float`,
68
+ `JSON`, `Date`, `Set`, `Map` are upstream conversions (the extension list
69
+ is now `Math`/`Values`, the ones core registers and upstream lacks);
70
+ `my.x`/`your.x` evaluate upstream (only `its.` is flagged); and the
71
+ extension-command scan no longer fires inside `y.replace(`, `arr.push(`,
72
+ string literals, `:process`, `--` comments, or the upstream trailing
73
+ `… unless …` modifier.
74
+
75
+ - **Language-server false positives and misses.** A `.hs` file containing a
76
+ query literal like `<li/>` was classified as HTML and lost every feature;
77
+ possessives after `)`/`]`/`>` and apostrophes in `--` comments raised
78
+ `unmatched-quote`; the outline reported the `on` in `toggle .x on me` as a
79
+ handler and `.init` as an init block; `install Foo(args)` produced
80
+ overlapping rename edits VS Code rejects; `on draggable:start` became a
81
+ variable named `:start`; and keyword boundaries were ASCII `\b`, so
82
+ definitions and symbols were silently absent in the ten non-Latin
83
+ languages. Completion-context and document-symbol logic moved out of the
84
+ entry script into `completion-context.ts` / `document-symbols.ts` so the
85
+ unit suite tests the shipped code rather than the hand-copied twins it
86
+ used to carry.
87
+
88
+ - **MCP `get_diagnostics`, `get_completions` and `get_document_symbols` read
89
+ the AST.** The bridge guarded those paths on helper names core never
90
+ exported, so all three had only ever taken their token-based fallback.
91
+ They now read the interchange: the core parser's own errors become
92
+ diagnostics, completions inside a command offer that command's argument
93
+ shapes, symbols carry their commands as children, and a document with
94
+ several `end`-terminated handlers keeps all of them.
95
+
96
+ - **`hyperscript.process()` honours the event grammar.** The API-side DOM
97
+ processor carried its own listener installer for `on …` attributes and
98
+ silently dropped what the runtime's installer handles: `on
99
+ click[event.shiftKey]` fired on a plain click, `on mouseenter or click` never
100
+ fired on mouseenter, `on click from document` never fired. Every browser
101
+ bundle already went through the runtime; `process()` now does too, and
102
+ `config.logAll` moved into the runtime so both paths log. Pinned by
103
+ `api/dom-processor.test.ts`, which runs each case on both paths.
104
+
105
+ - **The browser bundles' attribute processor now runs the element lifecycle,
106
+ and its lazy stub only takes the shapes it can run faithfully.** Measured
107
+ side by side with `hyperscript.process()`: the bundle path never dispatched
108
+ `hyperscript:before:init` / `hyperscript:after:init` and never set
109
+ `data-hyperscript-powered` — both lived only in the API processor, so a
110
+ morph engine reading the marker saw nothing on a bundle-processed page, and
111
+ canceling `before:init` was impossible there. It also compiled every
112
+ attribute as English; it now detects the element's language (`data-lang`,
113
+ closest `lang`, the document's) the way `process()` always did. And the
114
+ `lazyParsing` stub read only the event NAME from the header, so for the
115
+ first event it ignored a filter (`on click[event.shiftKey]` fired on a
116
+ plain click), listened for the first name of an `or` list only, and never
117
+ saw `from <target>` at all; a header with a filter, `(args)`, `or`, `from`,
118
+ `elsewhere`, `queue`, `debounced`, `throttled` or `in` is now processed
119
+ eagerly. `dom/processor-parity.test.ts` runs every row on all three paths
120
+ (API, eager, lazy) and is the gate the DOM-processor collapse landed under.
121
+
122
+ - **`hyperscript.process()` and the browser bundles share one DOM
123
+ processor.** `process()` and `cleanup()` now run on the attribute
124
+ processor every bundle uses, which receives its compiler and runtime from
125
+ the API by injection instead of importing it (the `dom -> api` layering
126
+ edge is gone). What changes for `process()` callers, all of it upstream
127
+ parity: an element is initialized once however many times it is passed or
128
+ scanned (it used to re-install on every call); `<script
129
+ type="text/hyperscript">` tags inside the tree are processed, with or
130
+ without `for=`, before the elements that may `install` what they define;
131
+ each element gets a non-bubbling `load` event once its program has run,
132
+ and an unparseable attribute is reported through `console.error`, the
133
+ `hyperfixi:compile-error` event and `config.onCompileError` (it was logged
134
+ at debug level only). And `cleanup(container)` now un-marks every processed
135
+ descendant — it stripped the root's `data-hyperscript-powered` only — and
136
+ drops a lazy stub still waiting on an element, so cleanup-then-process
137
+ re-initializes the tree once. A second scan in `lazyParsing` mode no longer
138
+ registers a second stub.
139
+ The API-side processor module is deleted; the multilingual bundle's own
140
+ copy of the language walk now calls the shared one, narrowed to the
141
+ languages that bundle ships; and a subtree the `MutationObserver` picks up
142
+ takes the same entry as `process()`.
143
+
144
+ - **`set *<css-property>` writes inline style in every spelling upstream
145
+ accepts.** `set *opacity to 0.5`, `set *opacity of me to 0.5` and
146
+ `set *background-color of me to "red"` were silent no-ops and
147
+ `set the *opacity of me to 0.5` threw; only the possessive `set my *opacity`
148
+ worked. The tokenizer classes `*opacity` as a selector (for `measure`), and
149
+ `set`'s parser now re-types it into the identifier property the runtime's
150
+ style rungs already handle, so one path serves all of them — bare, `of
151
+ <target>`, `the … of <target>`, `<target>'s`. Ten rows pinned against
152
+ `_hyperscript` 0.9.93.
153
+
154
+ - **`require('@hyperfixi/core')` returned `{}`, and the subpath `require`s
155
+ threw — since `"type": "module"`, on 3.0.0 too.** Every `exports.*.require`
156
+ and `main` pointed at a `.js` file built as CommonJS, which Node reads as
157
+ ESM under that flag. The CJS outputs are `.cjs` now (main entry, the 21
158
+ subpaths, the parser modules); the `import` conditions are unchanged. The
159
+ bare-Node check in CI now `require()`s the entries as well as importing
160
+ them, which is the check that would have caught this. Found by the
161
+ end-to-end probe that landed Arc 1's build half.
162
+
163
+ ### Changed
164
+
165
+ - **`@hyperfixi/core`'s library entry no longer bundles the multilingual
166
+ front-end.** `dist/index.mjs`/`index.js` had `@lokascript/semantic`,
167
+ `@lokascript/intent` and `@lokascript/framework` inlined whole (3.33 MB, zero
168
+ dynamic imports left); they are external now (1.04 MB) and load on the first
169
+ non-English `compileAsync`, the way the source always said they would. No
170
+ API change: semantic and intent stay `dependencies`, framework stays an
171
+ optional peer — and is now genuinely one. A consumer that imported both core
172
+ and semantic no longer holds two copies of semantic. `dist/index.min.js`
173
+ (UMD, not in `exports`) stays self-contained. Gated by
174
+ `scripts/check-node-import.mjs` on the sourcemap. Engine-migration plan Arc 1
175
+ step 2, build half.
176
+
177
+ - **`@lokascript/semantic` drops its `asyncSchema`.** Core deleted the `async`
178
+ command in 3.0.0 (#1102); the semantic front-end never emitted the action
179
+ anyway — its `stripAsyncModifier` pass removes the keyword (in all 24
180
+ languages) and parses the following command, so `async fetch /api as json`
181
+ is a `fetch`. The schema, its registration, the `'async'` `ActionType`
182
+ member and the AST-builder mapper row are gone. Kept on purpose: every
183
+ profile's `keywords.async` (the stripper matches on it) and the
184
+ `'then' | 'and' | 'async'` chain type (a different concept). The IR-level
185
+ `async all/race` node lives in `@lokascript/intent` and is untouched.
186
+
10
187
  ## [3.0.0] - 2026-09-03
11
188
 
12
189
  Full notes: [GitHub Releases](https://github.com/codetalcott/hyperfixi/releases/tag/v3.0.0).
@@ -14,9 +191,11 @@ Full notes: [GitHub Releases](https://github.com/codetalcott/hyperfixi/releases/
14
191
  One major, two themes. `@lokascript/i18n`'s grammar transformer is gone,
15
192
  because `@lokascript/semantic` overtook it on every row of the translation
16
193
  corpus (#973–#1001). And the engine-migration plan
17
- (`docs-internal/ENGINE_MIGRATION_PLAN.md`) is complete: its last arc deleted
194
+ (`docs-internal/ENGINE_MIGRATION_PLAN.md`) closed its last arc, which deleted
18
195
  the exported dead code it had been carrying and collapsed the browser bundle
19
- lineup to two names (#1099–#1105).
196
+ lineup to two names (#1099–#1105). One arc is still open: Arc 1's steps 2
197
+ and 3 — `@hyperfixi/core`'s library entry still bundles the semantic
198
+ front-end (recorded in the plan's History, 2026-09-03).
20
199
 
21
200
  ### ⚠ BREAKING
22
201
 
@@ -514,7 +693,8 @@ _Synchronized version release. See git history for details._
514
693
  - npm access token stored in GitHub Secrets
515
694
  - 2FA recommended for npm organization
516
695
 
517
- [Unreleased]: https://github.com/codetalcott/hyperfixi/compare/v2.10.0...HEAD
696
+ [Unreleased]: https://github.com/codetalcott/hyperfixi/compare/v3.1.0...HEAD
697
+ [3.1.0]: https://github.com/codetalcott/hyperfixi/compare/v3.0.0...v3.1.0
518
698
  [2.10.0]: https://github.com/codetalcott/hyperfixi/compare/v2.9.0...v2.10.0
519
699
  [2.9.0]: https://github.com/codetalcott/hyperfixi/compare/v2.8.0...v2.9.0
520
700
  [2.8.0]: https://github.com/codetalcott/hyperfixi/compare/v2.5.1...v2.8.0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperfixi/patterns-reference",
3
- "version": "3.0.0",
3
+ "version": "3.1.0",
4
4
  "description": "Queryable patterns database for hyperscript with multilingual translations and LLM support",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -66,13 +66,13 @@
66
66
  },
67
67
  "homepage": "https://github.com/codetalcott/hyperfixi/tree/main/packages/patterns-reference#readme",
68
68
  "dependencies": {
69
- "@lokascript/semantic": "^3.0.0",
69
+ "@lokascript/semantic": "^3.1.0",
70
70
  "better-sqlite3": "^13.0.1"
71
71
  },
72
72
  "devDependencies": {
73
- "@hyperfixi/core": "^3.0.0",
74
- "@hyperfixi/reactivity": "^3.0.0",
75
- "@hyperfixi/realtime": "^3.0.0",
73
+ "@hyperfixi/core": "^3.1.0",
74
+ "@hyperfixi/reactivity": "^3.1.0",
75
+ "@hyperfixi/realtime": "^3.1.0",
76
76
  "@types/better-sqlite3": "^7.6.0",
77
77
  "@types/node": "^26.1.2",
78
78
  "hyperscript.org": "0.9.93",