Skip to content

Commit 6a24d7b

Browse files
committed
chore: release v1.0.0 - initial stable version with features and improvements
1 parent 0a222bb commit 6a24d7b

File tree

3 files changed

+676
-197
lines changed

3 files changed

+676
-197
lines changed

CHANGELOG.md

Lines changed: 123 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -2,101 +2,151 @@
22

33
All notable changes to `@devwizard/laravel-localizer-vue` will be documented in this file.
44

5-
## v0.0.7 - 2025-11-09
5+
## v1.0.0 - 2025-11-09
66

7-
### 🔄 Major Update - Alignment with React Version
7+
### 🎉 Initial Stable Release
88

9-
- **Breaking Change**: Renamed `useTranslation` to `useLocalizer` for consistency with React version
10-
- No backward compatibility - all imports must be updated
11-
- Function signature and API remain the same
9+
This is the first stable release of Laravel Localizer Vue, providing seamless integration between Laravel translations and Vue 3 applications.
1210

13-
- **File Structure**: Reorganized to match React package structure
14-
- Created `src/` directory for all source files
15-
- Moved `composables/useTranslation.ts` to `src/useLocalizer.ts`
16-
- Renamed `vite-plugin.ts` to `src/vite-plugin-laravel-localizer.ts`
11+
### ✨ Features
1712

18-
- **Translation Loading**: Updated to use `window.localizer` object (consistent with React version)
19-
- Changed from `window.__LARAVEL_LOCALIZER_TRANSLATIONS__` to `window.localizer.translations`
20-
- Better integration with bootstrap.ts initialization
21-
- Synchronous translation loading for improved performance
13+
#### useLocalizer Composable
2214

23-
- **Vite Plugin Improvements**: Updated to match React implementation
24-
- Simplified plugin structure using `minimatch` for pattern matching
25-
- Better error handling and logging
26-
- Non-blocking command execution
27-
- Changed from `watch` option to `patterns` option for consistency
28-
- Removed debounce functionality for faster regeneration
29-
- Uses `handleHotUpdate` hook instead of `configureServer`
15+
A powerful Vue 3 composable for accessing Laravel translations with full TypeScript support and reactivity:
3016

31-
- **Dependencies**: Added `minimatch` for glob pattern matching
17+
- **Translation Functions**
18+
- `__()` - Main translation function with placeholder replacement and fallback support
19+
- `trans()` - Alias for `__()` (Laravel compatibility)
20+
- `lang()` - Alias for `__()` (Laravel compatibility)
21+
- `has()` - Check if translation key exists
22+
- `choice()` - Pluralization support with replacement variables
3223

33-
- **Documentation**: Updated README to match React version structure
34-
- Added bootstrap.ts initialization section
35-
- Updated Vite plugin options documentation
36-
- Improved setup instructions
37-
- All examples now use `useLocalizer`
24+
- **Reactive Locale Information**
25+
- `locale` - ComputedRef for current locale code (e.g., 'en', 'fr')
26+
- `dir` - ComputedRef for text direction ('ltr' or 'rtl')
27+
- `availableLocales` - ComputedRef for available locales with metadata
28+
- `translations` - ComputedRef for all translations for current locale
3829

39-
### 🐛 Bug Fixes
30+
#### Placeholder Replacement
4031

41-
- Fixed translation initialization warnings
42-
- Improved error messages for missing translations
32+
- Supports both `:placeholder` and `{placeholder}` formats
33+
- Multiple placeholders in single string
34+
- Numeric and string replacements
35+
- Nested placeholder support
4336

44-
---
37+
#### Pluralization
4538

46-
## v0.0.1 - 2025-11-09
39+
- Laravel-compatible pluralization format
40+
- Support for zero, one, and many forms
41+
- Placeholder replacement in pluralized strings
42+
- Custom count-based rules
4743

48-
### 🎉 Initial Beta Release
44+
#### Vite Plugin
4945

50-
- **useTranslation Composable**: Vue 3 Composition API for accessing Laravel translations
51-
- `__()` - Main translation function with replacements and fallback
52-
- `trans()` - Alias for `__()`
53-
- `lang()` - Alias for `__()`
54-
- `has()` - Check if translation key exists
55-
- `choice()` - Pluralization support
56-
- `locale` - Reactive current locale code (ComputedRef)
57-
- `dir` - Reactive text direction (ComputedRef)
58-
- `availableLocales` - Reactive available locales with metadata (ComputedRef)
59-
- `translations` - Reactive all translations for current locale (ComputedRef)
60-
61-
- **Vite Plugin**: Automatic TypeScript generation
62-
- Watches `lang/**` directory for changes
63-
- Debounced regeneration (300ms)
64-
- Runs `php artisan localizer:generate --all` automatically
65-
- Zero configuration required
66-
67-
- **TypeScript Support**: Full type safety
68-
- Comprehensive interfaces for all types
69-
- IntelliSense support in IDEs
70-
- Strict mode compatible
71-
72-
- **Inertia.js Integration**: Seamless integration with Inertia.js
73-
- Works with both Inertia v1 and v2
74-
- Supports Vue 3.0+
75-
- Automatic page props detection
46+
Automatic TypeScript generation with hot module replacement:
7647

