Skip to content

Conversation

@kingston
Copy link
Collaborator

@kingston kingston commented Oct 15, 2025

Summary by CodeRabbit

  • Refactor

    • Generated Fastify backends now use native ESM; example backends migrated accordingly.
    • Standardized instrumentation startup via Node --import and corrected production instrument path.
    • Normalized template/config filenames from .mjs/.mts to .js/.ts.
  • Chores

    • Dependency refresh across generators and examples (e.g., Redis clients, nanoid, tsx, vitest-mock-extended).
    • Workspace catalog updated for tsx.
  • Tests

    • Updated test imports to ESM-compatible paths.
    • Added Sentry testkit to an example backend for improved testing.

@changeset-bot
Copy link

changeset-bot bot commented Oct 15, 2025

🦋 Changeset detected

Latest commit: 973b051

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 Minor
@baseplate-dev/project-builder-server Minor
@baseplate-dev/plugin-auth Major
@baseplate-dev/plugin-queue Major
@baseplate-dev/plugin-storage Major
@baseplate-dev/project-builder-cli Minor
@baseplate-dev/project-builder-common Minor
@baseplate-dev/project-builder-test Minor
@baseplate-dev/project-builder-web Minor
@baseplate-dev/create-project Minor
@baseplate-dev/code-morph Minor
@baseplate-dev/core-generators Minor
@baseplate-dev/project-builder-lib Minor
@baseplate-dev/react-generators Minor
@baseplate-dev/sync Minor
@baseplate-dev/tools Minor
@baseplate-dev/ui-components Minor
@baseplate-dev/utils Minor

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

@vercel
Copy link

vercel bot commented Oct 15, 2025

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

Project Deployment Preview Comments Updated (UTC)
baseplate-project-builder-web Ready Ready Preview Comment Oct 15, 2025 0:05am

@coderabbitai
Copy link

coderabbitai bot commented Oct 15, 2025

Walkthrough

The PR updates package versions and generator constants, switches generated/templated Fastify backends to ESM, adjusts instrumentation loading to use Node’s --import with .js paths, renames template/config filenames (eslint.config.mjs→.js, vitest.config.mts→.ts), and updates example apps accordingly, including import specifiers with .js extensions.

Changes

Cohort / File(s) Summary
Changesets
.changeset/loud-doodles-train.md, .changeset/sixty-wasps-clean.md, .changeset/twenty-dingos-give.md
Records dependency bumps (tsx, ioredis, ioredis-mock), a minor bump for @baseplate-dev/fastify-generators, and notes backend switch to ESM.
Example admin apps: nanoid bump
examples/blog-with-auth/packages/admin/package.json, examples/todo-with-auth0/packages/admin/package.json
nanoid upgraded 3.3.8 → 5.1.6.
Template key renames (eslint/vitest)
examples/blog-with-auth/packages/backend/.templates-info.json, examples/todo-with-auth0/packages/backend/.templates-info.json
Renames keys: eslint.config.mjs → eslint.config.js; vitest.config.mts → vitest.config.ts.
Template file-id mappings updated
examples/blog-with-auth/packages/backend/baseplate/file-id-map.json, examples/todo-with-auth0/packages/backend/baseplate/file-id-map.json
Updates mapped values to eslint.config.js and vitest.config.ts.
ESLint config defaults adjusted
examples/blog-with-auth/packages/backend/eslint.config.js, examples/todo-with-auth0/packages/backend/eslint.config.js
Replace/remove vitest.config.mts; reference vitest.config.ts (now duplicated in list).
Backend package ESM + scripts/instrumentation
examples/blog-with-auth/packages/backend/package.json, examples/todo-with-auth0/packages/backend/package.json
Set "type": "module"; add Node --import for instrumentation (dev and start); bump deps (nanoid, tsx, vitest-mock-extended; plus ioredis/ioredis-mock in todo-with-auth0).
Remove hoisted instrumentation import
examples/.../packages/backend/src/index.ts (both examples)
Deletes top-level import/hoist of instrument; app entry unchanged otherwise.
Test imports use explicit .js
examples/todo-with-auth0/packages/backend/src/services/sentry.e2e.test.ts, .../sentry.instrument.test-helper.ts
Adds .js extensions to local imports for ESM resolution.
Generator package maps updated
packages/fastify-generators/src/constants/fastify-packages.ts, packages/react-generators/src/constants/react-packages.ts
Update versions: nanoid 5.1.6; tsx 4.20.6; ioredis 5.8.1; ioredis-mock 8.13.0; vitest-mock-extended 3.1.0; remove uuid and @types/uuid from Fastify set.
Fastify generator ESM enablement
packages/fastify-generators/src/generators/core/fastify/fastify.generator.ts
Sets nodeConfig.isEsm = true.
Sentry generator instrument path
packages/fastify-generators/src/generators/core/fastify-sentry/fastify-sentry.generator.ts
Changes instrument prod flag from ./dist/instrument.ts to ./dist/instrument.js.
Workspace catalog
pnpm-workspace.yaml
Bumps catalog tsx 4.19.3 → 4.20.6.
Snapshot diff (todo-with-auth0)
examples/todo-with-auth0/packages/backend/.baseplate-snapshot/diffs/package.json.diff
Shows added sentry-testkit and tsx bump for snapshot purposes.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Dev as Dev CLI
  participant Node as Node (ESM)
  participant Instr as Instrument Module
  participant App as App Entry (index.ts/js)
  participant Sentry as Sentry SDK

  rect rgba(200,230,255,0.25)
  Note over Node,App: New ESM startup with --import
  Dev->>Node: run (tsx/node) --import ./src/instrument.ts (dev) / ./dist/instrument.js (prod)
  Node->>Instr: Load instrumentation (ESM)
  Instr-->>Sentry: Initialize SDK/hooks
  Node->>App: Import main module
  App-->>Sentry: Use configured client
  end
