Skip to content

Conversation

@kingston
Copy link
Collaborator

@kingston kingston commented Jul 9, 2025

Summary by CodeRabbit

Here are the updated release notes based on the provided changes:

  • New Features
    • Environment names have been updated to use shorter formats (e.g., 'dev', 'stage', 'prod') across configuration options for Fastify and React applications.
    • The development environment file for React projects is now protected from being overwritten during builds, preserving custom changes.
    • Cookie security and session cookie naming now align with the updated short environment names to ensure consistent behavior across environments.

@vercel
Copy link

vercel bot commented Jul 9, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
baseplate-project-builder-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 10, 2025 6:48am

@changeset-bot
Copy link

changeset-bot bot commented Jul 9, 2025

🦋 Changeset detected

Latest commit: d00676d

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

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

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

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

@coderabbitai
Copy link

coderabbitai bot commented Jul 9, 2025

Walkthrough

This change updates environment variable names for both Fastify and React generators to use shorter formats for environment values, switching from "development", "staging", and "production" to "dev", "stage", and "prod". It also adds a safeguard to prevent overwriting the .env.development file in React generators. Additionally, several internal checks and constants that compare environment names have been updated accordingly.

Changes

File(s) Change Summary
.changeset/change-env-names-to-short-format.md Documents the update of environment names to short format for two packages.
packages/fastify-generators/src/generators/core/config-service/config-service.generator.ts Changes environment values in config from long format to short ("dev", "stage", "prod"); updates example value.
packages/react-generators/src/generators/core/react-config/react-config.generator.ts Updates environment values to short format; changes default from "development" to "dev"; adds shouldNeverOverwrite option to .env.development.
packages/fastify-generators/src/generators/core/error-handler-service/templates/src/plugins/error-handler.ts Updates the value of the IS_DEVELOPMENT constant from 'development' to 'dev'.
packages/fastify-generators/src/generators/yoga/yoga-plugin/templates/src/plugins/graphql/index.ts Updates the value of the IS_DEVELOPMENT constant from 'development' to 'dev'.
plugins/plugin-auth/src/auth/core/generators/auth-module/templates/module/services/user-session.service.ts Changes environment check for setting cookie secure flag from 'development' to 'dev'.
plugins/plugin-auth/src/auth/core/generators/auth-module/templates/module/utils/session-cookie.ts Updates environment check from 'development' to 'dev' for deciding session cookie naming logic.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Generator (Fastify/React)
    participant ConfigService

    User->>Generator (Fastify/React): Initiate project generation
    Generator (Fastify/React)->>ConfigService: Request environment config
    ConfigService-->>Generator (Fastify/React): Provide env ("dev", "test", "stage", "prod")
    Generator (Fastify/React)->>FileSystem: Write config files (.env, etc.)
    Note right of Generator (Fastify/React): React generator skips overwrite if .env.development exists
Loading

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0567287 and d00676d.

