Skip to content

Commit

Permalink
Removed node_modules from NPM builds, except for -examples module. Up…
Browse files Browse the repository at this point in the history
…dated docs.
  • Loading branch information
texodus committed Apr 24, 2018
1 parent 04fefcc commit 12aa025
Show file tree
Hide file tree
Showing 17 changed files with 63 additions and 23 deletions.
12 changes: 2 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,14 +236,6 @@ As a component, `perspective-viewer` provides a complete graphical UI for
configuring the `perspective` library and formatting its output to the
provided visualization plugins.

The `perspective-viewer` widget is packaged as a Web Component, and you'll need
the [webcomponents.js polyfill](https://www.webcomponents.org/polyfills)
imported first in order to use it - e.g., from a CDN:

```html
<script src='https://cdnjs.cloudflare.com/ajax/libs/webcomponentsjs/0.7.24/webcomponents.min.js'></script>
```

If you are using babel or another build environment which supports ES6 modules,
you need only import the `perspective-viewer` libraries somewhere in your
application - these modules export nothing, but rather register the components
Expand All @@ -255,8 +247,8 @@ import "@jpmorganchase/perspective-viewer-hypergrid";
import "@jpmorganchase/perspective-viewer-highcharts";
```

Alternatively, you can just import the pre-bundled assets from the relevant NPM
packages' `build/` directories:
Alternatively, you can just import the pre-bundled assets from the `perspective-examples`
module's `build/` directory:

```html
<script src="perspective.view.js"></script>
Expand Down
7 changes: 6 additions & 1 deletion packages/perspective-examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@
"access": "public"
},
"scripts": {
"start": "npm run copy",
"start": "npm run copy && npm run build",
"build": "npm-run-all -l -p build:*",
"build:view": "webpack --config src/config/view.config.js",
"build:hypergrid": "webpack --config src/config/hypergrid.config.js",
"build:highcharts": "webpack --config src/config/highcharts.config.js",
"compile_test": "npm run copy",
"copy": "mkdir -p build && cp -r node_modules/@jpmorganchase/perspective/build/* build && cp -r node_modules/@jpmorganchase/perspective-viewer/build/* build && cp -r node_modules/@jpmorganchase/perspective-viewer-hypergrid/build/* build && cp -r node_modules/@jpmorganchase/perspective-viewer-highcharts/build/* build && cp src/html/* build && cp src/json/* build && cp src/csv/* build && cp src/css/* build && cp src/js/* build",
"host": "http-server build/",
Expand All @@ -37,6 +41,7 @@
"ws": "^3.3.2"
},
"devDependencies": {
"npm-run-all": "^4.1.2",
"http-server": "^0.10.0"
}
}
12 changes: 12 additions & 0 deletions packages/perspective-examples/src/config/highcharts.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const path = require('path');
const common = require('@jpmorganchase/perspective/src/config/common.config.js');

module.exports = Object.assign({}, common(), {
entry: './src/js/highcharts.js',
output: {
filename: 'highcharts.plugin.js',
library: "perspective-view-highcharts",
libraryTarget: "umd",
path: path.resolve(__dirname, '../../build')
}
});
12 changes: 12 additions & 0 deletions packages/perspective-examples/src/config/hypergrid.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const path = require('path');
const common = require('@jpmorganchase/perspective/src/config/common.config.js');

module.exports = Object.assign({}, common(), {
entry: './src/js/hypergrid.js',
output: {
filename: 'hypergrid.plugin.js',
library: "perspective-view-hypergrid",
libraryTarget: "umd",
path: path.resolve(__dirname, '../../build')
}
});
12 changes: 12 additions & 0 deletions packages/perspective-examples/src/config/view.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const path = require('path');
const common = require('@jpmorganchase/perspective/src/config/common.config.js');

