verbaly 0.13.0 → 0.13.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/README.md +23 -20
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  <p align="center">
10
10
  <a href="https://www.npmjs.com/package/verbaly"><img src="https://img.shields.io/npm/v/verbaly?logo=npm&color=cb3837" alt="npm version" /></a>
11
- <a href="https://bundlephobia.com/package/verbaly"><img src="https://img.shields.io/bundlephobia/minzip/verbaly?label=gzip" alt="bundle size" /></a>
11
+ <img src="https://img.shields.io/badge/gzip-~3KB-3fb950" alt="~3KB gzip" />
12
12
  <img src="https://img.shields.io/badge/dependencies-0-3fb950" alt="zero dependencies" />
13
13
  <img src="https://img.shields.io/badge/types-included-3178C6?logo=typescript&logoColor=white" alt="TypeScript" />
14
14
  <a href="https://github.com/AronSoto/verbaly/blob/develop/LICENSE"><img src="https://img.shields.io/npm/l/verbaly?color=blue" alt="MIT" /></a>
@@ -18,7 +18,7 @@
18
18
 
19
19
  Most i18n tools make you maintain key files by hand — keys drift from the code, no type-safety, heavy setup. **Verbaly inverts the flow:** write the source text in your code, a build plugin extracts stable keys, types and per-locale modules. Compiler-grade safety, a runtime under **~3KB**, zero dependencies.
20
20
 
21
- ```ts
21
+ ```
22
22
  // You write this:
23
23
  t`Hello ${name}, you have ${count} messages`;
24
24
 
@@ -31,20 +31,20 @@ t.id('inbox.title')`Hello ${name}`; // → t('inbox.title', { name })
31
31
 
32
32
  Missing a translation? **The build fails** — raw keys never reach production.
33
33
 
34
- ## Install
34
+ ## 🚀 Try it in 30 seconds
35
35
 
36
- ```bash
36
+ ```
37
37
  pnpm add verbaly @verbaly/vite
38
38
  ```
39
39
 
40
- ```ts
40
+ ```
41
41
  // vite.config.ts
42
42
  import verbaly from '@verbaly/vite';
43
43
 
44
44
  export default { plugins: [verbaly({ locales: ['en', 'es', 'pt'] })] };
45
45
  ```
46
46
 
47
- ```ts
47
+ ```
48
48
  // anywhere in your app — extracted + typed on save
49
49
  import { t, setLocale } from 'virtual:verbaly';
50
50
 
@@ -52,11 +52,11 @@ t`Hello ${name}`;
52
52
  await setLocale('es'); // per-locale bundle loaded on demand
53
53
  ```
54
54
 
55
- ### Standalone runtime (no compiler)
55
+ ### 🎛️ Standalone runtime (no compiler)
56
56
 
57
57
  `verbaly` also works on its own for dynamic/CMS content:
58
58
 
59
- ```ts
59
+ ```
60
60
  import { createVerbaly } from 'verbaly';
61
61
 
62
62
  const v = createVerbaly({
@@ -69,9 +69,9 @@ v.t('greeting', { name: 'Aron' }); // "Hello Aron"
69
69
  v.setLocale('es'); // auto-loads the catalog; or: await v.loadLocale('es') first
70
70
  ```
71
71
 
72
- ### Plain HTML
72
+ ### 🌐 Plain HTML — no framework needed
73
73
 
74
- ```html
74
+ ```
75
75
  <h1 data-verbaly="home.title"></h1>
76
76
  <p data-verbaly="home.intro" data-verbaly-rich></p>
77
77
  <!-- rich: 'The build <em>gate</em>' renders a real <em> — whitelist, XSS-safe -->
@@ -83,7 +83,7 @@ v.setLocale('es'); // auto-loads the catalog; or: await v.loadLocale('es') first
83
83
  <!-- links: 'See the <repo>repo</repo>' renders <a href> — hrefs from you, never from messages -->
84
84
  ```
85
85
 
86
- ```ts
86
+ ```
87
87
  import { bindDom, createVerbaly, persistLocale, resolveLocale } from 'verbaly';
88
88
 
89
89
  const v = createVerbaly({
@@ -98,7 +98,7 @@ v.setLocale('es');
98
98
  persistLocale('es'); // localStorage + <html lang>
99
99
  ```
100
100
 
101
- ## What you get
101
+ ## ✨ What you get
102
102
 
103
103
  - **Hybrid compiler + runtime** — static text compiled (types + tree-shaking), dynamic content via a real runtime path.
104
104
  - **Type-safe params** — `{name}`, plurals, currency and dates inferred from the message; wrong/missing params fail to compile.
@@ -106,19 +106,22 @@ persistLocale('es'); // localStorage + <html lang>
106
106
  - **Plain, portable JSON catalogs** — no proprietary format, no lock-in.
107
107
  - **DOM interpreter** for framework-less HTML — with opt-in rich text (whitelist-based, XSS-safe) and named links (`richLinks` / `data-verbaly-links`; hrefs come from the caller, `javascript:` blocked).
108
108
  - **Lazy catalogs** — `loaders` + `loadLocale` load per-locale JSON on demand, in the runtime itself.
109
- - **Fast, with receipts** — fully memoized hot path, benchmarked every release: 4–43× faster than i18next on lookup, interpolation and plurals.
109
+ - **Fast, with receipts** — fully memoized hot path, benchmarked every release: 5–35× faster than i18next on lookup, interpolation and plurals.
110
110
 
111
- ## Ecosystem
111
+ ## 🧩 Ecosystem
112
112
 
113
- | Package | Description |
114
- | ----------------------------------------------------- | --------------------------- |
115
- | `verbaly` | Core runtime (this package) |
116
- | `@verbaly/vite` | Zero-config Vite plugin |
117
- | `@verbaly/compiler` | Extraction + codegen + CLI |
118
- | `@verbaly/react` · `@verbaly/vue` · `@verbaly/svelte` | Framework adapters |
113
+ | Package | Description |
114
+ | ----------------------------------------------------- | ----------------------------------- |
115
+ | `verbaly` | Core runtime (this package) |
116
+ | `@verbaly/vite` | Zero-config Vite plugin |
117
+ | `@verbaly/compiler` | Extraction + codegen + CLI |
118
+ | `@verbaly/unplugin` | webpack · Rollup · esbuild · Rspack |
119
+ | `@verbaly/react` · `@verbaly/vue` · `@verbaly/svelte` | Framework adapters |
119
120
 
120
121
  📖 **Docs & live playground:** https://verbaly-web.vercel.app
121
122
 
123
+ 🔁 **Coming from i18next?** Keep your keys and catalogs — the [migration guide](https://verbaly-web.vercel.app/docs/migrate) maps everything one-to-one.
124
+
122
125
  > ⚠️ Early development (`0.x`) — API not stable yet.
123
126
 
124
127
  ## License
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "verbaly",
3
- "version": "0.13.0",
3
+ "version": "0.13.1",
4
4
  "description": "Effortless i18n — write natural text, ship type-safe, tree-shakeable translations.",
5
5
  "keywords": [
6
6
  "i18n",