Angular: Add angular builder to start + build storybook#15061
Merged
Conversation
Nx Cloud ReportCI ran the following commands for commit ccc4ef1. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this branch
Sent with 💌 from NxCloud. |
kroeder
reviewed
May 28, 2021
|
|
||
| beforeEach(async () => { | ||
| const registry = new schema.CoreSchemaRegistry(); | ||
| registry.addPostTransform(schema.transforms.addUndefinedDefaults); |
Member
There was a problem hiding this comment.
What is this for? (15 and 16) I do lots of stuff with schematics but never have I seen this in tests, I'm curious 🙂
Contributor
Author
There was a problem hiding this comment.
this add all default props set in schema.json to test it
I was inspired by https://angular.io/guide/cli-builder#testing-a-builder ^^
7a79f38 to
3070788
Compare
The builder allows to add a "architect" in angular.json to start storybook
config ex :
```
"storybook": {
"builder": "@storybook/angular:start-storybook",
"options": {
"browserTarget": "angular-cli:build",
"port": 4400
}
```
cmd : `ng run angular-cli:storybook`
With this solution it is possible to have several angular projects using different assets and style
The builder allows to add a "architect" in angular.json to build storybook
config ex :
```
"build-storybook": {
"builder": "@storybook/angular:build-storybook",
"options": {
"browserTarget": "angular-cli:build"
}
}
```
cmd : `ng run angular-cli:build-storybook`
With this solution it is possible to have several angular projects using different assets and style
3070788 to
d14690c
Compare
This was referenced Jun 1, 2021
|
Great PR - Should be incorporated into nx.dev workflow asap |
Contributor
Author
|
If I have the time I'll go tease them with a PR 😁 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue: #3995
Other :
#12058
#12232
To bring Storybook closer to angular, add 2 builders, one to start the application and one for the build
Both builders have a required option
browserTargetwhich allows storybook to use the configs usually defined for the browser builder (@angular-devkit/build-angular:browser) of Angular. This way "reflects" the one already used byangular-clifor the builderserve,extract-i18n.What I did
The builder allows to add a "architect" in angular.json to start or build storybook
config ex :
cmd :
ng run angular-cli:storybookorng run angular-cli:build-storybookWith this solution it is possible to have several angular projects using different assets and style
How to test
Yes
na
maybe