Skip to content

Resolve cross-platform linting, export notification utilities, and add Node 16 fetch compatibility#53

Open
ayushedith wants to merge 3 commits intoHookflo:mainfrom
ayushedith:main
Open

Resolve cross-platform linting, export notification utilities, and add Node 16 fetch compatibility#53
ayushedith wants to merge 3 commits intoHookflo:mainfrom
ayushedith:main

Conversation

@ayushedith
Copy link

This PR addresses several developer experience (DX) papercuts, cross-platform compatibility issues, and runtime crashes found during a routine repository audit.

🐛 Bug Fixes & Improvements

  • Node 16 fetch Fallback: Replaced the native fetch call in src/notifications/send-alert.ts with a dynamic fallback to node-fetch. Since the engines directive in package.json supports Node >=16.0.0, the pure native fetch (which is only globally available in Node 18+) was causing runtime ReferenceErrors in older environments.
  • Windows CLI Compatibility: Updated the "lint:fix" script in package.json to use escaped double-quotes ("src/**/*.ts") instead of single-quotes. Single quotes crash cmd.exe on Windows when running npm scripts.
  • CRLF Linting Resolution: Added a .prettierrc file strictly enforcing lf (Line Feed) end of lines. This resolves over 5,000 linting errors that occur when cloning the repository on Windows machines (where git defaults to CRLF).
  • Missing API Exports: Exported sendAlert and dispatchWebhookAlert from src/notifications/index.ts. Previously, developers consuming the library could not manually trigger these utility notifications.

Testing Performed

  • Successfully ran npm run prepare (tsc build).
  • Successfully tested via npm run test against all webhook configurations.
  • Confirmed npm run lint now returns cleanly (0 errors) on both Unix and Windows setups.

@socket-security
Copy link

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednode-fetch@​2.7.06910010085100
Added@​types/​node-fetch@​2.6.131001007381100

View full report

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.

1 participant