From 630b10419ee9b8d43b389ef6d63b36c316b371d5 Mon Sep 17 00:00:00 2001 From: Elise Chant Date: Wed, 19 Apr 2017 09:55:53 +1000 Subject: [PATCH] fix(build): fix component paths which were incorrect for npm (#53) --- config/webpack.config.dev.js | 5 +++- config/webpack.config.prod.js | 5 +++- index.js | 6 +--- package.json | 14 +++++++--- src/Datavizkit.js | 28 ++++++++++--------- src/components/columnWidget/columnWidget.js | 3 -- src/components/columnWidget/index.js | 1 - src/components/donutWidget/donutWidget.js | 3 -- src/components/donutWidget/index.js | 1 - src/components/lineWidget/index.js | 1 - src/components/lineWidget/lineWidget.js | 3 -- src/components/sparklineWidget/index.js | 1 - .../sparklineWidget/sparklineWidget.js | 3 -- src/components/stackedColumnWidget/index.js | 1 - .../stackedColumnWidget.js | 3 -- src/index.js | 10 +++---- yarn.lock | 26 +++++++++++------ 17 files changed, 56 insertions(+), 58 deletions(-) delete mode 100644 src/components/columnWidget/index.js delete mode 100644 src/components/donutWidget/index.js delete mode 100644 src/components/lineWidget/index.js delete mode 100644 src/components/sparklineWidget/index.js delete mode 100644 src/components/stackedColumnWidget/index.js diff --git a/config/webpack.config.dev.js b/config/webpack.config.dev.js index 7a4ccfd..b99fd01 100644 --- a/config/webpack.config.dev.js +++ b/config/webpack.config.dev.js @@ -177,7 +177,10 @@ module.exports = { }, plugins: [ new webpack.DefinePlugin({ - __DEV__: process.env.NODE_ENV || true, + 'process.env': { + NODE_ENV: JSON.stringify(process.env.NODE_ENV || 'development') + }, + __DEV__: process.env.NODE_ENV === 'development' || true }), // Makes some environment variables available in index.html. // The public URL is available as %PUBLIC_URL% in index.html, e.g.: diff --git a/config/webpack.config.prod.js b/config/webpack.config.prod.js index e29a424..ab00af9 100644 --- a/config/webpack.config.prod.js +++ b/config/webpack.config.prod.js @@ -181,7 +181,10 @@ module.exports = { }, plugins: [ new webpack.DefinePlugin({ - __DEV__: process.env.NODE_ENV || false, + 'process.env': { + NODE_ENV: JSON.stringify(process.env.NODE_ENV || 'production') + }, + __DEV__: process.env.NODE_ENV === 'development' || false, }), // Makes some environment variables available in index.html. // The public URL is available as %PUBLIC_URL% in index.html, e.g.: diff --git a/index.js b/index.js index 61f00df..dfdf9e2 100644 --- a/index.js +++ b/index.js @@ -1,5 +1 @@ -if (typeof __DEV__ !== 'undefined' && __DEV__) { - module.exports = require('./src/Datavizkit'); -} else { - module.exports = require('./lib/Datavizkit'); -} +module.exports = require('./lib/Datavizkit'); diff --git a/package.json b/package.json index fd65aae..952eec6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@gov.au/datavizkit", - "version": "0.0.10-development", + "version": "0.0.16-development", "description": "A fully featured data visualisation toolset built on top of Highcharts and React.", "keywords": [ "highcharts", @@ -13,7 +13,6 @@ "url": "git+https://github.com/govau/datavizkit.git" }, "main": "index.js", - "module": "lib/Datavizkit.js", "bugs": { "url": "https://github.com/govau/datavizkit/issues" }, @@ -24,12 +23,19 @@ "dependencies": { "highcharts": "^5.0.9", "lodash": "^4.17.4", - "react": "^15.4.2", - "react-dom": "^15.4.2", "recompose": "^0.23.1", "styled-components": "^1.4.4" }, + "peerDependencies": { + "react": "^15.5.4", + "react-dom": "^15.5.4" + }, "devDependencies": { + "recompose": "^0.23.1", + "styled-components": "^1.4.4", + "lodash": "^4.17.4", + "react": "^15.5.4", + "react-dom": "^15.5.4", "autoprefixer": "6.7.2", "babel-cli": "^6.24.1", "babel-core": "^6.24.1", diff --git a/src/Datavizkit.js b/src/Datavizkit.js index b9a9102..212b4d2 100644 --- a/src/Datavizkit.js +++ b/src/Datavizkit.js @@ -6,16 +6,18 @@ Exports the library */ -import ColumnWidget from './components/columnWidget'; -import LineWidget from './components/lineWidget'; -import SparklineWidget from './components/sparklineWidget'; -import DonutWidget from './components/donutWidget'; -import StackedColumnWidget from './components/stackedColumnWidget'; - -export { - ColumnWidget, - LineWidget, - SparklineWidget, - DonutWidget, - StackedColumnWidget -} + +import ColumnWidget from './components/columnWidget/columnWidget.js'; +export {ColumnWidget}; + +import LineWidget from './components/lineWidget/lineWidget.js'; +export {LineWidget}; + +import SparklineWidget from './components/sparklineWidget/sparklineWidget.js'; +export {SparklineWidget}; + +import DonutWidget from './components/donutWidget/donutWidget.js'; +export {DonutWidget}; + +import StackedColumnWidget from './components/stackedColumnWidget/stackedColumnWidget.js'; +export {StackedColumnWidget}; diff --git a/src/components/columnWidget/columnWidget.js b/src/components/columnWidget/columnWidget.js index e5863d9..789e8ab 100644 --- a/src/components/columnWidget/columnWidget.js +++ b/src/components/columnWidget/columnWidget.js @@ -11,9 +11,6 @@ import withColumnChart from './../withColumnChart'; const ColumnWidget = (props) => { return (
-
-
Column Widget
-
{props.children}
) diff --git a/src/components/columnWidget/index.js b/src/components/columnWidget/index.js deleted file mode 100644 index 25d6f00..0000000 --- a/src/components/columnWidget/index.js +++ /dev/null @@ -1 +0,0 @@ -export {default} from './columnWidget'; diff --git a/src/components/donutWidget/donutWidget.js b/src/components/donutWidget/donutWidget.js index 58ea95b..9ded528 100644 --- a/src/components/donutWidget/donutWidget.js +++ b/src/components/donutWidget/donutWidget.js @@ -11,9 +11,6 @@ import withDonutChart from './../withDonutChart'; const DonutWidget = (props) => { return (
-
-
Donut Widget
-
{props.children}
) diff --git a/src/components/donutWidget/index.js b/src/components/donutWidget/index.js deleted file mode 100644 index 7845b03..0000000 --- a/src/components/donutWidget/index.js +++ /dev/null @@ -1 +0,0 @@ -export {default} from './donutWidget'; diff --git a/src/components/lineWidget/index.js b/src/components/lineWidget/index.js deleted file mode 100644 index affdb10..0000000 --- a/src/components/lineWidget/index.js +++ /dev/null @@ -1 +0,0 @@ -export {default} from './lineWidget'; diff --git a/src/components/lineWidget/lineWidget.js b/src/components/lineWidget/lineWidget.js index e083bd4..139f83a 100644 --- a/src/components/lineWidget/lineWidget.js +++ b/src/components/lineWidget/lineWidget.js @@ -11,9 +11,6 @@ import withLineChart from './../withLineChart'; const LineWidget = (props) => { return (
-
-
Column Widget
-
{props.children}
) diff --git a/src/components/sparklineWidget/index.js b/src/components/sparklineWidget/index.js deleted file mode 100644 index 90666a9..0000000 --- a/src/components/sparklineWidget/index.js +++ /dev/null @@ -1 +0,0 @@ -export {default} from './sparklineWidget'; diff --git a/src/components/sparklineWidget/sparklineWidget.js b/src/components/sparklineWidget/sparklineWidget.js index b807e05..a09785a 100644 --- a/src/components/sparklineWidget/sparklineWidget.js +++ b/src/components/sparklineWidget/sparklineWidget.js @@ -11,9 +11,6 @@ import withSparklineChart from './../withSparklineChart'; const SparklineWidget = (props) => { return (
-
-
Sparkline Widget
-
{props.children}
) diff --git a/src/components/stackedColumnWidget/index.js b/src/components/stackedColumnWidget/index.js deleted file mode 100644 index cb8bf86..0000000 --- a/src/components/stackedColumnWidget/index.js +++ /dev/null @@ -1 +0,0 @@ -export {default} from './stackedColumnWidget'; diff --git a/src/components/stackedColumnWidget/stackedColumnWidget.js b/src/components/stackedColumnWidget/stackedColumnWidget.js index 1209283..31dca34 100644 --- a/src/components/stackedColumnWidget/stackedColumnWidget.js +++ b/src/components/stackedColumnWidget/stackedColumnWidget.js @@ -11,9 +11,6 @@ import withStackedColumnChart from './../withStackedColumnChart'; const StackedColumnWidget = (props) => { return (
-
-
StackedColumn Widget
-
{props.children}
) diff --git a/src/index.js b/src/index.js index e5aaf77..2c84c68 100644 --- a/src/index.js +++ b/src/index.js @@ -2,11 +2,11 @@ import React from 'react'; import {render} from 'react-dom'; -import ColumnWidget from './components/columnWidget'; -import LineWidget from './components/lineWidget'; -import StackedColumnWidget from './components/stackedColumnWidget'; -import DonutWidget from './components/donutWidget'; -import SparklineWidget from './components/sparklineWidget'; +import ColumnWidget from './components/columnWidget/columnWidget.js'; +import LineWidget from './components/lineWidget/lineWidget.js'; +import SparklineWidget from './components/sparklineWidget/sparklineWidget.js'; +import DonutWidget from './components/donutWidget/donutWidget.js'; +import StackedColumnWidget from './components/stackedColumnWidget/stackedColumnWidget.js'; render( diff --git a/yarn.lock b/yarn.lock index ca91760..c5e19af 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2590,7 +2590,7 @@ fb-watchman@^1.8.0, fb-watchman@^1.9.0: dependencies: bser "1.0.2" -fbjs@^0.8.1, fbjs@^0.8.4, fbjs@^0.8.5, fbjs@^0.8.7, fbjs@^0.8.8: +fbjs@^0.8.1, fbjs@^0.8.5, fbjs@^0.8.7, fbjs@^0.8.8, fbjs@^0.8.9: version "0.8.11" resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.11.tgz#340b590b8a2278a01ef7467c07a16da9b753db24" dependencies: @@ -5208,6 +5208,12 @@ promise@7.1.1, promise@^7.1.1: dependencies: asap "~2.0.3" +prop-types@^15.5.7, prop-types@~15.5.7: + version "15.5.8" + resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.5.8.tgz#6b7b2e141083be38c8595aa51fc55775c7199394" + dependencies: + fbjs "^0.8.9" + proto-list@~1.2.1: version "1.2.4" resolved "https://registry.yarnpkg.com/proto-list/-/proto-list-1.2.4.tgz#212d5bfe1318306a420f6402b8e26ff39647a849" @@ -5338,13 +5344,14 @@ react-docgen@^2.13.0: node-dir "^0.1.10" recast "^0.11.5" -react-dom@^15.4.2: - version "15.4.2" - resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-15.4.2.tgz#015363f05b0a1fd52ae9efdd3a0060d90695208f" +react-dom@^15.5.4: + version "15.5.4" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-15.5.4.tgz#ba0c28786fd52ed7e4f2135fe0288d462aef93da" dependencies: - fbjs "^0.8.1" + fbjs "^0.8.9" loose-envify "^1.1.0" object-assign "^4.1.0" + prop-types "~15.5.7" react-group@^1.0.3: version "1.0.3" @@ -5397,13 +5404,14 @@ react-styleguidist@^5.0.2: webpack-dev-server "^1.16.3" webpack-merge "^4.1.0" -react@^15.4.2: - version "15.4.2" - resolved "https://registry.yarnpkg.com/react/-/react-15.4.2.tgz#41f7991b26185392ba9bae96c8889e7e018397ef" +react@^15.5.4: + version "15.5.4" + resolved "https://registry.yarnpkg.com/react/-/react-15.5.4.tgz#fa83eb01506ab237cdc1c8c3b1cea8de012bf047" dependencies: - fbjs "^0.8.4" + fbjs "^0.8.9" loose-envify "^1.1.0" object-assign "^4.1.0" + prop-types "^15.5.7" read-pkg-up@^1.0.1: version "1.0.1"