Skip to content

refactor: Extract Sentry into standalone plugin package @baseplate-dev/plugin-observability#826

Merged
kingston merged 4 commits into
mainfrom
kingston/eng-1039-split-sentry-into-plugin-package
Mar 13, 2026
Merged

refactor: Extract Sentry into standalone plugin package @baseplate-dev/plugin-observability#826
kingston merged 4 commits into
mainfrom
kingston/eng-1039-split-sentry-into-plugin-package

Conversation

@kingston

@kingston kingston commented Mar 13, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

Release Notes

  • New Features

    • Sentry observability is now available as a standalone plugin package for error monitoring and performance tracking.
  • Chores

    • Existing projects automatically receive the Sentry plugin enabled during upgrade.
    • Reorganized observability integrations within the plugin ecosystem.

@changeset-bot

changeset-bot Bot commented Mar 13, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: dfb7f93

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

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

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 Mar 13, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@kingston has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 20 minutes and 8 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d4570bc9-b93a-4e6f-bcea-60b0ebf2e72f

📥 Commits

Reviewing files that changed from the base of the PR and between ef0af27 and dfb7f93.

⛔ Files ignored due to path filters (1)
  • tests/simple/project-definition.json is excluded by !tests/**
📒 Files selected for processing (2)
  • packages/project-builder-dev/src/commands/test.ts
  • packages/project-builder-dev/src/e2e-runner/runner.ts
📝 Walkthrough

Walkthrough

Sentry observability functionality is extracted from individual generator packages into a new standalone @baseplate-dev/plugin-observability package. Example projects are updated to reference the new plugin, Sentry generators are removed from original packages, and a schema migration auto-enables the plugin on existing projects.

Changes

Cohort / File(s) Summary
Changeset & Schema Versioning
.changeset/extract-sentry-plugin.md, packages/project-builder-lib/src/migrations/index.ts
Documents package version bumps and introduces new schema migration entry for auto-enabling Sentry plugin.
Schema Migration Implementation
packages/project-builder-lib/src/migrations/migration-027-enable-sentry-plugin.ts, packages/project-builder-lib/src/migrations/migration-027-enable-sentry-plugin.unit.test.ts
New migration logic to add Sentry plugin to existing project configurations with comprehensive test coverage for empty, populated, and duplicate scenarios.
Example Project Template Metadata
examples/blog-with-auth/apps/admin/baseplate/file-id-map.json, examples/blog-with-auth/apps/admin/src/services/.templates-info.json, examples/blog-with-auth/apps/admin/src/services/apollo/.templates-info.json, examples/blog-with-auth/apps/backend/baseplate/file-id-map.json, examples/blog-with-auth/apps/backend/src/.templates-info.json, examples/blog-with-auth/apps/backend/src/plugins/graphql/.templates-info.json, examples/blog-with-auth/apps/backend/src/services/.templates-info.json, examples/todo-with-better-auth/apps/admin/.../*, examples/todo-with-better-auth/apps/backend/.../*, examples/todo-with-better-auth/apps/web/.../*
Updates template generator references from fastify-generators/react-generators to plugin-observability for Sentry-related templates across multiple example projects.
Example Project Configuration
examples/blog-with-auth/baseplate/project-definition.json, examples/todo-with-better-auth/baseplate/project-definition.json
Adds plugin entry for Sentry and bumps schema version to 27 in project definitions.
Generator Package Cleanup
packages/fastify-generators/src/generators/core/index.ts, packages/fastify-generators/src/generators/pothos/index.ts, packages/react-generators/src/generators/apollo/index.ts, packages/react-generators/src/generators/core/index.ts
Removes Sentry generator exports from original packages (fastify-sentry, pothos-sentry, apollo-sentry, react-sentry).
Compiler Updates
packages/project-builder-server/src/compiler/backend/fastify.ts, packages/project-builder-server/src/compiler/web/web-compiler.ts
Removes Sentry generator imports and usage from fastify and React app compilation pipelines.
Build Configuration
knip.config.js, tsconfig.build.json, packages/project-builder-common/package.json
Adds plugin-observability configuration to Knip, adds TypeScript build reference, and adds plugin-observability workspace dependency.
New Plugin Package (Core Setup)
plugins/plugin-observability/package.json, plugins/plugin-observability/tsconfig.json, plugins/plugin-observability/tsconfig.build.json, plugins/plugin-observability/tsconfig.node.json, plugins/plugin-observability/vitest.config.js, plugins/plugin-observability/eslint.config.js, plugins/plugin-observability/prettier.config.js, plugins/plugin-observability/.gitignore, plugins/plugin-observability/index.html, plugins/plugin-observability/vite.config.ts, plugins/plugin-observability/src/vite-env.d.ts, plugins/plugin-observability/src/web-export.ts, plugins/plugin-observability/src/styles.css
Establishes package infrastructure including build tools, TypeScript configuration, linting/formatting setup, and Vite bundling configuration.
New Plugin Package (Documentation)
plugins/plugin-observability/README.md, plugins/plugin-observability/LICENSE, plugins/plugin-observability/CHANGELOG.md
Adds plugin documentation, licensing, and changelog files.
New Plugin Package (Sentry Integration)
plugins/plugin-observability/src/index.ts, plugins/plugin-observability/src/sentry/index.ts, plugins/plugin-observability/src/sentry/plugin.json, plugins/plugin-observability/src/sentry/core/index.ts, plugins/plugin-observability/src/sentry/core/common.ts, plugins/plugin-observability/src/sentry/core/node.ts, plugins/plugin-observability/src/sentry/core/web.ts, plugins/plugin-observability/src/sentry/core/schema/plugin-definition.ts
Defines Sentry plugin structure with common module configuration, node/web plugin modules, and Zod-based plugin definition schema.
New Plugin Package (Sentry Generators)
plugins/plugin-observability/src/sentry/core/generators/index.ts, plugins/plugin-observability/src/sentry/core/generators/fastify-sentry/fastify-sentry.generator.ts, plugins/plugin-observability/src/sentry/core/generators/react-sentry/react-sentry.generator.ts, plugins/plugin-observability/src/sentry/core/generators/apollo-sentry/apollo-sentry.generator.ts, plugins/plugin-observability/src/sentry/core/generators/pothos-sentry/pothos-sentry.generator.ts
Implements Sentry generators for Fastify, React, Apollo, and Pothos with consolidated imports from respective base generator packages.
New Plugin Package (UI Component)
plugins/plugin-observability/src/sentry/core/components/sentry-definition-editor.tsx
React component for Sentry configuration UI with form validation, unsaved-changes protection, and project definition integration.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 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 change: extracting Sentry functionality into a new standalone plugin package (@baseplate-dev/plugin-observability). The title is specific, clear, and directly reflects the primary objective evident throughout the changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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-1039-split-sentry-into-plugin-package
📝 Coding Plan
  • Generate coding plan for human review comments

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.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying baseplate-storybook with  Cloudflare Pages  Cloudflare Pages

Latest commit: ef0af27
Status: ✅  Deploy successful!
Preview URL: https://598c78bd.baseplate-storybook.pages.dev
Branch Preview URL: https://kingston-eng-1039-split-sent.baseplate-storybook.pages.dev

View logs

@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: 4

🧹 Nitpick comments (4)
plugins/plugin-observability/LICENSE (1)

3-10: Prefer scanner-friendly license structure (SPDX + canonical LICENSE body).

Using markdown headings/custom prose in LICENSE can reduce reliability for automated license tooling. Consider keeping LICENSE as canonical MPL-2.0 text and placing the generated-code exception in a separate LICENSE-EXCEPTION/NOTICE file, with SPDX metadata in package manifests.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/plugin-observability/LICENSE` around lines 3 - 10, Replace the
markdownized LICENSE contents with the canonical MPL-2.0 license text only
(remove the custom "Generated Code Exception" prose and headings) and move the
generated-code exception into a separate file (e.g., LICENSE-EXCEPTION or
NOTICE) so tooling can parse the main LICENSE; also add SPDX metadata (e.g.,
"SPDX-License-Identifier: MPL-2.0" and a reference to the exception file) in
package manifests (package.json/other manifest) to make the license
machine-readable.
plugins/plugin-observability/index.html (1)

17-17: Update the page title to reflect this package.

The title "React Remote" appears to be a leftover from a template. Consider updating it to something more descriptive like "Plugin Observability" or similar.

Suggested fix
-    <title>React Remote</title>
+    <title>Plugin Observability</title>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/plugin-observability/index.html` at line 17, Update the HTML <title>
element in plugins/plugin-observability/index.html (the <title> tag currently
set to "React Remote") to a package-relevant value such as "Plugin
Observability" (or another descriptive name); locate the <title> tag and replace
its inner text so the browser tab and metadata reflect this package instead of
the template placeholder.
plugins/plugin-observability/.gitignore (1)

64-81: Minor: Duplicate .cache entries.

Lines 65, 77, and 81 all ignore .cache or .cache/. While this doesn't cause issues, consolidating to a single entry would reduce noise.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/plugin-observability/.gitignore` around lines 64 - 81, Consolidate
duplicate .cache entries in the .gitignore by removing repeated lines and
keeping a single canonical entry (e.g., ".cache" or ".cache/") that covers both
formats; update the block containing parcel/gatsby/vuepress entries so only one
.cache line remains and ensure other relevant cache entries like ".parcel-cache"
and ".temp" are preserved.
plugins/plugin-observability/src/sentry/core/components/sentry-definition-editor.tsx (1)

27-27: Consolidate global stylesheet import to one entry point.

styles.css is already imported from the web module, so importing it again here adds avoidable side-effect coupling.

♻️ Proposed cleanup
-import '#src/styles.css';
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@plugins/plugin-observability/src/sentry/core/components/sentry-definition-editor.tsx`
at line 27, Remove the duplicate global stylesheet import from this component:
delete the import '#src/styles.css' statement in sentry-definition-editor.tsx
and rely on the single global import from the web module (ensure no
component-specific side effects depend on that line); keep only component-local
styles or scoped imports inside this file if needed.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.changeset/extract-sentry-plugin.md:
- Line 2: Update the changeset entry so it uses the required "patch" bump
instead of "minor": locate the changeset markdown that contains the line with
the package identifier '@baseplate-dev/plugin-observability' and replace the
bump specifier "minor" with "patch" so the entry matches the repository's
.changeset/*.md format (i.e., 'package-name': patch).

In
`@packages/project-builder-lib/src/migrations/migration-027-enable-sentry-plugin.ts`:
- Around line 38-59: The migrate function (migrate) that adds SENTRY_PLUGIN_ID
must also remap existing Sentry-managed file IDs in baseplate/file-id-map.json
so old generator-managed entries (from
`@baseplate-dev/fastify-generators`#core/fastify-sentry and
`@baseplate-dev/react-generators`) are transferred to the new plugin owner; update
the migration to read the file-id map, find entries whose fullId or owner
references the old generator ids, and replace them with the new plugin
identifier (SENTRY_PLUGIN_ID or the plugin's packageName + name) for files like
src/instrument.ts and src/services/sentry.ts, ensuring either direct key renames
or merging into alternateFullIds so the sync layer won't orphan or re-generate
those files.

In `@plugins/plugin-observability/LICENSE`:
- Around line 275-315: The MPL text for sections "6. Disclaimer of Warranty" and
"7. Limitation of Liability" contains deletion/markdown artifacts (leading '-'
characters and escaped '\*')—replace the current mangled block in LICENSE with
the canonical, verbatim MPL wording for sections 6 and 7 (remove all '-'
prefixes and '\*' escapes, restore normal punctuation and line breaks) so the
license matches the official MPL text exactly for those two sections; locate the
block labeled "6. Disclaimer of Warranty" and "7. Limitation of Liability" in
the LICENSE and substitute the corrected canonical paragraphs verbatim.

In `@plugins/plugin-observability/src/styles.css`:
- Around line 3-4: Update biome.json to enable the CSS linter and configure the
CSS parser to recognize Tailwind v4 imports by adding the "css.linter.enabled":
true and under "css.parser" set "cssModules": true and "tailwindDirectives":
true so the linter accepts imports using layer() and prefix(); modify the
existing biome.json top-level config (look for any current "css" or "parser"
keys) and merge these three keys into that object to avoid invalid CSS parse
errors for lines importing 'tailwindcss/theme.css' and
'tailwindcss/utilities.css'.

---

Nitpick comments:
In `@plugins/plugin-observability/.gitignore`:
- Around line 64-81: Consolidate duplicate .cache entries in the .gitignore by
removing repeated lines and keeping a single canonical entry (e.g., ".cache" or
".cache/") that covers both formats; update the block containing
parcel/gatsby/vuepress entries so only one .cache line remains and ensure other
relevant cache entries like ".parcel-cache" and ".temp" are preserved.

In `@plugins/plugin-observability/index.html`:
- Line 17: Update the HTML <title> element in
plugins/plugin-observability/index.html (the <title> tag currently set to "React
Remote") to a package-relevant value such as "Plugin Observability" (or another
descriptive name); locate the <title> tag and replace its inner text so the
browser tab and metadata reflect this package instead of the template
placeholder.

In `@plugins/plugin-observability/LICENSE`:
- Around line 3-10: Replace the markdownized LICENSE contents with the canonical
MPL-2.0 license text only (remove the custom "Generated Code Exception" prose
and headings) and move the generated-code exception into a separate file (e.g.,
LICENSE-EXCEPTION or NOTICE) so tooling can parse the main LICENSE; also add
SPDX metadata (e.g., "SPDX-License-Identifier: MPL-2.0" and a reference to the
exception file) in package manifests (package.json/other manifest) to make the
license machine-readable.

In
`@plugins/plugin-observability/src/sentry/core/components/sentry-definition-editor.tsx`:
- Line 27: Remove the duplicate global stylesheet import from this component:
delete the import '#src/styles.css' statement in sentry-definition-editor.tsx
and rely on the single global import from the web module (ensure no
component-specific side effects depend on that line); keep only component-local
styles or scoped imports inside this file if needed.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 49e88f37-9ca7-41fd-bffb-2e67858edb7a

📥 Commits

Reviewing files that changed from the base of the PR and between 8616acc and ef0af27.

⛔ Files ignored due to path filters (20)
  • plugins/plugin-observability/src/sentry/core/generators/apollo-sentry/generated/index.ts is excluded by !**/generated/**, !**/generated/**
  • plugins/plugin-observability/src/sentry/core/generators/apollo-sentry/generated/template-paths.ts is excluded by !**/generated/**, !**/generated/**
  • plugins/plugin-observability/src/sentry/core/generators/apollo-sentry/generated/template-renderers.ts is excluded by !**/generated/**, !**/generated/**
  • plugins/plugin-observability/src/sentry/core/generators/apollo-sentry/generated/typed-templates.ts is excluded by !**/generated/**, !**/generated/**
  • plugins/plugin-observability/src/sentry/core/generators/fastify-sentry/generated/index.ts is excluded by !**/generated/**, !**/generated/**
  • plugins/plugin-observability/src/sentry/core/generators/fastify-sentry/generated/template-paths.ts is excluded by !**/generated/**, !**/generated/**
  • plugins/plugin-observability/src/sentry/core/generators/fastify-sentry/generated/template-renderers.ts is excluded by !**/generated/**, !**/generated/**
  • plugins/plugin-observability/src/sentry/core/generators/fastify-sentry/generated/ts-import-providers.ts is excluded by !**/generated/**, !**/generated/**
  • plugins/plugin-observability/src/sentry/core/generators/fastify-sentry/generated/typed-templates.ts is excluded by !**/generated/**, !**/generated/**
  • plugins/plugin-observability/src/sentry/core/generators/pothos-sentry/generated/index.ts is excluded by !**/generated/**, !**/generated/**
  • plugins/plugin-observability/src/sentry/core/generators/pothos-sentry/generated/template-paths.ts is excluded by !**/generated/**, !**/generated/**
  • plugins/plugin-observability/src/sentry/core/generators/pothos-sentry/generated/template-renderers.ts is excluded by !**/generated/**, !**/generated/**
  • plugins/plugin-observability/src/sentry/core/generators/pothos-sentry/generated/typed-templates.ts is excluded by !**/generated/**, !**/generated/**
  • plugins/plugin-observability/src/sentry/core/generators/react-sentry/generated/index.ts is excluded by !**/generated/**, !**/generated/**
  • plugins/plugin-observability/src/sentry/core/generators/react-sentry/generated/template-paths.ts is excluded by !**/generated/**, !**/generated/**
  • plugins/plugin-observability/src/sentry/core/generators/react-sentry/generated/template-renderers.ts is excluded by !**/generated/**, !**/generated/**
  • plugins/plugin-observability/src/sentry/core/generators/react-sentry/generated/ts-import-providers.ts is excluded by !**/generated/**, !**/generated/**
  • plugins/plugin-observability/src/sentry/core/generators/react-sentry/generated/typed-templates.ts is excluded by !**/generated/**, !**/generated/**
  • plugins/plugin-observability/src/sentry/static/icon.svg is excluded by !**/*.svg
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (75)
  • .changeset/extract-sentry-plugin.md
  • examples/blog-with-auth/apps/admin/baseplate/file-id-map.json
  • examples/blog-with-auth/apps/admin/src/services/.templates-info.json
  • examples/blog-with-auth/apps/admin/src/services/apollo/.templates-info.json
  • examples/blog-with-auth/apps/backend/baseplate/file-id-map.json
  • examples/blog-with-auth/apps/backend/src/.templates-info.json
  • examples/blog-with-auth/apps/backend/src/plugins/graphql/.templates-info.json
  • examples/blog-with-auth/apps/backend/src/services/.templates-info.json
  • examples/blog-with-auth/baseplate/project-definition.json
  • examples/todo-with-better-auth/apps/admin/baseplate/file-id-map.json
  • examples/todo-with-better-auth/apps/admin/src/services/.templates-info.json
  • examples/todo-with-better-auth/apps/admin/src/services/apollo/.templates-info.json
  • examples/todo-with-better-auth/apps/backend/baseplate/file-id-map.json
  • examples/todo-with-better-auth/apps/backend/src/.templates-info.json
  • examples/todo-with-better-auth/apps/backend/src/plugins/graphql/.templates-info.json
  • examples/todo-with-better-auth/apps/backend/src/services/.templates-info.json
  • examples/todo-with-better-auth/apps/web/baseplate/file-id-map.json
  • examples/todo-with-better-auth/apps/web/src/services/.templates-info.json
  • examples/todo-with-better-auth/apps/web/src/services/apollo/.templates-info.json
  • examples/todo-with-better-auth/baseplate/project-definition.json
  • knip.config.js
  • packages/fastify-generators/src/generators/core/index.ts
  • packages/fastify-generators/src/generators/pothos/index.ts
  • packages/project-builder-common/package.json
  • packages/project-builder-lib/src/migrations/index.ts
  • packages/project-builder-lib/src/migrations/migration-027-enable-sentry-plugin.ts
  • packages/project-builder-lib/src/migrations/migration-027-enable-sentry-plugin.unit.test.ts
  • packages/project-builder-server/src/compiler/backend/fastify.ts
  • packages/project-builder-server/src/compiler/web/web-compiler.ts
  • packages/react-generators/src/generators/apollo/index.ts
  • packages/react-generators/src/generators/core/index.ts
  • plugins/plugin-observability/.gitignore
  • plugins/plugin-observability/CHANGELOG.md
  • plugins/plugin-observability/LICENSE
  • plugins/plugin-observability/README.md
  • plugins/plugin-observability/eslint.config.js
  • plugins/plugin-observability/index.html
  • plugins/plugin-observability/package.json
  • plugins/plugin-observability/prettier.config.js
  • plugins/plugin-observability/src/index.ts
  • plugins/plugin-observability/src/sentry/core/common.ts
  • plugins/plugin-observability/src/sentry/core/components/sentry-definition-editor.tsx
  • plugins/plugin-observability/src/sentry/core/generators/apollo-sentry/apollo-sentry.generator.ts
  • plugins/plugin-observability/src/sentry/core/generators/apollo-sentry/extractor.json
  • plugins/plugin-observability/src/sentry/core/generators/apollo-sentry/index.ts
  • plugins/plugin-observability/src/sentry/core/generators/apollo-sentry/templates/src/services/apollo/apollo-sentry-link.ts
  • plugins/plugin-observability/src/sentry/core/generators/fastify-sentry/extractor.json
  • plugins/plugin-observability/src/sentry/core/generators/fastify-sentry/fastify-sentry.generator.ts
  • plugins/plugin-observability/src/sentry/core/generators/fastify-sentry/index.ts
  • plugins/plugin-observability/src/sentry/core/generators/fastify-sentry/templates/src/instrument.ts
  • plugins/plugin-observability/src/sentry/core/generators/fastify-sentry/templates/src/services/sentry.ts
  • plugins/plugin-observability/src/sentry/core/generators/index.ts
  • plugins/plugin-observability/src/sentry/core/generators/pothos-sentry/extractor.json
  • plugins/plugin-observability/src/sentry/core/generators/pothos-sentry/index.ts
  • plugins/plugin-observability/src/sentry/core/generators/pothos-sentry/pothos-sentry.generator.ts
  • plugins/plugin-observability/src/sentry/core/generators/pothos-sentry/templates/src/plugins/graphql/use-sentry.ts
  • plugins/plugin-observability/src/sentry/core/generators/react-sentry/extractor.json
  • plugins/plugin-observability/src/sentry/core/generators/react-sentry/index.ts
  • plugins/plugin-observability/src/sentry/core/generators/react-sentry/react-sentry.generator.ts
  • plugins/plugin-observability/src/sentry/core/generators/react-sentry/templates/src/services/sentry.ts
  • plugins/plugin-observability/src/sentry/core/index.ts
  • plugins/plugin-observability/src/sentry/core/node.ts
  • plugins/plugin-observability/src/sentry/core/schema/plugin-definition.ts
  • plugins/plugin-observability/src/sentry/core/web.ts
  • plugins/plugin-observability/src/sentry/index.ts
  • plugins/plugin-observability/src/sentry/plugin.json
  • plugins/plugin-observability/src/styles.css
  • plugins/plugin-observability/src/vite-env.d.ts
  • plugins/plugin-observability/src/web-export.ts
  • plugins/plugin-observability/tsconfig.build.json
  • plugins/plugin-observability/tsconfig.json
  • plugins/plugin-observability/tsconfig.node.json
  • plugins/plugin-observability/vite.config.ts
  • plugins/plugin-observability/vitest.config.js
  • tsconfig.build.json
