@vizzly-testing/honeydiff 0.4.1 → 0.4.3
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/CHANGELOG.md +21 -0
- package/index.js +54 -24
- package/package.json +7 -1
- package/platforms/index-aarch64-apple-darwin.node +0 -0
- package/platforms/index-aarch64-unknown-linux-gnu.node +0 -0
- package/platforms/index-x86_64-pc-windows-msvc.node +0 -0
- package/platforms/index-x86_64-unknown-linux-gnu.node +0 -0
- /package/{load-platform.js → load-platform.cjs} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,27 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.4.3] - 2025-12-01
|
|
9
|
+
|
|
10
|
+
## What's Changed
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
- Fixed ESM module loading error by renaming platform loader to `.cjs` extension. The package uses `"type": "module"` in package.json, which caused Node.js to incorrectly treat the CommonJS platform loader as ESM, resulting in import errors. The loader now uses the correct `.cjs` extension.
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
- Updated Windows build infrastructure to use Blacksmith runners for improved performance
|
|
17
|
+
|
|
18
|
+
**Full Changelog**: https://github.com/vizzly-testing/honeydiff/compare/v0.4.2...v0.4.3
|
|
19
|
+
|
|
20
|
+
## [0.4.2] - 2025-12-01
|
|
21
|
+
|
|
22
|
+
## What's Changed
|
|
23
|
+
|
|
24
|
+
### Fixed
|
|
25
|
+
- **ESM exports now work correctly in published package** - Fixed critical bug where ESM imports were broken in consuming projects (e.g., `import { compare } from '@vizzly-testing/honeydiff'` threw `SyntaxError: The requested module does not provide an export named 'compare'`). The package loader now auto-detects whether to use platform-specific binaries (published package) or the local development build. (#14)
|
|
26
|
+
|
|
27
|
+
**Full Changelog**: https://github.com/vizzly-testing/honeydiff/compare/v0.4.1...v0.4.2
|
|
28
|
+
|
|
8
29
|
## [0.4.1] - 2025-11-30
|
|
9
30
|
|
|
10
31
|
## What's Changed
|
package/index.js
CHANGED
|
@@ -2,31 +2,61 @@
|
|
|
2
2
|
* @vizzly-testing/honeydiff - Native Node.js bindings for Honeydiff
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
+
import { existsSync } from 'node:fs';
|
|
6
|
+
import { createRequire } from 'node:module';
|
|
7
|
+
import { dirname, join } from 'node:path';
|
|
8
|
+
import { fileURLToPath } from 'node:url';
|
|
9
|
+
|
|
10
|
+
const require = createRequire(import.meta.url);
|
|
11
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
12
|
+
|
|
5
13
|
let addon;
|
|
6
14
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
// Try to load the native addon:
|
|
16
|
+
// 1. First try load-platform.cjs (exists in published npm package with multi-platform binaries)
|
|
17
|
+
// 2. Fall back to index.node (exists in local development builds)
|
|
18
|
+
const platformLoaderPath = join(__dirname, 'load-platform.cjs');
|
|
19
|
+
|
|
20
|
+
if (existsSync(platformLoaderPath)) {
|
|
21
|
+
// Published package: use platform-specific loader (CommonJS)
|
|
22
|
+
addon = require(platformLoaderPath);
|
|
23
|
+
} else {
|
|
24
|
+
// Local development: use directly built index.node
|
|
25
|
+
try {
|
|
26
|
+
addon = require('./index.node');
|
|
27
|
+
} catch (e) {
|
|
28
|
+
throw new Error(
|
|
29
|
+
'@vizzly-testing/honeydiff: Failed to load native binary.\n' +
|
|
30
|
+
'If developing locally, run "cargo build --release" first.\n' +
|
|
31
|
+
'Original error: ' +
|
|
32
|
+
e.message
|
|
33
|
+
);
|
|
34
|
+
}
|
|
16
35
|
}
|
|
17
36
|
|
|
18
|
-
//
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
37
|
+
// Core comparison API
|
|
38
|
+
export const compare = addon.compare;
|
|
39
|
+
export const quickCompare = addon.quickCompare;
|
|
40
|
+
export const compareSync = addon.compareSync;
|
|
41
|
+
export const quickCompareSync = addon.quickCompareSync;
|
|
42
|
+
export const getDimensions = addon.getDimensions;
|
|
43
|
+
export const getDimensionsSync = addon.getDimensionsSync;
|
|
44
|
+
|
|
45
|
+
// WCAG Accessibility API
|
|
46
|
+
export const analyzeWcagContrast = addon.analyzeWcagContrast;
|
|
47
|
+
export const analyzeWcagContrastSync = addon.analyzeWcagContrastSync;
|
|
48
|
+
export const saveWcagOverlay = addon.saveWcagOverlay;
|
|
49
|
+
export const saveWcagOverlaySync = addon.saveWcagOverlaySync;
|
|
50
|
+
|
|
51
|
+
// Color Vision Deficiency (CVD) Simulation API
|
|
52
|
+
export const simulateColorBlindness = addon.simulateColorBlindness;
|
|
53
|
+
export const simulateColorBlindnessSync = addon.simulateColorBlindnessSync;
|
|
54
|
+
export const saveColorBlindnessSimulation = addon.saveColorBlindnessSimulation;
|
|
55
|
+
export const saveColorBlindnessSimulationSync = addon.saveColorBlindnessSimulationSync;
|
|
56
|
+
export const saveAllColorBlindnessSimulations = addon.saveAllColorBlindnessSimulations;
|
|
57
|
+
export const saveAllColorBlindnessSimulationsSync = addon.saveAllColorBlindnessSimulationsSync;
|
|
58
|
+
export const analyzeWcagForCvd = addon.analyzeWcagForCvd;
|
|
59
|
+
export const analyzeWcagForCvdSync = addon.analyzeWcagForCvdSync;
|
|
60
|
+
export const analyzeWcagAllCvd = addon.analyzeWcagAllCvd;
|
|
61
|
+
export const analyzeWcagAllCvdSync = addon.analyzeWcagAllCvdSync;
|
|
62
|
+
export const getColorBlindnessTypes = addon.getColorBlindnessTypes;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vizzly-testing/honeydiff",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
4
4
|
"description": "High-performance image diffing for Node.js - Native bindings to Honeydiff Rust library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -57,6 +57,12 @@
|
|
|
57
57
|
"load-platform.js",
|
|
58
58
|
"platforms/*.node",
|
|
59
59
|
"README.md",
|
|
60
|
+
"CHANGELOG.md",
|
|
61
|
+
"index.js",
|
|
62
|
+
"index.d.ts",
|
|
63
|
+
"load-platform.cjs",
|
|
64
|
+
"platforms/*.node",
|
|
65
|
+
"README.md",
|
|
60
66
|
"CHANGELOG.md"
|
|
61
67
|
],
|
|
62
68
|
"engines": {
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|