From f136590ddef8c35c3b35bfb7f5f7684c5cea8b53 Mon Sep 17 00:00:00 2001 From: Gordon Smith Date: Fri, 22 Nov 2024 11:26:14 +0000 Subject: [PATCH] chore: Switch to vite for development Signed-off-by: Gordon Smith --- demos/gallery/samples/samples.json | 54 +-- package-lock.json | 186 ++++++++-- package.json | 5 +- packages/api/.vscode/launch.json | 30 +- packages/api/package.json | 15 +- packages/api/tsconfig.json | 1 + packages/api/vite.config.ts | 32 ++ packages/api/vitest.workspace.ts | 6 +- packages/chart/.vscode/launch.json | 18 +- packages/chart/index-preview.html | 97 ++++++ packages/chart/index.html | 17 +- packages/chart/package.json | 15 +- packages/chart/tsconfig.json | 1 + packages/chart/vite.config.ts | 32 ++ packages/chart/vitest.workspace.ts | 6 +- packages/codemirror/.vscode/launch.json | 16 +- packages/codemirror/index-preview.html | 85 +++++ packages/codemirror/index.html | 44 +-- packages/codemirror/package.json | 12 +- packages/codemirror/src/codemirror-shim.ts | 29 +- packages/codemirror/src/index.ts | 1 - .../tests/codemirror.browser.spec.ts | 2 +- packages/codemirror/tsconfig.json | 1 + packages/codemirror/vite.config.ts | 32 ++ packages/codemirror/vitest.workspace.ts | 6 +- packages/common/.vscode/launch.json | 18 +- packages/common/index.html | 4 +- packages/common/package.json | 17 +- packages/common/tsconfig.json | 2 +- packages/common/vite.config.ts | 46 +++ packages/comms/.vscode/launch.json | 30 +- packages/comms/esbuild.js | 9 +- packages/comms/index.html | 42 ++- packages/comms/package.json | 25 +- packages/comms/src/index.browser.ts | 1 + .../src/{index-common.ts => index.common.ts} | 0 packages/comms/src/index.node.ts | 2 +- packages/comms/src/index.ts | 1 - packages/comms/src/services/wsAccount.ts | 2 +- packages/comms/src/services/wsCloud.ts | 2 +- packages/comms/src/services/wsDali.ts | 2 +- packages/comms/src/services/wsElk.ts | 2 +- packages/comms/src/services/wsMachine.ts | 2 +- .../comms/src/services/wsPackageProcess.ts | 2 +- packages/comms/src/services/wsResources.ts | 2 +- packages/comms/tsconfig.json | 4 +- packages/comms/vite.config.ts | 32 ++ packages/comms/vitest.workspace.ts | 6 +- packages/composite/.vscode/launch.json | 18 +- packages/composite/package.json | 15 +- packages/composite/tmp.ts | 317 ------------------ packages/composite/tsconfig.json | 1 + packages/composite/vite.config.ts | 32 ++ packages/composite/vitest.workspace.ts | 6 +- packages/dataflow/.vscode/launch.json | 30 +- packages/dataflow/package.json | 18 +- packages/dataflow/tsconfig.json | 1 + packages/dataflow/vite.config.ts | 32 ++ packages/dataflow/vitest.workspace.ts | 6 +- packages/ddl-shim/.vscode/launch.json | 18 +- packages/ddl-shim/index-preview.html | 97 ++++++ packages/ddl-shim/index.html | 43 +++ packages/ddl-shim/package.json | 12 +- packages/ddl-shim/tsconfig.json | 1 + packages/ddl-shim/vite.config.ts | 32 ++ packages/ddl-shim/vitest.workspace.ts | 6 +- packages/dgrid/.vscode/launch.json | 18 +- packages/dgrid/package.json | 14 +- packages/dgrid/tsconfig.json | 1 + packages/dgrid/vite.config.ts | 32 ++ packages/dgrid/vitest.workspace.ts | 6 +- packages/dgrid2/.vscode/launch.json | 18 +- packages/dgrid2/package.json | 15 +- packages/dgrid2/tsconfig.json | 1 + packages/dgrid2/vite.config.ts | 32 ++ packages/dgrid2/vitest.workspace.ts | 6 +- packages/eclwatch/.vscode/launch.json | 18 +- packages/eclwatch/package.json | 12 +- packages/eclwatch/tsconfig.json | 1 + packages/eclwatch/vite.config.ts | 32 ++ packages/eclwatch/vitest.workspace.ts | 6 +- packages/esbuild-plugins/src/index.ts | 1 + packages/esbuild-plugins/src/vite-utils.ts | 27 ++ packages/form/.vscode/launch.json | 18 +- packages/form/package.json | 15 +- packages/form/tsconfig.json | 1 + packages/form/vite.config.ts | 32 ++ packages/form/vitest.workspace.ts | 6 +- packages/graph/.vscode/launch.json | 18 +- packages/graph/index-preview.html | 144 ++++++++ packages/graph/index.html | 95 +++--- packages/graph/package.json | 20 +- packages/graph/src/GraphData.ts | 2 +- packages/graph/src/GraphLayouts.ts | 2 +- .../graph/src/graph2/layouts/dagreWorker.ts | 56 +--- .../src/graph2/layouts/forceDirectedWorker.ts | 50 +-- .../src/graph2/layouts/graphvizWorker.ts | 90 +---- .../graph2/layouts/workers}/dagre.ts | 1 - .../graph2/layouts/workers}/dagreOptions.ts | 0 .../graph2/layouts/workers}/forceDirected.ts | 0 .../layouts/workers}/forceDirectedOptions.ts | 0 .../graph2/layouts/workers}/graphviz.ts | 0 .../layouts/workers}/graphvizOptions.ts | 0 packages/graph/tsconfig.json | 1 + packages/graph/vite.config.ts | 32 ++ packages/graph/vitest.workspace.ts | 6 +- packages/graph/workers/package.json | 6 - packages/graph/workers/rollup.config.js | 55 --- packages/graph/workers/tsconfig.json | 17 - packages/html/.vscode/launch.json | 16 +- packages/html/package.json | 12 +- packages/html/tsconfig.json | 1 + packages/html/vite.config.ts | 32 ++ packages/html/vitest.workspace.ts | 6 +- packages/layout/.vscode/launch.json | 18 +- packages/layout/package.json | 12 +- packages/layout/tsconfig.json | 1 + packages/layout/vite.config.ts | 32 ++ packages/layout/vitest.workspace.ts | 6 +- packages/map/.vscode/launch.json | 18 +- packages/map/package.json | 12 +- packages/map/src/leaflet/leaflet-shim.ts | 2 +- packages/map/tsconfig.json | 1 + packages/map/vite.config.ts | 32 ++ packages/map/vitest.workspace.ts | 6 +- packages/markdown-it-plugins/package.json | 19 +- packages/markdown-it-plugins/tsconfig.json | 3 +- packages/markdown-it-plugins/vite.config.ts | 32 ++ .../observablehq-compiler/.vscode/launch.json | 18 +- packages/observablehq-compiler/index.html | 69 ++-- packages/observablehq-compiler/package.json | 17 +- packages/observablehq-compiler/src/parse.ts | 4 +- packages/observablehq-compiler/tsconfig.json | 1 + packages/observablehq-compiler/vite.config.ts | 32 ++ .../observablehq-compiler/vitest.workspace.ts | 6 +- packages/other/.vscode/launch.json | 18 +- packages/other/package.json | 15 +- packages/other/tsconfig.json | 1 + packages/other/vite.config.ts | 32 ++ packages/other/vitest.workspace.ts | 6 +- packages/phosphor/.vscode/launch.json | 16 +- packages/phosphor/package.json | 12 +- packages/phosphor/tsconfig.json | 1 + packages/phosphor/vite.config.ts | 32 ++ packages/phosphor/vitest.workspace.ts | 6 +- packages/preact-shim/.vscode/launch.json | 61 ++++ packages/preact-shim/package.json | 12 +- packages/preact-shim/tsconfig.json | 1 + packages/preact-shim/vite.config.ts | 32 ++ packages/preact-shim/vitest.workspace.ts | 6 + packages/react/.vscode/launch.json | 18 +- packages/react/package.json | 12 +- packages/react/tsconfig.json | 1 + packages/react/vite.config.ts | 32 ++ packages/react/vitest.workspace.ts | 6 +- packages/timeline/.vscode/launch.json | 18 +- packages/timeline/index.html | 10 +- packages/timeline/package.json | 15 +- packages/timeline/tsconfig.json | 1 + packages/timeline/vite.config.ts | 32 ++ packages/timeline/vitest.workspace.ts | 6 +- packages/tree/.vscode/launch.json | 18 +- packages/tree/package.json | 18 +- packages/tree/tsconfig.json | 1 + packages/tree/vite.config.ts | 32 ++ packages/tree/vitest.workspace.ts | 6 +- packages/util/.vscode/launch.json | 30 +- packages/util/package.json | 16 +- packages/util/tsconfig.json | 1 + packages/util/vite.config.ts | 32 ++ packages/util/vitest.workspace.ts | 6 +- 171 files changed, 2478 insertions(+), 1080 deletions(-) create mode 100644 packages/api/vite.config.ts create mode 100644 packages/chart/index-preview.html create mode 100644 packages/chart/vite.config.ts create mode 100644 packages/codemirror/index-preview.html create mode 100644 packages/codemirror/vite.config.ts create mode 100644 packages/common/vite.config.ts create mode 100644 packages/comms/src/index.browser.ts rename packages/comms/src/{index-common.ts => index.common.ts} (100%) delete mode 100644 packages/comms/src/index.ts create mode 100644 packages/comms/vite.config.ts delete mode 100644 packages/composite/tmp.ts create mode 100644 packages/composite/vite.config.ts create mode 100644 packages/dataflow/vite.config.ts create mode 100644 packages/ddl-shim/index-preview.html create mode 100644 packages/ddl-shim/index.html create mode 100644 packages/ddl-shim/vite.config.ts create mode 100644 packages/dgrid/vite.config.ts create mode 100644 packages/dgrid2/vite.config.ts create mode 100644 packages/eclwatch/vite.config.ts create mode 100644 packages/esbuild-plugins/src/vite-utils.ts create mode 100644 packages/form/vite.config.ts create mode 100644 packages/graph/index-preview.html rename packages/graph/{workers/src => src/graph2/layouts/workers}/dagre.ts (98%) rename packages/graph/{workers/src => src/graph2/layouts/workers}/dagreOptions.ts (100%) rename packages/graph/{workers/src => src/graph2/layouts/workers}/forceDirected.ts (100%) rename packages/graph/{workers/src => src/graph2/layouts/workers}/forceDirectedOptions.ts (100%) rename packages/graph/{workers/src => src/graph2/layouts/workers}/graphviz.ts (100%) rename packages/graph/{workers/src => src/graph2/layouts/workers}/graphvizOptions.ts (100%) create mode 100644 packages/graph/vite.config.ts delete mode 100644 packages/graph/workers/package.json delete mode 100644 packages/graph/workers/rollup.config.js delete mode 100644 packages/graph/workers/tsconfig.json create mode 100644 packages/html/vite.config.ts create mode 100644 packages/layout/vite.config.ts create mode 100644 packages/map/vite.config.ts create mode 100644 packages/markdown-it-plugins/vite.config.ts create mode 100644 packages/observablehq-compiler/vite.config.ts create mode 100644 packages/other/vite.config.ts create mode 100644 packages/phosphor/vite.config.ts create mode 100644 packages/preact-shim/.vscode/launch.json create mode 100644 packages/preact-shim/vite.config.ts create mode 100644 packages/preact-shim/vitest.workspace.ts create mode 100644 packages/react/vite.config.ts create mode 100644 packages/timeline/vite.config.ts create mode 100644 packages/tree/vite.config.ts create mode 100644 packages/util/vite.config.ts diff --git a/demos/gallery/samples/samples.json b/demos/gallery/samples/samples.json index 39d68aff9f..b4559fbb98 100644 --- a/demos/gallery/samples/samples.json +++ b/demos/gallery/samples/samples.json @@ -299,6 +299,27 @@ } ] }, + { + "path": "./samples/chart/dataMeta", + "name": "dataMeta", + "type": "folder", + "children": [ + { + "path": "./samples/chart/dataMeta/PieColumn.js", + "name": "PieColumn.js", + "type": "file", + "imports": { + "@hpcc-js/chart": [ + "Column", + "Pie" + ], + "@hpcc-js/layout": [ + "FlexGrid" + ] + } + } + ] + }, { "path": "./samples/chart/Gantt", "name": "Gantt", @@ -681,27 +702,6 @@ "SummaryC" ] } - }, - { - "path": "./samples/chart/dataMeta", - "name": "dataMeta", - "type": "folder", - "children": [ - { - "path": "./samples/chart/dataMeta/PieColumn.js", - "name": "PieColumn.js", - "type": "file", - "imports": { - "@hpcc-js/chart": [ - "Column", - "Pie" - ], - "@hpcc-js/layout": [ - "FlexGrid" - ] - } - } - ] } ] }, @@ -901,22 +901,22 @@ } }, { - "path": "./samples/common/SVGWidget.js", - "name": "SVGWidget.js", + "path": "./samples/common/Shape.js", + "name": "Shape.js", "type": "file", "imports": { "@hpcc-js/common": [ - "SVGWidget" + "Shape" ] } }, { - "path": "./samples/common/Shape.js", - "name": "Shape.js", + "path": "./samples/common/SVGWidget.js", + "name": "SVGWidget.js", "type": "file", "imports": { "@hpcc-js/common": [ - "Shape" + "SVGWidget" ] } }, diff --git a/package-lock.json b/package-lock.json index fbb9807b41..42d33de2b1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,6 +24,9 @@ "playwright": "1.49.0", "rimraf": "5.0.10", "typescript": "5.6.3", + "vite": "^5.4.11", + "vite-plugin-css-injected-by-js": "^3.5.2", + "vite-plugin-static-copy": "^2.1.0", "vitest": "2.1.5" } }, @@ -238,26 +241,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@dagrejs/dagre": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/@dagrejs/dagre/-/dagre-1.1.4.tgz", - "integrity": "sha512-QUTc54Cg/wvmlEUxB+uvoPVKFazM1H18kVHBQNmK2NbrDR5ihOCR6CXLnDSZzMcSQKJtabPUWridBOlJM3WkDg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@dagrejs/graphlib": "2.2.4" - } - }, - "node_modules/@dagrejs/graphlib": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/@dagrejs/graphlib/-/graphlib-2.2.4.tgz", - "integrity": "sha512-mepCf/e9+SKYy1d02/UkvSy6+6MoyXhVxP8lLDfA7BPE1X1d4dR0sZznmbM8/XVJ1GPM+Svnx7Xj6ZweByWUkw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">17.0.0" - } - }, "node_modules/@discoveryjs/json-ext": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz", @@ -6129,6 +6112,13 @@ "@types/d3-selection": "^1" } }, + "node_modules/@types/dagre": { + "version": "0.7.52", + "resolved": "https://registry.npmjs.org/@types/dagre/-/dagre-0.7.52.tgz", + "integrity": "sha512-XKJdy+OClLk3hketHi9Qg6gTfe1F3y+UFnHxKA2rn9Dw+oXa4Gb378Ztz9HlMgZKSxpPmn4BNVh9wgkpvrK1uw==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/dojo": { "version": "1.9.48", "resolved": "https://registry.npmjs.org/@types/dojo/-/dojo-1.9.48.tgz", @@ -7244,6 +7234,20 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "license": "ISC", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/apache-arrow": { "version": "17.0.0", "resolved": "https://registry.npmjs.org/apache-arrow/-/apache-arrow-17.0.0.tgz", @@ -7545,6 +7549,19 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, + "node_modules/binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/bl": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", @@ -7882,6 +7899,44 @@ "node": ">= 16" } }, + "node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/chokidar/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/chownr": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", @@ -9042,6 +9097,17 @@ "d3-transition": "^1.3.2" } }, + "node_modules/dagre": { + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/dagre/-/dagre-0.8.5.tgz", + "integrity": "sha512-/aTqmnRta7x7MCCpExk7HQL2O4owCT2h8NT//9I1OQ9vt29Pa0BzSAkR5lwFUcQ7491yVi/3CXU9jQ5o0Mn2Sw==", + "dev": true, + "license": "MIT", + "dependencies": { + "graphlib": "^2.1.8", + "lodash": "^4.17.15" + } + }, "node_modules/dargs": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/dargs/-/dargs-7.0.0.tgz", @@ -11497,6 +11563,16 @@ "dev": true, "license": "MIT" }, + "node_modules/graphlib": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/graphlib/-/graphlib-2.1.8.tgz", + "integrity": "sha512-jcLLfkpoVGmH7/InMC/1hIvOPSUh38oJtGhvrOFGzioE1DZ+0YW16RgmOJhHiuWTvGiJQ9Z1Ik43JvkRPRvE+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "lodash": "^4.17.15" + } + }, "node_modules/graphql": { "version": "16.9.0", "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.9.0.tgz", @@ -12141,6 +12217,19 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "license": "MIT", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/is-boolean-object": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", @@ -14777,6 +14866,16 @@ "node": "^16.14.0 || >=18.0.0" } }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/npm-bundled": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-3.0.1.tgz", @@ -16492,6 +16591,19 @@ "node": ">= 6" } }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, "node_modules/rechoir": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.8.0.tgz", @@ -19414,6 +19526,35 @@ "url": "https://opencollective.com/vitest" } }, + "node_modules/vite-plugin-css-injected-by-js": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/vite-plugin-css-injected-by-js/-/vite-plugin-css-injected-by-js-3.5.2.tgz", + "integrity": "sha512-2MpU/Y+SCZyWUB6ua3HbJCrgnF0KACAsmzOQt1UvRVJCGF6S8xdA3ZUhWcWdM9ivG4I5az8PnQmwwrkC2CAQrQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "vite": ">2.0.0-0" + } + }, + "node_modules/vite-plugin-static-copy": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/vite-plugin-static-copy/-/vite-plugin-static-copy-2.1.0.tgz", + "integrity": "sha512-n8lEOIVM00Y/zronm0RG8RdPyFd0SAAFR0sii3NWmgG3PSCyYMsvUNRQTlb3onp1XeMrKIDwCrPGxthKvqX9OQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "chokidar": "^3.5.3", + "fast-glob": "^3.2.11", + "fs-extra": "^11.1.0", + "picocolors": "^1.0.0" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "peerDependencies": { + "vite": "^5.0.0" + } + }, "node_modules/vite/node_modules/fsevents": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", @@ -20946,17 +21087,18 @@ "@hpcc-js/util": "^3.2.0" }, "devDependencies": { - "@dagrejs/dagre": "1.1.4", "@hpcc-js/esbuild-plugins": "^1.3.0", "@hpcc-js/wasm-graphviz": "1.6.1", "@types/d3-transition": "1.3.6", + "@types/dagre": "0.7.52", "d3-force": "^1", "d3-geo": "^1", "d3-interpolate-path": "2.3.0", "d3-sankey": "^0", "d3-shape": "^1", "d3-tile": "^1", - "d3-transition": "^1" + "d3-transition": "^1", + "dagre": "0.8.5" } }, "packages/html": { diff --git a/package.json b/package.json index b30a9a0d0b..e29811db6c 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,9 @@ "playwright": "1.49.0", "rimraf": "5.0.10", "typescript": "5.6.3", + "vite": "^5.4.11", + "vite-plugin-css-injected-by-js": "^3.5.2", + "vite-plugin-static-copy": "^2.1.0", "vitest": "2.1.5" }, "overrides": { @@ -51,4 +54,4 @@ "author": "HPCC Systems", "license": "Apache-2.0", "homepage": "https://github.com/hpcc-systems/Visualization" -} \ No newline at end of file +} diff --git a/packages/api/.vscode/launch.json b/packages/api/.vscode/launch.json index 3ee32e4122..f41798cc0a 100644 --- a/packages/api/.vscode/launch.json +++ b/packages/api/.vscode/launch.json @@ -5,7 +5,7 @@ "name": "test-browser", "type": "msedge", "request": "launch", - "url": "http://localhost:8888", + "url": "http://localhost:63315", "webRoot": "${workspaceFolder}", "outFiles": [ "${workspaceFolder}/**/*.js", @@ -28,6 +28,34 @@ "${workspaceFolder}/**/*.js", "!**/node_modules/**" ], + }, + { + "name": "index.html", + "request": "launch", + "type": "msedge", + "url": "http://localhost:5173/index.html", + "runtimeArgs": [ + "--disable-web-security" + ], + "webRoot": "${workspaceFolder}", + "outFiles": [ + "${workspaceFolder}/**/*.js", + "!**/node_modules/**" + ] + }, + { + "name": "index-preview.html", + "request": "launch", + "type": "msedge", + "url": "file://${workspaceFolder}/index-preview.html", + "runtimeArgs": [ + "--disable-web-security" + ], + "webRoot": "${workspaceFolder}", + "outFiles": [ + "${workspaceFolder}/**/*.js", + "!**/node_modules/**" + ] } ] } \ No newline at end of file diff --git a/packages/api/package.json b/packages/api/package.json index 298ddf6933..902b8fea79 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -3,15 +3,17 @@ "version": "3.2.0", "description": "hpcc-js - Viz api", "type": "module", + "main": "./dist/index.umd.cjs", + "module": "./dist/index.js", "exports": { ".": { "types": "./types/index.d.ts", - "default": "./dist/index.js" + "import": "./dist/index.js", + "require": "./dist/index.umd.cjs" }, "./dist/*": "./dist/*" }, - "module": "./dist/index.js", - "browser": "./dist/index.js", + "browser": "./dist/index.umd.cjs", "types": "./types/index.d.ts", "files": [ "dist/*", @@ -20,8 +22,8 @@ ], "scripts": { "clean": "rimraf --glob lib* types dist *.tsbuildinfo .turbo", - "bundle": "node esbuild.js", - "bundle-watch": "npm run bundle -- --development --watch", + "bundle": "vite build", + "bundle-watch": "vite", "gen-types": "tsc --project tsconfig.json", "gen-types-watch": "npm run gen-types -- --watch", "build": "run-p gen-types bundle", @@ -31,7 +33,8 @@ "test-browser": "vitest run --project browser", "test": "vitest run", "coverage": "vitest run --coverage", - "update": "npx -y npm-check-updates -u -t minor" + "update": "npx --yes npm-check-updates -u -t minor", + "update-major": "npx --yes npm-check-updates -u" }, "dependencies": { "@hpcc-js/common": "^3.2.0" diff --git a/packages/api/tsconfig.json b/packages/api/tsconfig.json index 318ecdd23e..d0b91b3df7 100644 --- a/packages/api/tsconfig.json +++ b/packages/api/tsconfig.json @@ -10,6 +10,7 @@ "strict": true, "noImplicitAny": false, "strictNullChecks": false, + "isolatedModules": true, "skipLibCheck": true, "allowImportingTsExtensions": true, "lib": [ diff --git a/packages/api/vite.config.ts b/packages/api/vite.config.ts new file mode 100644 index 0000000000..228e4ad83b --- /dev/null +++ b/packages/api/vite.config.ts @@ -0,0 +1,32 @@ +import { defineConfig } from "vite"; +import { resolve } from "path"; +import cssInjectedByJsPlugin from "vite-plugin-css-injected-by-js"; +import { hpccBundleNames } from "@hpcc-js/esbuild-plugins"; +import pkg from "./package.json" with { type: "json" }; + +const { alias, external, globals } = hpccBundleNames(pkg); + +export default defineConfig({ + build: { + lib: { + entry: resolve(__dirname, "src/index.ts"), + name: pkg.name, + fileName: "index", + }, + rollupOptions: { + external, + output: { + globals, + }, + }, + }, + resolve: { + alias + }, + esbuild: { + minifyIdentifiers: false + }, + plugins: [ + cssInjectedByJsPlugin() + ], +}); diff --git a/packages/api/vitest.workspace.ts b/packages/api/vitest.workspace.ts index fa7bb0720b..722950dd03 100644 --- a/packages/api/vitest.workspace.ts +++ b/packages/api/vitest.workspace.ts @@ -1,6 +1,6 @@ -import { defineWorkspace } from 'vitest/config'; -import baseWorkspace from '../../vitest.workspace.ts'; +import { defineWorkspace } from "vitest/config"; +import baseWorkspace from "../../vitest.workspace.ts"; export default defineWorkspace([ ...baseWorkspace -]) \ No newline at end of file +]); \ No newline at end of file diff --git a/packages/chart/.vscode/launch.json b/packages/chart/.vscode/launch.json index 7c2436335f..f41798cc0a 100644 --- a/packages/chart/.vscode/launch.json +++ b/packages/chart/.vscode/launch.json @@ -5,7 +5,7 @@ "name": "test-browser", "type": "msedge", "request": "launch", - "url": "http://localhost:8888", + "url": "http://localhost:63315", "webRoot": "${workspaceFolder}", "outFiles": [ "${workspaceFolder}/**/*.js", @@ -33,7 +33,21 @@ "name": "index.html", "request": "launch", "type": "msedge", - "url": "file:///${workspaceFolder}/index.html", + "url": "http://localhost:5173/index.html", + "runtimeArgs": [ + "--disable-web-security" + ], + "webRoot": "${workspaceFolder}", + "outFiles": [ + "${workspaceFolder}/**/*.js", + "!**/node_modules/**" + ] + }, + { + "name": "index-preview.html", + "request": "launch", + "type": "msedge", + "url": "file://${workspaceFolder}/index-preview.html", "runtimeArgs": [ "--disable-web-security" ], diff --git a/packages/chart/index-preview.html b/packages/chart/index-preview.html new file mode 100644 index 0000000000..778584f12d --- /dev/null +++ b/packages/chart/index-preview.html @@ -0,0 +1,97 @@ + + + + + Home + + + + + + + +

