repo-util 1.27.4 → 1.27.5
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/README.md +1 -1
- package/package.json +8 -7
- package/src/repo-util-cli.mjs +3 -3
- package/src/setup-provider.mjs +0 -53
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[](https://www.npmjs.com/package/repo-util)
|
|
2
2
|
[](https://opensource.org/licenses/BSD-3-Clause)
|
|
3
|
-
[](https://bundlejs.com/?q=repo-util)
|
|
4
4
|
[](https://npmjs.org/package/repo-util)
|
|
5
5
|
[](https://github.com/arlac77/repo-util/issues)
|
|
6
6
|
[](https://actions-badge.atrox.dev/arlac77/repo-util/goto)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "repo-util",
|
|
3
|
-
"version": "1.27.
|
|
3
|
+
"version": "1.27.5",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -21,14 +21,15 @@
|
|
|
21
21
|
"cover": "c8 -x 'tests/**/*' --temp-directory build/tmp ava --timeout 2m tests/*-ava.mjs tests/*-ava-node.mjs && c8 report -r lcov -o build/coverage --temp-directory build/tmp"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"aggregation-repository-provider": "^5.3.
|
|
25
|
-
"bitbucket-repository-provider": "^5.1.
|
|
24
|
+
"aggregation-repository-provider": "^5.3.27",
|
|
25
|
+
"bitbucket-repository-provider": "^5.1.5",
|
|
26
26
|
"commander": "^10.0.1",
|
|
27
|
-
"etag-cache-leveldb": "^2.0.
|
|
28
|
-
"gitea-repository-provider": "^3.1.
|
|
29
|
-
"github-repository-provider": "^8.0.
|
|
27
|
+
"etag-cache-leveldb": "^2.0.2",
|
|
28
|
+
"gitea-repository-provider": "^3.1.4",
|
|
29
|
+
"github-repository-provider": "^8.0.15",
|
|
30
30
|
"leveldown": "^6.1.1",
|
|
31
|
-
"levelup": "^5.1.1"
|
|
31
|
+
"levelup": "^5.1.1",
|
|
32
|
+
"repository-provider-cli-support": "^1.0.0"
|
|
32
33
|
},
|
|
33
34
|
"devDependencies": {
|
|
34
35
|
"ava": "^5.2.0",
|
package/src/repo-util-cli.mjs
CHANGED
|
@@ -12,11 +12,11 @@ import {
|
|
|
12
12
|
PullRequest,
|
|
13
13
|
MultiGroupProvider
|
|
14
14
|
} from "repository-provider";
|
|
15
|
-
import pkg from "../package.json" assert { type: "json" };
|
|
16
15
|
import {
|
|
17
16
|
initializeRepositoryProvider,
|
|
18
17
|
initializeCommandLine
|
|
19
|
-
} from "
|
|
18
|
+
} from "repository-provider-cli-support";
|
|
19
|
+
import pkg from "../package.json" assert { type: "json" };
|
|
20
20
|
|
|
21
21
|
const properties = {};
|
|
22
22
|
let action;
|
|
@@ -59,7 +59,7 @@ for (const t of [
|
|
|
59
59
|
suffix: "<names>",
|
|
60
60
|
description: "add a hook",
|
|
61
61
|
prepareCommand(command) {
|
|
62
|
-
command.option("-u, --url <url>", "hook url to be called")
|
|
62
|
+
command.option("-u, --url <url>", "hook url to be called");
|
|
63
63
|
},
|
|
64
64
|
executeInstance: async (repository, options) => {
|
|
65
65
|
console.log("ADD HOOK");
|
package/src/setup-provider.mjs
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import AggregationProvider from "aggregation-repository-provider";
|
|
2
|
-
import { ETagCacheLevelDB } from "etag-cache-leveldb";
|
|
3
|
-
import levelup from "levelup";
|
|
4
|
-
import leveldown from "leveldown";
|
|
5
|
-
import { mkdir } from "node:fs/promises";
|
|
6
|
-
import { join } from "node:path";
|
|
7
|
-
import { homedir } from "node:os";
|
|
8
|
-
import { Agent } from "node:https";
|
|
9
|
-
|
|
10
|
-
process.on("uncaughtException", console.error);
|
|
11
|
-
process.on("unhandledRejection", console.error);
|
|
12
|
-
|
|
13
|
-
async function createCache() {
|
|
14
|
-
const dir = join(homedir(), ".cache/repository-provider");
|
|
15
|
-
await mkdir(dir, { recursive: true });
|
|
16
|
-
const db = await levelup(leveldown(dir));
|
|
17
|
-
return new ETagCacheLevelDB(db);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const httpsAgent = new Agent({ keepAlive: true });
|
|
21
|
-
|
|
22
|
-
export async function initializeRepositoryProvider(program, properties) {
|
|
23
|
-
const provider = await AggregationProvider.initialize(
|
|
24
|
-
[],
|
|
25
|
-
properties,
|
|
26
|
-
process.env
|
|
27
|
-
);
|
|
28
|
-
|
|
29
|
-
const options = program.opts();
|
|
30
|
-
|
|
31
|
-
provider.messageDestination = {
|
|
32
|
-
...console,
|
|
33
|
-
trace: options.trace ? console.log : () => {}
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
let cache;
|
|
37
|
-
if (options.cache) {
|
|
38
|
-
cache = await createCache();
|
|
39
|
-
provider._providers.forEach(p => (p.cache = cache));
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
provider._providers.forEach(
|
|
43
|
-
p => (p.agent = url => httpsAgent )
|
|
44
|
-
);
|
|
45
|
-
|
|
46
|
-
return { provider, options, cache };
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export function initializeCommandLine(program) {
|
|
50
|
-
program
|
|
51
|
-
.option("--no-cache", "cache requests")
|
|
52
|
-
.option("--statistics", "show cache statistics");
|
|
53
|
-
}
|