Skip to content
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

Angular: Support workspace.json in nx workspace #10881

Merged
merged 2 commits into from
May 23, 2020

Conversation

isaacplmann
Copy link
Contributor

Issue:

What I did

Nx is a tool for managing a monorepo that can contain any kind of javascript framework. Nx has its own CLI based on the angular CLI, but we also allow the root angular.json file to be named workspace.json for non-angular devs to be more comfortable. However, the @storybook/angular package will only look for the angular.json file. This PR checks for angular.json and falls back to workspace.json. If neither file is present, the same error appears.

How to test

npx create-nx-workspace storybook-with-workspace-json --preset=empty --cli=nx
cd storybook-with-workspace-json
yarn add @nrwl/angular @nrwl/storybook
npx nx g @nrwl/angular:ng-add
npx nx g @nrwl/angular:lib ui --no-interactive
npx nx g @schematics/angular:component --name=button --project=ui --no-interactive
npx nx g @nrwl/angular:storybook-configuration --name=ui --generateStories --no-interactive
npx nx run ui:storybook

You'll see an error that angular.json was not found. After this PR, the error doesn't show up.

@ZachJW34
Copy link

Thanks @isaacplmann this will be a huge help. Hope this get reviewed soon so I can start playing around with some Angular storybook components!

Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this--looks great to me. Super excited about the NX integration and would love to chat about more ways to make it better!

@shilman shilman added this to the 6.0 milestone May 23, 2020
@shilman shilman changed the title feat: check for workspace.json in nx workspace Angular: Support workspace.json in nx workspace May 23, 2020
@shilman shilman merged commit 18be1a7 into storybookjs:next May 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants