Skip to content

Commit d3e92a3

Browse files
committed
trade parcel for vite
1 parent a14d553 commit d3e92a3

File tree

18 files changed

+1450
-3040
lines changed

18 files changed

+1450
-3040
lines changed

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,6 @@ typings/
5757
# dotenv environment variables file
5858
.env
5959

60-
# parcel-bundler caches
61-
.parcel-cache
62-
6360
# built files
6461
**/src/**/*.js
6562
docs/**/*.map

package-lock.json

Lines changed: 1177 additions & 2999 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,14 @@
2222
"watch-css": "npm run watch-css --workspaces --if-present",
2323
"watch-typescript": "npm run watch-typescript --workspaces --if-present",
2424
"specs": "npm-run-all --parallel specs-watch-typescript specs-watch",
25-
"serve-es6": "parcel serve ./test/sanddance-test-es6.html --port 8086 --open --no-autoinstall",
26-
"start-es6": "npm-run-all --parallel watch-typescript watch-css serve-es6",
27-
"serve-app": "parcel serve ./test/sanddance-app.html --port 8085 --open --no-autoinstall",
28-
"streamlit-dev": "parcel serve ./test/streamlit_sanddance.html --port 8087 --open --no-autoinstall",
29-
"data-inference-dev": "parcel serve ./test/data-inference.html --port 8088 --open --no-autoinstall",
25+
"serve-app": "npm run dev --workspace @msrvida/sanddance-app",
3026
"start": "npm-run-all --parallel watch-typescript watch-css serve-app",
31-
"parcel": "npm run parcel --workspaces --if-present",
3227
"restore-dist": "git checkout -q -- ./packages/sanddance/dist/umd/sanddance.d.ts ./packages/sanddance-react/dist/umd/sanddance-react.d.ts ./packages/vega-deck.gl/dist/umd/vega-deck.gl.d.ts ./packages/vega-morphcharts/dist/umd/vega-morphcharts.d.ts ./packages/sanddance-specs/dist/umd/sanddance-specs.d.ts ./packages/data-inference/dist/umd/data-inference.d.ts",
33-
"clean-parcel-cache": "rimraf ./.parcel-cache/ && rimraf --glob ./packages/**/.cache/ && rimraf --glob ./packages/**/.parcel-cache/",
34-
"clean-build": "npm run clean-parcel-cache && rimraf --glob ./packages/**/dist/",
28+
"clean-build": "rimraf --glob ./packages/**/dist/",
3529
"clean": "npm run clean --workspaces --if-present && npm run clean-build && npm run restore-dist",
3630
"remove-pem": "rimraf --glob **/*.pem && rimraf --glob **/*.key",
3731
"vega-upgrade": "npm run remove-vega --workspaces --if-present && git checkout -- \"**/package.json\" && node ./scripts/vega-version.mjs",
38-
"deploy": "npm run clean-parcel-cache && npm run deploy --workspaces --if-present",
32+
"deploy": "npm run deploy --workspaces --if-present",
3933
"test": "npm run eslint && npm run test --workspaces --if-present",
4034
"dev": "npm run dev --workspace dev --if-present",
4135
"pbiviz": "npm run start -w powerbi",
@@ -56,8 +50,6 @@
5650
"@deck.gl/layers": "8.3.7",
5751
"@fluentui/react": "^8",
5852
"@luma.gl/core": "8.3.1",
59-
"@parcel/transformer-sass": "^2.16.1",
60-
"@parcel/watcher": "^2.5.1",
6153
"@rollup/plugin-buble": "^1.0.3",
6254
"@rollup/plugin-commonjs": "^29.0.0",
6355
"@rollup/plugin-json": "^6.1.0",
@@ -75,7 +67,6 @@
7567
"@typescript-eslint/parser": "^8.33.1",
7668
"@uifabric/styling": "^7.25.1",
7769
"@vscode/vsce": "^3.6.0",
78-
"canvas": "^3.2.0",
7970
"core-js": "3.2.1",
8071
"d3-color": "^3.1.0",
8172
"d3-ease": "^1.0.5",
@@ -94,14 +85,13 @@
9485
"mocha": "^10.1.0",
9586
"morphcharts": "^1",
9687
"npm-run-all": "^4.1.5",
97-
"parcel": "^2.16.1",
9888
"process": "^0.11.10",
9989
"react": ">=16.8.0 <18.0.0",
10090
"react-dom": ">=16.8.0 <18.0.0",
10191
"regenerator-runtime": "^0.13.3",
10292
"rimraf": "^6.1.2",
10393
"rollup": "^4.53.3",
104-
"sass": "^1.32.4",
94+
"sass": "^1.94.2",
10595
"temp-write": "^3.4.0",
10696
"ts-loader": "^9.3.1",
10797
"tsx-create-element": "^2.2.9",
@@ -110,23 +100,11 @@
110100
"vega": "^6.2.0",
111101
"vega-datasets": "2.8.1",
112102
"vega-typings": "^2.1.0",
103+
"vite": "^7.2.6",
113104
"vscode-test": "^1.3.0",
114105
"webpack": "^5.52.0",
115106
"webpack-cli": "^4.8.0"
116107
},
117-
"babel": {
118-
"presets": [
119-
"es2015"
120-
]
121-
},
122-
"alias": {
123-
"react": {
124-
"global": "React"
125-
},
126-
"react-dom": {
127-
"global": "ReactDOM"
128-
}
129-
},
130108
"workspaces": {
131109
"packages": [
132110
"extensions/*",

packages/sanddance-app/index.html

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
8+
<title>Document</title>
9+
<style type="text/css">
10+
html,
11+
body {
12+
height: 100%;
13+
margin: 0;
14+
}
15+
16+
body {
17+
font-family: 'Segoe UI', sans-serif;
18+
}
19+
20+
select,
21+
button,
22+
input {
23+
font-family: 'Segoe UI', sans-serif;
24+
}
25+
26+
#app {
27+
position: absolute;
28+
top: 0;
29+
left: 0;
30+
right: 0;
31+
bottom: 0;
32+
}
33+
</style>
34+
<link rel="stylesheet" type="text/css" href="./src/css/sanddance-app.scss" />
35+
<link rel="shortcut icon" href="/favicon.ico" />
36+
</head>
37+
38+
<body>
39+
<!-- link to JSON files so we can get a url from the bundler -->
40+
<a class="sanddance-app-static-content" id="demovote" data-display-name="Demo Vote" data-type="tsv"
41+
href="/sample-data/demovote.tsv"></a>
42+
<a class="sanddance-app-static-content" id="titanic" data-display-name="Titanic" data-type="tsv"
43+
href="/sample-data/titanicmaster.tsv"></a>
44+
45+
<script>
46+
var themeColors = {
47+
"dark": {
48+
defaultCube: [128, 225, 255, 255]
49+
},
50+
"light": {
51+
defaultCube: [128, 225, 255, 255]
52+
}
53+
};
54+
var insights = {
55+
"titanic": {
56+
"columns": {
57+
"uid": "Name",
58+
"x": "Gender",
59+
"y": "Joined",
60+
"color": "Survived",
61+
"z": "TicketCost",
62+
"size": "TicketCost",
63+
"sort": "Survived"
64+
},
65+
"scheme": "dual_redgreen",
66+
"chart": "barchart",
67+
"view": "2d"
68+
},
69+
"demovote": {
70+
"columns": {
71+
"uid": "Id",
72+
"x": "Longitude",
73+
"y": "Latitude",
74+
"color": "Obama",
75+
"z": "Education",
76+
"size": "TotalPop",
77+
"sort": "State"
78+
},
79+
"scheme": "redblue",
80+
"chart": "scatterplot",
81+
"view": "3d",
82+
"colorBin": "quantize"
83+
}
84+
};
85+
var options = {
86+
"*": {
87+
"chartPrefs": {
88+
"*": {
89+
"*": {
90+
"*": {
91+
"signalValues": {
92+
"RoleColor_BinCountSignal": 7
93+
}
94+
}
95+
}
96+
}
97+
}
98+
},
99+
"titanic": {
100+
"chartPrefs": {
101+
"barchart": {
102+
"color": {
103+
"Gender": {
104+
"scheme": "set2"
105+
}
106+
}
107+
}
108+
}
109+
},
110+
"demovote": {
111+
"chartPrefs": {
112+
"*": {
113+
"color": {
114+
"Winner": {
115+
"scheme": "dual_bluered"
116+
}
117+
}
118+
},
119+
"treemap": {
120+
"*": {
121+
"*": {
122+
"columns": {
123+
"size": "TotalPop"
124+
}
125+
}
126+
}
127+
},
128+
"stacks": {
129+
"*": {
130+
"*": {
131+
"signalValues": {
132+
"RoleX_BinsSignal": 30,
133+
"RoleY_BinsSignal": 30
134+
}
135+
}
136+
}
137+
}
138+
},
139+
"tooltipExclusions": ["Id", "Latitude", "Longitude"]
140+
}
141+
};
142+
</script>
143+
144+
<main id="app"></main>
145+
146+
<script src="https://unpkg.com/react@17/umd/react.development.js" crossorigin></script>
147+
<script src="https://unpkg.com/react-dom@17/umd/react-dom.development.js" crossorigin></script>
148+
<script type="module" src="./src/index.tsx"></script>
149+
150+
</body>
151+
152+
</html>

packages/sanddance-app/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"watch-typescript": "tsc -p . -w",
1010
"build-css": "sass ./src/css/sanddance-app.scss ./dist/css/sanddance-app.css",
1111
"build:07": "npm run build-typescript && npm run bundle && npm run build-css",
12-
"bundle": "parcel build ./dist/es6/index.js --no-autoinstall --no-cache"
12+
"bundle": "vite build",
13+
"dev": "vite --config vite.dev.config.js"
1314
},
1415
"targets": {
1516
"main": false,
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { defineConfig } from 'vite';
2+
import { resolve } from 'path';
3+
4+
export default defineConfig({
5+
define: {
6+
'process.env': process.env,
7+
},
8+
build: {
9+
lib: {
10+
entry: resolve(__dirname, 'dist/es6/index.js'),
11+
name: 'SandDanceApp',
12+
formats: ['umd'],
13+
fileName: () => 'sanddance-app.js',
14+
},
15+
outDir: 'dist/umd',
16+
emptyOutDir: true,
17+
sourcemap: false,
18+
minify: false,
19+
rollupOptions: {
20+
external: ['react', 'react-dom'],
21+
output: {
22+
globals: {
23+
'react': 'React',
24+
'react-dom': 'ReactDOM',
25+
},
26+
},
27+
},
28+
},
29+
});
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { defineConfig } from 'vite';
2+
import { resolve } from 'path';
3+
4+
export default defineConfig({
5+
publicDir: resolve(__dirname, '../../docs'),
6+
server: {
7+
open: true,
8+
},
9+
});

packages/sanddance-explorer/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"watch-typescript": "tsc -p . -w",
1919
"build-css": "sass ./src/css/sanddance-explorer.scss ./dist/css/sanddance-explorer.css",
2020
"watch-css": "sass ./src/css/sanddance-explorer.scss ./dist/css/sanddance-explorer.css --watch",
21-
"bundle": "parcel build ./bundle/umd.js --no-autoinstall --no-cache",
21+
"bundle": "vite build",
2222
"deploy": "node ./scripts/deploy.js",
2323
"prebuild:06": "node ./scripts/prebuild.js",
2424
"build:06": "npm run build-typescript && node ../../scripts/version.js && npm run bundle && npm run build-css"
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { defineConfig } from 'vite';
2+
import { resolve } from 'path';
3+
4+
export default defineConfig({
5+
build: {
6+
lib: {
7+
entry: resolve(__dirname, 'bundle/umd.js'),
8+
name: 'SandDanceExplorer',
9+
formats: ['umd'],
10+
fileName: () => 'sanddance-explorer.js',
11+
},
12+
outDir: 'dist/umd',
13+
emptyOutDir: true,
14+
sourcemap: false,
15+
minify: false,
16+
rollupOptions: {
17+
external: ['react', 'react-dom'],
18+
output: {
19+
globals: {
20+
'react': 'React',
21+
'react-dom': 'ReactDOM',
22+
},
23+
},
24+
},
25+
},
26+
});

packages/sanddance-react/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
"dist"
1414
],
1515
"scripts": {
16-
"uitest": "parcel serve ./test/index.html --open --no-autoinstall --no-cache",
1716
"eslint": "eslint -c ../../eslint.config.mjs --fix ./src/**/*.ts*",
1817
"deploy": "node ./scripts/deploy.js",
1918
"watch-typescript": "tsc -p . -w",

0 commit comments

Comments
 (0)