good-fences
good-fences copied to clipboard
Nodegit should be an optional peer dependency
When nodegit fails to install (e.g. on node 16+ on a system without the dependencies for libgit2), requiring good-fences at all fails with this require stack:
requireStack: [
'node_modules/nodegit/dist/nodegit.js',
'node_modules/good-fences/lib/utils/diffing/getFenceAndImportDiffsFromGit.js',
'node_modules/good-fences/lib/core/runner.js',
'node_modules/good-fences/lib/index.js',
]
This is because we import nodegit even when it is not being used.
We can work around this by making it an optional dependency and importing the module only when partial diff functionality is actually used (e.g. runtime require()
)
Should we consider migrating to wasm-git instead?
@Adjective-Object @smikula if switching to wasm-git
bodes better when it comes to compilation issues, please consider moving on to it.
The nodegit
compilation errors are plaguing our CI and docker setup. We had to enforce alpha nodegit release via yarn resolutions
to be able to install good-fences on Macs (x86). Now, we started getting errors on alpine linux with Node 16...