First off, this is awesome guys! I know first hand what a challenge Angular can be to build this type of stuff for! I gave it a whirl today and here is my general 'end-user' feedback.
.angular-cli.json that lots of ppl use, it should be picked up here too/stories under /src so TypeScript will pick it up by default in a cli projectA few notes on some of those items:
//cc @igor-dv
//cc @alterx @ralzinov
Lovely feedback @amcdnl!
We do use dynamic components currently so adding the template support shouldn't be very-
difficult. These examples are amazing (the inputs/outputs parsing code will help a lot)!
The angular cli can include global css in the .angular-cli.json that lots of ppl use, it should be picked up here too
I think it's nice !
Now, @storybook/angular does not depend on @angular/cli. I understand that it makes sense for developers not using @angular/cli. However, almost all Angular developers create their project from ng new, so they(including me) want that start-storybook bundles module configured with their .angular-cli.json.
I think storybook should provide a helper function to configure webpack based on .angular-cli.json, something like:
/* .storybook/webpack.config.js */
import { webpackConfigHelperForNgCli } from '@storybook/angular';
module.exports = (env) => {
return webpackConfigHelperForNgCli(); // configures .ts , HTML, and style Rules
};
Hey @amcdnl , I have a couple of questions for you:
/stories folder is already inside the /src. Am I missing something here? 馃 Every example should show importing a NgModule ? For basic components it's possible to not import any modules in Storybook. Just trying to get a more clear idea of the stuff we want to focus on :D
@alterx
I think the /stories folder is already inside the /src. Am I missing something here? 馃
getstorybook generator creates the stories dir under not <project-root>/src but <project-root> . I'll fix it in PR #2672, would you review this?
@alterx -
1) @Quramy explains the issue.
2) I don't think showing just a component without ngModule imports is a good representative of a true setup since almost every demo will need to include a module.
@amcdnl
Progress on these items:
.angular-cli.json that lots of ppl use, it should be picked up here too~ (let's continue this one here https://github.com/storybooks/storybook/issues/2688)/stories under /src so TypeScript will pick it up by default in a cli project~ (#2672, merged)Are we going to do these 2 items? What is the meaning of them?
They are more documentation based items.
@amcdnl , @igor-dv
For item 1 our stories are already written in .ts files.
Is there a reason to write the config in ts? I mean, the .storybook folder is inside the top directory of the project, not inside the src folder and other configurations such as protractor.conf.js and karma.conf.js are written in JS.
For item 2 we should update the examples and I'm thinking we should also remove the FormsModule from the source (the BrowserModule should stay there since we're bootstrapping an Angular app and we need it)
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 60 days. Thanks!
Most helpful comment
I think it's nice !
Now,
@storybook/angulardoes not depend on@angular/cli. I understand that it makes sense for developers not using@angular/cli. However, almost all Angular developers create their project fromng new, so they(including me) want thatstart-storybookbundles module configured with their.angular-cli.json.I think storybook should provide a helper function to configure webpack based on
.angular-cli.json, something like: