forgedev 1.4.0 → 1.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/package.json +1 -1
- package/src/chainproof-bridge.js +9 -2
- package/src/ci-mode.js +3 -4
- package/src/composer.js +228 -242
- package/src/doctor-checks-chainproof.js +14 -11
- package/src/doctor-checks.js +3 -19
- package/src/index.js +6 -34
- package/src/recommender.js +319 -319
- package/src/uat-generator.js +105 -93
- package/src/utils.js +245 -214
- package/templates/auth/jwt-custom/backend/app/api/auth.py.template +39 -45
- package/templates/auth/jwt-custom/backend/app/core/security.py.template +44 -37
- package/templates/backend/express/package.json.template +35 -33
- package/templates/backend/express/src/lib/prisma.ts.template +32 -0
- package/templates/backend/express/src/routes/health.ts.template +35 -27
- package/templates/backend/fastapi/backend/app/main.py.template +67 -60
- package/templates/backend/fastapi/backend/requirements.txt.template +18 -16
- package/templates/backend/hono/package.json.template +33 -31
- package/templates/backend/hono/src/lib/prisma.ts.template +32 -0
- package/templates/backend/hono/src/routes/health.ts.template +38 -27
- package/templates/base/.gitignore.template +32 -32
- package/templates/claude-code/commands/workflows.md +52 -52
- package/templates/database/prisma-postgres/prisma/schema.prisma.template +19 -18
- package/templates/database/sqlalchemy-postgres/backend/alembic/env.py.template +39 -40
- package/templates/database/sqlalchemy-postgres/backend/alembic.ini.template +38 -36
- package/templates/database/sqlalchemy-postgres/backend/app/db/session.py.template +50 -48
- package/templates/frontend/nextjs/package.json.template +45 -43
- package/templates/frontend/remix/package.json.template +41 -39
- package/templates/infra/docker/.dockerignore.template +16 -0
- package/templates/infra/docker-compose/docker-compose.yml.template +22 -19
- package/templates/infra/github-actions/.github/workflows/ci.yml.template +61 -52
- package/templates/infra/k8s/k8s/deployment.yml.template +70 -70
- package/templates/infra/k8s/k8s/hpa.yml.template +24 -24
- package/templates/infra/k8s/k8s/ingress.yml.template +26 -26
- package/templates/infra/k8s/k8s/kustomization.yml.template +13 -13
- package/templates/infra/k8s/k8s/namespace.yml.template +4 -4
- package/templates/infra/k8s/k8s/networkpolicy.yml.template +41 -41
- package/templates/infra/k8s/k8s/secrets.yml.template +10 -10
- package/templates/infra/k8s/k8s/service.yml.template +15 -15
- package/templates/testing/load/k6/README.md.template +48 -48
- package/templates/testing/load/k6/load-test.js.template +57 -57
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
import http from 'k6/http';
|
|
2
|
-
import { check, sleep } from 'k6';
|
|
3
|
-
|
|
4
|
-
// ─── Configuration ──────────────────────────────────────────────────
|
|
5
|
-
// Override via environment: k6 run -e BASE_URL=https://staging.example.com load-test.js
|
|
6
|
-
|
|
7
|
-
const BASE_URL = __ENV.BASE_URL || 'http://localhost:{{APP_PORT}}';
|
|
8
|
-
|
|
9
|
-
export const options = {
|
|
10
|
-
// Ramp-up pattern: smoke → load → stress → recovery
|
|
11
|
-
stages: [
|
|
12
|
-
{ duration: '30s', target: 10 }, // smoke: 10 users
|
|
13
|
-
{ duration: '1m', target: 50 }, // load: ramp to 50
|
|
14
|
-
{ duration: '2m', target: 50 }, // load: hold at 50
|
|
15
|
-
{ duration: '30s', target: 100 }, // stress: ramp to 100
|
|
16
|
-
{ duration: '1m', target: 100 }, // stress: hold at 100
|
|
17
|
-
{ duration: '30s', target: 0 }, // recovery: ramp down
|
|
18
|
-
],
|
|
19
|
-
thresholds: {
|
|
20
|
-
http_req_duration: ['p(95)<500', 'p(99)<1500'], // 95th < 500ms, 99th < 1.5s
|
|
21
|
-
http_req_failed: ['rate<0.01'], // <1% error rate
|
|
22
|
-
checks: ['rate>0.99'], // >99% checks pass
|
|
23
|
-
},
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
// ─── Health check ───────────────────────────────────────────────────
|
|
27
|
-
|
|
28
|
-
export default function () {
|
|
29
|
-
// Liveness probe
|
|
30
|
-
const health = http.get(`${BASE_URL}/health`);
|
|
31
|
-
check(health, {
|
|
32
|
-
'health: status 200': (r) => r.status === 200,
|
|
33
|
-
'health: status ok': (r) => {
|
|
34
|
-
try { return JSON.parse(r.body).status === 'ok'; } catch { return false; }
|
|
35
|
-
},
|
|
36
|
-
'health: response < 200ms': (r) => r.timings.duration < 200,
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
// Readiness probe
|
|
40
|
-
const healthz = http.get(`${BASE_URL}/healthz`);
|
|
41
|
-
check(healthz, {
|
|
42
|
-
'healthz: status 200': (r) => r.status === 200,
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
sleep(1);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// ─── Smoke test (quick validation) ─────────────────────────────────
|
|
49
|
-
// Run with: k6 run --exec smoke load-test.js
|
|
50
|
-
|
|
51
|
-
export function smoke() {
|
|
52
|
-
const res = http.get(`${BASE_URL}/health`);
|
|
53
|
-
check(res, {
|
|
54
|
-
'smoke: status 200': (r) => r.status === 200,
|
|
55
|
-
'smoke: response < 100ms': (r) => r.timings.duration < 100,
|
|
56
|
-
});
|
|
57
|
-
}
|
|
1
|
+
import http from 'k6/http';
|
|
2
|
+
import { check, sleep } from 'k6';
|
|
3
|
+
|
|
4
|
+
// ─── Configuration ──────────────────────────────────────────────────
|
|
5
|
+
// Override via environment: k6 run -e BASE_URL=https://staging.example.com load-test.js
|
|
6
|
+
|
|
7
|
+
const BASE_URL = __ENV.BASE_URL || 'http://localhost:{{APP_PORT}}';
|
|
8
|
+
|
|
9
|
+
export const options = {
|
|
10
|
+
// Ramp-up pattern: smoke → load → stress → recovery
|
|
11
|
+
stages: [
|
|
12
|
+
{ duration: '30s', target: 10 }, // smoke: 10 users
|
|
13
|
+
{ duration: '1m', target: 50 }, // load: ramp to 50
|
|
14
|
+
{ duration: '2m', target: 50 }, // load: hold at 50
|
|
15
|
+
{ duration: '30s', target: 100 }, // stress: ramp to 100
|
|
16
|
+
{ duration: '1m', target: 100 }, // stress: hold at 100
|
|
17
|
+
{ duration: '30s', target: 0 }, // recovery: ramp down
|
|
18
|
+
],
|
|
19
|
+
thresholds: {
|
|
20
|
+
http_req_duration: ['p(95)<500', 'p(99)<1500'], // 95th < 500ms, 99th < 1.5s
|
|
21
|
+
http_req_failed: ['rate<0.01'], // <1% error rate
|
|
22
|
+
checks: ['rate>0.99'], // >99% checks pass
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
// ─── Health check ───────────────────────────────────────────────────
|
|
27
|
+
|
|
28
|
+
export default function () {
|
|
29
|
+
// Liveness probe
|
|
30
|
+
const health = http.get(`${BASE_URL}/health`);
|
|
31
|
+
check(health, {
|
|
32
|
+
'health: status 200': (r) => r.status === 200,
|
|
33
|
+
'health: status ok': (r) => {
|
|
34
|
+
try { return JSON.parse(r.body).status === 'ok'; } catch { return false; }
|
|
35
|
+
},
|
|
36
|
+
'health: response < 200ms': (r) => r.timings.duration < 200,
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
// Readiness probe
|
|
40
|
+
const healthz = http.get(`${BASE_URL}/healthz`);
|
|
41
|
+
check(healthz, {
|
|
42
|
+
'healthz: status 200': (r) => r.status === 200,
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
sleep(1);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// ─── Smoke test (quick validation) ─────────────────────────────────
|
|
49
|
+
// Run with: k6 run --exec smoke load-test.js
|
|
50
|
+
|
|
51
|
+
export function smoke() {
|
|
52
|
+
const res = http.get(`${BASE_URL}/health`);
|
|
53
|
+
check(res, {
|
|
54
|
+
'smoke: status 200': (r) => r.status === 200,
|
|
55
|
+
'smoke: response < 100ms': (r) => r.timings.duration < 100,
|
|
56
|
+
});
|
|
57
|
+
}
|