@hyperfixi/vite-plugin 3.1.1 → 3.3.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/README.md +20 -18
  2. package/package.json +5 -5
package/README.md CHANGED
@@ -93,7 +93,7 @@ Enable semantic parsing for natural language hyperscript and multilingual suppor
93
93
  | `semantic` | `boolean \| 'en' \| 'auto'` | `false` | Enable semantic parser |
94
94
  | `languages` | `string[]` | `[]` | Explicit language codes to support |
95
95
  | `region` | `'western' \| 'east-asian' \| 'priority' \| 'all'` | auto | Force a regional bundle |
96
- | `grammar` | `boolean` | `false` | Enable grammar transformation (SOV/VSO) |
96
+ | `grammar` | `boolean` | `false` | Add `translateHyperscript()` to the API |
97
97
  | `extraLanguages` | `string[]` | `[]` | Languages to always include |
98
98
 
99
99
  ### Supported Languages (24)
@@ -122,7 +122,7 @@ hyperfixi({ languages: ['en', 'es', 'ja'] });
122
122
  // Force a specific regional bundle
123
123
  hyperfixi({ region: 'western' });
124
124
 
125
- // Full multilingual with grammar transformation
125
+ // Semantic parsing plus translateHyperscript(code, from, to)
126
126
  hyperfixi({ semantic: true, grammar: true });
127
127
  ```
128
128
 
@@ -142,19 +142,21 @@ The plugin automatically selects the smallest bundle that covers all detected la
142
142
 
143
143
  ### Semantic Bundle Sizes
144
144
 
145
- | Bundle | Languages |
146
- | ---------------------- | --------------------- |
147
- | `semantic: 'en'` | English only |
148
- | `semantic: 'es'` | Spanish only |
149
- | `region: 'es-en'` | English + Spanish |
150
- | `region: 'western'` | en, es, pt, fr, de |
151
- | `region: 'east-asian'` | ja, zh, ko |
152
- | `region: 'priority'` | 11 priority languages |
153
- | `region: 'all'` | All 24 languages |
154
-
155
- Final size depends on Vite's tree-shaking of the selected languages; for reference,
156
- the prebuilt standalone semantic bundles range from ~62 KB (core) to ~203 KB
157
- (all 24 languages) gzipped — see `docs/BROWSER_BUNDLES.md` in the repo.
145
+ | Bundle | Languages |
146
+ | ------------------------- | ---------------------------------------------------------------- |
147
+ | `semantic: 'en'` | English only |
148
+ | `languages: ['es']` | Spanish only |
149
+ | `languages: ['en', 'es']` | English + Spanish |
150
+ | `region: 'western'` | en, es, pt, fr, de, it |
151
+ | `region: 'east-asian'` | ja, zh, ko |
152
+ | `region: 'priority'` | 13 languages: en, es, pt, fr, de, it, ja, zh, ko, ar, tr, ru, hi |
153
+ | `region: 'all'` | All 24 languages |
154
+
155
+ English is always included as the fallback. The generated code imports
156
+ `@lokascript/semantic/core` plus one `@lokascript/semantic/languages/<code>` module
157
+ per language, so the final size depends on Vite's tree-shaking; for reference, the
158
+ prebuilt standalone semantic bundles range from ~90 KB (no languages) to ~260 KB
159
+ (all 24 languages) gzipped, measured locally — see `docs/BROWSER_BUNDLES.md` in the repo.
158
160
 
159
161
  ### Tiered Bundle Architecture
160
162
 
@@ -165,7 +167,7 @@ Level 1: + Semantic English
165
167
  ↓ languages detected/specified
166
168
  Level 2: + Regional Semantic Bundle
167
169
  ↓ grammar: true
168
- Level 3: + Grammar Transformation
170
+ Level 3: + translateHyperscript() (semantic's translate)
169
171
  ```
170
172
 
171
173
  Each level adds bundle weight; the plugin picks the lowest level that covers the
@@ -219,7 +221,7 @@ hyperfixi({
219
221
  semantic: false, // boolean | 'en' | 'auto'
220
222
  languages: [], // ['en', 'es', 'ja']
221
223
  region: undefined, // 'western' | 'east-asian' | 'priority' | 'all'
222
- grammar: false, // Enable grammar transformation
224
+ grammar: false, // Add translateHyperscript() to the API (implies semantic)
223
225
  extraLanguages: [], // Languages to always include
224
226
  });
225
227
  ```
@@ -357,7 +359,7 @@ This example demonstrates language auto-detection with Japanese, Spanish, and Ko
357
359
  | `semantic` | `boolean \| 'en' \| 'auto'` | `false` | Enable semantic parser |
358
360
  | `languages` | `string[]` | `[]` | Explicit language codes |
359
361
  | `region` | `string` | auto | Force regional bundle |
360
- | `grammar` | `boolean` | `false` | Enable grammar transformation |
362
+ | `grammar` | `boolean` | `false` | Add `translateHyperscript()` to API |
361
363
  | `extraLanguages` | `string[]` | `[]` | Languages to always include |
362
364
 
363
365
  ### Default Include Pattern
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperfixi/vite-plugin",
3
- "version": "3.1.1",
3
+ "version": "3.3.0",
4
4
  "description": "Vite plugin for automatic tree-shaken hyperscript bundles",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -31,7 +31,7 @@
31
31
  "test:check": "VITEST_QUIET=1 bash ../../scripts/vitest-run.sh --reporter=dot"
32
32
  },
33
33
  "peerDependencies": {
34
- "@hyperfixi/server-bridge": "^3.1.1",
34
+ "@hyperfixi/server-bridge": "^3.3.0",
35
35
  "vite": ">=4.0.0"
36
36
  },
37
37
  "peerDependenciesMeta": {
@@ -40,14 +40,14 @@
40
40
  }
41
41
  },
42
42
  "dependencies": {
43
- "@hyperfixi/core": "^3.1.1",
43
+ "@hyperfixi/core": "^3.3.0",
44
44
  "glob": "^13.0.6"
45
45
  },
46
46
  "devDependencies": {
47
47
  "tsup": "^8.0.0",
48
48
  "typescript": "^5.8.3",
49
- "vite": "^8.0.0",
50
- "vitest": "^4.1.5"
49
+ "vite": "^8.3.1",
50
+ "vitest": "^5.0.2"
51
51
  },
52
52
  "keywords": [
53
53
  "vite",