@foundrynorth/compass-schema
v1.0.41
Published
Canonical Drizzle ORM schema for Foundry Compass (divine-pine database)
Downloads
8,292
Readme
@foundrynorth/compass-schema
Canonical Drizzle ORM schema for the Foundry Compass database (divine-pine-a4rvra4z).
This repo is intentionally lightweight: edit TypeScript in src/, compile to dist/, and publish the package. There are no local database services, Docker Compose files, or migration commands to run here.
Install
npm install @foundrynorth/compass-schemaUsage
import { mediaOrders, partners, plans } from "@foundrynorth/compass-schema";
import { relations } from "@foundrynorth/compass-schema/relations";| Export | Purpose |
|--------|---------|
| @foundrynorth/compass-schema | All table and enum definitions |
| @foundrynorth/compass-schema/relations | Drizzle relation definitions |
Consumers
- fn-legacy (Compass) — uses
shared/schema.tsas a compatibility shim and Drizzle entrypoint - fn-v2 (Trigger.dev tasks)
- Historical fn-worker usage is migration debt only
Contributor Quick Start
Contributor tooling is standardized on Node 20:
.nvmrcpins the local shell version fornvm.devcontainer/devcontainer.jsonuses the same Node 20 baseline- GitHub Actions runs CI on Node 20
The published package still declares node >=18 for consumers, but contributors should use Node 20 so local behavior matches CI.
Local setup
nvm use
npm ci
npm run check
npm run buildDevcontainer setup
Open the repo in a devcontainer if you want an isolated package-only workspace. The container:
- uses the official Node 20 devcontainer image
- runs
npm ciafter creation - does not start any local services
After the container is ready:
npm run check
npm run buildSafe Working Rules
- This package is the canonical Compass schema source.
fn-legacyowns database migrations for Compass. Do not generate or apply migrations from this repo.dist/is committed. When schema or type exports change, rebuild and commit the matchingdist/output with the source change.- Keep git and release work scoped to this package repo. Consumer installs and migration work happen after publish in the consumer repos.
Package Commands
| Command | Purpose |
|---------|---------|
| npm ci | Install locked dependencies |
| npm run check | Type-check without emitting files |
| npm run build | Compile src/ to dist/ |
| npm version patch | Bump the package version for a patch release |
| npm publish | Publish to npm (prepublishOnly runs npm run build) |
Schema Change Workflow
Use this when making a schema or shared-type change in this repo:
- Edit the source in
src/. - Run
npm run check. - Run
npm run build. - Review the generated
dist/changes before committing. - Publish a new package version when the change is ready.
This repo stops at the package boundary. Migration generation and database changes happen later from fn-legacy.
Release Workflow
When you are ready to publish:
- Verify the package is clean with
npm run checkandnpm run build. - Bump the version with
npm version patch(orminor/majoras needed). - Publish with
npm publish. - Update consumers:
cd ~/Developer/fn-legacy && npm install @foundrynorth/compass-schema@latestcd ~/Developer/fn-v2 && pnpm install @foundrynorth/compass-schema@latest
- In
fn-legacy, runnpm run check, thennpm run db:generate, review the generated SQL, and runnpm run db:migrate.
Full Documentation
See:
