Skip to content

Conversation

@jessealama
Copy link

Summary

Updates all outdated npm dependencies to their latest CommonJS-compatible versions. All tests pass successfully.

Changes

Updated to latest versions:

  • columnify: 1.5.4 → 1.6.0
  • csvtojson: 2.0.10 → 2.0.13
  • jmespath: 0.15.0 → 0.16.0
  • validator: 11.0.0 → 13.15.20
  • yargs: 13.2.4 → 18.0.0
  • husky: 3.0.1 → 9.1.7
  • jest: 25.1.0 → 30.2.0
  • jest-fetch-mock: 2.1.2 → 3.0.3
  • pkg: 4.4.7 → 5.8.1

Updated to last CommonJS version:

Several packages have moved to ESM-only (ES modules) in their latest versions. Since this project uses CommonJS (require/module.exports), these packages were updated to their last CommonJS-compatible versions:

  • chalk: 2.4.2 → 4.1.2 (v5+ is ESM-only)
  • get-stream: 5.1.0 → 6.0.1 (v7+ is ESM-only)
  • is-stream: 2.0.0 → 2.0.1 (v3+ is ESM-only)
  • node-fetch: 2.6.0 → 2.7.0 (v3+ is ESM-only)

Discussion

To upgrade to the latest versions of chalk, get-stream, is-stream, and node-fetch, the project would need to be converted from CommonJS to ESM, which would be a breaking change for consumers of this library. This PR takes the conservative approach of staying on CommonJS while still updating to the latest compatible versions.

If there's interest in migrating to ESM in the future, that would allow upgrading these packages to their latest versions (chalk 5.x, get-stream 9.x, is-stream 4.x, node-fetch 3.x).

Testing

All existing tests pass:

  • ✅ 8/8 test suites passed
  • ✅ 34/34 tests passed (1 skipped)
  • ✅ Coverage maintained

Note

Husky 9.x has a different configuration approach than v3. The git hooks configuration in package.json may need to be migrated to the new format in a follow-up PR if git hooks are actively used.

Previously, JSON parsing errors were only logged to console but tests
still reported as passing. Now parsing errors are properly reported as
test failures with descriptive error messages, and the tool exits with
code 1 when JSON-LD is malformed.

- Add __detectJsonLdErrors() helper to scan HTML for malformed JSON-LD
- Modify structuredDataTestHtml() to detect JSON parsing errors before validation
- Modify _structuredDataTest() to add parsing errors as failed tests
- Add comprehensive test suite for malformed JSON-LD handling
- Test valid JSON-LD processing even when invalid JSON-LD is present
Updated all outdated dependencies to their latest CommonJS-compatible versions:

**Updated to latest:**
- columnify: 1.5.4 → 1.6.0
- csvtojson: 2.0.10 → 2.0.13
- jmespath: 0.15.0 → 0.16.0
- validator: 11.0.0 → 13.15.20
- yargs: 13.2.4 → 18.0.0
- husky: 3.0.1 → 9.1.7
- jest: 25.1.0 → 30.2.0
- jest-fetch-mock: 2.1.2 → 3.0.3
- pkg: 4.4.7 → 5.8.1

**Updated to last CommonJS version:**
Several packages have moved to ESM-only in their latest versions. Since this
project uses CommonJS (require/module.exports), we've updated these to their
last CommonJS-compatible versions:
- chalk: 2.4.2 → 4.1.2 (v5+ is ESM-only)
- get-stream: 5.1.0 → 6.0.1 (v7+ is ESM-only)
- is-stream: 2.0.0 → 2.0.1 (v3+ is ESM-only)
- node-fetch: 2.6.0 → 2.7.0 (v3+ is ESM-only)

All tests pass successfully with the updated dependencies.
This was referenced Oct 29, 2025
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