You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- update the test action with a node version matrix
- get the tests running on macos newer than 13
- there's a single test that fails, consistently, on macos > 13
- update the publish job to include node 22 prebuilds
- we're gonna have super fat binaries until we can get an optionalDependencies-style setup going
- run linux-arm tests on PRs
- update version number
The patch in this commit resolves the build issue noted in nodegit#2023 by applying a patch to zlib, which is a little gross but gets us building at least
This is [@readme/nodegit](https://www.npmjs.com/package/@readme/nodegit), a fork of the original NodeGit library that provides Node.js bindings to libgit2. This fork is maintained by Readme and includes compatibility updates for Node.js 20 and 22.
6
+
7
+
## Quick Start
8
+
9
+
### Prerequisites
10
+
- Node.js >= 20 (supports Node 20 and 22)
11
+
- Git installed on your system
12
+
- Build tools (automatically handled during install)
13
+
14
+
### Installation
15
+
```bash
16
+
npm install
17
+
```
18
+
19
+
The install process automatically:
20
+
1. Runs preinstall scripts
21
+
2. Builds native bindings using node-gyp
22
+
3. Runs postinstall scripts
23
+
24
+
## Running Tests
25
+
26
+
### Full Test Suite
27
+
```bash
28
+
npm test
29
+
```
30
+
This runs linting followed by the complete test suite.
31
+
32
+
### Tests Only (Skip Linting)
33
+
```bash
34
+
npm run mocha
35
+
```
36
+
37
+
### Debug Tests
38
+
```bash
39
+
npm run mochaDebug
40
+
```
41
+
Runs tests with inspector for debugging.
42
+
43
+
### Run Specific Tests
44
+
```bash
45
+
# Run tests matching a pattern
46
+
npm run mocha -- --grep "pattern"
47
+
48
+
# Example: Run only commit tests
49
+
npm run mocha -- --grep "commit"
50
+
51
+
# Example: Run a specific test
52
+
npm run mocha -- --grep "can amend commit"
53
+
```
54
+
55
+
### Linting Only
56
+
```bash
57
+
npm run lint
58
+
```
59
+
60
+
## Development Commands
61
+
62
+
### Building
63
+
```bash
64
+
# Full rebuild (includes code generation)
65
+
npm run rebuild
66
+
67
+
# Debug build
68
+
npm run rebuildDebug
69
+
70
+
# Recompile only (skip code generation)
71
+
npm run recompile
72
+
```
73
+
74
+
### Code Generation
75
+
```bash
76
+
# Generate missing tests
77
+
npm run generateMissingTests
78
+
79
+
# Generate native code bindings
80
+
npm run generateNativeCode
81
+
82
+
# Generate JSON API definitions
83
+
npm run generateJson
84
+
```
85
+
86
+
## Test Structure
87
+
88
+
Tests are located in:
89
+
-`test/tests/` - Main test files
90
+
-`test/utils/` - Test utilities
91
+
-`test/repos/` - Test repositories
92
+
93
+
### Common Test Issues
94
+
95
+
**macOS Version Compatibility**: Tests may fail when upgrading macOS versions due to differences in Git behavior, file system precision, or system libraries. Hardcoded expected commit IDs are particularly sensitive to environment changes.
96
+
97
+
**Memory Management**: Tests use `--expose-gc` flag to test garbage collection behavior with native bindings.
98
+
99
+
**SSH Tests**: Some tests require SSH keys located in `test/id_rsa*` files.
100
+
101
+
## CI/CD
102
+
103
+
GitHub Actions workflows:
104
+
-**tests.yml**: Runs tests on Ubuntu 22.04 and macOS-26
105
+
-**publish.yml**: Handles package publishing
106
+
107
+
## Architecture
108
+
109
+
This library provides JavaScript bindings to the libgit2 C library:
0 commit comments