-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
feat(storybook): allow to specify angular target project for storybook #4099
Conversation
Nx Cloud ReportCI ran the following commands for commit 28823c6. Click to see the status, the terminal output, and the build insights. Sent with 💌 from NxCloud. |
Sad, why I just add only 1 enviroment variable but it can make the test failing? |
@juristr hello sir, can you help me to verify the new code? storybook 6.1 has been release and it should work with my new code, but I dont understand, why it fail |
Hey thx for the contribution. I'll give it a look next week |
@hiepxanh the problem why the build fails is due to the git commit message check: Can you squash your two commits and use this message:
Thx :) |
@juristr yes sir, I already pushed new commit |
@juristr I already follow the instruction, why it still fail sir? |
@juristr my yarn verified it |
@hiepxanh they aren't failing due to the commit message this time. There was some error in the pipeline, might have been a CircleCI issue. I'll restart them and then we'll see. |
thank you sir |
…rrect angular project target
@hiepxanh looks like something went wrong with your original rebase. Anyway, I fixed it and pushed again to your branch. The PR looks good to me. I'll give it a test run and then merge it. I just want to get the upgrade to Storybook v6.1 in first as well before I merge this one. Thx for your contribution :) |
wow! thank you so much sir, sorry for my clumsy |
@juristr dont you mind if you take a look with my PR? |
I did, but I have to think this through more deeply. Your PR works on apps, however needs some improvements when you run storybook in libs. Right now we're busy on preparing the Nx 11 release. I'll take a closer look immediately after that |
:D resolved conflict |
@hiepxanh I'm looking at your PR right now. The main issue here is that in this way when you generate a storybook config for an Nx library, the according "build" won't be found, thus you get something like
(where I'm wondering whether we should give the possibility to specify a property in the |
thank you, that is a greate idea,I think your solution should be fine 😄 |
@hiepxanh here's the solution I came up with. a) "app" type projects will always get the b) if "lib" type projects are being started with storybook, then the normal storybook app resolution will take place, unless you specify a different app project in the corresponding configuration in the "angular.json" (or workspace.json).
By adding What do you think? Also, if you have a better name in mind than |
Yes, that exactly what I'm thinking of. I belive the
|
Allows to specify the `projectBuildConfig` on the storybook config in the workspace.json
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
feat(storybook): adding enviroment variable which allow storybook get angular project target
Since this PR storybookjs/storybook#12565 already merge, and going to release with storybook 6.1.
As he said: "Basically, we now verify if there is an environment variable called "STORYBOOK_ANGULAR_PROJECT". If so, we use its value as the project name."
This PR going to add an enviroment variable call "STORYBOOK_ANGULAR_PROJECT" and the storybook going to catch that enviroment variable. Then it can recognize the project name correctly.
This PR only to work with the new storybook version, so why we not release the update first, then after they release it. Every body automatic got this feature :D voila
Current Behavior
Using "default" project from
angular.json
to run storybookExpected Behavior
Using project target while using storybook
Related Issue(s)
Fixes #3655 #4305