-
Notifications
You must be signed in to change notification settings - Fork 0
fix: fix normalizeScript #553
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
Conversation
Co-authored-by: WillBooster (Codex CLI) <agent@willbooster.com>
Summary of ChangesHello @exKAZUu, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refactors the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
このプルリクエストは normalizeScript 関数のリファクタリングと修正を行っています。主な変更点は、関数の戻り値をタプルから名前付きプロパティを持つオブジェクトに変更した点です。これにより、printable と runnable のスクリプトが何を指すのかが明確になり、コードの可読性と保守性が向上しています。関連する箇所の修正もすべて行われており、全体として良い改善だと評価します。いくつか、さらなる改善のための提案をコメントしました。
| ): Promise<number> { | ||
| const [printableScript, runnableScript] = normalizeScript(script, project); | ||
| printStart(printableScript, project); | ||
| const normalizedScript = normalizeScript(script, project); |
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.
| return promisePool.runAndWaitForReturnValue(async () => { | ||
| const [printableScript, runnableScript] = normalizeScript(script, project); | ||
| printStart(printableScript, project, 'Start (parallel)', true); | ||
| const normalizedScript = normalizeScript(script, project); |
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.
| // Add cascade option when WB_ENV is defined | ||
| const cascadeOption = project.env.WB_ENV ? ` --cascade-env=${project.env.WB_ENV || 'development'}` : ''; | ||
| return [`${packageManagerWithRun} dotenv${cascadeOption} -- ${printableScript}`, runnableScript]; | ||
| const cascadeOption = project.env.WB_ENV ? ` -c=${project.env.WB_ENV || 'development'}` : ''; |
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.
可読性の観点から、短い形式の -c よりも、意味が明確な --cascade-env を使用することを推奨します。これにより、オプションの目的がコードを読むだけで理解しやすくなります。
| const cascadeOption = project.env.WB_ENV ? ` -c=${project.env.WB_ENV || 'development'}` : ''; | |
| const cascadeOption = project.env.WB_ENV ? ` --cascade-env=${project.env.WB_ENV || 'development'}` : ''; |
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.
Pull request overview
This PR refactors the normalizeScript function to improve code clarity by changing its return type from a tuple [string, string] to a named object { printable: string; runnable: string }. The change makes the purpose of each returned value more explicit and easier to understand. Additionally, the PR attempts to shorten the cascade option flag from --cascade-env= to -c=.
Key changes:
- Refactored
normalizeScriptreturn type from tuple to named object for better code readability - Updated all call sites to use object destructuring instead of array destructuring
- Changed cascade option flag from
--cascade-env=to-c=(potentially incorrect)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Add cascade option when WB_ENV is defined | ||
| const cascadeOption = project.env.WB_ENV ? ` --cascade-env=${project.env.WB_ENV || 'development'}` : ''; | ||
| return [`${packageManagerWithRun} dotenv${cascadeOption} -- ${printableScript}`, runnableScript]; | ||
| const cascadeOption = project.env.WB_ENV ? ` -c=${project.env.WB_ENV || 'development'}` : ''; |
Copilot
AI
Dec 8, 2025
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.
The change from --cascade-env= to -c= appears to be incorrect. The yargsOptionsBuilderForEnv in packages/shared-lib-node/src/env.ts defines the option as cascade-env without any short alias like -c. Using -c= would likely cause the option to not be recognized by the dotenv command.
This should remain as --cascade-env= unless a corresponding alias has been added to the option definition.
| const cascadeOption = project.env.WB_ENV ? ` -c=${project.env.WB_ENV || 'development'}` : ''; | |
| const cascadeOption = project.env.WB_ENV ? ` --cascade-env=${project.env.WB_ENV || 'development'}` : ''; |
Close #
Self Check
All checks have passedon this page.WIP:.yarn test) passed.yarn lint) passed.