Skip to content

Commit bbcbc5a

Browse files
cursoragents00d
andcommitted
docs(integrations): link package playgrounds
Add a Playgrounds table on the integrations index and tip callouts on each package page with GitHub links and monorepo `dev` commands so the existing packages/*/playground apps are easy to find and run. Co-authored-by: Pavel Kuzmin <Virus191288@gmail.com>
1 parent e87eaf0 commit bbcbc5a

8 files changed

Lines changed: 77 additions & 7 deletions

File tree

docs/integrations/astro-package.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ The `@i18n-micro/astro` package provides a lightweight, high-performance interna
2222
- **DevTools Integration** - Optional development tools via Vite plugin
2323
- **SEO Optimized** - Automatic meta tags and hreflang generation
2424

25+
::: tip Playground
26+
Astro SSR app with middleware, islands (Vue/React/Svelte), and DevTools UI:
27+
28+
[`packages/astro/playground`](https://github.com/s00d/nuxt-i18n-micro/tree/main/packages/astro/playground)`pnpm -C packages/astro dev`
29+
:::
30+
2531
## Installation
2632

2733
Install the package using your preferred package manager:
@@ -3016,6 +3022,7 @@ const { t } = useI18n(Astro)
30163022

30173023
## Resources
30183024

3025+
- **Playground**: [`packages/astro/playground`](https://github.com/s00d/nuxt-i18n-micro/tree/main/packages/astro/playground)
30193026
- **Repository**: [https://github.com/s00d/nuxt-i18n-micro](https://github.com/s00d/nuxt-i18n-micro)
30203027
- **Documentation**: [https://s00d.github.io/nuxt-i18n-micro/](https://s00d.github.io/nuxt-i18n-micro/)
30213028

docs/integrations/index.md

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,20 @@ Unlike the full Nuxt module, these packages:
4141
- **[Types Generator](./types-generator.md)** (`@i18n-micro/types-generator`) - For generating TypeScript types from translation files
4242
- **[DevTools UI Package](./devtools-ui-package.md)** (`@i18n-micro/devtools-ui`) - Development tools for managing translations
4343

44+
## Playgrounds
45+
46+
Each integration ships a small app under `packages/<name>/playground` so you can see wiring end-to-end (createI18n / provider, router adapter, components, locale switch) without building a project from scratch. Clone the monorepo, `pnpm install`, then run the package’s `dev` script.
47+
48+
| Package | Playground | Run from monorepo root |
49+
| ------- | ---------- | ---------------------- |
50+
| Vue | [`packages/vue/playground`](https://github.com/s00d/nuxt-i18n-micro/tree/main/packages/vue/playground) | `pnpm -C packages/vue dev` |
51+
| React | [`packages/react/playground`](https://github.com/s00d/nuxt-i18n-micro/tree/main/packages/react/playground) | `pnpm -C packages/react dev` |
52+
| Preact | [`packages/preact/playground`](https://github.com/s00d/nuxt-i18n-micro/tree/main/packages/preact/playground) | `pnpm -C packages/preact dev` |
53+
| Solid | [`packages/solid/playground`](https://github.com/s00d/nuxt-i18n-micro/tree/main/packages/solid/playground) | `pnpm -C packages/solid dev` |
54+
| Astro | [`packages/astro/playground`](https://github.com/s00d/nuxt-i18n-micro/tree/main/packages/astro/playground) | `pnpm -C packages/astro dev` |
55+
| VitePress | [`packages/vitepress/playground`](https://github.com/s00d/nuxt-i18n-micro/tree/main/packages/vitepress/playground) | `pnpm -C packages/vitepress/playground dev` |
56+
| Node.js | [`packages/node/playground`](https://github.com/s00d/nuxt-i18n-micro/tree/main/packages/node/playground) | `pnpm -C packages/node dev` |
57+
4458
## Core Components
4559

4660
All framework packages include the following essential components:
@@ -275,19 +289,22 @@ All packages provide:
275289

276290
## Getting Started
277291

278-
1. **Choose your package** - Select the package for your framework
279-
2. **Install the package** - Use your preferred package manager
280-
3. **Read the documentation** - Each package has detailed setup instructions
281-
4. **Implement router adapter** - If you need routing features, implement the adapter
282-
5. **Start translating** - Use components and methods to add translations
292+
1. **Skim a playground** - Open the [table above](#playgrounds) for your stack to see a full setup
293+
2. **Choose your package** - Select the package for your framework
294+
3. **Install the package** - Use your preferred package manager
295+
4. **Read the documentation** - Each package has detailed setup instructions
296+
5. **Implement router adapter** - If you need routing features, implement the adapter
297+
6. **Start translating** - Use components and methods to add translations
283298

284299
For detailed setup instructions, see the documentation for your specific package:
285300

286301
- [Vue Package Documentation](./vue-package.md)
287302
- [React Package Documentation](./react-package.md)
303+
- [Preact Package Documentation](./preact-package.md)
288304
- [Solid Package Documentation](./solid-package.md)
289305
- [Astro Package Documentation](./astro-package.md)
290306
- [VitePress Package Documentation](./vitepress-package.md)
307+
- [VitePress Package Documentation](./vitepress-package.md)
291308

292309
## Comparison with Nuxt Module
293310

docs/integrations/nodejs-package.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ outline: 'deep'
88

99
Use `@i18n-micro/node` to add i18n translations to any Node.js application, CLI tool, or backend service. This package provides the same translation logic as the Nuxt module, but for pure Node.js environments.
1010

11+
::: tip Playground
12+
CLI script that loads a locales folder and exercises `t` / `tc` / routes / reload:
13+
14+
[`packages/node/playground`](https://github.com/s00d/nuxt-i18n-micro/tree/main/packages/node/playground)`pnpm -C packages/node dev`
15+
:::
16+
1117
## 📦 Installation
1218

1319
```bash
@@ -540,6 +546,7 @@ export default defineEventHandler(async (event) => {
540546

541547
## 📚 Related Documentation
542548

549+
- **[Playground](https://github.com/s00d/nuxt-i18n-micro/tree/main/packages/node/playground)** - Runnable Node demo in the monorepo
543550
- **[Folder Structure](../guide/folder-structure.md)** - Learn about translation file organization
544551
- **[Server Side Translations](../guide/server-side-translations.md)** - Nuxt server-side usage
545552
- **[API Reference](../api/methods.md)** - Complete method documentation

docs/integrations/preact-package.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ The `@i18n-micro/preact` package provides a lightweight, high-performance intern
2424

2525
**Note:** The built-in router adapter (`createPreactRouterAdapter` / `createBrowserHistoryAdapter`) uses the native History API and works with any router that listens to `popstate` events (e.g., `wouter-preact`, `preact-router`). For custom routing needs, you can create your own adapter.
2626

27+
::: tip Playground
28+
Pure Preact demo with history adapter, pages, and components:
29+
30+
[`packages/preact/playground`](https://github.com/s00d/nuxt-i18n-micro/tree/main/packages/preact/playground)`pnpm -C packages/preact dev`
31+
:::
32+
2733
## Installation
2834

2935
Install the package using your preferred package manager:
@@ -1948,6 +1954,7 @@ export function Home() {
19481954

19491955
## Resources
19501956

1957+
- **Playground**: [`packages/preact/playground`](https://github.com/s00d/nuxt-i18n-micro/tree/main/packages/preact/playground)
19511958
- **Repository**: [https://github.com/s00d/nuxt-i18n-micro](https://github.com/s00d/nuxt-i18n-micro)
19521959
- **Documentation**: [https://s00d.github.io/nuxt-i18n-micro/](https://s00d.github.io/nuxt-i18n-micro/)
19531960

docs/integrations/react-package.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ The `@i18n-micro/react` package provides a lightweight, high-performance interna
2121
- **Router-agnostic** - Works with any router or without a router
2222
- **DevTools Integration** - Vite plugin for managing translations during development
2323

24+
::: tip Playground
25+
Mini React app with React Router, provider setup, pages, and locale switcher:
26+
27+
[`packages/react/playground`](https://github.com/s00d/nuxt-i18n-micro/tree/main/packages/react/playground)`pnpm -C packages/react dev`
28+
:::
29+
2430
## Installation
2531

2632
Install the package using your preferred package manager:
@@ -1931,6 +1937,7 @@ See the "Full Application Setup" example above for a complete router integration
19311937

19321938
## Resources
19331939

1940+
- **Playground**: [`packages/react/playground`](https://github.com/s00d/nuxt-i18n-micro/tree/main/packages/react/playground)
19341941
- **Repository**: [https://github.com/s00d/nuxt-i18n-micro](https://github.com/s00d/nuxt-i18n-micro)
19351942
- **Documentation**: [https://s00d.github.io/nuxt-i18n-micro/](https://s00d.github.io/nuxt-i18n-micro/)
19361943

docs/integrations/solid-package.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ The `@i18n-micro/solid` package provides a lightweight, high-performance interna
2121
- **Router-agnostic** - Works with any router or without a router via `I18nRoutingStrategy` interface
2222
- **DevTools Integration** - Built-in DevTools support for managing translations
2323

24+
::: tip Playground
25+
SolidJS demo with router adapter, pages, and `I18n*` components:
26+
27+
[`packages/solid/playground`](https://github.com/s00d/nuxt-i18n-micro/tree/main/packages/solid/playground)`pnpm -C packages/solid dev`
28+
:::
29+
2430
## Installation
2531

2632
Install the package using your preferred package manager:
@@ -1337,7 +1343,7 @@ i18n.t('greeting', { invalid: 'value' }) // ⚠️ Type error
13371343
13381344
### Complete SPA Example
13391345
1340-
See the playground implementation in `packages/solid/playground/src/` for a complete working example.
1346+
See the [Solid playground](https://github.com/s00d/nuxt-i18n-micro/tree/main/packages/solid/playground) for a complete working example.
13411347
13421348
### Router Integration Example
13431349
@@ -1455,6 +1461,7 @@ const LocaleHandler: Component<{ params: { locale?: string }; children?: unknown
14551461
14561462
## Resources
14571463
1464+
- **Playground**: [`packages/solid/playground`](https://github.com/s00d/nuxt-i18n-micro/tree/main/packages/solid/playground)
14581465
- **Repository**: [https://github.com/s00d/nuxt-i18n-micro](https://github.com/s00d/nuxt-i18n-micro)
14591466
- **Documentation**: [https://s00d.github.io/nuxt-i18n-micro/](https://s00d.github.io/nuxt-i18n-micro/)
14601467

docs/integrations/vitepress-package.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ VitePress i18n is three separate problems. This package only solves **runtime UI
2323
@i18n-micro/vitepress ≠ markdown copier
2424
```
2525

26+
::: tip Playground
27+
Tiny VitePress site with `withI18nMicro`, theme `$t`, and FR locale pages:
28+
29+
[`packages/vitepress/playground`](https://github.com/s00d/nuxt-i18n-micro/tree/main/packages/vitepress/playground)`pnpm -C packages/vitepress/playground dev`
30+
:::
31+
2632
### Compose with other helpers
2733

2834
`withI18n` is already used by [`vitepress-i18n`](https://www.npmjs.com/package/vitepress-i18n). Our helper is intentionally named **`withI18nMicro`**:
@@ -245,6 +251,11 @@ Putting `<I18nSwitcher>` in `nav-bar-content-*` duplicates the control. Prefer p
245251
| `I18nT` / `I18nLink` / `I18nGroup` / `I18nSwitcher` / `useI18n` | Re-exported from `@i18n-micro/vue` |
246252
| `/node``loadMessages` / `loadTranslationBuckets` | Node FS loaders (scripts; prefer `/config` for site config) |
247253

254+
## Resources
255+
256+
- **Playground**: [`packages/vitepress/playground`](https://github.com/s00d/nuxt-i18n-micro/tree/main/packages/vitepress/playground)
257+
- **Repository**: [https://github.com/s00d/nuxt-i18n-micro](https://github.com/s00d/nuxt-i18n-micro)
258+
248259
## License
249260

250261
MIT

docs/integrations/vue-package.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ The `@i18n-micro/vue` package provides a lightweight, high-performance internati
2121
- **Router-agnostic** - Works with any router or without a router
2222
- **DevTools Integration** - Built-in Vue DevTools support for managing translations
2323

24+
::: tip Playground
25+
Runnable SPA (+ optional SSR) with Vue Router, `I18nLink` / `I18nSwitcher`, and page dictionaries:
26+
27+
[`packages/vue/playground`](https://github.com/s00d/nuxt-i18n-micro/tree/main/packages/vue/playground)`pnpm -C packages/vue dev`
28+
:::
29+
2430
## Installation
2531

2632
Install the package using your preferred package manager:
@@ -1328,7 +1334,7 @@ i18n.t('greeting', { invalid: 'value' }) // ⚠️ Type error
13281334

13291335
### Complete SPA Example
13301336

1331-
See the playground implementation in `packages/vue/playground/src/` for a complete working example.
1337+
See the [Vue playground](https://github.com/s00d/nuxt-i18n-micro/tree/main/packages/vue/playground) for a complete working example (`src/` pages, router adapter, SSR entry).
13321338

13331339
### Router Integration Example
13341340

@@ -1432,6 +1438,7 @@ watch(
14321438

14331439
## Resources
14341440

1441+
- **Playground**: [`packages/vue/playground`](https://github.com/s00d/nuxt-i18n-micro/tree/main/packages/vue/playground)
14351442
- **Repository**: [https://github.com/s00d/nuxt-i18n-micro](https://github.com/s00d/nuxt-i18n-micro)
14361443
- **Documentation**: [https://s00d.github.io/nuxt-i18n-micro/](https://s00d.github.io/nuxt-i18n-micro/)
14371444

0 commit comments

Comments
 (0)