agglomerative-clustering 3.0.0-beta.3 → 3.0.0-beta.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agglomerative-clustering",
3
- "version": "3.0.0-beta.3",
3
+ "version": "3.0.0-beta.5",
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",
@@ -50,9 +50,18 @@
50
50
  }
51
51
  },
52
52
  "./worker": {
53
- "types": "./dist/worker.d.ts",
54
- "import": "./dist/worker.mjs",
55
- "default": "./dist/worker.mjs"
53
+ "import": {
54
+ "types": "./dist/worker.d.ts",
55
+ "default": "./dist/worker.mjs"
56
+ },
57
+ "require": {
58
+ "types": "./dist/worker.d.cts",
59
+ "default": "./dist/worker.cjs"
60
+ },
61
+ "default": {
62
+ "types": "./dist/worker.d.ts",
63
+ "default": "./dist/worker.mjs"
64
+ }
56
65
  },
57
66
  "./clustering.wasm": "./dist/clustering.wasm",
58
67
  "./package.json": "./package.json"
@@ -73,9 +82,9 @@
73
82
  ],
74
83
  "scripts": {
75
84
  "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",
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",
85
+ "build:cjs": "cross-env BABEL_ENV=cjs babel src --out-dir dist --extensions \".js\" --ignore \"src/worker-thread.js\" --out-file-extension .cjs && node scripts/patch-cjs.mjs",
77
86
  "build:esm": "cross-env BABEL_ENV=esm babel src --out-dir dist --extensions \".js\" --out-file-extension .mjs",
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');\"",
87
+ "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'); fs.writeFileSync('dist/worker.d.cts', fs.readFileSync('src/worker.d.ts', 'utf8').replaceAll(\\\"'./index.js'\\\", \\\"'./index.cjs'\\\"));\"",
79
88
  "build:js": "npm run build:types && npm run build:cjs && npm run build:esm",
80
89
  "build": "node scripts/sync-version.mjs --check && npm run build:wasm && npm run build:js",
81
90
  "version": "node scripts/sync-version.mjs && git add src/shared.js src/version.hpp",
@@ -101,6 +110,8 @@
101
110
  "fast-png": "^8.0.0",
102
111
  "gifenc": "^1.0.3",
103
112
  "image-q": "^4.0.0",
113
+ "jest": "^30.5.2",
114
+ "jest-environment-jsdom": "^30.5.2",
104
115
  "libimagequant-wasm": "^0.3.0",
105
116
  "mkdirp": "^3.0.1",
106
117
  "omggif": "^1.0.10",