⛔ Files ignored due to path filters (19)
  • tests/simple/packages/backend/.env.example is excluded by !tests/**
  • tests/simple/packages/backend/baseplate/generated/.env.example is excluded by !**/generated/**, !tests/**, !**/generated/**
  • tests/simple/packages/backend/baseplate/generated/src/plugins/error-handler.ts is excluded by !**/generated/**, !tests/**, !**/generated/**
  • tests/simple/packages/backend/baseplate/generated/src/plugins/graphql/index.ts is excluded by !**/generated/**, !tests/**, !**/generated/**
  • tests/simple/packages/backend/baseplate/generated/src/services/config.ts is excluded by !**/generated/**, !tests/**, !**/generated/**
  • tests/simple/packages/backend/baseplate/generated/src/utils/zod.ts is excluded by !**/generated/**, !tests/**, !**/generated/**
  • tests/simple/packages/backend/src/plugins/error-handler.ts is excluded by !tests/**
  • tests/simple/packages/backend/src/plugins/graphql/index.ts is excluded by !tests/**
  • tests/simple/packages/backend/src/services/config.ts is excluded by !tests/**
  • tests/simple/packages/backend/src/utils/zod.ts is excluded by !tests/**
  • tests/simple/packages/web/.env.development is excluded by !tests/**
  • tests/simple/packages/web/baseplate/generated/.env.development is excluded by !**/generated/**, !tests/**, !**/generated/**
  • tests/simple/packages/web/baseplate/generated/package.json is excluded by !**/generated/**, !tests/**, !**/generated/**
  • tests/simple/packages/web/baseplate/generated/src/services/config.ts is excluded by !**/generated/**, !tests/**, !**/generated/**
  • tests/simple/packages/web/baseplate/generated/src/services/error-formatter.ts is excluded by !**/generated/**, !tests/**, !**/generated/**
  • tests/simple/packages/web/package.json is excluded by !tests/**
  • tests/simple/packages/web/src/services/config.ts is excluded by !tests/**
  • tests/simple/packages/web/src/services/error-formatter.ts is excluded by !tests/**
  • tests/simple/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml, !tests/**
📒 Files selected for processing (2)
  • plugins/plugin-auth/src/auth/core/generators/auth-module/templates/module/services/user-session.service.ts (1 hunks)
  • plugins/plugin-auth/src/auth/core/generators/auth-module/templates/module/utils/session-cookie.ts (2 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
`**/*.{ts,tsx}`: TypeScript with strict type checking Node 16 module resolution ...

**/*.{ts,tsx}: TypeScript with strict type checking
Node 16 module resolution - include file extensions in imports (.js)
Sort imports by group: external libs first, then local imports
Use camelCase for variables/functions, PascalCase for types/classes
Always include return types on top-level functions including React components (React.ReactElement)
Include absolute paths in import statements via tsconfig paths (@src/ is the alias for src/)
Order functions such that functions are placed below the variables/functions they use
If a particular interface or type is not exported, change the file so it is exported
Prefer using nullish coalescing operator (??) instead of logical or (||)
Use console.info/warn/error instead of console.log
Always use .js extensions in imports, even for TypeScript files
Specify explicit return types on all functions

📄 Source: CodeRabbit Inference Engine (CLAUDE.md)

List of files the instruction was applied to:

  • plugins/plugin-auth/src/auth/core/generators/auth-module/templates/module/services/user-session.service.ts
  • plugins/plugin-auth/src/auth/core/generators/auth-module/templates/module/utils/session-cookie.ts
`**/*`: Use kebab-case for file names

**/*: Use kebab-case for file names

📄 Source: CodeRabbit Inference Engine (CLAUDE.md)

List of files the instruction was applied to:

  • plugins/plugin-auth/src/auth/core/generators/auth-module/templates/module/services/user-session.service.ts
  • plugins/plugin-auth/src/auth/core/generators/auth-module/templates/module/utils/session-cookie.ts
`{packages,plugins}/**/*.{ts,tsx}`: Use TypeScript with strict type checking ena...

{packages,plugins}/**/*.{ts,tsx}: Use TypeScript with strict type checking enabled
All functions (excluding one-liner arrow functions) require explicit return types
Use camelCase for variables and functions
Use PascalCase for types and classes
Prefer functional programming patterns
Extract repeated components into distinct functions or components where applicable

📄 Source: CodeRabbit Inference Engine (.cursor/rules/code-style.mdc)

List of files the instruction was applied to:

  • plugins/plugin-auth/src/auth/core/generators/auth-module/templates/module/services/user-session.service.ts
  • plugins/plugin-auth/src/auth/core/generators/auth-module/templates/module/utils/session-cookie.ts
