mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-05-27 15:39:36 +00:00
Step 7 of the Zod migration: lock the migration's gains in place via
lint + CI enforcement.
- eslint.config.js: `@typescript-eslint/no-explicit-any` set to error.
Verified locally — zero violations in src/, with the only file-level
disables being src/models/inbound.ts and src/models/outbound.ts
(kept for DBInbound's toInbound() consumer; their migration is out
of spec scope).
- .github/workflows/ci.yml: add Typecheck and Test steps to the
frontend job, between Lint and Build. PRs now have to pass
tsc --noEmit and the full vitest suite (285 tests + 172 snapshots)
before build runs.
Migration scoreboard (vs the spec):
Step 1 primitives + barrels done
Step 2 protocol leaf + DUs done
Step 3 pure-fn extraction done
Step 4 form modals -> Pattern A done (Inbound + Outbound)
Step 5 delete models/ files DEFERRED (DBInbound still uses
Inbound; spec marks DBInbound
migration out of scope)
Step 6 tighten .loose() / unknown DEFERRED (invasive, separate PR)
Step 7 lint + CI enforcement done (this commit)
Production code paths now have no direct dependency on the legacy
Inbound or Outbound classes.
96 lines
2.2 KiB
YAML
96 lines
2.2 KiB
YAML
name: CI
|
|
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- "**.go"
|
|
- "go.mod"
|
|
- "go.sum"
|
|
- "**.js"
|
|
- "**.mjs"
|
|
- "**.cjs"
|
|
- "**.ts"
|
|
- "**.html"
|
|
- "**.css"
|
|
- "frontend/package.json"
|
|
- "frontend/package-lock.json"
|
|
- ".nvmrc"
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- "**.go"
|
|
- "go.mod"
|
|
- "go.sum"
|
|
- "**.js"
|
|
- "**.mjs"
|
|
- "**.cjs"
|
|
- "**.ts"
|
|
- "**.html"
|
|
- "**.css"
|
|
- "frontend/package.json"
|
|
- "frontend/package-lock.json"
|
|
- ".nvmrc"
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
go-test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: actions/setup-go@v6
|
|
with:
|
|
go-version-file: go.mod
|
|
cache: true
|
|
- name: Stub web/dist for go:embed
|
|
run: mkdir -p web/dist && touch web/dist/.gitkeep
|
|
- name: Test
|
|
run: |
|
|
go list ./... | grep -v '/frontend/node_modules/' > /tmp/go-packages.txt
|
|
go test $(cat /tmp/go-packages.txt)
|
|
|
|
govulncheck:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: actions/setup-go@v6
|
|
with:
|
|
go-version-file: go.mod
|
|
cache: true
|
|
- name: Stub web/dist for go:embed
|
|
run: mkdir -p web/dist && touch web/dist/.gitkeep
|
|
- name: Install govulncheck
|
|
run: go install golang.org/x/vuln/cmd/govulncheck@latest
|
|
- name: Run govulncheck
|
|
run: govulncheck ./...
|
|
|
|
frontend:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: actions/setup-node@v6
|
|
with:
|
|
node-version-file: .nvmrc
|
|
cache: npm
|
|
cache-dependency-path: frontend/package-lock.json
|
|
- name: Install
|
|
run: npm ci
|
|
working-directory: frontend
|
|
- name: Lint
|
|
run: npm run lint
|
|
working-directory: frontend
|
|
- name: Typecheck
|
|
run: npm run typecheck
|
|
working-directory: frontend
|
|
- name: Test
|
|
run: npm test
|
|
working-directory: frontend
|
|
- name: Build
|
|
run: npm run build
|
|
working-directory: frontend
|
|
- name: Audit
|
|
run: npm audit --audit-level=high
|
|
working-directory: frontend
|