-
Notifications
You must be signed in to change notification settings - Fork 162
feat: update npm run dev to accept project name or explicit path #8635
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
ericpgreen2
left a comment
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.
Thanks for the PR!
1. Missing clean-project.cjs script
The package.json references node scripts/clean-project.cjs but this file is not included in the PR. Running npm run clean will fail with a module not found error.
2. Case mismatch for blank project
The script maps blank to lowercase "blank":
blank: path.join(testLocation, "blank"),But the actual directory is capitalized Blank. Running npm run dev -- blank will fail.
3. Consider case-insensitive argument matching
Users might type AdBids or ADBIDS but only adbids works. A simple .toLowerCase() on the input would improve usability.
4. The ESLint ignore pattern is broader than necessary
The pattern scripts/**/*.{js,cjs,mjs} ignores all current and future scripts. Consider ignoring only scripts/dev.cjs specifically, or adding ESLint comments within the file if only certain rules need suppression.
5. Consider using spawn instead of execSync
Using execSync blocks the Node process and doesn't handle signals cleanly. If a user presses Ctrl+C, signal handling may be inconsistent. Using spawn with { stdio: 'inherit' } and forwarding signals would be more robust, though this is a minor concern for a dev script.
Developed in collaboration with Claude Code
|
1. Missing clean-project.cjs script Leftover from a previous approach. Reverted back to the pre-existing 2. Case mismatch for blank project Fixed. 3. Consider case-insensitive argument matching Added. 4. The ESLint ignore pattern is broader than necessary Decided to just remove the ignore pattern and allow type checking of the file. Also updated to module syntax. 5. Consider using spawn instead of execSync Done. |
ericpgreen2
left a comment
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.
👍
This PR alters the
npm run devscript to accept an optional parameter that specifies a particular test project to run:adbids,openrtb,adimpressionsorblank.For example,
npm run dev -- adbidswill start local development using the AdBids project instead of the files indev-projectThe script also accepts explicit paths:
npm run dev -- /path/to/project/folder