Skip to content

Commit

Permalink
Clean JS dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
texodus committed Jan 11, 2023
1 parent f163e04 commit f7a45c0
Show file tree
Hide file tree
Showing 43 changed files with 1,548 additions and 5,435 deletions.
8 changes: 4 additions & 4 deletions cpp/perspective/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
],
"scripts": {
"build": "node ../../scripts/run_emsdk.js node ./build.js",
"clean": "rimraf dist",
"test": ":",
"test:run": ":",
"test:build": ":"
"clean": "rimraf dist"
},
"devDependencies": {
"fflate": "^0.7.4"
}
}
1 change: 0 additions & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"scripts": {
"docusaurus": "docusaurus",
"start": "docusaurus start",
"build": ":",
"docs": "docusaurus build",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy",
Expand Down
2 changes: 2 additions & 0 deletions examples/blocks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
"@finos/perspective-viewer": "^1.9.0",
"@finos/perspective-viewer-d3fc": "^1.9.0",
"@finos/perspective-viewer-datagrid": "^1.9.0",
"@finos/perspective-viewer-openlayers": "^1.9.0",
"@finos/perspective-workspace": "^1.9.0",
"superstore-arrow": "1.0.0"
}
}
1 change: 1 addition & 0 deletions examples/esbuild-example/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ async function build() {
outdir: "dist",
format: "esm",
bundle: true,
target: "es2020",
loader: {
".ttf": "file",
".arrow": "file",
Expand Down
5 changes: 3 additions & 2 deletions examples/esbuild-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@
"@finos/perspective-viewer": "^1.9.0",
"@finos/perspective-viewer-d3fc": "^1.9.0",
"@finos/perspective-viewer-datagrid": "^1.9.0",
"@finos/perspective-viewer-openlayers": "^1.9.0"
"@finos/perspective-viewer-openlayers": "^1.9.0",
"superstore-arrow": "^1.0.0"
},
"devDependencies": {
"@finos/perspective-esbuild-plugin": "^1.9.0",
"esbuild": "^0.13.12",
"esbuild": "^0.14.54",
"http-server": "^0.11.1"
}
}
8 changes: 0 additions & 8 deletions examples/promo/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,6 @@ module.exports = {
test: /\.css$/,
use: [{ loader: "style-loader" }, { loader: "css-loader" }],
},
{
test: /\.less$/,
use: [
{ loader: "style-loader" },
{ loader: "css-loader" },
{ loader: "less-loader" },
],
},
{
test: /\.(png|jpe?g|gif)$/i,
type: "asset/resource",
Expand Down
10 changes: 5 additions & 5 deletions examples/react/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "react",
"name": "example-react",
"private": true,
"version": "1.9.0",
"description": "An example app built using `@finos/perspective-viewer`.",
Expand All @@ -14,13 +14,13 @@
"@finos/perspective-viewer": "^1.9.0",
"@finos/perspective-viewer-d3fc": "^1.9.0",
"@finos/perspective-viewer-datagrid": "^1.9.0",
"react": "16.8.6",
"react-dom": "16.8.6"
"react": "^16.14.0",
"react-dom": "^16.9.17"
},
"devDependencies": {
"@finos/perspective-webpack-plugin": "^1.9.0",
"@types/react": "^16.8.6",
"@types/react-dom": "^16.9.4",
"@types/react": "^16.14.0",
"@types/react-dom": "^16.9.17",
"source-map-loader": "^0.2.4",
"ts-loader": "^6.2.1"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/webpack-cross-origin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
"style-loader": "^0.18.2",
"webpack": "^5.14.0",
"webpack-cli": "^4.3.1",
"webpack-dev-server": "^3.11.2"
"webpack-dev-server": "^4.11.1"
}
}
2 changes: 1 addition & 1 deletion examples/webpack-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
"style-loader": "^0.18.2",
"webpack": "^5.14.0",
"webpack-cli": "^4.3.1",
"webpack-dev-server": "^3.11.2"
"webpack-dev-server": "^4.11.1"
}
}
8 changes: 4 additions & 4 deletions examples/webpack-example/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ const worker = perspective.shared_worker();

// superstore.arrow located in node_modules/superstore-arrow/ and it's
// configured by 'devServer' in 'webpack.config.js'
// const req = fetch("./superstore.arrow");
const req = fetch("./superstore.arrow");

