mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-04 21:51:17 +08:00
Merge pull request #4335 from gabrielcsapo/ember-storybook-cleanup
CLEANUP ember docs and refactor
This commit is contained in:
commit
542baa436b
@ -42,7 +42,7 @@ Then add the following NPM script to your package json in order to start the sto
|
||||
```json
|
||||
{
|
||||
"scripts": {
|
||||
"storybook": "start-storybook -p 9001 -c .storybook"
|
||||
"storybook": "start-storybook -p 9001 -s dist"
|
||||
}
|
||||
}
|
||||
```
|
||||
@ -130,13 +130,42 @@ storiesOf('Demo', module)
|
||||
return {
|
||||
template: hbs`{{foo-bar
|
||||
click=onClick
|
||||
}}`
|
||||
},
|
||||
context: {
|
||||
onClick: (e) => console.log(e)
|
||||
}}`,
|
||||
context: {
|
||||
onClick: (e) => console.log(e)
|
||||
}
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
> If you are using an older version of ember <= 3.1 please use this story style
|
||||
|
||||
```js
|
||||
import { compile } from 'ember-source/dist/ember-template-compiler';
|
||||
import { storiesOf } from '@storybook/ember';
|
||||
|
||||
storiesOf('Demo', module)
|
||||
.add('heading', () => compile(`<h1>Hello World</h1>`))
|
||||
.add('button', () => {
|
||||
return {
|
||||
template: compile(`<button {{action onClick}}>
|
||||
Hello Button
|
||||
</button>`),
|
||||
context: {
|
||||
onClick: (e) => console.log(e)
|
||||
}
|
||||
}
|
||||
})
|
||||
.add('component', () => {
|
||||
return {
|
||||
template: compile(`{{foo-bar
|
||||
click=onClick
|
||||
}}`),
|
||||
context: {
|
||||
onClick: (e) => console.log(e)
|
||||
}
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
A story is either:
|
||||
|
@ -4,9 +4,9 @@
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "ember build",
|
||||
"build-storybook": "yarn build && cp -r public/* dist; build-storybook -s dist",
|
||||
"build-storybook": "yarn build && cp -r public/* dist && build-storybook -s dist",
|
||||
"dev": "ember serve",
|
||||
"storybook": "yarn build && cp -r public/* dist; start-storybook -p 9009 -s dist"
|
||||
"storybook": "yarn build && start-storybook -p 9009 -s dist, public"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.1.2",
|
||||
|
@ -27,8 +27,8 @@ export default async npmOptions => {
|
||||
packageJson.scripts = {
|
||||
...packageJson.scripts,
|
||||
...{
|
||||
storybook: 'start-storybook -p 6006',
|
||||
'build-storybook': 'build-storybook',
|
||||
storybook: 'start-storybook -p 6006 -s dist',
|
||||
'build-storybook': 'build-storybook -s dist',
|
||||
},
|
||||
};
|
||||
|
||||
|
1
lib/cli/test/fixtures/ember-cli/.gitignore
vendored
Normal file
1
lib/cli/test/fixtures/ember-cli/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
!dist
|
0
lib/cli/test/fixtures/ember-cli/dist/.gitkeep
vendored
Normal file
0
lib/cli/test/fixtures/ember-cli/dist/.gitkeep
vendored
Normal file
25
lib/cli/test/fixtures/ember-cli/testem.js
vendored
25
lib/cli/test/fixtures/ember-cli/testem.js
vendored
@ -1,25 +0,0 @@
|
||||
module.exports = {
|
||||
test_page: 'tests/index.html?hidepassed',
|
||||
disable_watching: true,
|
||||
launch_in_ci: [
|
||||
'Chrome'
|
||||
],
|
||||
launch_in_dev: [
|
||||
'Chrome'
|
||||
],
|
||||
browser_args: {
|
||||
Chrome: {
|
||||
ci: [
|
||||
// --no-sandbox is needed when running Chrome inside a container
|
||||
process.env.CI ? '--no-sandbox' : null,
|
||||
'--headless',
|
||||
'--disable-gpu',
|
||||
'--disable-dev-shm-usage',
|
||||
'--disable-software-rasterizer',
|
||||
'--mute-audio',
|
||||
'--remote-debugging-port=0',
|
||||
'--window-size=1440,900'
|
||||
].filter(Boolean)
|
||||
}
|
||||
}
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user