Skip to content

Commit

Permalink
refactor to use common JS
Browse files Browse the repository at this point in the history
  • Loading branch information
mikemcbride committed Jan 21, 2020
1 parent 45651f3 commit 8768226
Show file tree
Hide file tree
Showing 9 changed files with 12,395 additions and 2,552 deletions.
10 changes: 5 additions & 5 deletions cli.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env node
'use strict'
import React from 'react'
import importJsx from 'import-jsx'
import {render} from 'ink'
import meow from 'meow'
const React = require('react')
const importJsx = require('import-jsx')
const {render} = require('ink')
const meow = require('meow')

const ui = importJsx('./ui')

Expand Down Expand Up @@ -39,4 +39,4 @@ const cli = meow(`
`)

const initialColor = cli.input.length === 0 ? null : cli.input.join(' ')
export default render(React.createElement(ui, { color: initialColor }))
module.exports = render(React.createElement(ui, { color: initialColor }))
8 changes: 4 additions & 4 deletions components/InputColor.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import { Box, Text } from 'ink'
import { UncontrolledTextInput } from 'ink-text-input'
const React = require('react')
const { Box, Text } = require('ink')
const { UncontrolledTextInput } = require('ink-text-input')

const InputColor = (props) => (
<Box>
Expand All @@ -11,4 +11,4 @@ const InputColor = (props) => (
</Box>
)

export default InputColor
module.exports = InputColor
8 changes: 4 additions & 4 deletions components/SelectFormat.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import { Box, Color, Text } from 'ink'
import SelectInput from 'ink-select-input'
const React = require('react')
const { Box, Color, Text } = require('ink')
const { default: SelectInput } = require('ink-select-input')

const SelectFormat = (props) => (
<Box flexDirection="column">
Expand All @@ -12,4 +12,4 @@ const SelectFormat = (props) => (
</Box>
)

export default SelectFormat
module.exports = SelectFormat
2 changes: 1 addition & 1 deletion converter.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ function convertColor(color, outputType) {
// Our exports go here
// ==================================

export default {
module.exports = {
isHex: function(str) {
return isHex(str)
},
Expand Down
9 changes: 0 additions & 9 deletions index.js

This file was deleted.

Loading

0 comments on commit 8768226

Please sign in to comment.