diff --git a/.circleci/config.yml b/.circleci/config.yml index bf9ab09ef959..c77e6a729f14 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -68,6 +68,11 @@ jobs: command: | cd examples/vue-kitchen-sink yarn build-storybook + - run: + name: "Build angular-cli" + command: | + cd examples/angular-cli + yarn build-storybook - run: name: "Run react kitchen-sink" @@ -81,6 +86,12 @@ jobs: cd examples/vue-kitchen-sink yarn storybook background: true + - run: + name: "Run angular-cli" + command: | + cd examples/angular-cli + yarn storybook + background: true - run: name: Workaround for https://github.com/GoogleChrome/puppeteer/issues/290 command: sh ./scripts/workaround-puppeteer-issue-290.sh diff --git a/examples/angular-cli/.storybook/config.js b/examples/angular-cli/.storybook/config.js index 10a0838b13df..2da8e2e77eee 100644 --- a/examples/angular-cli/.storybook/config.js +++ b/examples/angular-cli/.storybook/config.js @@ -3,7 +3,12 @@ import { configure } from '@storybook/angular'; function loadStories() { + // put welcome screen at the top of the list so it's the first one displayed require('../src/stories'); + + // automatically import all story ts files that end with *.stories.ts + const req = require.context('../src/stories', true, /\.stories\.ts$/) + req.keys().forEach((filename) => req(filename)) } configure(loadStories, module); diff --git a/examples/angular-cli/package.json b/examples/angular-cli/package.json index c4b7f4f7c935..3194f55468d0 100644 --- a/examples/angular-cli/package.json +++ b/examples/angular-cli/package.json @@ -9,7 +9,7 @@ "test": "ng test", "lint": "ng lint", "e2e": "ng e2e", - "storybook": "start-storybook -p 9009 -s src/assets", + "storybook": "start-storybook -p 9008 -s src/assets", "build-storybook": "build-storybook -s src" }, "private": true, diff --git a/examples/angular-cli/src/stories/index.ts b/examples/angular-cli/src/stories/index.ts index 9ed48fc67842..d755b4898847 100644 --- a/examples/angular-cli/src/stories/index.ts +++ b/examples/angular-cli/src/stories/index.ts @@ -25,8 +25,6 @@ import { ServiceComponent } from './moduleMetadata/service.component' import { NameComponent } from './name.component'; import { CustomPipePipe } from './custom.pipe'; -import './customControlValueAccessor/custom-cva-component.stories'; - storiesOf('Welcome', module) .add('to Storybook', () => ({ component: Welcome, diff --git a/integration/__image_snapshots__/angular-cli-snap.png b/integration/__image_snapshots__/angular-cli-snap.png new file mode 100644 index 000000000000..926d9138c169 Binary files /dev/null and b/integration/__image_snapshots__/angular-cli-snap.png differ diff --git a/integration/examples.test.js b/integration/examples.test.js index cdafd0f7411c..cff64b21935a 100644 --- a/integration/examples.test.js +++ b/integration/examples.test.js @@ -9,6 +9,10 @@ const examples = [ name: 'vue-kitchen-sink', port: 9009, }, + { + name: 'angular-cli', + port: 9008, + }, ]; examples.forEach(({ name, port }) => {