chore: initial Vector 2.0 monorepo
Ground-up TypeScript rewrite of the Vector hardware parts inventory
system. Ships the full roadmap (Phases 0-8) in one initial commit:
- pnpm + Turbo monorepo: apps/{api,web,e2e}, packages/{db,shared,ui,config}
- Express 5 + Prisma 5 + zod validation + JWT w/ refresh-token rotation
- React 19 + Vite + shadcn/ui + TanStack Query/Table + nuqs URL state
- Repair/RMA, tags, bulk ops, saved views, CSV audit export
- Analytics dashboard on Recharts + EOL tracking
- Signed webhook subscriptions (HMAC-SHA256) with in-process emitter
- Vitest unit tests (shared schemas, api services/helpers) + Playwright skeleton
- Gitea Actions CI (lint, typecheck, test+coverage, build) + Renovate
Deferred follow-ups: Postgres cutover (data-migration script ready),
BullMQ worker for webhook delivery, @react-pdf PDF export, CSV import wizard.
This commit is contained in:
@@ -0,0 +1,94 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
|
||||
# Cancel superseded runs on the same branch — saves runner minutes on rapid pushes.
|
||||
concurrency:
|
||||
group: ci-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
PNPM_VERSION: 10.33.0
|
||||
NODE_VERSION: 22
|
||||
|
||||
jobs:
|
||||
check:
|
||||
name: Lint · Typecheck · Test · Build
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: ${{ env.PNPM_VERSION }}
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
cache: pnpm
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Generate Prisma client
|
||||
run: pnpm -C packages/db exec prisma generate
|
||||
|
||||
- name: Lint
|
||||
run: pnpm lint
|
||||
|
||||
- name: Typecheck
|
||||
run: pnpm typecheck
|
||||
|
||||
- name: Unit tests (with coverage on api)
|
||||
run: |
|
||||
pnpm -C packages/shared test
|
||||
pnpm -C apps/api test:coverage
|
||||
|
||||
- name: Build
|
||||
run: pnpm build
|
||||
|
||||
- name: Upload API coverage
|
||||
uses: actions/upload-artifact@v4
|
||||
if: always()
|
||||
with:
|
||||
name: api-coverage
|
||||
path: apps/api/coverage
|
||||
if-no-files-found: ignore
|
||||
retention-days: 7
|
||||
|
||||
e2e:
|
||||
name: Playwright (smoke)
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 20
|
||||
# E2E needs a real DB + running stack. Flip this on by setting the `ENABLE_E2E`
|
||||
# repo variable to `true` in Gitea after the Postgres-in-CI follow-up lands.
|
||||
if: ${{ vars.ENABLE_E2E == 'true' }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: ${{ env.PNPM_VERSION }}
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
cache: pnpm
|
||||
|
||||
- run: pnpm install --frozen-lockfile
|
||||
- run: pnpm -C packages/db exec prisma generate
|
||||
- run: pnpm -C apps/e2e exec playwright install --with-deps chromium
|
||||
- run: pnpm -C apps/e2e test
|
||||
env:
|
||||
BASE_URL: ${{ secrets.E2E_BASE_URL }}
|
||||
TEST_USERNAME: ${{ secrets.E2E_USERNAME }}
|
||||
TEST_PASSWORD: ${{ secrets.E2E_PASSWORD }}
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: always()
|
||||
with:
|
||||
name: playwright-report
|
||||
path: apps/e2e/playwright-report
|
||||
retention-days: 7
|
||||
Reference in New Issue
Block a user