-
Notifications
You must be signed in to change notification settings - Fork 0
feat: refactor code for nodejs and workers that allows for faster proces #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
rajatkumar
commented
Jun 9, 2025
- Added CLI improvements using the commander library
- Enhanced pixel matching functionality with new options
- Added support for worker-based processing for large images
- Improved anti-aliasing detection and handling
- Added new benchmarking capabilities
- Added worker-based processing for large images
- Improved pixel comparison algorithms
- Enhanced color difference calculations
Releases: @sitepager/pixel-match@0.2.0 [skip ci]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors and enhances the pixel-level image comparison library by introducing worker-based processing, CLI improvements via the commander library, and improved build configurations to support multiple targets (browser and Node.js).
- Updated tsup build configuration for separate browser, Node.js, and CLI targets
- Refactored worker implementations and consolidated test suites for both small and large images
- Revised documentation, benchmarks, and package exports for clearer usage in both environments
Reviewed Changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tsup.config.ts | Updated build targets; commented out CLI shebang for potential cross-platform concerns |
| test/* | Refactored and consolidated test utilities and removed legacy test file |
| src/worker.ts & src/node/* | Added and updated worker implementations for parallel image processing |
| src/browser/index.ts | Refactored browser entry with updated options handling |
| package.json | Modified exports and dependency versions; added commander |
| bench/* | Updated benchmark scripts to use shared utilities and new exports |
| README.md | Revised CLI usage, examples, and documentation for browser vs Node.js patterns |
| CHANGELOG.md | Updated version and change log details |
Comments suppressed due to low confidence (2)
package.json:14
- [nitpick] The type definitions for the browser and Node.js builds use different file extensions ('.d.ts' vs '.d.mts'); please verify that this is intentional so that consumers receive the correct type declarations.
"types": "./dist/browser/index.d.ts",
README.md:165
- [nitpick] Consider adding an import statement for 'createWriteStream' (e.g., import { createWriteStream } from 'fs') in the Node.js usage example to ensure the snippet is self-contained.
output.pack().pipe(createWriteStream('diff.png'));
| skipNodeModulesBundle: true, | ||
| banner: { | ||
| js: '#! /usr/bin/env node', | ||
| // js: '#! /usr/bin/env node', |
Copilot
AI
Jun 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The shebang for the CLI binary is commented out; if this was unintentional, please ensure the CLI script remains executable in Unix environments. Otherwise, document the alternative approach that replaces this behavior.
| // js: '#! /usr/bin/env node', | |
| js: '#! /usr/bin/env node', |