Skip to content

Conversation

@fraxken
Copy link
Member

@fraxken fraxken commented Nov 30, 2025

No description provided.

@changeset-bot
Copy link

changeset-bot bot commented Nov 30, 2025

🦋 Changeset detected

Latest commit: 1c32df3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@nodesecure/scanner Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

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 the scanner to implement proper error event handling through the Logger class. The key improvement is that errors during tarball scanning are now emitted as events instead of being silently ignored, allowing consumers to track and assert on errors that occur during dependency walking.

  • Added typed event map to Logger class for better type safety
  • Implemented error event emission in scanDirOrArchiveEx function
  • Updated tests to verify error events are properly emitted

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
workspaces/scanner/src/class/logger.class.ts Added error event to ScannerLoggerEvents and defined LoggerEventsMap type for type-safe event handling
workspaces/scanner/src/depWalker.ts Changed error handling in scanDirOrArchiveEx to emit error events instead of silently ignoring them; added logger parameter
workspaces/scanner/test/depWalker.spec.ts Added error tracking to tests, verified error events are emitted correctly, and refactored to use shared test options constant
workspaces/scanner/test/fixtures/depWalker/slimio.config.json Changed version to trigger specific test error conditions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@fraxken
Copy link
Member Author

fraxken commented Nov 30, 2025

related to #504

@fraxken fraxken force-pushed the scanner-logger-error branch from a5b8170 to 7609a81 Compare December 2, 2025 13:09
@fraxken fraxken marked this pull request as ready for review December 2, 2025 14:29
@fraxken fraxken force-pushed the scanner-logger-error branch from 7609a81 to 1c32df3 Compare December 2, 2025 14:31
@fraxken fraxken merged commit a06ba7c into master Dec 2, 2025
5 checks passed
@fraxken fraxken deleted the scanner-logger-error branch December 2, 2025 20:59
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.

4 participants