Loading
sequenceDiagram
  autonumber
  participant Node as Node (CJS/ESM)
  participant App as App Entry
  participant Instr as Instrument Module

  rect rgba(255,230,200,0.25)
  Note over Node,App: Previous flow (removed)
  Node->>App: Execute
  App->>Instr: Top-level import './instrument'
  Instr-->>App: Side-effect init
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

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 title clearly and concisely describes the primary change in this pull request—the migration of the backend codebase from CommonJS to ESM—which aligns with the modifications in package types and import paths observed throughout the files.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch kingston/eng-843-upgrade-backend-to-esm

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

@socket-security
Copy link

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatednanoid@​3.3.8 ⏵ 5.1.610010080 -1988100
Updatedvitest-mock-extended@​1.3.2 ⏵ 3.1.0100 +110010080100
Updatedtsx@​4.20.3 ⏵ 4.20.61001008189100
Updatedioredis-mock@​8.7.0 ⏵ 8.13.09910010091 +14100
Updatedioredis@​5.3.2 ⏵ 5.8.199100100 +192100

View full report

@kingston kingston merged commit ac912b3 into main Oct 15, 2025
16 of 17 checks passed
@kingston kingston deleted the kingston/eng-843-upgrade-backend-to-esm branch October 15, 2025 12:10
@github-actions github-actions bot mentioned this pull request Oct 15, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
examples/todo-with-auth0/packages/backend/src/services/sentry.e2e.test.ts (1)

1-1: Add missing .js extension to import.

Line 1 imports the test helper without a .js extension, which is inconsistent with the ESM migration and coding guidelines. All other imports in this file correctly include .js extensions.

Apply this diff to add the .js extension:

-import './sentry.instrument.test-helper';
+import './sentry.instrument.test-helper.js';
🧹 Nitpick comments (4)
.changeset/loud-doodles-train.md (1)

5-5: Expand the release note beyond the TSX bump.

The published changelog should call out the Fastify generator’s switch to ESM (the core change of this PR), not just the tsx version bump. Please broaden the body so it reflects the user-visible behavior change.

examples/todo-with-auth0/packages/backend/.baseplate-snapshot/diffs/package.json.diff (1)

10-10: Consider using exact version pinning for consistency.

The sentry-testkit dependency uses a caret (^) version range, while other dependencies in this file use exact versions. Additionally, the reason for adding this testing utility isn't clear from the PR objectives, which focus on ESM migration.

Consider:

  1. Using an exact version (e.g., "sentry-testkit": "6.2.2") to match the pinning strategy of other dependencies.
  2. Clarifying whether this addition is related to the ESM migration or if it's unrelated scope.
.changeset/sixty-wasps-clean.md (1)

