@oalacea/daemon 0.5.0 → 0.5.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/CHANGELOG.md +46 -38
- package/LICENSE +23 -23
- package/README.md +147 -141
- package/agents/deps-analyzer.js +366 -366
- package/agents/detector.js +570 -570
- package/agents/fix-engine.js +305 -305
- package/agents/lighthouse-scanner.js +405 -405
- package/agents/perf-analyzer.js +294 -294
- package/agents/perf-front-analyzer.js +229 -229
- package/agents/test-generator.js +387 -387
- package/agents/test-runner.js +318 -318
- package/bin/Dockerfile +75 -74
- package/bin/cli.js +449 -449
- package/lib/config.js +250 -250
- package/lib/docker.js +207 -207
- package/lib/reporter.js +297 -297
- package/package.json +34 -34
- package/prompts/DEPS_EFFICIENCY.md +558 -558
- package/prompts/E2E.md +491 -491
- package/prompts/EXECUTE.md +1060 -1060
- package/prompts/INTEGRATION_API.md +484 -484
- package/prompts/INTEGRATION_DB.md +425 -425
- package/prompts/PERF_API.md +433 -433
- package/prompts/PERF_DB.md +430 -430
- package/prompts/PERF_FRONT.md +357 -357
- package/prompts/REMEDIATION.md +482 -482
- package/prompts/UNIT.md +260 -260
- package/scripts/dev.js +106 -106
- package/templates/README.md +38 -38
- package/templates/k6/load-test.js +54 -54
- package/templates/playwright/e2e.spec.ts +61 -61
- package/templates/vitest/angular-component.test.ts +38 -38
- package/templates/vitest/api.test.ts +51 -51
- package/templates/vitest/component.test.ts +27 -27
- package/templates/vitest/hook.test.ts +36 -36
- package/templates/vitest/solid-component.test.ts +34 -34
- package/templates/vitest/svelte-component.test.ts +33 -33
- package/templates/vitest/vue-component.test.ts +39 -39
package/CHANGELOG.md
CHANGED
|
@@ -1,38 +1,46 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- Additional framework support
|
|
12
|
+
- Enhanced test patterns
|
|
13
|
+
- Performance benchmarking comparisons
|
|
14
|
+
- CI/CD integration templates
|
|
15
|
+
|
|
16
|
+
## [1.0.0] - 2026-02-09
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
- Initial stable release of Daemon - AI-powered automated test generation
|
|
20
|
+
- CLI tool: `npx @oalacea/daemon@latest`
|
|
21
|
+
- Automated framework detection (Next.js, Remix, SvelteKit, Vite, etc.)
|
|
22
|
+
- Database detection (Prisma, Drizzle, Neon, Supabase, local Postgres)
|
|
23
|
+
- Unit test generation (components, hooks, utils, validators, stores)
|
|
24
|
+
- Integration test generation (API routes, database operations with transaction rollback)
|
|
25
|
+
- E2E test generation with Playwright (user flows, forms, navigation)
|
|
26
|
+
- Backend performance testing with k6 (API load testing, DB benchmarks)
|
|
27
|
+
- Frontend performance testing with Lighthouse (Core Web Vitals, LCP, FID, CLS)
|
|
28
|
+
- Dependency analysis (TanStack Router, React Query, Prisma, Zustand, React Compiler)
|
|
29
|
+
- Docker toolkit with pre-configured tools (~500 MB)
|
|
30
|
+
- Vitest, Testing Library (React, Vue, Svelte, Solid), Happy DOM
|
|
31
|
+
- Playwright (Chromium) for E2E testing
|
|
32
|
+
- k6 for load testing
|
|
33
|
+
- Lighthouse for performance metrics
|
|
34
|
+
- Comprehensive reporting with coverage and performance data
|
|
35
|
+
- Cross-platform support (Linux, macOS, Windows)
|
|
36
|
+
- Automatic test failure categorization and fix suggestions
|
|
37
|
+
- MIT License
|
|
38
|
+
- Complete documentation
|
|
39
|
+
|
|
40
|
+
## [1.0.0-alpha] - 2025-02-07
|
|
41
|
+
|
|
42
|
+
### Added
|
|
43
|
+
- Initial alpha release
|
|
44
|
+
- Core framework and database detection
|
|
45
|
+
- Basic test generation templates
|
|
46
|
+
- Docker container setup
|
package/LICENSE
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
# Daemon - License
|
|
2
|
-
|
|
3
|
-
MIT License
|
|
4
|
-
|
|
5
|
-
Copyright (c) 2025 Yanis
|
|
6
|
-
|
|
7
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
9
|
-
in the Software without restriction, including without limitation the rights
|
|
10
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
12
|
-
furnished to do so, subject to the following conditions:
|
|
13
|
-
|
|
14
|
-
The above copyright notice and this permission notice shall be included in all
|
|
15
|
-
copies or substantial portions of the Software.
|
|
16
|
-
|
|
17
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
-
SOFTWARE.
|
|
1
|
+
# Daemon - License
|
|
2
|
+
|
|
3
|
+
MIT License
|
|
4
|
+
|
|
5
|
+
Copyright (c) 2025 Yanis
|
|
6
|
+
|
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
in the Software without restriction, including without limitation the rights
|
|
10
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
furnished to do so, subject to the following conditions:
|
|
13
|
+
|
|
14
|
+
The above copyright notice and this permission notice shall be included in all
|
|
15
|
+
copies or substantial portions of the Software.
|
|
16
|
+
|
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,141 +1,147 @@
|
|
|
1
|
-
# Daemon
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
|
53
|
-
|
|
54
|
-
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
|
59
|
-
|
|
60
|
-
|
|
|
61
|
-
|
|
|
62
|
-
|
|
|
63
|
-
|
|
|
64
|
-
|
|
|
65
|
-
|
|
|
66
|
-
|
|
|
67
|
-
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
✓
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
###
|
|
113
|
-
|
|
114
|
-
```bash
|
|
115
|
-
docker exec daemon-tools npm test -- Button.test.ts
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
###
|
|
119
|
-
|
|
120
|
-
```bash
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
#
|
|
128
|
-
docker exec daemon-tools npx lighthouse http://host.docker.internal:3000 --
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
1
|
+
# Daemon
|
|
2
|
+
|
|
3
|
+
[](https://opensource.org/licenses/MIT)
|
|
4
|
+
[](https://github.com/Pamacea/daemon/releases/latest)
|
|
5
|
+
[](https://github.com/Pamacea/daemon/actions)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
AI-powered automated test generation and remediation for web applications.
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# From your project directory
|
|
15
|
+
npx --yes @oalacea/daemon@latest
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
First run installs the testing toolkit (~500 MB Docker image, takes 2-3 minutes).
|
|
19
|
+
|
|
20
|
+
## What You Need
|
|
21
|
+
|
|
22
|
+
- **Docker** - [Install](https://docs.docker.com/get-docker/)
|
|
23
|
+
- **AI coding agent** - Claude Code, Cursor, Windsurf, Aider, Codex...
|
|
24
|
+
|
|
25
|
+
## Features
|
|
26
|
+
|
|
27
|
+
| Category | Features |
|
|
28
|
+
|----------|----------|
|
|
29
|
+
| **Unit Tests** | Components, hooks, utils, validators, stores |
|
|
30
|
+
| **Integration Tests** | API routes, database operations (with transaction rollback) |
|
|
31
|
+
| **E2E Tests** | User flows, form interactions, navigation (Playwright) |
|
|
32
|
+
| **Backend Performance** | API load testing (k6), DB query benchmarks |
|
|
33
|
+
| **Frontend Performance** | Core Web Vitals, LCP, FID, CLS (Lighthouse) |
|
|
34
|
+
| **Dependency Analysis** | TanStack Router, React Query, Prisma, Zustand, React Compiler |
|
|
35
|
+
|
|
36
|
+
## How It Works
|
|
37
|
+
|
|
38
|
+
1. **Analyze** - Auto-detects your framework, database, and existing tests
|
|
39
|
+
2. **Generate** - Creates tests based on your code patterns
|
|
40
|
+
3. **Execute** - Runs tests inside Docker container
|
|
41
|
+
4. **Fix** - Analyzes failures and applies corrections
|
|
42
|
+
5. **Report** - Provides comprehensive coverage and performance report
|
|
43
|
+
|
|
44
|
+
## Included Tools
|
|
45
|
+
|
|
46
|
+
The Docker toolkit includes:
|
|
47
|
+
|
|
48
|
+
| Category | Tools |
|
|
49
|
+
|----------|-------|
|
|
50
|
+
| Testing | Vitest, @testing-library/react, @testing-library/vue, @testing-library/svelte, @solidjs/testing-library, happy-dom |
|
|
51
|
+
| E2E | Playwright (Chromium) |
|
|
52
|
+
| Backend Performance | k6 (load testing) |
|
|
53
|
+
| Frontend Performance | Lighthouse (Core Web Vitals) |
|
|
54
|
+
| Utilities | supertest, MSW, @prisma/cli |
|
|
55
|
+
|
|
56
|
+
## Framework Support
|
|
57
|
+
|
|
58
|
+
| Framework | Detection | Status |
|
|
59
|
+
|-----------|-----------|--------|
|
|
60
|
+
| Next.js | ✅ | Full support |
|
|
61
|
+
| Remix | ✅ | Full support |
|
|
62
|
+
| SvelteKit | ✅ | Full support |
|
|
63
|
+
| Nuxt | ✅ | Full support |
|
|
64
|
+
| Astro | ✅ | Full support |
|
|
65
|
+
| Gatsby | ✅ | Full support |
|
|
66
|
+
| Vite | ✅ | Full support |
|
|
67
|
+
| Solid | ✅ | Full support |
|
|
68
|
+
| Vue | ✅ | Full support |
|
|
69
|
+
| Svelte | ✅ | Full support |
|
|
70
|
+
| Angular | ✅ | Full support |
|
|
71
|
+
| React Native | ✅ | Basic support |
|
|
72
|
+
| Express | ✅ | Full support |
|
|
73
|
+
| NestJS | ✅ | Full support |
|
|
74
|
+
|
|
75
|
+
## Output Example
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
✓ Unit Tests: 45 created, 42 passing, 3 fixed
|
|
79
|
+
✓ Integration: 12 created, 12 passing
|
|
80
|
+
✓ E2E: 8 created, 7 passing, 1 requires manual review
|
|
81
|
+
✓ Backend Performance: API p95 = 145ms (PASS)
|
|
82
|
+
✓ Frontend Performance: Lighthouse 85/100 (PASS)
|
|
83
|
+
- LCP: 2.1s ✓ (target: <2.5s)
|
|
84
|
+
- FID: 56ms ✓ (target: <100ms)
|
|
85
|
+
- CLS: 0.05 ✓ (target: <0.1)
|
|
86
|
+
✓ Dependencies: 3 improvements suggested
|
|
87
|
+
|
|
88
|
+
## Summary
|
|
89
|
+
Total Tests: 245
|
|
90
|
+
Passing: 238
|
|
91
|
+
Failing: 2 (requires manual review)
|
|
92
|
+
Coverage: 84%
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Safety
|
|
96
|
+
|
|
97
|
+
- Always use transaction rollback for database tests
|
|
98
|
+
- Never modify production data
|
|
99
|
+
- Git integration for safe rollbacks
|
|
100
|
+
- Non-destructive testing modes available
|
|
101
|
+
|
|
102
|
+
## Troubleshooting
|
|
103
|
+
|
|
104
|
+
### Rebuild toolkit image
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
docker rm -f daemon-tools
|
|
108
|
+
docker rmi daemon-tools
|
|
109
|
+
npx --yes @oalacea/daemon@latest
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Run specific test
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
docker exec daemon-tools npm test -- Button.test.ts
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Debug test
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
docker exec daemon-tools npm test -- Button.test.ts --reporter=verbose
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Run Lighthouse audit
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
# Quick performance check
|
|
128
|
+
docker exec daemon-tools npx lighthouse http://host.docker.internal:3000 --output=json --output=html
|
|
129
|
+
|
|
130
|
+
# Mobile audit
|
|
131
|
+
docker exec daemon-tools npx lighthouse http://host.docker.internal:3000 --form-factor=mobile
|
|
132
|
+
|
|
133
|
+
# All categories
|
|
134
|
+
docker exec daemon-tools npx lighthouse http://host.docker.internal:3000 --only-categories=performance,accessibility,best-practices,seo
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## Related
|
|
138
|
+
|
|
139
|
+
- **Guardian** - Security testing package: `npx @oalacea/guardian`
|
|
140
|
+
|
|
141
|
+
## License
|
|
142
|
+
|
|
143
|
+
MIT - Use at your own risk.
|
|
144
|
+
|
|
145
|
+
## Credits
|
|
146
|
+
|
|
147
|
+
Inspired by the need for comprehensive automated testing in modern web development.
|