-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Add angular support: Storybook for Angular #1474
Conversation
Codecov Report
@@ Coverage Diff @@
## release/3.3 #1474 +/- ##
===============================================
- Coverage 22.3% 21.53% -0.77%
===============================================
Files 326 364 +38
Lines 6537 7081 +544
Branches 810 908 +98
===============================================
+ Hits 1458 1525 +67
- Misses 4476 4875 +399
- Partials 603 681 +78
Continue to review full report at Codecov.
|
Awesome possum!! Super excited @alterx and welcome to Team Storybook! 🍻 |
I rebased 3.2 with master, |
257041d
to
10ab08e
Compare
71730a5
to
7c3da0e
Compare
addons/knobs/README.md
Outdated
@@ -37,7 +37,7 @@ Now, write your stories with knobs. | |||
|
|||
```js | |||
import { storiesOf } from '@storybook/react'; | |||
import { withKnobs, text, boolean, number } from '@storybook/addon-knobs'; | |||
import { addonKnobs, text, boolean, number } from '@storybook/addon-knobs'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is wrong now..
addons/knobs/README.md
Outdated
// Knobs as dynamic variables. | ||
stories.add('as dynamic variables', () => { | ||
stories.add('as dynamic variables', addonKnobs(options)(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Must have been 'reverted' when rebasing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good! Will test on my machine..
} | ||
}; | ||
}) | ||
// .add('All knobs', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do these not work currently? or is there another reason why these are commented-out?
@Component({ | ||
selector: 'knobs-component', | ||
template: ` | ||
<div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An empty div? Is this uncompleted / in progress or is this the way it should be?
This is a WIP. I just don't trust my Mac anymore, it's old and I better
commit what I have
|
e4420a8
to
a4f665e
Compare
This is the first attempt at adding support for Angular based, mostly, on the vue changes. What works: - Added angular sample code to the `examples` folder - Rendering stories and creating stories out of existing angular components - For the time being, this only supports one-page angular components What's missing: - Addons support - Support for components that have a separate template Signed-off-by: Carlos Vega <clmvega@gmail.com>
Signed-off-by: Carlos Vega <clmvega@gmail.com>
- `start-storybook` / `build-storybook` should be run out of `node_modules/.bin` - update lerna config to not publish angular-test example
Signed-off-by: Carlos Vega <clmvega@gmail.com>
Signed-off-by: Carlos Vega <clmvega@gmail.com>
We had TypeScript errors related to conflicting @types included in the root @storybook repo and the angular-cli sample. Also, we had some issues with TS not recognizing `describe`, `it` and other global functions exposed by jasmine. Signed-off-by: Carlos Vega <clmvega@gmail.com>
- Links - Actions - Notes Signed-off-by: Carlos Vega <clmvega@gmail.com>
Signed-off-by: Carlos Vega <clmvega@gmail.com>
Ok guys, I spent a fair amount of time digging into these webpack errors and found several things:
After fixing these issues I was able to get it to compile using Angular 2.3.1 so we can say that it wasn't really an angular issue. It's just that a some of the modules angular uses are coupled to specific versions of TypeScript. I've committed those changes to the branch @Hypnosphi created just to demonstrate that we can fix it, here's the commit b604123. With that being said I'd recommend to use the Thoughts on this? ps. That branch was also using |
Signed-off-by: Carlos Vega <clmvega@gmail.com>
Guys, there's a problem with the CLI test, the
It looks like this is the last issue, the build issues are gone 🎉 |
Signed-off-by: Carlos Vega <clmvega@gmail.com>
Signed-off-by: Carlos Vega <clmvega@gmail.com>
Signed-off-by: Carlos Vega <clmvega@gmail.com>
I've added more changes to fix these tests (changes include mocking the |
That's weird, it should link a local version. I'll take a look |
It is weird, I even had to create this 9becf40 commit to mock the version (it tries to fetch the version from the npm registry using https://www.npmjs.com/package/latest-version |
But it is |
Hmm, I thought I bumped them all up here 64b7d3d |
Well, the |
Oh, ok, good to know that :) |
We're good to go, I think. |
Signed-off-by: Carlos Vega <clmvega@gmail.com>
… into 269-angular-support
Signed-off-by: Carlos Vega <clmvega@gmail.com>
Signed-off-by: Carlos Vega <clmvega@gmail.com>
Issue: #269
What I did
This is the first attempt at adding support for Angular based, mostly, on the vue changes.
What works:
examples
folderHow to test
yarn bootstrap --reset --core cd examples/angular-cli yarn storybook open http://localhost:9009