-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ran with the same command (`yarn dev`) this contains all the functionality you know and love - hot reloading, a playground, percy snapshots just with a different veneer
- Loading branch information
Showing
40 changed files
with
3,398 additions
and
1,057 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,3 @@ node_modules | |
/styles.scss | ||
/styles | ||
/src/styles/polaris-tokens | ||
/playground/build |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,5 +13,4 @@ node_modules | |
/sandbox | ||
.DS_Store | ||
*.scss.d.ts | ||
/playground/build | ||
/src/styles/polaris-tokens |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,6 @@ node_modules | |
/styles.scss | ||
/styles | ||
/src/styles/polaris-tokens | ||
/playground/build | ||
|
||
/package.json | ||
/.github |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"presets": [ | ||
["shopify/web", {"modules": false}], | ||
["shopify/react", {"hot": true}] | ||
] | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// The order of these imports defines the order of the tabs in the addons panel | ||
import '@storybook/addon-actions/register'; | ||
import '@storybook/addon-notes/register'; | ||
import '@storybook/addon-a11y/register'; | ||
import '@storybook/addon-options/register'; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
import { | ||
configure, | ||
addDecorator, | ||
getStorybook, | ||
setAddon, | ||
} from '@storybook/react'; | ||
import {setConsoleOptions} from '@storybook/addon-console'; | ||
import {withNotes} from '@storybook/addon-notes'; | ||
import {withOptions} from '@storybook/addon-options'; | ||
import {themes} from '@storybook/components'; | ||
import createPercyAddon from '@percy-io/percy-storybook'; | ||
import tokens from '@shopify/polaris-tokens'; | ||
|
||
import { | ||
addPlaygroundStory, | ||
generateStories, | ||
hydrateExecutableExamples, | ||
} from './stories-from-readme'; | ||
|
||
// addon-options | ||
addDecorator( | ||
withOptions({ | ||
name: 'Shopify Polaris Storybook', | ||
url: '/', | ||
hierarchySeparator: /\//, | ||
hierarchyRootSeparator: /\|/, | ||
theme: { | ||
...themes.normal, | ||
mainTextSize: '16', | ||
mainBorderRadius: 0, | ||
mainBackground: tokens.colorSkyLight, | ||
mainTextColor: tokens.colorInk, | ||
highlightColor: tokens.colorIndigoDark, | ||
dimmedTextColor: tokens.colorInkLighter, | ||
successColor: tokens.colorGreenDark, | ||
failColor: tokens.colorRedDark, | ||
warnColor: tokens.colorOrange, | ||
// TODO more pretty brand colors? | ||
// SEE https://github.com/storybooks/storybook/blob/next/lib/components/src/theme.js | ||
}, | ||
}), | ||
); | ||
|
||
// addon-notes | ||
addDecorator(withNotes); | ||
|
||
// addon-console | ||
setConsoleOptions((opts: any) => { | ||
// When transpiling TS using isolatedModules, the compiler doesn't strip | ||
// out exported types as it doesn't know if an item is a type or not. | ||
// Ignore those warnings as we don't care about them. | ||
// ignore color because the addon doesn't handle colored logs properly | ||
opts.panelExclude = [ | ||
...opts.panelExclude, | ||
/export .* was not found in/, | ||
/color: #999933;/, | ||
]; | ||
return opts; | ||
}); | ||
|
||
// percy-storybook | ||
const {percyAddon, serializeStories} = createPercyAddon(); | ||
setAddon(percyAddon); | ||
|
||
// import all README.md files within component folders | ||
const readmeReq = require.context( | ||
'../src/components', | ||
true, | ||
/\/.+\/README.md$/, | ||
); | ||
function loadStories() { | ||
addPlaygroundStory(); | ||
|
||
readmeReq.keys().forEach((filename) => { | ||
const readme = readmeReq(filename).component; | ||
generateStories(hydrateExecutableExamples(readme)); | ||
}); | ||
} | ||
|
||
configure(loadStories, module); | ||
|
||
serializeStories(getStorybook); |
Oops, something went wrong.