-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Fixes to build scripts for Windows. #2051
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2051 +/- ##
=======================================
Coverage 21.34% 21.34%
=======================================
Files 262 262
Lines 5767 5767
Branches 692 703 +11
=======================================
Hits 1231 1231
- Misses 4003 4008 +5
+ Partials 533 528 -5
Continue to review full report at Codecov.
|
Would you care to review this @usulpro ? |
app/react/package.json
Outdated
@@ -18,7 +18,8 @@ | |||
"url": "https://github.com/storybooks/storybook.git" | |||
}, | |||
"scripts": { | |||
"dev": "DEV_BUILD=1 nodemon --watch ./src --exec 'yarn prepare'", | |||
"prepare-root": "cd ../../ && yarn && cd ./app/react", |
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.
We use yarn workspaces, so you can run yarn install
in any package directory, and it will bootstrap everything. The cd
part is therefore redundant
I also wonder why this script is needed at all. You shouldn't be able to run package scripts before installing everything anyway
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.
Oh that's curious. It looks like Yarn just released 1.2.1, perhaps this was a bug fixed with workspaces.
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.
Would you like me to remove the prepare-root
script from this and retry from a clean git pull?
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.
Yes please, but you can actually do yarn bootstrap --reset
instead of clean pull
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.
Hey, I commented further below, could you check in on this?
@AaronFriel Anything we need to do on our side to get this merged? Who in the @storybooks/team works with windows and can do a review on this? |
Hi, I think I understand what you meant now by the bootstrap script, which I had not run before attempting to work with a branch of the project. I just added a commit that makes "yarn bootstrap" run on Windows. That said, I am a bit confused about the prepare-root part. If I just want to work on say, the
|
There’re no such thing as “just work on @storybook/react package”. Even if it’s the only package where you make changes, you still need to run example app (located in |
Oh, I actually had significant success using the tool |
If it's a blocking issue for merging this, I can remove the |
My point was that as though you CAN work with only one package being set up, you SHOULDN'T do that, because you have to test how this interacts with current state of other packages anyway. So yes, please remove the |
By the way, maybe there's a sense in using If you feel like that, you could add |
Codecov Report
@@ Coverage Diff @@
## master #2051 +/- ##
======================================
Coverage 22.2% 22.2%
======================================
Files 268 268
Lines 5872 5872
Branches 717 708 -9
======================================
Hits 1304 1304
- Misses 4025 4035 +10
+ Partials 543 533 -10
Continue to review full report at Codecov.
|
I changed other uses of the pattern I added cross-env to the root project, and removed prepare-root scripts. I also made sure that the |
@@ -14,7 +14,7 @@ | |||
"babel-loader": "^7.1.2", | |||
"babel-preset-env": "^1.6.0", | |||
"babel-preset-vue": "^1.2.1", | |||
"cross-env": "^3.0.0", | |||
"cross-env": "^5.1.1", |
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.
Is it still needed here, given that we have it in root now?
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 wasn't sure. The kitchen sink is something people should be able to play with in isolation, right?
I assumed that because babel-core
and babel-preset-env
were also duplicated, that the package vue-kitchen-sink
should be self-contained.
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 kitchen sink is something people should be able to play with in isolation, right?
Not really. In our case, it‘s mainly used to test the changes made to other packages
Please resolve conflict in |
I rebased on master. Edit: And I got confused by GitHub's UI. |
Gosh that was fun. I think with that last commit all of the CI checks will be happy. |
Great, thanks @AaronFriel ! |
Thank you @AaronFriel ! |
Issue: On Windows platforms, the
dev
scripts in.\app\react
andvue
relied on three things that didn't work:They assumed the parent project's dependencies were installed in the
prepare
script. This is fixed by addingprepare-root
.The environment variable
DEV_BUILD
is set in a *nix-ish way, which doesn't work in PowerShell.The
--exec
parameter ofnodemon
used single quotes instead of double quotes.What I did
I added a
prepare-root
script which builds the parent package, added that as an initial command to thedev
script.I added the
cross-env
dependency and used that to set theDEV_BUILD
parameter.I double quoted and escaped the
--exec
parameter.I then tested these changes on a Linux environment. I used *nix style path separators in the
prepare-root
script.