Skip to content

feat: Add support for generating files field in package.json and move prisma back to dev dependency#722

Merged
kingston merged 2 commits into
mainfrom
kingston/eng-960-get-generated-backend-app-ready-for-deployment
Dec 29, 2025
Merged

feat: Add support for generating files field in package.json and move prisma back to dev dependency#722
kingston merged 2 commits into
mainfrom
kingston/eng-960-get-generated-backend-app-ready-for-deployment

Conversation

@kingston

@kingston kingston commented Dec 29, 2025

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features

    • Generators now support declaring package "files" so build output and config can be included in published packages.
  • Chores

    • Bumped generator packages to patch releases.
    • Adjusted packaging across examples to include build/prisma artifacts.
    • Moved Prisma to devDependencies where appropriate and updated packaging entries.

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel

vercel Bot commented Dec 29, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
baseplate-project-builder-web Ready Ready Preview, Comment Dec 29, 2025 3:34pm

@changeset-bot

changeset-bot Bot commented Dec 29, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: bd4bd1f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 18 packages
Name Type
@baseplate-dev/fastify-generators Patch
@baseplate-dev/react-generators Patch
@baseplate-dev/core-generators Patch
@baseplate-dev/project-builder-server Patch
@baseplate-dev/plugin-auth Patch
@baseplate-dev/plugin-queue Patch
@baseplate-dev/plugin-storage Patch
@baseplate-dev/create-project Patch
@baseplate-dev/project-builder-cli Patch
@baseplate-dev/project-builder-common Patch
@baseplate-dev/project-builder-test Patch
@baseplate-dev/project-builder-web Patch
@baseplate-dev/code-morph Patch
@baseplate-dev/project-builder-lib Patch
@baseplate-dev/sync Patch
@baseplate-dev/tools Patch
@baseplate-dev/ui-components Patch
@baseplate-dev/utils Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Dec 29, 2025

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Adds support for generating the package.json "files" field in generators, updates generator implementations to populate node.files (including build/dist/prisma paths), moves Prisma from prod → dev dependencies in generator outputs and example backends, and updates example package.json files and changesets accordingly.

Changes

Cohort / File(s) Summary
Changeset docs
\.changeset/some-flowers-double.md, \.changeset/tangy-worms-divide.md
Removed an outdated changeset and added a new changeset marking patch releases for @baseplate-dev/fastify-generators, @baseplate-dev/react-generators, and @baseplate-dev/core-generators with a note about generating files in package.json.
Example admin packages
examples/blog-with-auth/apps/admin/package.json, examples/todo-with-auth0/apps/admin/package.json
Added top-level files field to include build artifacts (e.g., "build/**/*").
Example backend packages
examples/blog-with-auth/apps/backend/package.json, examples/todo-with-auth0/apps/backend/package.json
Replaced some files entries with Prisma paths (prisma.config.ts, prisma/**/*) and moved "prisma": "7.2.0" from dependenciesdevDependencies.
Example web package
examples/todo-with-auth0/apps/web/package.json
Added top-level files field including "build/**/*".
Core generator schema
packages/core-generators/src/generators/node/node/node.generator.ts
Added files property to node package.json schema (string array, duplicates stripped, sorted) and only emits it when non-empty.
Fastify core generator
packages/fastify-generators/src/generators/core/fastify/fastify.generator.ts
Moved dist/**/* into the node.files array and removed the previous hard-coded files entries from extraProperties.
Fastify Prisma generator
packages/fastify-generators/src/generators/prisma/prisma/prisma.generator.ts
Removed prisma from production dependencies and added it to devDependencies in generator output; added prisma/**/* and prisma.config.ts to node.files; postinstall script unchanged.
React generator
packages/react-generators/src/generators/core/react/node.ts
Added build/**/* to node.files so build outputs are tracked in generated package.json files.
Snapshot diff (example)
examples/todo-with-auth0/apps/backend/.baseplate-snapshot/diffs/package.json.diff
Dependency changes in snapshot: removed pg-connection-string, added prisma and sentry-testkit entries (manifest-only changes).

Sequence Diagram(s)

