Skip to content

Commit

Permalink
Merge pull request #4295 from GordonSmith/V3_ECLWATCH
Browse files Browse the repository at this point in the history
feat:  Upgrade eclwatch to v3
  • Loading branch information
GordonSmith authored Nov 13, 2024
2 parents 9ac09fb + a32c104 commit d8d4ae6
Show file tree
Hide file tree
Showing 17 changed files with 7,040 additions and 1,876 deletions.
8,351 changes: 6,652 additions & 1,699 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"packages/dgrid",
"packages/dgrid-shim",
"packages/dgrid2",
"xpackages/eclwatch",
"packages/eclwatch",
"packages/esbuild-plugins",
"packages/form",
"packages/graph",
Expand Down
2 changes: 1 addition & 1 deletion packages/dgrid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@
},
"dependencies": {
"@hpcc-js/common": "^3.1.0",
"@hpcc-js/ddl-shim": "^2.22.0",
"@hpcc-js/dgrid-shim": "^2.26.0",
"@hpcc-js/util": "^3.1.0"
},
"devDependencies": {
"@hpcc-js/esbuild-plugins": "^1.2.0",
"@hpcc-js/ddl-shim": "^2.22.0",
"@testing-library/dom": "10.4.0",
"d3-format": "^1",
"d3-selection": "^1"
Expand Down
47 changes: 47 additions & 0 deletions packages/eclwatch/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "test-browser",
"type": "msedge",
"request": "launch",
"url": "http://localhost:8888",
"webRoot": "${workspaceFolder}",
"outFiles": [
"${workspaceFolder}/**/*.js",
"!**/node_modules/**"
],
},
{
"name": "test-node",
"type": "node",
"request": "launch",
"runtimeArgs": [
"run-script",
"test-node"
],
"runtimeExecutable": "npm",
"skipFiles": [
"<node_internals>/**"
],
"outFiles": [
"${workspaceFolder}/**/*.js",
"!**/node_modules/**"
],
},
{
"name": "index.html",
"request": "launch",
"type": "msedge",
"url": "file:///${workspaceFolder}/index.html",
"runtimeArgs": [
"--disable-web-security"
],
"webRoot": "${workspaceFolder}",
"outFiles": [
"${workspaceFolder}/**/*.js",
"!**/node_modules/**"
]
}
]
}
25 changes: 6 additions & 19 deletions packages/eclwatch/.vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"version": "2.0.0",
"tasks": [
{
"label": "es6 watch",
"label": "gen-types-watch",
"type": "npm",
"script": "compile-es6-watch",
"script": "gen-types-watch",
"problemMatcher": [
"$tsc-watch"
],
Expand All @@ -13,18 +13,7 @@
}
},
{
"label": "umd watch",
"type": "npm",
"script": "compile-umd-watch",
"problemMatcher": [
"$tsc-watch"
],
"presentation": {
"group": "group-build"
}
},
{
"label": "bundle watch",
"label": "bundle-watch",
"type": "npm",
"script": "bundle-watch",
"problemMatcher": [],
Expand All @@ -35,15 +24,13 @@
{
"label": "build",
"dependsOn": [
"es6 watch",
"umd watch",
"bundle watch"
"gen-types-watch",
"bundle-watch",
],
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": []
}
}
]
}
29 changes: 29 additions & 0 deletions packages/eclwatch/esbuild.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { browserTpl } from "@hpcc-js/esbuild-plugins";
import pkg from "./package.json" with { type: "json" };

// config ---
await Promise.all([
browserTpl("src/index.ts", "dist/index", {
keepNames: true,
alias: {
"d3-array": "@hpcc-js/common",
"d3-brush": "@hpcc-js/common",
"d3-collection": "@hpcc-js/common",
"d3-color": "@hpcc-js/common",
"d3-dispatch": "@hpcc-js/common",
"d3-drag": "@hpcc-js/common",
"d3-dsv": "@hpcc-js/common",
"d3-ease": "@hpcc-js/common",
"d3-format": "@hpcc-js/common",
"d3-interpolate": "@hpcc-js/common",
"d3-scale": "@hpcc-js/common",
"d3-selection": "@hpcc-js/common",
"d3-time-format": "@hpcc-js/common",
"d3-transition": "@hpcc-js/common",
"d3-zoom": "@hpcc-js/common"
},
external: [
...Object.keys(pkg.dependencies),
]
})
]);
109 changes: 109 additions & 0 deletions packages/eclwatch/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
<!DOCTYPE html>
<html>

