Skip to content

Commit

Permalink
Merge pull request #4291 from GordonSmith/V3_OTHER
Browse files Browse the repository at this point in the history
feat: Upgrade other to v3
  • Loading branch information
GordonSmith authored Nov 12, 2024
2 parents 165b078 + 2400076 commit 397c707
Show file tree
Hide file tree
Showing 29 changed files with 821 additions and 404 deletions.
45 changes: 44 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"xpackages/marshaller",
"packages/observable-shim",
"packages/observablehq-compiler",
"xpackages/other",
"packages/other",
"packages/phosphor",
"packages/phosphor-shim",
"packages/preact-shim",
Expand Down
54 changes: 34 additions & 20 deletions packages/other/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,47 @@
{
// Use IntelliSense to learn about possible Node.js debug attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Dermatology",
"type": "chrome",
"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",
"urlFilter": "*dermatology*www*index.html*",
"runtimeArgs": [
"--allow-file-access-from-files",
"file:///${workspaceRoot}/../../demos/dermatology/www/index.html?src/other/CalendarHeatMap"
"run-script",
"test-node"
],
"runtimeExecutable": "npm",
"skipFiles": [
"<node_internals>/**"
],
"outFiles": [
"${workspaceFolder}/**/*.js",
"!**/node_modules/**"
],
"trace": true,
"sourceMapPathOverrides": {
"../*": "${workspaceRoot}/*"
}
},
{
"name": "Chrome Debug",
"type": "chrome",
"name": "index.html",
"request": "launch",
"url": "file:///C:/Users/gordon/git/hpcc-js/tests/test-other/test.html",
"trace": true,
"webRoot": "${workspaceRoot}",
"sourceMapPathOverrides": {
"webpack:///C:/Users/gordon/git/hpcc-js/packages/other/*": "${workspaceRoot}/*"
}
"type": "msedge",
"url": "file:///${workspaceFolder}/index.html",
"runtimeArgs": [
"--disable-web-security"
],
"webRoot": "${workspaceFolder}",
"outFiles": [
"${workspaceFolder}/**/*.js",
"!**/node_modules/**"
]
}
]
}
34 changes: 25 additions & 9 deletions packages/other/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,36 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "gen-types-watch",
"type": "npm",
"script": "compile-umd-watch",
"group": {
"kind": "build",
"isDefault": true
},
"script": "gen-types-watch",
"problemMatcher": [
"$tsc-watch"
],
"label": "npm: compile-umd-watch",
"detail": "tsc --module umd --outDir ./lib-umd --watch"
"presentation": {
"group": "group-build"
}
},
{
"label": "bundle-watch",
"type": "npm",
"script": "bundle-watch",
"problemMatcher": [],
"presentation": {
"group": "group-build"
}
},
{
"label": "build",
"dependsOn": [
"gen-types-watch",
"bundle-watch",
],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
29 changes: 29 additions & 0 deletions packages/other/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),
]
})
]);
73 changes: 73 additions & 0 deletions packages/other/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<!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/runtime@5.9.9/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/comms": "../comms/dist/index.js",
"@hpcc-js/observablehq-compiler": "../observablehq-compiler/dist/index.js"
}
}
</script>
<link rel="stylesheet" href="../common/dist/index.css">
<link rel="stylesheet" href="./dist/index.css">
</head>

<body onresize="doResize()">
<h1>ESM Quick Test</h1>
<div id="placeholder"></div>
<script type="module">
import { Table } from "@hpcc-js/other";

window.__widget = new Table()
.target("placeholder")
.columns(["Category", "Series-1", "Series-2"])
.data([
["A", 34, 21],
["B", 55, 34],
["C", 54, 90],
["D", 80, 153],
["E", 86, 92],
["F", 144, 233]
])
.tooltipValueFormat(",.0f")
.showValue(true)
.xAxisFocus(true)
.render()
;
</script>
<script>
function doResize() {
window.__widget?.resize()?.render();
}
</script>
</body>

</html>
62 changes: 30 additions & 32 deletions packages/other/package.json
Original file line number Diff line number Diff line change
@@ -1,49 +1,48 @@
{
"name": "@hpcc-js/other",
"version": "2.17.0",
"version": "3.0.0",
"description": "hpcc-js - Viz Other",
"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/*",
"src/*",
"types/*",
"types-3.4/*",
"src/*"
"font-awesome/**/*"
],
"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/api": "^2.14.0",
"@hpcc-js/common": "^2.73.0",
"@hpcc-js/layout": "^2.51.0"
"@hpcc-js/api": "^3.1.0",
"@hpcc-js/common": "^3.1.0",
"@hpcc-js/layout": "^3.0.0"
},
"devDependencies": {
"@hpcc-js/bundle": "^2.12.0",
"@hpcc-js/esbuild-plugins": "^1.2.0",
"d3-array": "^1",
"d3-collection": "^1",
"d3-format": "^1",
Expand All @@ -55,8 +54,7 @@
"d3-timer": "^1",
"d3-zoom": "^1",
"javascript-autocomplete": "1.0.5",
"simpleheat": "0.4.0",
"tslib": "2.7.0"
"simpleheat": "0.4.0"
},
"repository": {
"type": "git",
Expand Down
Loading

0 comments on commit 397c707

Please sign in to comment.