@oalacea/daemon 0.5.0 → 0.6.0
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/LICENSE +23 -23
- package/README.md +147 -141
- package/bin/Dockerfile +75 -74
- package/dist/cli/cli.d.ts +42 -0
- package/dist/cli/cli.d.ts.map +1 -0
- package/dist/cli/cli.js +89 -0
- package/dist/cli/cli.js.map +1 -0
- package/dist/cli/commands/detect.command.d.ts +39 -0
- package/dist/cli/commands/detect.command.d.ts.map +1 -0
- package/dist/cli/commands/detect.command.js +111 -0
- package/dist/cli/commands/detect.command.js.map +1 -0
- package/dist/cli/commands/index.d.ts +14 -0
- package/dist/cli/commands/index.d.ts.map +1 -0
- package/dist/cli/commands/index.js +11 -0
- package/dist/cli/commands/index.js.map +1 -0
- package/dist/cli/commands/init.command.d.ts +41 -0
- package/dist/cli/commands/init.command.d.ts.map +1 -0
- package/dist/cli/commands/init.command.js +111 -0
- package/dist/cli/commands/init.command.js.map +1 -0
- package/dist/cli/commands/test.command.d.ts +58 -0
- package/dist/cli/commands/test.command.d.ts.map +1 -0
- package/dist/cli/commands/test.command.js +180 -0
- package/dist/cli/commands/test.command.js.map +1 -0
- package/dist/cli/index.d.ts +8 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +10 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/core/config/daemon.config.d.ts +32 -0
- package/dist/core/config/daemon.config.d.ts.map +1 -0
- package/dist/core/config/daemon.config.js +83 -0
- package/dist/core/config/daemon.config.js.map +1 -0
- package/dist/core/config/index.d.ts +5 -0
- package/dist/core/config/index.d.ts.map +1 -0
- package/dist/core/config/index.js +5 -0
- package/dist/core/config/index.js.map +1 -0
- package/dist/core/constants.d.ts +36 -0
- package/dist/core/constants.d.ts.map +1 -0
- package/dist/core/constants.js +56 -0
- package/dist/core/constants.js.map +1 -0
- package/dist/core/types/common.types.d.ts +250 -0
- package/dist/core/types/common.types.d.ts.map +1 -0
- package/dist/core/types/common.types.js +7 -0
- package/dist/core/types/common.types.js.map +1 -0
- package/dist/core/types/detection.types.d.ts +232 -0
- package/dist/core/types/detection.types.d.ts.map +1 -0
- package/dist/core/types/detection.types.js +22 -0
- package/dist/core/types/detection.types.js.map +1 -0
- package/dist/core/types/docker.types.d.ts +322 -0
- package/dist/core/types/docker.types.d.ts.map +1 -0
- package/dist/core/types/docker.types.js +7 -0
- package/dist/core/types/docker.types.js.map +1 -0
- package/dist/core/types/index.d.ts +11 -0
- package/dist/core/types/index.d.ts.map +1 -0
- package/dist/core/types/index.js +7 -0
- package/dist/core/types/index.js.map +1 -0
- package/dist/core/types/project.types.d.ts +74 -0
- package/dist/core/types/project.types.d.ts.map +1 -0
- package/dist/core/types/project.types.js +7 -0
- package/dist/core/types/project.types.js.map +1 -0
- package/dist/core/types/shared.types.d.ts +118 -0
- package/dist/core/types/shared.types.d.ts.map +1 -0
- package/dist/core/types/shared.types.js +7 -0
- package/dist/core/types/shared.types.js.map +1 -0
- package/dist/core/types/test.types.d.ts +230 -0
- package/dist/core/types/test.types.d.ts.map +1 -0
- package/dist/core/types/test.types.js +7 -0
- package/dist/core/types/test.types.js.map +1 -0
- package/dist/services/detection/__tests__/framework-detector.test.d.ts +5 -0
- package/dist/services/detection/__tests__/framework-detector.test.d.ts.map +1 -0
- package/dist/services/detection/__tests__/framework-detector.test.js +52 -0
- package/dist/services/detection/__tests__/framework-detector.test.js.map +1 -0
- package/dist/services/detection/framework-detector.d.ts +179 -0
- package/dist/services/detection/framework-detector.d.ts.map +1 -0
- package/dist/services/detection/framework-detector.js +636 -0
- package/dist/services/detection/framework-detector.js.map +1 -0
- package/dist/services/detection/index.d.ts +10 -0
- package/dist/services/detection/index.d.ts.map +1 -0
- package/dist/services/detection/index.js +7 -0
- package/dist/services/detection/index.js.map +1 -0
- package/dist/services/docker/__tests__/docker-manager.test.d.ts +5 -0
- package/dist/services/docker/__tests__/docker-manager.test.d.ts.map +1 -0
- package/dist/services/docker/__tests__/docker-manager.test.js +67 -0
- package/dist/services/docker/__tests__/docker-manager.test.js.map +1 -0
- package/dist/services/docker/docker-manager.d.ts +157 -0
- package/dist/services/docker/docker-manager.d.ts.map +1 -0
- package/dist/services/docker/docker-manager.js +516 -0
- package/dist/services/docker/docker-manager.js.map +1 -0
- package/dist/services/docker/index.d.ts +9 -0
- package/dist/services/docker/index.d.ts.map +1 -0
- package/dist/services/docker/index.js +9 -0
- package/dist/services/docker/index.js.map +1 -0
- package/dist/services/index.d.ts +10 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +8 -0
- package/dist/services/index.js.map +1 -0
- package/dist/shared/errors/__tests__/base.error.test.d.ts +5 -0
- package/dist/shared/errors/__tests__/base.error.test.d.ts.map +1 -0
- package/dist/shared/errors/__tests__/base.error.test.js +61 -0
- package/dist/shared/errors/__tests__/base.error.test.js.map +1 -0
- package/dist/shared/errors/__tests__/command.error.test.d.ts +5 -0
- package/dist/shared/errors/__tests__/command.error.test.d.ts.map +1 -0
- package/dist/shared/errors/__tests__/command.error.test.js +62 -0
- package/dist/shared/errors/__tests__/command.error.test.js.map +1 -0
- package/dist/shared/errors/__tests__/file.error.test.d.ts +5 -0
- package/dist/shared/errors/__tests__/file.error.test.d.ts.map +1 -0
- package/dist/shared/errors/__tests__/file.error.test.js +75 -0
- package/dist/shared/errors/__tests__/file.error.test.js.map +1 -0
- package/dist/shared/errors/__tests__/index.test.d.ts +5 -0
- package/dist/shared/errors/__tests__/index.test.d.ts.map +1 -0
- package/dist/shared/errors/__tests__/index.test.js +62 -0
- package/dist/shared/errors/__tests__/index.test.js.map +1 -0
- package/dist/shared/errors/__tests__/validation.error.test.d.ts +5 -0
- package/dist/shared/errors/__tests__/validation.error.test.d.ts.map +1 -0
- package/dist/shared/errors/__tests__/validation.error.test.js +79 -0
- package/dist/shared/errors/__tests__/validation.error.test.js.map +1 -0
- package/dist/shared/errors/base.error.d.ts +54 -0
- package/dist/shared/errors/base.error.d.ts.map +1 -0
- package/dist/shared/errors/base.error.js +85 -0
- package/dist/shared/errors/base.error.js.map +1 -0
- package/dist/shared/errors/command.error.d.ts +58 -0
- package/dist/shared/errors/command.error.d.ts.map +1 -0
- package/dist/shared/errors/command.error.js +102 -0
- package/dist/shared/errors/command.error.js.map +1 -0
- package/dist/shared/errors/detection.error.d.ts +42 -0
- package/dist/shared/errors/detection.error.d.ts.map +1 -0
- package/dist/shared/errors/detection.error.js +82 -0
- package/dist/shared/errors/detection.error.js.map +1 -0
- package/dist/shared/errors/docker.error.d.ts +142 -0
- package/dist/shared/errors/docker.error.d.ts.map +1 -0
- package/dist/shared/errors/docker.error.js +172 -0
- package/dist/shared/errors/docker.error.js.map +1 -0
- package/dist/shared/errors/file.error.d.ts +66 -0
- package/dist/shared/errors/file.error.d.ts.map +1 -0
- package/dist/shared/errors/file.error.js +93 -0
- package/dist/shared/errors/file.error.js.map +1 -0
- package/dist/shared/errors/index.d.ts +56 -0
- package/dist/shared/errors/index.d.ts.map +1 -0
- package/dist/shared/errors/index.js +86 -0
- package/dist/shared/errors/index.js.map +1 -0
- package/dist/shared/errors/validation.error.d.ts +67 -0
- package/dist/shared/errors/validation.error.d.ts.map +1 -0
- package/dist/shared/errors/validation.error.js +97 -0
- package/dist/shared/errors/validation.error.js.map +1 -0
- package/dist/shared/templates/index.d.ts +2 -0
- package/dist/shared/templates/index.d.ts.map +1 -0
- package/dist/shared/templates/index.js +2 -0
- package/dist/shared/templates/index.js.map +1 -0
- package/dist/shared/templates/prompt-builder.d.ts +2 -0
- package/dist/shared/templates/prompt-builder.d.ts.map +1 -0
- package/dist/shared/templates/prompt-builder.js +2 -0
- package/dist/shared/templates/prompt-builder.js.map +1 -0
- package/dist/shared/templates/template-engine.d.ts +2 -0
- package/dist/shared/templates/template-engine.d.ts.map +1 -0
- package/dist/shared/templates/template-engine.js +2 -0
- package/dist/shared/templates/template-engine.js.map +1 -0
- package/dist/shared/utils/__tests__/command-executor.test.d.ts +5 -0
- package/dist/shared/utils/__tests__/command-executor.test.d.ts.map +1 -0
- package/dist/shared/utils/__tests__/command-executor.test.js +45 -0
- package/dist/shared/utils/__tests__/command-executor.test.js.map +1 -0
- package/dist/shared/utils/__tests__/file-helper.test.d.ts +5 -0
- package/dist/shared/utils/__tests__/file-helper.test.d.ts.map +1 -0
- package/dist/shared/utils/__tests__/file-helper.test.js +71 -0
- package/dist/shared/utils/__tests__/file-helper.test.js.map +1 -0
- package/dist/shared/utils/__tests__/logger.test.d.ts +5 -0
- package/dist/shared/utils/__tests__/logger.test.d.ts.map +1 -0
- package/dist/shared/utils/__tests__/logger.test.js +83 -0
- package/dist/shared/utils/__tests__/logger.test.js.map +1 -0
- package/dist/shared/utils/command-executer.d.ts +2 -0
- package/dist/shared/utils/command-executer.d.ts.map +1 -0
- package/dist/shared/utils/command-executer.js +2 -0
- package/dist/shared/utils/command-executer.js.map +1 -0
- package/dist/shared/utils/command-executor.d.ts +255 -0
- package/dist/shared/utils/command-executor.d.ts.map +1 -0
- package/dist/shared/utils/command-executor.js +287 -0
- package/dist/shared/utils/command-executor.js.map +1 -0
- package/dist/shared/utils/file-helper.d.ts +86 -0
- package/dist/shared/utils/file-helper.d.ts.map +1 -0
- package/dist/shared/utils/file-helper.js +323 -0
- package/dist/shared/utils/file-helper.js.map +1 -0
- package/dist/shared/utils/index.d.ts +9 -0
- package/dist/shared/utils/index.d.ts.map +1 -0
- package/dist/shared/utils/index.js +9 -0
- package/dist/shared/utils/index.js.map +1 -0
- package/dist/shared/utils/logger.d.ts +163 -0
- package/dist/shared/utils/logger.d.ts.map +1 -0
- package/dist/shared/utils/logger.js +389 -0
- package/dist/shared/utils/logger.js.map +1 -0
- package/package.json +53 -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/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 +0 -38
- package/agents/deps-analyzer.js +0 -366
- package/agents/detector.js +0 -570
- package/agents/fix-engine.js +0 -305
- package/agents/lighthouse-scanner.js +0 -405
- package/agents/perf-analyzer.js +0 -294
- package/agents/perf-front-analyzer.js +0 -229
- package/agents/test-generator.js +0 -387
- package/agents/test-runner.js +0 -318
- package/bin/cli.js +0 -449
- package/lib/config.js +0 -250
- package/lib/docker.js +0 -207
- package/lib/reporter.js +0 -297
- package/scripts/dev.js +0 -106
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.
|
package/bin/Dockerfile
CHANGED
|
@@ -1,74 +1,75 @@
|
|
|
1
|
-
# Daemon - Testing Tools Container
|
|
2
|
-
FROM node:20-slim
|
|
3
|
-
|
|
4
|
-
LABEL maintainer="Yanis"
|
|
5
|
-
LABEL description="Daemon - Automated testing tools for web applications"
|
|
6
|
-
|
|
7
|
-
# Install system dependencies for Playwright and wget with SSL
|
|
8
|
-
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
9
|
-
ca-certificates \
|
|
10
|
-
libnss3 \
|
|
11
|
-
libnspr4 \
|
|
12
|
-
libatk1.0-0 \
|
|
13
|
-
libatk-bridge2.0-0 \
|
|
14
|
-
libcups2 \
|
|
15
|
-
libdrm2 \
|
|
16
|
-
libxkbcommon0 \
|
|
17
|
-
libxcomposite1 \
|
|
18
|
-
libxdamage1 \
|
|
19
|
-
libxfixes3 \
|
|
20
|
-
libxrandr2 \
|
|
21
|
-
libgbm1 \
|
|
22
|
-
libpango-1.0-0 \
|
|
23
|
-
libcairo2 \
|
|
24
|
-
libasound2 \
|
|
25
|
-
libatspi2.0-0 \
|
|
26
|
-
libxshmfence1 \
|
|
27
|
-
wget \
|
|
28
|
-
&& rm -rf /var/lib/apt/lists/*
|
|
29
|
-
|
|
30
|
-
# Install Playwright browsers
|
|
31
|
-
RUN npx playwright install --with-deps chromium
|
|
32
|
-
|
|
33
|
-
# Install testing tools globally
|
|
34
|
-
RUN npm install -g \
|
|
35
|
-
vitest \
|
|
36
|
-
@vitest/ui \
|
|
37
|
-
@playwright/test \
|
|
38
|
-
@vitejs/plugin-react \
|
|
39
|
-
@testing-library/react \
|
|
40
|
-
@testing-library/jest-dom \
|
|
41
|
-
@testing-library/user-event \
|
|
42
|
-
@testing-library/vue \
|
|
43
|
-
@testing-library/svelte \
|
|
44
|
-
@solidjs/testing-library \
|
|
45
|
-
@vue/test-utils \
|
|
46
|
-
happy-dom
|
|
47
|
-
|
|
48
|
-
# Install k6 for performance testing
|
|
49
|
-
ARG TARGETARCH=amd64
|
|
50
|
-
RUN ARCH=$([ "$TARGETARCH" = "arm64" ] && echo "arm64" || echo "amd64") && \
|
|
51
|
-
wget -q "https://github.com/grafana/k6/releases/download/v1.5.0/k6-v1.5.0-linux-${ARCH}.tar.gz" -O /tmp/k6.tar.gz && \
|
|
52
|
-
tar -xzf /tmp/k6.tar.gz -C /tmp && \
|
|
53
|
-
mv /tmp/k6-v1.5.0-linux-${ARCH}/k6 /usr/local/bin/ && \
|
|
54
|
-
rm -rf /tmp/k6.tar.gz /tmp/k6-v1.5.0-linux-${ARCH}
|
|
55
|
-
|
|
56
|
-
# Install additional tools
|
|
57
|
-
RUN npm install -g \
|
|
58
|
-
supertest \
|
|
59
|
-
msw \
|
|
60
|
-
prisma \
|
|
61
|
-
lighthouse
|
|
62
|
-
|
|
63
|
-
# Create non-root user for security
|
|
64
|
-
# Use UID 1001 to avoid conflict with existing node user (UID 1000)
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
1
|
+
# Daemon - Testing Tools Container
|
|
2
|
+
FROM node:20-slim
|
|
3
|
+
|
|
4
|
+
LABEL maintainer="Yanis"
|
|
5
|
+
LABEL description="Daemon - Automated testing tools for web applications"
|
|
6
|
+
|
|
7
|
+
# Install system dependencies for Playwright and wget with SSL
|
|
8
|
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
9
|
+
ca-certificates \
|
|
10
|
+
libnss3 \
|
|
11
|
+
libnspr4 \
|
|
12
|
+
libatk1.0-0 \
|
|
13
|
+
libatk-bridge2.0-0 \
|
|
14
|
+
libcups2 \
|
|
15
|
+
libdrm2 \
|
|
16
|
+
libxkbcommon0 \
|
|
17
|
+
libxcomposite1 \
|
|
18
|
+
libxdamage1 \
|
|
19
|
+
libxfixes3 \
|
|
20
|
+
libxrandr2 \
|
|
21
|
+
libgbm1 \
|
|
22
|
+
libpango-1.0-0 \
|
|
23
|
+
libcairo2 \
|
|
24
|
+
libasound2 \
|
|
25
|
+
libatspi2.0-0 \
|
|
26
|
+
libxshmfence1 \
|
|
27
|
+
wget \
|
|
28
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
29
|
+
|
|
30
|
+
# Install Playwright browsers
|
|
31
|
+
RUN npx playwright install --with-deps chromium
|
|
32
|
+
|
|
33
|
+
# Install testing tools globally
|
|
34
|
+
RUN npm install -g \
|
|
35
|
+
vitest \
|
|
36
|
+
@vitest/ui \
|
|
37
|
+
@playwright/test \
|
|
38
|
+
@vitejs/plugin-react \
|
|
39
|
+
@testing-library/react \
|
|
40
|
+
@testing-library/jest-dom \
|
|
41
|
+
@testing-library/user-event \
|
|
42
|
+
@testing-library/vue \
|
|
43
|
+
@testing-library/svelte \
|
|
44
|
+
@solidjs/testing-library \
|
|
45
|
+
@vue/test-utils \
|
|
46
|
+
happy-dom
|
|
47
|
+
|
|
48
|
+
# Install k6 for performance testing
|
|
49
|
+
ARG TARGETARCH=amd64
|
|
50
|
+
RUN ARCH=$([ "$TARGETARCH" = "arm64" ] && echo "arm64" || echo "amd64") && \
|
|
51
|
+
wget -q "https://github.com/grafana/k6/releases/download/v1.5.0/k6-v1.5.0-linux-${ARCH}.tar.gz" -O /tmp/k6.tar.gz && \
|
|
52
|
+
tar -xzf /tmp/k6.tar.gz -C /tmp && \
|
|
53
|
+
mv /tmp/k6-v1.5.0-linux-${ARCH}/k6 /usr/local/bin/ && \
|
|
54
|
+
rm -rf /tmp/k6.tar.gz /tmp/k6-v1.5.0-linux-${ARCH}
|
|
55
|
+
|
|
56
|
+
# Install additional tools
|
|
57
|
+
RUN npm install -g \
|
|
58
|
+
supertest \
|
|
59
|
+
msw \
|
|
60
|
+
prisma \
|
|
61
|
+
lighthouse
|
|
62
|
+
|
|
63
|
+
# Create non-root user for security
|
|
64
|
+
# Use UID 1001 to avoid conflict with existing node user (UID 1000)
|
|
65
|
+
# Check if 'daemon' user exists first (node:20-slim already has it)
|
|
66
|
+
RUN id -u daemon >/dev/null 2>&1 || useradd -m -u 1001 -s /bin/bash daemon && \
|
|
67
|
+
mkdir -p /app && \
|
|
68
|
+
chown -R daemon:daemon /app
|
|
69
|
+
|
|
70
|
+
# Switch to non-root user
|
|
71
|
+
USER daemon
|
|
72
|
+
WORKDIR /app
|
|
73
|
+
|
|
74
|
+
# Keep container alive for docker exec
|
|
75
|
+
CMD ["sleep", "infinity"]
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Daemon CLI - Main CLI Class
|
|
4
|
+
*
|
|
5
|
+
* @module cli/cli
|
|
6
|
+
*/
|
|
7
|
+
export interface CliContext {
|
|
8
|
+
/** Project directory */
|
|
9
|
+
projectDir: string;
|
|
10
|
+
/** Verbose mode */
|
|
11
|
+
verbose?: boolean;
|
|
12
|
+
/** Silent mode */
|
|
13
|
+
silent?: boolean;
|
|
14
|
+
/** Force mode */
|
|
15
|
+
force?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Main CLI class for Daemon
|
|
19
|
+
*
|
|
20
|
+
* Handles command routing and execution.
|
|
21
|
+
*/
|
|
22
|
+
export declare class DaemonCli {
|
|
23
|
+
private readonly commands;
|
|
24
|
+
constructor();
|
|
25
|
+
/**
|
|
26
|
+
* Run the CLI with provided arguments
|
|
27
|
+
*/
|
|
28
|
+
run(argv: string[]): Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* Show help message
|
|
31
|
+
*/
|
|
32
|
+
private showHelp;
|
|
33
|
+
/**
|
|
34
|
+
* Get CLI context from environment and flags
|
|
35
|
+
*/
|
|
36
|
+
createContext(options: {
|
|
37
|
+
verbose?: boolean;
|
|
38
|
+
silent?: boolean;
|
|
39
|
+
force?: boolean;
|
|
40
|
+
}): CliContext;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=cli.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/cli/cli.ts"],"names":[],"mappings":";AACA;;;;GAIG;AASH,MAAM,WAAW,UAAU;IACzB,wBAAwB;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,mBAAmB;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,kBAAkB;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,iBAAiB;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;;GAIG;AACH,qBAAa,SAAS;IACpB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA8D;;IASvF;;OAEG;IACG,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IA2BxC;;OAEG;IACH,OAAO,CAAC,QAAQ;IAyBhB;;OAEG;IACH,aAAa,CAAC,OAAO,EAAE;QACrB,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,KAAK,CAAC,EAAE,OAAO,CAAC;KACjB,GAAG,UAAU;CAQf"}
|
package/dist/cli/cli.js
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Daemon CLI - Main CLI Class
|
|
4
|
+
*
|
|
5
|
+
* @module cli/cli
|
|
6
|
+
*/
|
|
7
|
+
import { createLogger } from '../shared/utils/logger.js';
|
|
8
|
+
import { InitCommand } from './commands/init.command.js';
|
|
9
|
+
import { DetectCommand } from './commands/detect.command.js';
|
|
10
|
+
import { TestCommand } from './commands/test.command.js';
|
|
11
|
+
const logger = createLogger('DaemonCli');
|
|
12
|
+
/**
|
|
13
|
+
* Main CLI class for Daemon
|
|
14
|
+
*
|
|
15
|
+
* Handles command routing and execution.
|
|
16
|
+
*/
|
|
17
|
+
export class DaemonCli {
|
|
18
|
+
commands;
|
|
19
|
+
constructor() {
|
|
20
|
+
this.commands = new Map();
|
|
21
|
+
this.commands.set('init', new InitCommand());
|
|
22
|
+
this.commands.set('detect', new DetectCommand());
|
|
23
|
+
this.commands.set('test', new TestCommand());
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Run the CLI with provided arguments
|
|
27
|
+
*/
|
|
28
|
+
async run(argv) {
|
|
29
|
+
const args = argv.slice(2); // Skip node and script path
|
|
30
|
+
if (args.length === 0 || args[0] === '--help' || args[0] === '-h') {
|
|
31
|
+
this.showHelp();
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const commandName = args[0] ?? '';
|
|
35
|
+
const commandArgs = args.slice(1);
|
|
36
|
+
const command = this.commands.get(commandName);
|
|
37
|
+
if (!command) {
|
|
38
|
+
logger.error(`Unknown command: ${commandName}`);
|
|
39
|
+
this.showHelp();
|
|
40
|
+
process.exit(1);
|
|
41
|
+
}
|
|
42
|
+
try {
|
|
43
|
+
await command.execute(commandArgs);
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
logger.error('Command execution failed', error);
|
|
47
|
+
process.exit(1);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Show help message
|
|
52
|
+
*/
|
|
53
|
+
showHelp() {
|
|
54
|
+
console.log(`
|
|
55
|
+
Daemon v0.6.0 - AI-powered automated testing toolkit
|
|
56
|
+
|
|
57
|
+
USAGE:
|
|
58
|
+
daemon <command> [options]
|
|
59
|
+
|
|
60
|
+
COMMANDS:
|
|
61
|
+
init Initialize project with Daemon
|
|
62
|
+
detect Detect project framework and tools
|
|
63
|
+
test Generate and run tests
|
|
64
|
+
|
|
65
|
+
OPTIONS:
|
|
66
|
+
--help, -h Show this help message
|
|
67
|
+
--version Show version number
|
|
68
|
+
|
|
69
|
+
EXAMPLES:
|
|
70
|
+
daemon init
|
|
71
|
+
daemon detect
|
|
72
|
+
daemon test --coverage
|
|
73
|
+
|
|
74
|
+
For more information, visit: https://github.com/Pamacea/daemon
|
|
75
|
+
`);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Get CLI context from environment and flags
|
|
79
|
+
*/
|
|
80
|
+
createContext(options) {
|
|
81
|
+
return {
|
|
82
|
+
projectDir: process.cwd(),
|
|
83
|
+
verbose: options.verbose ?? false,
|
|
84
|
+
silent: options.silent ?? false,
|
|
85
|
+
force: options.force ?? false,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=cli.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli/cli.ts"],"names":[],"mappings":";AACA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAEzD,MAAM,MAAM,GAAG,YAAY,CAAC,WAAW,CAAC,CAAC;AAazC;;;;GAIG;AACH,MAAM,OAAO,SAAS;IACH,QAAQ,CAA8D;IAEvF;QACE,IAAI,CAAC,QAAQ,GAAG,IAAI,GAAG,EAA0D,CAAC;QAClF,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,WAAW,EAAE,CAAC,CAAC;QAC7C,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,aAAa,EAAE,CAAC,CAAC;QACjD,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,WAAW,EAAE,CAAC,CAAC;IAC/C,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,GAAG,CAAC,IAAc;QACtB,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,4BAA4B;QAExD,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;YAClE,IAAI,CAAC,QAAQ,EAAE,CAAC;YAChB,OAAO;QACT,CAAC;QAED,MAAM,WAAW,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QAClC,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAElC,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QAE/C,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,CAAC,KAAK,CAAC,oBAAoB,WAAW,EAAE,CAAC,CAAC;YAChD,IAAI,CAAC,QAAQ,EAAE,CAAC;YAChB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QAED,IAAI,CAAC;YACH,MAAM,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QACrC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,KAAK,CAAC,0BAA0B,EAAE,KAAK,CAAC,CAAC;YAChD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;IAED;;OAEG;IACK,QAAQ;QACd,OAAO,CAAC,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;KAqBX,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,aAAa,CAAC,OAIb;QACC,OAAO;YACL,UAAU,EAAE,OAAO,CAAC,GAAG,EAAE;YACzB,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,KAAK;YACjC,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,KAAK;YAC/B,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,KAAK;SAC9B,CAAC;IACJ,CAAC;CACF"}
|