(omitted)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • #480 — Overlaps with fastify-generators' Prisma handling and generator file-list changes.
  • #710 — Related adjustments to Prisma placement and generator outputs for prisma files.
  • #409 — Related changes to package.json files handling and generator-driven file lists.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately summarizes the main changes: it covers both key objectives of adding support for generating files field in package.json and moving prisma to dev dependency.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch kingston/eng-960-get-generated-backend-app-ready-for-deployment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (3)
examples/blog-with-auth/apps/admin/package.json (1)

8-10: Consider whether the files field is needed for a private package.

The files field specifies which files are included when publishing to npm. Since this package is marked as "private": true, it won't be published, making this field currently unnecessary. However, if this is intended for other tooling or future use, this is fine.

examples/todo-with-auth0/apps/admin/package.json (1)

8-10: Consider whether the files field is needed for a private package.

The files field specifies which files are included when publishing to npm. Since this package is marked as "private": true, it won't be published, making this field currently unnecessary. However, if this is intended for other tooling or future use, this is fine.

examples/todo-with-auth0/apps/web/package.json (1)

8-10: Consider whether the files field is needed for a private package.

The files field specifies which files are included when publishing to npm. Since this package is marked as "private": true, it won't be published, making this field currently unnecessary. However, if this is intended for other tooling or future use, this is fine.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between d0302cb and a7aa017.

⛔ Files ignored due to path filters (12)
  • examples/blog-with-auth/apps/admin/baseplate/generated/package.json is excluded by !**/generated/**, !**/generated/**
  • examples/blog-with-auth/apps/backend/baseplate/generated/package.json is excluded by !**/generated/**, !**/generated/**
  • examples/blog-with-auth/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • examples/todo-with-auth0/apps/admin/baseplate/generated/package.json is excluded by !**/generated/**, !**/generated/**
  • examples/todo-with-auth0/apps/backend/baseplate/generated/package.json is excluded by !**/generated/**, !**/generated/**
  • examples/todo-with-auth0/apps/web/baseplate/generated/package.json is excluded by !**/generated/**, !**/generated/**
  • examples/todo-with-auth0/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • tests/simple/apps/backend/baseplate/generated/package.json is excluded by !**/generated/**, !tests/**, !**/generated/**
  • tests/simple/apps/backend/package.json is excluded by !tests/**
  • tests/simple/apps/web/baseplate/generated/package.json is excluded by !**/generated/**, !tests/**, !**/generated/**
  • tests/simple/apps/web/package.json is excluded by !tests/**
  • tests/simple/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml, !tests/**
📒 Files selected for processing (11)
  • .changeset/some-flowers-double.md
  • .changeset/tangy-worms-divide.md
  • examples/blog-with-auth/apps/admin/package.json
  • examples/blog-with-auth/apps/backend/package.json
  • examples/todo-with-auth0/apps/admin/package.json
  • examples/todo-with-auth0/apps/backend/package.json
  • examples/todo-with-auth0/apps/web/package.json
  • packages/core-generators/src/generators/node/node/node.generator.ts
  • packages/fastify-generators/src/generators/core/fastify/fastify.generator.ts
  • packages/fastify-generators/src/generators/prisma/prisma/prisma.generator.ts
  • packages/react-generators/src/generators/core/react/node.ts
💤 Files with no reviewable changes (1)
  • .changeset/some-flowers-double.md
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/code-style.mdc)

**/*.{ts,tsx}: Use TypeScript with strict type checking enabled
Always include return types on top-level functions including React components (React.ReactElement)
Include absolute paths in import statements via tsconfig paths (@src/ is the alias for src/)
If a particular interface or type is not exported, change the file so it is exported
If caught on a typing loop where forcing the any type is necessary, do not iterate too much - leave the typing as broken and let the user fix it

If target code is not easily testable, refactor it to be more testable (e.g., export types or functions)