5-5: Fix trailing hyphen in description.

The summary line ends with a dangling -, which reads like a typographical error. Please drop it for a clean changeset note.

Apply this diff:

-Upgrade ioredis to 5.8.1 and ioredis-mock to 8.13.0-
+Upgrade ioredis to 5.8.1 and ioredis-mock to 8.13.0
examples/blog-with-auth/packages/backend/eslint.config.js (1)

39-41: Remove duplicate vitest.config.ts.

When swapping out the .mts filename, the array now contains vitest.config.ts twice. Drop the duplicate so the allowlist stays tidy and intention-revealing.

Apply this diff:

 const TS_DEFAULT_PROJECT_FILES = /* TPL_DEFAULT_PROJECT_FILES:START */ [
   'prisma.config.mts',
-  'vitest.config.ts',
   'vitest.config.ts',
 ]; /* TPL_DEFAULT_PROJECT_FILES:END */
📜 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 e13e6da and 973b051.

⛔ Files ignored due to path filters (23)
  • examples/blog-with-auth/packages/admin/baseplate/generated/package.json is excluded by !**/generated/**, !**/generated/**
  • examples/blog-with-auth/packages/backend/baseplate/generated/eslint.config.js is excluded by !**/generated/**, !**/generated/**
  • examples/blog-with-auth/packages/backend/baseplate/generated/package.json is excluded by !**/generated/**, !**/generated/**
  • examples/blog-with-auth/packages/backend/baseplate/generated/src/index.ts is excluded by !**/generated/**, !**/generated/**
  • examples/blog-with-auth/packages/backend/baseplate/generated/vitest.config.ts is excluded by !**/generated/**, !**/generated/**
  • examples/blog-with-auth/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • examples/todo-with-auth0/packages/admin/baseplate/generated/package.json is excluded by !**/generated/**, !**/generated/**
  • examples/todo-with-auth0/packages/backend/baseplate/generated/eslint.config.js is excluded by !**/generated/**, !**/generated/**
  • examples/todo-with-auth0/packages/backend/baseplate/generated/package.json is excluded by !**/generated/**, !**/generated/**
  • examples/todo-with-auth0/packages/backend/baseplate/generated/src/index.ts is excluded by !**/generated/**, !**/generated/**
  • examples/todo-with-auth0/packages/backend/baseplate/generated/vitest.config.ts is excluded by !**/generated/**, !**/generated/**
  • examples/todo-with-auth0/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • tests/simple/packages/backend/baseplate/file-id-map.json is excluded by !tests/**
  • tests/simple/packages/backend/baseplate/generated/eslint.config.js is excluded by !**/generated/**, !tests/**, !**/generated/**
  • tests/simple/packages/backend/baseplate/generated/package.json is excluded by !**/generated/**, !tests/**, !**/generated/**
  • tests/simple/packages/backend/baseplate/generated/src/index.ts is excluded by !**/generated/**, !tests/**, !**/generated/**
  • tests/simple/packages/backend/baseplate/generated/vitest.config.ts is excluded by !**/generated/**, !tests/**, !**/generated/**
  • tests/simple/packages/backend/eslint.config.js is excluded by !tests/**
  • tests/simple/packages/backend/package.json is excluded by !tests/**
  • tests/simple/packages/backend/src/index.ts is excluded by !tests/**
  • tests/simple/packages/backend/vitest.config.ts is excluded by !tests/**
  • tests/simple/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml, !tests/**
📒 Files selected for processing (23)
  • .changeset/loud-doodles-train.md (1 hunks)
  • .changeset/sixty-wasps-clean.md (1 hunks)
  • .changeset/twenty-dingos-give.md (1 hunks)
  • examples/blog-with-auth/packages/admin/package.json (1 hunks)
  • examples/blog-with-auth/packages/backend/.templates-info.json (2 hunks)
  • examples/blog-with-auth/packages/backend/baseplate/file-id-map.json (2 hunks)
  • examples/blog-with-auth/packages/backend/eslint.config.js (1 hunks)
  • examples/blog-with-auth/packages/backend/package.json (4 hunks)
  • examples/blog-with-auth/packages/backend/src/index.ts (0 hunks)
  • examples/todo-with-auth0/packages/admin/package.json (1 hunks)
  • examples/todo-with-auth0/packages/backend/.baseplate-snapshot/diffs/package.json.diff (1 hunks)
  • examples/todo-with-auth0/packages/backend/.templates-info.json (2 hunks)
  • examples/todo-with-auth0/packages/backend/baseplate/file-id-map.json (2 hunks)
  • examples/todo-with-auth0/packages/backend/eslint.config.js (1 hunks)
  • examples/todo-with-auth0/packages/backend/package.json (5 hunks)
  • examples/todo-with-auth0/packages/backend/src/index.ts (0 hunks)
  • examples/todo-with-auth0/packages/backend/src/services/sentry.e2e.test.ts (1 hunks)
  • examples/todo-with-auth0/packages/backend/src/services/sentry.instrument.test-helper.ts (1 hunks)
  • packages/fastify-generators/src/constants/fastify-packages.ts (3 hunks)
  • packages/fastify-generators/src/generators/core/fastify-sentry/fastify-sentry.generator.ts (1 hunks)
  • packages/fastify-generators/src/generators/core/fastify/fastify.generator.ts (1 hunks)
  • packages/react-generators/src/constants/react-packages.ts (1 hunks)
  • pnpm-workspace.yaml (1 hunks)
💤 Files with no reviewable changes (2)
  • examples/blog-with-auth/packages/backend/src/index.ts
  • examples/todo-with-auth0/packages/backend/src/index.ts
🧰 Additional context used
📓 Path-based instructions (13)
**/*.{ts,tsx}

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

**/*.{ts,tsx}: TypeScript with strict type checking
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 a particular interface or type is not exported, update the TypeScript file so it is exported

Files:

  • packages/fastify-generators/src/generators/core/fastify/fastify.generator.ts
  • packages/react-generators/src/constants/react-packages.ts
  • examples/todo-with-auth0/packages/backend/src/services/sentry.e2e.test.ts
  • packages/fastify-generators/src/generators/core/fastify-sentry/fastify-sentry.generator.ts
  • packages/fastify-generators/src/constants/fastify-packages.ts
  • examples/todo-with-auth0/packages/backend/src/services/sentry.instrument.test-helper.ts
**/*.{js,ts,tsx}

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

Node 16 module resolution - include file extensions in imports (.js)

Files:

  • packages/fastify-generators/src/generators/core/fastify/fastify.generator.ts
  • examples/blog-with-auth/packages/backend/eslint.config.js
  • packages/react-generators/src/constants/react-packages.ts
  • examples/todo-with-auth0/packages/backend/eslint.config.js
  • examples/todo-with-auth0/packages/backend/src/services/sentry.e2e.test.ts
  • packages/fastify-generators/src/generators/core/fastify-sentry/fastify-sentry.generator.ts
  • packages/fastify-generators/src/constants/fastify-packages.ts
  • examples/todo-with-auth0/packages/backend/src/services/sentry.instrument.test-helper.ts
**/*.{ts,tsx,js}

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

**/*.{ts,tsx,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
We use the prefer using nullish coalescing operator (??) ESLint rule instead of a logical or (||), as it is a safer operator
Use console.info/warn/error instead of console.log

Files:

  • packages/fastify-generators/src/generators/core/fastify/fastify.generator.ts
  • examples/blog-with-auth/packages/backend/eslint.config.js
  • packages/react-generators/src/constants/react-packages.ts
  • examples/todo-with-auth0/packages/backend/eslint.config.js
  • examples/todo-with-auth0/packages/backend/src/services/sentry.e2e.test.ts
  • packages/fastify-generators/src/generators/core/fastify-sentry/fastify-sentry.generator.ts
  • packages/fastify-generators/src/constants/fastify-packages.ts
  • examples/todo-with-auth0/packages/backend/src/services/sentry.instrument.test-helper.ts
**/*

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

Use kebab-case for file names

Files:

  • packages/fastify-generators/src/generators/core/fastify/fastify.generator.ts
  • examples/blog-with-auth/packages/backend/eslint.config.js
  • examples/blog-with-auth/packages/backend/baseplate/file-id-map.json
  • packages/react-generators/src/constants/react-packages.ts
  • examples/todo-with-auth0/packages/backend/eslint.config.js
  • examples/todo-with-auth0/packages/backend/src/services/sentry.e2e.test.ts
  • examples/blog-with-auth/packages/admin/package.json
  • examples/todo-with-auth0/packages/backend/baseplate/file-id-map.json
  • examples/blog-with-auth/packages/backend/package.json
  • packages/fastify-generators/src/generators/core/fastify-sentry/fastify-sentry.generator.ts
  • packages/fastify-generators/src/constants/fastify-packages.ts
  • examples/todo-with-auth0/packages/backend/src/services/sentry.instrument.test-helper.ts
  • examples/todo-with-auth0/packages/admin/package.json
  • examples/todo-with-auth0/packages/backend/package.json
  • pnpm-workspace.yaml
.changeset/**/*.md

📄 CodeRabbit inference engine (AGENTS.md)

.changeset/**/*.md: When adding a new feature or changing an existing feature, add a new Changeset in the .changeset/ directory
Changeset files must follow the specified frontmatter format with a package entry set to patch and a description body

Files:

  • .changeset/twenty-dingos-give.md
  • .changeset/sixty-wasps-clean.md
  • .changeset/loud-doodles-train.md
**/*.test.ts

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

Always import vitest globals explicitly (describe, it, expect)

Files:

  • examples/todo-with-auth0/packages/backend/src/services/sentry.e2e.test.ts
**/*.test.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/testing.mdc)

