dependabot-bun 0.388.0 → 0.389.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d35ccc1aac59905c40beece74c715bc870aa961bf0fc81369451f126c6cdb189
4
- data.tar.gz: 5bfcf59f40932759fdb77505742edd15c38137257c5989f64e1b2421e4a6eca6
3
+ metadata.gz: 22834707df55df4ac0a7ac6780eccb4888052824833bbab428b11e10142871df
4
+ data.tar.gz: c557dcb417537da0427682aa54ef50f2a4d096707b2eecf3b0a2e727eae95172
5
5
  SHA512:
6
- metadata.gz: 8846046a149c47be747c816e0b3fd38d58e7e6b33339965067aa5ec2d1135055d1e491da45009daf763b6532076fd73708df78d759bc6cb07c4605565a99e15d
7
- data.tar.gz: 4572b2960fbf871d8e758e257bd8ccfafb646440c2ee7a18a52b1735def020f683e5dd8657cba7bbd5e38e7cb78c7ad9af7d87e7ce2c04f1ec27bbd3cdb81dec
6
+ metadata.gz: 5d1471eeeeb325f22b47c5fa57d6f02890f84b18525e07ab58b83a0b4e95bca08719696765f3e9d9a9d42c2d578f2db2c6b84c547b055d48961f718fa7735c26
7
+ data.tar.gz: 837703736f6acb5a04b29209746ddfb8481d9d2f8264ba0dd25d2b4fd584b5770bab5b6745828d15dcbd284c60179ae61ee1a8efe9130592a5098372bfff2b69
@@ -0,0 +1,28 @@
1
+ const globals = require("globals");
2
+ const js = require("@eslint/js");
3
+ const eslintConfigPrettier = require("eslint-config-prettier/flat");
4
+
5
+ module.exports = [
6
+ js.configs.recommended,
7
+ {
8
+ languageOptions: {
9
+ globals: {
10
+ ...globals.node,
11
+ ...globals.jest,
12
+ },
13
+ ecmaVersion: "latest",
14
+ },
15
+ },
16
+ {
17
+ rules: {
18
+ "no-unused-vars": [
19
+ "error",
20
+ { argsIgnorePattern: "^_", destructuredArrayIgnorePattern: "^_" },
21
+ ],
22
+ },
23
+ },
24
+ eslintConfigPrettier,
25
+ {
26
+ ignores: ["dist/**", "build/**"],
27
+ },
28
+ ];
@@ -44,7 +44,11 @@ class LightweightInstall extends Install {
44
44
  }
45
45
  }
46
46
 
47
- const LOCKFILE_ENTRY_REGEX = /^(.*)@([^@]*?)$/;
47
+ // Matches a yarn lockfile entry key, correctly handling:
48
+ // - scoped packages: @scope/name@requirement
49
+ // - unscoped packages: name@requirement
50
+ // - git URLs with credentials: name@https://token@host/path (@ preserved in requirement)
51
+ const LOCKFILE_ENTRY_REGEX = /^(@[^@]+|[^@]+)@(.*)$/;
48
52
 
49
53
  module.exports = {
50
54
  isString,
@@ -1,13 +1,12 @@
1
1
  const parse = require("@dependabot/yarn-lib/lib/lockfile/parse").default;
2
2
  const stringify = require("@dependabot/yarn-lib/lib/lockfile/stringify")
3
3
  .default;
4
+ const { LOCKFILE_ENTRY_REGEX } = require("./helpers");
4
5
 
5
6
  // Get an array of a dependency's requested version ranges from a lockfile
6
7
  function getRequestedVersions(depName, lockfileJson) {
7
8
  const requestedVersions = [];
8
- // Matching dependency name and version requirements which could be a full url:
9
- // dep@version, @private-dep@version, private-dep@https:://token@gh.com...#ref
10
- const re = /^(.[^@]*)@(.*?)$/;
9
+ const re = LOCKFILE_ENTRY_REGEX;
11
10
 
12
11
  Object.entries(lockfileJson).forEach(([name, _]) => {
13
12
  if (name.match(re)) {
@@ -21,8 +21,10 @@
21
21
  "helper": "run.js"
22
22
  },
23
23
  "devDependencies": {
24
+ "@eslint/js": "^9.16.0",
24
25
  "eslint": "^9.16.0",
25
26
  "eslint-config-prettier": "^9.1.0",
27
+ "globals": "^13.24.0",
26
28
  "jest": "^29.7.0",
27
29
  "prettier": "^3.4.2"
28
30
  }
@@ -820,6 +822,19 @@
820
822
  }
821
823
  }
822
824
  },
825
+ "node_modules/@eslint/eslintrc/node_modules/globals": {
826
+ "version": "14.0.0",
827
+ "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz",
828
+ "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==",
829
+ "dev": true,
830
+ "license": "MIT",
831
+ "engines": {
832
+ "node": ">=18"
833
+ },
834
+ "funding": {
835
+ "url": "https://github.com/sponsors/sindresorhus"
836
+ }
837
+ },
823
838
  "node_modules/@eslint/eslintrc/node_modules/js-yaml": {
824
839
  "version": "4.1.0",
825
840
  "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
@@ -5474,12 +5489,16 @@
5474
5489
  }
5475
5490
  },