**/*.{ts,tsx}: Import components from '@baseplate-dev/ui-components' package for UI development (e.g., Button, Input, Card, Dialog, etc.)
Use form components with React Hook Form controller variants (InputField, TextareaField, SelectField, CheckboxField, SwitchField, ComboboxField, MultiComboboxField, ColorPickerField, DatePickerField, DateTimePickerField)
Use SidebarLayout, Card, Breadcrumb, NavigationMenu, and NavigationTabs components for consistent layout structure from @baseplate-dev/ui-components
Use Dialog, ConfirmDialog, and useConfirmDialog from @baseplate-dev/ui-components for modal dialogs and confirmation interactions
Always use compareStrings from @baseplate-dev/utils instead of String.prototype.localeCompare() for code generation, file sorting, and internal data structures
If a particular interface or type is not exported, modify the file to export it
Use TsCodeFragment for composable code pieces and TsCodeUtils for manipulating fragments when generating TypeScript code
Create generators using createGenerator with configuration via descriptor schema (Zod), organizing into one or more tasks created with createGeneratorTask
Tasks should have run (initialization) and build (code generation) phases, export and consume providers, and may be organized into phases for ordered execution
Use provider scopes to control visibility and prevent collisions be...

Files:

  • packages/fastify-generators/src/generators/prisma/prisma/prisma.generator.ts
  • packages/core-generators/src/generators/node/node/node.generator.ts
  • packages/fastify-generators/src/generators/core/fastify/fastify.generator.ts
  • packages/react-generators/src/generators/core/react/node.ts
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/code-style.mdc)

**/*.{ts,tsx,js}: Node 16 module resolution - include file extensions in imports (.js)
Sort imports by group: external libs first, then local imports
Use camelCase for variables/functions, PascalCase for types/classes
Order functions such that functions are placed below the variables/functions they use
Prefer using nullish coalescing operator (??) instead of logical or (||), enforced via ESLint rule
Prefer barrel exports e.g. export * from './foo.js' instead of individual named exports
Use console.info/warn/error instead of console.log

Files:

  • packages/fastify-generators/src/generators/prisma/prisma/prisma.generator.ts
  • packages/core-generators/src/generators/node/node/node.generator.ts
  • packages/fastify-generators/src/generators/core/fastify/fastify.generator.ts
  • packages/react-generators/src/generators/core/react/node.ts
.changeset/*.md

📄 CodeRabbit inference engine (AGENTS.md)

Add a new Changeset in the .changeset/ directory for new features or changes, with format 'package-name': patch and description of the feature or change

Files:

  • .changeset/tangy-worms-divide.md
examples/blog-with-auth/**/package.json

📄 CodeRabbit inference engine (examples/blog-with-auth/CLAUDE.md)

examples/blog-with-auth/**/package.json: Enforce pnpm 10+ as the package manager
Use ESM only with "type": "module" in package.json

Files:

  • examples/blog-with-auth/apps/admin/package.json
  • examples/blog-with-auth/apps/backend/package.json
🧠 Learnings (36)
📓 Common learnings
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T22:46:20.505Z
Learning: Baseplate development follows a code-first approach: make changes directly in working codebases, extract those changes into reusable templates, update generators to use the new templates, then validate and sync the generated code
📚 Learning: 2025-11-24T19:44:33.994Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/blog-with-auth/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:33.994Z
Learning: Applies to examples/blog-with-auth/**/package.json : Use ESM only with `"type": "module"` in package.json

Applied to files:

  • examples/todo-with-auth0/apps/web/package.json
  • examples/todo-with-auth0/apps/admin/package.json
  • examples/blog-with-auth/apps/admin/package.json
  • examples/blog-with-auth/apps/backend/package.json
📚 Learning: 2025-11-24T19:44:46.506Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/todo-with-auth0/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:46.506Z
Learning: Applies to examples/todo-with-auth0/**/*.{ts,tsx} : Add JSDocs to all exported functions, interfaces, and classes with documentation of the function, its parameters, return value, and all fields

Applied to files:

  • examples/todo-with-auth0/apps/web/package.json
  • examples/todo-with-auth0/apps/backend/package.json
  • examples/todo-with-auth0/apps/admin/package.json
📚 Learning: 2025-11-24T19:44:33.994Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/blog-with-auth/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:33.994Z
Learning: Applies to examples/blog-with-auth/**/package.json : Enforce pnpm 10+ as the package manager

Applied to files:

  • examples/todo-with-auth0/apps/web/package.json
  • examples/todo-with-auth0/apps/admin/package.json
  • examples/blog-with-auth/apps/admin/package.json
  • examples/blog-with-auth/apps/backend/package.json