**/*.test.{ts,tsx}: Use descriptive test names that explain what is being tested
Structure tests with clear setup, execution, and verification phases (Arrange-Act-Assert)
Always mock external API calls and file system operations in tests
Each test should be independent and not rely on others
Leverage TypeScript for type-safe mocking in tests
Focus on testing public methods and behaviors, not implementation details
Each test should verify one specific behavior to keep tests simple
For file system operations in tests, use memfs and mock 'node:fs' and 'node:fs/promises'
When using globby in tests, pass the mocked fs adapter

Files:

  • examples/todo-with-auth0/packages/backend/src/services/sentry.e2e.test.ts
**/*.{test,test-helper}.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/testing.mdc)

Extract repeated logic into reusable helper functions

Files:

  • examples/todo-with-auth0/packages/backend/src/services/sentry.e2e.test.ts
  • examples/todo-with-auth0/packages/backend/src/services/sentry.instrument.test-helper.ts
examples/todo-with-auth0/packages/{admin,backend}/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (examples/todo-with-auth0/CLAUDE.md)

examples/todo-with-auth0/packages/{admin,backend}/src/**/*.{ts,tsx}: Always use .js extensions in import statements, even when importing from TypeScript files
Use import type for type-only imports in TypeScript
Always specify explicit return types for all functions

Files:

  • examples/todo-with-auth0/packages/backend/src/services/sentry.e2e.test.ts
  • examples/todo-with-auth0/packages/backend/src/services/sentry.instrument.test-helper.ts
examples/todo-with-auth0/{packages/admin/src/{app,components,pages,hooks,services}/**/*.{ts,tsx},packages/backend/src/{modules,plugins,prisma,services,utils}/**/*.{ts,tsx}}

📄 CodeRabbit inference engine (examples/todo-with-auth0/CLAUDE.md)

Add JSDoc to all exported functions, interfaces, and classes including descriptions, params, returns, and fields (exclude generated code)

Files:

  • examples/todo-with-auth0/packages/backend/src/services/sentry.e2e.test.ts
  • examples/todo-with-auth0/packages/backend/src/services/sentry.instrument.test-helper.ts
examples/blog-with-auth/{package.json,packages/**/package.json}

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

Use ESM only by setting "type": "module" in package.json

Files:

  • examples/blog-with-auth/packages/admin/package.json
  • examples/blog-with-auth/packages/backend/package.json
**/*.test-helper.ts

📄 CodeRabbit inference engine (.cursor/rules/testing.mdc)

Extract common setup code into test helpers, which can be new files named *.test-helper.ts

Files:

  • examples/todo-with-auth0/packages/backend/src/services/sentry.instrument.test-helper.ts
examples/todo-with-auth0/{package.json,packages/**/package.json}

📄 CodeRabbit inference engine (examples/todo-with-auth0/CLAUDE.md)

examples/todo-with-auth0/{package.json,packages/**/package.json}: Module system must be ESM only ("type": "module" in package.json)
Package manager is pnpm 10+ (enforce via packageManager field)
Node version 22+ with Volta pinned to 22.18.0

