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
| Well done! You've found code #2, it is XYICD. | |
| Were you looking for the real docs? https://www.chromatic.com/docs/visual-testing-addon |
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
| module.exports = { | |
| // Make sure you match CSF files! | |
| testMatch: ['**/__tests__/**/*.js', '**/?(*.)test.js', '**/?(*.)stories.js'], | |
| // You'll probably want to add some code to mock out things for stories | |
| setupFilesAfterEnv: ['<rootDir>/.storybook/setupFilesAfterEnv'], | |
| transform: { | |
| // This is the key bit! |
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
| const { executablePath, args } = require('chrome-aws-lambda'); | |
| const { spawnSync,execSync } = require('child_process'); | |
| const fullArgs = args.concat(['--no-sandbox', '--headless', '--disable-gpu', '--screenshot', 'https://kqdbudnrfd.tunnel.chromaticqa.com/iframe.html?selectedKind=basics%2FA&selectedStory=fonts']); | |
| console.log('runningWithArgs: ' + fullArgs); | |
| const screenshotResult = spawnSync(executablePath, fullArgs, { cwd: '/tmp', timeout: 25 * 1000 }); | |
| console.log('chrome command stdio: ' + screenshotResult.output.toString()); | |
| console.log('chrome command stderr: ' + screenshotResult.stderr.toString()); |
- Refactor each view layer to export a "story" component
(sort of like I imagined on this PR: storybookjs/storybook#3360)
So, you could this:
import React from 'react';
import { Story } from '@storybook/react';
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
| // The idea is to maintain the `api.X` contract that allows us to change the internal store format without releasing a breaking change | |
| import React from 'react'; | |
| import { addons, types } from '@storybook/addons'; | |
| import { ADDON_ID, PANEL_ID } from './constants'; | |
| addons.register(ADDON_ID, api => { | |
| addons.add(PANEL_ID, { | |
| type: types.PANEL, |
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
| ### Keybase proof | |
| I hereby claim: | |
| * I am tmeasday on github. | |
| * I am tmeasday (https://keybase.io/tmeasday) on keybase. | |
| * I have a public key ASB182E6eXpK7TriyrH8UK4hiMI9WVQmgK7deP7SlxC3rAo | |
| To claim this, I am signing this object: |
Here's a rough plan of where I am interested in taking Storybook's Story API.
The basic idea is to transition towards a new API that is:
- More powerful
- More flexible and interoperable with other tools
- More familiar+idomatic.
The ground work of @storybook/core has been done, now we can do the fun stuff!
Ideas of what I'd like to add:
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
| import { execute } from 'graphql'; | |
| import { makeExecutableSchema } from 'graphql-tools'; | |
| // There is some code duplication with server/index here. | |
| // I wonder if we could refactor? | |
| import addModelsToContext from '../model'; | |
| import typeDefs from '../schema'; | |
| import resolvers from '../resolvers'; | |
| /* eslint-disable no-console */ |
NewerOlder