From 19f79dfb174aef381693c847abdcea3f50051865 Mon Sep 17 00:00:00 2001 From: joshua Date: Wed, 4 Nov 2026 09:36:42 +0200 Subject: [PATCH] Monorepo set up: workspaces, contracts package, placeholders npm workspaces (packages/*, apps/*) with shared TypeScript, ESLint and Jest setup and `npm run check`. @crosscode/contracts builds to CommonJS and ESM (tsup) with the crosscode./ schema-name helpers. packages/ui and apps/{accounts,website,app} are placeholders. Co-Authored-By: Claude Opus 5.5 --- .gitattributes | 4 + .gitignore | 27 + CHANGELOG.md | 13 + README.md | 43 + apps/accounts/README.md | 3 + apps/accounts/package.json | 6 + apps/app/README.md | 3 + apps/app/package.json | 6 + apps/website/README.md | 3 + apps/website/package.json | 6 + eslint.config.mjs | 21 + package-lock.json | 7220 ++++++++++++++++++ package.json | 31 + packages/contracts/README.md | 36 + packages/contracts/jest.config.js | 7 + packages/contracts/package.json | 46 + packages/contracts/src/index.ts | 7 + packages/contracts/src/schema-name.ts | 37 + packages/contracts/tests/schema-name.test.ts | 38 + packages/contracts/tsconfig.json | 8 + packages/contracts/tsup.config.ts | 13 + packages/ui/README.md | 5 + packages/ui/package.json | 6 + tsconfig.base.json | 20 + 24 files changed, 7609 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 CHANGELOG.md create mode 100644 README.md create mode 100644 apps/accounts/README.md create mode 100644 apps/accounts/package.json create mode 100644 apps/app/README.md create mode 100644 apps/app/package.json create mode 100644 apps/website/README.md create mode 100644 apps/website/package.json create mode 100644 eslint.config.mjs create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 packages/contracts/README.md create mode 100644 packages/contracts/jest.config.js create mode 100644 packages/contracts/package.json create mode 100644 packages/contracts/src/index.ts create mode 100644 packages/contracts/src/schema-name.ts create mode 100644 packages/contracts/tests/schema-name.test.ts create mode 100644 packages/contracts/tsconfig.json create mode 100644 packages/contracts/tsup.config.ts create mode 100644 packages/ui/README.md create mode 100644 packages/ui/package.json create mode 100644 tsconfig.base.json diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..c4c1f90 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,4 @@ +* text=auto eol=lf +*.png binary +*.jpg binary +*.ico binary diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9e4ba97 --- /dev/null +++ b/.gitignore @@ -0,0 +1,27 @@ +# dependencies +node_modules/ + +# env files (never commit real secrets — .env.example files are fine) +.env +.env.* +!.env.example + +# IDE +.idea/ +.vscode/ + +# build output +dist/ +coverage/ +.next/ + +# logs +npm-debug.log* +*.log + +# typescript +*.tsbuildinfo + +# OS +.DS_Store +Thumbs.db diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..daf2cc5 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,13 @@ +# Changelog + +Each package and app has its own section and its own tags (`contracts@1.0.0`, `accounts@1.0.0`, …). + +## Unreleased + +### Monorepo + +- Set up: npm workspaces (`packages/*`, `apps/*`), shared TypeScript, ESLint and Jest setup, + and `npm run check` (lint, typecheck, tests and build). +- `packages/contracts`: package set up with a dual CommonJS / ESM build (tsup) and the + schema-name helpers every contract uses (`crosscode./`). +- `packages/ui`, `apps/accounts`, `apps/website`, `apps/app`: placeholders. diff --git a/README.md b/README.md new file mode 100644 index 0000000..6f33bda --- /dev/null +++ b/README.md @@ -0,0 +1,43 @@ +# Cross Code platform + +The monorepo for the Cross Code products that come after Cross Events, and the formats they share. +The plan is in `hope-events/docs/ROADMAP-v3.md` (decided 2026-11-03). + +| Folder | What | Status | +|--------|------|--------| +| `packages/contracts` | `@crosscode/contracts`: the shared JSON formats (zod schemas, JSON Schema, TypeScript types, sample payloads) used by every product, including Cross Events and the Hub | Phase 0, in progress | +| `packages/ui` | `@crosscode/ui`: shared UI for the Website, App and Accounts | Placeholder, filled in during the Website phase | +| `apps/accounts` | Accounts: the per-church sign-in (OpenID Connect) | Placeholder (phase 3) | +| `apps/website` | Church Website | Placeholder (phase 4) | +| `apps/app` | Church App (PWA) | Placeholder (phase 6) | + +Cross Events (`joshua/hope-events`) and Cross Code Hub (`joshua/events-hub`) stay in their own +repos and install `@crosscode/contracts` from Gitea's package registry. + +## Rules (ROADMAP-v3 §1) + +1. No shared databases, ever. Products only talk over HTTPS using the contracts. +2. The Hub is never on the runtime path. +3. One maintained codebase per product. Nothing is built specially for one church. +4. The origin of a record owns it. Copies elsewhere are read-only and link back to the origin. + +## Working on it + +Node 20 or newer, npm workspaces. + +```bash +npm install +npm run check # lint + typecheck + tests + build, for every workspace +npm run build # build every workspace +npm test # test every workspace +``` + +Work in a workspace with `npm run