window.addEventListener("DOMContentLoaded", async () => {
const viewer = document.createElement("perspective-viewer");
document.body.append(viewer);

// const resp = await req;
// const buffer = await resp.arrayBuffer();
const table = worker.table({ x: [1, 2, 3, 4, 5] });
const resp = await req;
const buffer = await resp.arrayBuffer();
const table = worker.table(buffer);

viewer.load(table);

Expand Down
2 changes: 1 addition & 1 deletion examples/webpack-example/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ module.exports = {
entrypoints: false,
},
devServer: {
contentBase: [
static: [
path.join(__dirname, "dist"),
path.join(__dirname, "../../node_modules/superstore-arrow"),
],
Expand Down
69 changes: 21 additions & 48 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"type": "git",
"url": "https://github.com/finos/perspective"
},
"version": "1.9.0",
"changelog": {
"labels": {
"enhancement": "Added",
Expand All @@ -29,82 +30,54 @@
"packages/perspective-jupyterlab",
"packages/perspective-webpack-plugin",
"packages/perspective-cli",
"examples/blocks",
"examples/*",
"docs",
"python/perspective"
],
"devDependencies": {
"@types/ws": "^7.2.2",
"arraybuffer-loader": "^1.0.2",
"auto-changelog": "^2.4.0",
"chalk": "^2.4.2",
"cpy-cli": "^3.1.1",
"css-loader": "^0.28.7",
"cssnano": "^4.1.10",
"cssnano-preset-lite": "^1.0.1",
"cpy-cli": "^4.2.0",
"css-loader": "^6.7.3",
"decompress": "^4.2.1",
"decompress-unzip": "^4.0.1",
"dotenv": "^8.1.0",
"esbuild": "^0.13.12",
"esbuild-plugin-less": "^1.1.5",
"esbuild": "^0.14.54",
"esbuild-plugin-less": "^1.1.11",
"fs-extra": "^8.1.0",
"html-loader": "^0.5.1",
"glob": "^7.2.0",
"html-loader-jest": "^0.2.1",
"html-webpack-plugin": "^5.1.0",
"husky": "^7.0.4",
"inquirer": "^7.0.0",
"jest": "^29.3.1",
"jest": "^25.1.0",
"jest-junit": "^10.0.0",
"jsdoc": "3.5.5",
"jsdoc-babel": "^0.5.0",
"jsdoc-to-markdown": "^4.0.1",
"less": "^4.1.0",
"jsdoc-to-markdown": "^8.0.0",
"less": "^4.1.3",
"less-loader": "^7.2.1",
"mini-css-extract-plugin": "^1.3.4",
"minimatch": "^5.1.2",
"minimist": "^1.2.0",
"mkdirp": "^0.5.1",
"npm-pack-here": "^1.2.0",
"npm-run-all": "^4.1.3",
"octokit": "^1.7.2",
"postcss": "^8",
"postcss-loader": "^7",
"prettier": "^2.7.1",
"puppeteer": "^13.1.3",
"rimraf": "^2.6.2",
"sinon": "^7.3.1",
"style-loader": "^0.18.2",
"style-loader": "^3.3.1",
"term-img": "^4.1.0",
"timezone-mock": "^1.3.6",
"tiny-glob": "^0.2.9",
"ts-loader": "^6.2.0",
"typedoc": "^0.22.7",
"typedoc-plugin-markdown": "^3.11.6",
"typedoc-plugin-no-inherit": "^1.3.1",
"typescript": "4.3.3",
"webfontloader": "^1.6.28",
"typedoc": "^0.23.0",
"typedoc-plugin-markdown": "^3.14.0",
"typedoc-plugin-no-inherit": "^1.4.0",
"typescript": "4.9.4",
"webpack": "^5.60.0",
"webpack-cli": "^4.3.1",
"webpack-dev-server": "^3.11.2",
"worker-loader": "^3.0.7"
},
"resolutions": {
"graceful-fs": "^4.2.4",
"jest": "^25.1.0",
"write-file-atomic": "3.0.0",
"postcss": "^8",
"webpack": "^5.60.0",
"react": "16.8.6",
"react-dom": "16.8.6",
"npm-packlist": "1.1.12",
"@lumino/algorithm": "^1.9.1",
"@lumino/commands": "^1.20.0",
"@lumino/coreutils": "^1.12.0",
"@lumino/disposable": "^1.10.1",
"@lumino/domutils": "^1.8.1",
"@lumino/dragdrop": "^1.14.0",
"@lumino/keyboard": "^1.8.1",
"@lumino/messaging": "^1.10.1",
"@lumino/properties": "^1.8.1",
"@lumino/signaling": "^1.10.1",
"@lumino/virtualdom": "^1.14.1"
"webpack-dev-server": "^4.11.1"
},
"scripts": {
"postinstall": "node scripts/install_emsdk.js",
Expand All @@ -130,7 +103,7 @@
"test_js": "node scripts/test_js.js",
"test_python": "node scripts/test_python.js",
"clean": "node scripts/clean.js",
"start": "lerna run start --stream --scope",
"start": "npm run start --workspace",
"prepush": "npm-run-all lint_js lint_python",
"prepare": "husky install",
"lint_js": "npm-run-all lint:*",
Expand All @@ -145,7 +118,7 @@
"fix:json": "prettier --write packages/**/package.json rust/**/package.json examples/**/package.json docs/package.json",
"fix:python": "node scripts/lint_python.js --fix",
"fix": "npm-run-all --silent fix:*",
"version": "python3 python/perspective/scripts/write_version.py && git add python/perspective/perspective/core/_version.py && node scripts/version.js",
"version": "node scripts/version.js && python3 python/perspective/scripts/write_version.py && git add python/perspective/perspective/core/_version.py",
"jlab_link": "node scripts/jlab_link.js",
"repl": "node scripts/repl.js"
}
Expand Down
1 change: 0 additions & 1 deletion packages/perspective-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
],
"typings": "index.d.ts",
"scripts": {
"build": ":",
"clean": "rimraf build",
"test:run": "jest --rootDir=. --config=../../tools/perspective-test/jest.config.js --color",
"test": "npm-run-all test:build test:run"
Expand Down
5 changes: 0 additions & 5 deletions packages/perspective-esbuild-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@
"*.js",
"README.md"
],
"scripts": {
"build": "echo",
"test": "echo",
"clean": "echo"
},
"repository": {
"type": "git",
"url": "https://github.com/finos/perspective/packages/perspective-build"
Expand Down
9 changes: 6 additions & 3 deletions packages/perspective-esbuild-plugin/umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ const get_banner = ({ globalName }) => ({
if (typeof define === 'function' && define.amd) {
define(['exports'], factory);
} else if (typeof exports === 'object' && typeof exports.nodeName !== 'string') {
factory(exports);
factory(exports, module);
} else {
factory((root.${globalName} = {}));
const exports = (root.${globalName} = {});
const module = {exports}
factory(exports, module);
root.${globalName} = module.exports;
}
}(typeof self !== 'undefined' ? self : this, function (exports) {
}(typeof self !== 'undefined' ? self : this, function (exports, module) {
`.trimStart(),
});

Expand Down
39 changes: 24 additions & 15 deletions packages/perspective-esbuild-plugin/wasm.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,37 @@
const fs = require("fs");
const path = require("path");

exports.WasmPlugin = function WasmPlugin(inline) {
function setup(build) {
build.onResolve(
{ filter: /^\@finos\/perspective.+?\.wasm$/ },
(args) => {
if (
args.namespace === "wasm-stub" ||
args.namespace === "wasm-inline"
) {
return {
path: args.path,
namespace: "wasm",
};
}
build.onResolve({ filter: /\.wasm$/ }, (args) => {
if (
args.namespace === "wasm-stub" ||
args.namespace === "wasm-inline"
) {
const entryPoint = path.join(
args.pluginData.resolveDir,
args.path
);

return {
path: args.path,
namespace: inline ? "wasm-inline" : "wasm-stub",
path: entryPoint,
namespace: "wasm",
};
}
);

return {
path: args.path,
namespace: inline ? "wasm-inline" : "wasm-stub",
pluginData: {
resolveDir: args.resolveDir,
},
};
});

build.onLoad(
{ filter: /.*/, namespace: "wasm-inline" },
async (args) => ({
pluginData: args.pluginData,
contents: `
import wasm from ${JSON.stringify(args.path)};
export default Promise.resolve(wasm);
Expand All @@ -35,6 +42,7 @@ exports.WasmPlugin = function WasmPlugin(inline) {
build.onLoad(
{ filter: /.*/, namespace: "wasm-stub" },
async (args) => ({
pluginData: args.pluginData,
contents: `
import wasm from ${JSON.stringify(args.path)};
async function get_wasm() {
Expand All @@ -50,6 +58,7 @@ exports.WasmPlugin = function WasmPlugin(inline) {
const path = require.resolve(args.path);
const contents = await fs.promises.readFile(path);
return {
pluginData: args.pluginData,
contents,
loader: inline ? "binary" : "file",
};
Expand Down
Loading

0 comments on commit f7a45c0

Please sign in to comment.