Skip to content

Commit 1c01a39

Browse files
authored
Merge pull request hpcc-systems#4316 from GordonSmith/V3TWEAKS_ECLWATCH_II
feat: Switch to vite for dev server and build process
2 parents b4f63e0 + fdd3cac commit 1c01a39

File tree

222 files changed

+5172
-1787
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

222 files changed

+5172
-1787
lines changed

demos/gallery/.vscode/tasks.json

+25-4
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,36 @@
11
{
22
"version": "2.0.0",
33
"tasks": [
4+
{
5+
"label": "gen-types-watch",
6+
"type": "npm",
7+
"script": "gen-types-watch",
8+
"problemMatcher": [
9+
"$tsc-watch"
10+
],
11+
"presentation": {
12+
"group": "group-build"
13+
}
14+
},
15+
{
16+
"label": "bundle-watch",
17+
"type": "npm",
18+
"script": "bundle-watch",
19+
"problemMatcher": [],
20+
"presentation": {
21+
"group": "group-build"
22+
}
23+
},
424
{
525
"label": "build",
6-
"type": "shell",
7-
"command": "npm run dev",
26+
"dependsOn": [
27+
"gen-types-watch",
28+
"bundle-watch",
29+
],
830
"group": {
931
"kind": "build",
1032
"isDefault": true
11-
},
12-
"problemMatcher": []
33+
}
1334
}
1435
]
1536
}

demos/gallery/index.html

+6-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@
1111

1212
<body>
1313
<div id="root"></div>
14-
<script type="module" src="/src/main.tsx"></script>
14+
<script type="module">
15+
import { main } from "./src/index.tsx";
16+
17+
main();
18+
19+
</script>
1520
</body>
1621

1722
</html>

demos/gallery/package.json

+15-7
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,35 @@
44
"version": "0.0.0",
55
"type": "module",
66
"scripts": {
7-
"clean": "rimraf --glob types dist *.tsbuildinfo",
7+
"clean": "rimraf --glob lib* types dist *.tsbuildinfo .turbo",
8+
"bundle": "vite build",
9+
"bundle-watch": "vite",
10+
"gen-types": "tsc --project tsconfig.json",
11+
"gen-types-watch": "npm run gen-types -- --watch",
12+
"build": "run-p gen-types bundle",
813
"lint": "eslint ./src",
9-
"dev": "vite",
10-
"preview": "vite preview",
14+
"lint-fix": "eslint --fix src/**/*.ts",
1115
"gen-filejson": "node ./util/dir2json ./samples",
12-
"build": "npm run gen-filejson",
1316
"update": "npx --yes npm-check-updates -u -t minor"
1417
},
1518
"dependencies": {
1619
"@fluentui/react-components": "9.56.2",
1720
"@fluentui/react-hooks": "8.8.16",
1821
"@fluentui/react-icons-mdl2": "1.3.80",
1922
"@fluentui/react-nav-preview": "0.10.1",
20-
"d3-random": "3"
23+
"d3-random": "3",
24+
"@hpcc-js/composite": "^3.1.1",
25+
"@hpcc-js/map": "^3.1.1"
2126
},
2227
"devDependencies": {
2328
"@types/react": "18.3.12",
2429
"@types/react-dom": "18.3.1",
2530
"@vitejs/plugin-react-swc": "3.7.1",
2631
"react": "18.3.1",
27-
"react-dom": "18.3.1",
28-
"vite": "5.4.11"
32+
"react-dom": "18.3.1"
33+
},
34+
"peerDependencies": {
35+
"react": "18.3.1",
36+
"react-dom": "18.3.1"
2937
}
3038
}

demos/gallery/samples/samples.json

