repo-util 1.22.7 → 1.23.1
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/package.json +6 -6
- package/src/repo-util-cli.mjs +12 -14
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "repo-util",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.23.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -21,12 +21,12 @@
|
|
|
21
21
|
"cover": "c8 -x 'tests/**/*' --temp-directory build/tmp ava --timeout 2m tests/*.mjs && c8 report -r lcov -o build/coverage --temp-directory build/tmp"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"aggregation-repository-provider": "^5.2.
|
|
24
|
+
"aggregation-repository-provider": "^5.2.36",
|
|
25
25
|
"bitbucket-repository-provider": "^4.2.10",
|
|
26
26
|
"commander": "^9.3.0",
|
|
27
|
-
"etag-cache-leveldb": "^1.1
|
|
28
|
-
"gitea-repository-provider": "^2.2.
|
|
29
|
-
"github-repository-provider": "^7.30.
|
|
27
|
+
"etag-cache-leveldb": "^1.2.1",
|
|
28
|
+
"gitea-repository-provider": "^2.2.11",
|
|
29
|
+
"github-repository-provider": "^7.30.12",
|
|
30
30
|
"leveldown": "^6.1.1",
|
|
31
31
|
"levelup": "^5.1.1",
|
|
32
32
|
"local-repository-provider": "^8.0.12"
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"semantic-release": "^19.0.3"
|
|
39
39
|
},
|
|
40
40
|
"engines": {
|
|
41
|
-
"node": ">=
|
|
41
|
+
"node": ">=18.3.0"
|
|
42
42
|
},
|
|
43
43
|
"repository": {
|
|
44
44
|
"type": "git",
|
package/src/repo-util-cli.mjs
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { homedir } from "os";
|
|
7
|
-
import { fileURLToPath } from "url";
|
|
3
|
+
import { mkdir } from "node:fs/promises";
|
|
4
|
+
import { join } from "node:path";
|
|
5
|
+
import { homedir } from "node:os";
|
|
8
6
|
import { program } from "commander";
|
|
9
7
|
import levelup from "levelup";
|
|
10
8
|
import leveldown from "leveldown";
|
|
@@ -22,21 +20,16 @@ import {
|
|
|
22
20
|
} from "repository-provider";
|
|
23
21
|
import AggregationProvider from "aggregation-repository-provider";
|
|
24
22
|
import { ETagCacheLevelDB } from "etag-cache-leveldb";
|
|
23
|
+
import pkg from "../package.json" assert { type: "json" };
|
|
25
24
|
|
|
26
25
|
process.on("uncaughtException", console.error);
|
|
27
26
|
process.on("unhandledRejection", console.error);
|
|
28
27
|
|
|
29
|
-
const { version, description } = JSON.parse(
|
|
30
|
-
readFileSync(fileURLToPath(new URL("../package.json", import.meta.url)), {
|
|
31
|
-
encoding: "utf8"
|
|
32
|
-
})
|
|
33
|
-
);
|
|
34
|
-
|
|
35
28
|
const properties = {};
|
|
36
29
|
|
|
37
30
|
program
|
|
38
|
-
.description(description)
|
|
39
|
-
.version(version)
|
|
31
|
+
.description(pkg.description)
|
|
32
|
+
.version(pkg.version)
|
|
40
33
|
.option("-D --define <a=b>", "define property", str =>
|
|
41
34
|
Object.assign(properties, Object.fromEntries([str.split(/=/)]))
|
|
42
35
|
);
|
|
@@ -88,7 +81,8 @@ for (const o of [
|
|
|
88
81
|
command
|
|
89
82
|
.option("--trace", "log level trace")
|
|
90
83
|
.option("--debug", "log level debug")
|
|
91
|
-
.option("--cache", "cache requests")
|
|
84
|
+
.option("--no-cache", "cache requests")
|
|
85
|
+
.option("--statistics", "cache statistics")
|
|
92
86
|
.option("--json", "output as json")
|
|
93
87
|
.option("--no-identifier", "do not output identifier, show attributes only")
|
|
94
88
|
.option("-a, --attribute <attributes>", "list attribute", a =>
|
|
@@ -177,6 +171,10 @@ async function list(provider, names, options, slot, attributes, actions) {
|
|
|
177
171
|
if (options.json) {
|
|
178
172
|
console.log(JSON.stringify(json));
|
|
179
173
|
}
|
|
174
|
+
|
|
175
|
+
if (options.statistics) {
|
|
176
|
+
console.error(provider._providers[0].cache.statistics);
|
|
177
|
+
}
|
|
180
178
|
}
|
|
181
179
|
|
|
182
180
|
async function createCache() {
|