@hyperscript-tools/i18n 3.0.0 → 3.1.1

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