Skip to content

Commit 8598a03

Browse files
committed
Convert viewer-datagrid to TypeScript
Signed-off-by: Andrew Stein <[email protected]> # Conflicts: # rust/perspective-viewer/src/rust/presentation.rs # rust/perspective-viewer/test/js/viewnotfound.spec.js # tools/test/results.tar.gz
1 parent 390b7ea commit 8598a03

Some content is hidden

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

57 files changed

+3461
-1575
lines changed

packages/viewer-datagrid/build.mjs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@ import { BuildCss } from "@prospective.co/procss/target/cjs/procss.js";
1616
import * as fs from "node:fs";
1717
import * as path_mod from "node:path";
1818

19+
import "zx/globals";
20+
1921
const BUILD = [
2022
{
2123
define: {
2224
global: "window",
2325
},
24-
entryPoints: ["src/js/index.js"],
26+
entryPoints: ["src/ts/index.ts"],
2527
plugins: [NodeModulesExternal()],
2628
format: "esm",
2729
loader: {
@@ -34,7 +36,7 @@ const BUILD = [
3436
define: {
3537
global: "window",
3638
},
37-
entryPoints: ["src/js/index.js"],
39+
entryPoints: ["src/ts/index.ts"],
3840
plugins: [],
3941
format: "esm",
4042
loader: {
@@ -77,6 +79,16 @@ async function compile_css() {
7779
async function build_all() {
7880
await compile_css();
7981
await Promise.all(BUILD.map(build)).catch(() => process.exit(1));
82+
try {
83+
await $`tsc --project ./tsconfig.json`.stdio(
84+
"inherit",
85+
"inherit",
86+
"inherit",
87+
);
88+
} catch (e) {
89+
console.error(e.stdout);
90+
process.exit(1);
91+
}
8092
}
8193

8294
build_all();

packages/viewer-datagrid/package.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,18 @@
66
"jsdelivr": "dist/cdn/perspective-viewer-datagrid.js",
77
"exports": {
88
".": {
9-
"types": "./index.d.ts",
9+
"types": "./dist/esm/index.d.ts",
1010
"default": "./dist/esm/perspective-viewer-datagrid.js"
1111
},
1212
"./dist/*": "./dist/*",
13+
"./src/*": "./src/*",
1314
"./package.json": "./package.json"
1415
},
1516
"type": "module",
17+
"types": "dist/esm/index.d.ts",
1618
"files": [
1719
"dist/**/*",
18-
"index.d.ts"
20+
"src/**/*"
1921
],
2022
"scripts": {
2123
"build": "node ./build.mjs",
@@ -40,6 +42,9 @@
4042
"@prospective.co/procss": "catalog:",
4143
"@perspective-dev/esbuild-plugin": "workspace:",
4244
"@perspective-dev/test": "workspace:",
43-
"prettier": "catalog:"
45+
"@types/chroma-js": "catalog:",
46+
"prettier": "catalog:",
47+
"typescript": "catalog:",
48+
"zx": "catalog:"
4449
}
4550
}

packages/viewer-datagrid/src/js/data_listener/formatter_cache.js

Lines changed: 0 additions & 206 deletions
This file was deleted.

0 commit comments

Comments
 (0)