📚 Learning: 2025-11-25T22:46:20.505Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T22:46:20.505Z
Learning: Applies to .changeset/*.md : Add a new Changeset in the `.changeset/` directory for new features or changes, with format `'package-name': patch` and description of the feature or change

Applied to files:

  • examples/todo-with-auth0/apps/web/package.json
  • .changeset/tangy-worms-divide.md
  • examples/blog-with-auth/apps/admin/package.json
📚 Learning: 2025-05-08T12:56:11.723Z
Learnt from: kingston
Repo: halfdomelabs/baseplate PR: 539
File: scripts/check-changesets.ts:70-79
Timestamp: 2025-05-08T12:56:11.723Z
Learning: In the check-changesets.ts script for monorepo validation, `npm pack ${pkg.name}latest` is intentionally used to pack the most recently published version (not local changes) for comparison purposes to determine if changes require new changesets.

Applied to files:

  • examples/todo-with-auth0/apps/web/package.json
📚 Learning: 2025-11-24T19:44:46.506Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/todo-with-auth0/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:46.506Z
Learning: Applies to examples/todo-with-auth0/**/*.{unit,int}.test.ts : Use `.unit.test.ts` or `.int.test.ts` suffixes for test files in TypeScript

Applied to files:

  • examples/todo-with-auth0/apps/web/package.json
  • examples/todo-with-auth0/apps/admin/package.json
📚 Learning: 2025-11-24T19:44:46.506Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/todo-with-auth0/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:46.506Z
Learning: Applies to examples/todo-with-auth0/**/*.{ts,tsx} : Use `import type` for type-only imports

Applied to files:

  • examples/todo-with-auth0/apps/web/package.json
  • examples/todo-with-auth0/apps/admin/package.json
📚 Learning: 2025-11-24T19:44:46.506Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/todo-with-auth0/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:46.506Z
Learning: Applies to examples/todo-with-auth0/**/*.{unit,int}.test.ts : Import test functions explicitly from 'vitest' instead of using globals. Example: `import { describe, expect, it } from 'vitest';`

Applied to files:

  • examples/todo-with-auth0/apps/web/package.json
  • examples/todo-with-auth0/apps/backend/package.json
  • examples/todo-with-auth0/apps/admin/package.json
📚 Learning: 2025-11-24T19:44:33.994Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/blog-with-auth/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:33.994Z
Learning: Applies to examples/blog-with-auth/**/tsconfig.json : Enable `isolatedModules` in TypeScript configuration

Applied to files:

  • examples/todo-with-auth0/apps/web/package.json
  • examples/todo-with-auth0/apps/admin/package.json
  • examples/blog-with-auth/apps/admin/package.json
📚 Learning: 2025-11-24T19:44:46.506Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/todo-with-auth0/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:46.506Z
Learning: Applies to examples/todo-with-auth0/**/*.{ts,tsx,js,jsx} : Always use .js extensions in import statements, even for TypeScript files. Example: `import { getSystemInfo } from 'src/system-info.js';`

Applied to files:

  • examples/todo-with-auth0/apps/web/package.json
  • examples/todo-with-auth0/apps/admin/package.json
📚 Learning: 2025-11-24T19:44:33.994Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/blog-with-auth/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:33.994Z
Learning: Applies to examples/blog-with-auth/**/*.{ts,tsx,js,jsx} : Follow ESM module resolution with TypeScript's `NodeNext` setting

Applied to files:

  • examples/todo-with-auth0/apps/web/package.json
  • examples/todo-with-auth0/apps/backend/package.json
  • examples/todo-with-auth0/apps/admin/package.json
  • examples/blog-with-auth/apps/admin/package.json
  • packages/react-generators/src/generators/core/react/node.ts
  • examples/blog-with-auth/apps/backend/package.json
📚 Learning: 2025-11-24T19:44:33.994Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/blog-with-auth/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:33.994Z
Learning: Applies to examples/blog-with-auth/**/tsconfig.json : Use `NodeNext` module resolution in TypeScript configuration

Applied to files:

  • examples/todo-with-auth0/apps/web/package.json
  • examples/todo-with-auth0/apps/backend/package.json
  • examples/todo-with-auth0/apps/admin/package.json
  • examples/blog-with-auth/apps/admin/package.json
  • packages/react-generators/src/generators/core/react/node.ts
  • examples/blog-with-auth/apps/backend/package.json
