Skip to content

Conversation

@zzcr
Copy link
Member

@zzcr zzcr commented Nov 3, 2025

…ration

PR

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our Commit Message Guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Summary by CodeRabbit

  • Chores
    • Updated build configuration for SaaS environments with new environment variable settings
    • Modified build mode to use updated configuration strategy
    • Added new environment configuration settings for enhanced build targeting and context management

@github-actions github-actions bot added the chore label Nov 3, 2025
@coderabbitai
Copy link

coderabbitai bot commented Nov 3, 2025

Walkthrough

Configuration updates for SaaS environment builds. A new environment configuration file (.env.saaspages) is added, an existing environment file is modified to change the build target, and the build script is updated to use the new configuration mode.

Changes

Cohort / File(s) Summary
SaaS Environment Configuration
examples/sites/env/.env.saas, examples/sites/env/.env.saaspages
Modified VITE_BUILD_TARGET from 'open' to 'inner' in .env.saas. Added new .env.saaspages file with Vite environment variables including context path, build target, theme, app mode, and playground URL.
Build Script Updates
examples/sites/package.json
Updated build:saas script to use vite build --mode saaspages instead of vite build --mode saas. Copy command unchanged.
Minor Formatting
packages/vue/package.json
Removed trailing newline at end of file.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Straightforward configuration changes with minimal logic complexity
  • New environment file follows existing conventions
  • Build script change is a direct mode parameter substitution with clear intent
  • Changes are concentrated and homogeneous (configuration updates)

Poem

🐰 A rabbit hops through config files with glee,
New .saaspages mode sets the build targets free!
From 'open' to 'inner', the build target's flipped,
The SaaS environment is now nicely equipped! ✨

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title 'chore: update build command and environment variable for saas configuration' directly aligns with the main changes in the changeset. The PR modifies the build command in package.json (from 'vite build --mode saas' to 'vite build --mode saaspages') and updates environment variables across multiple .env files (.env.saas and .env.saaspages). The title accurately captures both key aspects of the change and is specific enough to convey the primary purpose.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch zzc/fix-saas-site-build

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.

@zzcr zzcr merged commit 8d64cfc into dev Nov 3, 2025
12 checks passed
@zzcr zzcr deleted the zzc/fix-saas-site-build branch November 3, 2025 12:01
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: 0

🧹 Nitpick comments (2)
examples/sites/env/.env.saas (1)

3-3: Address quote inconsistency and key ordering in environment variables.

The static analysis flagged two issues with this line:

  1. Quote characters: Line 3 quotes the value ('inner'), but line 9 does not quote (/playground.html). Values on lines 2, 4, and 8 also have inconsistent quoting patterns.
  2. Key ordering: VITE_BUILD_TARGET should precede VITE_CONTEXT according to dotenv-linter conventions.

Verify whether the quoting pattern is intentional (e.g., only quoted when containing special characters) or if it should be standardized across the file for consistency.

examples/sites/env/.env.saaspages (1)

2-9: Standardize quoting and key ordering in environment configuration.

Multiple linting warnings indicate inconsistent patterns in this new environment file:

  1. Quote inconsistency: Lines 3, 4, 6, 8 use single quotes around values, but lines 2 and 9 don't. Consider whether quoted values are needed only for values containing special characters or if all should follow the same pattern.
  2. Key ordering: According to dotenv-linter, keys should follow alphabetical or semantic order. Currently, VITE_BUILD_TARGET should precede VITE_CONTEXT, and VITE_APP_MODE should precede VITE_BUILD_TARGET.

While these are unlikely to cause functional issues with Vite, standardizing them will improve maintainability and consistency across your environment files (compare with examples/sites/env/.env.saas).

Consider reordering and standardizing quotes like this:

  # 1、声明一个变量
- VITE_CONTEXT=/tiny-vue-saas-web-doc/
- VITE_BUILD_TARGET='inner'
- VITE_TINY_THEME='saas'
+ VITE_APP_BUILD_BASE_URL=/tiny-vue-saas-web-doc/
+ VITE_APP_MODE=pc
+ VITE_BUILD_TARGET=inner
+ VITE_CONTEXT=/tiny-vue-saas-web-doc/
  # 官网应用类型:pc / mobile / mobile-first
- VITE_APP_MODE='pc'
-
- VITE_APP_BUILD_BASE_URL='/tiny-vue-saas-web-doc/'
+ VITE_PLAYGROUND_URL=/playground.html
+ VITE_TINY_THEME=saas

This aligns key ordering semantically and removes unnecessary quotes to match the pattern in the rest of the file.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4e097d4 and 0cdf423.

📒 Files selected for processing (4)
  • examples/sites/env/.env.saas (1 hunks)
  • examples/sites/env/.env.saaspages (1 hunks)
  • examples/sites/package.json (1 hunks)
  • packages/vue/package.json (1 hunks)
🧰 Additional context used
🪛 dotenv-linter (4.0.0)
examples/sites/env/.env.saas

[warning] 3-3: [QuoteCharacter] The value has quote characters (', ")

(QuoteCharacter)


[warning] 3-3: [UnorderedKey] The VITE_BUILD_TARGET key should go before the VITE_CONTEXT key

(UnorderedKey)

examples/sites/env/.env.saaspages

[warning] 3-3: [QuoteCharacter] The value has quote characters (', ")

(QuoteCharacter)


[warning] 3-3: [UnorderedKey] The VITE_BUILD_TARGET key should go before the VITE_CONTEXT key

(UnorderedKey)


[warning] 4-4: [QuoteCharacter] The value has quote characters (', ")

(QuoteCharacter)


[warning] 6-6: [QuoteCharacter] The value has quote characters (', ")

(QuoteCharacter)


[warning] 6-6: [UnorderedKey] The VITE_APP_MODE key should go before the VITE_BUILD_TARGET key

(UnorderedKey)


[warning] 8-8: [QuoteCharacter] The value has quote characters (', ")

(QuoteCharacter)

🔇 Additional comments (1)
examples/sites/package.json (1)

19-19: Mode update is logically coherent with new configuration.

The build script change from --mode saas to --mode saaspages aligns with the addition of the new .env.saaspages configuration file. The file preservation command is unchanged, which is correct.

Verify that the saaspages Vite mode is properly configured in your Vite configuration file and that the corresponding .env.saaspages environment file is being loaded correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants