From 2c49eb68ac8ae4a46f6b815d0cf4f1d21405ae2a Mon Sep 17 00:00:00 2001 From: Harry Nguyen Date: Wed, 10 Jan 2018 18:09:32 +1100 Subject: [PATCH] Update: remove extra chunk and make moment external --- .babelrc.js | 2 +- config/dist.js | 10 +++++++--- docs/components/Contributors/index.jsx | 2 +- docs/components/Example/index.jsx | 2 +- docs/components/Header/index.jsx | 2 +- docs/components/Layout/index.jsx | 2 +- docs/components/Navigation/index.jsx | 2 +- docs/components/NotePanel/index.jsx | 2 +- docs/components/SearchBar/index.jsx | 2 +- docs/components/SearchResultCard/index.jsx | 2 +- docs/examples/AccordionExample.jsx | 2 +- docs/examples/AlertExample.jsx | 2 +- docs/examples/AlertInputExample.jsx | 2 +- docs/examples/AvatarExample.jsx | 2 +- docs/examples/BorderedWellExample.jsx | 2 +- docs/examples/BreadcrumbExample.jsx | 2 +- docs/examples/ButtonExample.jsx | 2 +- docs/examples/CardExample.jsx | 2 +- docs/examples/CarouselExample.jsx | 2 +- docs/examples/CheckboxExample.jsx | 2 +- docs/examples/ConfirmModalExample.jsx | 2 +- docs/examples/DatePickerExample.jsx | 2 +- docs/examples/EmptyExample.jsx | 2 +- docs/examples/FilePickerExample.jsx | 2 +- docs/examples/FlexibleSpacerExample.jsx | 2 +- docs/examples/GridExample.jsx | 2 +- docs/examples/HelpIconPopoverExample.jsx | 2 +- docs/examples/HoverDropdownMenuExample.jsx | 2 +- docs/examples/InformationBoxExample.jsx | 2 +- docs/examples/ListPickerExample.jsx | 2 +- docs/examples/NavigationExample.jsx | 2 +- docs/examples/PageTitleExample.jsx | 2 +- docs/examples/PagedGridExample.jsx | 2 +- docs/examples/PanelExample.jsx | 2 +- docs/examples/PrettyDiffExample.jsx | 2 +- docs/examples/RadioExample.jsx | 2 +- docs/examples/SearchBarExample.jsx | 2 +- docs/examples/SearchExample.jsx | 2 +- docs/examples/SelectExample.jsx | 2 +- docs/examples/SliceyExample.jsx | 2 +- docs/examples/SpinnerExample.jsx | 2 +- docs/examples/SplitPaneExample.jsx | 2 +- docs/examples/StatisticExample.jsx | 2 +- docs/examples/SvgSymbolCircleExample.jsx | 2 +- docs/examples/SvgSymbolExample.jsx | 2 +- docs/examples/TabExample.jsx | 2 +- docs/examples/TagExample.jsx | 2 +- docs/examples/TextEllipsisExample.jsx | 2 +- docs/examples/TextareaExample.jsx | 2 +- docs/examples/TileGridExample.jsx | 2 +- docs/examples/TotalsExample.jsx | 2 +- docs/examples/TreePickerExample.jsx | 2 +- docs/examples/UserListPickerExample.jsx | 2 +- docs/examples/template.jsx | 2 +- docs/run.jsx | 11 ++++------- index.html | 5 +++++ scripts/scaffold | 2 +- src/dist-entry/extra.js | 4 ---- src/dist-entry/index.js | 5 ----- src/{dist-entry/core.js => index.js} | 4 ++++ 60 files changed, 74 insertions(+), 73 deletions(-) delete mode 100644 src/dist-entry/extra.js delete mode 100644 src/dist-entry/index.js rename src/{dist-entry/core.js => index.js} (95%) diff --git a/.babelrc.js b/.babelrc.js index db83ab01d..ea1f2e5a1 100644 --- a/.babelrc.js +++ b/.babelrc.js @@ -4,7 +4,7 @@ if (process.env.TYPE === 'development') { plugins = [...plugins, 'react-hot-loader/babel']; } -const presets = ['env', 'react']; +const presets = process.env.TYPE === 'development' ? [['env', { modules: false }], 'react'] : ['env', 'react']; module.exports = { presets, diff --git a/config/dist.js b/config/dist.js index a0ddb6a1f..be7e4222e 100644 --- a/config/dist.js +++ b/config/dist.js @@ -8,9 +8,7 @@ module.exports = () => { const buildType = process.env.TYPE || 'development'; let entries = { - main: resolve(__dirname, '../src/dist-entry'), - core: resolve(__dirname, '../src/dist-entry/core'), - extra: resolve(__dirname, '../src/dist-entry/extra'), + main: resolve(__dirname, '../src'), docs: resolve(__dirname, '../docs/run'), }; const plugins = [ @@ -79,6 +77,12 @@ module.exports = () => { commonjs: 'redux', amd: 'redux', }, + moment: { + root: 'moment', + commonjs2: 'moment', + commonjs: 'moment', + amd: 'moment', + }, }, output: { path: resolve(__dirname, '../dist'), diff --git a/docs/components/Contributors/index.jsx b/docs/components/Contributors/index.jsx index 0a79b6748..064e033f7 100644 --- a/docs/components/Contributors/index.jsx +++ b/docs/components/Contributors/index.jsx @@ -1,6 +1,6 @@ import React from 'react'; import _ from 'lodash'; -import { Avatar, Spinner, PageTitle } from '../../../src/dist-entry'; +import { Avatar, Spinner, PageTitle } from '../../../src'; import './styles.scss'; diff --git a/docs/components/Example/index.jsx b/docs/components/Example/index.jsx index a7f84b539..332ba5a35 100644 --- a/docs/components/Example/index.jsx +++ b/docs/components/Example/index.jsx @@ -4,7 +4,7 @@ import PropTypes from 'prop-types'; import SyntaxHighlighter from 'react-syntax-highlighter'; import { github } from 'react-syntax-highlighter/dist/styles'; import NotePanel from '../NotePanel'; -import { Button, Empty } from '../../../src/dist-entry'; +import { Button, Empty } from '../../../src'; import './styles.scss'; diff --git a/docs/components/Header/index.jsx b/docs/components/Header/index.jsx index cb64ca55a..3f4a6c6f3 100644 --- a/docs/components/Header/index.jsx +++ b/docs/components/Header/index.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Button, PageTitle, SvgSymbol } from '../../../src/dist-entry'; +import { Button, PageTitle, SvgSymbol } from '../../../src'; import './styles.scss'; const HeaderGraphics = () => ( diff --git a/docs/components/Layout/index.jsx b/docs/components/Layout/index.jsx index e9c456517..4444d9608 100644 --- a/docs/components/Layout/index.jsx +++ b/docs/components/Layout/index.jsx @@ -51,7 +51,7 @@ import SplitPaneExample from '../../examples/SplitPaneExample'; import HoverDropdownMenuExample from '../../examples/HoverDropdownMenuExample'; import NavigationExample from '../../examples/NavigationExample'; -import { PageTitle } from '../../../src/dist-entry'; +import { PageTitle } from '../../../src'; import './styles.scss'; import '../../examples/styles.scss'; diff --git a/docs/components/Navigation/index.jsx b/docs/components/Navigation/index.jsx index dca378681..cd53e1cb1 100644 --- a/docs/components/Navigation/index.jsx +++ b/docs/components/Navigation/index.jsx @@ -1,7 +1,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import _ from 'lodash'; -import { Accordion, Button } from '../../../src/dist-entry'; +import { Accordion, Button } from '../../../src'; import './styles.scss'; const initialOpenPanel = 'form-elements'; diff --git a/docs/components/NotePanel/index.jsx b/docs/components/NotePanel/index.jsx index 43e735720..a11c510a6 100644 --- a/docs/components/NotePanel/index.jsx +++ b/docs/components/NotePanel/index.jsx @@ -1,7 +1,7 @@ import _ from 'lodash'; import React from 'react'; import PropTypes from 'prop-types'; -import { Panel } from '../../../src/dist-entry'; +import { Panel } from '../../../src'; import './styles.scss'; diff --git a/docs/components/SearchBar/index.jsx b/docs/components/SearchBar/index.jsx index 2cfa40899..beb15adf9 100644 --- a/docs/components/SearchBar/index.jsx +++ b/docs/components/SearchBar/index.jsx @@ -1,6 +1,6 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { SearchBar } from '../../../src/dist-entry'; +import { SearchBar } from '../../../src'; import './styles.scss'; class SearchBarComponent extends React.Component { diff --git a/docs/components/SearchResultCard/index.jsx b/docs/components/SearchResultCard/index.jsx index b63aa02b6..eb8eedbdb 100644 --- a/docs/components/SearchResultCard/index.jsx +++ b/docs/components/SearchResultCard/index.jsx @@ -1,7 +1,7 @@ import _ from 'lodash'; import React from 'react'; import PropTypes from 'prop-types'; -import { Card, Button, Empty } from '../../../src/dist-entry'; +import { Card, Button, Empty } from '../../../src'; import './styles.scss'; const SearchResultCard = ({ navigateTo, clearSearch, searchResults }) => ( diff --git a/docs/examples/AccordionExample.jsx b/docs/examples/AccordionExample.jsx index 3ac743808..7f07f36a1 100644 --- a/docs/examples/AccordionExample.jsx +++ b/docs/examples/AccordionExample.jsx @@ -2,7 +2,7 @@ import React from 'react'; import _ from 'lodash'; import Immutable from 'seamless-immutable'; import Example from '../components/Example'; -import { Accordion, Checkbox } from '../../src/dist-entry'; +import { Accordion, Checkbox } from '../../src'; const initialState = { accordionPanels: [ diff --git a/docs/examples/AlertExample.jsx b/docs/examples/AlertExample.jsx index 0e4a32b5d..340568a43 100644 --- a/docs/examples/AlertExample.jsx +++ b/docs/examples/AlertExample.jsx @@ -1,6 +1,6 @@ import React from 'react'; import Example from '../components/Example'; -import { Alert } from '../../src/dist-entry'; +import { Alert } from '../../src'; class AlertExample extends React.PureComponent { render() { diff --git a/docs/examples/AlertInputExample.jsx b/docs/examples/AlertInputExample.jsx index 1b8a575df..9eb2ed4de 100644 --- a/docs/examples/AlertInputExample.jsx +++ b/docs/examples/AlertInputExample.jsx @@ -1,7 +1,7 @@ import React from 'react'; import _ from 'lodash'; import Example from '../components/Example'; -import { AlertInput } from '../../src/dist-entry'; +import { AlertInput } from '../../src'; const initialState = { impressions: null, diff --git a/docs/examples/AvatarExample.jsx b/docs/examples/AvatarExample.jsx index 9f1d48645..e2938e033 100644 --- a/docs/examples/AvatarExample.jsx +++ b/docs/examples/AvatarExample.jsx @@ -1,6 +1,6 @@ import React from 'react'; import Example from '../components/Example'; -import { Avatar } from '../../src/dist-entry'; +import { Avatar } from '../../src'; class AvatarExample extends React.PureComponent { render() { diff --git a/docs/examples/BorderedWellExample.jsx b/docs/examples/BorderedWellExample.jsx index e5e46918b..d61ca5ce3 100644 --- a/docs/examples/BorderedWellExample.jsx +++ b/docs/examples/BorderedWellExample.jsx @@ -1,6 +1,6 @@ import React from 'react'; import Example from '../components/Example'; -import { BorderedWell } from '../../src/dist-entry'; +import { BorderedWell } from '../../src'; class BorderedWellExample extends React.PureComponent { render() { diff --git a/docs/examples/BreadcrumbExample.jsx b/docs/examples/BreadcrumbExample.jsx index 81a2daded..508e1c9d4 100644 --- a/docs/examples/BreadcrumbExample.jsx +++ b/docs/examples/BreadcrumbExample.jsx @@ -1,7 +1,7 @@ import React from 'react'; import _ from 'lodash'; import Example from '../components/Example'; -import { Button, Breadcrumb } from '../../src/dist-entry'; +import { Button, Breadcrumb } from '../../src'; const initialState = { breadcrumbNodes: [ diff --git a/docs/examples/ButtonExample.jsx b/docs/examples/ButtonExample.jsx index 6d79e0cb4..a8dd7e188 100644 --- a/docs/examples/ButtonExample.jsx +++ b/docs/examples/ButtonExample.jsx @@ -1,6 +1,6 @@ import React from 'react'; import Example from '../components/Example'; -import { Button } from '../../src/dist-entry'; +import { Button } from '../../src'; class ButtonExample extends React.PureComponent { constructor(props) { diff --git a/docs/examples/CardExample.jsx b/docs/examples/CardExample.jsx index e7e1d721c..087ff1f83 100644 --- a/docs/examples/CardExample.jsx +++ b/docs/examples/CardExample.jsx @@ -1,6 +1,6 @@ import React from 'react'; import Example from '../components/Example'; -import { Card } from '../../src/dist-entry'; +import { Card } from '../../src'; class CardExample extends React.PureComponent { render() { diff --git a/docs/examples/CarouselExample.jsx b/docs/examples/CarouselExample.jsx index 32ad735af..d581253b5 100644 --- a/docs/examples/CarouselExample.jsx +++ b/docs/examples/CarouselExample.jsx @@ -1,6 +1,6 @@ import React from 'react'; import Example from '../components/Example'; -import { Carousel } from '../../src/dist-entry'; +import { Carousel } from '../../src'; class CarouselExample extends React.PureComponent { render() { diff --git a/docs/examples/CheckboxExample.jsx b/docs/examples/CheckboxExample.jsx index 172a01012..63353c6bc 100644 --- a/docs/examples/CheckboxExample.jsx +++ b/docs/examples/CheckboxExample.jsx @@ -1,6 +1,6 @@ import React from 'react'; import Example from '../components/Example'; -import { Checkbox } from '../../src/dist-entry'; +import { Checkbox } from '../../src'; class CheckboxExample extends React.PureComponent { render() { diff --git a/docs/examples/ConfirmModalExample.jsx b/docs/examples/ConfirmModalExample.jsx index a2f53b8d0..695fb073a 100644 --- a/docs/examples/ConfirmModalExample.jsx +++ b/docs/examples/ConfirmModalExample.jsx @@ -1,6 +1,6 @@ import React from 'react'; import Example from '../components/Example'; -import { Button, ConfirmModal } from '../../src/dist-entry'; +import { Button, ConfirmModal } from '../../src'; class ConfirmModalExample extends React.PureComponent { constructor() { diff --git a/docs/examples/DatePickerExample.jsx b/docs/examples/DatePickerExample.jsx index b6d3c579d..59008be01 100644 --- a/docs/examples/DatePickerExample.jsx +++ b/docs/examples/DatePickerExample.jsx @@ -1,7 +1,7 @@ import React from 'react'; import moment from 'moment'; import Example from '../components/Example'; -import { DatePicker } from '../../src/dist-entry'; +import { DatePicker } from '../../src'; class DatePickerExample extends React.Component { constructor() { diff --git a/docs/examples/EmptyExample.jsx b/docs/examples/EmptyExample.jsx index ac1e66e3b..9975d3fd1 100644 --- a/docs/examples/EmptyExample.jsx +++ b/docs/examples/EmptyExample.jsx @@ -1,6 +1,6 @@ import React from 'react'; import Example from '../components/Example'; -import { Empty } from '../../src/dist-entry'; +import { Empty } from '../../src'; class EmptyExample extends React.PureComponent { render() { diff --git a/docs/examples/FilePickerExample.jsx b/docs/examples/FilePickerExample.jsx index 4011dc521..5086491b7 100644 --- a/docs/examples/FilePickerExample.jsx +++ b/docs/examples/FilePickerExample.jsx @@ -1,7 +1,7 @@ import React from 'react'; import _ from 'lodash'; import Example from '../components/Example'; -import { FilePicker } from '../../src/dist-entry'; +import { FilePicker } from '../../src'; class FilePickerExample extends React.PureComponent { render() { diff --git a/docs/examples/FlexibleSpacerExample.jsx b/docs/examples/FlexibleSpacerExample.jsx index a2107e12c..20ee4d00c 100644 --- a/docs/examples/FlexibleSpacerExample.jsx +++ b/docs/examples/FlexibleSpacerExample.jsx @@ -1,6 +1,6 @@ import React from 'react'; import Example from '../components/Example'; -import { FlexibleSpacer } from '../../src/dist-entry'; +import { FlexibleSpacer } from '../../src'; class FlexibleSpacerExample extends React.PureComponent { render() { diff --git a/docs/examples/GridExample.jsx b/docs/examples/GridExample.jsx index 558e7cf10..1b7186fa0 100644 --- a/docs/examples/GridExample.jsx +++ b/docs/examples/GridExample.jsx @@ -1,6 +1,6 @@ import React from 'react'; import Example from '../components/Example'; -import { Grid, GridCell, GridRow } from '../../src/dist-entry'; +import { Grid, GridCell, GridRow } from '../../src'; const cellClicked = () => console.log('Cell clicked'); diff --git a/docs/examples/HelpIconPopoverExample.jsx b/docs/examples/HelpIconPopoverExample.jsx index 54d90f295..04221e0ff 100644 --- a/docs/examples/HelpIconPopoverExample.jsx +++ b/docs/examples/HelpIconPopoverExample.jsx @@ -1,6 +1,6 @@ import React from 'react'; import Example from '../components/Example'; -import { HelpIconPopover } from '../../src/dist-entry'; +import { HelpIconPopover } from '../../src'; class HelpIconPopoverExample extends React.PureComponent { render() { diff --git a/docs/examples/HoverDropdownMenuExample.jsx b/docs/examples/HoverDropdownMenuExample.jsx index 6fca11428..ba6c8e04a 100644 --- a/docs/examples/HoverDropdownMenuExample.jsx +++ b/docs/examples/HoverDropdownMenuExample.jsx @@ -1,7 +1,7 @@ import _ from 'lodash'; import React from 'react'; import Example from '../components/Example'; -import { Avatar, HoverDropdownMenu } from '../../src/dist-entry'; +import { Avatar, HoverDropdownMenu } from '../../src'; class HoverDropdownMenuExample extends React.PureComponent { render() { diff --git a/docs/examples/InformationBoxExample.jsx b/docs/examples/InformationBoxExample.jsx index 01584b91a..f2e6ccbed 100644 --- a/docs/examples/InformationBoxExample.jsx +++ b/docs/examples/InformationBoxExample.jsx @@ -1,6 +1,6 @@ import React from 'react'; import Example from '../components/Example'; -import { InformationBox } from '../../src/dist-entry'; +import { InformationBox } from '../../src'; class InformationBoxExample extends React.PureComponent { render() { diff --git a/docs/examples/ListPickerExample.jsx b/docs/examples/ListPickerExample.jsx index ed24a85ef..9acaf51f7 100644 --- a/docs/examples/ListPickerExample.jsx +++ b/docs/examples/ListPickerExample.jsx @@ -1,7 +1,7 @@ import React from 'react'; import Checkbox from 'react-icheck/lib/Checkbox'; import Example from '../components/Example'; -import { ListPicker, Button } from '../../src/dist-entry'; +import { ListPicker, Button } from '../../src'; const teamMember1 = { avatar: '//lorempixel.com/35/35/people/7', diff --git a/docs/examples/NavigationExample.jsx b/docs/examples/NavigationExample.jsx index 8961d7ca5..4c748ffd0 100644 --- a/docs/examples/NavigationExample.jsx +++ b/docs/examples/NavigationExample.jsx @@ -1,6 +1,6 @@ import React from 'react'; import Example from '../components/Example'; -import { Nav, NavItem } from '../../src/dist-entry'; +import { Nav, NavItem } from '../../src'; class NavigationExample extends React.PureComponent { constructor(props) { diff --git a/docs/examples/PageTitleExample.jsx b/docs/examples/PageTitleExample.jsx index 5e04086be..59115ca38 100644 --- a/docs/examples/PageTitleExample.jsx +++ b/docs/examples/PageTitleExample.jsx @@ -1,6 +1,6 @@ import React from 'react'; import Example from '../components/Example'; -import { PageTitle } from '../../src/dist-entry'; +import { PageTitle } from '../../src'; class PageTitleExample extends React.PureComponent { render() { diff --git a/docs/examples/PagedGridExample.jsx b/docs/examples/PagedGridExample.jsx index f0d5a23a6..2a266b91c 100644 --- a/docs/examples/PagedGridExample.jsx +++ b/docs/examples/PagedGridExample.jsx @@ -1,6 +1,6 @@ import React from 'react'; import Example from '../components/Example'; -import { PagedGrid } from '../../src/dist-entry'; +import { PagedGrid } from '../../src'; class PagedGridExample extends React.PureComponent { render() { diff --git a/docs/examples/PanelExample.jsx b/docs/examples/PanelExample.jsx index e7e899e07..69f9b7e8c 100644 --- a/docs/examples/PanelExample.jsx +++ b/docs/examples/PanelExample.jsx @@ -1,7 +1,7 @@ import React from 'react'; import _ from 'lodash'; import Example from '../components/Example'; -import { Panel } from '../../src/dist-entry'; +import { Panel } from '../../src'; class PanelExample extends React.Component { constructor() { diff --git a/docs/examples/PrettyDiffExample.jsx b/docs/examples/PrettyDiffExample.jsx index 6c7ce1dd4..ffab67783 100644 --- a/docs/examples/PrettyDiffExample.jsx +++ b/docs/examples/PrettyDiffExample.jsx @@ -1,6 +1,6 @@ import React from 'react'; import Example from '../components/Example'; -import { PrettyDiff } from '../../src/dist-entry'; +import { PrettyDiff } from '../../src'; class PrettyDiffExample extends React.PureComponent { render() { diff --git a/docs/examples/RadioExample.jsx b/docs/examples/RadioExample.jsx index d1c2da9b7..670252374 100644 --- a/docs/examples/RadioExample.jsx +++ b/docs/examples/RadioExample.jsx @@ -1,6 +1,6 @@ import React from 'react'; import Example from '../components/Example'; -import { Radio, RadioGroup } from '../../src/dist-entry'; +import { Radio, RadioGroup } from '../../src'; class RadioExample extends React.PureComponent { render() { diff --git a/docs/examples/SearchBarExample.jsx b/docs/examples/SearchBarExample.jsx index 07c0c2dd6..dff2a0faf 100644 --- a/docs/examples/SearchBarExample.jsx +++ b/docs/examples/SearchBarExample.jsx @@ -1,6 +1,6 @@ import React from 'react'; import Example from '../components/Example'; -import { SearchBar } from '../../src/dist-entry'; +import { SearchBar } from '../../src'; class SearchBarExample extends React.Component { constructor() { diff --git a/docs/examples/SearchExample.jsx b/docs/examples/SearchExample.jsx index a93fd44b1..e792282ae 100644 --- a/docs/examples/SearchExample.jsx +++ b/docs/examples/SearchExample.jsx @@ -1,6 +1,6 @@ import React from 'react'; import Example from '../components/Example'; -import { Search } from '../../src/dist-entry'; +import { Search } from '../../src'; class SearchExample extends React.Component { constructor() { diff --git a/docs/examples/SelectExample.jsx b/docs/examples/SelectExample.jsx index dd88b0569..fa8985ca7 100644 --- a/docs/examples/SelectExample.jsx +++ b/docs/examples/SelectExample.jsx @@ -1,6 +1,6 @@ import React from 'react'; import Example from '../components/Example'; -import { Select } from '../../src/dist-entry'; +import { Select } from '../../src'; class SelectExample extends React.Component { constructor() { diff --git a/docs/examples/SliceyExample.jsx b/docs/examples/SliceyExample.jsx index 6afb8abeb..e36ee7960 100644 --- a/docs/examples/SliceyExample.jsx +++ b/docs/examples/SliceyExample.jsx @@ -1,6 +1,6 @@ import React from 'react'; import Example from '../components/Example'; -import { Slicey } from '../../src/dist-entry'; +import { Slicey } from '../../src'; class SliceyExample extends React.PureComponent { render() { diff --git a/docs/examples/SpinnerExample.jsx b/docs/examples/SpinnerExample.jsx index c1f1877e8..a50939992 100644 --- a/docs/examples/SpinnerExample.jsx +++ b/docs/examples/SpinnerExample.jsx @@ -1,6 +1,6 @@ import React from 'react'; import Example from '../components/Example'; -import { Spinner } from '../../src/dist-entry'; +import { Spinner } from '../../src'; class SpinnerExample extends React.PureComponent { render() { diff --git a/docs/examples/SplitPaneExample.jsx b/docs/examples/SplitPaneExample.jsx index c1a128115..55a907adf 100644 --- a/docs/examples/SplitPaneExample.jsx +++ b/docs/examples/SplitPaneExample.jsx @@ -1,6 +1,6 @@ import React from 'react'; import Example from '../components/Example'; -import { SplitPane } from '../../src/dist-entry'; +import { SplitPane } from '../../src'; class SplitPaneExample extends React.PureComponent { render() { diff --git a/docs/examples/StatisticExample.jsx b/docs/examples/StatisticExample.jsx index 030d980bb..104dc9fd4 100644 --- a/docs/examples/StatisticExample.jsx +++ b/docs/examples/StatisticExample.jsx @@ -1,6 +1,6 @@ import React from 'react'; import Example from '../components/Example'; -import { Statistic } from '../../src/dist-entry'; +import { Statistic } from '../../src'; class StatisticExample extends React.PureComponent { render() { diff --git a/docs/examples/SvgSymbolCircleExample.jsx b/docs/examples/SvgSymbolCircleExample.jsx index 41081fe21..c1f5944fe 100644 --- a/docs/examples/SvgSymbolCircleExample.jsx +++ b/docs/examples/SvgSymbolCircleExample.jsx @@ -1,6 +1,6 @@ import React from 'react'; import Example from '../components/Example'; -import { SvgSymbolCircle } from '../../src/dist-entry'; +import { SvgSymbolCircle } from '../../src'; class SvgSymbolCircleExample extends React.PureComponent { render() { diff --git a/docs/examples/SvgSymbolExample.jsx b/docs/examples/SvgSymbolExample.jsx index c1b85b261..41fb74047 100644 --- a/docs/examples/SvgSymbolExample.jsx +++ b/docs/examples/SvgSymbolExample.jsx @@ -1,6 +1,6 @@ import React from 'react'; import Example from '../components/Example'; -import { SvgSymbol } from '../../src/dist-entry'; +import { SvgSymbol } from '../../src'; class SvgSymbolExample extends React.PureComponent { render() { diff --git a/docs/examples/TabExample.jsx b/docs/examples/TabExample.jsx index f34ea5ba9..fc365dfa3 100644 --- a/docs/examples/TabExample.jsx +++ b/docs/examples/TabExample.jsx @@ -1,6 +1,6 @@ import React from 'react'; import Example from '../components/Example'; -import { Empty, SvgSymbol, FlexibleSpacer, Tabs, Tab } from '../../src/dist-entry'; +import { Empty, SvgSymbol, FlexibleSpacer, Tabs, Tab } from '../../src'; class TabExample extends React.PureComponent { render() { diff --git a/docs/examples/TagExample.jsx b/docs/examples/TagExample.jsx index 4516b574e..8aa656acd 100644 --- a/docs/examples/TagExample.jsx +++ b/docs/examples/TagExample.jsx @@ -1,7 +1,7 @@ import _ from 'lodash'; import React from 'react'; import Example from '../components/Example'; -import { Button, Tag } from '../../src/dist-entry'; +import { Button, Tag } from '../../src'; const initialState = { tags: [ diff --git a/docs/examples/TextEllipsisExample.jsx b/docs/examples/TextEllipsisExample.jsx index 4916d1803..ce89ca00c 100644 --- a/docs/examples/TextEllipsisExample.jsx +++ b/docs/examples/TextEllipsisExample.jsx @@ -1,6 +1,6 @@ import React from 'react'; import Example from '../components/Example'; -import { TextEllipsis } from '../../src/dist-entry'; +import { TextEllipsis } from '../../src'; const loremIpsum = ` Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore diff --git a/docs/examples/TextareaExample.jsx b/docs/examples/TextareaExample.jsx index d871ef858..11f57c90f 100644 --- a/docs/examples/TextareaExample.jsx +++ b/docs/examples/TextareaExample.jsx @@ -1,6 +1,6 @@ import React from 'react'; import Example from '../components/Example'; -import { Textarea } from '../../src/dist-entry'; +import { Textarea } from '../../src'; class TextareaExample extends React.PureComponent { render() { diff --git a/docs/examples/TileGridExample.jsx b/docs/examples/TileGridExample.jsx index 88f436f84..ca4436d90 100644 --- a/docs/examples/TileGridExample.jsx +++ b/docs/examples/TileGridExample.jsx @@ -1,6 +1,6 @@ import React from 'react'; import Example from '../components/Example'; -import { TileGrid } from '../../src/dist-entry'; +import { TileGrid } from '../../src'; class TileGridExample extends React.PureComponent { constructor() { diff --git a/docs/examples/TotalsExample.jsx b/docs/examples/TotalsExample.jsx index 451a6fb63..f1fcc3554 100644 --- a/docs/examples/TotalsExample.jsx +++ b/docs/examples/TotalsExample.jsx @@ -1,6 +1,6 @@ import React from 'react'; import Example from '../components/Example'; -import { Totals } from '../../src/dist-entry'; +import { Totals } from '../../src'; class TotalsExample extends React.PureComponent { render() { diff --git a/docs/examples/TreePickerExample.jsx b/docs/examples/TreePickerExample.jsx index 69ce273ed..2a957cebd 100644 --- a/docs/examples/TreePickerExample.jsx +++ b/docs/examples/TreePickerExample.jsx @@ -1,7 +1,7 @@ import React from 'react'; import Example from '../components/Example'; import _ from 'lodash'; -import { TreePickerSimplePure } from '../../src/dist-entry'; +import { TreePickerSimplePure } from '../../src'; class TreePickerExample extends React.Component { constructor() { diff --git a/docs/examples/UserListPickerExample.jsx b/docs/examples/UserListPickerExample.jsx index 179ca7eca..6be27bc66 100644 --- a/docs/examples/UserListPickerExample.jsx +++ b/docs/examples/UserListPickerExample.jsx @@ -1,6 +1,6 @@ import React from 'react'; import Example from '../components/Example'; -import { Button, UserListPicker } from '../../src/dist-entry'; +import { Button, UserListPicker } from '../../src'; const avatarColor = () => 'cyan'; const emptySvgSymbol = { diff --git a/docs/examples/template.jsx b/docs/examples/template.jsx index 1b53692d7..e2b492244 100644 --- a/docs/examples/template.jsx +++ b/docs/examples/template.jsx @@ -1,6 +1,6 @@ import React from 'react'; import Example from '../components/Example'; -import { xxx } from '../../src/dist-entry'; +import { xxx } from '../../src'; class xxxExample extends React.PureComponent { render() { diff --git a/docs/run.jsx b/docs/run.jsx index c0ce5061b..7a2f39fdd 100644 --- a/docs/run.jsx +++ b/docs/run.jsx @@ -1,9 +1,9 @@ import React from 'react'; import ReactDOM from 'react-dom'; import { AppContainer } from 'react-hot-loader'; -import Layout from './components/Layout'; +import App from './components/Layout'; -const renderApp = App => { +const renderApp = () => { ReactDOM.render( @@ -12,11 +12,8 @@ const renderApp = App => { ); }; -renderApp(Layout); +renderApp(); if (module.hot) { - module.hot.accept('./components/Layout', () => { - const NextLayout = require('./components/Layout').default; // eslint-disable-line - renderApp(NextLayout); - }); + module.hot.accept('./components/Layout', renderApp); } diff --git a/index.html b/index.html index a3d420e29..ea2149882 100644 --- a/index.html +++ b/index.html @@ -29,6 +29,11 @@ integrity="sha256-8E6QUcFg1KTnpEU8TFGhpTGHw5fJqB9vCms3OhAYLqw=" crossorigin="anonymous" > + diff --git a/scripts/scaffold b/scripts/scaffold index 263032530..e155f95ad 100755 --- a/scripts/scaffold +++ b/scripts/scaffold @@ -15,4 +15,4 @@ cp ./docs/examples/template.jsx ./docs/examples/"${1}Example.jsx" sed -i '.bak' "s/xxx/$1/g" docs/examples/"$1"Example.jsx && rm -f docs/examples/"$1"Example.jsx.bak; sed -i '.bak' "s/xxx/$1/g" src/components/adslot-ui/"$1"/* && rm -f src/components/adslot-ui/"$1"/*.bak; sed -i '.bak' "s/x-x-x/$(sed -e 's/\([A-Z]\)/-\1/g' -e 's/^-//' <<< $1 | tr '[:upper:]' '[:lower:]')/g" src/components/adslot-ui/"$1"/* && rm -f src/components/adslot-ui/"$1"/*.bak; -echo "✓ Generated '${1}'. Don't forget to add your new component to src/dist-entry/core.js" && exit 0; +echo "✓ Generated '${1}'. Don't forget to add your new component to src/index.js" && exit 0; diff --git a/src/dist-entry/extra.js b/src/dist-entry/extra.js deleted file mode 100644 index 70c33937b..000000000 --- a/src/dist-entry/extra.js +++ /dev/null @@ -1,4 +0,0 @@ -import 'styles/_react-datepicker-custom.scss'; -import DatePicker from 'react-datepicker/dist/react-datepicker'; - -export { DatePicker }; // eslint-disable-line import/prefer-default-export diff --git a/src/dist-entry/index.js b/src/dist-entry/index.js deleted file mode 100644 index 283389773..000000000 --- a/src/dist-entry/index.js +++ /dev/null @@ -1,5 +0,0 @@ -// Webpack chunk entry file for distribution -import _ from 'lodash'; - -// es6 "import * from" is not used for upsetting coverage because of unknown reason -module.exports = _.assign(require('./core'), require('./extra')); diff --git a/src/dist-entry/core.js b/src/index.js similarity index 95% rename from src/dist-entry/core.js rename to src/index.js index bb60b682f..249c941b3 100644 --- a/src/dist-entry/core.js +++ b/src/index.js @@ -4,6 +4,8 @@ import Radio from 'react-icheck/lib/Radio'; import RadioGroup from 'react-icheck/lib/RadioGroup'; import Select from 'react-select'; +import DatePicker from 'react-datepicker'; + // React Bootstrap import { Button } from 'third-party'; @@ -20,6 +22,7 @@ import NavItem from 'react-bootstrap/lib/NavItem'; import 'styles/_bootstrap-custom.scss'; import 'styles/_icheck-custom.scss'; +import 'styles/_react-datepicker-custom.scss'; import 'styles/_react-select-custom.scss'; import { @@ -86,6 +89,7 @@ export { Checkbox, ConfirmModal, Dropdown, + DatePicker, Empty, fastStatelessWrapper, FilePicker,