react-native-voice-ts 1.0.0 → 1.0.2

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 (41) hide show
  1. package/README.md +914 -83
  2. package/dist/components/MicIcon.d.ts +23 -0
  3. package/dist/components/MicIcon.d.ts.map +1 -0
  4. package/dist/components/MicIcon.js +28 -0
  5. package/dist/components/MicIcon.js.map +1 -0
  6. package/dist/components/VoiceMicrophone.d.ts +93 -0
  7. package/dist/components/VoiceMicrophone.d.ts.map +1 -0
  8. package/dist/components/VoiceMicrophone.js +239 -0
  9. package/dist/components/VoiceMicrophone.js.map +1 -0
  10. package/dist/components/index.d.ts +5 -0
  11. package/dist/components/index.d.ts.map +1 -0
  12. package/dist/components/index.js +3 -0
  13. package/dist/components/index.js.map +1 -0
  14. package/dist/hooks/index.d.ts +3 -0
  15. package/dist/hooks/index.d.ts.map +1 -0
  16. package/dist/hooks/index.js +2 -0
  17. package/dist/hooks/index.js.map +1 -0
  18. package/dist/hooks/useVoiceRecognition.d.ts +89 -0
  19. package/dist/hooks/useVoiceRecognition.d.ts.map +1 -0
  20. package/dist/hooks/useVoiceRecognition.js +227 -0
  21. package/dist/hooks/useVoiceRecognition.js.map +1 -0
  22. package/dist/index.d.ts +4 -0
  23. package/dist/index.d.ts.map +1 -1
  24. package/dist/index.js +4 -0
  25. package/dist/index.js.map +1 -1
  26. package/ios/Voice.xcodeproj/project.xcworkspace/xcuserdata/olumayowadaniel.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  27. package/ios/Voice.xcodeproj/project.xcworkspace/xcuserdata/rudie_shahinian.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  28. package/package.json +25 -7
  29. package/plugin/src/withVoice.ts +74 -0
  30. package/plugin/tsconfig.json +10 -0
  31. package/src/components/MicIcon.tsx +72 -0
  32. package/src/components/VoiceMicrophone.tsx +345 -0
  33. package/src/components/index.ts +4 -0
  34. package/src/hooks/index.ts +5 -0
  35. package/src/hooks/useVoiceRecognition.ts +333 -0
  36. package/src/images/mic.svg +16 -0
  37. package/src/index.ts +15 -0
  38. package/.nvmrc +0 -1
  39. package/.prettierrc +0 -5
  40. package/.releaserc +0 -15
  41. package/MIGRATION_SUMMARY.md +0 -510
package/src/index.ts CHANGED
@@ -497,4 +497,19 @@ export type {
497
497
  Language,
498
498
  } from './VoiceUtilTypes';
499
499
 
500
+ // Export components
501
+ export { VoiceMicrophone, MicIcon, MicOffIcon } from './components';
502
+ export type {
503
+ VoiceMicrophoneProps,
504
+ MicIconProps,
505
+ MicOffIconProps,
506
+ } from './components';
507
+
508
+ // Export hooks
509
+ export { useVoiceRecognition } from './hooks';
510
+ export type {
511
+ UseVoiceRecognitionOptions,
512
+ UseVoiceRecognitionReturn,
513
+ } from './hooks';
514
+
500
515
  export default new RCTVoice();
package/.nvmrc DELETED
@@ -1 +0,0 @@
1
- lts/fermium
package/.prettierrc DELETED
@@ -1,5 +0,0 @@
1
- {
2
- "semi": true,
3
- "singleQuote": true,
4
- "trailingComma": "all"
5
- }
package/.releaserc DELETED
@@ -1,15 +0,0 @@
1
- {
2
- "plugins": [
3
- "@semantic-release/commit-analyzer",
4
- "@semantic-release/release-notes-generator",
5
- "@semantic-release/npm",
6
- "@semantic-release/github",
7
- [
8
- "@semantic-release/git",
9
- {
10
- "assets": "package.json",
11
- "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
12
- }
13
- ]
14
- ]
15
- }
@@ -1,510 +0,0 @@
1
- # 🚀 React Native Voice - Complete Migration & Update Summary
2
-
3
- ## 📋 Overview
4
-
5
- This document summarizes the comprehensive transformation of the React Native Voice package, including rebranding, modernization, and optimization for 2025.
6
-
7
- ---
8
-
9
- ## 🔄 Major Changes
10
-
11
- ### 1. Package Rebranding
12
-
13
- **FROM:**
14
-
15
- - Package Name: `@react-native-voice/voice`
16
- - Repository: `https://github.com/react-native-voice/voice`
17
- - Author: Previous maintainers
18
-
19
- **TO:**
20
-
21
- - Package Name: `react-native-voice-ts`
22
- - Repository: `https://github.com/noorjsdivs/react-native-voice-ts`
23
- - Author: Noor Mohammad (@noorjsdivs)
24
- - License: MIT 2025 Noor Mohammad
25
-
26
- ### 2. Technology Stack Updates
27
-
28
- #### React & React Native
29
-
30
- **FROM:**
31
-
32
- ```json
33
- "react": "18.3.1",
34
- "react-native": "^0.76.9"
35
- ```
36
-
37
- **TO:**
38
-
39
- ```json
40
- "react": "^19.0.0",
41
- "react-native": "^0.76.9",
42
- "peerDependencies": {
43
- "react": ">=18.0.0",
44
- "react-native": ">=0.71.0"
45
- }
46
- ```
47
-
48
- #### TypeScript Configuration
49
-
50
- **FROM:**
51
-
52
- - Target: ES5/ES6
53
- - Basic configuration
54
- - Missing type definitions
55
- - 31 compilation errors
56
-
57
- **TO:**
58
-
59
- - Target: ES2020
60
- - Strict mode enabled
61
- - Complete type definitions
62
- - 0 compilation errors
63
- - Source maps enabled
64
-
65
- #### Dependencies Added
66
-
67
- ```json
68
- "@types/node": "^25.0.3",
69
- "@typescript-eslint/eslint-plugin": "^8.50.1",
70
- "@typescript-eslint/parser": "^8.50.1",
71
- "prettier": "^3.7.4",
72
- "eslint-plugin-react": "^7.37.5",
73
- "eslint-plugin-react-hooks": "^7.0.1",
74
- "eslint-plugin-react-native": "^5.0.0"
75
- ```
76
-
77
- ---
78
-
79
- ## ✨ New Features Added
80
-
81
- ### 1. Permission Management (Android)
82
-
83
- ```typescript
84
- // Check microphone permission
85
- await Voice.checkMicrophonePermission(): Promise<boolean>
86
-
87
- // Request microphone permission
88
- await Voice.requestMicrophonePermission(): Promise<boolean>
89
- ```
90
-
91
- ### 2. Performance Tracking
92
-
93
- ```typescript
94
- // Get recognition duration
95
- Voice.getRecognitionDuration(): number
96
-
97
- // Get last results without re-recognition
98
- Voice.getLastResults(): string[]
99
-
100
- // Check if currently recognizing (synchronous)
101
- Voice.recognizing: boolean
102
- ```
103
-
104
- ### 3. Enhanced State Management
105
-
106
- - `_isRecognizing` - Internal state tracking
107
- - `_lastResults` - Cached results for quick access
108
- - `_recognitionStartTime` - Performance monitoring
109
- - `_debounceTimeout` - Future-ready for optimizations
110
-
111
- ### 4. Improved Error Handling
112
-
113
- - Better error messages
114
- - Proper error types
115
- - Comprehensive error documentation
116
-
117
- ---
118
-
119
- ## 📚 Documentation Updates
120
-
121
- ### Created New Documentation Files
122
-
123
- #### 1. README.md (543 lines)
124
-
125
- **FROM:**
126
-
127
- - Basic installation instructions
128
- - Limited examples
129
- - Missing API documentation
130
-
131
- **TO:**
132
-
133
- - Beautiful header with badges
134
- - Comprehensive feature list
135
- - Platform compatibility table
136
- - 5 complete React Native examples
137
- - Full API reference (35+ methods)
138
- - Custom hook examples
139
- - Troubleshooting guide
140
- - Performance tips
141
-
142
- #### 2. EXAMPLES.md (1,100+ lines) - NEW
143
-
144
- Complete working examples:
145
-
146
- 1. Simple Voice-to-Text
147
- 2. Real-time Transcription with Partial Results
148
- 3. Multi-language Support (9 languages)
149
- 4. Voice Commands Implementation
150
- 5. Permission Handling (Android)
151
- 6. Volume Indicator with Animation
152
- 7. Note Taking App
153
- 8. Custom Hook (useVoiceRecognition)
154
-
155
- #### 3. CONTRIBUTING.md - NEW
156
-
157
- - Contribution guidelines
158
- - Development setup
159
- - Pull request process
160
- - Commit message conventions
161
- - Testing requirements
162
-
163
- #### 4. PUBLISH_CHECKLIST.md - NEW
164
-
165
- - Pre-publish verification steps
166
- - Publishing process
167
- - Post-publish validation
168
- - Troubleshooting guide
169
- - Rollback procedures
170
-
171
- #### 5. PACKAGE_READY.md - NEW
172
-
173
- - Complete package summary
174
- - Feature highlights
175
- - Quality assurance checklist
176
- - Next steps for publishing
177
-
178
- ---
179
-
180
- ## 🛠️ Code Quality Improvements
181
-
182
- ### TypeScript
183
-
184
- **FROM:**
185
-
186
- - 31 compilation errors
187
- - Missing type definitions
188
- - Loose configuration
189
-
190
- **TO:**
191
-
192
- - 0 compilation errors
193
- - Complete type definitions
194
- - Strict TypeScript configuration
195
- - Source maps for debugging
196
-
197
- ### Code Formatting
198
-
199
- **NEW:**
200
-
201
- - Prettier integration
202
- - Consistent code style
203
- - Automated formatting
204
- - Pre-commit hooks ready
205
-
206
- ### Linting
207
-
208
- **FROM:**
209
-
210
- - Basic ESLint setup
211
-
212
- **TO:**
213
-
214
- - ESLint 9.39.2
215
- - TypeScript-specific rules
216
- - React/React Native plugins
217
- - Automated fixing
218
-
219
- ### Build System
220
-
221
- **FROM:**
222
-
223
- - Basic TypeScript compilation
224
-
225
- **TO:**
226
-
227
- - Clean build process
228
- - Plugin building
229
- - Type checking
230
- - Validation scripts
231
- - Development sync
232
-
233
- ---
234
-
235
- ## 📦 Package Configuration
236
-
237
- ### package.json Updates
238
-
239
- #### Scripts Added/Updated
240
-
241
- ```json
242
- "lint": "eslint src/* --fix",
243
- "lint:check": "eslint src/*",
244
- "format": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json}\"",
245
- "format:check": "prettier --check \"src/**/*.{ts,tsx,js,jsx,json}\"",
246
- "type-check": "tsc --noEmit",
247
- "type-check:watch": "tsc --noEmit --watch",
248
- "clean": "rm -rf dist && rm -rf plugin/build",
249
- "validate": "yarn type-check && yarn lint:check && yarn format:check",
250
- "build:watch": "tsc --watch",
251
- "dev-sync": "cp -r ./dist example/node_modules/react-native-voice-ts"
252
- ```
253
-
254
- #### Keywords Optimized (13 keywords)
255
-
256
- ```json
257
- [
258
- "react-native",
259
- "voice",
260
- "speech",
261
- "speech-to-text",
262
- "voice-recognition",
263
- "speech-recognition",
264
- "stt",
265
- "android",
266
- "ios",
267
- "typescript",
268
- "microphone",
269
- "audio",
270
- "transcription"
271
- ]
272
- ```
273
-
274
- ### Files Configuration
275
-
276
- **ADDED:**
277
-
278
- ```json
279
- "files": [
280
- "src",
281
- "dist",
282
- "android",
283
- "ios",
284
- "react-native-voice.podspec",
285
- "app.plugin.js",
286
- "plugin"
287
- ]
288
- ```
289
-
290
- ### .npmignore Configuration
291
-
292
- **UPDATED:**
293
-
294
- - Excludes development files
295
- - Excludes test files
296
- - Excludes example app
297
- - Includes only production essentials
298
-
299
- ---
300
-
301
- ## 🔧 Source Code Updates
302
-
303
- ### src/index.ts
304
-
305
- **CHANGES:**
306
-
307
- 1. Added performance tracking properties
308
- 2. Implemented new permission methods
309
- 3. Enhanced state management
310
- 4. Improved event handler cleanup
311
- 5. Added synchronous state getters
312
- 6. Updated error messages with new package name
313
-
314
- **New Properties:**
315
-
316
- ```typescript
317
- private _isRecognizing: boolean;
318
- private _debounceTimeout: NodeJS.Timeout | null;
319
- private _lastResults: string[];
320
- private _recognitionStartTime: number;
321
- ```
322
-
323
- **New Methods:**
324
-
325
- ```typescript
326
- requestMicrophonePermission(): Promise<boolean>
327
- checkMicrophonePermission(): Promise<boolean>
328
- getRecognitionDuration(): number
329
- getLastResults(): string[]
330
- get recognizing(): boolean
331
- ```
332
-
333
- ### Type Definitions
334
-
335
- **ENHANCED:**
336
-
337
- - VoiceModuleTypes.ts - Complete event types
338
- - VoiceUtilTypes.ts - New utility types
339
- - Full TypeScript support
340
- - Comprehensive JSDoc comments
341
-
342
- ---
343
-
344
- ## 📱 Platform-Specific Updates
345
-
346
- ### iOS (ios/Voice/)
347
-
348
- **STATUS:** Maintained existing functionality
349
-
350
- - Speech framework integration
351
- - Native event handling
352
- - Proper memory management
353
-
354
- ### Android (android/)
355
-
356
- **STATUS:** Maintained existing functionality
357
-
358
- - SpeechRecognizer implementation
359
- - Permission handling
360
- - Background support
361
-
362
- ### Podspec
363
-
364
- **UPDATED:**
365
-
366
- ```ruby
367
- s.source = { :git => "https://github.com/noorjsdivs/react-native-voice-ts.git" }
368
- ```
369
-
370
- ---
371
-
372
- ## 🎯 Import Statement Changes
373
-
374
- **FROM:**
375
-
376
- ```typescript
377
- import Voice from '@react-native-voice/voice';
378
- ```
379
-
380
- **TO:**
381
-
382
- ```typescript
383
- import Voice from 'react-native-voice-ts';
384
- ```
385
-
386
- **Installation:**
387
-
388
- ```bash
389
- # FROM
390
- npm install @react-native-voice/voice
391
-
392
- # TO
393
- npm install react-native-voice-ts
394
- # OR
395
- yarn add react-native-voice-ts
396
- ```
397
-
398
- ---
399
-
400
- ## 📊 Statistics
401
-
402
- ### Code Metrics
403
-
404
- | Metric | Before | After | Change |
405
- | ------------------- | ------ | ------ | --------- |
406
- | TypeScript Errors | 31 | 0 | ✅ -31 |
407
- | Documentation Lines | ~500 | 2,500+ | ✅ +2,000 |
408
- | Code Examples | 2 | 8+ | ✅ +6 |
409
- | Test Scripts | 3 | 12 | ✅ +9 |
410
- | DevDependencies | 10 | 17 | ✅ +7 |
411
- | Keywords | 5 | 13 | ✅ +8 |
412
-
413
- ### Package Size
414
-
415
- - **Compressed:** 65.1 kB
416
- - **Unpacked:** 214.3 kB
417
- - **Total Files:** 50
418
-
419
- ### Feature Additions
420
-
421
- - ✅ 3 new API methods
422
- - ✅ 4 internal performance properties
423
- - ✅ 1 synchronous state getter
424
- - ✅ Enhanced error handling
425
- - ✅ TypeScript strict mode
426
-
427
- ---
428
-
429
- ## 🔒 Quality Assurance
430
-
431
- ### Build Status
432
-
433
- - ✅ TypeScript compilation: PASSING
434
- - ✅ Type checking: PASSING
435
- - ✅ ESLint: PASSING
436
- - ✅ Prettier: PASSING
437
- - ✅ Package verification: PASSING
438
-
439
- ### Test Coverage
440
-
441
- - ✅ Build test
442
- - ✅ Type check test
443
- - ✅ Lint test
444
- - ✅ Format test
445
- - ✅ Package dry-run test
446
-
447
- ---
448
-
449
- ## 🚀 Production Readiness
450
-
451
- ### ✅ Completed
452
-
453
- - [x] TypeScript configuration modernized
454
- - [x] All compilation errors fixed
455
- - [x] Code formatted with Prettier
456
- - [x] ESLint rules applied
457
- - [x] Package name updated everywhere
458
- - [x] Repository URLs updated
459
- - [x] Author information updated
460
- - [x] License updated to 2025
461
- - [x] README completely rewritten
462
- - [x] Examples documentation created
463
- - [x] Contributing guidelines added
464
- - [x] Publish checklist created
465
- - [x] Build artifacts verified
466
- - [x] Type definitions generated
467
- - [x] Source maps created
468
- - [x] npm package verified
469
-
470
- ### 📋 Ready for:
471
-
472
- - ✅ npm publication
473
- - ✅ GitHub release
474
- - ✅ Community use
475
- - ✅ Production applications
476
-
477
- ---
478
-
479
- ## 🎉 Summary
480
-
481
- This package has been completely transformed from a legacy React Native Voice library into a modern, TypeScript-first, production-ready speech-to-text solution:
482
-
483
- 1. **Rebranded** to react-native-voice-ts under new ownership
484
- 2. **Modernized** with React 19 and latest TypeScript
485
- 3. **Enhanced** with new features and performance optimizations
486
- 4. **Documented** with 2,500+ lines of comprehensive guides
487
- 5. **Tested** with zero compilation errors and full validation
488
- 6. **Optimized** for npm discovery with 13 keywords
489
- 7. **Prepared** with complete publishing documentation
490
-
491
- **Total Lines of Code:** 1,800+
492
- **Total Documentation:** 2,500+
493
- **Examples:** 8 complete working examples
494
- **Build Status:** ✅ PRODUCTION READY
495
-
496
- ---
497
-
498
- ## 📞 Contact & Links
499
-
500
- - **Package:** react-native-voice-ts
501
- - **Repository:** https://github.com/noorjsdivs/react-native-voice-ts
502
- - **npm:** https://www.npmjs.com/package/react-native-voice-ts
503
- - **Author:** Noor Mohammad (@noorjsdivs)
504
- - **Email:** noor.jsdivs@gmail.com
505
- - **License:** MIT 2025
506
-
507
- ---
508
-
509
- **Last Updated:** December 23, 2025
510
- **Status:** ✅ **READY FOR NPM PUBLICATION**