📚 Learning: 2025-11-25T22:46:20.505Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T22:46:20.505Z
Learning: Applies to **/*.{ts,tsx} : Tasks should have `run` (initialization) and `build` (code generation) phases, export and consume providers, and may be organized into phases for ordered execution

Applied to files:

  • examples/todo-with-auth0/apps/web/package.json
  • examples/todo-with-auth0/apps/backend/package.json
  • examples/todo-with-auth0/apps/admin/package.json
  • packages/fastify-generators/src/generators/prisma/prisma/prisma.generator.ts
  • packages/react-generators/src/generators/core/react/node.ts
  • examples/blog-with-auth/apps/backend/package.json
📚 Learning: 2025-11-24T19:44:33.994Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/blog-with-auth/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:33.994Z
Learning: Applies to examples/blog-with-auth/**/tsconfig.json : Use strict type checking in TypeScript configuration

Applied to files:

  • examples/todo-with-auth0/apps/web/package.json
  • examples/todo-with-auth0/apps/backend/package.json
  • examples/todo-with-auth0/apps/admin/package.json
  • examples/blog-with-auth/apps/admin/package.json
  • examples/blog-with-auth/apps/backend/package.json
📚 Learning: 2025-11-24T19:45:01.582Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-11-24T19:45:01.582Z
Learning: Applies to **/*.{ts,tsx} : Include absolute paths in import statements via tsconfig paths (`src/` is the alias for `src/`)

Applied to files:

  • examples/todo-with-auth0/apps/backend/package.json
  • packages/react-generators/src/generators/core/react/node.ts
  • examples/blog-with-auth/apps/backend/package.json
📚 Learning: 2025-06-03T09:11:29.651Z
Learnt from: kingston
Repo: halfdomelabs/baseplate PR: 562
File: plugins/plugin-auth/package.json:32-36
Timestamp: 2025-06-03T09:11:29.651Z
Learning: With TypeScript project references, TypeScript compilation is watched from the root level using "watch:tsc:root" script, so individual packages no longer need to include their "tsc:watch" scripts in their local "watch" commands. The local "tsc:watch" scripts are renamed from "watch:tsc" but are not meant to be run as part of the package's watch command since TypeScript watching is handled centrally at the workspace root.

Applied to files:

  • examples/todo-with-auth0/apps/backend/package.json
  • examples/blog-with-auth/apps/backend/package.json
📚 Learning: 2025-11-24T19:45:01.582Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-11-24T19:45:01.582Z
Learning: Applies to **/*.{ts,tsx,js} : Node 16 module resolution - include file extensions in imports (`.js`)

Applied to files:

  • examples/todo-with-auth0/apps/backend/package.json
  • packages/fastify-generators/src/generators/core/fastify/fastify.generator.ts
  • packages/react-generators/src/generators/core/react/node.ts
  • examples/blog-with-auth/apps/backend/package.json
📚 Learning: 2025-04-21T06:32:22.476Z
Learnt from: kingston
Repo: halfdomelabs/baseplate PR: 505
File: packages/create-project/tsconfig.json:6-6
Timestamp: 2025-04-21T06:32:22.476Z
Learning: Since TypeScript 4.1, baseUrl is not required for paths mapping in tsconfig.json. Removing baseUrl and using explicit relative paths with "./" prefix (e.g., changing "src/*": ["src/*"] to "src/*": ["./src/*"]) prevents bare path imports from node_modules while maintaining path alias functionality.

Applied to files:

  • examples/todo-with-auth0/apps/backend/package.json
  • examples/blog-with-auth/apps/backend/package.json
📚 Learning: 2025-01-23T09:12:46.178Z
Learnt from: kingston
Repo: halfdomelabs/baseplate PR: 428
File: packages/project-builder-server/src/sync/index.ts:5-5
Timestamp: 2025-01-23T09:12:46.178Z
Learning: Avoid importing directly from 'dist' directories. Instead, expose functionality through the package's public API and import from the main package entry point.

Applied to files:

  • examples/todo-with-auth0/apps/backend/package.json
  • packages/fastify-generators/src/generators/core/fastify/fastify.generator.ts
  • examples/blog-with-auth/apps/backend/package.json
📚 Learning: 2025-11-24T19:44:46.506Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/todo-with-auth0/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:46.506Z
Learning: Use pnpm 10+ as the package manager (enforced)

Applied to files:

  • examples/todo-with-auth0/apps/backend/package.json
  • packages/fastify-generators/src/generators/prisma/prisma/prisma.generator.ts
  • examples/blog-with-auth/apps/backend/package.json
