Skip to content

Conversation

@rajatkumar
Copy link
Contributor

  • 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

@rajatkumar rajatkumar requested a review from Copilot June 9, 2025 20:20
Copy link

Copilot AI left a 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',
Copy link

Copilot AI Jun 9, 2025

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.

Suggested change
// js: '#! /usr/bin/env node',
js: '#! /usr/bin/env node',

Copilot uses AI. Check for mistakes.
@rajatkumar rajatkumar merged commit d935667 into main Jun 9, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants