@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/README.md +82 -527
- package/dist/emotive-mascot-3d-elementals.js +1 -1
- package/dist/emotive-mascot-3d-elementals.umd.js +1 -1
- package/dist/emotive-mascot-3d.js +1 -1
- package/dist/emotive-mascot-3d.umd.js +1 -1
- package/docs/README.md +263 -0
- package/package.json +4 -5
- /package/{THIRD-PARTY-LICENSES.md โ docs/THIRD-PARTY-LICENSES.md} +0 -0
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.
|
|
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",
|
|
File without changes
|