📚 Learning: 2025-11-25T22:46:20.505Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T22:46:20.505Z
Learning: Applies to **/*.{ts,tsx} : Create generators using `createGenerator` with configuration via descriptor schema (Zod), organizing into one or more tasks created with `createGeneratorTask`

Applied to files:

  • packages/fastify-generators/src/generators/prisma/prisma/prisma.generator.ts
  • .changeset/tangy-worms-divide.md
📚 Learning: 2025-11-25T22:46:20.505Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T22:46:20.505Z
Learning: Follow task-based architecture for generators, use provider scopes for explicit wiring, leverage TypeScript rendering system for code generation, organize complex generation with Task Phases, and use Dynamic Tasks for data-driven generation

Applied to files:

  • packages/fastify-generators/src/generators/prisma/prisma/prisma.generator.ts
📚 Learning: 2025-11-25T22:46:20.505Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T22:46:20.505Z
Learning: Applies to **/*.{ts,tsx} : Use Dynamic Tasks for data-driven generation where code generation is driven by data

Applied to files:

  • packages/fastify-generators/src/generators/prisma/prisma/prisma.generator.ts
  • packages/react-generators/src/generators/core/react/node.ts
📚 Learning: 2025-11-24T19:45:08.523Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/dev-commands.mdc:0-0
Timestamp: 2025-11-24T19:45:08.523Z
Learning: Build the project using `pnpm build` from repository root or package

Applied to files:

  • packages/fastify-generators/src/generators/prisma/prisma/prisma.generator.ts
  • packages/react-generators/src/generators/core/react/node.ts
📚 Learning: 2025-11-25T22:46:20.505Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T22:46:20.505Z
Learning: Baseplate development follows a code-first approach: make changes directly in working codebases, extract those changes into reusable templates, update generators to use the new templates, then validate and sync the generated code

Applied to files:

  • .changeset/tangy-worms-divide.md
📚 Learning: 2025-11-24T19:44:33.994Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/blog-with-auth/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:33.994Z
Learning: Applies to examples/blog-with-auth/**/*.{ts,tsx} : Use `import type` for type-only imports in TypeScript

Applied to files:

  • examples/blog-with-auth/apps/admin/package.json
📚 Learning: 2025-11-24T19:44:33.994Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/blog-with-auth/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:33.994Z
Learning: Applies to examples/blog-with-auth/**/*.{unit,int}.test.ts : Use `.unit.test.ts` or `.int.test.ts` suffixes for test files and collocate tests with source files

Applied to files:

  • examples/blog-with-auth/apps/admin/package.json
📚 Learning: 2025-11-24T19:44:33.994Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/blog-with-auth/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:33.994Z
Learning: Applies to examples/blog-with-auth/**/*.{ts,tsx,js,jsx} : Add JSDocs to all exported functions, interfaces, and classes with documentation of the function, its parameters, return value, and all fields

Applied to files:

  • examples/blog-with-auth/apps/admin/package.json
📚 Learning: 2025-11-25T22:46:20.505Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T22:46:20.505Z
Learning: Applies to **/*.{ts,tsx} : Run `pnpm lint:affected` and `pnpm typecheck` before committing changes

Applied to files:

  • packages/react-generators/src/generators/core/react/node.ts
📚 Learning: 2025-04-23T06:44:30.952Z
Learnt from: kingston
Repo: halfdomelabs/baseplate PR: 510
File: packages/project-builder-server/src/sync/conflict-file-monitor.test.ts:19-24
Timestamp: 2025-04-23T06:44:30.952Z
Learning: When testing file operations in this codebase, the pattern is to use Vitest automocks for 'node:fs' and 'node:fs/promises' (without explicit implementation replacement) while populating a virtual filesystem with vol.fromJSON() from memfs. File operations in tests are performed directly via vol.promises methods.

Applied to files:

  • packages/react-generators/src/generators/core/react/node.ts
📚 Learning: 2025-06-30T11:52:28.745Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-06-30T11:52:28.745Z
Learning: Applies to **/*.test.{ts,tsx} : For file system operations in tests, use memfs and mock 'node:fs' and 'node:fs/promises' with vi.mock

Applied to files:

  • packages/react-generators/src/generators/core/react/node.ts
