@swimlane/nodegit 1.1.5 → 2.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,12 @@
1
+ extends:
2
+ - "@commitlint/config-conventional"
3
+ rules:
4
+ header-max-length:
5
+ - 2
6
+ - "always"
7
+ - 200
8
+ body-max-line-length:
9
+ - 1
10
+ - "always"
11
+ - "Infinity"
12
+
@@ -0,0 +1,19 @@
1
+ name: "Lint PR"
2
+
3
+ on:
4
+ pull_request:
5
+ types:
6
+ - opened
7
+ - edited
8
+ - synchronize
9
+
10
+ permissions:
11
+ contents: write
12
+ pull-requests: write
13
+
14
+ jobs:
15
+ main:
16
+ uses: "swimlane/shared-workflows/.github/workflows/lint-pr.yml@v3"
17
+ secrets:
18
+ GH_APP_ID: ${{ secrets.GH_APP_ID }}
19
+ GH_APP_PRIVATE_KEY: ${{ secrets.GH_APP_PRIVATE_KEY }}
@@ -1,9 +1,14 @@
1
+ name: Publish
1
2
  on:
2
3
  push:
3
4
  tags:
4
5
  - v*
5
6
  workflow_dispatch:
6
7
 
8
+ concurrency:
9
+ group: publish-${{ github.ref }}
10
+ cancel-in-progress: true
11
+
7
12
  jobs:
8
13
  build:
9
14
  # TODO: should we run the tests, or can we assume that a v* tag ought to
@@ -11,20 +16,14 @@ jobs:
11
16
  name: build
12
17
  strategy:
13
18
  matrix:
14
- node: [20.0.0]
19
+ node: [24.x]
15
20
  os:
16
21
  # macos-14 is arm64 (m1)
17
22
  - name: darwin
18
23
  host: macos-14
19
24
 
20
- # macos-13 is x86
21
- - name: mac-x64
22
- host: macos-13
23
-
24
- # ubuntu-20.04 is x86. Still no arm linux runners yet
25
- # https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories
26
- - name: linux
27
- host: ubuntu-20.04
25
+ - name: linux-amd
26
+ host: ubuntu-24.04
28
27
  env:
29
28
  CC: clang
30
29
  CXX: clang++
@@ -37,7 +36,7 @@ jobs:
37
36
  submodules: true
38
37
  - uses: actions/setup-node@v4
39
38
  with:
40
- node-version: 20.0.0
39
+ node-version: ${{ matrix.node }}
41
40
  check-latest: true
42
41
  - name: Prebuildify
43
42
  run: |
@@ -53,40 +52,57 @@ jobs:
53
52
  path: ./prebuilds
54
53
  retention-days: 14
55
54
 
56
- cross-compile:
57
- name: "cross compile linux/arm"
58
- runs-on: ubuntu-20.04
55
+ build-linux-glibc-arm:
56
+ name: "Build Linux glibc ARM"
57
+ runs-on: large-arm-on-demand
59
58
  steps:
60
59
  - uses: actions/checkout@v4
61
- - uses: docker/setup-qemu-action@v3
60
+ with:
61
+ submodules: true
62
62
  - name: build linux glibc arm
63
63
  run: |
64
64
  docker build --platform=linux/arm64 --tag nodegit-linux-glibc-arm64 -f scripts/Dockerfile.debian .
65
65
  docker create --platform=linux/arm64 --name nodegit-linux-glibc-arm64 nodegit-linux-glibc-arm64
66
66
  docker cp "nodegit-linux-glibc-arm64:/app/prebuilds" .
67
+ - name: "list the generated files"
68
+ run: find prebuilds
69
+ - uses: actions/upload-artifact@v4
70
+ with:
71
+ name: prebuild-linux-arm64
72
+ path: ./prebuilds
73
+ retention-days: 14
74
+
75
+ build-linux-musl-x64:
76
+ name: "Build Linux musl x64"
77
+ runs-on: large-amd-on-demand
78
+ steps:
79
+ - uses: actions/checkout@v4
80
+ with:
81
+ submodules: true
67
82
  - name: build linux musl x64