ESM Quick Test

+
+ + + + + \ No newline at end of file diff --git a/packages/chart/index.html b/packages/chart/index.html index 6f902b3894..4464af916e 100644 --- a/packages/chart/index.html +++ b/packages/chart/index.html @@ -23,21 +23,8 @@ margin-top: 20px; } - - - + + diff --git a/packages/chart/package.json b/packages/chart/package.json index 3f75cf0809..a65f77a4e3 100644 --- a/packages/chart/package.json +++ b/packages/chart/package.json @@ -3,26 +3,27 @@ "version": "3.2.0", "description": "hpcc-js - Viz Chart", "type": "module", + "main": "./dist/index.umd.cjs", + "module": "./dist/index.js", "exports": { ".": { "types": "./types/index.d.ts", - "default": "./dist/index.js" + "import": "./dist/index.js", + "require": "./dist/index.umd.cjs" }, "./dist/*": "./dist/*" }, - "module": "./dist/index.js", - "browser": "./dist/index.js", + "browser": "./dist/index.umd.cjs", "types": "./types/index.d.ts", "files": [ "dist/*", "src/*", - "types/*", - "font-awesome/**/*" + "types/*" ], "scripts": { "clean": "rimraf --glob lib* types dist *.tsbuildinfo .turbo", - "bundle": "node esbuild.js", - "bundle-watch": "npm run bundle -- --development --watch", + "bundle": "vite build", + "bundle-watch": "vite", "gen-types": "tsc --project tsconfig.json", "gen-types-watch": "npm run gen-types -- --watch", "build": "run-p gen-types bundle", diff --git a/packages/chart/tsconfig.json b/packages/chart/tsconfig.json index 3cd3be3a69..22c2fb9695 100644 --- a/packages/chart/tsconfig.json +++ b/packages/chart/tsconfig.json @@ -11,6 +11,7 @@ "noImplicitAny": false, "noImplicitThis": false, "strictNullChecks": false, + "isolatedModules": true, "skipLibCheck": true, "allowImportingTsExtensions": true, "lib": [ diff --git a/packages/chart/vite.config.ts b/packages/chart/vite.config.ts new file mode 100644 index 0000000000..228e4ad83b --- /dev/null +++ b/packages/chart/vite.config.ts @@ -0,0 +1,32 @@ +import { defineConfig } from "vite"; +import { resolve } from "path"; +import cssInjectedByJsPlugin from "vite-plugin-css-injected-by-js"; +import { hpccBundleNames } from "@hpcc-js/esbuild-plugins"; +import pkg from "./package.json" with { type: "json" }; + +const { alias, external, globals } = hpccBundleNames(pkg); + +export default defineConfig({ + build: { + lib: { + entry: resolve(__dirname, "src/index.ts"), + name: pkg.name, + fileName: "index", + }, + rollupOptions: { + external, + output: { + globals, + }, + }, + }, + resolve: { + alias + }, + esbuild: { + minifyIdentifiers: false + }, + plugins: [ + cssInjectedByJsPlugin() + ], +}); diff --git a/packages/chart/vitest.workspace.ts b/packages/chart/vitest.workspace.ts index fa7bb0720b..722950dd03 100644 --- a/packages/chart/vitest.workspace.ts +++ b/packages/chart/vitest.workspace.ts @@ -1,6 +1,6 @@ -import { defineWorkspace } from 'vitest/config'; -import baseWorkspace from '../../vitest.workspace.ts'; +import { defineWorkspace } from "vitest/config"; +import baseWorkspace from "../../vitest.workspace.ts"; export default defineWorkspace([ ...baseWorkspace -]) \ No newline at end of file +]); \ No newline at end of file diff --git a/packages/codemirror/.vscode/launch.json b/packages/codemirror/.vscode/launch.json index 967172fec7..f41798cc0a 100644 --- a/packages/codemirror/.vscode/launch.json +++ b/packages/codemirror/.vscode/launch.json @@ -33,7 +33,21 @@ "name": "index.html", "request": "launch", "type": "msedge", - "url": "file:///${workspaceFolder}/index.html", + "url": "http://localhost:5173/index.html", + "runtimeArgs": [ + "--disable-web-security" + ], + "webRoot": "${workspaceFolder}", + "outFiles": [ + "${workspaceFolder}/**/*.js", + "!**/node_modules/**" + ] + }, + { + "name": "index-preview.html", + "request": "launch", + "type": "msedge", + "url": "file://${workspaceFolder}/index-preview.html", "runtimeArgs": [ "--disable-web-security" ], diff --git a/packages/codemirror/index-preview.html b/packages/codemirror/index-preview.html new file mode 100644 index 0000000000..54f3b7f7db --- /dev/null +++ b/packages/codemirror/index-preview.html @@ -0,0 +1,85 @@ + + + + + Home + + + + + + + +

ESM Quick Test

+
+ + + + + \ No newline at end of file diff --git a/packages/codemirror/index.html b/packages/codemirror/index.html index a990e85ef4..bcf87546d6 100644 --- a/packages/codemirror/index.html +++ b/packages/codemirror/index.html @@ -25,35 +25,41 @@ - - -

ESM Quick Test

- -

ESM Quick Test

- - - - - - + Home + + + -
- + + + + +

ESM Quick Test

+
+ + + + + \ No newline at end of file diff --git a/packages/ddl-shim/index.html b/packages/ddl-shim/index.html new file mode 100644 index 0000000000..f75c0aec4f --- /dev/null +++ b/packages/ddl-shim/index.html @@ -0,0 +1,43 @@ + + + + + Home + + + + + + +

ESM Quick Test

+
+ + + + + \ No newline at end of file diff --git a/packages/ddl-shim/package.json b/packages/ddl-shim/package.json index 55f084ce07..b2199e86d2 100644 --- a/packages/ddl-shim/package.json +++ b/packages/ddl-shim/package.json @@ -3,15 +3,17 @@ "version": "3.0.0", "description": "hpcc-js DDL parser", "type": "module", + "main": "./dist/index.umd.cjs", + "module": "./dist/index.js", "exports": { ".": { "types": "./types/index.d.ts", - "default": "./dist/index.js" + "import": "./dist/index.js", + "require": "./dist/index.umd.cjs" }, "./dist/*": "./dist/*" }, - "module": "./dist/index.js", - "browser": "./dist/index.js", + "browser": "./dist/index.umd.cjs", "types": "./types/index.d.ts", "files": [ "dist/*", @@ -24,8 +26,8 @@ "generate-v1": "ts-json-schema-generator --tsconfig tsconfig-schema.json --type DDLSchema > ./schema/v1.json", "generate-v2": "ts-json-schema-generator --tsconfig tsconfig-schema.json --type Schema > ./schema/v2.json", "generate": "run-p generate-v1 generate-v2", - "bundle": "node esbuild.js", - "bundle-watch": "npm run bundle -- --development --watch", + "bundle": "vite build", + "bundle-watch": "vite", "gen-types": "tsc --project tsconfig.json", "gen-types-watch": "npm run gen-types -- --watch", "build": "npm-run-all --serial generate --parallel gen-types bundle", diff --git a/packages/ddl-shim/tsconfig.json b/packages/ddl-shim/tsconfig.json index 3cd3be3a69..22c2fb9695 100644 --- a/packages/ddl-shim/tsconfig.json +++ b/packages/ddl-shim/tsconfig.json @@ -11,6 +11,7 @@ "noImplicitAny": false, "noImplicitThis": false, "strictNullChecks": false, + "isolatedModules": true, "skipLibCheck": true, "allowImportingTsExtensions": true, "lib": [ diff --git a/packages/ddl-shim/vite.config.ts b/packages/ddl-shim/vite.config.ts new file mode 100644 index 0000000000..228e4ad83b --- /dev/null +++ b/packages/ddl-shim/vite.config.ts @@ -0,0 +1,32 @@ +import { defineConfig } from "vite"; +import { resolve } from "path"; +import cssInjectedByJsPlugin from "vite-plugin-css-injected-by-js"; +import { hpccBundleNames } from "@hpcc-js/esbuild-plugins"; +import pkg from "./package.json" with { type: "json" }; + +const { alias, external, globals } = hpccBundleNames(pkg); + +export default defineConfig({ + build: { + lib: { + entry: resolve(__dirname, "src/index.ts"), + name: pkg.name, + fileName: "index", + }, + rollupOptions: { + external, + output: { + globals, + }, + }, + }, + resolve: { + alias + }, + esbuild: { + minifyIdentifiers: false + }, + plugins: [ + cssInjectedByJsPlugin() + ], +}); diff --git a/packages/ddl-shim/vitest.workspace.ts b/packages/ddl-shim/vitest.workspace.ts index fa7bb0720b..722950dd03 100644 --- a/packages/ddl-shim/vitest.workspace.ts +++ b/packages/ddl-shim/vitest.workspace.ts @@ -1,6 +1,6 @@ -import { defineWorkspace } from 'vitest/config'; -import baseWorkspace from '../../vitest.workspace.ts'; +import { defineWorkspace } from "vitest/config"; +import baseWorkspace from "../../vitest.workspace.ts"; export default defineWorkspace([ ...baseWorkspace -]) \ No newline at end of file +]); \ No newline at end of file diff --git a/packages/dgrid/.vscode/launch.json b/packages/dgrid/.vscode/launch.json index 7c2436335f..f41798cc0a 100644 --- a/packages/dgrid/.vscode/launch.json +++ b/packages/dgrid/.vscode/launch.json @@ -5,7 +5,7 @@ "name": "test-browser", "type": "msedge", "request": "launch", - "url": "http://localhost:8888", + "url": "http://localhost:63315", "webRoot": "${workspaceFolder}", "outFiles": [ "${workspaceFolder}/**/*.js", @@ -33,7 +33,21 @@ "name": "index.html", "request": "launch", "type": "msedge", - "url": "file:///${workspaceFolder}/index.html", + "url": "http://localhost:5173/index.html", + "runtimeArgs": [ + "--disable-web-security" + ], + "webRoot": "${workspaceFolder}", + "outFiles": [ + "${workspaceFolder}/**/*.js", + "!**/node_modules/**" + ] + }, + { + "name": "index-preview.html", + "request": "launch", + "type": "msedge", + "url": "file://${workspaceFolder}/index-preview.html", "runtimeArgs": [ "--disable-web-security" ], diff --git a/packages/dgrid/package.json b/packages/dgrid/package.json index fdbe2ea66d..a30c9c2edf 100644 --- a/packages/dgrid/package.json +++ b/packages/dgrid/package.json @@ -3,15 +3,17 @@ "version": "3.1.0", "description": "hpcc-js - Viz DGrid", "type": "module", + "main": "./dist/index.umd.cjs", + "module": "./dist/index.js", "exports": { ".": { "types": "./types/index.d.ts", - "default": "./dist/index.js" + "import": "./dist/index.js", + "require": "./dist/index.umd.cjs" }, "./dist/*": "./dist/*" }, - "module": "./dist/index.js", - "browser": "./dist/index.js", + "browser": "./dist/index.umd.cjs", "types": "./types/index.d.ts", "files": [ "dist/*", @@ -20,8 +22,8 @@ ], "scripts": { "clean": "rimraf --glob lib* types dist *.tsbuildinfo .turbo", - "bundle": "node esbuild.js", - "bundle-watch": "npm run bundle -- --development --watch", + "bundle": "vite build", + "bundle-watch": "vite", "gen-types": "tsc --project tsconfig.json", "gen-types-watch": "npm run gen-types -- --watch", "build": "run-p gen-types bundle", @@ -32,7 +34,7 @@ "test": "vitest run", "coverage": "vitest run --coverage", "update": "npx --yes npm-check-updates -u -t minor", - "update-major": "npx -yes npm-check-updates -u" + "update-major": "npx --yes npm-check-updates -u" }, "dependencies": { "@hpcc-js/common": "^3.2.0", diff --git a/packages/dgrid/tsconfig.json b/packages/dgrid/tsconfig.json index 318ecdd23e..d0b91b3df7 100644 --- a/packages/dgrid/tsconfig.json +++ b/packages/dgrid/tsconfig.json @@ -10,6 +10,7 @@ "strict": true, "noImplicitAny": false, "strictNullChecks": false, + "isolatedModules": true, "skipLibCheck": true, "allowImportingTsExtensions": true, "lib": [ diff --git a/packages/dgrid/vite.config.ts b/packages/dgrid/vite.config.ts new file mode 100644 index 0000000000..228e4ad83b --- /dev/null +++ b/packages/dgrid/vite.config.ts @@ -0,0 +1,32 @@ +import { defineConfig } from "vite"; +import { resolve } from "path"; +import cssInjectedByJsPlugin from "vite-plugin-css-injected-by-js"; +import { hpccBundleNames } from "@hpcc-js/esbuild-plugins"; +import pkg from "./package.json" with { type: "json" }; + +const { alias, external, globals } = hpccBundleNames(pkg); + +export default defineConfig({ + build: { + lib: { + entry: resolve(__dirname, "src/index.ts"), + name: pkg.name, + fileName: "index", + }, + rollupOptions: { + external, + output: { + globals, + }, + }, + }, + resolve: { + alias + }, + esbuild: { + minifyIdentifiers: false + }, + plugins: [ + cssInjectedByJsPlugin() + ], +}); diff --git a/packages/dgrid/vitest.workspace.ts b/packages/dgrid/vitest.workspace.ts index fa7bb0720b..722950dd03 100644 --- a/packages/dgrid/vitest.workspace.ts +++ b/packages/dgrid/vitest.workspace.ts @@ -1,6 +1,6 @@ -import { defineWorkspace } from 'vitest/config'; -import baseWorkspace from '../../vitest.workspace.ts'; +import { defineWorkspace } from "vitest/config"; +import baseWorkspace from "../../vitest.workspace.ts"; export default defineWorkspace([ ...baseWorkspace -]) \ No newline at end of file +]); \ No newline at end of file diff --git a/packages/dgrid2/.vscode/launch.json b/packages/dgrid2/.vscode/launch.json index 7c2436335f..f41798cc0a 100644 --- a/packages/dgrid2/.vscode/launch.json +++ b/packages/dgrid2/.vscode/launch.json @@ -5,7 +5,7 @@ "name": "test-browser", "type": "msedge", "request": "launch", - "url": "http://localhost:8888", + "url": "http://localhost:63315", "webRoot": "${workspaceFolder}", "outFiles": [ "${workspaceFolder}/**/*.js", @@ -33,7 +33,21 @@ "name": "index.html", "request": "launch", "type": "msedge", - "url": "file:///${workspaceFolder}/index.html", + "url": "http://localhost:5173/index.html", + "runtimeArgs": [ + "--disable-web-security" + ], + "webRoot": "${workspaceFolder}", + "outFiles": [ + "${workspaceFolder}/**/*.js", + "!**/node_modules/**" + ] + }, + { + "name": "index-preview.html", + "request": "launch", + "type": "msedge", + "url": "file://${workspaceFolder}/index-preview.html", "runtimeArgs": [ "--disable-web-security" ], diff --git a/packages/dgrid2/package.json b/packages/dgrid2/package.json index c1f7033fae..d53611cd5f 100644 --- a/packages/dgrid2/package.json +++ b/packages/dgrid2/package.json @@ -3,26 +3,27 @@ "version": "3.1.0", "description": "hpcc-js - DGrid2", "type": "module", + "main": "./dist/index.umd.cjs", + "module": "./dist/index.js", "exports": { ".": { "types": "./types/index.d.ts", - "default": "./dist/index.js" + "import": "./dist/index.js", + "require": "./dist/index.umd.cjs" }, "./dist/*": "./dist/*" }, - "module": "./dist/index.js", - "browser": "./dist/index.js", + "browser": "./dist/index.umd.cjs", "types": "./types/index.d.ts", "files": [ "dist/*", "src/*", - "types/*", - "font-awesome/**/*" + "types/*" ], "scripts": { "clean": "rimraf --glob lib* types dist *.tsbuildinfo .turbo", - "bundle": "node esbuild.js", - "bundle-watch": "npm run bundle -- --development --watch", + "bundle": "vite build", + "bundle-watch": "vite", "gen-types": "tsc --project tsconfig.json", "gen-types-watch": "npm run gen-types -- --watch", "build": "run-p gen-types bundle", diff --git a/packages/dgrid2/tsconfig.json b/packages/dgrid2/tsconfig.json index f7c315bbc3..378d52b366 100644 --- a/packages/dgrid2/tsconfig.json +++ b/packages/dgrid2/tsconfig.json @@ -12,6 +12,7 @@ "noImplicitAny": false, "noImplicitThis": false, "strictNullChecks": false, + "isolatedModules": true, "skipLibCheck": true, "allowImportingTsExtensions": true, "lib": [ diff --git a/packages/dgrid2/vite.config.ts b/packages/dgrid2/vite.config.ts new file mode 100644 index 0000000000..228e4ad83b --- /dev/null +++ b/packages/dgrid2/vite.config.ts @@ -0,0 +1,32 @@ +import { defineConfig } from "vite"; +import { resolve } from "path"; +import cssInjectedByJsPlugin from "vite-plugin-css-injected-by-js"; +import { hpccBundleNames } from "@hpcc-js/esbuild-plugins"; +import pkg from "./package.json" with { type: "json" }; + +const { alias, external, globals } = hpccBundleNames(pkg); + +export default defineConfig({ + build: { + lib: { + entry: resolve(__dirname, "src/index.ts"), + name: pkg.name, + fileName: "index", + }, + rollupOptions: { + external, + output: { + globals, + }, + }, + }, + resolve: { + alias + }, + esbuild: { + minifyIdentifiers: false + }, + plugins: [ + cssInjectedByJsPlugin() + ], +}); diff --git a/packages/dgrid2/vitest.workspace.ts b/packages/dgrid2/vitest.workspace.ts index fa7bb0720b..722950dd03 100644 --- a/packages/dgrid2/vitest.workspace.ts +++ b/packages/dgrid2/vitest.workspace.ts @@ -1,6 +1,6 @@ -import { defineWorkspace } from 'vitest/config'; -import baseWorkspace from '../../vitest.workspace.ts'; +import { defineWorkspace } from "vitest/config"; +import baseWorkspace from "../../vitest.workspace.ts"; export default defineWorkspace([ ...baseWorkspace -]) \ No newline at end of file +]); \ No newline at end of file diff --git a/packages/eclwatch/.vscode/launch.json b/packages/eclwatch/.vscode/launch.json index 7c2436335f..f41798cc0a 100644 --- a/packages/eclwatch/.vscode/launch.json +++ b/packages/eclwatch/.vscode/launch.json @@ -5,7 +5,7 @@ "name": "test-browser", "type": "msedge", "request": "launch", - "url": "http://localhost:8888", + "url": "http://localhost:63315", "webRoot": "${workspaceFolder}", "outFiles": [ "${workspaceFolder}/**/*.js", @@ -33,7 +33,21 @@ "name": "index.html", "request": "launch", "type": "msedge", - "url": "file:///${workspaceFolder}/index.html", + "url": "http://localhost:5173/index.html", + "runtimeArgs": [ + "--disable-web-security" + ], + "webRoot": "${workspaceFolder}", + "outFiles": [ + "${workspaceFolder}/**/*.js", + "!**/node_modules/**" + ] + }, + { + "name": "index-preview.html", + "request": "launch", + "type": "msedge", + "url": "file://${workspaceFolder}/index-preview.html", "runtimeArgs": [ "--disable-web-security" ], diff --git a/packages/eclwatch/package.json b/packages/eclwatch/package.json index 2423aff72c..dec9a360e4 100644 --- a/packages/eclwatch/package.json +++ b/packages/eclwatch/package.json @@ -3,15 +3,17 @@ "version": "3.1.0", "description": "hpcc-js - ECL Watch", "type": "module", + "main": "./dist/index.umd.cjs", + "module": "./dist/index.js", "exports": { ".": { "types": "./types/index.d.ts", - "default": "./dist/index.js" + "import": "./dist/index.js", + "require": "./dist/index.umd.cjs" }, "./dist/*": "./dist/*" }, - "module": "./dist/index.js", - "browser": "./dist/index.js", + "browser": "./dist/index.umd.cjs", "types": "./types/index.d.ts", "files": [ "dist/*", @@ -20,8 +22,8 @@ ], "scripts": { "clean": "rimraf --glob lib* types dist *.tsbuildinfo .turbo", - "bundle": "node esbuild.js", - "bundle-watch": "npm run bundle -- --development --watch", + "bundle": "vite build", + "bundle-watch": "vite", "gen-types": "tsc --project tsconfig.json", "gen-types-watch": "npm run gen-types -- --watch", "build": "run-p gen-types bundle", diff --git a/packages/eclwatch/tsconfig.json b/packages/eclwatch/tsconfig.json index 3cd3be3a69..22c2fb9695 100644 --- a/packages/eclwatch/tsconfig.json +++ b/packages/eclwatch/tsconfig.json @@ -11,6 +11,7 @@ "noImplicitAny": false, "noImplicitThis": false, "strictNullChecks": false, + "isolatedModules": true, "skipLibCheck": true, "allowImportingTsExtensions": true, "lib": [ diff --git a/packages/eclwatch/vite.config.ts b/packages/eclwatch/vite.config.ts new file mode 100644 index 0000000000..228e4ad83b --- /dev/null +++ b/packages/eclwatch/vite.config.ts @@ -0,0 +1,32 @@ +import { defineConfig } from "vite"; +import { resolve } from "path"; +import cssInjectedByJsPlugin from "vite-plugin-css-injected-by-js"; +import { hpccBundleNames } from "@hpcc-js/esbuild-plugins"; +import pkg from "./package.json" with { type: "json" }; + +const { alias, external, globals } = hpccBundleNames(pkg); + +export default defineConfig({ + build: { + lib: { + entry: resolve(__dirname, "src/index.ts"), + name: pkg.name, + fileName: "index", + }, + rollupOptions: { + external, + output: { + globals, + }, + }, + }, + resolve: { + alias + }, + esbuild: { + minifyIdentifiers: false + }, + plugins: [ + cssInjectedByJsPlugin() + ], +}); diff --git a/packages/eclwatch/vitest.workspace.ts b/packages/eclwatch/vitest.workspace.ts index fa7bb0720b..722950dd03 100644 --- a/packages/eclwatch/vitest.workspace.ts +++ b/packages/eclwatch/vitest.workspace.ts @@ -1,6 +1,6 @@ -import { defineWorkspace } from 'vitest/config'; -import baseWorkspace from '../../vitest.workspace.ts'; +import { defineWorkspace } from "vitest/config"; +import baseWorkspace from "../../vitest.workspace.ts"; export default defineWorkspace([ ...baseWorkspace -]) \ No newline at end of file +]); \ No newline at end of file diff --git a/packages/esbuild-plugins/src/index.ts b/packages/esbuild-plugins/src/index.ts index 39ac3b5080..ff229ea2e7 100644 --- a/packages/esbuild-plugins/src/index.ts +++ b/packages/esbuild-plugins/src/index.ts @@ -5,3 +5,4 @@ export * from "./rebuild-logger.ts"; export * from "./remove-strict.ts"; export * from "./sfx-wrapper.ts"; export * from "./inline-css.ts"; +export * from "./vite-utils.ts"; diff --git a/packages/esbuild-plugins/src/vite-utils.ts b/packages/esbuild-plugins/src/vite-utils.ts new file mode 100644 index 0000000000..42161fd920 --- /dev/null +++ b/packages/esbuild-plugins/src/vite-utils.ts @@ -0,0 +1,27 @@ +const 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" +}; + +export function hpccBundleNames(pkg: any) { + const external: string[] = []; + const globals: { [id: string]: string } = {}; + for (const dep in pkg.dependencies) { + external.push(dep); + globals[dep] = dep; + } + return { alias: (pkg.name !== "@hpcc-js/common" && pkg.dependencies["@hpcc-js/common"]) ? alias : {}, external, globals }; +} \ No newline at end of file diff --git a/packages/form/.vscode/launch.json b/packages/form/.vscode/launch.json index 7c2436335f..f41798cc0a 100644 --- a/packages/form/.vscode/launch.json +++ b/packages/form/.vscode/launch.json @@ -5,7 +5,7 @@ "name": "test-browser", "type": "msedge", "request": "launch", - "url": "http://localhost:8888", + "url": "http://localhost:63315", "webRoot": "${workspaceFolder}", "outFiles": [ "${workspaceFolder}/**/*.js", @@ -33,7 +33,21 @@ "name": "index.html", "request": "launch", "type": "msedge", - "url": "file:///${workspaceFolder}/index.html", + "url": "http://localhost:5173/index.html", + "runtimeArgs": [ + "--disable-web-security" + ], + "webRoot": "${workspaceFolder}", + "outFiles": [ + "${workspaceFolder}/**/*.js", + "!**/node_modules/**" + ] + }, + { + "name": "index-preview.html", + "request": "launch", + "type": "msedge", + "url": "file://${workspaceFolder}/index-preview.html", "runtimeArgs": [ "--disable-web-security" ], diff --git a/packages/form/package.json b/packages/form/package.json index e79655596c..cdbb3462ea 100644 --- a/packages/form/package.json +++ b/packages/form/package.json @@ -3,26 +3,27 @@ "version": "3.1.0", "description": "hpcc-js - Viz Form", "type": "module", + "main": "./dist/index.umd.cjs", + "module": "./dist/index.js", "exports": { ".": { "types": "./types/index.d.ts", - "default": "./dist/index.js" + "import": "./dist/index.js", + "require": "./dist/index.umd.cjs" }, "./dist/*": "./dist/*" }, - "module": "./dist/index.js", - "browser": "./dist/index.js", + "browser": "./dist/index.umd.cjs", "types": "./types/index.d.ts", "files": [ "dist/*", "src/*", - "types/*", - "font-awesome/**/*" + "types/*" ], "scripts": { "clean": "rimraf --glob lib* types dist *.tsbuildinfo .turbo", - "bundle": "node esbuild.js", - "bundle-watch": "npm run bundle -- --development --watch", + "bundle": "vite build", + "bundle-watch": "vite", "gen-types": "tsc --project tsconfig.json", "gen-types-watch": "npm run gen-types -- --watch", "build": "run-p gen-types bundle", diff --git a/packages/form/tsconfig.json b/packages/form/tsconfig.json index 3cd3be3a69..22c2fb9695 100644 --- a/packages/form/tsconfig.json +++ b/packages/form/tsconfig.json @@ -11,6 +11,7 @@ "noImplicitAny": false, "noImplicitThis": false, "strictNullChecks": false, + "isolatedModules": true, "skipLibCheck": true, "allowImportingTsExtensions": true, "lib": [ diff --git a/packages/form/vite.config.ts b/packages/form/vite.config.ts new file mode 100644 index 0000000000..228e4ad83b --- /dev/null +++ b/packages/form/vite.config.ts @@ -0,0 +1,32 @@ +import { defineConfig } from "vite"; +import { resolve } from "path"; +import cssInjectedByJsPlugin from "vite-plugin-css-injected-by-js"; +import { hpccBundleNames } from "@hpcc-js/esbuild-plugins"; +import pkg from "./package.json" with { type: "json" }; + +const { alias, external, globals } = hpccBundleNames(pkg); + +export default defineConfig({ + build: { + lib: { + entry: resolve(__dirname, "src/index.ts"), + name: pkg.name, + fileName: "index", + }, + rollupOptions: { + external, + output: { + globals, + }, + }, + }, + resolve: { + alias + }, + esbuild: { + minifyIdentifiers: false + }, + plugins: [ + cssInjectedByJsPlugin() + ], +}); diff --git a/packages/form/vitest.workspace.ts b/packages/form/vitest.workspace.ts index fa7bb0720b..722950dd03 100644 --- a/packages/form/vitest.workspace.ts +++ b/packages/form/vitest.workspace.ts @@ -1,6 +1,6 @@ -import { defineWorkspace } from 'vitest/config'; -import baseWorkspace from '../../vitest.workspace.ts'; +import { defineWorkspace } from "vitest/config"; +import baseWorkspace from "../../vitest.workspace.ts"; export default defineWorkspace([ ...baseWorkspace -]) \ No newline at end of file +]); \ No newline at end of file diff --git a/packages/graph/.vscode/launch.json b/packages/graph/.vscode/launch.json index 7c2436335f..f41798cc0a 100644 --- a/packages/graph/.vscode/launch.json +++ b/packages/graph/.vscode/launch.json @@ -5,7 +5,7 @@ "name": "test-browser", "type": "msedge", "request": "launch", - "url": "http://localhost:8888", + "url": "http://localhost:63315", "webRoot": "${workspaceFolder}", "outFiles": [ "${workspaceFolder}/**/*.js", @@ -33,7 +33,21 @@ "name": "index.html", "request": "launch", "type": "msedge", - "url": "file:///${workspaceFolder}/index.html", + "url": "http://localhost:5173/index.html", + "runtimeArgs": [ + "--disable-web-security" + ], + "webRoot": "${workspaceFolder}", + "outFiles": [ + "${workspaceFolder}/**/*.js", + "!**/node_modules/**" + ] + }, + { + "name": "index-preview.html", + "request": "launch", + "type": "msedge", + "url": "file://${workspaceFolder}/index-preview.html", "runtimeArgs": [ "--disable-web-security" ], diff --git a/packages/graph/index-preview.html b/packages/graph/index-preview.html new file mode 100644 index 0000000000..cfbe3691d9 --- /dev/null +++ b/packages/graph/index-preview.html @@ -0,0 +1,144 @@ + + + + + Home + + + + + + + + + +

ESM Quick Test

+
+ +
+ + + + + \ No newline at end of file diff --git a/packages/graph/index.html b/packages/graph/index.html index 09b31d5b6e..6e2052755c 100644 --- a/packages/graph/index.html +++ b/packages/graph/index.html @@ -26,68 +26,16 @@ - - - - - -

ESM Quick Test

-
-
+
+ - - @@ -45,24 +30,24 @@

ESM Quick Test

-->

ESM Quick Test