refactor: Split Stripe into separate payments plugin#829
Conversation
🦋 Changeset detectedLatest commit: 9b65789 The changes in this PR will be included in the next version bump. This PR includes changesets to release 23 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 |
📝 WalkthroughWalkthroughExtracts Stripe from fastify-generators into a new Changes
Sequence DiagramsequenceDiagram
participant ProjDef as Project Definition
participant PluginSys as Plugin System
participant WebUI as Web UI (StripeEditor)
participant Compiler as Backend Compiler
participant Runtime as Fastify Runtime
ProjDef->>PluginSys: include plugin-payments:stripe in plugins[]
PluginSys->>WebUI: mount StripeDefinitionEditor for plugin key
WebUI->>WebUI: user edits stripeOptions and saves
WebUI->>PluginSys: PluginUtils.setPluginConfig(update)
PluginSys->>Compiler: expose plugin metadata to appCompiler
Compiler->>Compiler: add stripe child (fastifyStripeGenerator) during compile
Compiler->>Runtime: compiled app includes stripe routes & services
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
|
Deploying baseplate-storybook with
|
| Latest commit: |
9b65789
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://1aab1fc4.baseplate-storybook.pages.dev |
| Branch Preview URL: | https://kingston-eng-1035-split-stri.baseplate-storybook.pages.dev |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@examples/todo-with-better-auth/apps/backend/src/services/.templates-info.json`:
- Around line 43-48: The extractor metadata contains outdated generator
references: replace all occurrences of the old generator string
"@baseplate-dev/fastify-generators#stripe/fastify-stripe" in extractor.json with
the new "@baseplate-dev/plugin-payments#stripe/fastify-stripe" so the template
metadata round-trips correctly; update the four instances noted in the review to
match the strings used elsewhere (e.g., those seen in .templates-info.json) to
ensure tool resolution consistency.
In `@plugins/plugin-payments/LICENSE`:
- Around line 275-317: The LICENSE file's sections titled "Disclaimer of
Warranty" and "Limitation of Liability" contain corrupted line prefixes/suffixes
(stray "-" and "\*") and broken line breaks; replace the malformed blocks under
the headings "6. Disclaimer of Warranty" and "7. Limitation of Liability" with
the canonical MPL-2.0 paragraph text (remove all "-" prefixes and "\*" suffixes
and restore normal sentences/line breaks) so the text matches the official
license wording exactly; locate the blocks by the section headings in the
LICENSE and perform a straight textual replacement to the standard MPL-2.0
content for those two sections.
In `@plugins/plugin-payments/src/styles.css`:
- Around line 3-4: The CSS `@import` lines using Tailwind v4 modifiers (e.g. the
lines containing "@import 'tailwindcss/theme.css' layer(theme) prefix(payments)"
and the similar utilities import) cause Biome v2.4.6 parse errors; add an
overrides entry to your biome.json that targets this plugin's styles.css and
disables the CSS formatter and linter (css.formatter.enabled = false and
css.linter.enabled = false) so Biome will skip parsing these Tailwind v4
constructs, or alternatively add a top-of-file Biome suppression comment to
disable formatting for this file.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 70ce22ad-92ac-486c-8e5a-b1bc175a4d16
⛔ Files ignored due to path filters (13)
examples/blog-with-auth/apps/admin/baseplate/generated/src/components/ui/checkbox-field.tsxis excluded by!**/generated/**,!**/generated/**examples/blog-with-auth/apps/admin/baseplate/generated/src/components/ui/switch-field.tsxis excluded by!**/generated/**,!**/generated/**examples/todo-with-better-auth/apps/admin/baseplate/generated/src/components/ui/checkbox-field.tsxis excluded by!**/generated/**,!**/generated/**examples/todo-with-better-auth/apps/admin/baseplate/generated/src/components/ui/switch-field.tsxis excluded by!**/generated/**,!**/generated/**examples/todo-with-better-auth/apps/web/baseplate/generated/src/components/ui/checkbox-field.tsxis excluded by!**/generated/**,!**/generated/**examples/todo-with-better-auth/apps/web/baseplate/generated/src/components/ui/switch-field.tsxis excluded by!**/generated/**,!**/generated/**plugins/plugin-payments/src/stripe/core/generators/fastify-stripe/generated/index.tsis excluded by!**/generated/**,!**/generated/**plugins/plugin-payments/src/stripe/core/generators/fastify-stripe/generated/template-paths.tsis excluded by!**/generated/**,!**/generated/**plugins/plugin-payments/src/stripe/core/generators/fastify-stripe/generated/template-renderers.tsis excluded by!**/generated/**,!**/generated/**plugins/plugin-payments/src/stripe/core/generators/fastify-stripe/generated/ts-import-providers.tsis excluded by!**/generated/**,!**/generated/**plugins/plugin-payments/src/stripe/core/generators/fastify-stripe/generated/typed-templates.tsis excluded by!**/generated/**,!**/generated/**plugins/plugin-payments/src/stripe/static/icon.svgis excluded by!**/*.svgpnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (68)
.changeset/extract-stripe-to-plugin-payments.mdexamples/blog-with-auth/apps/admin/src/components/ui/checkbox-field.tsxexamples/blog-with-auth/apps/admin/src/components/ui/switch-field.tsxexamples/blog-with-auth/baseplate/project-definition.jsonexamples/todo-with-better-auth/apps/admin/src/components/ui/checkbox-field.tsxexamples/todo-with-better-auth/apps/admin/src/components/ui/switch-field.tsxexamples/todo-with-better-auth/apps/backend/baseplate/file-id-map.jsonexamples/todo-with-better-auth/apps/backend/src/plugins/.templates-info.jsonexamples/todo-with-better-auth/apps/backend/src/services/.templates-info.jsonexamples/todo-with-better-auth/apps/web/src/components/ui/checkbox-field.tsxexamples/todo-with-better-auth/apps/web/src/components/ui/switch-field.tsxexamples/todo-with-better-auth/baseplate/project-definition.jsonknip.config.jspackages/fastify-generators/src/generators/index.tspackages/project-builder-common/package.jsonpackages/project-builder-lib/src/migrations/index.tspackages/project-builder-lib/src/migrations/migration-028-enable-stripe-plugin.tspackages/project-builder-lib/src/migrations/migration-028-enable-stripe-plugin.unit.test.tspackages/project-builder-lib/src/schema/apps/backend/index.tspackages/project-builder-server/src/compiler/backend/fastify.tspackages/project-builder-web/public/preview-app.jsonpackages/project-builder-web/src/app/app-layout/app-breadcrumbs.tsxpackages/project-builder-web/src/routes/data/models/edit.$key/-components/fields/model-field-default-value-input.tsxpackages/project-builder-web/src/routes/data/models/edit.$key/-components/fields/model-field-form.tsxpackages/project-builder-web/src/routes/data/models/edit.$key/-components/service/service-transformers-section.tsxpackages/project-builder-web/src/routes/packages/apps.$key/backend.tsxpackages/project-builder-web/src/routes/plugins/edit.$key.tsxpackages/project-builder-web/src/routes/plugins/route.tsxpackages/react-generators/src/generators/core/react-components/templates/components/ui/checkbox-field.tsxpackages/react-generators/src/generators/core/react-components/templates/components/ui/switch-field.tsxpackages/ui-components/src/components/ui/checkbox-field/checkbox-field.tsxpackages/ui-components/src/components/ui/switch-field/switch-field.tsxplugins/plugin-payments/.gitignoreplugins/plugin-payments/CHANGELOG.mdplugins/plugin-payments/LICENSEplugins/plugin-payments/README.mdplugins/plugin-payments/eslint.config.jsplugins/plugin-payments/index.htmlplugins/plugin-payments/package.jsonplugins/plugin-payments/prettier.config.jsplugins/plugin-payments/src/index.tsplugins/plugin-payments/src/stripe/core/common.tsplugins/plugin-payments/src/stripe/core/components/stripe-definition-editor.tsxplugins/plugin-payments/src/stripe/core/generators/fastify-stripe/extractor.jsonplugins/plugin-payments/src/stripe/core/generators/fastify-stripe/fastify-stripe.generator.tsplugins/plugin-payments/src/stripe/core/generators/fastify-stripe/index.tsplugins/plugin-payments/src/stripe/core/generators/fastify-stripe/templates/src/plugins/stripe-webhook.int.test.tsplugins/plugin-payments/src/stripe/core/generators/fastify-stripe/templates/src/plugins/stripe-webhook.tsplugins/plugin-payments/src/stripe/core/generators/fastify-stripe/templates/src/services/stripe-events.tsplugins/plugin-payments/src/stripe/core/generators/fastify-stripe/templates/src/services/stripe.tsplugins/plugin-payments/src/stripe/core/generators/index.tsplugins/plugin-payments/src/stripe/core/index.tsplugins/plugin-payments/src/stripe/core/node.tsplugins/plugin-payments/src/stripe/core/schema/plugin-definition.tsplugins/plugin-payments/src/stripe/core/web.tsplugins/plugin-payments/src/stripe/index.tsplugins/plugin-payments/src/stripe/plugin.jsonplugins/plugin-payments/src/styles.cssplugins/plugin-payments/src/vite-env.d.tsplugins/plugin-payments/src/web-export.tsplugins/plugin-payments/tsconfig.build.jsonplugins/plugin-payments/tsconfig.jsonplugins/plugin-payments/tsconfig.node.jsonplugins/plugin-payments/vite.config.tsplugins/plugin-payments/vitest.config.jsplugins/plugin-rate-limit/src/rate-limit/core/components/rate-limit-definition-editor.tsxplugins/plugin-storage/src/storage/core/components/storage-definition-editor.tsxtsconfig.build.json
💤 Files with no reviewable changes (6)
- packages/project-builder-web/public/preview-app.json
- packages/project-builder-web/src/routes/packages/apps.$key/backend.tsx
- knip.config.js
- packages/project-builder-server/src/compiler/backend/fastify.ts
- packages/project-builder-lib/src/schema/apps/backend/index.ts
- packages/fastify-generators/src/generators/index.ts
| "generator": "@baseplate-dev/plugin-payments#stripe/fastify-stripe", | ||
| "instanceData": {}, | ||
| "template": "service-events" | ||
| }, | ||
| "stripe.ts": { | ||
| "generator": "@baseplate-dev/fastify-generators#stripe/fastify-stripe", | ||
| "generator": "@baseplate-dev/plugin-payments#stripe/fastify-stripe", |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "1) Find stale Stripe generator references (expected: no matches):"
rg -n '"generator":\s*"@baseplate-dev/fastify-generators#stripe/fastify-stripe"' \
plugins/plugin-payments/src/stripe/core/generators/fastify-stripe/extractor.json
echo
echo "2) Confirm new package reference exists (expected: one or more matches):"
rg -n '"generator":\s*"@baseplate-dev/plugin-payments#stripe/fastify-stripe"' \
plugins/plugin-payments/src/stripe/core/generators/fastify-stripe/extractor.jsonRepository: halfdomelabs/baseplate
Length of output: 528
Update plugin-payments extractor generator references to match this migration
Lines 43 and 48 correctly point to @baseplate-dev/plugin-payments#stripe/fastify-stripe, but plugins/plugin-payments/src/stripe/core/generators/fastify-stripe/extractor.json still references the old @baseplate-dev/fastify-generators#stripe/fastify-stripe at lines 7, 27, 42, and 58. This inconsistency can break template metadata round-tripping and tool resolution.
Update all four occurrences in extractor.json:
- "generator": "@baseplate-dev/fastify-generators#stripe/fastify-stripe",
+ "generator": "@baseplate-dev/plugin-payments#stripe/fastify-stripe",🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In
`@examples/todo-with-better-auth/apps/backend/src/services/.templates-info.json`
around lines 43 - 48, The extractor metadata contains outdated generator
references: replace all occurrences of the old generator string
"@baseplate-dev/fastify-generators#stripe/fastify-stripe" in extractor.json with
the new "@baseplate-dev/plugin-payments#stripe/fastify-stripe" so the template
metadata round-trips correctly; update the four instances noted in the review to
match the strings used elsewhere (e.g., those seen in .templates-info.json) to
ensure tool resolution consistency.
| @import 'tailwindcss/theme.css' layer(theme) prefix(payments); | ||
| @import 'tailwindcss/utilities.css' layer(utilities) prefix(payments); |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
Does Biome v2.4.6 support Tailwind CSS v4 @importmodifiers likeprefix(...)(e.g.,@import 'tailwindcss/theme.css' layer(theme) prefix(payments);), and if not, what is the recommended workaround in Biome configuration?
💡 Result:
No. Biome v2.4.6 still doesn’t parse Tailwind CSS v4’s extra @import “modifiers”/functions (like source(...) and, by extension, prefix(...) after layer(...)), so formatting/linting the file can fail at parse time. Biome has an open/closed history of treating this as unsupported Tailwind-specific @import syntax (for example @import "tailwindcss" source(none); causing a parse error). [1] Tailwind’s own recommended v4 syntax does use layer(...) + prefix(...) on @import lines. [2]
Workaround (recommended in Biome config): disable Biome’s CSS formatter (and optionally CSS lint) for the file(s) that contain these Tailwind v4 @import ... prefix(...) lines using an overrides entry, since overrides can replace top-level config per glob match. [3]
// biome.json
{
"overrides": [
{
"include": ["src/app/globals.css"], // adjust
"css": {
"formatter": { "enabled": false },
"linter": { "enabled": false } // optional, but often paired
}
}
]
}If you prefer not to use config, Biome also supports suppressing formatting for a whole file via a top-of-file ignore comment. [4]
Sources: [1] [2] [3] [4]
Add biome.json overrides config for Tailwind v4 syntax support
Lines 3-4 use prefix(payments) correctly for plugin scoping. However, Biome v2.4.6 does not parse Tailwind v4's @import modifiers (layer(...) and prefix(...)) and will report parse errors. Configure Biome to skip CSS parsing for this file using an overrides entry:
biome.json configuration example
{
"overrides": [
{
"include": ["plugins/plugin-payments/src/styles.css"],
"css": {
"formatter": { "enabled": false },
"linter": { "enabled": false }
}
}
]
}Alternatively, suppress formatting via a top-of-file comment if config-based exclusion is not preferred.
🧰 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-payments/src/styles.css` around lines 3 - 4, The CSS `@import`
lines using Tailwind v4 modifiers (e.g. the lines containing "@import
'tailwindcss/theme.css' layer(theme) prefix(payments)" and the similar utilities
import) cause Biome v2.4.6 parse errors; add an overrides entry to your
biome.json that targets this plugin's styles.css and disables the CSS formatter
and linter (css.formatter.enabled = false and css.linter.enabled = false) so
Biome will skip parsing these Tailwind v4 constructs, or alternatively add a
top-of-file Biome suppression comment to disable formatting for this file.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.workspace-meta/templates/LICENSE:
- Around line 67-73: Section 1.11 in the LICENSE template deviates from
canonical MPL-2.0 wording; update the text in Section 1.11 (the "Patent Claims"
definition) to replace the phrase "have made, import, or transfer" with the
correct canonical phrase "have made, import, or otherwise transfer". Locate the
template's Section 1.11 string and edit the sentence so it exactly matches the
standard MPL-2.0 wording for that clause.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 108d8a37-1d8b-4c74-ba11-b74f8a83c3f4
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (50)
.prettierignore.root.prettierignore.workspace-meta/config.ts.workspace-meta/templates/LICENSELICENSEpackages/code-morph/LICENSEpackages/core-generators/LICENSEpackages/create-project/.prettierignorepackages/create-project/LICENSEpackages/fastify-generators/.prettierignorepackages/fastify-generators/LICENSEpackages/project-builder-cli/.prettierignorepackages/project-builder-cli/LICENSEpackages/project-builder-common/.prettierignorepackages/project-builder-common/LICENSEpackages/project-builder-dev/.prettierignorepackages/project-builder-dev/LICENSEpackages/project-builder-lib/.prettierignorepackages/project-builder-lib/LICENSEpackages/project-builder-server/.prettierignorepackages/project-builder-server/LICENSEpackages/project-builder-test/.prettierignorepackages/project-builder-test/LICENSEpackages/project-builder-web/.prettierignorepackages/project-builder-web/LICENSEpackages/react-generators/.prettierignorepackages/react-generators/LICENSEpackages/sync/.prettierignorepackages/sync/LICENSEpackages/tools/.prettierignorepackages/tools/LICENSEpackages/ui-components/.prettierignorepackages/ui-components/LICENSEpackages/utils/.prettierignorepackages/utils/LICENSEplugins/plugin-auth/.prettierignoreplugins/plugin-auth/LICENSEplugins/plugin-email/.prettierignoreplugins/plugin-email/LICENSEplugins/plugin-observability/.prettierignoreplugins/plugin-observability/LICENSEplugins/plugin-payments/.prettierignoreplugins/plugin-payments/LICENSEplugins/plugin-queue/.prettierignoreplugins/plugin-queue/LICENSEplugins/plugin-rate-limit/.prettierignoreplugins/plugin-rate-limit/LICENSEplugins/plugin-storage/.prettierignoreplugins/plugin-storage/LICENSEturbo.json
✅ Files skipped from review due to trivial changes (16)
- plugins/plugin-queue/.prettierignore
- packages/sync/.prettierignore
- packages/project-builder-cli/.prettierignore
- plugins/plugin-payments/LICENSE
- packages/create-project/.prettierignore
- plugins/plugin-auth/.prettierignore
- packages/ui-components/.prettierignore
- packages/project-builder-test/LICENSE
- packages/project-builder-common/LICENSE
- packages/react-generators/.prettierignore
- plugins/plugin-rate-limit/.prettierignore
- plugins/plugin-payments/.prettierignore
- plugins/plugin-observability/.prettierignore
- plugins/plugin-storage/LICENSE
- plugins/plugin-observability/LICENSE
- packages/tools/.prettierignore
| 1.11. "Patent Claims" of a Contributor | ||
| means any patent claim(s), including without limitation, method, | ||
| process, and apparatus claims, in any patent Licensable by such | ||
| Contributor that would be infringed, but for the grant of the | ||
| License, by the making, using, selling, offering for sale, having | ||
| made, import, or transfer of either its Contributions or its | ||
| Contributor Version. | ||
| means any patent claim(s), including without limitation, method, | ||
| process, and apparatus claims, in any patent Licensable by such | ||
| Contributor that would be infringed, but for the grant of the | ||
| License, by the making, using, selling, offering for sale, having | ||
| made, import, or transfer of either its Contributions or its | ||
| Contributor Version. |
There was a problem hiding this comment.
Restore canonical MPL wording in Section 1.11.
Line 72 currently says “have made, import, or transfer”. The standard MPL-2.0 text is “have made, import, or otherwise transfer”. This is a legal-text deviation and should be corrected at the template source to avoid propagating non-canonical license language.
📄 Proposed fix
- made, import, or transfer of either its Contributions or its
+ made, import, or otherwise transfer of either its Contributions or its📝 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.
| 1.11. "Patent Claims" of a Contributor | |
| means any patent claim(s), including without limitation, method, | |
| process, and apparatus claims, in any patent Licensable by such | |
| Contributor that would be infringed, but for the grant of the | |
| License, by the making, using, selling, offering for sale, having | |
| made, import, or transfer of either its Contributions or its | |
| Contributor Version. | |
| means any patent claim(s), including without limitation, method, | |
| process, and apparatus claims, in any patent Licensable by such | |
| Contributor that would be infringed, but for the grant of the | |
| License, by the making, using, selling, offering for sale, having | |
| made, import, or transfer of either its Contributions or its | |
| Contributor Version. | |
| 1.11. "Patent Claims" of a Contributor | |
| means any patent claim(s), including without limitation, method, | |
| process, and apparatus claims, in any patent Licensable by such | |
| Contributor that would be infringed, but for the grant of the | |
| License, by the making, using, selling, offering for sale, having | |
| made, import, or otherwise transfer of either its Contributions or its | |
| Contributor Version. |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.workspace-meta/templates/LICENSE around lines 67 - 73, Section 1.11 in the
LICENSE template deviates from canonical MPL-2.0 wording; update the text in
Section 1.11 (the "Patent Claims" definition) to replace the phrase "have made,
import, or transfer" with the correct canonical phrase "have made, import, or
otherwise transfer". Locate the template's Section 1.11 string and edit the
sentence so it exactly matches the standard MPL-2.0 wording for that clause.
Summary by CodeRabbit
New Features
Bug Fixes
Chores