68
83
  run: |
69
84
  docker build --platform=linux/amd64 --tag nodegit-linux-musl-amd64 -f scripts/Dockerfile.alpine .
70
85
  docker create --platform=linux/amd64 --name nodegit-linux-musl-amd64 nodegit-linux-musl-amd64
71
86
  docker cp "nodegit-linux-musl-amd64:/app/prebuilds" .
72
- # - name: build linux musl arm
73
- # run: |
74
- # docker build --platform=linux/arm64 --tag nodegit-linux-musl-arm64 -f scripts/Dockerfile.alpine .
75
- # docker create --platform=linux/arm64 --name nodegit-linux-musl-arm64 nodegit-linux-musl-arm64
76
- # docker cp "nodegit-linux-musl-arm64:/app/prebuilds" .
77
87
  - name: "list the generated files"
78
88
  run: find prebuilds
79
89
  - uses: actions/upload-artifact@v4
80
90
  with:
81
- name: prebuild-linux-arm64
91
+ name: prebuild-linux-amd64
82
92
  path: ./prebuilds
83
93
  retention-days: 14
84
94
 
95
+
85
96
  # https://docs.npmjs.com/generating-provenance-statements#publishing-packages-with-provenance-via-github-actions
86
- publish:
97
+ publish-npm:
98
+ if: github.event_name != 'workflow_dispatch'
87
99
  runs-on: ubuntu-latest
88
- needs: [build, cross-compile]
100
+ needs:
101
+ - build
102
+ - build-linux-glibc-arm
103
+ - build-linux-musl-x64
89
104
  permissions:
105
+ contents: read
90
106
  id-token: write
91
107
  steps:
92
108
  - uses: actions/checkout@v4
@@ -94,7 +110,7 @@ jobs:
94
110
  submodules: true
95
111
  - uses: actions/setup-node@v4
96
112
  with:
97
- node-version: 20
113
+ node-version: 24.x
98
114
  check-latest: true
99
115
  registry-url: "https://registry.npmjs.org"
100
116
  scope: "swimlane"
@@ -113,9 +129,8 @@ jobs:
113
129
  find ${{ steps.download.outputs.download-path }}
