agglomerative-clustering 3.0.0-beta.2 → 3.0.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +193 -26
- package/dist/clustering.cjs +3 -0
- package/dist/clustering.js +1 -1
- package/dist/clustering.wasm +0 -0
- package/dist/index.cjs +559 -1055
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.mjs +531 -1035
- package/dist/shared.cjs +204 -151
- package/dist/shared.mjs +184 -149
- package/dist/worker-thread.mjs +150 -354
- package/dist/worker.d.ts +21 -2
- package/dist/worker.mjs +548 -753
- package/package.json +7 -2
package/package.json
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agglomerative-clustering",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.4",
|
|
4
4
|
"description": "Colour palette extraction and image quantization with exact Ward clustering, in WebAssembly. Cluster an image once, then cut it to a palette of any size.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Rohan Fredriksson",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "./dist/index.cjs",
|
|
9
|
+
"module": "./dist/index.mjs",
|
|
10
|
+
"jsdelivr": "./dist/index.mjs",
|
|
11
|
+
"unpkg": "./dist/index.mjs",
|
|
9
12
|
"types": "./dist/index.d.ts",
|
|
10
13
|
"repository": {
|
|
11
14
|
"type": "git",
|
|
@@ -70,7 +73,7 @@
|
|
|
70
73
|
],
|
|
71
74
|
"scripts": {
|
|
72
75
|
"build:wasm": "mkdirp dist && em++ src/clustering.cpp -O3 -msimd128 -s WASM=1 -s MODULARIZE=1 -s EXPORT_ES6=1 -s EXPORT_NAME='createWasmModule' -s ALLOW_MEMORY_GROWTH=1 -s INITIAL_MEMORY=32MB -s MAXIMUM_MEMORY=2147483648 -s EXPORTED_FUNCTIONS=\"['_library_version','_get_clustering','_clustering_job_start','_clustering_job_step','_clustering_job_result','_clustering_job_free','_get_palette','_get_palette_from_clustering','_get_palette_weights','_quantize','_quantize_with_clustering','_quantize_with_palette','_quantize_indices','_quantize_indices_with_clustering','_quantize_indices_with_palette','_malloc','_free']\" -s EXPORTED_RUNTIME_METHODS=\"['HEAPU8']\" -o dist/clustering.js && node scripts/patch-glue.mjs",
|
|
73
|
-
"build:cjs": "cross-env BABEL_ENV=cjs babel src --out-dir dist --extensions \".js\" --ignore \"src/worker.js\",\"src/worker-thread.js\" --out-file-extension .cjs",
|
|
76
|
+
"build:cjs": "cross-env BABEL_ENV=cjs babel src --out-dir dist --extensions \".js\" --ignore \"src/worker.js\",\"src/worker-thread.js\" --out-file-extension .cjs && node scripts/patch-cjs.mjs",
|
|
74
77
|
"build:esm": "cross-env BABEL_ENV=esm babel src --out-dir dist --extensions \".js\" --out-file-extension .mjs",
|
|
75
78
|
"build:types": "mkdirp dist && node -e \"const fs = require('fs'); for (const f of ['index.d.ts', 'worker.d.ts']) {fs.copyFileSync('src/' + f, 'dist/' + f);} fs.copyFileSync('src/index.d.ts', 'dist/index.d.cts');\"",
|
|
76
79
|
"build:js": "npm run build:types && npm run build:cjs && npm run build:esm",
|
|
@@ -98,6 +101,8 @@
|
|
|
98
101
|
"fast-png": "^8.0.0",
|
|
99
102
|
"gifenc": "^1.0.3",
|
|
100
103
|
"image-q": "^4.0.0",
|
|
104
|
+
"jest": "^30.5.2",
|
|
105
|
+
"jest-environment-jsdom": "^30.5.2",
|
|
101
106
|
"libimagequant-wasm": "^0.3.0",
|
|
102
107
|
"mkdirp": "^3.0.1",
|
|
103
108
|
"omggif": "^1.0.10",
|