Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
texodus committed Aug 16, 2018
1 parent ffd326c commit 99facdf
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 7 deletions.
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"rimraf": "^2.6.2"
},
"scripts": {
"build,test": "npm run --silent build && npm run --silent test",
"build,test,bench": "npm run --silent build && npm run --silent test && npm run --silent bench",
"build,bench": "npm run --silent build && npm run --silent bench",
"build": "bash -c '[[ -z \"${PSP_DOCKER}\" ]] && npm run --silent _build || npm run --silent _emsdk -- npm run --silent _build'",
"bench:build": "lerna run bench:build ${PACKAGE:+--scope=@jpmorganchase/${PACKAGE}} --stream",
"bench:run": "lerna exec ${PACKAGE:+--scope=@jpmorganchase/${PACKAGE}} -- npm run bench:run",
Expand Down
17 changes: 17 additions & 0 deletions packages/perspective-jupyterlab/src/config/plugin.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,25 @@
const path = require('path');
const common = require('@jpmorganchase/perspective/src/config/common.config.js');

const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
const webpack = require('webpack');

const plugins = [
new webpack.ContextReplacementPlugin(/moment[\/\\]locale$/, /(en|es|fr)$/)
];

if (!process.env.PSP_NO_MINIFY && !process.env.PSP_DEBUG) {
plugins.push(new UglifyJSPlugin({
sourceMap: false,
mangle: false,
output: {
ascii_only: true
}
}));
}
module.exports = Object.assign({}, common(), {
entry: './src/ts/index.ts',
plugins: plugins,
output: {
filename: 'index.js',
libraryTarget: "umd",
Expand Down
7 changes: 4 additions & 3 deletions packages/perspective/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@
],
"typings": "index.d.ts",
"scripts": {
"bench:build": "npm-run-all bench:build:*",
"bench:build": "npm-run-all -p bench:build:*",
"bench:build:benchmark": "webpack --color --config bench/config/benchmark.config.js",
"bench:build:report": "webpack --color --config bench/config/report.config.js",
"bench:build:copy": "cp bench/csv/* build",
"bench:run": "node build/benchmark.js",
"bench": "npm-run-all bench:build bench:run",
"build": "npm-run-all build:compile:* build:webpack:* ",
"build": "npm-run-all build:compile:* build:webpack",
"build:compile:copy": "mkdir -p obj build build/wasm_async build/wasm_sync build/asmjs",
"build:compile:emmake": "cd obj/ && emcmake cmake ../ && emmake make -j8",
"build:webpack": "npm-run-all -p build:webpack:*",
"build:webpack:asmjs": "webpack --color --config src/config/perspective.asmjs.config.js",
"build:webpack:wasm": "webpack --color --config src/config/perspective.wasm.config.js",
"build:webpack:parallel": "webpack --color --config src/config/perspective.parallel.config.js",
Expand All @@ -30,7 +31,7 @@
"test:build:copy": "npm-run-all -p test:build:copy:*",
"test:build:copy:html": "cp test/html/* build",
"test:build:copy:test": "cp test/csv/* build",
"test:build:webpack": "npm-run-all test:build:webpack:*",
"test:build:webpack": "npm-run-all -p test:build:webpack:*",
"test:build:webpack:browser": "webpack --color --config test/config/test_browser.config.js",
"test:build:webpack:node": "webpack --color --config test/config/test_node.config.js",
"docs": "documentation build src/js/perspective.js -f md --shallow > README.md",
Expand Down
8 changes: 4 additions & 4 deletions packages/perspective/src/cpp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ _fill_col(val dcol, t_col_sptr col, t_bool is_arrow)
} else {
for (auto i = 0; i < nrows; ++i)
{
if (dcol[i].equals(val::undefined())) continue;
if (dcol[i].isUndefined()) continue;
auto elem = dcol[i].as<T>();
col->set_nth(i, elem);
}
Expand Down Expand Up @@ -299,7 +299,7 @@ _fill_col<t_time>(val dcol, t_col_sptr col, t_bool is_arrow)
} else {
for (auto i = 0; i < nrows; ++i)
{
if (dcol[i].equals(val::undefined())) continue;
if (dcol[i].isUndefined()) continue;
auto elem = static_cast<t_int64>(dcol[i].as<t_float64>());
col->set_nth(i, elem);
}
Expand All @@ -324,7 +324,7 @@ _fill_col<t_bool>(val dcol, t_col_sptr col, t_bool is_arrow)
} else {
for (auto i = 0; i < nrows; ++i)
{
if (dcol[i].equals(val::undefined())) continue;
if (dcol[i].isUndefined()) continue;
auto elem = dcol[i].as<t_bool>();
col->set_nth(i, elem);
}
Expand Down Expand Up @@ -381,7 +381,7 @@ _fill_col<std::string>(val dcol, t_col_sptr col, t_bool is_arrow)
} else {
for (auto i = 0; i < nrows; ++i)
{
if (dcol[i].equals(val::undefined())) continue;
if (dcol[i].isUndefined()) continue;
std::wstring welem = dcol[i].as<std::wstring>();
std::wstring_convert<utf16convert_type, wchar_t> converter;
std::string elem = converter.to_bytes(welem);
Expand Down

0 comments on commit 99facdf

Please sign in to comment.