repo-util 1.27.4 → 1.27.6

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  [![npm](https://img.shields.io/npm/v/repo-util.svg)](https://www.npmjs.com/package/repo-util)
2
2
  [![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
3
- [![Open Bundle](https://bundlejs.com/badge-light.svg)](https://bundlejs.com/?q=repo-util)
3
+ [![bundlejs](https://deno.bundlejs.com/?q=repo-util\&badge=detailed)](https://bundlejs.com/?q=repo-util)
4
4
  [![downloads](http://img.shields.io/npm/dm/repo-util.svg?style=flat-square)](https://npmjs.org/package/repo-util)
5
5
  [![GitHub Issues](https://img.shields.io/github/issues/arlac77/repo-util.svg?style=flat-square)](https://github.com/arlac77/repo-util/issues)
6
6
  [![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Farlac77%2Frepo-util%2Fbadge\&style=flat)](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.4",
3
+ "version": "1.27.6",
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.24",
25
- "bitbucket-repository-provider": "^5.1.1",
24
+ "aggregation-repository-provider": "^5.3.28",
25
+ "bitbucket-repository-provider": "^5.1.6",
26
26
  "commander": "^10.0.1",
27
- "etag-cache-leveldb": "^2.0.1",
28
- "gitea-repository-provider": "^3.1.1",
29
- "github-repository-provider": "^8.0.12",
27
+ "etag-cache-leveldb": "^2.0.3",
28
+ "gitea-repository-provider": "^3.1.5",
29
+ "github-repository-provider": "^8.0.16",
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",
@@ -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 "./setup-provider.mjs";
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");
@@ -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
- }