Skip to content

Commit 5712eb7

Browse files
committed
fix: Convert JSDelivr purge to ESM
Signed-off-by: Gordon Smith <[email protected]>
1 parent 46330d2 commit 5712eb7

File tree

12 files changed

+64
-228
lines changed

12 files changed

+64
-228
lines changed

README.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,45 @@ This repository contains a collection of useful c++ libraries compiled to WASM f
1212
Built with:
1313
- [emsdk](https://github.com/emscripten-core/emsdk) - v3.1.24
1414

15+
## Homepage and Documents
1516

16-
See [Home Page](https://hpcc-systems.github.io/hpcc-js-wasm/) for more information and documentation.
17+
* [Homepage](https://hpcc-systems.github.io/hpcc-js-wasm/)
18+
* [Base91](https://hpcc-systems.github.io/hpcc-js-wasm/classes/base91.Base91.html)
19+
* [Expat](https://hpcc-systems.github.io/hpcc-js-wasm/classes/expat.Expat.html)
20+
* [Graphviz](https://hpcc-systems.github.io/hpcc-js-wasm/classes/base91.Base91.html)
21+
* [Zstd](https://hpcc-systems.github.io/hpcc-js-wasm/classes/zstd.Zstd.html)
1722

23+
## Quick Migration Example
1824

25+
v1.x.x
26+
```ts
27+
import { graphviz, wasmFolder } from "@hpcc-js/wasm";
28+
29+
wasmFolder("https://cdn.jsdelivr.net/npm/@hpcc-js/wasm/dist");
30+
31+
const dot = "digraph G { Hello -> World }";
32+
33+
graphviz.dot(dot).then(svg => {
34+
const div = document.getElementById("placeholder");
35+
div.innerHTML = svg;
36+
});
37+
38+
graphvizVersion.then(version => console.log(version));
39+
```
40+
41+
v2.x.x
42+
```ts
43+
import { Graphviz } from "@hpcc-js/wasm/graphviz";
44+
45+
const graphviz = await Graphviz.load();
46+
47+
const dot = "digraph G { Hello -> World }";
48+
const svg = graphviz.dot(dot);
49+
console.log(graphviz.version());
50+
```
51+
52+
Notes:
53+
* Import must specify which wasm library your using
54+
* wasmFolder is no longer needed
55+
* All wasm libraries have the same asynchronous load pattern
56+
- `const instance = await Wasm.load();`

docs/dist

-27.8 KB
Binary file not shown.

docs/guide/base91.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/guide/expat.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/guide/graphviz.md

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

docs/guide/zstd.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/hpccsystemsdark.png

21.2 KB
Loading

docs/index.md

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,14 @@ hero:
66
xtext: Collection of wasm libraries.
77
tagline: HPCC Systems WASM Collection.
88
image:
9-
src: /hpccsystems.png
10-
alt: HPCC Systems
11-
link: https://hpccsystems.com/hpcc-systems/hpcc-js-wasm
9+
light:
10+
src: /hpccsystems.png
11+
alt: HPCC Systems
12+
link: https://hpccsystems.com/hpcc-systems/hpcc-js-wasm
13+
dark:
14+
src: /hpccsystemsdark.png
15+
alt: HPCC Systems
16+
link: https://hpccsystems.com/hpcc-systems/hpcc-js-wasm
1217
actions:
1318
- theme: brand
1419
text: Get Started
@@ -18,33 +23,16 @@ hero:
1823
link: https://github.com/hpcc-systems/hpcc-js-wasm
1924

2025
features:
21-
- title: Base91
22-
details: Base 91 WASM library, similar to Base 64 but uses more characters resulting in smaller strings.
26+
- title: Base 91
27+
details: Similar to Base 64 but uses more characters resulting in smaller strings.
2328
link: /classes/base91.Base91
2429
- title: Expat
25-
details: Expat XML parser WASM library, provides a simplified wrapper around the Expat XML Parser library.
30+
details: A popular stream-oriented XML parser library.
2631
link: /classes/expat.Expat
2732
- title: GraphViz
2833
details: The Graphviz layout algorithms take descriptions of graphs in a simple text language, and make diagrams in useful formats, such as images and SVG for web pages or display in an interactive graph browser.
2934
link: /classes/graphviz.Graphviz
3035
- title: Zstd
31-
details: The Zstandard WASM library, provides a simplified wrapper around the Zstandard c++ library.
36+
details: Zstandard is a fast compression algorithm, providing high compression ratios and is backed by an extremely fast decoder.
3237
link: /classes/zstd.Zstd
33-
34-
footer: Apache-2.0 Licensed | Copyright © 2022 hpccsystems.com
3538
---
36-
37-
38-
39-
40-
41-
<!-- ---
42-
home: true
43-
heroImage: /resources/hpccsystems.png
44-
heroAlt: HPCC Systems Logo
45-
heroText: Visualization + Web Component Suite
46-
tagline: HPCC Systems JavaScript Library
47-
actionText: Get Started
48-
actionLink: /README
49-
50-
--- -->

package.json

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,17 @@
44
"description": "hpcc-js - WASM Libraries",
55
"keywords": [
66
"graphviz",
7-
"expat",
7+
"typescript",
8+
"webassembly",
89
"wasm",
910
"dot",
10-
"twopi",
11-
"circo",
12-
"fdp",
13-
"neato",
14-
"osage",
15-
"patchwork",
16-
"xml"
11+
"zstd",
12+
"graphviz-dot",
13+
"zstandard",
14+
"expat",
15+
"base91",
16+
"expat-xml-parser",
17+
"webassemby"
1718
],
1819
"type": "module",
1920
"exports": {
@@ -68,7 +69,7 @@
6869
"clean-build": "rimraf bin build coverage dist* lib* output-* tmp types *.tsbuildinfo",
6970
"clean-docs": "rimraf docs/.vitepress/dist docs/classes docs/interfaces docs/modules docs/.nojekyll docs/README.md",
7071
"clean": "run-p clean-build clean-docs",
71-
"copy-res": "cp ./docs/hpccsystems.png ./docs/.vitepress/dist",
72+
"copy-res": "cp ./docs/*.png ./docs/.vitepress/dist",
7273
"compile": "tsc",
7374
"compile-watch": "npm run compile -- -w",
7475
"compile-cpp": "run-script-os",
@@ -158,5 +159,5 @@
158159
"bugs": {
159160
"url": "https://github.com/hpcc-systems/hpcc-js-wasm/issues"
160161
},
161-
"homepage": "https://github.com/hpcc-systems/hpcc-js-wasm#readme"
162-
}
162+
"homepage": "https://hpcc-systems.github.io/hpcc-js-wasm/"
163+
}

src/index.ts

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

0 commit comments

Comments
 (0)