💤 Files with no reviewable changes (6)
  • packages/fastify-generators/src/generators/core/index.ts
  • packages/react-generators/src/generators/core/index.ts
  • packages/project-builder-server/src/compiler/backend/fastify.ts
  • packages/react-generators/src/generators/apollo/index.ts
  • packages/project-builder-server/src/compiler/web/web-compiler.ts
  • packages/fastify-generators/src/generators/pothos/index.ts

@@ -0,0 +1,10 @@
---
'@baseplate-dev/plugin-observability': minor

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Use a patch bump in this changeset entry.

Line 2 uses minor, but the repository changeset rule specifies patch format for entries in .changeset/*.md.

Suggested fix
-'@baseplate-dev/plugin-observability': minor
+'@baseplate-dev/plugin-observability': patch

As per coding guidelines: “.changeset/*.md: Add a new Changeset ... with the format: ---\n'package-name': patch\n---\n\nDescription of the feature or change”.

📝 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/plugin-observability': minor
'@baseplate-dev/plugin-observability': patch
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.changeset/extract-sentry-plugin.md at line 2, Update the changeset entry so
it uses the required "patch" bump instead of "minor": locate the changeset
markdown that contains the line with the package identifier
'@baseplate-dev/plugin-observability' and replace the bump specifier "minor"
with "patch" so the entry matches the repository's .changeset/*.md format (i.e.,
'package-name': patch).

Comment on lines +38 to +59
migrate: (config) => {
const plugins = config.plugins ? [...config.plugins] : [];

// Skip if sentry plugin already exists
const existingIndex = plugins.findIndex((p) => p.id === SENTRY_PLUGIN_ID);

if (existingIndex === -1) {
plugins.push({
id: SENTRY_PLUGIN_ID,
name: 'sentry',
packageName: '@baseplate-dev/plugin-observability',
version: '0.1.0',
config: {
sentryOptions: {},
},
});
}

return {
...config,
plugins,
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n=== Old and new Sentry managed file IDs ===\n'
rg -n -C1 '@baseplate-dev/(core|react-generators|fastify-generators)#.*sentry|@baseplate-dev/plugin-observability#.*sentry'

printf '\n=== Migration/remap logic for managed file IDs ===\n'
rg -n -C2 'file-id-map|rename.*file.*id|migrate.*file.*id|generator.*id' packages plugins

Repository: halfdomelabs/baseplate

Length of output: 50379


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n=== Migration 027 full content ===\n'
cat packages/project-builder-lib/src/migrations/migration-027-enable-sentry-plugin.ts

printf '\n\n=== Check for alternateFullIds in Sentry generators ===\n'
find plugins/plugin-observability/src/sentry -name "*.json" -o -name "*.ts" | head -20 | xargs -I {} bash -c 'echo "=== {} ===" && head -50 {}'

printf '\n\n=== Check other migrations for ID remapping patterns ===\n'
ls -la packages/project-builder-lib/src/migrations/ | head -30

Repository: halfdomelabs/baseplate

Length of output: 26396


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n=== Search for alternateFullIds usage in generators ===\n'
rg -n 'alternateFullIds' plugins/plugin-observability --type ts --type json

printf '\n=== Check if any generator task in Sentry uses alternateFullIds ===\n'
rg -n 'alternateFullIds' packages/sync/src --type ts -A2 -B2 | head -50

printf '\n=== Check if file-id-map migration or remapping logic exists ===\n'
rg -n 'old.*sentry|fastify.*sentry|react.*sentry' packages/project-builder-lib/src/migrations --type ts -i

Repository: halfdomelabs/baseplate

Length of output: 122


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n=== Check file-id-map sync logic for auto-remapping ===\n'
cat packages/project-builder-server/src/sync/file-id-map.ts | head -100

printf '\n=== Check if sync detects and handles orphaned files ===\n'
rg -n 'orphan|remap|migrate.*file.*id' packages/project-builder-server/src/sync --type ts -B2 -A2

printf '\n=== Verify examples actually have updated file-id-map.json ===\n'
cat examples/blog-with-auth/apps/backend/baseplate/file-id-map.json | grep -A1 -B1 'plugin-observability.*sentry'

Repository: halfdomelabs/baseplate

Length of output: 1886


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n=== Verify examples file-id-map.json content ===\n'
head -150 examples/blog-with-auth/apps/backend/baseplate/file-id-map.json | grep 'sentry'

printf '\n=== Check if migration files reference file ID changes ===\n'
rg -n 'file-id-map' packages/project-builder-lib/src/migrations/*.ts

printf '\n=== Search for any file ID migration in later versions ===\n'
ls packages/project-builder-lib/src/migrations/ | grep migration-0

Repository: halfdomelabs/baseplate

Length of output: 472


Sentry managed-file IDs are not migrated by this change.

Migration 027 enables the @baseplate-dev/plugin-observability plugin but does not remap the Sentry-managed file IDs in baseplate/file-id-map.json. Existing projects will retain old file ID entries from the former @baseplate-dev/fastify-generators#core/fastify-sentry and @baseplate-dev/react-generators generators. Without explicit remapping—via migration logic, alternateFullIds in the generators, or sync-layer orphan detection—the next sync will orphan these files and likely re-generate them as newly managed, risking conflicts or overwrites of src/instrument.ts, src/services/sentry.ts, and related Apollo/Pothos Sentry files.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@packages/project-builder-lib/src/migrations/migration-027-enable-sentry-plugin.ts`
around lines 38 - 59, The migrate function (migrate) that adds SENTRY_PLUGIN_ID
must also remap existing Sentry-managed file IDs in baseplate/file-id-map.json
so old generator-managed entries (from
`@baseplate-dev/fastify-generators`#core/fastify-sentry and
`@baseplate-dev/react-generators`) are transferred to the new plugin owner; update
the migration to read the file-id map, find entries whose fullId or owner
references the old generator ids, and replace them with the new plugin
identifier (SENTRY_PLUGIN_ID or the plugin's packageName + name) for files like
src/instrument.ts and src/services/sentry.ts, ensuring either direct key renames
or merging into alternateFullIds so the sync layer won't orphan or re-generate
those files.

Comment on lines +275 to +315
- *
- 6. Disclaimer of Warranty \*
- ------------------------- \*
- *
- Covered Software is provided under this License on an "as is" \*
- basis, without warranty of any kind, either expressed, implied, or \*
- statutory, including, without limitation, warranties that the \*
- Covered Software is free of defects, merchantable, fit for a \*
- particular purpose or non-infringing. The entire risk as to the \*
- quality and performance of the Covered Software is with You. \*
- Should any Covered Software prove defective in any respect, You \*
- (not any Contributor) assume the cost of any necessary servicing, \*
- repair, or correction. This disclaimer of warranty constitutes an \*
- essential part of this License. No use of any Covered Software is \*
- authorized under this License except under this disclaimer. \*
- *

---

---

- *
- 7. Limitation of Liability \*
- -------------------------- \*
- *
- Under no circumstances and under no legal theory, whether tort \*
- (including negligence), contract, or otherwise, shall any \*
- Contributor, or anyone who distributes Covered Software as \*
- permitted above, be liable to You for any direct, indirect, \*
- special, incidental, or consequential damages of any character \*
- including, without limitation, damages for lost profits, loss of \*
- goodwill, work stoppage, computer failure or malfunction, or any \*
- and all other commercial damages or losses, even if such party \*
- shall have been informed of the possibility of such damages. This \*
- limitation of liability shall not apply to liability for death or \*
- personal injury resulting from such party's negligence to the \*
- extent applicable law prohibits such limitation. Some \*
- jurisdictions do not allow the exclusion or limitation of \*
- incidental or consequential damages, so this exclusion and \*
- limitation may not apply to You. \*
- *

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Restore MPL sections 6 and 7 in canonical form.

These lines appear to include markdown/deletion-style artifacts (- prefixes and escaped \*) instead of clean license text. For legal clarity and compliance, the MPL body should be copied verbatim from the official text with no transformation artifacts.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/plugin-observability/LICENSE` around lines 275 - 315, The MPL text
for sections "6. Disclaimer of Warranty" and "7. Limitation of Liability"
contains deletion/markdown artifacts (leading '-' characters and escaped
'\*')—replace the current mangled block in LICENSE with the canonical, verbatim
MPL wording for sections 6 and 7 (remove all '-' prefixes and '\*' escapes,
restore normal punctuation and line breaks) so the license matches the official
MPL text exactly for those two sections; locate the block labeled "6. Disclaimer
of Warranty" and "7. Limitation of Liability" in the LICENSE and substitute the
corrected canonical paragraphs verbatim.

Comment on lines +3 to +4
@import 'tailwindcss/theme.css' layer(theme) prefix(sentry);
@import 'tailwindcss/utilities.css' layer(utilities) prefix(sentry);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Biome config files =="
fd -HI 'biome*.json'

echo
echo "== Biome dependency/version references =="
rg -n '"@biomejs/biome"|"\bbiome\b"' $(fd -HI 'package.json' | tr '\n' ' ')

echo
echo "== Biome config content (first 260 lines) =="
fd -HI 'biome*.json' -x sh -c 'echo "--- {} ---"; sed -n "1,260p" "{}"'

echo
echo "== Any ignore/include mention for plugin-observability CSS paths =="
rg -n "plugin-observability/src/styles\\.css|plugin-observability/src/|ignore|includes|files|css" $(fd -HI 'biome*.json' | tr '\n' ' ')

echo
echo "== Where biome is invoked in scripts/workflows =="
rg -n "biome\\s+(check|lint|format)|@biomejs/biome|\\bbiome\\b"

Repository: halfdomelabs/baseplate

Length of output: 144


🏁 Script executed:

cat -n biome.json

Repository: halfdomelabs/baseplate

Length of output: 2351


🏁 Script executed:

fd -HI 'package.json' -x grep -l '@biomejs/biome\|"biome"' {} \;

Repository: halfdomelabs/baseplate

Length of output: 48


🏁 Script executed:

cat -n plugins/plugin-observability/package.json 2>/dev/null || echo "File not found"

Repository: halfdomelabs/baseplate

Length of output: 3566


🏁 Script executed:

fd -HI '.biomeignore'

Repository: halfdomelabs/baseplate

Length of output: 48


🏁 Script executed:

rg -l 'biome' $(fd -HI 'package.json\|\.yml\|\.yaml' | head -20)

Repository: halfdomelabs/baseplate

Length of output: 219


🏁 Script executed:

fd -HI '\.(yml|yaml)$' -path '*/.github/workflows/*' -o -path '*/\.github/workflows/*' | xargs cat 2>/dev/null | rg -A5 -B5 'biome'

Repository: halfdomelabs/baseplate

Length of output: 234


🌐 Web query:

Biome 2.4.6 CSS parser Tailwind CSS v4 @import layer prefix support

💡 Result:

Biome 2.4.6 can parse Tailwind CSS v4’s CSS-first syntax, but Tailwind support in Biome’s CSS parser is opt-in — you must enable css.parser.tailwindDirectives: true (or the CLI flag --css-parse-tailwind-directives) for Tailwind v4 directives/functions to be recognized. [1][2]

With that enabled, Biome is intended to accept Tailwind v4 @import statements that include Tailwind’s extra parameters like layer(...) and prefix(...), e.g. (from Tailwind docs):

`@import` "tailwindcss/theme.css" layer(theme) prefix(tw);
`@import` "tailwindcss/utilities.css" layer(utilities) prefix(tw);

[3]

If you don’t enable tailwindDirectives, Biome will parse those Tailwind-specific additions as invalid CSS and you’ll get parse errors. [1][2]

Sources:
[1] Biome v2.3 blog (Tailwind v4 support + css.parser.tailwindDirectives)
[2] Biome v2.3 blog (CLI flag --css-parse-tailwind-directives)
[3] Tailwind CSS docs (examples using @import ... layer(...) ... prefix(...))


🏁 Script executed:

find .github/workflows -type f -name '*.yml' -o -name '*.yaml' 2>/dev/null | xargs grep -l 'biome' 2>/dev/null || echo "No workflows found mentioning biome"

Repository: halfdomelabs/baseplate

Length of output: 101


🏁 Script executed:

# Check if any npm/pnpm scripts in root package.json invoke biome
cat -n package.json | grep -A20 '"scripts"' | head -30

Repository: halfdomelabs/baseplate

Length of output: 1514


Configure Biome to recognize Tailwind v4 import syntax.

Biome 2.4.6's CSS linter (enabled in biome.json) requires the tailwindDirectives parser option to recognize Tailwind v4's layer() and prefix() import modifiers. Without it, lines 3–4 will parse as invalid CSS.

Update biome.json to add:

"css": {
  "linter": {
    "enabled": true
  },
  "parser": {
    "cssModules": true,
    "tailwindDirectives": true
  }
}
🧰 Tools
🪛 Biome (2.4.6)

[error] 3-3: expected , but instead found (

(parse)


[error] 4-4: expected , but instead found (

(parse)


[error] 3-3: Don't use unknown media feature names.

(lint/correctness/noUnknownMediaFeatureName)


[error] 4-4: Don't use unknown media feature names.

(lint/correctness/noUnknownMediaFeatureName)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/plugin-observability/src/styles.css` around lines 3 - 4, Update
biome.json to enable the CSS linter and configure the CSS parser to recognize
Tailwind v4 imports by adding the "css.linter.enabled": true and under
"css.parser" set "cssModules": true and "tailwindDirectives": true so the linter
accepts imports using layer() and prefix(); modify the existing biome.json
top-level config (look for any current "css" or "parser" keys) and merge these
three keys into that object to avoid invalid CSS parse errors for lines
importing 'tailwindcss/theme.css' and 'tailwindcss/utilities.css'.

@kingston kingston merged commit fdd496d into main Mar 13, 2026
12 checks passed
@kingston kingston deleted the kingston/eng-1039-split-sentry-into-plugin-package branch March 13, 2026 23:49
@github-actions github-actions Bot mentioned this pull request Mar 13, 2026
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