📚 Learning: 2025-04-23T06:44:30.952Z
Learnt from: kingston
Repo: halfdomelabs/baseplate PR: 510
File: packages/project-builder-server/src/sync/conflict-file-monitor.test.ts:19-24
Timestamp: 2025-04-23T06:44:30.952Z
Learning: In this codebase, when testing file operations, Vitest's automocks for 'node:fs' and 'node:fs/promises' are used in conjunction with memfs, but without replacing the mock implementation explicitly in each test file. The virtual filesystem is populated using vol.fromJSON or similar methods, which works seamlessly with the automocks.

Applied to files:

  • packages/react-generators/src/generators/core/react/node.ts
📚 Learning: 2025-11-24T19:45:19.136Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-11-24T19:45:19.136Z
Learning: Applies to **/*.{unit,int}.test.{ts,tsx} : For file system operations in tests, use memfs and mock `node:fs` and `node:fs/promises`

Applied to files:

  • packages/react-generators/src/generators/core/react/node.ts
📚 Learning: 2025-05-08T12:56:23.394Z
Learnt from: kingston
Repo: halfdomelabs/baseplate PR: 539
File: scripts/check-changesets.ts:111-124
Timestamp: 2025-05-08T12:56:23.394Z
Learning: Node.js 22.0.0 and later versions provide native glob functionality via `fs.glob` method in the `node:fs/promises` module, allowing pattern matching without requiring external dependencies.

Applied to files:

  • packages/react-generators/src/generators/core/react/node.ts
📚 Learning: 2025-05-08T12:56:23.394Z
Learnt from: kingston
Repo: halfdomelabs/baseplate PR: 539
File: scripts/check-changesets.ts:111-124
Timestamp: 2025-05-08T12:56:23.394Z
Learning: Node.js 22.0.0 and later versions provide native glob functionality via `fs.glob` and `fs.globSync` methods in the `node:fs` module, allowing pattern matching without external dependencies.

Applied to files:

  • packages/react-generators/src/generators/core/react/node.ts
🧬 Code graph analysis (1)
packages/fastify-generators/src/generators/prisma/prisma/prisma.generator.ts (1)
packages/fastify-generators/src/constants/fastify-packages.ts (1)
  • FASTIFY_PACKAGES (1-84)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: Lint Examples (todo-with-auth0)
  • GitHub Check: Lint Examples (blog-with-auth)
  • GitHub Check: Verify Sync (todo-with-auth0)
  • GitHub Check: Verify Sync (blog-with-auth)
  • GitHub Check: test
  • GitHub Check: Test E2E
  • GitHub Check: Lint
🔇 Additional comments (11)
packages/core-generators/src/generators/node/node/node.generator.ts (2)

60-63: LGTM! Clean schema definition for files field.

The files field is properly defined with duplicate stripping enabled, which prevents accidental duplicates from multiple generators.


208-211: LGTM! Proper conditional handling of files field.

The logic correctly:

  • Sorts the array for deterministic output
  • Omits the field entirely when empty (cleaner package.json)
  • Includes sorted files when non-empty
packages/react-generators/src/generators/core/react/node.ts (1)

42-42: LGTM! Correct inclusion of Vite build artifacts.

The build/**/* pattern correctly includes all Vite build output files in the package.

packages/fastify-generators/src/generators/core/fastify/fastify.generator.ts (1)

116-116: LGTM! Correct migration to centralized files handling.

The change correctly adds distribution files to node.files, which aligns with the new centralized packaging approach. The explicit files declaration was appropriately removed from extraProperties.

packages/fastify-generators/src/generators/prisma/prisma/prisma.generator.ts (2)

105-111: LGTM! Correct separation of Prisma dependencies.

The change correctly:

  • Keeps @prisma/client and @prisma/adapter-pg as production dependencies (runtime)
  • Moves prisma CLI to dev dependencies (build-time only)

This aligns with best practices and reduces production bundle size.


116-116: LGTM! Proper inclusion of Prisma schema files.

Adding prisma/**/* and prisma.config.ts to the files list ensures the Prisma schema and configuration are included in the package, which is necessary for the postinstall script to run prisma generate.

.changeset/tangy-worms-divide.md (1)

1-7: LGTM! Proper changeset documentation.

The changeset correctly documents:

  • All three affected generator packages
  • Appropriate patch version bump for this enhancement
  • Clear description of the feature
