@joshtol/emotive-engine 3.4.0 โ†’ 3.4.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.
package/docs/README.md ADDED
@@ -0,0 +1,263 @@
1
+ # Emotive Engine Documentation
2
+
3
+ Welcome to the Emotive Engine documentation! This guide will help you understand the architecture, APIs, and best practices for working with the Emotive Engine.
4
+
5
+ ## ๐Ÿ“š Documentation Index
6
+
7
+ ### Architecture Documentation
8
+
9
+ - **[Gesture Animator Refactoring](./architecture/gesture-animator-refactoring.md)**
10
+ - Complete overview of the god object refactoring
11
+ - Design patterns and architectural decisions
12
+ - Benefits and metrics
13
+ - Migration guide for contributors
14
+
15
+ - **[Gesture Animator Diagram](./architecture/gesture-animator-diagram.md)**
16
+ - Visual architecture diagrams
17
+ - Class relationship diagrams
18
+ - Data flow diagrams
19
+ - Testing architecture
20
+
21
+ ### API Reference
22
+
23
+ - **[Gesture Animators API](./api/gesture-animators-api.md)**
24
+ - Complete API documentation for all 8 animator classes
25
+ - Method signatures and parameters
26
+ - Return value specifications
27
+ - Usage examples and best practices
28
+
29
+ ### Integration Guides
30
+
31
+ - **[LLM Integration Guide](./LLM_INTEGRATION.md)** โญ NEW
32
+ - Connect Claude, GPT, Gemini, or any LLM to control the mascot
33
+ - Natural language `feel()` API
34
+ - System prompt templates
35
+ - Vocabulary reference (~1400 synonyms)
36
+
37
+ ### Guides
38
+
39
+ - [Testing Guide](./guides/testing.md) *(coming soon)*
40
+ - [Contributing Guide](./guides/contributing.md) *(coming soon)*
41
+ - [Performance Optimization](./guides/performance.md) *(coming soon)*
42
+
43
+ ## ๐Ÿ—๏ธ Architecture Overview
44
+
45
+ The Emotive Engine uses a modular architecture with specialized components:
46
+
47
+ ```
48
+ EmotiveEngine
49
+ โ”œโ”€โ”€ EmotiveMascot (Main entry point)
50
+ โ”œโ”€โ”€ EmotiveRenderer (Rendering pipeline)
51
+ โ”‚ โ”œโ”€โ”€ GestureAnimator (Animation coordinator)
52
+ โ”‚ โ”‚ โ”œโ”€โ”€ PhysicalGestureAnimator
53
+ โ”‚ โ”‚ โ”œโ”€โ”€ VisualEffectAnimator
54
+ โ”‚ โ”‚ โ”œโ”€โ”€ BreathGestureAnimator
55
+ โ”‚ โ”‚ โ”œโ”€โ”€ MovementGestureAnimator
56
+ โ”‚ โ”‚ โ”œโ”€โ”€ ShapeTransformAnimator
57
+ โ”‚ โ”‚ โ”œโ”€โ”€ ExpressionGestureAnimator
58
+ โ”‚ โ”‚ โ”œโ”€โ”€ DirectionalGestureAnimator
59
+ โ”‚ โ”‚ โ””โ”€โ”€ ComplexAnimationAnimator
60
+ โ”‚ โ”œโ”€โ”€ ParticleSystem
61
+ โ”‚ โ””โ”€โ”€ SpecialEffects
62
+ โ”œโ”€โ”€ EmotiveStateMachine (State management)
63
+ โ”œโ”€โ”€ ShapeMorpher (Shape morphing)
64
+ โ”œโ”€โ”€ SoundSystem (Audio)
65
+ โ””โ”€โ”€ PluginSystem (Extensions)
66
+ ```
67
+
68
+ ## ๐ŸŽฏ Quick Links
69
+
70
+ ### For Users
71
+ - [Getting Started](../README.md#getting-started)
72
+ - [Examples](../examples/)
73
+ - [API Overview](./api/gesture-animators-api.md)
74
+
75
+ ### For Contributors
76
+ - [Architecture Overview](./architecture/gesture-animator-refactoring.md)
77
+ - [Code Structure](./architecture/gesture-animator-diagram.md)
78
+ - [Testing Guidelines](./guides/testing.md) *(coming soon)*
79
+
80
+ ### For Maintainers
81
+ - [Refactoring History](./architecture/gesture-animator-refactoring.md#metrics)
82
+ - [Performance Metrics](./guides/performance.md) *(coming soon)*
83
+ - [Release Process](./guides/releases.md) *(coming soon)*
84
+
85
+ ## ๐Ÿ“Š Recent Improvements
86
+
87
+ ### October 2025 - GestureAnimator Refactoring
88
+
89
+ **Major architectural refactoring** to improve code quality and maintainability:
90
+
91
+ - โœ… Extracted 8 specialized animator classes from 1,472-line god object
92
+ - โœ… Reduced GestureAnimator by 43% (1,472 โ†’ 832 lines)
93
+ - โœ… Added 187 comprehensive unit tests (100% coverage)
94
+ - โœ… Maintained 100% backward compatibility
95
+ - โœ… Improved code organization and modularity
96
+
97
+ **Key Benefits:**
98
+ - Single Responsibility Principle applied throughout
99
+ - Easier to understand, test, and extend
100
+ - Clear separation of concerns
101
+ - Better performance characteristics
102
+
103
+ [Read more about the refactoring โ†’](./architecture/gesture-animator-refactoring.md)
104
+
105
+ ## ๐Ÿ”ง Development Tools
106
+
107
+ ### Running Tests
108
+ ```bash
109
+ npm test # Run all tests
110
+ npm test -- AnimatorName # Run specific test suite
111
+ npm run test:coverage # Generate coverage report
112
+ ```
113
+
114
+ ### Building
115
+ ```bash
116
+ npm run build # Full build
117
+ npm run build:lean # Lean build (no examples)
118
+ npm run build:dev # Development build with source maps
119
+ ```
120
+
121
+ ### Linting
122
+ ```bash
123
+ npm run lint # Check code style
124
+ npm run lint:fix # Auto-fix issues
125
+ ```
126
+
127
+ ## ๐Ÿ“– Code Examples
128
+
129
+ ### Basic Gesture Usage
130
+
131
+ ```javascript
132
+ import EmotiveMascot from '@joshtol/emotive-engine';
133
+
134
+ // Initialize mascot
135
+ const mascot = new EmotiveMascot({
136
+ containerId: 'mascot-container',
137
+ size: 'medium'
138
+ });
139
+
140
+ // Trigger a gesture
141
+ mascot.startGesture('bounce');
142
+
143
+ // Chain gestures
144
+ mascot.startGesture('bounce').then(() => {
145
+ mascot.startGesture('flash');
146
+ });
147
+ ```
148
+
149
+ ### Custom Animation Sequence
150
+
151
+ ```javascript
152
+ // Multiple gestures with timing
153
+ async function greetingSequence() {
154
+ await mascot.startGesture('wave');
155
+ await mascot.startGesture('nod');
156
+ await mascot.startGesture('sparkle');
157
+ }
158
+
159
+ greetingSequence();
160
+ ```
161
+
162
+ ### Using Individual Animators
163
+
164
+ ```javascript
165
+ // Direct access to specialized animators
166
+ const renderer = mascot.renderer;
167
+ const gestureAnimator = renderer.gestureAnimator;
168
+
169
+ // Access specific animator
170
+ const physicalAnimator = gestureAnimator.physicalGestureAnimator;
171
+
172
+ // Use animator method directly
173
+ const anim = {
174
+ params: {
175
+ frequency: 4,
176
+ amplitude: 30
177
+ }
178
+ };
179
+ const transform = physicalAnimator.applyBounce(anim, 0.5);
180
+ ```
181
+
182
+ ## ๐Ÿงช Testing Philosophy
183
+
184
+ The Emotive Engine follows Test-Driven Development (TDD) principles:
185
+
186
+ 1. **RED**: Write failing tests first
187
+ 2. **GREEN**: Implement minimum code to pass
188
+ 3. **REFACTOR**: Clean up and optimize
189
+
190
+ All code maintains 100% test coverage with comprehensive test suites for each component.
191
+
192
+ ## ๐ŸŽจ Design Principles
193
+
194
+ ### SOLID Principles
195
+
196
+ - **Single Responsibility**: Each class has one well-defined purpose
197
+ - **Open/Closed**: Open for extension, closed for modification
198
+ - **Liskov Substitution**: Components can be swapped for testing
199
+ - **Interface Segregation**: Minimal, focused interfaces
200
+ - **Dependency Inversion**: Depend on abstractions, not concretions
201
+
202
+ ### Code Quality Standards
203
+
204
+ - **Comprehensive Testing**: 100% test coverage
205
+ - **Clear Documentation**: Every public API documented
206
+ - **Consistent Style**: ESLint enforced code style
207
+ - **Performance**: Optimized for 60fps animations
208
+ - **Accessibility**: WCAG 2.1 AA compliant
209
+
210
+ ## ๐Ÿ“ˆ Metrics
211
+
212
+ ### Code Quality
213
+ | Metric | Value |
214
+ |--------|-------|
215
+ | Test Coverage | 100% |
216
+ | Total Tests | 2,827 |
217
+ | Test Success Rate | 100% |
218
+ | ESLint Issues | 0 |
219
+
220
+ ### Performance
221
+ | Metric | Target | Actual |
222
+ |--------|--------|--------|
223
+ | Frame Rate | 60 FPS | 60 FPS โœ… |
224
+ | Bundle Size (lean) | < 100KB | ~95KB โœ… |
225
+ | Load Time | < 1s | ~800ms โœ… |
226
+
227
+ ## ๐Ÿค Contributing
228
+
229
+ We welcome contributions! Please see our contributing guidelines:
230
+
231
+ 1. Fork the repository
232
+ 2. Create a feature branch
233
+ 3. Write tests for your changes
234
+ 4. Implement your feature
235
+ 5. Ensure all tests pass
236
+ 6. Submit a pull request
237
+
238
+ [Contributing Guide โ†’](./guides/contributing.md) *(coming soon)*
239
+
240
+ ## ๐Ÿ“ License
241
+
242
+ [View License](../LICENSE)
243
+
244
+ ## ๐Ÿ”— Related Resources
245
+
246
+ - [GitHub Repository](https://github.com/joshtol/emotive-engine)
247
+ - [Issue Tracker](https://github.com/joshtol/emotive-engine/issues)
248
+ - [Discussions](https://github.com/joshtol/emotive-engine/discussions)
249
+
250
+ ---
251
+
252
+ ## ๐Ÿ“… Documentation Changelog
253
+
254
+ ### October 2025
255
+ - Added comprehensive gesture animator architecture documentation
256
+ - Created visual architecture diagrams
257
+ - Documented complete API for all 8 animator classes
258
+ - Added code examples and best practices
259
+
260
+ ---
261
+
262
+ *Last updated: October 29, 2025*
263
+ *Documentation version: 1.0.0*
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@joshtol/emotive-engine",
4
- "version": "3.4.0",
4
+ "version": "3.4.1",
5
5
  "description": "Open-source animation engine for AI-controlled emotional visualizations with musical time synchronization",
6
6
  "main": "dist/emotive-mascot.umd.js",
7
7
  "module": "dist/mascot.js",
@@ -56,12 +56,11 @@
56
56
  "assets/emotive-engine-full-BW.svg",
57
57
  "README.md",
58
58
  "LICENSE.md",
59
- "THIRD-PARTY-LICENSES.md"
59
+ "docs/THIRD-PARTY-LICENSES.md"
60
60
  ],
61
61
  "scripts": {
62
62
  "build": "rollup -c --environment NODE_ENV:production && node scripts/copy-built-files.js",
63
63
  "build:dev": "rollup -c --environment NODE_ENV:development",
64
- "build:split": "rollup -c rollup.split.config.js --environment NODE_ENV:production",
65
64
  "build:watch": "rollup -c -w --environment NODE_ENV:development",
66
65
  "dev": "cd site && npm run dev",
67
66
  "serve": "cd site && python -m http.server 5000",
@@ -70,8 +69,8 @@
70
69
  "copy-files": "node scripts/copy-built-files.js",
71
70
  "build:docs": "node scripts/build-docs.js",
72
71
  "optimize": "node scripts/optimize-bundle.js",
73
- "docs": "jsdoc -c jsdoc.json",
74
- "docs:api": "typedoc",
72
+ "docs": "jsdoc -c docs/jsdoc.json",
73
+ "docs:api": "typedoc --options docs/typedoc.json",
75
74
  "test": "vitest run",
76
75
  "test:watch": "vitest",
77
76
  "test:coverage": "vitest run --coverage",