77-
### 📚 Documentation
48+
- Watches language files for changes
49+
- Non-blocking command execution
50+
- Configurable watch patterns
51+
- Debug logging option
52+
- Integrates with Laravel Artisan commands
7853

79-
- Comprehensive README with usage examples
80-
- API documentation with TypeScript interfaces
81-
- Migration guide from v1 to v2
54+
#### Inertia.js Integration
8255

83-
### 🧪 Testing
56+
Seamless integration with Inertia.js:
8457

85-
- Vitest configuration
86-
- Comprehensive test suite with 100% coverage
87-
- Vue Test Utils for component testing
88-
- ESM module support
58+
- Automatic locale detection from page props
59+
- Reactive locale updates
60+
- Shared locale data
61+
- RTL support via page props
8962

90-
### 🛠️ Development Tools
63+
### ⚛️ Vue 3 Composition API
9164

92-
- ESLint configuration with TypeScript and Vue rules
93-
- Prettier for code formatting
94-
- tsup for building and bundling
95-
- GitHub Actions for CI/CD
65+
- Fully reactive with Vue computed refs
66+
- Works with `<script setup>` syntax
67+
- Composable pattern for reusability
68+
- Automatic reactivity tracking
69+
- No manual watchers needed
70+
71+
### 🎯 TypeScript Support
72+
73+
- Full type definitions
74+
- IntelliSense support in IDEs
75+
- Type-safe placeholder replacements
76+
- Strict mode compatible
77+
- Exported types for custom implementations
78+
- ComputedRef types for reactive values
79+
80+
### 🧪 Testing
81+
82+
- Comprehensive test suite with Vitest
83+
- Vue Test Utils integration
84+
- 100% code coverage
85+
- Mock Inertia.js integration
86+
- Example test patterns
9687

9788
### 📦 Package Configuration
9889

99-
- ESM-only distribution
90+
- ESM-only distribution (modern bundlers)
10091
- Tree-shakeable exports
92+
- Separate entry points for composable and Vite plugin
93+
- Proper peer dependencies
94+
- Side-effect free
95+
96+
### 🔧 Build System
97+
98+
- Built with tsup for optimal bundling
99+
- Source maps for debugging
100+
- Minified production builds
101+
- Declaration files included
102+
103+
### 📚 Documentation
104+
105+
- Complete README with examples
106+
- API reference
107+
- Setup guide
108+
- Integration examples
109+
- TypeScript usage patterns
110+
- Composition API examples
111+
112+
### 🔗 Dependencies
113+
114+
- Vue 3.0+ (peer dependency)
115+
- Inertia.js v1 or v2 (peer dependency)
116+
- Vite 5+ (peer dependency for plugin)
117+
- `minimatch` for pattern matching in Vite plugin
118+
119+
### ⚡ Performance
120+
121+
- Computed refs for optimal reactivity
122+
- Cached locale data
123+
- Optimized re-renders
124+
- Lazy evaluation
125+
126+
### 🎨 Developer Experience
127+
128+
- Hot module replacement in development
129+
- Automatic regeneration on file changes
130+
- Clear error messages
131+
- Debug mode for troubleshooting
132+
- Vue DevTools integration
133+
134+
### 📝 Requirements
135+
136+
- Node.js 16+
137+
- Vue 3.0+
138+
- Inertia.js v1 or v2
139+
- Laravel Localizer backend package
140+
141+
### 🔄 Migration from Beta
142+
143+
This release consolidates all beta features into a stable API. Key changes from beta versions:
144+
145+
- Renamed `useTranslation` to `useLocalizer` for consistency
146+
- Uses `window.localizer.translations` for global translation access
147+
- Improved Vite plugin with better pattern matching
148+
- Enhanced TypeScript definitions
149+
- All reactive values are now ComputedRef types
150+
101151
- Proper package.json exports field
102152
- Peer dependencies: Vue 3+, Inertia v1/v2, Vite 5+

0 commit comments

Comments
 (0)