-
Notifications
You must be signed in to change notification settings - Fork 7.2k
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
docs: 对scripts中的包添加使用文档 #5330
base: main
Are you sure you want to change the base?
docs: 对scripts中的包添加使用文档 #5330
Conversation
|
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 eslint
packages/effects/plugins/src/echarts/use-echarts.tsOops! Something went wrong! :( ESLint: 9.17.0 Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/node_modules/@vben/eslint-config/dist/index.mjs' imported from /eslint.config.mjs WalkthroughThe pull request introduces documentation updates for two different script tools: Changes
Poem
Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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 (6)
scripts/turbo-run/src/run.ts (1)
Line range hint
20-22
: Consider adding type safety for package.json access.The current code uses type assertions with
Record<string, any>
which reduces type safety. Consider creating an interface for the package.json structure.+interface PackageJson { + name: string; + scripts?: Record<string, string>; +} const selectPkgs = packages.filter((pkg) => { - return (pkg?.packageJson as Record<string, any>)?.scripts?.[command]; + return (pkg?.packageJson as PackageJson)?.scripts?.[command]; });scripts/vsh/README.md (5)
1-6
: Consider enhancing the introduction section.The introduction could be more helpful by including:
- Installation instructions
- Basic usage examples
- Prerequisites or dependencies
7-12
: Add reference link for publint and example usage for lint.Consider the following improvements:
- Add a link to the publint documentation for better context
- Include example usage of the lint command with and without the
--format
parameter- Clarify what "不退出程序" (not exiting the program) means in the context of the
--check
parameter
13-16
: Maintain consistent formatting for default values.The default value notation
默认: 2
should follow a consistent format across all parameter descriptions. Consider using a standardized format like:(default: 2)
or[默认值: 2]
.
20-21
: Enhance the check-dep command documentation.The documentation for
check-dep
is minimal compared to other commands. Consider:
- Adding any available parameters
- Including example output
- Explaining what constitutes an "unused" or "undeclared" dependency
4-21
: Consider standardizing the documentation structure.To improve consistency and usability, consider adopting a standard format for each command:
## Command Name Description of what the command does ### Parameters - `--param-name`: Description (default: value) ### Examples ```shell # Example usage vsh command --param valueOutput
Example output or expected behavior
</blockquote></details> </blockquote></details> <details> <summary>📜 Review details</summary> **Configuration used: CodeRabbit UI** **Review profile: CHILL** **Plan: Pro** <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 16162c01eddcb812b7a2e130a8465e8eb6fdcbc2 and 69143ab34f8bb25f504cfa1c914c714dafc89aa4. </details> <details> <summary>📒 Files selected for processing (3)</summary> * `scripts/turbo-run/README.md` (1 hunks) * `scripts/turbo-run/src/run.ts` (1 hunks) * `scripts/vsh/README.md` (1 hunks) </details> <details> <summary>✅ Files skipped from review due to trivial changes (1)</summary> * scripts/turbo-run/README.md </details> <details> <summary>⏰ Context from checks skipped due to timeout of 90000ms (8)</summary> * GitHub Check: Test (windows-latest) * GitHub Check: Lint (windows-latest) * GitHub Check: Test (ubuntu-latest) * GitHub Check: Lint (ubuntu-latest) * GitHub Check: Check (windows-latest) * GitHub Check: post-update (windows-latest) * GitHub Check: Check (ubuntu-latest) * GitHub Check: post-update (ubuntu-latest) </details> <details> <summary>🔇 Additional comments (1)</summary><blockquote> <details> <summary>scripts/turbo-run/src/run.ts (1)</summary> `28-28`: **LGTM! Type parameter simplification looks good.** The removal of the unnecessary `any` type parameter improves type safety while maintaining the correct typing for the select function's return value. </details> </blockquote></details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
There was a problem hiding this 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)
packages/effects/plugins/src/echarts/use-echarts.ts (2)
112-112
: LGTM! Consider adding documentation for the exposed instance.The addition of
chartInstance
to the return object is valid, but it would benefit from documentation explaining its purpose and usage guidelines.Consider adding JSDoc comments above the
useEcharts
function to document:
- The purpose of exposing
chartInstance
- Common use cases and examples
- Warnings about direct manipulation
- Type information for the return object
Example:
/** * Vue composable for ECharts integration * @returns {Object} The chart control object * @property {Function} renderEcharts - Renders the chart with given options * @property {Function} resize - Resizes the chart instance * @property {echarts.ECharts | null} chartInstance - Direct access to ECharts instance. * Use with caution as direct manipulation may bypass the composable's lifecycle management. */
112-112
: Consider adding safeguards for the exposed instance.Since
chartInstance
is now exposed, it's important to protect against potential misuse.Consider these architectural improvements:
- Return a readonly version of the instance to prevent direct mutations:
return { renderEcharts, resize, chartInstance: readonly(chartInstance), };
- Or return only specific methods needed from the instance:
return { renderEcharts, resize, // Example of exposing specific methods safely getWidth: () => chartInstance?.getWidth(), getHeight: () => chartInstance?.getHeight(), };
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/effects/plugins/src/echarts/use-echarts.ts
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (9)
- GitHub Check: Check (windows-latest)
- GitHub Check: Test (windows-latest)
- GitHub Check: Check (ubuntu-latest)
- GitHub Check: Lint (windows-latest)
- GitHub Check: Test (ubuntu-latest)
- GitHub Check: Lint (ubuntu-latest)
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: post-update (windows-latest)
- GitHub Check: post-update (ubuntu-latest)
Description
包含两个commit,
await select<any, string>
此处<any, string>
在编辑器中报错,于是删除了any
对scripts中的包添加使用文档
Type of change
Please delete options that are not relevant.
Summary by CodeRabbit
Release Notes
Documentation
turbo-run
README with detailed command usage and functionality description.vsh
README with new command documentation:lint
command for code formatting.publint
for package rule compliance.code-workspace
for VS Code workspace generation.check-circular
for dependency cycle detection.check-dep
for dependency analysis.Code Improvements
turbo-run
selection function.useEcharts
function to exposechartInstance
for external access.