114
130
  mv ${{ steps.download.outputs.download-path}}/prebuild-Linux-X64/linux-x64/* ./prebuilds/linux-x64/
115
131
  mv ${{ steps.download.outputs.download-path}}/prebuild-linux-arm64/linux-arm64/* ./prebuilds/linux-arm64/
116
- mv ${{ steps.download.outputs.download-path}}/prebuild-linux-arm64/linux-x64/* ./prebuilds/linux-x64/
132
+ mv ${{ steps.download.outputs.download-path}}/prebuild-linux-amd64/linux-x64/* ./prebuilds/linux-x64/
117
133
  mv ${{ steps.download.outputs.download-path}}/prebuild-macOS-ARM64/darwin-arm64/* ./prebuilds/darwin-arm64/
118
- mv ${{ steps.download.outputs.download-path}}/prebuild-macOS-X64/darwin-x64/* ./prebuilds/darwin-x64/
119
134
  find ./prebuilds
120
135
  - name: npm install
121
136
  run: npm ci --ignore-scripts
@@ -123,6 +138,56 @@ jobs:
123
138
  run: npm run preinstall
124
139
  - name: publish
125
140
  run: |
126
- (cat "$NPM_CONFIG_USERCONFIG" || true) && npm publish --provenance --access public
141
+ (cat "$NPM_CONFIG_USERCONFIG" || true) && npm publish --access public
127
142
  env:
128
143
  NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
144
+
145
+ publish-github:
146
+ if: github.event_name == 'workflow_dispatch'
147
+ runs-on:
148
+ - large-amd-on-demand
149
+ needs:
150
+ - build
151
+ - build-linux-glibc-arm
152
+ - build-linux-musl-x64
153
+ permissions:
154
+ contents: read
155
+ id-token: write
156
+ packages: write
157
+ steps:
158
+ - uses: actions/checkout@v4
159
+ with:
160
+ submodules: true
161
+ - uses: actions/setup-node@v4
162
+ with:
163
+ node-version: 24.x
164
+ check-latest: true
165
+ registry-url: "https://npm.pkg.github.com"
166
+ scope: "@swimlane"
167
+ - name: download built libraries
168
+ id: download
169
+ uses: actions/download-artifact@v4
170
+ with:
171
+ path: prebuilds
172
+ - name: copy libs
173
+ run: |
174
+ set -x
175
+ mkdir -p prebuilds/linux-arm64
176
+ mkdir -p prebuilds/linux-x64
177
+ mkdir -p prebuilds/darwin-arm64
178
+ mkdir -p prebuilds/darwin-x64
179
+ find ${{ steps.download.outputs.download-path }}
180
+ mv ${{ steps.download.outputs.download-path}}/prebuild-Linux-X64/linux-x64/* ./prebuilds/linux-x64/
181
+ mv ${{ steps.download.outputs.download-path}}/prebuild-linux-arm64/linux-arm64/* ./prebuilds/linux-arm64/
182
+ mv ${{ steps.download.outputs.download-path}}/prebuild-linux-amd64/linux-x64/* ./prebuilds/linux-x64/
183
+ mv ${{ steps.download.outputs.download-path}}/prebuild-macOS-ARM64/darwin-arm64/* ./prebuilds/darwin-arm64/
184
+ find ./prebuilds
185
+ - name: npm install
186
+ run: npm ci --ignore-scripts
187
+ - name: generate source code
188
+ run: npm run preinstall
189
+ - name: publish
190
+ run: |
191
+ (cat "$NPM_CONFIG_USERCONFIG" || true) && npm publish --access restricted
192
+ env:
193
+ NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,45 @@
1
+ name: Release
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ push:
6
+ branches:
7
+ - master
8
+
9
+ permissions:
10
+ contents: write # for checkout and tag
11
+ actions: write # updating envs
12
+ pull-requests: write # for comments
13
+ packages: write # for publish
14
+ id-token: write
15
+
16
+ jobs:
17
+ release-prep:
18
+ name: Release | Prep
19
+ runs-on:
20
+ - ubuntu-latest
21
+ outputs:
22
+ release-outputs: ${{ toJSON(steps.release.outputs) }}
23
+ steps:
24
+
25
+ - uses: actions/checkout@v4
26
+ with:
27
+ fetch-depth: 0
28
+
29
+ - name: Commit Linter
30
+ uses: wagoid/commitlint-github-action@v6
31
+ with:
32
+ commitDepth: 1
33
+
34
+ - uses: actions/create-github-app-token@v1
35
+ id: app-token
36
+ with:
37
+ app-id: ${{ secrets.GH_APP_ID }}
38
+ private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
39
+
40
+ - uses: googleapis/release-please-action@v4
41
+ name: release-please
42
+ id: release
43
+ with:
44
+ token: ${{ steps.app-token.outputs.token }}
45
+ release-type: 'node'
@@ -1,3 +1,5 @@
1
+ name: Test
2
+
1
3
  on:
2
4
  push:
3
5
  branches:
@@ -7,6 +9,9 @@ on:
7
9
  - v*.*.*
8
10
  pull_request:
9
11
 
12
+ concurrency:
13
+ group: ${{ github.workflow }}-${{ github.ref }}
14
+
10
15
  jobs:
11
16
  linux-test:
12
17
  name: "test on linux"
@@ -16,8 +21,8 @@ jobs:
16
21
  npm_config_clang: 1
17
22
  GYP_DEFINES: use_obsolete_asm=true
18
23
  DEBIAN_FRONTEND: "noninteractive"
19
- runs-on: ubuntu-20.04
20
- container: ubuntu:20.04
24
+ runs-on: ubuntu-24.04
25
+ container: ubuntu:24.04
21
26
  steps:
22
27
  - name: prerequisites
23
28
  run: |
@@ -28,7 +33,7 @@ jobs:
28
33
  submodules: true
29
34
  - uses: actions/setup-node@v4
30
35
  with:
31
- node-version: 20
36
+ node-version: 24.0.0
32
37
  check-latest: true
33
38
  - name: Test
34
39
  run: |
@@ -56,14 +61,14 @@ jobs:
56
61
  CXX: clang++
57
62
  npm_config_clang: 1
58
63
  GYP_DEFINES: use_obsolete_asm=true
59
- runs-on: macos-13
64
+ runs-on: macos-15
60
65
  steps:
61
66
  - uses: actions/checkout@v4
62
67
  with:
63
68
  submodules: true
64
69
  - uses: actions/setup-node@v4
65
70
  with:
66
- node-version: 20
71
+ node-version: 24.0.0
67
72
  check-latest: true
68
73
  - name: Test
69
74
  run: |
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # NodeGit
2
2
 
3
- > Node bindings to the [libgit2](http://libgit2.github.com/) project.
3
+ > Node bindings to the [libgit2](http://libgit2.github.com/) project.
4
4
 
5
5
  [![Actions Status](https://github.com/nodegit/nodegit/workflows/Testing/badge.svg)](https://github.com/nodegit/nodegit/actions)
6
6
 
package/binding.gyp CHANGED
@@ -17,38 +17,8 @@
17
17
  },
18
18
 
19
19
  "targets": [{
20
- "target_name": "acquireOpenSSL",
21
- "type": "none",
22
- "conditions": [
23
- ["<(is_electron) == 1 and <!(node -p \"process.env.npm_config_openssl_dir ? 0 : 1\")", {
24
- "actions": [{
25
- "action_name": "acquire",
26
- "action": ["node", "utils/acquireOpenSSL.js", "<(macOS_deployment_target)"],
27
- "inputs": [""],
28
- "outputs": ["vendor/openssl"],
29
- "message": "Acquiring OpenSSL binaries and headers"
30
- }]
31
- }]
32
- ]
33
- }, {
34
- "target_name": "configureLibssh2",
35
- "type": "none",
36
- "actions": [{
37
- "action_name": "configure",
38
- "action": ["node", "utils/configureLibssh2.js"],
39
- "inputs": [""],
40
- "outputs": [""]
41
- }],
42
- "hard_dependencies": [
43
- "acquireOpenSSL"
44
- ]
45
- }, {
46
20
  "target_name": "nodegit",
47
21
 
48
- "hard_dependencies": [
49
- "configureLibssh2"
50
- ],
51
-
52
22
  "dependencies": [
53
23
  "vendor/libgit2.gyp:libgit2"
54
24
  ],
@@ -85,6 +55,7 @@
85
55
  "src/attr_options.cc",
86
56
  "src/blame.cc",
87
57
  "src/blame_hunk.cc",
58
+ "src/blame_line.cc",
88
59
  "src/blame_options.cc",
89
60
  "src/blob.cc",
90
61
  "src/blob_filter_options.cc",
@@ -103,9 +74,12 @@
103
74
  "src/clone.cc",
104
75
  "src/clone_options.cc",
105
76
  "src/commit.cc",
77
+ "src/commit_create_options.cc",
106
78
  "src/commit_graph.cc",
107
79
  "src/commit_graph_writer.cc",
80
+ "src/commitarray.cc",
108
81
  "src/config.cc",
82
+ "src/config_backend_memory_options.cc",
109
83
  "src/config_entry.cc",
110
84
  "src/config_entry.cc",
111
85
  "src/config_iterator.cc",
@@ -129,6 +103,8 @@
129
103
  "src/diff_patchid_options.cc",
130
104
  "src/diff_perfdata.cc",
131
105
  "src/diff_stats.cc",
106
+ "src/email.cc",
107
+ "src/email_create_options.cc",
132
108
  "src/error.cc",
133
109
  "src/fetch.cc",
134
110
  "src/fetch_options.cc",
@@ -224,6 +200,7 @@
224
200
  "src/treebuilder.cc",
225
201
  "src/worktree.cc",
226
202
  "src/worktree_add_options.cc",
203
+ "src/worktree_add_options.cc",
227
204
  "src/worktree_prune_options.cc",
228
205
  "src/worktree_prune_options.cc",
229
206
  "src/writestream.cc",
@@ -232,7 +209,7 @@
232
209
  "include_dirs": [
233
210
  "vendor/libv8-convert",
234
211
  "vendor/libssh2/include",
235
- "<!(node -e \"require('@axosoft/nan')\")"
212
+ "<!(node -e \"require('nan')\")"
236
213
  ],
237
214
 
238
215
  "cflags": [
@@ -296,7 +273,8 @@
296
273
  }]
297
274
  ],
298
275
  "defines": [
299
- "_HAS_EXCEPTIONS=1"
276
+ "_HAS_EXCEPTIONS=1",
277
+ "NOMINMAX=1"
300
278
  ],
301
279
  "msvs_settings": {
302
280
  "VCCLCompilerTool": {
@@ -312,9 +290,9 @@
312
290
  }
313
291
  },
314
292
  "libraries": [
315
- "winhttp.lib",
316
293
  "crypt32.lib",
317
- "rpcrt4.lib"
294
+ "rpcrt4.lib",
295
+ "secur32.lib"
318
296
  ]
319
297
  }
320
298
  ],
@@ -330,21 +308,28 @@
330
308
  "-std=c++<(cxx_version)"
331
309
  ],
332
310
  }],
333
- ["<(is_electron) == 1 and <(electron_openssl_static) == 1", {
311
+ ["<(is_electron) == 1", {
312
+ "conditions": [
313
+ ["<(electron_openssl_static) == 1", {
314
+ "libraries": [
315
+ "<(electron_openssl_root)/lib/libssl.a",
316
+ "<(electron_openssl_root)/lib/libcrypto.a"
317
+ ]
318
+ }],
319
+ ["<(electron_openssl_static) != 1", {
320
+ "library_dirs": [
321
+ "<(electron_openssl_root)/lib"
322
+ ],
323
+ "libraries": [
324
+ "-lcrypto",
325
+ "-lssl"
326
+ ]
327
+ }]
328
+ ],
334
329
  "include_dirs": [
335
330
  "<(electron_openssl_root)/include"
336
331
  ],
337
- "libraries": [#this order is significant on centos7 apparently...
338
- "<(electron_openssl_root)/lib/libssl.a",
339
- "<(electron_openssl_root)/lib/libcrypto.a"
340
- ]
341
332
  }],
342
- ["<(is_electron) == 1 and <(electron_openssl_static) != 1", {
343
- "libraries": [
344
- "-lcrypto",
345
- "-lssl"
346
- ]
347
- }]
348
333
  ],
349
334
  }],
350
335
  [
package/lib/credential.js CHANGED
@@ -16,6 +16,7 @@ NodeGit.Cred = {
16
16
  defaultNew: deprecatedFn("defaultNew"),
17
17
  sshKeyFromAgent: deprecatedFn("sshKeyFromAgent"),
18
18
  sshKeyNew: deprecatedFn("sshKeyNew"),
19
+ sshKeyMemoryNew: deprecatedFn("sshKeyMemoryNew"),
19
20
  usernameNew: deprecatedFn("usernameNew"),
20
21
  userpassPlaintextNew: deprecatedFn("userpassPlaintextNew"),
21
22
  TYPE: Object.keys(Credential.TYPE).reduce(
package/lib/enums.js CHANGED
@@ -69,8 +69,7 @@ NodeGit.Checkout.NOTIFY = {
69
69
  ALL: 65535,
70
70
  };
71
71
  NodeGit.Checkout.STRATEGY = {
72
- NONE: 0,
73
- SAFE: 1,
72
+ SAFE: 0,
74
73
  FORCE: 2,
75
74
  RECREATE_MISSING: 4,
76
75
  ALLOW_CONFLICTS: 16,
@@ -91,6 +90,7 @@ NodeGit.Checkout.STRATEGY = {
91
90
  DONT_WRITE_INDEX: 8388608,
92
91
  DRY_RUN: 16777216,
93
92
  CONFLICT_STYLE_ZDIFF3: 33554432,
93
+ NONE: 1073741824,
94
94
  UPDATE_SUBMODULES: 65536,
95
95
  UPDATE_SUBMODULES_IF_CHANGED: 131072,
96
96
  };
@@ -109,7 +109,8 @@ NodeGit.Config.LEVEL = {
109
109
  XDG: 3,
110
110
  GLOBAL: 4,
111
111
  LOCAL: 5,
112
- APP: 6,
112
+ WORKTREE: 6,
113
+ APP: 7,
113
114
  HIGHEST_LEVEL: -1,
114
115
  };
115
116
  NodeGit.Config.MAP = {
@@ -237,11 +238,11 @@ NodeGit.Enums.DIRECTION = {
237
238
  FETCH: 0,
238
239
  PUSH: 1,
239
240
  };
240
- NodeGit.Enums.EMAIL_CREATE_FLAGS = {
241
- EMAIL_CREATE_DEFAULT: 0,
242
- EMAIL_CREATE_OMIT_NUMBERS: 1,
243
- EMAIL_CREATE_ALWAYS_NUMBER: 2,
244
- EMAIL_CREATE_NO_RENAMES: 4,
241
+ NodeGit.Email.CREATE_FLAGS = {
242
+ CREATE_DEFAULT: 0,
243
+ CREATE_OMIT_NUMBERS: 1,
244
+ CREATE_ALWAYS_NUMBER: 2,
245
+ CREATE_NO_RENAMES: 4,
245
246
  };
246
247
  NodeGit.Error.ERROR = {
247
248
  NONE: 0,
@@ -315,12 +316,23 @@ NodeGit.Error.CODE = {
315
316
  EAPPLYFAIL: -35,
316
317
  EOWNER: -36,
317
318
  TIMEOUT: -37,
319
+ EUNCHANGED: -38,
320
+ ENOTSUPPORTED: -39,
321
+ EREADONLY: -40,
318
322
  };
319
323
  NodeGit.Enums.FEATURE = {
320
324
  THREADS: 1,
321
325
  HTTPS: 2,
322
326
  SSH: 4,
323
327
  NSEC: 8,
328
+ HTTP_PARSER: 16,
329
+ REGEX: 32,
330
+ I18N: 64,
331
+ AUTH_NTLM: 128,
332
+ AUTH_NEGOTIATE: 256,
333
+ COMPRESSION: 512,
334
+ SHA1: 1024,
335
+ SHA256: 2048,
324
336
  };
325
337
  NodeGit.Fetch.DEPTH = {
326
338
  FULL: 0,
@@ -431,6 +443,9 @@ NodeGit.Libgit2.OPT = {
431
443
  GET_SERVER_CONNECT_TIMEOUT: 40,
432
444
  SET_SERVER_TIMEOUT: 41,
433
445
  GET_SERVER_TIMEOUT: 42,
446
+ SET_USER_AGENT_PRODUCT: 43,
447
+ GET_USER_AGENT_PRODUCT: 44,
448
+ ADD_SSL_X509_CERT: 45,
434
449
  };
435
450
  NodeGit.Merge.ANALYSIS = {
436
451
  NONE: 0,
@@ -559,6 +574,10 @@ NodeGit.Remote.REDIRECT = {
559
574
  INITIAL: 2,
560
575
  ALL: 4,
561
576
  };
577
+ NodeGit.Remote.UPDATE_FLAGS = {
578
+ UPDATE_FETCHHEAD: 1,
579
+ UPDATE_REPORT_UNCHANGED: 2,
580
+ };
562
581
  NodeGit.Repository.INIT_FLAG = {
563
582
  BARE: 1,
564
583
  NO_REINIT: 2,
@@ -588,7 +607,8 @@ NodeGit.Repository.ITEM = {
588
607
  LOGS: 11,
589
608
  MODULES: 12,
590
609
  WORKTREES: 13,
591
- _LAST: 14,
610
+ WORKTREE_CONFIG: 14,
611
+ _LAST: 15,
592
612
  };
593
613
  NodeGit.Repository.OPEN_FLAG = {
594
614
  OPEN_NO_SEARCH: 1,