Skip to content
This repository was archived by the owner on Jun 20, 2022. It is now read-only.

Commit

Permalink
chore: move to lerna arch
Browse files Browse the repository at this point in the history
  • Loading branch information
gregberge committed Sep 16, 2018
1 parent bbaef2b commit e9c1d5f
Show file tree
Hide file tree
Showing 98 changed files with 1,461 additions and 243 deletions.
19 changes: 5 additions & 14 deletions babel.config.js → .babelrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const getStyledEnginePlugins = () => {
}
}

const config = {
let config = {
presets: [
['@babel/preset-env', { loose: true, modules: false }],
'@babel/preset-react',
Expand All @@ -35,22 +35,13 @@ const config = {
],
}

if (process.env.BABEL_ENV === 'lib') {
module.exports = Object.assign({}, config, {
if (process.env.NODE_ENV === 'test') {
config = Object.assign({}, config, {
plugins: [
...config.plugins,
['@babel/plugin-transform-modules-commonjs', { loose: true }],
],
})
} else if (process.env.BABEL_ENV === 'rollup') {
module.exports = config
} else if (process.env.NODE_ENV === 'test') {
module.exports = Object.assign({}, config, {
plugins: [
...config.plugins,
['@babel/plugin-transform-modules-commonjs', { loose: true }],
],
})
} else {
module.exports = config
}

module.exports = config
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
node_modules/
build/
dist/
styleguide/
.docz/
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ module.exports = {
'react/forbid-foreign-prop-types': 'off',

'import/prefer-default-export': 'off',
'import/no-extraneous-dependencies': 'off',

'no-return-assign': 'off',
'no-param-reassign': 'off',
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
node_modules/
build/
dist/
.docz/
.vscode/
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
node_modules/
build/
dist/
package.json
CHANGELOG.json
.docz/
83 changes: 83 additions & 0 deletions config/rollup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
import path from 'path'
import resolve from 'rollup-plugin-node-resolve'
import babel from 'rollup-plugin-babel'
import replace from 'rollup-plugin-replace'
import commonjs from 'rollup-plugin-commonjs'
import { uglify } from 'rollup-plugin-uglify'

// eslint-disable-next-line
const babelConfig = require('../../.babelrc')

export const getRollupConfig = ({ pkg, pwd, buildName }) => {
const SOURCE_DIR = path.resolve(pwd, 'src')
const DIST_DIR = path.resolve(pwd, 'dist')

const baseConfig = {
input: `${SOURCE_DIR}/index.js`,
plugins: [babel({ exclude: '**/node_modules/**', ...babelConfig })],
}

const esConfig = Object.assign({}, baseConfig, {
output: {
file: `${DIST_DIR}/${buildName}.es.js`,
format: 'es',
},
external: [
...Object.keys(pkg.peerDependencies),
...Object.keys(pkg.dependencies),
'react-transition-group/Transition',
],
})

const cjsConfig = Object.assign({}, esConfig, {
output: {
file: `${DIST_DIR}/${buildName}.cjs.js`,
format: 'cjs',
},
})

const globals = {
classnames: 'classNames',
polished: 'polished',
'prop-types': 'PropTypes',
'emotion-theming': 'emotionTheming',
react: 'React',
'react-dom': 'ReactDom',
'react-emotion': 'reactEmotion',
'styled-components': 'styled',
}

const umdConfig = Object.assign({}, baseConfig, {
output: {
name: 'smoothUI',
file: `${DIST_DIR}/${buildName}.js`,
format: 'umd',
globals,
exports: 'named',
sourcemap: true,
},
external: Object.keys(globals),
plugins: [...baseConfig.plugins, resolve({ browser: true }), commonjs()],
})

const minConfig = Object.assign({}, umdConfig, {
output: {
...umdConfig.output,
file: `${DIST_DIR}/${buildName}.min.js`,
},
plugins: [
...umdConfig.plugins,
replace({ 'process.env.NODE_ENV': JSON.stringify('production') }),
uglify({
compress: {
pure_getters: true,
unsafe: true,
unsafe_comps: true,
warnings: false,
},
}),
],
})

return [esConfig, cjsConfig, umdConfig, minConfig]
}
2 changes: 1 addition & 1 deletion docs/GettingStarted.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Getting Started
---

import { Playground } from 'docz'
import { Button } from '@smooth-ui'
import { Button } from '@smooth-ui/core-sc'

# Getting Started

Expand Down
2 changes: 1 addition & 1 deletion docs/Home.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ route: /
order: -1
---

import { Box } from '@smooth-ui'
import { Box } from '@smooth-ui/core-sc'

<Box mx="auto" mt={{ sm: 3, md: 5 }} width={500} maxWidth={1}>
<img alt="Smooth UI" src="https://raw.githubusercontent.com/smooth-code/smooth-ui/master/resources/smooth-ui-logo.png" width="100%" />
Expand Down
2 changes: 1 addition & 1 deletion docs/advanced/AddVariant.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ menu: 2. Advanced
---

import { Playground } from 'docz'
import { theme as defaultTheme, ThemeProvider, Button } from '@smooth-ui'
import { theme as defaultTheme, ThemeProvider, Button } from '@smooth-ui/core-sc'

# Add variants

Expand Down
2 changes: 1 addition & 1 deletion docs/advanced/CustomComponent.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ menu: 2. Advanced
---

import { Playground } from 'docz'
import { Button, Alert } from '@smooth-ui'
import { Button, Alert } from '@smooth-ui/core-sc'

# Custom component

Expand Down
2 changes: 1 addition & 1 deletion docs/advanced/ExtendStyles.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ menu: 2. Advanced
---

import { Playground } from 'docz'
import { Button, Switch } from '@smooth-ui'
import { Button, Switch } from '@smooth-ui/core-sc'

# Extend Styles

Expand Down
2 changes: 1 addition & 1 deletion docs/basics/Forms.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ order: 2
---

import { Playground } from 'docz'
import { ControlFeedback, FormGroup, Label, Input } from '@smooth-ui'
import { ControlFeedback, FormGroup, Label, Input } from '@smooth-ui/core-sc'

# Forms

Expand Down
2 changes: 1 addition & 1 deletion docs/basics/Grid.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ order: 1
---

import { Playground } from 'docz'
import { Row, Col, Grid } from '@smooth-ui'
import { Row, Col, Grid } from '@smooth-ui/core-sc'

# Grid

Expand Down
2 changes: 1 addition & 1 deletion docs/basics/System.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ order: 4
---

import { Playground } from 'docz'
import { Box } from '@smooth-ui'
import { Box } from '@smooth-ui/core-sc'

# System

Expand Down
2 changes: 1 addition & 1 deletion docs/basics/Theming.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ order: 3
---

import { Playground } from 'docz'
import { Button, Switch } from '@smooth-ui'
import { Button, Switch } from '@smooth-ui/core-sc'

# Theming

Expand Down
2 changes: 1 addition & 1 deletion docs/components/Alert.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ menu: 3. Components

import { PropsTable, Playground } from 'docz'
import { PropDesc, themeProp, getSystemPropDesc } from '@docs/utils'
import { Alert } from '@smooth-ui'
import { Alert } from '@smooth-ui/core-sc'

# Alert

Expand Down
2 changes: 1 addition & 1 deletion docs/components/Box.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ menu: 3. Components

import { PropsTable, Playground } from 'docz'
import { PropDesc, getSystemPropDesc } from '@docs/utils'
import { Box } from '@smooth-ui'
import { Box } from '@smooth-ui/core-sc'

# Box

Expand Down
2 changes: 1 addition & 1 deletion docs/components/Button.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ menu: 3. Components

import { PropsTable, Playground } from 'docz'
import { BlockList, PropDesc, themeProp, getSystemPropDesc } from '@docs/utils'
import { Button } from '@smooth-ui'
import { Button } from '@smooth-ui/core-sc'

# Button

Expand Down
2 changes: 1 addition & 1 deletion docs/components/Checkbox.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ menu: 3. Components

import { PropsTable, Playground } from 'docz'
import { BlockList, PropDesc, themeProp, getSystemPropDesc } from '@docs/utils'
import { Checkbox, FormCheck, FormCheckLabel } from '@smooth-ui'
import { Checkbox, FormCheck, FormCheckLabel } from '@smooth-ui/core-sc'

# Checkbox

Expand Down
2 changes: 1 addition & 1 deletion docs/components/FormCheck.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ menu: 3. Components

import { PropsTable, Playground } from 'docz'
import { PropDesc, getSystemPropDesc } from '@docs/utils'
import { Checkbox, FormCheck, FormCheckLabel } from '@smooth-ui'
import { Checkbox, FormCheck, FormCheckLabel } from '@smooth-ui/core-sc'

# FormCheck

Expand Down
2 changes: 1 addition & 1 deletion docs/components/Input.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ menu: 3. Components

import { PropsTable, Playground } from 'docz'
import { BlockList, PropDesc, getSystemPropDesc } from '@docs/utils'
import { Input } from '@smooth-ui'
import { Input } from '@smooth-ui/core-sc'

# Input

Expand Down
2 changes: 1 addition & 1 deletion docs/components/Modal.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ModalDialog } from '@smooth-ui'
import { ModalDialog } from '@smooth-ui/core-sc'

export const ModalDialogExample = ModalDialog.extend`
left: auto;
Expand Down
2 changes: 1 addition & 1 deletion docs/components/Modal.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
Typography,
Button,
Toggler,
} from '@smooth-ui'
} from '@smooth-ui/core-sc'
import { ModalDialogExample } from './Modal'

# Modal
Expand Down
2 changes: 1 addition & 1 deletion docs/components/Radio.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ menu: 3. Components

import { PropsTable, Playground } from 'docz'
import { BlockList, PropDesc, getSystemPropDesc } from '@docs/utils'
import { Radio, RadioGroup, FormCheck, FormCheckLabel } from '@smooth-ui'
import { Radio, RadioGroup, FormCheck, FormCheckLabel } from '@smooth-ui/core-sc'

# Radio

Expand Down
2 changes: 1 addition & 1 deletion docs/components/Select.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ menu: 3. Components

import { PropsTable, Playground } from 'docz'
import { BlockList, PropDesc, getSystemPropDesc } from '@docs/utils'
import { Select } from '@smooth-ui'
import { Select } from '@smooth-ui/core-sc'

# Select

Expand Down
2 changes: 1 addition & 1 deletion docs/components/Switch.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ menu: 3. Components

import { PropsTable, Playground } from 'docz'
import { PropDesc, getSystemPropDesc, BlockList } from '@docs/utils'
import { Switch, FormCheck, FormCheckLabel } from '@smooth-ui'
import { Switch, FormCheck, FormCheckLabel } from '@smooth-ui/core-sc'

# Switch

Expand Down
2 changes: 1 addition & 1 deletion docs/components/Textarea.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ menu: 3. Components

import { PropsTable, Playground } from 'docz'
import { BlockList, PropDesc, getSystemPropDesc } from '@docs/utils'
import { Textarea } from '@smooth-ui'
import { Textarea } from '@smooth-ui/core-sc'

# Textarea

Expand Down
2 changes: 1 addition & 1 deletion docs/components/Typography.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ menu: 3. Components

import { PropsTable, Playground } from 'docz'
import { PropDesc, BlockList, getSystemPropDesc } from '@docs/utils'
import { Typography } from '@smooth-ui'
import { Typography } from '@smooth-ui/core-sc'

# Typography

Expand Down
4 changes: 2 additions & 2 deletions docs/config/Wrapper.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* eslint-disable import/no-extraneous-dependencies, no-unused-expressions */
/* eslint-disable no-unused-expressions */
import React from 'react'
import { transparentize } from 'polished'
import { ThemeProvider } from 'emotion-theming'
import { theme, injectGlobal, globalStyle } from '@smooth-ui'
import { theme, injectGlobal, globalStyle } from '@smooth-ui/core-sc'

injectGlobal`
${globalStyle()}
Expand Down
2 changes: 1 addition & 1 deletion docs/utilities/Breakpoint.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ menu: 4. Utilities

import { PropsTable, Playground } from 'docz'
import { PropDesc } from '@docs/utils'
import { Button, Breakpoint } from '@smooth-ui'
import { Button, Breakpoint } from '@smooth-ui/core-sc'

# Breakpoint

Expand Down
2 changes: 1 addition & 1 deletion docs/utilities/SwitchState.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ menu: 4. Utilities

import { PropsTable, Playground } from 'docz'
import { PropDesc } from '@docs/utils'
import { Box, SwitchState, styled } from '@smooth-ui'
import { Box, SwitchState, styled } from '@smooth-ui/core-sc'

# SwitchState

Expand Down
2 changes: 1 addition & 1 deletion docs/utilities/Toggler.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ menu: 4. Utilities

import { PropsTable, Playground } from 'docz'
import { PropDesc } from '@docs/utils'
import { Button, Toggler } from '@smooth-ui'
import { Button, Toggler } from '@smooth-ui/core-sc'

# Toggler

Expand Down
2 changes: 1 addition & 1 deletion docs/utils/customPropDesc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { styles } from '@smooth-ui/core-sc'
import PropDesc from './PropDesc'
import { styles } from '@smooth-ui'

const systemProps = styles.system.meta.props

Expand Down
2 changes: 1 addition & 1 deletion docs/utils/themeProp.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { th, theme } from '@smooth-ui'
import { th, theme } from '@smooth-ui/core-sc'

const themeProp = value => th(value)({ theme })

Expand Down
Loading

0 comments on commit e9c1d5f

Please sign in to comment.