Files:

  • examples/todo-with-auth0/packages/admin/package.json
  • examples/todo-with-auth0/packages/backend/package.json
🧠 Learnings (11)
📚 Learning: 2025-09-03T17:03:33.250Z
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: examples/todo-with-auth0/CLAUDE.md:0-0
Timestamp: 2025-09-03T17:03:33.250Z
Learning: Applies to examples/todo-with-auth0/packages/{admin,backend}/src/**/*.{unit,int}.test.ts : Vitest: do not use globals; import `describe`, `it`, and `expect` from `vitest`

Applied to files:

  • examples/blog-with-auth/packages/backend/eslint.config.js
  • examples/todo-with-auth0/packages/backend/eslint.config.js
  • examples/todo-with-auth0/packages/backend/src/services/sentry.e2e.test.ts
📚 Learning: 2025-09-03T17:02:31.412Z
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: examples/blog-with-auth/CLAUDE.md:0-0
Timestamp: 2025-09-03T17:02:31.412Z
Learning: Applies to examples/blog-with-auth/packages/**/src/**/*.@(unit|int).test.ts : Do not use Vitest globals; import test functions explicitly from `vitest`

Applied to files:

  • examples/blog-with-auth/packages/backend/eslint.config.js
  • examples/todo-with-auth0/packages/backend/src/services/sentry.e2e.test.ts
📚 Learning: 2025-09-03T17:02:31.412Z
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: examples/blog-with-auth/CLAUDE.md:0-0
Timestamp: 2025-09-03T17:02:31.412Z
Learning: Applies to examples/blog-with-auth/packages/**/src/**/*.@(unit|int).test.ts : Name test files with `.unit.test.ts` or `.int.test.ts` suffixes

Applied to files:

  • examples/blog-with-auth/packages/backend/eslint.config.js
📚 Learning: 2025-09-03T17:03:33.250Z
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: examples/todo-with-auth0/CLAUDE.md:0-0
Timestamp: 2025-09-03T17:03:33.250Z
Learning: Applies to examples/todo-with-auth0/packages/{admin,backend}/src/**/*.{unit,int}.test.ts : Test files must use suffixes `.unit.test.ts` or `.int.test.ts` and be collocated under src

Applied to files:

  • examples/todo-with-auth0/packages/backend/src/services/sentry.e2e.test.ts
📚 Learning: 2025-07-22T09:10:31.413Z
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-07-22T09:10:31.413Z
Learning: Applies to **/*.test.ts : Always import vitest globals explicitly (describe, it, expect)

Applied to files:

  • examples/todo-with-auth0/packages/backend/src/services/sentry.e2e.test.ts
📚 Learning: 2025-04-23T06:44:30.952Z
Learnt from: kingston
PR: halfdomelabs/baseplate#510
File: packages/project-builder-server/src/sync/conflict-file-monitor.test.ts:19-24
Timestamp: 2025-04-23T06:44:30.952Z
Learning: In the project-builder-server test suite, Vitest automocks for 'node:fs' and 'node:fs/promises' are already configured to use memfs without needing explicit implementation replacement in each test file.

Applied to files:

  • examples/todo-with-auth0/packages/backend/src/services/sentry.e2e.test.ts
📚 Learning: 2025-09-03T17:02:31.412Z
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: examples/blog-with-auth/CLAUDE.md:0-0
Timestamp: 2025-09-03T17:02:31.412Z
Learning: Applies to examples/blog-with-auth/{package.json,packages/**/package.json} : Use ESM only by setting `"type": "module"` in package.json

Applied to files:

  • examples/blog-with-auth/packages/backend/package.json
  • examples/todo-with-auth0/packages/backend/package.json
📚 Learning: 2025-06-03T09:11:29.651Z
Learnt from: kingston
PR: halfdomelabs/baseplate#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/blog-with-auth/packages/backend/package.json
📚 Learning: 2025-09-03T17:03:33.250Z
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: examples/todo-with-auth0/CLAUDE.md:0-0
Timestamp: 2025-09-03T17:03:33.250Z
Learning: Applies to examples/todo-with-auth0/{package.json,packages/**/package.json} : Node version 22+ with Volta pinned to 22.18.0

Applied to files:

  • examples/blog-with-auth/packages/backend/package.json
  • examples/todo-with-auth0/packages/admin/package.json
  • examples/todo-with-auth0/packages/backend/package.json
📚 Learning: 2025-09-03T17:03:33.250Z
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: examples/todo-with-auth0/CLAUDE.md:0-0
Timestamp: 2025-09-03T17:03:33.250Z
Learning: Applies to examples/todo-with-auth0/{package.json,packages/**/package.json} : Module system must be ESM only (`"type": "module"` in package.json)

Applied to files:

  • examples/todo-with-auth0/packages/backend/package.json
📚 Learning: 2025-09-03T17:03:33.250Z
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: examples/todo-with-auth0/CLAUDE.md:0-0
Timestamp: 2025-09-03T17:03:33.250Z
Learning: Applies to examples/todo-with-auth0/packages/**/tsconfig*.json : Use TypeScript moduleResolution set to `NodeNext` (ESM)

Applied to files:

  • examples/todo-with-auth0/packages/backend/package.json
🪛 LanguageTool
.changeset/twenty-dingos-give.md

[grammar] ~4-~4: There might be a mistake here.
Context: ...ate-dev/fastify-generators': minor --- Switch backend to ESM instead of CommonJS. Thi...

(QB_NEW_EN)


[grammar] ~5-~5: There might be a mistake here.
Context: ...mmonJS. This may break some packages but most packages at this point are now ESM ...

(QB_NEW_EN)


[grammar] ~6-~6: There might be a mistake here.
Context: ...es at this point are now ESM compatible.

(QB_NEW_EN)

⏰ 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: Verify Sync (todo-with-auth0)
  • GitHub Check: Verify Sync (blog-with-auth)
  • GitHub Check: Lint Examples (todo-with-auth0)
  • GitHub Check: Lint Examples (blog-with-auth)
  • GitHub Check: test
  • GitHub Check: Lint
  • GitHub Check: Test E2E
🔇 Additional comments (15)
examples/todo-with-auth0/packages/backend/.baseplate-snapshot/diffs/package.json.diff (1)

12-12: Approve tsx update [email protected] is the current latest release with no reported security advisories and aligns with our ESM migration.

examples/todo-with-auth0/packages/backend/src/services/sentry.instrument.test-helper.ts (1)

5-5: LGTM!

The import path correctly includes the .js extension, aligning with ESM module resolution and the coding guidelines.

examples/todo-with-auth0/packages/backend/src/services/sentry.e2e.test.ts (2)

5-5: LGTM!

All import paths correctly include the .js extension, aligning with ESM module resolution and the coding guidelines.

Also applies to: 7-8, 10-11


1-107: Verify the .e2e.test.ts naming convention.

The file uses a .e2e.test.ts suffix, but the retrieved learnings indicate that test files should use .unit.test.ts or .int.test.ts suffixes. Since this test spawns a real HTTP server and makes actual fetch calls, it appears to be a genuine end-to-end test. Please confirm whether the .e2e.test.ts naming convention is intentional and allowed for this project.

Based on learnings.

examples/todo-with-auth0/packages/backend/.templates-info.json (1)

9-9: LGTM! Config file renames align with ESM migration.

The renames from .mjs/.mts to .js/.ts are consistent with the ESM migration pattern across the codebase.

Also applies to: 19-19

examples/todo-with-auth0/packages/backend/package.json (3)

7-7: LGTM! ESM mode enabled.

Setting "type": "module" correctly enables ES module mode for the package.

Based on coding guidelines.


16-17: LGTM! Instrumentation loading pattern is correct.

The use of --import ./src/instrument.ts for dev (with tsx) and --import ./dist/instrument.js for production (with node) correctly handles TypeScript and JavaScript contexts respectively.

Also applies to: 26-28


69-69: Review major version upgrades for breaking changes

  • nanoid 3.3.8→5.1.6 is now ESM-only: replace any require('nanoid') calls with import { nanoid } from 'nanoid', update direct‐path imports per the exports field, and target Node 14+
  • vitest-mock-extended 1.3.2→3.1.0 may include API changes: review its GitHub releases or changelog for renamed/moved mock helpers
  • No security advisories found for nanoid v5.1.6, vitest-mock-extended 3.1.0, ioredis, ioredis-mock, or tsx
examples/blog-with-auth/packages/backend/package.json (3)

7-7: LGTM! ESM mode enabled.