+27-27
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,27 @@
299299
}
300300
]
301301
},
302+
{
303+
"path": "./samples/chart/dataMeta",
304+
"name": "dataMeta",
305+
"type": "folder",
306+
"children": [
307+
{
308+
"path": "./samples/chart/dataMeta/PieColumn.js",
309+
"name": "PieColumn.js",
310+
"type": "file",
311+
"imports": {
312+
"@hpcc-js/chart": [
313+
"Column",
314+
"Pie"
315+
],
316+
"@hpcc-js/layout": [
317+
"FlexGrid"
318+
]
319+
}
320+
}
321+
]
322+
},
302323
{
303324
"path": "./samples/chart/Gantt",
304325
"name": "Gantt",
@@ -681,27 +702,6 @@
681702
"SummaryC"
682703
]
683704
}
684-
},
685-
{
686-
"path": "./samples/chart/dataMeta",
687-
"name": "dataMeta",
688-
"type": "folder",
689-
"children": [
690-
{
691-
"path": "./samples/chart/dataMeta/PieColumn.js",
692-
"name": "PieColumn.js",
693-
"type": "file",
694-
"imports": {
695-
"@hpcc-js/chart": [
696-
"Column",
697-
"Pie"
698-
],
699-
"@hpcc-js/layout": [
700-
"FlexGrid"
701-
]
702-
}
703-
}
704-
]
705705
}
706706
]
707707
},
@@ -901,22 +901,22 @@
901901
}
902902
},
903903
{
904-
"path": "./samples/common/SVGWidget.js",
905-
"name": "SVGWidget.js",
904+
"path": "./samples/common/Shape.js",
905+
"name": "Shape.js",
906906
"type": "file",
907907
"imports": {
908908
"@hpcc-js/common": [
909-
"SVGWidget"
909+
"Shape"
910910
]
911911
}
912912
},
913913
{
914-
"path": "./samples/common/Shape.js",
915-
"name": "Shape.js",
914+
"path": "./samples/common/SVGWidget.js",
915+
"name": "SVGWidget.js",
916916
"type": "file",
917917
"imports": {
918918
"@hpcc-js/common": [
919-
"Shape"
919+
"SVGWidget"
920920
]
921921
}
922922
},

demos/gallery/src/App.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { DrawerProps, makeStyles, tokens } from "@fluentui/react-components";
33
import { useConst } from "@fluentui/react-hooks";
44
import { NavDrawer, NavDrawerBody, NavDrawerHeader } from "@fluentui/react-nav-preview";
55
import { JSEditor } from "@hpcc-js/codemirror";
6-
import { AutosizeHpccJSComponent } from "./HpccJSAdapter";
7-
import { Samples } from "./Samples";
6+
import { AutosizeHpccJSComponent } from "./HpccJSAdapter.tsx";
7+
import { Samples } from "./Samples.tsx";
88

99
function useLocationSearch() {
1010
const [search, setSearch] = React.useState(window.location.search);

demos/gallery/src/index.tsx

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import React, { StrictMode } from "react";
2+
import { createRoot } from "react-dom/client";
3+
import { FluentProvider, webLightTheme } from "@fluentui/react-components";
4+
import { App } from "./App.tsx";
5+
6+
export function main() {
7+
createRoot(document.getElementById("root")!).render(
8+
<StrictMode>
9+
<FluentProvider theme={webLightTheme}>
10+
<App />
11+
</FluentProvider>
12+
</StrictMode>
13+
);
14+
}

demos/gallery/src/main.tsx

-14
This file was deleted.

demos/gallery/tsconfig.json

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"emitDeclarationOnly": true,
88
"declaration": true,
99
"declarationDir": "types",
10+
"jsx": "react",
1011
"strict": false,
1112
"noImplicitAny": false,
1213
"noImplicitThis": false,

demos/gallery/vite.config.ts

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { defineConfig } from "vite";
2+
import { resolve } from "path";
3+
import cssInjectedByJsPlugin from "vite-plugin-css-injected-by-js";
4+
import { hpccBundleNames } from "@hpcc-js/esbuild-plugins";
5+
import pkg from "./package.json" with { type: "json" };
6+
7+
const { alias, external, globals } = hpccBundleNames(pkg);
8+
9+
export default defineConfig({
10+
build: {
11+
lib: {
12+
entry: resolve(__dirname, "src/index.tsx"),
13+
name: pkg.name,
14+
fileName: "index",
15+
},
16+
rollupOptions: {
17+
external,
18+
output: {
19+
globals,
20+
},
21+
},
22+
sourcemap: true
23+
},
24+
resolve: {
25+
alias
26+
},
27+
esbuild: {
28+
minifyIdentifiers: false
29+
},
30+
plugins: [
31+
cssInjectedByJsPlugin()
32+
],
33+
});

demos/imdb/package.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,5 @@
1919
"@hpcc-js/util": "^3.1.0",
2020
"d3-fetch": "^1"
2121
},
22-
"devDependencies": {
23-
"vite": "5.4.11"
24-
}
22+
"devDependencies": {}
2523
}

0 commit comments

Comments
 (0)