examples/todo-with-auth0/apps/backend/package.json (2)

9-13: Verify that Prisma schema files are needed in deployment artifacts.

The files field now includes prisma.config.ts and prisma/**/*. For typical application deployments, these files are only needed if:

  • The application runs migrations at runtime (not recommended)
  • The deployment process generates the Prisma client post-deployment

Most production deployments only need the compiled code (dist/**/*) and the pre-generated Prisma Client (in node_modules/@prisma/client), not the schema files.

Run the following to verify if these files are actively used in the deployment or runtime workflows:

#!/bin/bash
# Check if prisma schema is referenced in production code or deployment scripts
rg -n --type=ts --type=js -g '!*.test.*' -g '!*.spec.*' 'prisma/schema|prisma.config' examples/todo-with-auth0/apps/backend/

21-21: The deployment workflow correctly handles Prisma client generation.

The Dockerfile's build sequence (lines 11–19) installs all dependencies including the Prisma CLI before the pnpm deploy --prod step, ensuring the postinstall script on line 21 executes successfully during the build phase. The generated Prisma client is then included in the deployed artifacts.

The concern about pnpm install --prod failing is not applicable here—the Docker build process does not run a production-only install that would skip postinstall, and the explicit copy of Prisma schemas (line 26) further ensures the client is available in production.

examples/blog-with-auth/apps/backend/package.json (2)

9-13: Clarify the deployment strategy for Prisma schema files and postinstall generation.

The files field includes prisma.config.ts and prisma/**/*, but prisma is in devDependencies. The postinstall script runs prisma generate, which requires both the Prisma CLI and schema files. This setup only works if the application runs pnpm install (full installation) at deployment—if deployment uses pnpm install --prod, the Prisma CLI won't be available and the schema files won't be used.

Verify your deployment process:

  • If deploying with pnpm install --prod: Remove prisma.config.ts and prisma/**/* from the files field, and ensure the Prisma Client is pre-generated during the build step.
  • If deploying with full pnpm install: Consider if regenerating Prisma Client at runtime is necessary, or if it should be pre-generated during CI/build.

21-21: The deployment process correctly handles Prisma client generation. The Dockerfile performs a full dependency install during the build phase (line 24) where the postinstall script successfully executes and generates the Prisma client. The subsequent pnpm deploy --prod step (line 33) copies the generated client as part of node_modules to production without needing to re-run postinstall. No changes required.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
examples/todo-with-auth0/apps/backend/.baseplate-snapshot/diffs/package.json.diff (1)

9-10: Consider consistent version pinning strategy.

The dependencies use different pinning strategies: prisma uses exact version (7.2.0) while sentry-testkit uses caret range (^6.2.2). If this is intentional to lock Prisma's version, that's fine; otherwise, consider aligning the approach across devDependencies.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between a7aa017 and bd4bd1f.

📒 Files selected for processing (1)
  • examples/todo-with-auth0/apps/backend/.baseplate-snapshot/diffs/package.json.diff
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T22:46:20.505Z
Learning: Baseplate development follows a code-first approach: make changes directly in working codebases, extract those changes into reusable templates, update generators to use the new templates, then validate and sync the generated code
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T22:46:20.505Z
Learning: Applies to **/*.{ts,tsx} : Create generators using `createGenerator` with configuration via descriptor schema (Zod), organizing into one or more tasks created with `createGeneratorTask`
📚 Learning: 2025-11-24T19:44:33.994Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/blog-with-auth/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:33.994Z
Learning: Applies to examples/blog-with-auth/**/package.json : Enforce pnpm 10+ as the package manager

Applied to files:

  • examples/todo-with-auth0/apps/backend/.baseplate-snapshot/diffs/package.json.diff
🔇 Additional comments (1)
examples/todo-with-auth0/apps/backend/.baseplate-snapshot/diffs/package.json.diff (1)

9-9: Prisma 7.2.0 is the latest stable version available with no deprecation warnings. It requires Node.js ^20.19, ^22.12, or >=24.0, which are reasonable for modern projects. No security advisories detected.

@kingston kingston merged commit 8622c4e into main Dec 29, 2025
16 checks passed
@kingston kingston deleted the kingston/eng-960-get-generated-backend-app-ready-for-deployment branch December 29, 2025 15:47
@github-actions github-actions Bot mentioned this pull request Dec 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant