- Notifications
You must be signed in to change notification settings - Fork476
feat: generate start and test npm scripts#387
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
feat: generate start and test npm scripts#387
Uh oh!
There was an error while loading.Please reload this page.
Conversation
c6fd31d
to6ae5c5d
CompareThere 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@szgabsz91
I think you can do simpler than this, by just adding the script directly to thetemplate/base/package.json
forstart
. You can probably do the same fortest
with thetemplate/**/package.json
of each library, and that would avoid adding theaddNpmScript
function.
You can then generate the snapshots locally withpnpm snapshot
and check if the result is OK.
Thanks for the quick review,@cexbrayat, I added a new commit with the modifications, keeping the old commit just for reference. (If the PR gets accepted in the future, a squash might be necessary.) Just some comments:
I don't know if the current solution is OK with you, but if not, I'll try to modify it later as you suggest. |
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.
I think I like this way better 👍
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
7c9431d
to8db43ce
Compare@szgabsz91 Can you rebase the PR on the latest main branch, please? I'll then take a look. |
8db43ce
to0982194
CompareI did the rebase yesterday, if I see it correctly, the branch is up to date with the remote main. I also resolved the conflicts around the nightwatch package.json files. |
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.
LGTM, thanks@szgabsz91
I'll let@sodatea take a look and merge if he feels this is interesting
Thanks! |
0982194
tobf64fed
CompareFYI: I just rebased the branch, now it's up-to-date again. :) |
@@ -3,6 +3,7 @@ | |||
"type": "module", | |||
"scripts": { | |||
"dev": "vite", | |||
"start": "npm run dev", |
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.
Here you may be able to dynamically obtain the corresponding script commands generated by the package manager.
Lines 569 to 576 in9a4dd95
constuserAgent=process.env.npm_config_user_agent??'' | |
constpackageManager=/pnpm/.test(userAgent) | |
?'pnpm' | |
:/yarn/.test(userAgent) | |
?'yarn' | |
:/bun/.test(userAgent) | |
?'bun' | |
:'npm' |
Resolves#303