Prepare DrFed for collaborative development#14
Open
dahlia wants to merge 9 commits into
Open
Conversation
- New @drfed/models package with Drizzle ORM schema defining accounts, instances, and instance_members tables (PostgreSQL), with support for both PGlite (local file-based) and PostgreSQL backends, plus database/transaction type definitions and an initial migration - New @drfed/drfed package: main server CLI using srvx and GraphQL Yoga, with @optique-based argument parsing for database backend selection (--pglite-data-path or --postgres-url), listen address (--listen), and migration control (--no-migrate) - Expanded @drfed/graphql with a Pothos SchemaBuilder integrated with the Drizzle plugin for type-safe GraphQL schema generation, and a createYogaServer() factory function wiring it all together - Added .oxfmtrc.json formatter config and .zed/settings.json with per-language format-on-save via oxfmt - Updated mise.toml and pnpm workspace to include the new packages
- Add @pothos/plugin-relay and graphql-scalars dependencies - Add DateTime, Email, UUID custom scalar types to the schema builder - Rename PothosTypes to SchemaTypes and add Scalars definition - Implement Account drizzleNode with UUID, email, created fields - Add accountByUuid query field - Refactor Instance to drizzleNode with slug, expires, created fields - Add normalizeEmail() utility function to @drfed/models - Export normalizeEmail from @drfed/models package index
Replace the Nushell-based dev task with a Node.js/TypeScript script (scripts/dev.mts) that provides more robust process management: - Remove dist directories before starting builds - Spawn tsdown in watch mode across all packages - Poll until all packages have built their dist directories - Start the drfed server once builds are ready - Propagate SIGINT/SIGTERM gracefully to child process groups, with a 5-second timeout before force-killing - Handle double Ctrl+C with an immediate forced kill - Cross-platform support (Windows taskkill, Unix process groups) Also handle SIGINT (in addition to SIGTERM) in the server's main() to ensure clean shutdown when running under node --watch. Assisted-by: Codex:gpt-5.5
Document the DrFed development workflow, including mise-based tasks, package boundaries, AGPL source headers, npm packaging expectations, and AI usage disclosure rules. Point AGENTS.md and CLAUDE.md at the same guide, and exclude those symlinks from Hongdown so Markdown checks validate the source document once. Assisted-by: Codex:gpt-5.5
Add package-level tsconfig files with strict no-emit type checking and allowImportingTsExtensions enabled for local .ts imports. Wire Node 26 types through the pnpm catalog, add the mise type check, and update imports that must be type-only under verbatimModuleSyntax. Also fix the development script's child-process error result typing and process lookup error handling so it passes the stricter checks.
2chanhaeng
reviewed
Jun 20, 2026
2chanhaeng
left a comment
Member
There was a problem hiding this comment.
Looks great! The code and the flow seem solid. I think it would be even better if more documentation for the code were added.
- CONTRIBUTING.md: descriptions for each package
- README.md for each package
@drfed/models: descriptions for each model and their relationships@drfed/graphql: descriptions for each node
Added a concise README.md to each of the three packages: - packages/drfed/README.md: documents the CLI options, server startup behavior, and source file layout for @drfed/drfed. - packages/graphql/README.md: documents the custom scalars, source layout, and createYogaServer usage for @drfed/graphql. - packages/models/README.md: documents the database schema, source layout, and migration generation for @drfed/models. Added a Packages section to CONTRIBUTING.md with a table summarising each package's directory path, npm name, and one-line description. Also added README.md to the files list in each package.json so the documentation is included in published npm packages. Assisted-by: Claude Code:claude-sonnet-4-6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request sets up the project so other contributors can work against the same local workflow, package boundaries, and contribution rules.
It adds the first installable server and model packages, wires the GraphQL layer to the database schema, and gives contributors a documented path for building, running, formatting, and reviewing changes.
What changed
@drfed/models, including the Drizzle schema for accounts, instances, and instance members, database type exports, email normalization, migration support, and the initial generated migration under packages/models/drizzle.@drfed/drfed, the main server package with thedrfed-servernpm binary, Optique-based CLI parsing, PGlite and PostgreSQL database options, automatic migration support, and GraphQL Yoga serving throughsrvx.@drfed/graphqlwith a Pothos schema builder, Drizzle integration, Relay node support,DateTime,Email, andUUIDscalars, Account and Instance object types, and anaccountByUuidquery.tsdown --watchbuilds, waits for the packages to build, starts the server, and handles shutdown more reliably.Checks
mise run checkmise run buildAI disclosure
scripts/dev.mts and CONTRIBUTING.md were written with GPT-5.5 assistance. The README.md file in each package was written with Claude Sonnet 4.6. assistance. No AI assistance was used for the other changes in this pull request.