-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from South-Paw/3.0.0
Update starter
- Loading branch information
Showing
46 changed files
with
7,720 additions
and
5,310 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
.git | ||
node_modules | ||
public | ||
build | ||
coverage |
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,12 @@ | ||
{ | ||
"root": true, | ||
"parser": "babel-eslint", | ||
"extends": ["airbnb", "plugin:prettier/recommended", "plugin:jest/recommended"], | ||
"rules": { | ||
"import/prefer-default-export": "off", | ||
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }], | ||
"react/jsx-props-no-spreading": "off", | ||
"react/jsx-one-expression-per-line": "off" | ||
}, | ||
"overrides": [] | ||
} |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
.git | ||
node_modules | ||
public | ||
build | ||
coverage |
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 @@ | ||
{ | ||
"endOfLine": "lf", | ||
"printWidth": 120, | ||
"singleQuote": true, | ||
"trailingComma": "all" | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,29 @@ | ||
module.exports = { | ||
stories: ['../src/**/*.stories.js'], | ||
addons: ['@storybook/addon-actions', '@storybook/addon-links', '@storybook/addon-docs'], | ||
webpackFinal: async (config) => { | ||
// Transpile Gatsby module because Gatsby includes un-transpiled ES6 code. | ||
config.module.rules[0].exclude = [/node_modules\/(?!(gatsby)\/)/]; | ||
|
||
// use installed babel-loader which is v8.0-beta (which is meant to work with @babel/core@7) | ||
config.module.rules[0].use[0].loader = require.resolve('babel-loader'); | ||
|
||
// use @babel/preset-react for JSX and env (instead of staged presets) | ||
config.module.rules[0].use[0].options.presets = [ | ||
require.resolve('@babel/preset-react'), | ||
require.resolve('@babel/preset-env'), | ||
]; | ||
|
||
config.module.rules[0].use[0].options.plugins = [ | ||
// use @babel/plugin-proposal-class-properties for class arrow functions | ||
require.resolve('@babel/plugin-proposal-class-properties'), | ||
// use babel-plugin-remove-graphql-queries to remove static queries from components when rendering in storybook | ||
require.resolve('babel-plugin-remove-graphql-queries'), | ||
]; | ||
|
||
// Prefer Gatsby ES6 entrypoint (module) over commonjs (main) entrypoint | ||
config.resolve.mainFields = ['browser', 'module', 'main']; | ||
|
||
return config; | ||
}, | ||
}; |
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,25 @@ | ||
import { action } from '@storybook/addon-actions'; | ||
import { addDecorator } from '@storybook/react'; | ||
import * as React from 'react'; | ||
import { Theme } from '../src/components/Theme'; | ||
|
||
addDecorator((storyFn) => <Theme>{storyFn()}</Theme>); | ||
|
||
// Gatsby's Link overrides: | ||
// Gatsby Link calls the `enqueue` & `hovering` methods on the global variable ___loader. | ||
// This global object isn't set in storybook context, requiring you to override it to empty functions (no-op), | ||
// so Gatsby Link doesn't throw any errors. | ||
global.___loader = { | ||
enqueue: () => {}, | ||
hovering: () => {}, | ||
}; | ||
|
||
// __PATH_PREFIX__ and __BASE_PATH__ are used inside gatsby-link an other various places. For storybook not to crash, you need to set it as well. | ||
global.__PATH_PREFIX__ = ''; | ||
global.__BASE_PATH__ = ''; | ||
|
||
// Navigating through a gatsby app using gatsby-link or any other gatsby component will use the `___navigate` method. | ||
// In Storybook it makes more sense to log an action than doing an actual navigate. Checkout the actions addon docs for more info: https://github.com/storybookjs/storybook/tree/master/addons/actions. | ||
window.___navigate = (pathname) => { | ||
action('NavigateTo:')(pathname); | ||
}; |
This file was deleted.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import React from 'react'; | ||
import { Button } from '.'; | ||
|
||
export default { | ||
title: 'Button', | ||
component: Button, | ||
}; | ||
|
||
export const Simple = () => <Button>button</Button>; |
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
Oops, something went wrong.