🧠 Learnings (2)
📓 Common learnings
Learnt from: kingston
PR: halfdomelabs/baseplate#598
File: packages/fastify-generators/src/generators/yoga/yoga-plugin/templates/src/plugins/graphql/index.ts:18-18
Timestamp: 2025-07-10T06:49:07.704Z
Learning: In React projects using Vite, keep the .env file naming convention as .env.development, .env.production, etc. even when internal application environment values use shorter abbreviations like 'dev', 'stage', 'prod'. This follows Vite's mode conventions.
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : Use camelCase for variables and functions
Learnt from: kingston
PR: halfdomelabs/baseplate#521
File: packages/react-generators/src/generators/admin/admin-components/admin-components.generator.ts:55-61
Timestamp: 2025-05-05T06:35:13.300Z
Learning: In generators, paths should be merged with forward slashes (/) only since JavaScript generated files use POSIX style separators. The system handles conversion to Windows style separators at later stages when writing out files.
plugins/plugin-auth/src/auth/core/generators/auth-module/templates/module/utils/session-cookie.ts (3)
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : Use camelCase for variables and functions
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T11:51:48.395Z
Learning: Applies to **/*.{ts,tsx} : If a particular interface or type is not exported, change the file so it is exported
Learnt from: kingston
PR: halfdomelabs/baseplate#598
File: packages/fastify-generators/src/generators/yoga/yoga-plugin/templates/src/plugins/graphql/index.ts:18-18
Timestamp: 2025-07-10T06:49:07.704Z
Learning: In React projects using Vite, keep the .env file naming convention as .env.development, .env.production, etc. even when internal application environment values use shorter abbreviations like 'dev', 'stage', 'prod'. This follows Vite's mode conventions.
🧬 Code Graph Analysis (2)
plugins/plugin-auth/src/auth/core/generators/auth-module/templates/module/services/user-session.service.ts (1)
packages/fastify-generators/src/generators/core/config-service/templates/src/services/config.ts (1)
  • config (5-5)
plugins/plugin-auth/src/auth/core/generators/auth-module/templates/module/utils/session-cookie.ts (1)
packages/fastify-generators/src/generators/core/config-service/templates/src/services/config.ts (1)
  • config (5-5)
🔇 Additional comments (3)
plugins/plugin-auth/src/auth/core/generators/auth-module/templates/module/services/user-session.service.ts (1)

36-36: LGTM: Environment check correctly updated for new naming convention.

The logic correctly maintains the same security behavior - secure cookies are disabled only for the 'dev' environment, ensuring HTTPS-only cookies in staging and production environments.

plugins/plugin-auth/src/auth/core/generators/auth-module/templates/module/utils/session-cookie.ts (2)

11-11: LGTM: Comment updated to reflect new environment naming convention.

The comment accurately describes the behavior using the new 'dev' environment name.


20-20: LGTM: Environment check correctly updated for new naming convention.

The logic correctly maintains the same cookie naming behavior - using the more secure __Host- prefix for non-development environments ('stage' and 'prod') while using port-specific naming for the 'dev' environment where localhost doesn't support the __Host- prefix.

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 636069e and 0567287.

📒 Files selected for processing (2)
  • packages/fastify-generators/src/generators/core/error-handler-service/templates/src/plugins/error-handler.ts (1 hunks)
  • packages/fastify-generators/src/generators/yoga/yoga-plugin/templates/src/plugins/graphql/index.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
`**/*.{ts,tsx}`: TypeScript with strict type checking Node 16 module resolution ...

**/*.{ts,tsx}: TypeScript with strict type checking
Node 16 module resolution - include file extensions in imports (.js)
Sort imports by group: external libs first, then local imports
Use camelCase for variables/functions, PascalCase for types/classes
Always include return types on top-level functions including React components (React.ReactElement)
Include absolute paths in import statements via tsconfig paths (@src/ is the alias for src/)
Order functions such that functions are placed below the variables/functions they use
If a particular interface or type is not exported, change the file so it is exported
Prefer using nullish coalescing operator (??) instead of logical or (||)
Use console.info/warn/error instead of console.log
Always use .js extensions in imports, even for TypeScript files
Specify explicit return types on all functions

📄 Source: CodeRabbit Inference Engine (CLAUDE.md)

List of files the instruction was applied to:

  • packages/fastify-generators/src/generators/yoga/yoga-plugin/templates/src/plugins/graphql/index.ts
  • packages/fastify-generators/src/generators/core/error-handler-service/templates/src/plugins/error-handler.ts
`**/*`: Use kebab-case for file names

**/*: Use kebab-case for file names

