Skip to content

Conversation

@chenjiahan
Copy link
Member

Summary

Added validation to ensure environment names are safe for filesystem and property access. Only letters, numbers, _, - and $ are now allowed in environment names. Invalid names trigger a warning.

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings May 28, 2025 08:56
@netlify
Copy link

netlify bot commented May 28, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit 5945a21
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/6836cfa8db182d0008a1ceaa
😎 Deploy Preview https://deploy-preview-5328--rsbuild.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 73 (🔴 down 1 from production)
Accessibility: 97 (no change from production)
Best Practices: 92 (no change from production)
SEO: 100 (no change from production)
PWA: 60 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces environment name validation to ensure that only safe characters (letters, numbers, _, -, and $) are used when naming environments. It also updates related documentation and adjusts output file naming and configuration IDs accordingly.

  • Added documentation in both English and Chinese to describe safe environment naming.
  • Implemented a validation check in the core provider to warn on invalid environment names.
  • Updated output file naming in the inspectConfig module and standardized configuration IDs in rslib.config.ts.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
website/docs/zh/config/environments.mdx Added Chinese documentation on environment naming guidelines.
website/docs/en/config/environments.mdx Added English documentation on environment naming guidelines.
packages/core/src/provider/initConfigs.ts Added a regex check with corresponding warning when an environment name is unsafe.
packages/core/src/inspectConfig.ts Removed sanitization of environment and bundler config names for output files, now using the provided names directly.
packages/core/rslib.config.ts Changed configuration IDs from colon-delimited to underscore-delimited values.
Comments suppressed due to low confidence (1)

packages/core/rslib.config.ts:75

  • The configuration ID was changed from 'esm:index' to 'esm_index'. Please confirm that this change will not inadvertently affect any consumers that may depend on the original ID format.
id: 'esm_index',

@chenjiahan chenjiahan merged commit f80dda1 into main May 28, 2025
12 checks passed
@chenjiahan chenjiahan deleted the environment_name_0528 branch May 28, 2025 09:11
@chenjiahan chenjiahan mentioned this pull request Jun 2, 2025
@chenjiahan chenjiahan mentioned this pull request Jun 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant