@b12k/gitleaks 8.30.1-v.6 → 8.30.1-v.60
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.
- package/dist/config.js +3 -3
- package/dist/postinstall.js +2 -3
- package/package.json +33 -38
- package/scripts/postinstall.js +2 -2
package/dist/config.js
CHANGED
|
@@ -7,15 +7,15 @@ const platform = 'win32' === process.platform ? 'windows' : process.platform;
|
|
|
7
7
|
const isWindows = 'windows' === platform;
|
|
8
8
|
const { arch: architecture } = process;
|
|
9
9
|
const { name: config_name, version: version } = package_0;
|
|
10
|
-
const [defaultVersion = ''] = version.split('-');
|
|
10
|
+
const [defaultVersion = ''] = version.split('-', 1);
|
|
11
11
|
const versionFileName = '.gitleaks-version';
|
|
12
12
|
const versionFilePath = node_path.join(process.env['INIT_CWD'] ?? process.cwd(), versionFileName);
|
|
13
13
|
let versionOverride;
|
|
14
14
|
try {
|
|
15
15
|
const fileContents = await readFile(versionFilePath, 'utf8');
|
|
16
|
-
versionOverride = fileContents.trim().replace(/^v
|
|
16
|
+
versionOverride = fileContents.trim().replace(/^v/u, '');
|
|
17
17
|
} catch (error) {
|
|
18
|
-
if ('ENOENT'
|
|
18
|
+
if (!(error instanceof Error && 'code' in error && 'ENOENT' === error.code)) {
|
|
19
19
|
const message = Error.isError(error) ? error.message : 'Unknown error.';
|
|
20
20
|
throw new Error(`Failed to read ${versionFileName}: ${message}`, {
|
|
21
21
|
cause: error
|
package/dist/postinstall.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { createHash } from "node:crypto";
|
|
3
3
|
import { createWriteStream } from "node:fs";
|
|
4
4
|
import { readFile, rm } from "node:fs/promises";
|
|
5
|
-
import { Readable } from "node:stream";
|
|
6
5
|
import { pipeline } from "node:stream/promises";
|
|
7
6
|
import { architecture, archiveFileName, archiveGithubUrl, archivePath, binaryPath, checksumsGithubUrl, currentDirectory, libraryName, platform, supportedArchitectures, supportedPlatforms } from "./config.js";
|
|
8
7
|
import { extractArchive } from "./extract-archive.js";
|
|
@@ -28,7 +27,7 @@ async function downloadArchive() {
|
|
|
28
27
|
borderColor: 'green',
|
|
29
28
|
title: `${libraryName}:save`
|
|
30
29
|
});
|
|
31
|
-
await pipeline(
|
|
30
|
+
await pipeline(response.body, createWriteStream(archivePath));
|
|
32
31
|
}
|
|
33
32
|
async function ensureArchiveChecksum() {
|
|
34
33
|
log(checksumsGithubUrl, {
|
|
@@ -37,7 +36,7 @@ async function ensureArchiveChecksum() {
|
|
|
37
36
|
});
|
|
38
37
|
const response = await createFetchResponse(checksumsGithubUrl);
|
|
39
38
|
const checksums = await response.text();
|
|
40
|
-
const checksum = checksums.split('\n').find((line)=>line.endsWith(` ${archiveFileName}`))?.split(/\s
|
|
39
|
+
const checksum = checksums.split('\n').find((line)=>line.endsWith(` ${archiveFileName}`))?.split(/\s+/u, 1)[0];
|
|
41
40
|
if (!checksum) throw new Error(`Checksum not found for ${archiveFileName}.`);
|
|
42
41
|
const archive = await readFile(archivePath);
|
|
43
42
|
const actualChecksum = createHash('sha256').update(archive).digest('hex');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@b12k/gitleaks",
|
|
3
|
-
"version": "8.30.1-v.
|
|
3
|
+
"version": "8.30.1-v.60",
|
|
4
4
|
"description": "The missing NPM wrapper for Gitleaks",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"api-keys",
|
|
@@ -21,13 +21,12 @@
|
|
|
21
21
|
"tokens",
|
|
22
22
|
"wrapper"
|
|
23
23
|
],
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"author": "Bogdan Kolesnyk",
|
|
24
26
|
"repository": {
|
|
25
27
|
"type": "git",
|
|
26
28
|
"url": "git+https://github.com/b12k/gitleaks.git"
|
|
27
29
|
},
|
|
28
|
-
"license": "MIT",
|
|
29
|
-
"author": "Bogdan Kolesnyk",
|
|
30
|
-
"type": "module",
|
|
31
30
|
"bin": {
|
|
32
31
|
"gitleaks": "dist/cli.js",
|
|
33
32
|
"gitleaks-install": "dist/postinstall.js"
|
|
@@ -36,58 +35,54 @@
|
|
|
36
35
|
"dist",
|
|
37
36
|
"scripts"
|
|
38
37
|
],
|
|
38
|
+
"type": "module",
|
|
39
|
+
"publishConfig": {
|
|
40
|
+
"access": "public"
|
|
41
|
+
},
|
|
39
42
|
"dependencies": {
|
|
40
|
-
"boxen": "
|
|
41
|
-
"tar": "7.5.
|
|
43
|
+
"boxen": "9.0.0",
|
|
44
|
+
"tar": "7.5.22",
|
|
42
45
|
"update-notifier": "7.3.1"
|
|
43
46
|
},
|
|
44
47
|
"devDependencies": {
|
|
45
48
|
"@b12k/branch-name-lint": "1.3.0",
|
|
46
|
-
"@commitlint/config-conventional": "21.2.
|
|
47
|
-
"@
|
|
48
|
-
"@
|
|
49
|
-
"@
|
|
50
|
-
"@types/
|
|
51
|
-
"@types/semver": "7.7.1",
|
|
49
|
+
"@commitlint/config-conventional": "21.2.3",
|
|
50
|
+
"@release-it/conventional-changelog": "12.0.2",
|
|
51
|
+
"@rslib/core": "1.0.3",
|
|
52
|
+
"@types/node": "26.6.5",
|
|
53
|
+
"@types/semver": "7.8.0",
|
|
52
54
|
"@types/update-notifier": "6.0.8",
|
|
53
|
-
"commitlint": "21.2.
|
|
54
|
-
"eslint": "
|
|
55
|
-
"eslint-config-airbnb-extended": "3.1.0",
|
|
56
|
-
"eslint-config-prettier": "10.1.8",
|
|
57
|
-
"eslint-plugin-perfectionist": "5.9.1",
|
|
58
|
-
"eslint-plugin-unicorn": "70.0.0",
|
|
55
|
+
"commitlint": "21.2.3",
|
|
56
|
+
"eslint-plugin-perfectionist": "5.12.1",
|
|
59
57
|
"husky": "9.1.7",
|
|
60
|
-
"lint-staged": "17.0
|
|
61
|
-
"npm-check-updates": "
|
|
62
|
-
"npm-run-all2": "9.0.
|
|
63
|
-
"
|
|
64
|
-
"
|
|
58
|
+
"lint-staged": "17.6.0",
|
|
59
|
+
"npm-check-updates": "23.1.1",
|
|
60
|
+
"npm-run-all2": "9.0.3",
|
|
61
|
+
"oxfmt": "0.72.0",
|
|
62
|
+
"oxlint": "1.87.0",
|
|
63
|
+
"oxlint-tsgolint": "7.0.2004",
|
|
64
|
+
"release-it": "21.1.1",
|
|
65
65
|
"semver": "7.8.5",
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"typescript": "6.0.3"
|
|
66
|
+
"tsx": "4.23.15",
|
|
67
|
+
"typescript": "7.0.2"
|
|
69
68
|
},
|
|
70
69
|
"engines": {
|
|
71
70
|
"node": ">=24"
|
|
72
71
|
},
|
|
73
|
-
"publishConfig": {
|
|
74
|
-
"access": "public"
|
|
75
|
-
},
|
|
76
72
|
"scripts": {
|
|
77
73
|
"build": "rslib",
|
|
78
74
|
"check": "run-p -l check:*",
|
|
79
|
-
"check:format": "
|
|
80
|
-
"check:
|
|
81
|
-
"check:scripts": "eslint . --cache",
|
|
75
|
+
"check:format": "oxfmt . --check",
|
|
76
|
+
"check:scripts": "oxlint",
|
|
82
77
|
"check:types": "tsc --noEmit",
|
|
83
|
-
"deps:check": "ncu -e
|
|
84
|
-
"deps:update": "ncu -du --doctorTest \"pnpm deps:update:doctor\" -c
|
|
78
|
+
"deps:check": "ncu -e 2 -c 1",
|
|
79
|
+
"deps:update": "ncu -du --doctorInstall \"pnpm deps:update:install\" --doctorTest \"pnpm deps:update:doctor\" -c 1",
|
|
85
80
|
"deps:update:doctor": "run-p -l check:types check:scripts build",
|
|
81
|
+
"deps:update:install": "pnpm i --no-frozen-lockfile",
|
|
86
82
|
"dev": "rslib --watch",
|
|
87
|
-
"fix": "run-
|
|
88
|
-
"fix:format": "
|
|
89
|
-
"fix:
|
|
90
|
-
"fix:scripts": "eslint . --fix --cache",
|
|
83
|
+
"fix": "run-s -l fix:*",
|
|
84
|
+
"fix:format": "oxfmt . --write",
|
|
85
|
+
"fix:scripts": "oxlint --fix",
|
|
91
86
|
"ga:notify": "tsx .github/notify.ts",
|
|
92
87
|
"ga:update-gitleaks": "tsx .github/update-gitleaks.ts",
|
|
93
88
|
"husky:commit-msg": "commitlint",
|
package/scripts/postinstall.js
CHANGED
|
@@ -2,6 +2,6 @@ import path from 'node:path';
|
|
|
2
2
|
import { pathToFileURL } from 'node:url';
|
|
3
3
|
|
|
4
4
|
const directory = import.meta.dirname;
|
|
5
|
-
//
|
|
5
|
+
// oxlint-disable-next-line unicorn/no-process-exit
|
|
6
6
|
if (!directory.includes('node_modules')) process.exit(0);
|
|
7
|
-
await import(pathToFileURL(path.join(directory, '../dist/postinstall.js')));
|
|
7
|
+
await import(pathToFileURL(path.join(directory, '../dist/postinstall.js')).href);
|