repo-util 1.21.1 → 1.22.2
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 +8 -8
- package/src/repo-util-cli.mjs +11 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "repo-util",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.22.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -21,21 +21,21 @@
|
|
|
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.
|
|
25
|
-
"bitbucket-repository-provider": "^4.2.
|
|
24
|
+
"aggregation-repository-provider": "^5.2.35",
|
|
25
|
+
"bitbucket-repository-provider": "^4.2.8",
|
|
26
26
|
"commander": "^9.3.0",
|
|
27
|
-
"etag-cache-leveldb": "^1.0.
|
|
28
|
-
"gitea-repository-provider": "^2.2.
|
|
29
|
-
"github-repository-provider": "^7.30.
|
|
27
|
+
"etag-cache-leveldb": "^1.0.8",
|
|
28
|
+
"gitea-repository-provider": "^2.2.7",
|
|
29
|
+
"github-repository-provider": "^7.30.9",
|
|
30
30
|
"leveldown": "^6.1.1",
|
|
31
31
|
"levelup": "^5.1.1",
|
|
32
|
-
"local-repository-provider": "^8.0.
|
|
32
|
+
"local-repository-provider": "^8.0.12"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"ava": "^4.3.0",
|
|
36
36
|
"c8": "^7.11.3",
|
|
37
37
|
"execa": "^6.1.0",
|
|
38
|
-
"semantic-release": "^19.0.
|
|
38
|
+
"semantic-release": "^19.0.3"
|
|
39
39
|
},
|
|
40
40
|
"engines": {
|
|
41
41
|
"node": ">=16.15.1"
|
package/src/repo-util-cli.mjs
CHANGED
|
@@ -32,14 +32,11 @@ const { version, description } = JSON.parse(
|
|
|
32
32
|
})
|
|
33
33
|
);
|
|
34
34
|
|
|
35
|
-
|
|
36
35
|
const properties = {};
|
|
37
36
|
|
|
38
37
|
program
|
|
39
38
|
.description(description)
|
|
40
39
|
.version(version)
|
|
41
|
-
.option("--trace", "log level trace")
|
|
42
|
-
.option("--debug", "log level debug")
|
|
43
40
|
.option("-D --define <a=b>", "define property", str =>
|
|
44
41
|
Object.assign(properties, Object.fromEntries([str.split(/=/)]))
|
|
45
42
|
);
|
|
@@ -89,6 +86,9 @@ for (const o of [
|
|
|
89
86
|
]) {
|
|
90
87
|
const command = program.command(`${o[0]} [name...]`);
|
|
91
88
|
command
|
|
89
|
+
.option("--trace", "log level trace")
|
|
90
|
+
.option("--debug", "log level debug")
|
|
91
|
+
.option("--cache", "cache requests")
|
|
92
92
|
.option("--json", "output as json")
|
|
93
93
|
.option("--no-identifier", "do not output identifier, show attributes only")
|
|
94
94
|
.option("-a, --attribute <attributes>", "list attribute", a =>
|
|
@@ -179,10 +179,9 @@ async function list(provider, names, options, slot, attributes, actions) {
|
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
-
async function createCache()
|
|
183
|
-
{
|
|
182
|
+
async function createCache() {
|
|
184
183
|
const dir = join(homedir(), ".cache/repository-provider");
|
|
185
|
-
await mkdir(dir,{ recursive: true });
|
|
184
|
+
await mkdir(dir, { recursive: true });
|
|
186
185
|
const db = await levelup(leveldown(dir));
|
|
187
186
|
return new ETagCacheLevelDB(db);
|
|
188
187
|
}
|
|
@@ -194,12 +193,14 @@ async function prepareProvider(options) {
|
|
|
194
193
|
process.env
|
|
195
194
|
);
|
|
196
195
|
|
|
197
|
-
|
|
198
|
-
|
|
196
|
+
if (options.cache) {
|
|
197
|
+
const cache = await createCache();
|
|
198
|
+
provider._providers.forEach(p => (p.cache = cache));
|
|
199
|
+
}
|
|
199
200
|
|
|
200
201
|
provider.messageDestination = {
|
|
201
|
-
trace: () => {},
|
|
202
|
-
info:
|
|
202
|
+
trace: options.trace ? console.log : () => {},
|
|
203
|
+
info: console.log,
|
|
203
204
|
warn: console.warn,
|
|
204
205
|
error: console.error
|
|
205
206
|
};
|