feat(node-type-registry): add module presets#1015
Merged
pyramation merged 1 commit intomainfrom Apr 20, 2026
Merged
Conversation
Ships eight curated Constructive module presets as TypeScript metadata in the node-type-registry package: minimal, auth:email, auth:email+magic, auth:sso, auth:passkey, auth:hardened, b2b, full. Each preset is a ModulePreset record with a display_name, a summary, a narrative description, good_for / not_for scenarios, a flat module list, and per-module includes_notes / omits_notes explaining the choices. This is metadata only — passing preset.modules to provision_database_modules is what actually installs them. Exposed via allModulePresets and getModulePreset(name).
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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.
Summary
Ships eight curated Constructive module presets as TypeScript metadata in the
node-type-registrypackage. Presets are documented shapes forprovision_database_modules(v_modules => ...)— they tell a user which modules to install for a recognizable app shape (internal tool, consumer email login, SSO, B2B SaaS, …) and why each module is or isn't included.New package export:
graphql/node-type-registry/src/module-presets/Presets
minimalauth:emailauth:email+magicauth:email+ magic-link / email-OTP nonces.auth:ssoauth:email+ OAuth providers and connected accounts.auth:passkeyauth:email+ WebAuthn.auth:hardenedb2bauth:hardened+ orgs + invites + permissions + levels + profiles + hierarchy.full['all'].Shape
Each preset file has a top-level JSDoc narrative plus per-module
includes_notes/omits_notesrationale, so CLIs / docs /--explainoutput all have a single source of truth.Presets live alongside node types (
authz/,data/,relation/,view/) in the registry package, but are a sibling concept — notNodeTypeDefinitions. Node types are reusable blueprint building blocks; presets are starting points for which modules to install before any blueprint is authored.Follow-up scope explicitly not in this PR: feature-flag / toggle-inside-preset syntax (e.g.
settings?: { app_settings_auth: { allow_password_sign_up: false } }). TheModulePresetshape leaves room to add that later non-breakingly. Source doc with the preset rationale lives in constructive-db docs/architecture/module-presets.md.Review & Testing Checklist for Human
minimal,auth:email,auth:email+magic,auth:sso,auth:passkey,auth:hardened,b2b,full).includes_notes/omits_notesnarratives — they're the user-facing reasoning and should match your mental model.graphql/node-type-registry/src/module-presets/is the right home. Alternative: a new package (@constructive-io/module-presets) orpgpm/export/src/. Easy to move if you'd prefer.Notes
Known caveat: every auth preset currently includes
emails_modulebecause theuser_auth_moduleinsert trigger in constructive-db hard-raisesREQUIRES (emails_module). Pure SSO-only / SMS-only / passkey-only (no emails) needs that trigger loosened — called out as a refactor target in the constructive-db docs. For now, presets reflect what provisioning will actually accept today.Link to Devin session: https://app.devin.ai/sessions/649649b6aa824471adc8a84b563cf58a
Requested by: @pyramation