@oalacea/daemon 0.7.0 → 0.7.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.
- package/bin/Dockerfile +4 -4
- package/bin/docker-entrypoint.sh +293 -0
- package/package.json +3 -2
package/bin/Dockerfile
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
# Daemon - Testing Tools Container v0.7.
|
|
1
|
+
# Daemon - Testing Tools Container v0.7.2
|
|
2
2
|
FROM node:20-slim
|
|
3
3
|
|
|
4
4
|
LABEL maintainer="Yanis"
|
|
5
|
-
LABEL description="Daemon v0.7.
|
|
6
|
-
LABEL version="0.7.
|
|
5
|
+
LABEL description="Daemon v0.7.2 - Automated testing and quality tools for web applications"
|
|
6
|
+
LABEL version="0.7.2"
|
|
7
7
|
|
|
8
8
|
# ============================================================================
|
|
9
9
|
# ENVIRONMENT VARIABLES
|
|
@@ -57,7 +57,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
|
57
57
|
# Install Rust with rustup for Rust project testing and compilation
|
|
58
58
|
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \
|
|
59
59
|
rustup component add rustfmt clippy rust-analyzer && \
|
|
60
|
-
cargo install cargo-nextest && \
|
|
60
|
+
cargo install --locked cargo-nextest && \
|
|
61
61
|
cargo install cargo-audit && \
|
|
62
62
|
cargo install cargo-watch && \
|
|
63
63
|
chmod -R a+w $RUSTUP_HOME $CARGO_HOME
|
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Daemon Docker Container Entrypoint v0.7.0
|
|
3
|
+
# This script handles container initialization, environment setup, and cleanup
|
|
4
|
+
|
|
5
|
+
set -e
|
|
6
|
+
|
|
7
|
+
# ============================================================================
|
|
8
|
+
# COLORS FOR OUTPUT
|
|
9
|
+
# ============================================================================
|
|
10
|
+
export RED='\033[0;31m'
|
|
11
|
+
export GREEN='\033[0;32m'
|
|
12
|
+
export YELLOW='\033[1;33m'
|
|
13
|
+
export BLUE='\033[0;34m'
|
|
14
|
+
export PURPLE='\033[0;35m'
|
|
15
|
+
export CYAN='\033[0;36m'
|
|
16
|
+
export NC='\033[0m' # No Color
|
|
17
|
+
|
|
18
|
+
# ============================================================================
|
|
19
|
+
# BANNER
|
|
20
|
+
# ============================================================================
|
|
21
|
+
print_banner() {
|
|
22
|
+
cat << "EOF"
|
|
23
|
+
╔═══════════════════════════════════════════════════════════╗
|
|
24
|
+
║ ║
|
|
25
|
+
║ ███╗ ██╗███████╗██╗ ██╗██╗ ██╗███████╗ ║
|
|
26
|
+
║ ████╗ ██║██╔════╝╚██╗██╔╝██║ ██║██╔════╝ ║
|
|
27
|
+
║ ██╔██╗ ██║█████╗ ╚███╔╝ ██║ ██║███████╗ ║
|
|
28
|
+
║ ██║╚██╗██║██╔══╝ ██╔██╗ ██║ ██║╚════██║ ║
|
|
29
|
+
║ ██║ ╚████║███████╗██╔╝ ██╗╚██████╔╝███████║ ║
|
|
30
|
+
║ ╚═╝ ╚═══╝╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚══════╝ ║
|
|
31
|
+
║ ║
|
|
32
|
+
║ v0.7.0 - Testing Suite ║
|
|
33
|
+
║ ║
|
|
34
|
+
╚═══════════════════════════════════════════════════════════╝
|
|
35
|
+
EOF
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
# ============================================================================
|
|
39
|
+
# LOGGING FUNCTIONS
|
|
40
|
+
# ============================================================================
|
|
41
|
+
log_info() {
|
|
42
|
+
echo -e "${BLUE}[INFO]${NC} $1"
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
log_success() {
|
|
46
|
+
echo -e "${GREEN}[SUCCESS]${NC} $1"
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
log_warning() {
|
|
50
|
+
echo -e "${YELLOW}[WARNING]${NC} $1"
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
log_error() {
|
|
54
|
+
echo -e "${RED}[ERROR]${NC} $1"
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
log_tool() {
|
|
58
|
+
echo -e "${CYAN}[TOOL]${NC} $1"
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
# ============================================================================
|
|
62
|
+
# ENVIRONMENT SETUP
|
|
63
|
+
# ============================================================================
|
|
64
|
+
setup_environment() {
|
|
65
|
+
log_info "Setting up environment..."
|
|
66
|
+
|
|
67
|
+
# Set timezone if specified
|
|
68
|
+
if [ -n "${TZ}" ]; then
|
|
69
|
+
export TZ="${TZ}"
|
|
70
|
+
log_info "Timezone set to ${TZ}"
|
|
71
|
+
fi
|
|
72
|
+
|
|
73
|
+
# Ensure Rust is in PATH
|
|
74
|
+
if [ -d "/usr/local/cargo/bin" ]; then
|
|
75
|
+
export PATH="/usr/local/cargo/bin:${PATH}"
|
|
76
|
+
log_success "Rust toolchain configured"
|
|
77
|
+
fi
|
|
78
|
+
|
|
79
|
+
# Create working directory if it doesn't exist
|
|
80
|
+
mkdir -p /app/{logs,reports,temp}
|
|
81
|
+
|
|
82
|
+
# Set Node environment
|
|
83
|
+
export NODE_ENV="${NODE_ENV:-development}"
|
|
84
|
+
|
|
85
|
+
log_success "Environment setup complete"
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
# ============================================================================
|
|
89
|
+
# TOOL VERSION DISPLAY
|
|
90
|
+
# ============================================================================
|
|
91
|
+
show_versions() {
|
|
92
|
+
log_info "Installed tools:"
|
|
93
|
+
echo ""
|
|
94
|
+
|
|
95
|
+
# Node.js
|
|
96
|
+
log_tool "Node.js: $(node --version 2>/dev/null || echo 'not installed')"
|
|
97
|
+
|
|
98
|
+
# Rust
|
|
99
|
+
log_tool "Rust: $(rustc --version 2>/dev/null || echo 'not installed')"
|
|
100
|
+
log_tool "Cargo: $(cargo --version 2>/dev/null || echo 'not installed')"
|
|
101
|
+
|
|
102
|
+
# Testing frameworks
|
|
103
|
+
log_tool "Vitest: $(vitest --version 2>/dev/null || echo 'not installed')"
|
|
104
|
+
log_tool "Playwright: $(playwright --version 2>/dev/null || echo 'not installed')"
|
|
105
|
+
|
|
106
|
+
# Performance tools
|
|
107
|
+
log_tool "k6: $(k6 version 2>/dev/null | head -1 || echo 'not installed')"
|
|
108
|
+
log_tool "Lighthouse: $(lighthouse --version 2>/dev/null || echo 'not installed')"
|
|
109
|
+
|
|
110
|
+
# Security tools
|
|
111
|
+
log_tool "Snyk: $(snyk --version 2>/dev/null || echo 'not installed')"
|
|
112
|
+
|
|
113
|
+
# Code quality
|
|
114
|
+
log_tool "ESLint: $(eslint --version 2>/dev/null || echo 'not installed')"
|
|
115
|
+
log_tool "Prettier: $(prettier --version 2>/dev/null || echo 'not installed')"
|
|
116
|
+
|
|
117
|
+
# Database
|
|
118
|
+
log_tool "Prisma: $(prisma --version 2>/dev/null || echo 'not installed')"
|
|
119
|
+
|
|
120
|
+
# Accessibility
|
|
121
|
+
log_tool "Pa11y: $(pa11y --version 2>/dev/null || echo 'not installed')"
|
|
122
|
+
|
|
123
|
+
# TypeScript
|
|
124
|
+
log_tool "TypeScript: $(tsc --version 2>/dev/null || echo 'not installed')"
|
|
125
|
+
|
|
126
|
+
echo ""
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
# ============================================================================
|
|
130
|
+
# AVAILABLE COMMANDS HELP
|
|
131
|
+
# ============================================================================
|
|
132
|
+
show_help() {
|
|
133
|
+
cat << EOF
|
|
134
|
+
${CYAN}Daemon v0.7.0 - Available Commands${NC}
|
|
135
|
+
|
|
136
|
+
${YELLOW}Testing Commands:${NC}
|
|
137
|
+
vitest Run Vitest unit tests
|
|
138
|
+
playwright Run Playwright E2E tests
|
|
139
|
+
k6 run <script> Run k6 performance test
|
|
140
|
+
lighthouse <url> Run Lighthouse audit
|
|
141
|
+
|
|
142
|
+
${YELLOW}Code Quality:${NC}
|
|
143
|
+
eslint <files> Run ESLint
|
|
144
|
+
prettier <files> Run Prettier
|
|
145
|
+
rustfmt <files> Format Rust code
|
|
146
|
+
clippy Run Rust linter
|
|
147
|
+
|
|
148
|
+
${YELLOW}Security:${NC}
|
|
149
|
+
snyk test Run Snyk security scan
|
|
150
|
+
npm audit Audit npm dependencies
|
|
151
|
+
cargo audit Audit Rust dependencies
|
|
152
|
+
|
|
153
|
+
${YELLOW}Accessibility:${NC}
|
|
154
|
+
pa11y <url> Run accessibility test
|
|
155
|
+
axe <url> Run axe-core test
|
|
156
|
+
|
|
157
|
+
${YELLOW}Database:${NC}
|
|
158
|
+
prisma <command> Run Prisma CLI
|
|
159
|
+
|
|
160
|
+
${YELLOW}Utilities:${NC}
|
|
161
|
+
versions Show all tool versions
|
|
162
|
+
help Show this help message
|
|
163
|
+
shell Start bash shell
|
|
164
|
+
|
|
165
|
+
${YELLOW}Examples:${NC}
|
|
166
|
+
vitest run --coverage
|
|
167
|
+
playwright test --project=chromium
|
|
168
|
+
k6 run performance/test.js
|
|
169
|
+
lighthouse https://example.com --output html
|
|
170
|
+
snyk test --json
|
|
171
|
+
|
|
172
|
+
EOF
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
# ============================================================================
|
|
176
|
+
# CLEANUP FUNCTION
|
|
177
|
+
# ============================================================================
|
|
178
|
+
cleanup() {
|
|
179
|
+
log_info "Cleaning up before exit..."
|
|
180
|
+
|
|
181
|
+
# Remove temporary files
|
|
182
|
+
rm -rf /app/temp/*
|
|
183
|
+
|
|
184
|
+
# Clean npm cache
|
|
185
|
+
npm cache clean --force 2>/dev/null || true
|
|
186
|
+
|
|
187
|
+
log_success "Cleanup complete"
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
# ============================================================================
|
|
191
|
+
# SIGNAL HANDLERS
|
|
192
|
+
# ============================================================================
|
|
193
|
+
trap cleanup EXIT INT TERM
|
|
194
|
+
|
|
195
|
+
# ============================================================================
|
|
196
|
+
# COMMAND ROUTING
|
|
197
|
+
# ============================================================================
|
|
198
|
+
route_command() {
|
|
199
|
+
local cmd="$1"
|
|
200
|
+
|
|
201
|
+
case "${cmd}" in
|
|
202
|
+
versions|--version|-v)
|
|
203
|
+
show_versions
|
|
204
|
+
exit 0
|
|
205
|
+
;;
|
|
206
|
+
help|--help|-h)
|
|
207
|
+
show_help
|
|
208
|
+
exit 0
|
|
209
|
+
;;
|
|
210
|
+
shell)
|
|
211
|
+
exec /bin/bash
|
|
212
|
+
;;
|
|
213
|
+
vitest)
|
|
214
|
+
shift
|
|
215
|
+
exec vitest "$@"
|
|
216
|
+
;;
|
|
217
|
+
playwright)
|
|
218
|
+
shift
|
|
219
|
+
exec playwright "$@"
|
|
220
|
+
;;
|
|
221
|
+
eslint)
|
|
222
|
+
shift
|
|
223
|
+
exec eslint "$@"
|
|
224
|
+
;;
|
|
225
|
+
prettier)
|
|
226
|
+
shift
|
|
227
|
+
exec prettier "$@"
|
|
228
|
+
;;
|
|
229
|
+
k6)
|
|
230
|
+
shift
|
|
231
|
+
exec k6 "$@"
|
|
232
|
+
;;
|
|
233
|
+
lighthouse)
|
|
234
|
+
shift
|
|
235
|
+
exec lighthouse "$@"
|
|
236
|
+
;;
|
|
237
|
+
snyk)
|
|
238
|
+
shift
|
|
239
|
+
exec snyk "$@"
|
|
240
|
+
;;
|
|
241
|
+
pa11y)
|
|
242
|
+
shift
|
|
243
|
+
exec pa11y "$@"
|
|
244
|
+
;;
|
|
245
|
+
prisma)
|
|
246
|
+
shift
|
|
247
|
+
exec prisma "$@"
|
|
248
|
+
;;
|
|
249
|
+
cargo)
|
|
250
|
+
shift
|
|
251
|
+
exec cargo "$@"
|
|
252
|
+
;;
|
|
253
|
+
rustc)
|
|
254
|
+
shift
|
|
255
|
+
exec rustc "$@"
|
|
256
|
+
;;
|
|
257
|
+
"")
|
|
258
|
+
# No command specified, keep container alive
|
|
259
|
+
log_info "No command specified. Container running..."
|
|
260
|
+
log_info "Use 'docker exec -it <container> help' for available commands"
|
|
261
|
+
exec sleep infinity
|
|
262
|
+
;;
|
|
263
|
+
*)
|
|
264
|
+
# Pass through unknown commands
|
|
265
|
+
log_info "Executing: $@"
|
|
266
|
+
exec "$@"
|
|
267
|
+
;;
|
|
268
|
+
esac
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
# ============================================================================
|
|
272
|
+
# MAIN ENTRYPOINT
|
|
273
|
+
# ============================================================================
|
|
274
|
+
main() {
|
|
275
|
+
print_banner
|
|
276
|
+
setup_environment
|
|
277
|
+
|
|
278
|
+
# If no arguments, show versions and keep alive
|
|
279
|
+
if [ $# -eq 0 ]; then
|
|
280
|
+
echo ""
|
|
281
|
+
show_versions
|
|
282
|
+
echo ""
|
|
283
|
+
log_info "Container ready. Use 'docker exec -it <container> <command>' to run commands"
|
|
284
|
+
echo ""
|
|
285
|
+
exec sleep infinity
|
|
286
|
+
fi
|
|
287
|
+
|
|
288
|
+
# Route the command
|
|
289
|
+
route_command "$@"
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
# Run main function
|
|
293
|
+
main "$@"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oalacea/daemon",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"description": "AI-powered code quality analysis, scoring, and optimization for web applications",
|
|
5
5
|
"author": "Yanis",
|
|
6
6
|
"license": "MIT",
|
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
"dist",
|
|
57
57
|
"prompts",
|
|
58
58
|
"templates",
|
|
59
|
-
"bin/Dockerfile"
|
|
59
|
+
"bin/Dockerfile",
|
|
60
|
+
"bin/docker-entrypoint.sh"
|
|
60
61
|
]
|
|
61
62
|
}
|