📄 Source: CodeRabbit Inference Engine (CLAUDE.md)

List of files the instruction was applied to:

  • packages/fastify-generators/src/generators/yoga/yoga-plugin/templates/src/plugins/graphql/index.ts
  • packages/fastify-generators/src/generators/core/error-handler-service/templates/src/plugins/error-handler.ts
`**/index.{ts,tsx}`: Prefer barrel exports e.g. `export * from './foo.js'` instead of individual named exports

**/index.{ts,tsx}: Prefer barrel exports e.g. export * from './foo.js' instead of individual named exports

📄 Source: CodeRabbit Inference Engine (CLAUDE.md)

List of files the instruction was applied to:

  • packages/fastify-generators/src/generators/yoga/yoga-plugin/templates/src/plugins/graphql/index.ts
`{packages,plugins}/**/*.{ts,tsx}`: Use TypeScript with strict type checking ena...

{packages,plugins}/**/*.{ts,tsx}: Use TypeScript with strict type checking enabled
All functions (excluding one-liner arrow functions) require explicit return types
Use camelCase for variables and functions
Use PascalCase for types and classes
Prefer functional programming patterns
Extract repeated components into distinct functions or components where applicable

📄 Source: CodeRabbit Inference Engine (.cursor/rules/code-style.mdc)

List of files the instruction was applied to:

  • packages/fastify-generators/src/generators/yoga/yoga-plugin/templates/src/plugins/graphql/index.ts
  • packages/fastify-generators/src/generators/core/error-handler-service/templates/src/plugins/error-handler.ts
🧠 Learnings (3)
📓 Common learnings
Learnt from: kingston
PR: halfdomelabs/baseplate#521
File: packages/react-generators/src/generators/admin/admin-components/admin-components.generator.ts:55-61
Timestamp: 2025-05-05T06:35:13.300Z
Learning: In generators, paths should be merged with forward slashes (/) only since JavaScript generated files use POSIX style separators. The system handles conversion to Windows style separators at later stages when writing out files.
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : Use camelCase for variables and functions
packages/fastify-generators/src/generators/yoga/yoga-plugin/templates/src/plugins/graphql/index.ts (5)
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : Use camelCase for variables and functions
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : Use PascalCase for types and classes
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : Use TypeScript with strict type checking enabled
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{unit,int}.test.ts : Always import vitest globals explicitly (describe, it, expect)
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T11:51:48.395Z
Learning: Applies to **/*.{ts,tsx} : If a particular interface or type is not exported, change the file so it is exported
packages/fastify-generators/src/generators/core/error-handler-service/templates/src/plugins/error-handler.ts (1)
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : Use camelCase for variables and functions
🧬 Code Graph Analysis (2)
packages/fastify-generators/src/generators/yoga/yoga-plugin/templates/src/plugins/graphql/index.ts (1)
packages/fastify-generators/src/generators/core/config-service/templates/src/services/config.ts (1)
  • config (5-5)
packages/fastify-generators/src/generators/core/error-handler-service/templates/src/plugins/error-handler.ts (1)
packages/fastify-generators/src/generators/core/config-service/templates/src/services/config.ts (1)
  • config (5-5)
⏰ 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). (3)
  • GitHub Check: Test E2E
  • GitHub Check: Lint
  • GitHub Check: test
🔇 Additional comments (1)
packages/fastify-generators/src/generators/core/error-handler-service/templates/src/plugins/error-handler.ts (1)

9-9: Consistent environment name change - looks good.

The change from 'development' to 'dev' is consistent with the refactoring objective and follows the same pattern as the GraphQL plugin file. The IS_DEVELOPMENT constant is appropriately used on line 44 to conditionally include original error details only in development mode, which maintains proper security practices.

@kingston kingston merged commit 69eea11 into main Jul 10, 2025
10 checks passed
@kingston kingston deleted the kingston/eng-773-change-environments-to-stageprod branch July 10, 2025 06:54
@github-actions github-actions bot mentioned this pull request Jul 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants