chore(workspace): move the app to apps/app under a pnpm workspace (step 2)
144 files moved with git mv (pure renames). Root package.json delegates dev/typecheck/test:run/lint/build to the packages; Node 24 LTS and pnpm 10.13.1 pinned (.nvmrc, .node-version, engines, packageManager, root devDependency, engine-strict). Dockerfile builds @faunosteo/app on node:24-alpine and copies apps/app/dist; nginx and runtime config unchanged. CI workflow for Gitea Actions. packages/ reserved (README only). Docs synced: WORKSPACE.md, CLAUDE.md, README, DEPLOY, CHANGELOG, plan. 271/271 tests, typecheck, lint, build green from the root.
This commit is contained in:
1 parent
c8d48ab4cc
commit
8673475293
164 files changed
+348
-128
No files matched your search
@@ -48,7 +48,8 @@ feat/findings-tree-v2 merged (FindingsTreePicker tracked in HEAD); all work belo
|
||||
|
||||
- [x] Step 0 — preparation docs in docs/development/ (2026-10-08, validated)
|
||||
- [x] Step 1 — characterisation tests: 7 files / 91 cases, 2 golden fixtures, docs/development/CHARACTERIZATION_REPORT.md; 271/271, typecheck, lint, build green (2026-10-08, branch feature/step-01-characterisation-tests, awaiting validation)
|
||||
- [ ] Step 2 — monorepo workspace (next, on validation)
|
||||
- [x] Step 2 — monorepo workspace: apps/app via git mv (144 files), root scripts, Node 24 + pnpm 10.13.1 pins, Dockerfile node:24 + filtered build, CI .gitea/workflows/ci.yml, WORKSPACE.md; 271/271, typecheck, lint, build green from root (2026-10-08, branch feature/step-02-monorepo-workspace, uncommitted, awaiting validation)
|
||||
- [ ] Step 3 — Supabase foundation (next, on validation)
|
||||
|
||||
---
|
||||
|
||||
|
||||
+2
-2
@@ -19,8 +19,8 @@ coverage/
|
||||
*.tsbuildinfo
|
||||
|
||||
# Binary & media assets — reference by path only when needed
|
||||
public/species/**/*.svg
|
||||
src/assets/**
|
||||
**/public/species/**/*.svg
|
||||
**/src/assets/**
|
||||
*.png
|
||||
*.jpg
|
||||
*.jpeg
|
||||
|
||||
@@ -1,13 +1,20 @@
|
||||
node_modules/
|
||||
**/node_modules/
|
||||
dist/
|
||||
**/dist/
|
||||
.git/
|
||||
.env
|
||||
.env.*
|
||||
!.env.example
|
||||
coverage/
|
||||
**/coverage/
|
||||
.vite/
|
||||
**/.vite/
|
||||
*.log
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
graphify-out/
|
||||
.claude/
|
||||
.gitea/
|
||||
docs/
|
||||
logos/
|
||||
@@ -0,0 +1,32 @@
|
||||
# Gitea Actions (same syntax as GitHub Actions). Runs on the self-hosted forge
|
||||
# runner; no external provider. No Supabase dependency at this stage.
|
||||
name: ci
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main, develop]
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: .nvmrc
|
||||
- name: Activate pnpm (version from package.json "packageManager")
|
||||
run: corepack enable && corepack prepare --activate
|
||||
- run: pnpm install --frozen-lockfile
|
||||
- run: pnpm typecheck
|
||||
- run: pnpm test:run
|
||||
- run: pnpm lint
|
||||
- run: pnpm build
|
||||
|
||||
docker:
|
||||
runs-on: ubuntu-latest
|
||||
needs: check
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Docker image builds (runner needs a Docker daemon)
|
||||
run: docker build -t faunosteo:ci .
|
||||
@@ -0,0 +1 @@
|
||||
24
|
||||
@@ -2,3 +2,5 @@ shamefully-hoist=false
|
||||
strict-peer-dependencies=false
|
||||
# Supply-chain guard: only install package versions published >= 24h ago
|
||||
minimum-release-age=1440
|
||||
# Refuse to install on a Node/pnpm outside package.json "engines" (explicit environment)
|
||||
engine-strict=true
|
||||
@@ -6,6 +6,16 @@ Versions follow [Semantic Versioning](https://semver.org/).
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Changed (SaaS migration, plan Step 2)
|
||||
|
||||
- **pnpm workspace** — the application moved to `apps/app` (`@faunosteo/app`) with `git mv`; root commands (`pnpm typecheck|test:run|lint|build|dev`) delegate to the packages. `packages/` reserved, empty. CI workflow added (`.gitea/workflows/ci.yml`).
|
||||
- **Node 24 LTS / pnpm 10.13.1** — declared in `.nvmrc`, `.node-version`, `engines`, `packageManager`; `engine-strict` on; Dockerfile builds on `node:24-alpine` and copies `apps/app/dist`.
|
||||
|
||||
### Added (SaaS migration, plan Steps 0–1)
|
||||
|
||||
- **Implementation plan** — `docs/development/` (27-step plan, migration map, domain map, architecture, strategies, open questions).
|
||||
- **Characterisation suite** — 91 tests on the real SVGs, catalog and PDF pipeline; two golden Report v2 fixtures (`CHARACTERIZATION_REPORT.md`).
|
||||
|
||||
### Added
|
||||
|
||||
- **Laterality & bilaterality** — `LateralSideSchema` (left/right) + `Bone.lateral`, `data-anno-lateral` parsed from the SVG; `LateralityPicker` modal in the zone-click flow, side shown in zone badges and PDF labels; bilateral zones get a separate findings picker per side.
|
||||
|
||||
@@ -20,8 +20,8 @@ MVP species: equine only. Open-source MIT.
|
||||
|
||||
| Concern | Choice | Version |
|
||||
|---|---|---|
|
||||
| Runtime | Node.js | 20 |
|
||||
| Package manager | pnpm | >=9 (11.x on host) |
|
||||
| Runtime | Node.js | 24 LTS (`.nvmrc`, `engines` >=22.12 <25) |
|
||||
| Package manager | pnpm | 10.13.1 (`packageManager`, root devDependency) |
|
||||
| Build | Vite + @vitejs/plugin-react-swc | 7.x |
|
||||
| UI | React | 19 |
|
||||
| Language | TypeScript strict | 5.x |
|
||||
@@ -38,6 +38,10 @@ MVP species: equine only. Open-source MIT.
|
||||
|
||||
## Build commands
|
||||
|
||||
pnpm workspace: `apps/app` = the private application, `packages/` empty for
|
||||
now (see `docs/development/WORKSPACE.md`). Every command below runs from the
|
||||
repository root and delegates to the packages.
|
||||
|
||||
```bash
|
||||
# Development
|
||||
pnpm dev
|
||||
@@ -77,8 +81,8 @@ docker compose up --build
|
||||
docker compose down
|
||||
```
|
||||
|
||||
Note: pnpm binary at `~/.local/bin/pnpm` on dev host (corepack broken).
|
||||
It is normally already on PATH; otherwise `export PATH="$HOME/.local/bin:$PATH"`.
|
||||
Note: no global pnpm needed. `corepack enable` once (reads `packageManager`),
|
||||
or call `corepack pnpm <cmd>`. Root scripts resolve `node_modules/.bin/pnpm`.
|
||||
|
||||
---
|
||||
|
||||
@@ -89,8 +93,9 @@ pnpm test:run # vitest run — all tests, single pass, CI-safe
|
||||
pnpm test # vitest watch — dev loop
|
||||
```
|
||||
|
||||
Test files live in `tests/unit/*.test.ts` and `tests/unit/*.test.tsx`.
|
||||
Setup: `tests/setup.ts` imports @testing-library/jest-dom.
|
||||
Test files live in `apps/app/tests/unit/*.test.ts(x)`; golden fixtures in
|
||||
`apps/app/tests/fixtures/`. Setup: `apps/app/tests/setup.ts` imports
|
||||
@testing-library/jest-dom. Characterisation suite: files prefixed `char.`.
|
||||
|
||||
---
|
||||
|
||||
@@ -106,7 +111,8 @@ pnpm format # Prettier write
|
||||
## Folder structure
|
||||
|
||||
```
|
||||
osteo/
|
||||
faunosteo/
|
||||
├─ apps/app/ ← @faunosteo/app (everything below until packages/)
|
||||
├─ public/
|
||||
│ ├─ species/equine/{Horse,Horse_head}.svg ← real anatomy SVGs
|
||||
│ └─ pathology-editor.html ← standalone JSON editor (served as static file)
|
||||
@@ -166,20 +172,18 @@ osteo/
|
||||
│ ├─ ANATOMY-SVG-CONVENTION.md ← SVG data-* contract
|
||||
│ ├─ ADDING-A-SPECIES.md
|
||||
│ ├─ PDF-FORMAT.md
|
||||
│ ├─ superpowers/specs/
|
||||
│ │ ├─ 2026-05-18-osteo-report-mvp-design.md
|
||||
│ │ ├─ 2026-05-20-b3-i18n-fr-en-design.md
|
||||
│ │ └─ 2026-05-22-pathology-editor-design.md
|
||||
│ └─ superpowers/plans/
|
||||
│ ├─ 2026-05-18-osteo-report-mvp.md
|
||||
│ └─ 2026-05-20-b3-i18n-fr-en.md
|
||||
│ ├─ faunosteo-audit/ ← audit of the current system (frozen at 83e40af)
|
||||
│ └─ development/ ← SaaS implementation plan, WORKSPACE.md
|
||||
├─ eslint.config.js, index.html, package.json (@faunosteo/app)
|
||||
├─ tsconfig*.json, vite.config.ts, vitest.config.ts
|
||||
│ (end of apps/app)
|
||||
├─ packages/README.md ← future shared packages (none yet)
|
||||
├─ .gitea/workflows/ci.yml ← CI: install, typecheck, test, lint, build, docker
|
||||
├─ .claude/{tasks/TODO.md,memory/,audits/}
|
||||
├─ Dockerfile, docker-compose.yml
|
||||
├─ .env.example, .editorconfig, .nvmrc, .prettierrc.json
|
||||
├─ eslint.config.js, index.html
|
||||
├─ package.json, tsconfig*.json
|
||||
├─ vite.config.ts, vitest.config.ts
|
||||
├─ CLAUDE.md, README.md, LICENSE
|
||||
├─ Dockerfile, docker-compose.yml, docker/
|
||||
├─ .env.example, .editorconfig, .nvmrc, .node-version, .npmrc, .prettierrc.json
|
||||
├─ package.json (workspace root), pnpm-workspace.yaml, pnpm-lock.yaml
|
||||
├─ CLAUDE.md, README.md, DEPLOY.md, CHANGELOG.md, LICENSE
|
||||
```
|
||||
|
||||
---
|
||||
@@ -321,12 +325,12 @@ Runtime config
|
||||
- Pathology DB entries must be source-cited before commit; client review required for MVP batch.
|
||||
- Ask before any change to importReportFromPdf or extractReportJson — these handle user data.
|
||||
- After PDF roundtrip tests fail: check attachment bytes, then Zod validation, then DecompressionStream inflation.
|
||||
- pnpm binary: `~/.local/bin/pnpm` on dev host (normally already on PATH).
|
||||
- Node 24 / pnpm 10.13.1: `corepack enable` or `corepack pnpm`; never a global install.
|
||||
|
||||
## Commit message convention
|
||||
|
||||
Conventional Commits format. Subject ≤72 chars, imperative mood, no trailing period.
|
||||
Allowed scopes: `schema`, `store`, `anatomy`, `pdf`, `editor`, `home`, `new`, `ui`, `config`, `species`, `i18n`, `docker`, `docs`, `tests`, `chore`.
|
||||
Allowed scopes: `schema`, `store`, `anatomy`, `pdf`, `editor`, `home`, `new`, `ui`, `config`, `species`, `i18n`, `docker`, `docs`, `tests`, `chore`, `app`, `workspace`, `ci`.
|
||||
|
||||
Examples:
|
||||
- `test(schema): cover Report version literal`
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
# Deploy
|
||||
|
||||
Single nginx:alpine container behind a host reverse proxy that terminates
|
||||
TLS. The container serves a static SPA bundle from `/usr/share/nginx/html`
|
||||
TLS. The container serves a static SPA bundle (built from `apps/app`, Node 24,
|
||||
pnpm 10.13.1) from `/usr/share/nginx/html`
|
||||
and a runtime-injected `env.js`; there is no backend, no database, no
|
||||
persistent server-side state. Praticien data lives in the browser
|
||||
(`sessionStorage` / `localStorage`) and in the exported PDFs themselves
|
||||
@@ -163,8 +164,8 @@ curl -sI http://127.0.0.1:8080/ | head -1 # expect 200 OK
|
||||
curl -s http://127.0.0.1:8080/env.js # expect window.__APP_CONFIG__ = {...};
|
||||
```
|
||||
|
||||
If the build OOMs on a 1 GB VPS, build locally and rsync the resulting
|
||||
`dist/` over, then bind-mount it into a plain `nginx:alpine` until you
|
||||
If the build OOMs on a 1 GB VPS, build locally (`pnpm build`) and rsync the
|
||||
resulting `apps/app/dist/` over, then bind-mount it into a plain `nginx:alpine` until you
|
||||
upsize.
|
||||
|
||||
---
|
||||
|
||||
+10
-7
@@ -1,25 +1,28 @@
|
||||
# ---- stage 1: builder -----------------------------------------------
|
||||
FROM node:20-alpine AS builder
|
||||
# Node 24 LTS (Node 20 reached end-of-life on 2026-04-30). pnpm pinned to the
|
||||
# same version as package.json "packageManager"; pnpm 11 needs Node >= 22.13
|
||||
# and rewrites the lockfile, so the 10.x line stays pinned on purpose.
|
||||
FROM node:24-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install pnpm via corepack
|
||||
RUN corepack enable && corepack prepare pnpm@10.13.1 --activate
|
||||
|
||||
# Copy manifests first for layer caching
|
||||
COPY package.json pnpm-lock.yaml* ./
|
||||
# Workspace manifests first for layer caching (install depends only on these)
|
||||
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml .npmrc ./
|
||||
COPY apps/app/package.json apps/app/
|
||||
|
||||
RUN pnpm install --frozen-lockfile
|
||||
|
||||
# Copy source and build
|
||||
# Copy source and build the private app only
|
||||
COPY . .
|
||||
RUN pnpm build
|
||||
RUN pnpm --filter @faunosteo/app build
|
||||
|
||||
# ---- stage 2: runner ------------------------------------------------
|
||||
FROM nginx:1.31-alpine AS runner
|
||||
|
||||
# Copy built static assets
|
||||
COPY --from=builder /app/dist /usr/share/nginx/html
|
||||
COPY --from=builder /app/apps/app/dist /usr/share/nginx/html
|
||||
|
||||
# Copy custom nginx config and entrypoint
|
||||
COPY docker/nginx.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
@@ -56,9 +56,8 @@ contract.
|
||||
Single process, no Docker:
|
||||
|
||||
```bash
|
||||
# Requires pnpm — install if needed:
|
||||
curl -fsSL https://get.pnpm.io/install.sh | sh
|
||||
source ~/.bashrc # or restart your shell
|
||||
# Node 24 (see .nvmrc) + pnpm 10.13.1 via corepack, no global install:
|
||||
corepack enable
|
||||
|
||||
pnpm install
|
||||
cp .env.example .env # edit APP_* vars if desired
|
||||
@@ -80,8 +79,8 @@ docker compose up --build
|
||||
```bash
|
||||
pnpm typecheck # TypeScript strict, no emit
|
||||
pnpm lint # ESLint 9 flat config, 0 warnings
|
||||
pnpm test:run # vitest run (174 tests)
|
||||
pnpm build # tsc + vite build → dist/
|
||||
pnpm test:run # vitest run (271 tests)
|
||||
pnpm build # tsc + vite build → apps/app/dist/
|
||||
```
|
||||
|
||||
---
|
||||
@@ -89,7 +88,7 @@ pnpm build # tsc + vite build → dist/
|
||||
## Build & deploy
|
||||
|
||||
```bash
|
||||
pnpm build # production build → dist/
|
||||
pnpm build # production build → apps/app/dist/
|
||||
docker build -t faunosteo . # multi-stage Docker image
|
||||
docker compose up --build # run with env_file: .env
|
||||
```
|
||||
@@ -114,7 +113,8 @@ For production deployment (VPS provisioning, firewall, TLS, nginx reverse proxy,
|
||||
## Project layout
|
||||
|
||||
```
|
||||
osteo/
|
||||
faunosteo/ pnpm workspace (see docs/development/WORKSPACE.md)
|
||||
├─ apps/app/ the private application (@faunosteo/app):
|
||||
├─ public/species/equine/ anatomy SVGs (Horse.svg, Horse_head.svg)
|
||||
├─ src/app/ routes + ConfigProvider
|
||||
├─ src/config/ runtime env config resolution
|
||||
@@ -126,7 +126,8 @@ osteo/
|
||||
├─ src/pdf/ export/import/attachment/fonts + renderers
|
||||
├─ src/lib/ id, dates, assert utilities
|
||||
├─ src/styles/ Tailwind v4 CSS + design tokens
|
||||
├─ tests/unit/ vitest tests
|
||||
├─ tests/unit/ vitest tests (apps/app/tests, incl. characterisation suite)
|
||||
├─ packages/ shared packages, none yet
|
||||
├─ docker/ entrypoint.sh + nginx.conf
|
||||
├─ docs/ conventions + species guide + PDF spec
|
||||
├─ index.html SPA entry point
|
||||
@@ -141,7 +142,7 @@ v0.1.0 MVP — implementation complete.
|
||||
|
||||
- `pnpm typecheck` ✅
|
||||
- `pnpm lint` ✅
|
||||
- `pnpm test:run` ✅ — 174 tests across 30 files
|
||||
- `pnpm test:run` ✅ — 271 tests across 39 files
|
||||
- `pnpm build` ✅
|
||||
|
||||
The first species data set ships with the real `Horse.svg` + `Horse_head.svg`
|
||||
|
||||
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,45 @@
|
||||
{
|
||||
"name": "@faunosteo/app",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"description": "Faunosteo private application: veterinary osteopathy reports with PDF export/import",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "tsc -p tsconfig.json --noEmit && vite build",
|
||||
"preview": "vite preview",
|
||||
"typecheck": "tsc -p tsconfig.json --noEmit",
|
||||
"test": "vitest",
|
||||
"test:run": "vitest run",
|
||||
"lint": "eslint . --max-warnings 0",
|
||||
"scaffold:species": "node scripts/scaffold-species.mjs"
|
||||
},
|
||||
"dependencies": {
|
||||
"motion": "^11.11.17",
|
||||
"pdf-lib": "^1.17.1",
|
||||
"react": "^19.0.0",
|
||||
"react-dom": "^19.0.0",
|
||||
"react-router-dom": "^7.1.1",
|
||||
"zod": "^3.24.1",
|
||||
"zustand": "^5.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tailwindcss/vite": "^4.3.0",
|
||||
"@testing-library/jest-dom": "^6.6.3",
|
||||
"@testing-library/react": "^16.1.0",
|
||||
"@testing-library/user-event": "^14.5.2",
|
||||
"@types/node": "^20.19.41",
|
||||
"@types/react": "^19.0.1",
|
||||
"@types/react-dom": "^19.0.1",
|
||||
"@vitejs/plugin-react-swc": "^3.7.2",
|
||||
"eslint": "^9.17.0",
|
||||
"eslint-plugin-react": "^7.37.3",
|
||||
"eslint-plugin-react-hooks": "^5.1.0",
|
||||
"globals": "^15.14.0",
|
||||
"happy-dom": "^20.10.6",
|
||||
"typescript": "^5.7.2",
|
||||
"typescript-eslint": "^8.19.0",
|
||||
"vite": "^7.3.6",
|
||||
"vitest": "^3.2.7"
|
||||
}
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loaded 100 of 164 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user