module.exports = Object.assign({}, common(), {
entry: './src/js/view.js',
output: {
filename: 'perspective.view.js',
library: "perspective-view",
libraryTarget: "umd",
path: path.resolve(__dirname, '../../build')
}
});
1 change: 1 addition & 0 deletions packages/perspective-examples/src/js/highcharts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import "@jpmorganchase/perspective-viewer-highcharts";
1 change: 1 addition & 0 deletions packages/perspective-examples/src/js/hypergrid.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import "@jpmorganchase/perspective-viewer-hypergrid";
1 change: 1 addition & 0 deletions packages/perspective-examples/src/js/view.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import "@jpmorganchase/perspective-viewer";
4 changes: 2 additions & 2 deletions packages/perspective-viewer-highcharts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@
"license": "Apache",
"dependencies": {
"babel-runtime": "^6.26.0",
"@jpmorganchase/perspective": "^0.1.8",
"@jpmorganchase/perspective-viewer": "^0.1.8",
"chroma-js": "^1.3.4",
"gradient-parser": "0.1.5",
"highcharts": "6.0.7",
"highcharts-grouped-categories": "1.1.2",
"highcharts-more": "^0.1.2"
},
"devDependencies": {
"@jpmorganchase/perspective": "^0.1.8",
"@jpmorganchase/perspective-viewer": "^0.1.8",
"babel-plugin-transform-custom-element-classes": "^0.1.0",
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const common = require('@jpmorganchase/perspective/src/config/common.config.js')

module.exports = Object.assign({}, common(), {
entry: './src/js/highcharts.js',
externals: [/^[a-z0-9\@].*$/],
output: {
filename: 'highcharts.plugin.js',
library: "perspective-view-highcharts",
Expand Down
5 changes: 2 additions & 3 deletions packages/perspective-viewer-hypergrid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,12 @@
"babel-polyfill": "^6.26.0",
"babel-runtime": "^6.26.0",
"fin-hypergrid": "2.0.2",
"@jpmorganchase/perspective": "^0.1.8",
"@jpmorganchase/perspective-viewer": "^0.1.8",
"underscore": "^1.8.3"
},
"devDependencies": {
"@jpmorganchase/perspective": "^0.1.8",
"@jpmorganchase/perspective-viewer": "^0.1.8",
"babel-plugin-transform-custom-element-classes": "^0.1.0",
"babel-polyfill": "^6.26.0",
"babel-core": "^6.26.0",
"babel-jest": "^22.0.4",
"babel-loader": "^7.1.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const common = require('@jpmorganchase/perspective/src/config/common.config.js')

module.exports = Object.assign({}, common(), {
entry: './src/js/hypergrid.js',
externals: [/^[a-z0-9\@].*$/],
output: {
filename: 'hypergrid.plugin.js',
library: "perspective-view-hypergrid",
Expand Down
3 changes: 1 addition & 2 deletions packages/perspective-viewer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,14 @@
"@webcomponents/webcomponentsjs": "~1.2.0",
"babel-polyfill": "^6.26.0",
"babel-runtime": "^6.26.0",
"bluebird": "^3.5.1",
"d3-array": "^1.2.1",
"awesomplete": "^1.1.2",
"mobile-drag-drop": "^2.2.0",
"underscore": "^1.8.3"
},
"devDependencies": {
"babel-plugin-transform-custom-element-classes": "^0.1.0",
"babel-polyfill": "^6.26.0",
"awesomplete": "^1.1.2",
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-plugin-transform-es2015-for-of": "^6.23.0",
Expand Down
1 change: 1 addition & 0 deletions packages/perspective-viewer/src/config/view.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const common = require('@jpmorganchase/perspective/src/config/common.config.js')

module.exports = Object.assign({}, common(), {
entry: './src/js/view.js',
externals: [/^[a-z0-9\@].*$/],
output: {
filename: 'perspective.view.js',
library: "perspective-view",
Expand Down
3 changes: 1 addition & 2 deletions packages/perspective/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,11 @@
"underscore": "^1.8.3"
},
"devDependencies": {
"babel-plugin-transform-custom-element-classes": "^0.1.0",
"@apache-arrow/es5-esm": "^0.2.0",
"@jpmorganchase/perspective-common": "^0.1.8",
"arraybuffer-loader": "^1.0.2",
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-plugin-transform-custom-element-classes": "^0.1.0",
"babel-plugin-transform-es2015-for-of": "^6.23.0",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-polyfill": "^6.26.0",
Expand Down
9 changes: 6 additions & 3 deletions packages/perspective/src/config/common.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,12 @@ module.exports = function () {
loader: "babel-loader",
options: {
presets: ['env'],
plugins: ["transform-custom-element-classes", 'transform-runtime', 'transform-object-rest-spread', ["transform-es2015-for-of", {
"loose": true
}]]
plugins: [
"transform-custom-element-classes",
'transform-runtime',
'transform-object-rest-spread',
["transform-es2015-for-of", {"loose": true}]
]
}
}]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const common = require('./common.config.js');

module.exports = Object.assign({}, common(), {
entry: './src/js/perspective.parallel.js',
externals: [/^[a-z0-9\@].*$/],
output: {
filename: 'perspective.js',
library: "perspective",
Expand Down

0 comments on commit 12aa025

Please sign in to comment.