@i18n-micro/types-generator
@i18n-micro/types-generator
Type generator for i18n-micro translation keys. Automatically generates TypeScript types from JSON translation files.
Installation
npm install -D @i18n-micro/types-generator
# or
pnpm add -D @i18n-micro/types-generator
# or
yarn add -D @i18n-micro/types-generator
Usage
Nuxt
Add to nuxt.config.ts:
export default defineNuxtConfig({
modules: ['nuxt-i18n-micro', '@i18n-micro/types-generator/nuxt'],
})
Vite/Vue
Add to vite.config.ts:
import { I18nTypesPlugin } from '@i18n-micro/types-generator'
export default defineConfig({
plugins: [
I18nTypesPlugin({
srcDir: 'src',
translationDir: 'locales',
}),
],
})
Features
- 🔍 Automatic type generation from JSON files
- ✅ Full type safety for translation keys
- 🎯 IDE autocomplete support
- 🔄 Hot reload on file changes
- 🚀 Zero runtime overhead
Documentation
See full documentation for detailed usage and examples.
License
MIT
Related Packages
Version History
| Version | Released | License |
|---|---|---|
| 1.1.10 | MIT | |
| 1.1.9 | MIT | |
| 1.1.8 | MIT | |
| 1.1.7 | MIT | |
| 1.1.6 | MIT | |
| 1.1.5 | MIT | |
| 1.1.4 | MIT | |
| 1.1.3 | MIT | |
| 1.1.2 | MIT | |
| 1.1.1 | MIT | |
| 1.1.0 | MIT | |
| 1.0.1 | MIT | |
| 1.0.0 | MIT |