-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(build): adds SFC, prettierrc, styleguidist wrapper, styled-compo…
…nents
- Loading branch information
1 parent
0827de0
commit efe5fa4
Showing
26 changed files
with
1,356 additions
and
1,021 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"singleQuote": 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 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,3 @@ | ||
# Hello | ||
|
||
`npm install @coinsquare/hello-component` |
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 |
---|---|---|
@@ -1,19 +1,16 @@ | ||
import React from "react"; | ||
import PropTypes from "prop-types"; | ||
import React from 'react'; | ||
|
||
export default class Hello extends React.PureComponent { | ||
static propTypes = { | ||
/** Sample prop that you can change */ | ||
dummyProp: PropTypes.string | ||
}; | ||
import PropTypes from 'prop-types'; | ||
|
||
static defaultProps = { | ||
dummyProp: 'My dummy prop default value' | ||
}; | ||
export const Hello = props => ( | ||
<p>Hello Component {props.dummyProp}</p> | ||
); | ||
|
||
render() { | ||
return ( | ||
<p>Hello Component - {this.props.dummyProp}</p> | ||
); | ||
} | ||
} | ||
Hello.propTypes = { | ||
/** Sample prop that you can change */ | ||
dummyProp: PropTypes.string | ||
}; | ||
|
||
Hello.defaultProps = { | ||
dummyProp: 'My dummy prop default value' | ||
}; |
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 |
---|---|---|
@@ -1,2 +1 @@ | ||
export { default } from "./Hello"; | ||
export { default as Hello } from "./Hello"; | ||
export { Hello } from "./Hello"; |
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 |
---|---|---|
@@ -1,17 +1,14 @@ | ||
import * as React from "react"; | ||
import * as React from 'react'; | ||
|
||
interface WorldProps { | ||
/** Sample prop description */ | ||
dummyProp?: string; | ||
} | ||
|
||
const World: React.SFC<WorldProps> = props => ( | ||
export const World: React.SFC<WorldProps> = props => ( | ||
<p>World Component - {props.dummyProp}</p> | ||
); | ||
|
||
World.defaultProps = { | ||
/* Sample prop that you can change */ | ||
dummyProp: 'My dummy prop default value' | ||
} | ||
|
||
export default World; | ||
}; |
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 |
---|---|---|
@@ -1,2 +1 @@ | ||
export { default } from './World'; | ||
export { default as World } from './World'; | ||
export { World } from "./World"; |
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 |
---|---|---|
@@ -1,12 +1,18 @@ | ||
const path = require('path'); | ||
|
||
module.exports = { | ||
title: "Coinsquare Styleguide", | ||
components: "packages/**/src/!(*.story).*sx" | ||
title: 'Coinsquare Styleguide', | ||
components: 'packages/**/src/!(*.story).*sx', | ||
// resolver: require("react-docgen").resolver.findAllComponentDefinitions, | ||
// propsParser: (filePath, source, resolver, handlers) => { | ||
// return filePath.indexOf(".tsx") > -1 | ||
// ? require("react-docgen-typescript") | ||
// .withDefaultConfig() | ||
// .parse(filePath, source, resolver, handlers) | ||
// : require("react-docgen").parse(source, resolver, handlers); | ||
// } | ||
// }, | ||
styleguideComponents: { | ||
Wrapper: path.join(__dirname, 'styleguide.wrapper.jsx') | ||
}, | ||
assetsDir: path.join(__dirname, 'assets') | ||
}; |
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,11 @@ | ||
import React from 'react' | ||
import { ThemeProvider } from 'styled-components' | ||
import { theme } from './packages/Theme' | ||
|
||
const Wrapper = props => ( | ||
<ThemeProvider theme={theme}> | ||
{props.children} | ||
</ThemeProvider> | ||
) | ||
|
||
export default Wrapper; |
File renamed without changes.
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 |
---|---|---|
@@ -1,2 +1 @@ | ||
export { default } from "./{{pascalcase name}}"; | ||
export { default as {{pascalcase name}} } from "./{{pascalcase name}}"; | ||
export { {{pascalcase name}} } from "./{{pascalcase name}}"; |
29 changes: 13 additions & 16 deletions
29
templates/jsx-component/{{pascalcase name}}/src/{{pascalcase name}}.jsx.tpl
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 |
---|---|---|
@@ -1,19 +1,16 @@ | ||
import React from "react"; | ||
import PropTypes from "prop-types"; | ||
import React from 'react'; | ||
|
||
export default class {{pascalcase name}} extends React.PureComponent { | ||
static propTypes = { | ||
/** Sample prop that you can change */ | ||
dummyProp: PropTypes.string | ||
}; | ||
import PropTypes from 'prop-types'; | ||
|
||
static defaultProps = { | ||
dummyProp: 'My dummy prop default value' | ||
}; | ||
export const {{pascalcase name}} = props => ( | ||
<p>{{pascalcase name}} Component {props.dummyProp}</p> | ||
); | ||
|
||
render() { | ||
return ( | ||
<p>{{pascalcase name}} Component - {this.props.dummyProp}</p> | ||
); | ||
} | ||
} | ||
{{pascalcase name}}.propTypes = { | ||
/** Sample prop that you can change */ | ||
dummyProp: PropTypes.string | ||
}; | ||
|
||
{{pascalcase name}}.defaultProps = { | ||
dummyProp: 'My dummy prop default value' | ||
}; |
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
2 changes: 1 addition & 1 deletion
2
templates/jsx-component/{{pascalcase name}}/src/{{pascalcase name}}.test.js.tpl
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.