Skip to content

chore: update dependencies and documentation, optimize build toolchain #6060

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 28, 2025

Conversation

anncwb
Copy link
Collaborator

@anncwb anncwb commented Apr 27, 2025

Description

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Please, don't make changes to pnpm-lock.yaml unless you introduce a new test example.

Checklist

ℹ️ Check all checkboxes - this will indicate that you have done everything in accordance with the rules in CONTRIBUTING.

  • If you introduce new functionality, document it. You can run documentation with pnpm run docs:dev command.
  • Run the tests with pnpm test.
  • Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with feat:, fix:, perf:, docs:, or chore:.
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Summary by CodeRabbit

  • Chores
    • Updated the package manager version to improve compatibility and performance.
    • Upgraded Node.js version specification and base Docker image for updated environment support.
    • Enhanced editor settings for better performance and file management.
    • Refined documentation formatting and structure across multiple languages for improved readability.
    • Improved CLI tools with expanded documentation, enhanced error handling, and new configuration options.
    • Updated package versions in workspace for dependency maintenance.
    • Improved cleanup script with better logging and error handling.
    • Reorganized route update logic to ensure accurate route data during user switches.
  • New Features
    • Added detailed plugin configuration options and type definitions for enhanced build system customization.

Copy link

changeset-bot bot commented Apr 27, 2025

⚠️ No Changeset found

Latest commit: c2bc4b4

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

Copy link
Contributor

coderabbitai bot commented Apr 27, 2025

Walkthrough

The changes include updating the packageManager field in package.json from "[email protected]" to "[email protected]". The Node.js version in .node-version was updated from 20.14.0 to 22.1.0. The lint-staged configuration was fixed by adding a missing space in the prettier command. VSCode settings were modified to enable large file optimizations, exclude .vitepress from file explorer, and exclude certain folders from TypeScript server processing. Multiple README files (README.md, README.ja-JP.md, README.zh-CN.md) were reformatted for improved readability and consistency without content changes. TypeScript interfaces and types for Vite plugin options were added in internal/vite-config/src/typing.ts. Package versions were bumped in pnpm-workspace.yaml. Various scripts were improved including cleaning logic, Dockerfile base image update, and expanded documentation for CLI tools. Several scripts under scripts/vsh/src were refactored to add configuration options, improve error handling, and enhance CLI command registration and feedback. Additionally, a bug fix was applied to route updating logic in packages/effects/access/src/accessible.ts to update existing routes before adding new ones, preventing stale route issues.

Changes

File(s) Change Summary
package.json Updated packageManager version from [email protected] to [email protected].
.node-version Updated Node.js version from 20.14.0 to 22.1.0.
.lintstagedrc.mjs Fixed missing space in prettier command between --write and --parser.
.vscode/settings.json Enabled large file optimizations, excluded .vitepress folder from explorer, and added TypeScript exclusions.
README.md, README.ja-JP.md, README.zh-CN.md Reformatted for readability and consistency; adjusted HTML structure, punctuation, and tables without content changes.
internal/vite-config/src/typing.ts Added detailed TypeScript interfaces and types for Vite plugin options and configuration.
pnpm-workspace.yaml Bumped versions of multiple packages in the catalog section.
scripts/clean.mjs Refactored recursive cleaning logic with normalized paths, improved error handling, and enhanced logging.
scripts/deploy/Dockerfile Updated builder base image to node:22-slim; improved Nginx config steps and added clarifying comments.
scripts/turbo-run/README.md Expanded README with detailed Chinese documentation including features, installation, usage, and examples.
scripts/turbo-run/src/run.ts Narrowed generic type parameter for select function call from any, string to string.
scripts/vsh/README.md Expanded README with detailed project overview, features, installation, usage, and command list.
scripts/vsh/src/check-circular/index.ts Added configurable options, caching, improved formatting and error handling for circular dependency checking.
scripts/vsh/src/check-dep/index.ts Modularized configuration, improved result processing, added error handling, and enhanced CLI options for dependency checking.
scripts/vsh/src/index.ts Refactored CLI initialization into async main function with enhanced error handling and invalid command feedback.
packages/effects/access/src/accessible.ts Reversed conditional logic to update existing routes before adding new ones, fixing stale route issues.

Possibly related PRs

Suggested reviewers

  • jinmao88
  • vince292007

Poem

🐰 A hop, a skip, a version jump,
Our package manager got a bump!
Node and scripts all fresh and bright,
Docs polished clean, configs just right.
Plugins typed with care and grace,
Our code keeps hopping, setting pace! 🌿✨

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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
Contributor

@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 (1)
package.json (1)

102-102: Ensure engine requirement aligns with updated packageManager.