Setting "type": "module" correctly enables ES module mode for the package.

Based on coding guidelines.


17-18: LGTM! Instrumentation loading pattern is correct.

The use of --import ./src/instrument.ts for dev scripts and --import ./dist/instrument.js for production scripts correctly handles TypeScript and JavaScript contexts respectively.

Also applies to: 26-29


59-59: Verify updated package versions.

The same dependency updates appear here as in the todo-with-auth0 backend package. Please ensure the verification script and web searches from the previous review of examples/todo-with-auth0/packages/backend/package.json cover these versions as well.

Also applies to: 84-84, 89-89

packages/fastify-generators/src/constants/fastify-packages.ts (1)

6-6: LGTM! Package version constants updated.

The version updates in the generator constants align with the changes in the example package.json files and maintain consistency across the codebase. The verification requested for the example packages applies to these canonical versions as well.

Also applies to: 56-56, 60-61, 74-74

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

85-90: LGTM! Correct .js extension for production ESM imports.

The change from ./dist/instrument.ts to ./dist/instrument.js is correct for ESM. The --import flag in production must reference the compiled JavaScript file, not the TypeScript source.

Based on coding guidelines.

examples/blog-with-auth/packages/backend/baseplate/file-id-map.json (1)

6-6: LGTM! File mappings updated consistently.

The mappings for eslint-config and vitest-config now point to the renamed files (eslint.config.js and vitest.config.ts), maintaining consistency with the template information changes.

Also applies to: 16-16

examples/blog-with-auth/packages/backend/.templates-info.json (1)

9-9: LGTM! Config file renames align with ESM migration.

The renames from .mjs/.mts to .js/.ts are consistent with the ESM migration pattern and match the changes in the todo-with-auth0 example.

Also applies to: 19-19

@@ -0,0 +1,6 @@
---
'@baseplate-dev/fastify-generators': minor
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Set the bump level to patch per changeset policy.

The coding guideline mandates that every package entry in a changeset use patch, but this file declares minor. Update the frontmatter accordingly.

Apply this diff:

-'@baseplate-dev/fastify-generators': minor
+'@baseplate-dev/fastify-generators': patch
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
'@baseplate-dev/fastify-generators': minor
'@baseplate-dev/fastify-generators': patch
🤖 Prompt for AI Agents
In .changeset/twenty-dingos-give.md around line 2, the package entry currently
uses 'minor' but must use 'patch' per changeset policy; edit that line to
replace 'minor' with 'patch' so the frontmatter lists
'@baseplate-dev/fastify-generators': patch.

Comment on lines 37 to 41
const TS_DEFAULT_PROJECT_FILES = /* TPL_DEFAULT_PROJECT_FILES:START */ [
'prisma.config.mts',
'vitest.config.mts',
'vitest.config.ts',
'vitest.config.ts',
]; /* TPL_DEFAULT_PROJECT_FILES:END */
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Remove duplicate vitest.config.ts entry.

The array contains vitest.config.ts twice (lines 39 and 40). Only one entry is needed.

Apply this diff to remove the duplicate:

 const TS_DEFAULT_PROJECT_FILES = /* TPL_DEFAULT_PROJECT_FILES:START */ [
   'prisma.config.mts',
   'vitest.config.ts',
-  'vitest.config.ts',
 ]; /* TPL_DEFAULT_PROJECT_FILES:END */
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const TS_DEFAULT_PROJECT_FILES = /* TPL_DEFAULT_PROJECT_FILES:START */ [
'prisma.config.mts',
'vitest.config.mts',
'vitest.config.ts',
'vitest.config.ts',
]; /* TPL_DEFAULT_PROJECT_FILES:END */
const TS_DEFAULT_PROJECT_FILES = /* TPL_DEFAULT_PROJECT_FILES:START */ [
'prisma.config.mts',
'vitest.config.ts',
]; /* TPL_DEFAULT_PROJECT_FILES:END */
🤖 Prompt for AI Agents
In examples/todo-with-auth0/packages/backend/eslint.config.js around lines 37 to
41 the TS_DEFAULT_PROJECT_FILES array contains a duplicate 'vitest.config.ts'
entry; remove one of the duplicate 'vitest.config.ts' entries so the array lists
each filename only once (ensure remaining items and punctuation/comma placement
are valid).

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.

2 participants