Skip to content

Commit

Permalink
refactor(checkbox): esm export refactor
Browse files Browse the repository at this point in the history
BREAKING CHANGE: import pattern
  • Loading branch information
Edward Irby committed Oct 31, 2019
1 parent 42a926a commit 6465d79
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion packages/checkbox/css.js
@@ -1 +1 @@
module.exports = require('./dist/css')
module.exports = require('./dist/cjs/css')
4 changes: 0 additions & 4 deletions packages/checkbox/index.js

This file was deleted.

11 changes: 6 additions & 5 deletions packages/checkbox/package.json
Expand Up @@ -6,12 +6,13 @@
"repository": "pluralsight/design-system",
"author": "jaketrent",
"keywords": [],
"main": "index.js",
"module": "index.js",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"scripts": {
"build": "run-s build:js build:css",
"build:css": "build-css --useGlamor",
"build:js": "babel src --root-mode upward --out-dir dist",
"build": "run-s build:js build:cjs build:css",
"build:cjs": "babel --root-mode upward src --out-dir dist/cjs",
"build:css": "build-css --useGlamor -i dist/cjs/css/index.js",
"build:js": "cross-env ESM=true babel --root-mode upward src --out-dir dist/esm",
"build:watch": "npm run build:js -- --watch",
"prepublish": "npm run build",
"storybook": "start-storybook -p 6006",
Expand Down
2 changes: 1 addition & 1 deletion packages/checkbox/react.js
@@ -1 +1 @@
module.exports = require('./dist/react')
module.exports = require('./dist/cjs/react')
2 changes: 2 additions & 0 deletions packages/checkbox/src/index.js
@@ -0,0 +1,2 @@
export { default } from './react/index.js'
export { default as css } from './css/index.js'
2 changes: 1 addition & 1 deletion packages/form/src/react/__stories__/index.story.js
Expand Up @@ -7,7 +7,7 @@ import core from '@pluralsight/ps-design-system-core'
// Form controls:
import ActionMenu from '@pluralsight/ps-design-system-actionmenu/react'
import Button from '@pluralsight/ps-design-system-button'
import Checkbox from '@pluralsight/ps-design-system-checkbox/react'
import Checkbox from '@pluralsight/ps-design-system-checkbox'
import DatePicker from '@pluralsight/ps-design-system-datepicker/react'
import Dropdown from '@pluralsight/ps-design-system-dropdown/react'
import Radio from '@pluralsight/ps-design-system-radio/react'
Expand Down
4 changes: 2 additions & 2 deletions packages/site/pages/components/checkbox.js
@@ -1,4 +1,4 @@
import Checkbox from '@pluralsight/ps-design-system-checkbox/react.js'
import Checkbox from '@pluralsight/ps-design-system-checkbox'
import core from '@pluralsight/ps-design-system-core'
import React from 'react'
import * as Text from '@pluralsight/ps-design-system-text/react.js'
Expand Down Expand Up @@ -159,7 +159,7 @@ export default _ => (

<P>Include a React component in your project:</P>
<Code language="javascript">
import Checkbox from '@pluralsight/ps-design-system-checkbox/react'
import Checkbox from '@pluralsight/ps-design-system-checkbox'
</Code>

<PropTypes
Expand Down
2 changes: 1 addition & 1 deletion packages/site/pages/components/form.js
@@ -1,7 +1,7 @@
import ActionMenu from '@pluralsight/ps-design-system-actionmenu/react.js'
import Banner from '@pluralsight/ps-design-system-banner/react.js'
import Button from '@pluralsight/ps-design-system-button'
import Checkbox from '@pluralsight/ps-design-system-checkbox/react.js'
import Checkbox from '@pluralsight/ps-design-system-checkbox'
import core from '@pluralsight/ps-design-system-core'
import DatePicker from '@pluralsight/ps-design-system-datepicker/react.js'
import Dropdown from '@pluralsight/ps-design-system-dropdown/react.js'
Expand Down

0 comments on commit 6465d79

Please sign in to comment.