The packageManager field was bumped to [email protected], but the engines.pnpm setting still allows >=9.12.0. This may permit older pnpm versions that lack compatibility guarantees with v10 features. For consistency and to avoid unforeseen issues, consider updating the engines.pnpm constraint to >=10.9.0.

 "engines": {
   "node": ">=20.10.0",
-  "pnpm": ">=9.12.0"
+  "pnpm": ">=10.9.0"
 }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 76de450 and 1c2d714.

📒 Files selected for processing (1)
  • package.json (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: Check (ubuntu-latest)
  • GitHub Check: Check (windows-latest)
  • GitHub Check: Test (windows-latest)
  • GitHub Check: Lint (windows-latest)
  • GitHub Check: Lint (ubuntu-latest)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: post-update (ubuntu-latest)
  • GitHub Check: post-update (windows-latest)
🔇 Additional comments (1)
package.json (1)

102-102: Verify lockfile compatibility with [email protected].

Changing the packageManager may require regenerating pnpm-lock.yaml to ensure the lockfile schema and dependency resolutions align with pnpm v10.9.0. Please confirm that no lockfile issues arise on CI and consider running a clean install:

pnpm install --force

…ibility and stability

- Update Node version to 22.1.0
- Updated pnpm version to 10.10.0
- Fixed syntax error in prettier command in lintstagedrc
- Update dependent versions in pnpm-lock.yaml to ensure consistency
- Update format and content in README documents to improve readability
@anncwb anncwb changed the title chore: update packageManager version to [email protected] for compatibility improvements chore: update dependencies and documentation, optimize build toolchain Apr 28, 2025
Copy link
Contributor

@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 (1)
scripts/clean.mjs (1)

35-56: Consider adding a deletion summary

While the current logging improvements are good, consider adding a summary at the end that counts how many items were deleted. This would provide users with a quick overview of the cleanup operation.

try {
  await cleanTargetsRecursively(rootDir, cleanupTargets);
+ console.log('Cleanup process completed successfully.');
- console.log('Cleanup process completed successfully.');
+ console.log(`Cleanup process completed successfully. Run with --verbose for details.`);
} catch (error) {
  console.error(`Unexpected error during cleanup: ${error.message}`);
  process.exit(1);
}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1c2d714 and 9b2ca7b.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (17)
  • .lintstagedrc.mjs (1 hunks)
  • .node-version (1 hunks)
  • .vscode/settings.json (3 hunks)
  • README.ja-JP.md (5 hunks)
  • README.md (6 hunks)
  • README.zh-CN.md (4 hunks)
  • internal/vite-config/src/typing.ts (1 hunks)
  • package.json (1 hunks)
  • pnpm-workspace.yaml (5 hunks)
  • scripts/clean.mjs (2 hunks)
  • scripts/deploy/Dockerfile (2 hunks)
  • scripts/turbo-run/README.md (1 hunks)
  • scripts/turbo-run/src/run.ts (1 hunks)
  • scripts/vsh/README.md (1 hunks)
  • scripts/vsh/src/check-circular/index.ts (1 hunks)
  • scripts/vsh/src/check-dep/index.ts (1 hunks)
  • scripts/vsh/src/index.ts (1 hunks)
✅ Files skipped from review due to trivial changes (11)
  • package.json
  • .node-version
  • .lintstagedrc.mjs
  • scripts/deploy/Dockerfile
  • .vscode/settings.json
  • scripts/vsh/README.md
  • pnpm-workspace.yaml
  • scripts/turbo-run/README.md
  • README.zh-CN.md
  • README.md
  • README.ja-JP.md
🧰 Additional context used
🧬 Code Graph Analysis (2)
scripts/vsh/src/check-dep/index.ts (1)
internal/node-utils/src/monorepo.ts (1)
  • getPackages (46-46)
internal/vite-config/src/typing.ts (1)
internal/vite-config/src/plugins/inject-metadata.ts (1)
  • config (79-105)
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Test (windows-latest)
  • GitHub Check: Check (windows-latest)
  • GitHub Check: post-update (ubuntu-latest)
  • GitHub Check: post-update (windows-latest)
🔇 Additional comments (35)
scripts/turbo-run/src/run.ts (1)

28-28: Type parameter refinement looks good.

The change from select<any, string> to select<string> appropriately narrows the type parameter to just string, which matches the expected return type. This change improves type safety without altering the function's behavior and aligns with modern TypeScript best practices.

scripts/clean.mjs (8)

2-2: Good addition of path normalization

Using normalize from node:path is a great improvement as it ensures path consistency across different operating systems, enhancing the script's reliability.


9-9: Documentation properly updated

The JSDoc comment has been correctly updated to reflect that targets is now an array of strings, which aligns with how the function is actually used.


16-18: Improved path handling and code organization

Moving the lstat call earlier and applying path normalization are excellent improvements. This reorganization allows for better control flow and ensures consistent path handling across different platforms.


23-24: Clearer conditional logic

The refactored conditional structure makes the code more readable by explicitly checking if the item is a directory before recursion. The added comment also improves code clarity.


27-31: Enhanced error handling

The improved error message now provides contextual information about where the error occurred, making debugging much easier. This is a significant improvement in error reporting.


40-40: Good use of array spread for immutability

Using the spread operator to create a copy of the targets array before potentially modifying it is a good practice that maintains immutability of the original array.


51-51: Improved user feedback

Adding a success message upon completion provides better feedback to users, making the script more user-friendly.


54-54: Proper error handling with process exit

Adding process.exit(1) ensures that the script correctly signals failure to any calling processes, which is essential for proper error handling in automated workflows.

internal/vite-config/src/typing.ts (8)

6-22: Well-structured JSDoc documentation with effective examples

The JSDoc comments for the IImportMap interface provide clear explanations and include practical examples that demonstrate the implementation. This documentation style effectively communicates the purpose and usage of the interface.

Note that the JSDoc comments are in Chinese while the property comments are in English. Consider maintaining a consistent language throughout all documentation for better maintainability.


32-49: Documentation includes clear examples for PrintPluginOptions

The JSDoc documentation for PrintPluginOptions is well-structured with good examples showing the expected format for the infoMap property. This documentation style helps developers understand how to use this configuration option.


51-73: Default values clearly documented in JSDoc

The JSDoc comments for NitroMockPluginOptions, ArchiverPluginOptions, and ImportmapPluginOptions include default values, which is excellent practice. This helps developers understand what values will be used if they don't explicitly set these options.

Also applies to: 75-90, 92-120


139-175: CommonPluginOptions provides a well-structured base interface

The CommonPluginOptions interface serves as a solid foundation for other plugin configurations. The properties are well-documented with clear descriptions and default values. This approach promotes consistency across different plugin configurations.


177-277: Comprehensive ApplicationPluginOptions with detailed property documentation

The ApplicationPluginOptions interface extends CommonPluginOptions and provides a comprehensive set of application-specific configuration options. Each property has detailed documentation explaining its purpose, default value, and in some cases, additional description of functionality. This level of detail is excellent for developer experience.


279-290: LibraryPluginOptions remains focused on library-specific needs

The LibraryPluginOptions interface is appropriately focused on library-specific configuration needs, currently only adding the dts option for TypeScript declaration file generation. This maintains a clean separation between application and library configurations.


302-328: Well-defined asynchronous configuration functions

The type definitions for DefineApplicationOptions, DefineLibraryOptions, and DefineConfig effectively establish a structured pattern for asynchronous configuration functions. This approach allows for dynamic configuration generation based on the build environment.


1-343: Comprehensive type system for Vite plugin configuration

This file adds a well-structured, comprehensive type system for Vite plugin configurations. The interfaces are logically organized with a common base interface and specialized extensions for different use cases. The detailed JSDoc comments make the code self-documenting.

While this file seems to be a substantial addition of new type definitions rather than a direct change related to the package manager update mentioned in the PR description, it significantly improves type safety and developer experience for working with Vite plugins in the project.

scripts/vsh/src/index.ts (4)

5-5: Good practice: Properly sourcing version from package.json

This change ensures the CLI version is consistently sourced from package.json rather than being hardcoded.


12-19: Well-structured command descriptions

Centralizing command descriptions in a constant makes them easier to maintain and ensures consistency across the CLI. The use of as const provides proper type safety.


21-64: Good refactoring: Improved CLI initialization with error handling

Refactoring the CLI initialization into an async main function with proper error handling significantly improves code quality. The structure is clean with:

  • Try-catch blocks for granular error handling
  • Centralized command registration
  • Clear command feedback for invalid inputs
  • Well-organized CLI setup with usage and version information

66-74: Proper async error handling

The top-level invocation with promise error handling ensures all unhandled promise rejections are properly caught and reported, which is an important improvement for CLI reliability.

scripts/vsh/src/check-circular/index.ts (7)

9-24: Good refactoring: Centralized configuration

Moving configuration options to a DEFAULT_CONFIG constant improves maintainability by centralizing all default settings in one place. The use of as const ensures type safety for the configuration object.


29-33: Well-designed configuration interface

The CheckCircularConfig interface properly documents the expected structure with optional properties, making the configuration options clear to users.


41-42: Performance improvement with caching

Adding a caching mechanism is a good optimization that helps avoid redundant circular dependency checks, especially when running multiple commands in sequence.


48-59: Improved output formatting

The formatCircles function provides clear, structured output that makes circular dependencies easier to understand and debug.


69-140: Enhanced circular dependency checking with configuration options

The refactored checkCircular function is well-structured with:

  • Configuration merging with defaults
  • Dynamic ignore pattern generation
  • Efficient caching mechanism
  • Proper filtering of files based on extensions
  • Improved result formatting and handling

146-167: Extended CLI options for better user control

The command definition now includes additional options for fine-tuning circular dependency checks, providing better flexibility for users while maintaining reasonable defaults.


170-170: Appropriate type exports

Exporting the CheckCircularConfig type allows consumers of this module to access the type definitions, which is good practice for TypeScript modules.

scripts/vsh/src/check-dep/index.ts (7)

7-36: Good refactoring: Comprehensive default configuration

The DEFAULT_CONFIG object centralizes all configuration settings with clear categorization:

  • Dependencies to ignore by pattern
  • Packages to completely skip
  • File patterns to ignore

This approach improves maintainability and makes the configuration more self-documenting.


38-55: Well-designed type definitions

The interfaces clearly define the structure of dependency check results, configuration options, and package information, providing good type safety and documentation.


61-74: Improved result cleaning with clear logic

The cleanDepcheckResult function properly handles special cases:

  • Removing local file-prefixed dependencies
  • Filtering out path-based missing dependencies
  • Cleaning up empty result entries

This results in more accurate and relevant dependency check reports.


81-110: Enhanced result formatting for better readability

The formatDepcheckResult function provides clear, structured output that categorizes issues into:

  • Missing dependencies with their file references
  • Unused regular dependencies
  • Unused dev dependencies

The added emojis and indentation improve readability.


116-162: Robust dependency checking with error handling

The refactored runDepcheck function includes several improvements:

  • Configuration merging with defaults
  • Proper tracking of issues across packages
  • Clear success messaging when no issues are found
  • Comprehensive error handling

168-193: Extended CLI options for better user control

The command definition now includes additional options for customizing dependency checks:

  • Specifying packages to ignore
  • Defining dependency patterns to ignore
  • Setting file patterns to exclude

This provides better flexibility while maintaining sensible defaults.


195-195: Appropriate type exports

Exporting the DepcheckConfig type alongside the command definition function allows consumers to access the type definitions, following good TypeScript practices.

Copy link
Contributor

@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

🧹 Nitpick comments (1)
packages/effects/access/src/accessible.ts (1)

42-43: Consider an alternative to the delete operator

The static analysis tool flagged the use of the delete operator which can impact performance. While this isn't part of your current changes, consider refactoring in a future update.

- delete route.component;
+ route.component = undefined;
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9b2ca7b and c2bc4b4.

📒 Files selected for processing (1)
  • packages/effects/access/src/accessible.ts (1 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
packages/effects/access/src/accessible.ts

[error] 47-47: Avoid the delete operator which can impact performance.

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: post-update (windows-latest)
  • GitHub Check: post-update (ubuntu-latest)
  • GitHub Check: Test (windows-latest)
  • GitHub Check: Check (windows-latest)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Check (ubuntu-latest)
  • GitHub Check: Lint (windows-latest)
  • GitHub Check: Lint (ubuntu-latest)
🔇 Additional comments (1)
packages/effects/access/src/accessible.ts (1)

45-55: Logical improvement to prevent stale route data - LGTM!

This change appropriately reverses the logic to update existing routes before adding new ones, which prevents stale route data during user switches. Without this fix, switching users could lead to outdated routes persisting in the navigation, potentially causing 404 errors (as mentioned in the comment on line 47 about homePath).

🧰 Tools
🪛 Biome (1.9.4)

[error] 47-47: Avoid the delete operator which can impact performance.

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

@anncwb anncwb merged commit dd833ca into main Apr 28, 2025
14 checks passed
@anncwb anncwb deleted the feature/pnpm branch April 28, 2025 15:08
mynetfan pushed a commit that referenced this pull request May 19, 2025
#6060)

* chore: update packageManager version to [email protected] for compatibility improvements

* chore: Update dependent versions and configurations to improve compatibility and stability

- Update Node version to 22.1.0
- Updated pnpm version to 10.10.0
- Fixed syntax error in prettier command in lintstagedrc
- Update dependent versions in pnpm-lock.yaml to ensure consistency
- Update format and content in README documents to improve readability

* fix: lint error
@github-actions github-actions bot locked and limited conversation to collaborators May 29, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant