-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Update backend to use ESM instead of CommonJS #680
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: 973b051 The changes in this PR will be included in the next version bump. This PR includes changesets to release 18 packages
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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughThe 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
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
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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this 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.jsextension to import.Line 1 imports the test helper without a
.jsextension, which is inconsistent with the ESM migration and coding guidelines. All other imports in this file correctly include.jsextensions.Apply this diff to add the
.jsextension:-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-testkitdependency 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:
- Using an exact version (e.g.,
"sentry-testkit": "6.2.2") to match the pinning strategy of other dependencies.- 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.0examples/blog-with-auth/packages/backend/eslint.config.js (1)
39-41: Remove duplicatevitest.config.ts.When swapping out the
.mtsfilename, the array now containsvitest.config.tstwice. 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.
⛔ Files ignored due to path filters (23)
examples/blog-with-auth/packages/admin/baseplate/generated/package.jsonis excluded by!**/generated/**,!**/generated/**examples/blog-with-auth/packages/backend/baseplate/generated/eslint.config.jsis excluded by!**/generated/**,!**/generated/**examples/blog-with-auth/packages/backend/baseplate/generated/package.jsonis excluded by!**/generated/**,!**/generated/**examples/blog-with-auth/packages/backend/baseplate/generated/src/index.tsis excluded by!**/generated/**,!**/generated/**examples/blog-with-auth/packages/backend/baseplate/generated/vitest.config.tsis excluded by!**/generated/**,!**/generated/**examples/blog-with-auth/pnpm-lock.yamlis excluded by!**/pnpm-lock.yamlexamples/todo-with-auth0/packages/admin/baseplate/generated/package.jsonis excluded by!**/generated/**,!**/generated/**examples/todo-with-auth0/packages/backend/baseplate/generated/eslint.config.jsis excluded by!**/generated/**,!**/generated/**examples/todo-with-auth0/packages/backend/baseplate/generated/package.jsonis excluded by!**/generated/**,!**/generated/**examples/todo-with-auth0/packages/backend/baseplate/generated/src/index.tsis excluded by!**/generated/**,!**/generated/**examples/todo-with-auth0/packages/backend/baseplate/generated/vitest.config.tsis excluded by!**/generated/**,!**/generated/**examples/todo-with-auth0/pnpm-lock.yamlis excluded by!**/pnpm-lock.yamlpnpm-lock.yamlis excluded by!**/pnpm-lock.yamltests/simple/packages/backend/baseplate/file-id-map.jsonis excluded by!tests/**tests/simple/packages/backend/baseplate/generated/eslint.config.jsis excluded by!**/generated/**,!tests/**,!**/generated/**tests/simple/packages/backend/baseplate/generated/package.jsonis excluded by!**/generated/**,!tests/**,!**/generated/**tests/simple/packages/backend/baseplate/generated/src/index.tsis excluded by!**/generated/**,!tests/**,!**/generated/**tests/simple/packages/backend/baseplate/generated/vitest.config.tsis excluded by!**/generated/**,!tests/**,!**/generated/**tests/simple/packages/backend/eslint.config.jsis excluded by!tests/**tests/simple/packages/backend/package.jsonis excluded by!tests/**tests/simple/packages/backend/src/index.tsis excluded by!tests/**tests/simple/packages/backend/vitest.config.tsis excluded by!tests/**tests/simple/pnpm-lock.yamlis 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 forsrc/)
If a particular interface or type is not exported, change the file so it is exportedIf 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.tspackages/react-generators/src/constants/react-packages.tsexamples/todo-with-auth0/packages/backend/src/services/sentry.e2e.test.tspackages/fastify-generators/src/generators/core/fastify-sentry/fastify-sentry.generator.tspackages/fastify-generators/src/constants/fastify-packages.tsexamples/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.tsexamples/blog-with-auth/packages/backend/eslint.config.jspackages/react-generators/src/constants/react-packages.tsexamples/todo-with-auth0/packages/backend/eslint.config.jsexamples/todo-with-auth0/packages/backend/src/services/sentry.e2e.test.tspackages/fastify-generators/src/generators/core/fastify-sentry/fastify-sentry.generator.tspackages/fastify-generators/src/constants/fastify-packages.tsexamples/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.tsexamples/blog-with-auth/packages/backend/eslint.config.jspackages/react-generators/src/constants/react-packages.tsexamples/todo-with-auth0/packages/backend/eslint.config.jsexamples/todo-with-auth0/packages/backend/src/services/sentry.e2e.test.tspackages/fastify-generators/src/generators/core/fastify-sentry/fastify-sentry.generator.tspackages/fastify-generators/src/constants/fastify-packages.tsexamples/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.tsexamples/blog-with-auth/packages/backend/eslint.config.jsexamples/blog-with-auth/packages/backend/baseplate/file-id-map.jsonpackages/react-generators/src/constants/react-packages.tsexamples/todo-with-auth0/packages/backend/eslint.config.jsexamples/todo-with-auth0/packages/backend/src/services/sentry.e2e.test.tsexamples/blog-with-auth/packages/admin/package.jsonexamples/todo-with-auth0/packages/backend/baseplate/file-id-map.jsonexamples/blog-with-auth/packages/backend/package.jsonpackages/fastify-generators/src/generators/core/fastify-sentry/fastify-sentry.generator.tspackages/fastify-generators/src/constants/fastify-packages.tsexamples/todo-with-auth0/packages/backend/src/services/sentry.instrument.test-helper.tsexamples/todo-with-auth0/packages/admin/package.jsonexamples/todo-with-auth0/packages/backend/package.jsonpnpm-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.tsexamples/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
Useimport typefor 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.tsexamples/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.tsexamples/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.jsonexamples/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 viapackageManagerfield)
Node version 22+ with Volta pinned to 22.18.0
Files:
examples/todo-with-auth0/packages/admin/package.jsonexamples/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.jsexamples/todo-with-auth0/packages/backend/eslint.config.jsexamples/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.jsexamples/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.jsonexamples/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.jsonexamples/todo-with-auth0/packages/admin/package.jsonexamples/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
.jsextension, 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
.jsextension, aligning with ESM module resolution and the coding guidelines.Also applies to: 7-8, 10-11
1-107: Verify the.e2e.test.tsnaming convention.The file uses a
.e2e.test.tssuffix, but the retrieved learnings indicate that test files should use.unit.test.tsor.int.test.tssuffixes. 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.tsnaming 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/.mtsto.js/.tsare 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.tsfor dev (with tsx) and--import ./dist/instrument.jsfor 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 withimport { 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.tsfor dev scripts and--import ./dist/instrument.jsfor 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-auth0backend package. Please ensure the verification script and web searches from the previous review ofexamples/todo-with-auth0/packages/backend/package.jsoncover 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.tsto./dist/instrument.jsis correct for ESM. The--importflag 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-configandvitest-confignow point to the renamed files (eslint.config.jsandvitest.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/.mtsto.js/.tsare consistent with the ESM migration pattern and match the changes in thetodo-with-auth0example.Also applies to: 19-19
| @@ -0,0 +1,6 @@ | |||
| --- | |||
| '@baseplate-dev/fastify-generators': minor | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| '@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.
| 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 */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| 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).
Summary by CodeRabbit
Refactor
Chores
Tests