<head>
<title>Home</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #f0f0f0;
}

h1 {
text-align: center;
margin-top: 50px;
}

#placeholder {
width: 100%;
height: 500px;
background-color: #fff;
margin-top: 20px;
}
</style>
<script type="importmap">
{
"imports": {
"@observablehq/runtime": "https://cdn.jsdelivr.net/npm/@observablehq/[email protected]/dist/runtime.js",

"@hpcc-js/util": "../util/dist/index.js",
"@hpcc-js/common": "../common/dist/index.js",
"@hpcc-js/api": "../api/dist/index.js",
"@hpcc-js/chart": "../chart/dist/index.js",
"@hpcc-js/codemirror": "../codemirror/dist/index.js",
"@hpcc-js/comms": "../comms/dist/index.js",
"@hpcc-js/dgrid": "../dgrid/dist/index.js",
"@hpcc-js/react": "../react/dist/index.js",
"@hpcc-js/html": "../html/dist/index.js",
"@hpcc-js/graph": "../graph/dist/index.js",
"@hpcc-js/layout": "../layout/dist/index.js",
"@hpcc-js/eclwatch": "../eclwatch/dist/index.js",
"@hpcc-js/observablehq-compiler": "../observablehq-compiler/dist/index.js"
}
}
</script>
<link rel="stylesheet" href="./dist/index.css">
</head>

<body onresize="doResize()">
<h1>ESM Quick Test</h1>
<div id="placeholder"></div>
<script type="module">
import { Area, Column } from "@hpcc-js/chart";
import { ChartPanel } from "@hpcc-js/layout";

import "@hpcc-js/common/dist/index.css";
import "@hpcc-js/common/font-awesome/css/font-awesome.min.css";
import "@hpcc-js/chart/dist/index.css";
import "@hpcc-js/dgrid2/dist/index.css";

const simple = {
ND: {
columns: ["Subject", "Year 1", "Year 2", "Year 3", "Year 4"],
data: [
["English", 5, 43, 41, 92],
["English II", 17, 43, 83, 93],
["English III", 6, 43, 64, 93],
["Geography", 7, 45, 52, 83],
["Geography II", 16, 73, 52, 83],
["Geography III", 26, 83, 11, 72],
["Science", 66, 60, 85, 6],
["Science II", 46, 20, 53, 7],
["Science III", 46, 20, 38, 7],
["Math", 98, 30, 23, 13],
["Math II", 76, 30, 34, 6],
["Math III", 80, 30, 27, 8]
]
},
WordCloud: {
columns: ["Word", "Weight"],
words: ["Myriel", "Napoleon", "Mlle.Baptistine", "Mme.Magloire", "CountessdeLo", "Geborand", "Champtercier", "Cravatte", "Count", "OldMan", "Labarre", "Valjean", "Marguerite", "Mme.deR", "Isabeau", "Gervais", "Tholomyes", "Listolier", "Fameuil", "Blacheville", "Favourite", "Dahlia", "Zephine", "Fantine", "Mme.Thenardier", "Thenardier", "Cosette", "Javert", "Fauchelevent", "Bamatabois", "Perpetue", "Simplice", "Scaufflaire", "Woman1", "Judge", "Champmathieu", "Brevet", "Chenildieu", "Cochepaille", "Pontmercy", "Boulatruelle", "Eponine", "Anzelma", "Woman2", "MotherInnocent", "Gribier", "Jondrette", "Mme.Burgon", "Gavroche", "Gillenormand", "Magnon", "Mlle.Gillenormand", "Mme.Pontmercy", "Mlle.Vaubois", "Lt.Gillenormand", "Marius", "BaronessT", "Mabeuf", "Enjolras", "Combeferre", "Prouvaire", "Feuilly", "Courfeyrac", "Bahorel", "Bossuet", "Joly", "Grantaire", "MotherPlutarch", "Gueulemer", "Babet", "Claquesous", "Montparnasse", "Toussaint", "Child1", "Child2", "Brujon", "Mme.Hucheloup"]
}
};

window.__widget = new ChartPanel()
.widget(new Column())
.target("placeholder")
.columns(["Subject", "Year 1", "Year 2", "Year 3"])
.data([
["Geography", 75, 68, 65],
["English", 45, 55, -52],
["Math", 98, 92, 90],
["Science", 66, 60, 72]
])
.title("Exam Results 2008->10")
.legendVisible(true)
.render()
;

