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 storybook configuration for projects with only angular Library #15744

Merged
merged 4 commits into from
Sep 7, 2021

Conversation

ThibaudAV
Copy link
Contributor

@ThibaudAV ThibaudAV commented Aug 3, 2021

Issue: 🤷‍♂️

If the use of the native ng builder for sb is well adopted. It solves several issues.
I think, it should be released officially in storybook 7. because it is a major change 🤔

if you're reading this and you're interested, I'd love some feedback on this :)

What I did

Previous PR : #15061

Allows to use sotrybook without relying on an existing configuration (angular.json artifact).
Can be used for projects with only ng library

Only tsConfig is required
ex :

    "without-browser-target": {
      "root": "",
      "projectType": "library",
      "architect": {
        "storybook": {
          "builder": "@storybook/angular:start-storybook",
          "options": {
            "tsConfig": "src/tsconfig.app.json"
          }
        },
        "build-storybook": {
          "builder": "@storybook/angular:build-storybook",
          "options": {
            "tsConfig": "src/tsconfig.app.json"
          }
        }
      }

How to test

  • Is this testable with Jest or Chromatic screenshots? Yes
  • Does this need a new example in the kitchen sink apps? Yes
  • Does this need an update to the documentation? Not Yet, for storybook 7.0 🤞

If your answer is yes to any of these, please make sure to include it in your PR.

@ThibaudAV ThibaudAV changed the title Angular: Improves storybook configuration for projects with only angular Library Angular: Improve storybook configuration for projects with only angular Library Aug 3, 2021
@nx-cloud
Copy link

nx-cloud bot commented Aug 3, 2021

Nx Cloud Report

CI ran the following commands for commit 1604b61. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch

Status Command
#000000 nx run-many --target=prepare --all --parallel --max-parallel=15

Sent with 💌 from NxCloud.

@ThibaudAV ThibaudAV marked this pull request as ready for review August 6, 2021 13:31
@ThibaudAV ThibaudAV changed the title Angular: Improve storybook configuration for projects with only angular Library Angular: Support storybook configuration for projects with only angular Library Aug 6, 2021
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.

Looking good @ThibaudAV ! Are there any documentation updates needed here?

@ThibaudAV
Copy link
Contributor Author

Looking good @ThibaudAV ! Are there any documentation updates needed here?

@shilman I think we need to add some documentation on this. But I think I'll do it in another PR when the feature is more complete.
And for sb v 7 🤷‍♂️

Note: thow error if project (lib or not) does not have tsConfig options
should allow project with only lib, without `@angular-devkit/build-angular:browser` to complete the configuration, to work more simply
should allow project with only lib, without `@angular-devkit/build-angular:browser` to complete the configuration, to work more simply
only tsConfig is required and can be directly given to storybook using new Angular builder for SB

should allow project with only lib, without `@angular-devkit/build-angular:browser` to complete the configuration, to work more simply
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 @ThibaudAV !! Looking great 😍

@shilman shilman merged commit 5d8a1e2 into next Sep 7, 2021
@shilman shilman deleted the angular/lib-only branch September 7, 2021 01:28
@shilman
Copy link
Member

shilman commented Sep 7, 2021

@ThibaudAV OOPS I missed the comment about being a major change ... Should I revert it in 6.4? Or can we figure out how to make it a non-breaking change? For example, put it behind a feature flag?

@shilman shilman added this to the 6.4 PRs milestone Sep 15, 2021
@maxisam
Copy link

maxisam commented Sep 29, 2021

Can't wait to see this release officially! I hope we can use it in 6.4!

@shilman
Copy link
Member

shilman commented Sep 29, 2021

@maxisam you can try it out today using:

npx sb@next upgrade --prerelease

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