Skip to content

Commit

Permalink
Run prettier on all the things
Browse files Browse the repository at this point in the history
  • Loading branch information
johno committed May 22, 2018
1 parent 987ad03 commit f61888c
Show file tree
Hide file tree
Showing 100 changed files with 17,297 additions and 1,057 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ node_modules
dist
.nyc_output
lerna-debug.log
.next
64 changes: 33 additions & 31 deletions cli/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,39 +31,41 @@ const cli = meow(
-m --mode Enable different modes for server UI
--webpack Path to custom webpack.config.js
`, {
version: pkg.version,
flags: {
version: {
type: 'boolean',
alias: 'v'
},
help: {
type: 'boolean',
alias: 'h'
},
open: {
type: 'boolean',
alias: 'o'
},
port: {
type: 'string',
alias: 'p',
default: 8080
},
webpack: {
type: 'string'
},
config: {
type: 'string',
alias: 'c'
},
mode: {
type: 'string',
alias: 'm'
`,
{
version: pkg.version,
flags: {
version: {
type: 'boolean',
alias: 'v'
},
help: {
type: 'boolean',
alias: 'h'
},
open: {
type: 'boolean',
alias: 'o'
},
port: {
type: 'string',
alias: 'p',
default: 8080
},
webpack: {
type: 'string'
},
config: {
type: 'string',
alias: 'c'
},
mode: {
type: 'string',
alias: 'm'
}
}
}
})
)

require('update-notifier')({
pkg: cli.pkg
Expand Down
9 changes: 8 additions & 1 deletion cli/lib/constants.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
const projectTemplates = ['next', 'x0', 'create-react-app', 'styled-system', 'rebass', 'tachyons']
const projectTemplates = [
'next',
'x0',
'create-react-app',
'styled-system',
'rebass',
'tachyons'
]

const templatesDir = 'c8r/kit/templates'

Expand Down
4 changes: 1 addition & 3 deletions cli/src/Init.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,7 @@ class Init extends Component {
<Spinner /> Running <Text bold>npm i</Text>
</div>
)}
{step === 'done' && (
<Text>Done!</Text>
)}
{step === 'done' && <Text>Done!</Text>}
</div>
)
}
Expand Down
6 changes: 1 addition & 5 deletions core/examples/Debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,4 @@ import React from 'react'
import { Debug } from '../src'
import pkg from '../package.json'

export default props => (
<Debug
children={pkg}
/>
)
export default props => <Debug children={pkg} />
4 changes: 3 additions & 1 deletion core/examples/Diff.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ export default props => (
<Box p={3}>
<Diff>
<Button>Hello</Button>
<Button bg='red' px={2}>Hello</Button>
<Button bg="red" px={2}>
Hello
</Button>
</Diff>
</Box>
)
66 changes: 26 additions & 40 deletions core/examples/Library.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
Heading,
Button,
Donut,

ButtonCircle,
ButtonOutline,
Card,
Expand All @@ -14,7 +13,7 @@ import {
Circle,
Badge,
Dot,
Switch,
Switch
} from 'rebass'
import * as Rebass from 'rebass'
import {
Expand Down Expand Up @@ -52,10 +51,10 @@ const Demo = props => (
<ButtonOutline>ButtonOutline</ButtonOutline>
</Example>
<Example name="Green Button">
<Button bg='green'>Button</Button>
<Button bg="green">Button</Button>
</Example>
<Example name="Red Button">
<Button bg='red'>Button</Button>
<Button bg="red">Button</Button>
</Example>

<Example name="Badge">
Expand All @@ -68,33 +67,22 @@ const Demo = props => (
<Switch checked />
</Example>
<Example name="Dot">
<Dot bg='black' />
<Dot bg="black" />
<Dot />
<Dot />
</Example>
<Example name='Card'>
<Card>
Hello Card
</Card>
<Example name="Card">
<Card>Hello Card</Card>
</Example>
<Example name='Avatar'>
<Avatar
src='https://images.unsplash.com/photo-1462331940025-496dfbfc7564?w=2048&q=20'
/>
<Example name="Avatar">
<Avatar src="https://images.unsplash.com/photo-1462331940025-496dfbfc7564?w=2048&q=20" />
</Example>
<Example name='Image'>
<Image
src='https://images.unsplash.com/photo-1462331940025-496dfbfc7564?w=2048&q=20'
/>
<Example name="Image">
<Image src="https://images.unsplash.com/photo-1462331940025-496dfbfc7564?w=2048&q=20" />
</Example>



<Example name="Donut">
<Donut
value={2/3}
color='tomato'
/>
<Donut value={2 / 3} color="tomato" />
<Detail>
{/* throwing errors
<Markdown components={Rebass}>
Expand All @@ -103,16 +91,16 @@ const Demo = props => (
*/}
<Matrix
x={[
{ color: 'blue '},
{ color: 'blue ' },
{ color: 'pink' },
{ color: 'tomato' },
{ color: 'purple' }
]}
y={[
{ value: 1/5 },
{ value: 1/4 },
{ value: 1/3 },
{ value: 3/4 }
{ value: 1 / 5 },
{ value: 1 / 4 },
{ value: 1 / 3 },
{ value: 3 / 4 }
]}
component={Donut}
/>
Expand All @@ -128,10 +116,7 @@ const Demo = props => (
<Font fontFamily="&quot;Ubuntu&quot;, sans-serif">Font</Font>
</Example>
<Example name="LiveEditor">
<LiveEditor
scope={Rebass}
code="<Button>hello</Button>"
/>
<LiveEditor scope={Rebass} code="<Button>hello</Button>" />
</Example>
<Example name="TypeScale">
<TypeScale value={[14, 16, 20, 24, 32, 48, 64, 80]} />
Expand All @@ -145,7 +130,8 @@ const Demo = props => (
fontWeight: 'bold',
color: 'white',
backgroundColor: 'tomato'
}}>
}}
>
Hello
</div>
</Responsive>
Expand Down Expand Up @@ -173,23 +159,23 @@ const Demo = props => (
</Example>
<Example name="Diff">
<Diff>
<Heading color='pink'>Hello</Heading>
<Heading color='purple' fontSize={3} mt={1}>Hello</Heading>
<Heading color="pink">Hello</Heading>
<Heading color="purple" fontSize={3} mt={1}>
Hello
</Heading>
</Diff>
</Example>
<Example name='State'>
<Example name="State">
<State
count={0}
render={({ count, update }) => (
<React.Fragment>
<pre>{'<State />'}</pre>
<samp>{count}</samp>
<button
onClick={e => update(s => ({ count: s.count - 1 }))}>
<button onClick={e => update(s => ({ count: s.count - 1 }))}>
-
</button>
<button
onClick={e => update(s => ({ count: s.count + 1 }))}>
<button onClick={e => update(s => ({ count: s.count + 1 }))}>
+
</button>
</React.Fragment>
Expand Down
25 changes: 6 additions & 19 deletions core/examples/LibraryProps.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,19 @@
import React from 'react'
import {
Library,
Example,
Detail
} from '../src'
import { Library, Example, Detail } from '../src'

const examples = [
{
name: 'Button',
element: (
<button>Beep</button>
)
element: <button>Beep</button>
},
{
name: 'Heading',
element: (
<h1>Hello</h1>
)
},
element: <h1>Hello</h1>
}
]

export default class extends React.Component {
render () {
return (
<Library
title='Example Library'
examples={examples}
/>
)
render() {
return <Library title="Example Library" examples={examples} />
}
}
8 changes: 2 additions & 6 deletions core/examples/Matrix.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,8 @@ export default props => (
x={[
{ children: 'Hello', bg: 'red', m: 2 },
{ children: 'Beep', bg: 'green', m: 2 },
{ children: 'Boop', bg: 'blue', m: 2 },
]}
y={[
{ px: 3, py: 2 },
{ px: 4, py: 3 },
{ px: 4, py: 3, fontSize: 3 },
{ children: 'Boop', bg: 'blue', m: 2 }
]}
y={[{ px: 3, py: 2 }, { px: 4, py: 3 }, { px: 4, py: 3, fontSize: 3 }]}
/>
)
5 changes: 3 additions & 2 deletions core/examples/Responsive.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ export default props => (
fontSize: 32,
fontWeight: 'bold',
color: 'white',
backgroundColor: 'tomato',
}}>
backgroundColor: 'tomato'
}}
>
Hello
</div>
</Responsive>
Expand Down
4 changes: 1 addition & 3 deletions core/src/Cartesian.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ export default ({ component, ...props }) => {

return (
<Fragment>
{combinations.map((props, i) =>
<Component key={i} {...props} />
)}
{combinations.map((props, i) => <Component key={i} {...props} />)}
</Fragment>
)
}
9 changes: 2 additions & 7 deletions core/src/Diff.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,12 @@ const ComponentBox = nano(Box)(({ blendMode }) => ({
mixBlendMode: blendMode || 'multiply'
}))

export default ({
blendMode,
children
}) => {
export default ({ blendMode, children }) => {
const diffs = React.Children.toArray(children)
return (
<DiffBox>
{diffs.map(el => (
<ComponentBox
key={el.key}
blendMode={blendMode}>
<ComponentBox key={el.key} blendMode={blendMode}>
{el}
</ComponentBox>
))}
Expand Down
Loading

0 comments on commit f61888c

Please sign in to comment.