5476
5491
  "node_modules/globals": {
5477
- "version": "14.0.0",
5478
- "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz",
5479
- "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==",
5492
+ "version": "13.24.0",
5493
+ "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz",
5494
+ "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==",
5480
5495
  "dev": true,
5496
+ "license": "MIT",
5497
+ "dependencies": {
5498
+ "type-fest": "^0.20.2"
5499
+ },
5481
5500
  "engines": {
5482
- "node": ">=18"
5501
+ "node": ">=8"
5483
5502
  },
5484
5503
  "funding": {
5485
5504
  "url": "https://github.com/sponsors/sindresorhus"
@@ -15873,6 +15892,19 @@
15873
15892
  "node": ">=4"
15874
15893
  }
15875
15894
  },
15895
+ "node_modules/type-fest": {
15896
+ "version": "0.20.2",
15897
+ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz",
15898
+ "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==",
15899
+ "dev": true,
15900
+ "license": "(MIT OR CC0-1.0)",
15901
+ "engines": {
15902
+ "node": ">=10"
15903
+ },
15904
+ "funding": {
15905
+ "url": "https://github.com/sponsors/sindresorhus"
15906
+ }
15907
+ },
15876
15908
  "node_modules/unique-filename": {
15877
15909
  "version": "4.0.0",
15878
15910
  "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-4.0.0.tgz",
@@ -16939,6 +16971,12 @@
16939
16971
  "ms": "^2.1.3"
16940
16972
  }
16941
16973
  },
16974
+ "globals": {
16975
+ "version": "14.0.0",
16976
+ "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz",
16977
+ "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==",
16978
+ "dev": true
16979
+ },
16942
16980
  "js-yaml": {
16943
16981
  "version": "4.1.0",
16944
16982
  "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
@@ -20391,10 +20429,13 @@
20391
20429
  }
20392
20430
  },
20393
20431
  "globals": {
20394
- "version": "14.0.0",
20395
- "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz",
20396
- "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==",
20397
- "dev": true
20432
+ "version": "13.24.0",
20433
+ "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz",
20434
+ "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==",
20435
+ "dev": true,
20436
+ "requires": {
20437
+ "type-fest": "^0.20.2"
20438
+ }
20398
20439
  },
20399
20440
  "graceful-fs": {
20400
20441
  "version": "4.2.10",
@@ -28159,6 +28200,12 @@
28159
28200
  "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==",
28160
28201
  "dev": true
28161
28202
  },
28203
+ "type-fest": {
28204
+ "version": "0.20.2",
28205
+ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz",
28206
+ "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==",
28207
+ "dev": true
28208
+ },
28162
28209
  "unique-filename": {
28163
28210
  "version": "4.0.0",
28164
28211
  "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-4.0.0.tgz",
data/helpers/package.json CHANGED
@@ -21,8 +21,10 @@
21
21
  "patch-package": "^8.0.0"
22
22
  },
23
23
  "devDependencies": {
24
+ "@eslint/js": "^9.16.0",
24
25
  "eslint": "^9.16.0",
25
26
  "eslint-config-prettier": "^9.1.0",
27
+ "globals": "^13.24.0",
26
28
  "jest": "^29.7.0",
27
29
  "prettier": "^3.4.2"
28
30
  }
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "test-project",
3
+ "version": "1.0.0",
4
+ "dependencies": {
5
+ "is-positive": "^3.0.0"
6
+ }
7
+ }
@@ -0,0 +1,8 @@
1
+ # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2
+ # yarn lockfile v1
3
+
4
+
5
+ "is-positive@^3.0.0", "is-positive@3.0.0":
6
+ version "3.0.0"
7
+ resolved "https://registry.yarnpkg.com/is-positive/-/is-positive-3.0.0.tgz#e1ee21cb67a4b41ea3e9ca23b32e6fb51bef9d26"
8
+ integrity sha512-3aX3F8v8gzxT1DnLXo8/0fQ9i/aKDqgDZZvFh/hhsb0HkYfNxz5j9xLF8f3T8L/5DgVxWlBGFbHfgHYf3vJXEA==
@@ -0,0 +1,40 @@
1
+ const { LOCKFILE_ENTRY_REGEX } = require("../../lib/yarn/helpers");
2
+
3
+ describe("LOCKFILE_ENTRY_REGEX", () => {
4
+ it("matches a simple unscoped package", () => {
5
+ const match = "left-pad@1.0.0".match(LOCKFILE_ENTRY_REGEX);
6
+ expect(match).not.toBeNull();
7
+ const [, packageName, requirement] = match;
8
+ expect(packageName).toBe("left-pad");
9
+ expect(requirement).toBe("1.0.0");
10
+ });
11
+
12
+ it("matches a scoped package", () => {
13
+ const match = "@scope/pkg@1.2.3".match(LOCKFILE_ENTRY_REGEX);
14
+ expect(match).not.toBeNull();
15
+ const [, packageName, requirement] = match;
16
+ expect(packageName).toBe("@scope/pkg");
17
+ expect(requirement).toBe("1.2.3");
18
+ });
19
+
20
+ it("matches an unscoped package with a git URL containing @", () => {
21
+ const key =
22
+ "is-number@git+https://username:password@github.com/jonschlinkert/is-number.git";
23
+ const match = key.match(LOCKFILE_ENTRY_REGEX);
24
+ expect(match).not.toBeNull();
25
+ const [, packageName, requirement] = match;
26
+ expect(packageName).toBe("is-number");
27
+ expect(requirement).toBe(
28
+ "git+https://username:password@github.com/jonschlinkert/is-number.git"
29
+ );
30
+ });
31
+
32
+ it("matches a scoped package with a git URL containing multiple @ characters", () => {
33
+ const key = "@scope/pkg@git+https://x@github.com/y/z";
34
+ const match = key.match(LOCKFILE_ENTRY_REGEX);
35
+ expect(match).not.toBeNull();
36
+ const [, packageName, requirement] = match;
37
+ expect(packageName).toBe("@scope/pkg");
38
+ expect(requirement).toBe("git+https://x@github.com/y/z");
39
+ });
40
+ });
@@ -114,4 +114,32 @@ describe("updater", () => {
114
114
  expect(error.message).toEqual("package.json: Name contains illegal characters")
115
115
  }
116
116
  });
117
+
118
+ it("correctly updates packages with multiple lockfile entries", async () => {
119
+ // This test verifies that replaceLockfileDeclaration correctly consolidates
120
+ // duplicate lockfile entries when updating versions. This ensures the regex
121
+ // change properly identifies all entries belonging to a dependency.
122
+ copyDependencies("scoped-git-source", tempDir);
123
+
124
+ const result = await updateDependencyFiles(tempDir, [
125
+ {
126
+ name: "is-positive",
127
+ version: "3.1.0",
128
+ requirements: [
129
+ {
130
+ requirement: "^3.0.0",
131
+ file: "package.json",
132
+ groups: ["dependencies"],
133
+ },
134
+ ],
135
+ },
136
+ ]);
137
+
138
+ // The updated lock should have the new version
139
+ expect(result["yarn.lock"]).toContain('version "3.1.0"');
140
+ // Old version should be gone
141
+ expect(result["yarn.lock"]).not.toContain('version "3.0.0"');
142
+ // The caret requirement entry should be preserved
143
+ expect(result["yarn.lock"]).toContain("is-positive@^3.0.0");
144
+ });
117
145
  });
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dependabot-bun
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.388.0
4
+ version: 0.389.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - '='
17
17
  - !ruby/object:Gem::Version
18
- version: 0.388.0
18
+ version: 0.389.0
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - '='
24
24
  - !ruby/object:Gem::Version
25
- version: 0.388.0
25
+ version: 0.389.0
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: debug
28
28
  requirement: !ruby/object:Gem::Requirement
@@ -244,6 +244,7 @@ files:
244
244
  - helpers/.eslintrc
245
245
  - helpers/README.md
246
246
  - helpers/build
247
+ - helpers/eslint.config.js
247
248
  - helpers/jest.config.js
248
249
  - helpers/lib/npm/conflicting-dependency-parser.js
249
250
  - helpers/lib/npm/index.js
@@ -300,10 +301,13 @@ files:
300
301
  - helpers/test/yarn/fixtures/updater/illegal_character/yarn.lock
301
302
  - helpers/test/yarn/fixtures/updater/original/package.json
302
303
  - helpers/test/yarn/fixtures/updater/original/yarn.lock
304
+ - helpers/test/yarn/fixtures/updater/scoped-git-source/package.json
305
+ - helpers/test/yarn/fixtures/updater/scoped-git-source/yarn.lock
303
306
  - helpers/test/yarn/fixtures/updater/updated/yarn.lock
304
307
  - helpers/test/yarn/fixtures/updater/with-version-comments/package.json
305
308
  - helpers/test/yarn/fixtures/updater/with-version-comments/yarn.lock
306
309
  - helpers/test/yarn/helpers.js
310
+ - helpers/test/yarn/helpers.test.js
307
311
  - helpers/test/yarn/updater.test.js
308
312
  - lib/dependabot/bun.rb
309
313
  - lib/dependabot/bun/bun_package_manager.rb
@@ -350,7 +354,7 @@ licenses:
350
354
  - MIT
351
355
  metadata:
352
356
  bug_tracker_uri: https://github.com/dependabot/dependabot-core/issues
353
- changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.388.0
357
+ changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.389.0
354
358
  rdoc_options: []
355
359
  require_paths:
356
360
  - lib