</script>
<script>
function doResize() {
window.__widget?.resize()?.render();
}
</script>
</body>

</html>
77 changes: 37 additions & 40 deletions packages/eclwatch/package.json
Original file line number Diff line number Diff line change
@@ -1,58 +1,55 @@
{
"name": "@hpcc-js/eclwatch",
"version": "2.76.0",
"version": "3.0.0",
"description": "hpcc-js - ECL Watch",
"main": "dist/index.js",
"module": "dist/index.es6",
"unpkg": "dist/index.min.js",
"jsdelivr": "dist/index.min.js",
"types": "types/index.d.ts",
"typesVersions": {
"<3.8": {
"*": [
"types-3.4/index.d.ts"
]
}
"type": "module",
"exports": {
".": {
"types": "./types/index.d.ts",
"default": "./dist/index.js"
},
"./dist/*": "./dist/*"
},
"module": "./dist/index.js",
"browser": "./dist/index.js",
"types": "./types/index.d.ts",
"files": [
"dist/*",
"types/*",
"types-3.4/*",
"src/*"
"src/*",
"types/*"
],
"scripts": {
"clean": "rimraf --glob lib* types dist *.tsbuildinfo",
"compile-es6": "tsc --module es6 --outDir ./lib-es6",
"compile-es6-watch": "npm run compile-es6 -- -w",
"compile-umd": "tsc --module umd --outDir ./lib-umd",
"compile-umd-watch": "npm run compile-umd -- -w",
"bundle": "rollup -c",
"bundle-watch": "npm run bundle -- -w",
"minimize": "terser dist/index.js -c -m --source-map \"content='dist/index.js.map',url='index.min.js.map'\" -o dist/index.min.js",
"gen-legacy-types": "downlevel-dts ./types ./types-3.4",
"build": "npm run compile-es6 && npm run bundle",
"watch": "npm-run-all compile-es6 -p compile-es6-watch bundle-watch",
"clean": "rimraf --glob lib* types dist *.tsbuildinfo .turbo",
"bundle": "node esbuild.js",
"bundle-watch": "npm run bundle -- --development --watch",
"gen-types": "tsc --project tsconfig.json",
"gen-types-watch": "npm run gen-types -- --watch",
"build": "run-p gen-types bundle",
"stamp": "node ../../node_modules/@hpcc-js/bundle/src/stamp.js",
"lint": "eslint ./src",
"lint-fix": "eslint --fix src/**/*.ts",
"docs": "typedoc --options tdoptions.json .",
"update": "npx --yes npm-check-updates -u -t minor"
"test-browser": "vitest run --project browser",
"test": "vitest run",
"coverage": "vitest run --coverage",
"update": "npx --yes npm-check-updates -u -t minor",
"update-major": "npx --yes npm-check-updates -u"
},
"dependencies": {
"@hpcc-js/codemirror": "^2.64.0",
"@hpcc-js/common": "^2.73.0",
"@hpcc-js/comms": "^2.98.0",
"@hpcc-js/dgrid": "^2.34.0",
"@hpcc-js/graph": "^2.87.0",
"@hpcc-js/layout": "^2.51.0",
"@hpcc-js/phosphor": "^2.20.0",
"@hpcc-js/timeline": "^2.54.0",
"@hpcc-js/tree": "^2.42.0",
"@hpcc-js/util": "^2.53.0"
"@hpcc-js/codemirror": "^3.0.0",
"@hpcc-js/common": "^3.0.0",
"@hpcc-js/comms": "^3.0.0",
"@hpcc-js/dgrid": "^3.0.0",
"@hpcc-js/graph": "^3.0.0",
"@hpcc-js/layout": "^3.0.0",
"@hpcc-js/phosphor": "^3.0.0",
"@hpcc-js/timeline": "^3.0.0",
"@hpcc-js/tree": "^3.0.0",
"@hpcc-js/util": "^3.0.0"
},
"devDependencies": {
"@hpcc-js/bundle": "^2.12.0",
"d3-selection": "^1",
"tslib": "2.7.0"
"@hpcc-js/esbuild-plugins": "^1.2.0",
"d3-selection": "^1"
},
"repository": {
"type": "git",
Expand Down
Loading

0 comments on commit d8d4ae6

Please sign in to comment.