Describe the bug
When trying to run Storybook in an Angular library (as part of a larger Angular CLI workspace), Storybook now fails to start due to being unable to find angular.json in the current directory (it's in the workspace root).
To Reproduce
Steps to reproduce the behavior:
TypeError: Cannot read property 'defaultProject' of nullExpected behavior
In v5.25.0, there is no error and Storybook runs from the custom config set in ./.storybook when unable to find an angular.json file.
Code snippets
https://github.com/storybookjs/storybook/commit/1fa78aa5736be43a2f86138bc2374d58ad2c9edb#diff-85c97608923e0cbbc684961efd172cac
This is the commit which broke the functionality. L52 in that file (app/angular/src/server/angular-cli_config.ts) used to exit the entire function of getting the Angular CLI config. Since the functions have been split up, this is no longer the case and the second function (getLeadingAngularCliProject) receives the null value.
System:
Environment Info:
System:
OS: Linux 5.3 Arch Linux undefined
CPU: (4) x64 Intel(R) Core(TM) i5-2500K CPU @ 3.30GHz
Binaries:
Node: 10.16.3 - ~/.nvm/versions/node/v10.16.3/bin/node
Yarn: 1.19.1 - /usr/bin/yarn
npm: 6.9.0 - ~/.nvm/versions/node/v10.16.3/bin/npm
Browsers:
Firefox: 69.0.2
npmPackages:
@storybook/addon-a11y: ^5.3.0-alpha.38 => 5.3.0-alpha.38
@storybook/addon-actions: ^5.3.0-alpha.38 => 5.3.0-alpha.38
@storybook/addon-knobs: ^5.3.0-alpha.38 => 5.3.0-alpha.38
@storybook/addon-storysource: ^5.3.0-alpha.38 => 5.3.0-alpha.38
@storybook/angular: ^5.3.0-alpha.38 => 5.3.0-alpha.38
cc @kroeder
Thanks for catching that! My commit message contained "improve testability" and yet I haven't tested what I have changed 馃槵 Will fix it asap
No problem. Thanks for your work on this :)
Hurrah!! I just released https://github.com/storybookjs/storybook/releases/tag/v5.3.0-alpha.41 containing PR #8727 that references this issue. Upgrade today to try it out!
You can find this prerelease on the @next NPM tag.
Closing this issue. Please re-open if you think there's still more to do.
Most helpful comment
Thanks for catching that! My commit message contained "improve testability" and yet I haven't tested what I have changed 馃槵 Will fix it asap