Update deps and tooling to reduce installation footprint - #218
Conversation
There was a problem hiding this comment.
Feels like this file is an artifact of some no-longer relevant setup (references to Travis CI based on where it's used). Maybe could be removable?
There was a problem hiding this comment.
I removed this file since it seemed kind of outdated. Doing so allows removing ts-node and tsconfig-paths as deps.
Could be very mistaken about whether it's used or not though!
| "@types/bindings": "^1.5.5", | ||
| "@types/jest": "^30.0.0", | ||
| "@types/node": "^26.1.1", | ||
| "@types/node": "22 || 24 || 26", |
There was a problem hiding this comment.
I believe this is still needed as direct dependency because the exported types for the module reference types that are provided by it. Always kind of uncertain about the requirements between @types/node and published modules tbh 😅
I updated the versions to make it more flexible for consuming projects, as I don't think the types used by this module have changed drastically between these LTS versions.
This PR brings in quite a few changes and I fully acknowledge that there may be some reversions or adjustments based on maintainers' preferences.
Moves some of the still-necessary dependencies as dev-only, which prevents unnecessary installation from consuming projects. Basically
@types/*modules and things used only in the tests.Leans into Node's support for TypeScript files via type-stripping, which is primarily relevant for the tests that are written in TypeScript. This removes the need for something like ts-node.
Updates the TypeScript configuration to align with Node-based projects, most notably related to the native TS support and a stricter adherence to Node-oriented ESM module syntax (e.g. requiring file extension names in imports).
Replaces Jest with Node's built-in test runner. This means updates to the npm scripts that run the tests as well as minor updates to the tests themselves. Note that as of now, I have not made use of the built-in assertions module. Instead, I installed
expect, which is Jest's standalone module for its assertions API. This avoids needing to completely rewrite the tests for now.Some open questions:
Is there any interest in moving away from Jest's expect API and instead using Node's built-in assertions for the tests? This would further reduce the dependency usage for this project (although it doesn't affect consuming projects). Porting the tests would be pretty straightforward from what I can tell.
Is
@faker-js/fakerstill actually used in practice? I noticed that there's some commented-out lines in the memory-leak tests that would make use of it. Not sure if those are still relevant or not but if not, could remove that dependency as well.Deps graph before and after this PR (when installing as consumer):
Before (107 dependencies):
After (25 dependencies):