all-contributors-for-repository 0.6.0 → 0.7.0
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 +4 -0
- package/lib/collect/api.d.ts +13 -1
- package/lib/collect/api.d.ts.map +1 -1
- package/lib/collect/api.js +7 -3
- package/lib/collect/api.js.map +1 -1
- package/lib/collect/collecting/collectAcceptedIssues.d.ts +1 -1
- package/lib/collect/collecting/collectAcceptedIssues.d.ts.map +1 -1
- package/lib/collect/collecting/collectAcceptedIssues.js +2 -1
- package/lib/collect/collecting/collectAcceptedIssues.js.map +1 -1
- package/lib/collect/collecting/collectIssueEvents.d.ts +1 -1
- package/lib/collect/collecting/collectIssueEvents.d.ts.map +1 -1
- package/lib/collect/collecting/collectIssueEvents.js +5 -2
- package/lib/collect/collecting/collectIssueEvents.js.map +1 -1
- package/lib/collect/collecting/collectMergedPulls.d.ts +1 -1
- package/lib/collect/collecting/collectMergedPulls.d.ts.map +1 -1
- package/lib/collect/collecting/collectMergedPulls.js +8 -2
- package/lib/collect/collecting/collectMergedPulls.js.map +1 -1
- package/lib/collect/collecting/collectRepoEvents.d.ts +1 -1
- package/lib/collect/collecting/collectRepoEvents.d.ts.map +1 -1
- package/lib/collect/collecting/collectRepoEvents.js +5 -2
- package/lib/collect/collecting/collectRepoEvents.js.map +1 -1
- package/lib/collect/index.js +4 -4
- package/lib/collect/index.js.map +1 -1
- package/lib/collect/processing/processContributors.js +9 -3
- package/lib/collect/processing/processContributors.js.map +1 -1
- package/lib/options.d.ts +6 -0
- package/lib/options.d.ts.map +1 -1
- package/lib/options.js +1 -0
- package/lib/options.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -92,6 +92,9 @@ It additionally allows for the following optional options.
|
|
|
92
92
|
- `labelTypeDocs` _(`string`)_: Label to indicate an issue is for documentation.
|
|
93
93
|
- `labelTypeIdeas` _(`string`)_: Label to indicate an issue is for a feature.
|
|
94
94
|
- `labelTypeTool` _(`string`)_: Label to indicate an issue is for tooling.
|
|
95
|
+
- `since` _(`Date`)_: Only include contributions made at or after this time.
|
|
96
|
+
- Default: no limit; all available contributions are included.
|
|
97
|
+
- Useful for repeated runs, to avoid re-requesting contributions that were already seen.
|
|
95
98
|
- `testFiles` _(`RegExp[]`)_: Regular expressions for file paths that count as tests, for merged PRs to be given a `test` contribution.
|
|
96
99
|
- Default: `[/\.(spec|test)\.[^/]+$/i, /(^|\/)(__tests__|tests?)\//i]`
|
|
97
100
|
- Pass `[]` to skip looking at PR files altogether.
|
|
@@ -107,6 +110,7 @@ getAllContributorsForRepository({
|
|
|
107
110
|
labelTypeDocs: "docs",
|
|
108
111
|
labelTypeIdeas: "feature",
|
|
109
112
|
labelTypeTool: "tool",
|
|
113
|
+
since: new Date("2026-01-01"),
|
|
110
114
|
testFiles: [/^tests\//],
|
|
111
115
|
});
|
|
112
116
|
```
|
package/lib/collect/api.d.ts
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
import { Octokit } from "octokit";
|
|
2
2
|
//#region src/collect/api.d.ts
|
|
3
3
|
export declare const perPage = 100;
|
|
4
|
+
export interface PaginateOptions<T> {
|
|
5
|
+
/**
|
|
6
|
+
* Earliest time an item may have happened at to be included.
|
|
7
|
+
* Pages are expected to be ordered newest-first, so paginating stops
|
|
8
|
+
* on the first page that contains an item from before this time.
|
|
9
|
+
*/
|
|
10
|
+
since?: Date;
|
|
11
|
+
/**
|
|
12
|
+
* Retrieves when an item happened, for comparing against `since`.
|
|
13
|
+
*/
|
|
14
|
+
timestampOf?: (item: T) => null | string | undefined;
|
|
15
|
+
}
|
|
4
16
|
export interface PaginatingOctokit {
|
|
5
17
|
paginate: Pick<Octokit["paginate"], "iterator">;
|
|
6
18
|
}
|
|
@@ -11,6 +23,6 @@ export interface RequestDefaults {
|
|
|
11
23
|
export declare function createOctokit(auth: string | undefined): Promise<Octokit>;
|
|
12
24
|
export declare function paginate<T>(pages: AsyncIterable<{
|
|
13
25
|
data: T[];
|
|
14
|
-
}>): Promise<T[]>;
|
|
26
|
+
}>, { since, timestampOf }?: PaginateOptions<T>): Promise<T[]>;
|
|
15
27
|
//#endregion
|
|
16
28
|
//# sourceMappingURL=api.d.ts.map
|
package/lib/collect/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","names":[],"sources":["../../src/collect/api.ts"],"mappings":";;qBAKa;iBAEI;EAChB,UAAU,KAAK;;iBAGC;EAChB;EACA;;wBAGqB,cACrB,2BACE,QAAQ;wBASW,SAAS,
|
|
1
|
+
{"version":3,"file":"api.d.ts","names":[],"sources":["../../src/collect/api.ts"],"mappings":";;qBAKa;iBAEI,gBAAgB;;;;;;EAMhC,QAAQ;;;;EAKR,eAAe,MAAM;;iBAGL;EAChB,UAAU,KAAK;;iBAGC;EAChB;EACA;;wBAGqB,cACrB,2BACE,QAAQ;wBASW,SAAS,GAC9B,OAAO;EAAgB,MAAM;MAC3B,OAAO,gBAAe,gBAAgB,KAAO,QAAA"}
|
package/lib/collect/api.js
CHANGED
|
@@ -8,16 +8,20 @@ async function createOctokit(auth) {
|
|
|
8
8
|
headers: { "X-GitHub-Api-Version": "2022-11-28" }
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
|
-
async function paginate(pages) {
|
|
11
|
+
async function paginate(pages, { since, timestampOf } = {}) {
|
|
12
12
|
const items = [];
|
|
13
13
|
let requested = 0;
|
|
14
14
|
for await (const page of pages) {
|
|
15
|
-
|
|
15
|
+
const pageItems = since && timestampOf ? page.data.filter((item) => !isBefore(timestampOf(item), since)) : page.data;
|
|
16
|
+
items.push(...pageItems);
|
|
16
17
|
requested += 1;
|
|
17
|
-
if (requested >= maxPages) break;
|
|
18
|
+
if (requested >= maxPages || pageItems.length < page.data.length) break;
|
|
18
19
|
}
|
|
19
20
|
return items;
|
|
20
21
|
}
|
|
22
|
+
function isBefore(timestamp, since) {
|
|
23
|
+
return !!timestamp && new Date(timestamp) < since;
|
|
24
|
+
}
|
|
21
25
|
//#endregion
|
|
22
26
|
export { createOctokit, paginate, perPage };
|
|
23
27
|
|
package/lib/collect/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","names":[],"sources":["../../src/collect/api.ts"],"sourcesContent":["import { Octokit } from \"octokit\";\nimport { octokitFromAuthSafe } from \"octokit-from-auth\";\n\nconst maxPages = 10;\n\nexport const perPage = 100;\n\nexport interface PaginatingOctokit {\n\tpaginate: Pick<Octokit[\"paginate\"], \"iterator\">;\n}\n\nexport interface RequestDefaults {\n\towner: string;\n\trepo: string;\n}\n\nexport async function createOctokit(\n\tauth: string | undefined,\n): Promise<Octokit> {\n\treturn await octokitFromAuthSafe({\n\t\tauth,\n\t\theaders: {\n\t\t\t\"X-GitHub-Api-Version\": \"2022-11-28\",\n\t\t},\n\t});\n}\n\nexport async function paginate<T>(
|
|
1
|
+
{"version":3,"file":"api.js","names":[],"sources":["../../src/collect/api.ts"],"sourcesContent":["import { Octokit } from \"octokit\";\nimport { octokitFromAuthSafe } from \"octokit-from-auth\";\n\nconst maxPages = 10;\n\nexport const perPage = 100;\n\nexport interface PaginateOptions<T> {\n\t/**\n\t * Earliest time an item may have happened at to be included.\n\t * Pages are expected to be ordered newest-first, so paginating stops\n\t * on the first page that contains an item from before this time.\n\t */\n\tsince?: Date;\n\n\t/**\n\t * Retrieves when an item happened, for comparing against `since`.\n\t */\n\ttimestampOf?: (item: T) => null | string | undefined;\n}\n\nexport interface PaginatingOctokit {\n\tpaginate: Pick<Octokit[\"paginate\"], \"iterator\">;\n}\n\nexport interface RequestDefaults {\n\towner: string;\n\trepo: string;\n}\n\nexport async function createOctokit(\n\tauth: string | undefined,\n): Promise<Octokit> {\n\treturn await octokitFromAuthSafe({\n\t\tauth,\n\t\theaders: {\n\t\t\t\"X-GitHub-Api-Version\": \"2022-11-28\",\n\t\t},\n\t});\n}\n\nexport async function paginate<T>(\n\tpages: AsyncIterable<{ data: T[] }>,\n\t{ since, timestampOf }: PaginateOptions<T> = {},\n) {\n\tconst items: T[] = [];\n\tlet requested = 0;\n\n\tfor await (const page of pages) {\n\t\tconst pageItems =\n\t\t\tsince && timestampOf\n\t\t\t\t? page.data.filter((item) => !isBefore(timestampOf(item), since))\n\t\t\t\t: page.data;\n\n\t\titems.push(...pageItems);\n\t\trequested += 1;\n\n\t\tif (requested >= maxPages || pageItems.length < page.data.length) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn items;\n}\n\nfunction isBefore(timestamp: null | string | undefined, since: Date) {\n\treturn !!timestamp && new Date(timestamp) < since;\n}\n"],"mappings":";;AAGA,MAAM,WAAW;AAEjB,MAAa,UAAU;AAyBvB,eAAsB,cACrB,MACmB;CACnB,OAAO,MAAM,oBAAoB;EAChC;EACA,SAAS,EACR,wBAAwB,aACzB;CACD,CAAC;AACF;AAEA,eAAsB,SACrB,OACA,EAAE,OAAO,gBAAoC,CAAC,GAC7C;CACD,MAAM,QAAa,CAAC;CACpB,IAAI,YAAY;CAEhB,WAAW,MAAM,QAAQ,OAAO;EAC/B,MAAM,YACL,SAAS,cACN,KAAK,KAAK,QAAQ,SAAS,CAAC,SAAS,YAAY,IAAI,GAAG,KAAK,CAAC,IAC9D,KAAK;EAET,MAAM,KAAK,GAAG,SAAS;EACvB,aAAa;EAEb,IAAI,aAAa,YAAY,UAAU,SAAS,KAAK,KAAK,QACzD;CAEF;CAEA,OAAO;AACR;AAEA,SAAS,SAAS,WAAsC,OAAa;CACpE,OAAO,CAAC,CAAC,aAAa,IAAI,KAAK,SAAS,IAAI;AAC7C"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PaginatingOctokit, RequestDefaults } from "../api.js";
|
|
2
2
|
//#region src/collect/collecting/collectAcceptedIssues.d.ts
|
|
3
3
|
export type AcceptedIssue = Awaited<ReturnType<typeof collectAcceptedIssues>>[number];
|
|
4
|
-
export declare function collectAcceptedIssues(defaults: RequestDefaults, octokit: PaginatingOctokit, labelAcceptingPrs: string): Promise<{
|
|
4
|
+
export declare function collectAcceptedIssues(defaults: RequestDefaults, octokit: PaginatingOctokit, labelAcceptingPrs: string, since?: Date): Promise<{
|
|
5
5
|
id: number;
|
|
6
6
|
node_id: string;
|
|
7
7
|
url: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collectAcceptedIssues.d.ts","names":[],"sources":["../../../src/collect/collecting/collectAcceptedIssues.ts"],"mappings":";;YAOY,gBAAgB,QAC3B,kBAAkB;wBAGG,sBACrB,UAAU,iBACV,SAAS,mBACT,
|
|
1
|
+
{"version":3,"file":"collectAcceptedIssues.d.ts","names":[],"sources":["../../../src/collect/collecting/collectAcceptedIssues.ts"],"mappings":";;YAOY,gBAAgB,QAC3B,kBAAkB;wBAGG,sBACrB,UAAU,iBACV,SAAS,mBACT,2BACA,QAAQ,OAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAc8qowB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAtwkE;;MAAmD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAqhX;MAAsC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAspiD;MAAyB;MAA2B;MAA2B;MAA8B"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { paginate } from "../api.js";
|
|
2
2
|
//#region src/collect/collecting/collectAcceptedIssues.ts
|
|
3
|
-
async function collectAcceptedIssues(defaults, octokit, labelAcceptingPrs) {
|
|
3
|
+
async function collectAcceptedIssues(defaults, octokit, labelAcceptingPrs, since) {
|
|
4
4
|
return await paginate(octokit.paginate.iterator("GET /repos/{owner}/{repo}/issues", {
|
|
5
5
|
...defaults,
|
|
6
6
|
labels: labelAcceptingPrs,
|
|
7
7
|
per_page: 100,
|
|
8
|
+
...since && { since: since.toISOString() },
|
|
8
9
|
state: "all"
|
|
9
10
|
}));
|
|
10
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collectAcceptedIssues.js","names":[],"sources":["../../../src/collect/collecting/collectAcceptedIssues.ts"],"sourcesContent":["import {\n\tpaginate,\n\tPaginatingOctokit,\n\tperPage,\n\tRequestDefaults,\n} from \"../api.js\";\n\nexport type AcceptedIssue = Awaited<\n\tReturnType<typeof collectAcceptedIssues>\n>[number];\n\nexport async function collectAcceptedIssues(\n\tdefaults: RequestDefaults,\n\toctokit: PaginatingOctokit,\n\tlabelAcceptingPrs: string,\n) {\n\tconst issues = await paginate(\n\t\toctokit.paginate.iterator(\"GET /repos/{owner}/{repo}/issues\", {\n\t\t\t...defaults,\n\t\t\tlabels: labelAcceptingPrs,\n\t\t\tper_page: perPage,\n\t\t\tstate: \"all\",\n\t\t}),\n\t);\n\n\treturn issues;\n}\n"],"mappings":";;AAWA,eAAsB,sBACrB,UACA,SACA,
|
|
1
|
+
{"version":3,"file":"collectAcceptedIssues.js","names":[],"sources":["../../../src/collect/collecting/collectAcceptedIssues.ts"],"sourcesContent":["import {\n\tpaginate,\n\tPaginatingOctokit,\n\tperPage,\n\tRequestDefaults,\n} from \"../api.js\";\n\nexport type AcceptedIssue = Awaited<\n\tReturnType<typeof collectAcceptedIssues>\n>[number];\n\nexport async function collectAcceptedIssues(\n\tdefaults: RequestDefaults,\n\toctokit: PaginatingOctokit,\n\tlabelAcceptingPrs: string,\n\tsince?: Date,\n) {\n\tconst issues = await paginate(\n\t\toctokit.paginate.iterator(\"GET /repos/{owner}/{repo}/issues\", {\n\t\t\t...defaults,\n\t\t\tlabels: labelAcceptingPrs,\n\t\t\tper_page: perPage,\n\t\t\t...(since && { since: since.toISOString() }),\n\t\t\tstate: \"all\",\n\t\t}),\n\t);\n\n\treturn issues;\n}\n"],"mappings":";;AAWA,eAAsB,sBACrB,UACA,SACA,mBACA,OACC;CAWD,OAAO,MAVc,SACpB,QAAQ,SAAS,SAAS,oCAAoC;EAC7D,GAAG;EACH,QAAQ;EACR,UAAA;EACA,GAAI,SAAS,EAAE,OAAO,MAAM,YAAY,EAAE;EAC1C,OAAO;CACR,CAAC,CACF;AAGD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PaginatingOctokit, RequestDefaults } from "../api.js";
|
|
2
2
|
//#region src/collect/collecting/collectIssueEvents.d.ts
|
|
3
3
|
export type IssueEvent = Awaited<ReturnType<typeof collectIssueEvents>>[number];
|
|
4
|
-
export declare function collectIssueEvents(defaults: RequestDefaults, octokit: PaginatingOctokit): Promise<{
|
|
4
|
+
export declare function collectIssueEvents(defaults: RequestDefaults, octokit: PaginatingOctokit, since?: Date): Promise<{
|
|
5
5
|
id: number;
|
|
6
6
|
node_id: string;
|
|
7
7
|
url: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collectIssueEvents.d.ts","names":[],"sources":["../../../src/collect/collecting/collectIssueEvents.ts"],"mappings":";;YAeY,aAAa,QAAQ,kBAAkB;wBAE7B,mBACrB,UAAU,iBACV,SAAS,
|
|
1
|
+
{"version":3,"file":"collectIssueEvents.d.ts","names":[],"sources":["../../../src/collect/collecting/collectIssueEvents.ts"],"mappings":";;YAeY,aAAa,QAAQ,kBAAkB;wBAE7B,mBACrB,UAAU,iBACV,SAAS,mBACT,QAAQ,OAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAc2rwpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAA14sd;;QAAmD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAAqhX;QAAsC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAAspiD;QAAyB;QAA2B;QAA2B;QAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAA7G;MAAyB;MAA2B;MAA2B;MAA8B"}
|
|
@@ -7,11 +7,14 @@ const relevantIssueEvents = /* @__PURE__ */ new Set([
|
|
|
7
7
|
"pinned",
|
|
8
8
|
"unlocked"
|
|
9
9
|
]);
|
|
10
|
-
async function collectIssueEvents(defaults, octokit) {
|
|
10
|
+
async function collectIssueEvents(defaults, octokit, since) {
|
|
11
11
|
return (await paginate(octokit.paginate.iterator("GET /repos/{owner}/{repo}/issues/events", {
|
|
12
12
|
...defaults,
|
|
13
13
|
per_page: 100
|
|
14
|
-
})
|
|
14
|
+
}), {
|
|
15
|
+
since,
|
|
16
|
+
timestampOf: (issueEvent) => issueEvent.created_at
|
|
17
|
+
})).filter((issueEvent) => relevantIssueEvents.has(issueEvent.event));
|
|
15
18
|
}
|
|
16
19
|
//#endregion
|
|
17
20
|
export { collectIssueEvents };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collectIssueEvents.js","names":[],"sources":["../../../src/collect/collecting/collectIssueEvents.ts"],"sourcesContent":["import {\n\tpaginate,\n\tPaginatingOctokit,\n\tperPage,\n\tRequestDefaults,\n} from \"../api.js\";\n\nconst relevantIssueEvents = new Set([\n\t\"assigned\",\n\t\"locked\",\n\t\"merged\",\n\t\"pinned\",\n\t\"unlocked\",\n]);\n\nexport type IssueEvent = Awaited<ReturnType<typeof collectIssueEvents>>[number];\n\nexport async function collectIssueEvents(\n\tdefaults: RequestDefaults,\n\toctokit: PaginatingOctokit,\n) {\n\tconst issueEvents = await paginate(\n\t\toctokit.paginate.iterator(\"GET /repos/{owner}/{repo}/issues/events\", {\n\t\t\t...defaults,\n\t\t\tper_page: perPage,\n\t\t}),\n\t);\n\n\treturn issueEvents.filter((issueEvent) =>\n\t\trelevantIssueEvents.has(issueEvent.event),\n\t);\n}\n"],"mappings":";;AAOA,MAAM,sCAAsB,IAAI,IAAI;CACnC;CACA;CACA;CACA;CACA;AACD,CAAC;AAID,eAAsB,mBACrB,UACA,
|
|
1
|
+
{"version":3,"file":"collectIssueEvents.js","names":[],"sources":["../../../src/collect/collecting/collectIssueEvents.ts"],"sourcesContent":["import {\n\tpaginate,\n\tPaginatingOctokit,\n\tperPage,\n\tRequestDefaults,\n} from \"../api.js\";\n\nconst relevantIssueEvents = new Set([\n\t\"assigned\",\n\t\"locked\",\n\t\"merged\",\n\t\"pinned\",\n\t\"unlocked\",\n]);\n\nexport type IssueEvent = Awaited<ReturnType<typeof collectIssueEvents>>[number];\n\nexport async function collectIssueEvents(\n\tdefaults: RequestDefaults,\n\toctokit: PaginatingOctokit,\n\tsince?: Date,\n) {\n\tconst issueEvents = await paginate(\n\t\toctokit.paginate.iterator(\"GET /repos/{owner}/{repo}/issues/events\", {\n\t\t\t...defaults,\n\t\t\tper_page: perPage,\n\t\t}),\n\t\t{ since, timestampOf: (issueEvent) => issueEvent.created_at },\n\t);\n\n\treturn issueEvents.filter((issueEvent) =>\n\t\trelevantIssueEvents.has(issueEvent.event),\n\t);\n}\n"],"mappings":";;AAOA,MAAM,sCAAsB,IAAI,IAAI;CACnC;CACA;CACA;CACA;CACA;AACD,CAAC;AAID,eAAsB,mBACrB,UACA,SACA,OACC;CASD,QAAO,MARmB,SACzB,QAAQ,SAAS,SAAS,2CAA2C;EACpE,GAAG;EACH,UAAA;CACD,CAAC,GACD;EAAE;EAAO,cAAc,eAAe,WAAW;CAAW,CAC7D,EAAA,CAEmB,QAAQ,eAC1B,oBAAoB,IAAI,WAAW,KAAK,CACzC;AACD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PaginatingOctokit, RequestDefaults } from "../api.js";
|
|
2
2
|
//#region src/collect/collecting/collectMergedPulls.d.ts
|
|
3
3
|
export type MergedPull = Awaited<ReturnType<typeof collectMergedPulls>>[number];
|
|
4
|
-
export declare function collectMergedPulls(defaults: RequestDefaults, octokit: PaginatingOctokit): Promise<{
|
|
4
|
+
export declare function collectMergedPulls(defaults: RequestDefaults, octokit: PaginatingOctokit, since?: Date): Promise<{
|
|
5
5
|
url: string;
|
|
6
6
|
repository_url: string;
|
|
7
7
|
labels_url: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collectMergedPulls.d.ts","names":[],"sources":["../../../src/collect/collecting/collectMergedPulls.ts"],"mappings":";;YAOY,aAAa,QAAQ,kBAAkB;wBAE7B,mBACrB,UAAU,iBACV,SAAS,
|
|
1
|
+
{"version":3,"file":"collectMergedPulls.d.ts","names":[],"sources":["../../../src/collect/collecting/collectMergedPulls.ts"],"mappings":";;YAOY,aAAa,QAAQ,kBAAkB;wBAE7B,mBACrB,UAAU,iBACV,SAAS,mBACT,QAAQ,OAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAgBgqruC;IAA0B;IAAsB;IAAuB;IAAwB;IAA0B;IAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAt1F;MAA0B;;;;IAAolH;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAhqpiB;;MAAmD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAqhX;MAAsC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAspiD;MAAyB;MAA2B;MAA2B;MAA8B"}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { paginate } from "../api.js";
|
|
2
2
|
//#region src/collect/collecting/collectMergedPulls.ts
|
|
3
|
-
async function collectMergedPulls(defaults, octokit) {
|
|
3
|
+
async function collectMergedPulls(defaults, octokit, since) {
|
|
4
|
+
const qualifiers = [
|
|
5
|
+
`repo:${defaults.owner}/${defaults.repo}`,
|
|
6
|
+
"is:pr",
|
|
7
|
+
"is:merged",
|
|
8
|
+
...since ? [`merged:>=${since.toISOString()}`] : []
|
|
9
|
+
];
|
|
4
10
|
return await paginate(octokit.paginate.iterator("GET /search/issues", {
|
|
5
11
|
per_page: 100,
|
|
6
|
-
q:
|
|
12
|
+
q: qualifiers.join("+")
|
|
7
13
|
}));
|
|
8
14
|
}
|
|
9
15
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collectMergedPulls.js","names":[],"sources":["../../../src/collect/collecting/collectMergedPulls.ts"],"sourcesContent":["import {\n\tpaginate,\n\tPaginatingOctokit,\n\tperPage,\n\tRequestDefaults,\n} from \"../api.js\";\n\nexport type MergedPull = Awaited<ReturnType<typeof collectMergedPulls>>[number];\n\nexport async function collectMergedPulls(\n\tdefaults: RequestDefaults,\n\toctokit: PaginatingOctokit,\n) {\n\treturn await paginate(\n\t\toctokit.paginate.iterator(\"GET /search/issues\", {\n\t\t\tper_page: perPage,\n\t\t\tq:
|
|
1
|
+
{"version":3,"file":"collectMergedPulls.js","names":[],"sources":["../../../src/collect/collecting/collectMergedPulls.ts"],"sourcesContent":["import {\n\tpaginate,\n\tPaginatingOctokit,\n\tperPage,\n\tRequestDefaults,\n} from \"../api.js\";\n\nexport type MergedPull = Awaited<ReturnType<typeof collectMergedPulls>>[number];\n\nexport async function collectMergedPulls(\n\tdefaults: RequestDefaults,\n\toctokit: PaginatingOctokit,\n\tsince?: Date,\n) {\n\tconst qualifiers = [\n\t\t`repo:${defaults.owner}/${defaults.repo}`,\n\t\t\"is:pr\",\n\t\t\"is:merged\",\n\t\t...(since ? [`merged:>=${since.toISOString()}`] : []),\n\t];\n\n\treturn await paginate(\n\t\toctokit.paginate.iterator(\"GET /search/issues\", {\n\t\t\tper_page: perPage,\n\t\t\tq: qualifiers.join(\"+\"),\n\t\t}),\n\t);\n}\n"],"mappings":";;AASA,eAAsB,mBACrB,UACA,SACA,OACC;CACD,MAAM,aAAa;EAClB,QAAQ,SAAS,MAAM,GAAG,SAAS;EACnC;EACA;EACA,GAAI,QAAQ,CAAC,YAAY,MAAM,YAAY,GAAG,IAAI,CAAC;CACpD;CAEA,OAAO,MAAM,SACZ,QAAQ,SAAS,SAAS,sBAAsB;EAC/C,UAAA;EACA,GAAG,WAAW,KAAK,GAAG;CACvB,CAAC,CACF;AACD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PaginatingOctokit, RequestDefaults } from "../api.js";
|
|
2
2
|
//#region src/collect/collecting/collectRepoEvents.d.ts
|
|
3
3
|
export type RepoEvent = Awaited<ReturnType<typeof collectRepoEvents>>[number];
|
|
4
|
-
export declare function collectRepoEvents(defaults: RequestDefaults, octokit: PaginatingOctokit): Promise<{
|
|
4
|
+
export declare function collectRepoEvents(defaults: RequestDefaults, octokit: PaginatingOctokit, since?: Date): Promise<{
|
|
5
5
|
id: string;
|
|
6
6
|
type: string | null;
|
|
7
7
|
actor: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collectRepoEvents.d.ts","names":[],"sources":["../../../src/collect/collecting/collectRepoEvents.ts"],"mappings":";;YAOY,YAAY,QAAQ,kBAAkB;wBAE5B,kBACrB,UAAU,iBACV,SAAS,
|
|
1
|
+
{"version":3,"file":"collectRepoEvents.d.ts","names":[],"sources":["../../../src/collect/collecting/collectRepoEvents.ts"],"mappings":";;YAOY,YAAY,QAAQ,kBAAkB;wBAE5B,kBACrB,UAAU,iBACV,SAAS,mBACT,QAAQ,OAAI;;;;;;;;;;;;;;;;;;;;;;;;;IAUouuwB;IAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAAz+F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAAtwkE;;UAAmD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAAqhX;UAAsC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAAspiD;UAAyB;UAA2B;UAA2B;UAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAg7Q;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAA7hR;UAAyB;UAA2B;UAA2B;UAA8B;;;;;;;;;;;;;;;;;;;IAAw+Q;MAAwB;MAA0B;MAA4B;MAAkC;MAAwB;MAA6B"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { paginate } from "../api.js";
|
|
2
2
|
//#region src/collect/collecting/collectRepoEvents.ts
|
|
3
|
-
async function collectRepoEvents(defaults, octokit) {
|
|
3
|
+
async function collectRepoEvents(defaults, octokit, since) {
|
|
4
4
|
return await paginate(octokit.paginate.iterator("GET /repos/{owner}/{repo}/events", {
|
|
5
5
|
...defaults,
|
|
6
6
|
per_page: 100
|
|
7
|
-
})
|
|
7
|
+
}), {
|
|
8
|
+
since,
|
|
9
|
+
timestampOf: (repoEvent) => repoEvent.created_at
|
|
10
|
+
});
|
|
8
11
|
}
|
|
9
12
|
//#endregion
|
|
10
13
|
export { collectRepoEvents };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collectRepoEvents.js","names":[],"sources":["../../../src/collect/collecting/collectRepoEvents.ts"],"sourcesContent":["import {\n\tpaginate,\n\tPaginatingOctokit,\n\tperPage,\n\tRequestDefaults,\n} from \"../api.js\";\n\nexport type RepoEvent = Awaited<ReturnType<typeof collectRepoEvents>>[number];\n\nexport async function collectRepoEvents(\n\tdefaults: RequestDefaults,\n\toctokit: PaginatingOctokit,\n) {\n\treturn await paginate(\n\t\toctokit.paginate.iterator(\"GET /repos/{owner}/{repo}/events\", {\n\t\t\t...defaults,\n\t\t\tper_page: perPage,\n\t\t}),\n\t);\n}\n"],"mappings":";;AASA,eAAsB,kBACrB,UACA,
|
|
1
|
+
{"version":3,"file":"collectRepoEvents.js","names":[],"sources":["../../../src/collect/collecting/collectRepoEvents.ts"],"sourcesContent":["import {\n\tpaginate,\n\tPaginatingOctokit,\n\tperPage,\n\tRequestDefaults,\n} from \"../api.js\";\n\nexport type RepoEvent = Awaited<ReturnType<typeof collectRepoEvents>>[number];\n\nexport async function collectRepoEvents(\n\tdefaults: RequestDefaults,\n\toctokit: PaginatingOctokit,\n\tsince?: Date,\n) {\n\treturn await paginate(\n\t\toctokit.paginate.iterator(\"GET /repos/{owner}/{repo}/events\", {\n\t\t\t...defaults,\n\t\t\tper_page: perPage,\n\t\t}),\n\t\t{ since, timestampOf: (repoEvent) => repoEvent.created_at },\n\t);\n}\n"],"mappings":";;AASA,eAAsB,kBACrB,UACA,SACA,OACC;CACD,OAAO,MAAM,SACZ,QAAQ,SAAS,SAAS,oCAAoC;EAC7D,GAAG;EACH,UAAA;CACD,CAAC,GACD;EAAE;EAAO,cAAc,cAAc,UAAU;CAAW,CAC3D;AACD"}
|
package/lib/collect/index.js
CHANGED
|
@@ -14,10 +14,10 @@ async function collect(options) {
|
|
|
14
14
|
};
|
|
15
15
|
const octokit = await createOctokit(options.auth);
|
|
16
16
|
const [acceptedIssues, issueEvents, mergedPulls, repoEvents] = await Promise.all([
|
|
17
|
-
collectAcceptedIssues(defaults, octokit, options.labelAcceptingPrs),
|
|
18
|
-
collectIssueEvents(defaults, octokit),
|
|
19
|
-
collectMergedPulls(defaults, octokit),
|
|
20
|
-
collectRepoEvents(defaults, octokit)
|
|
17
|
+
collectAcceptedIssues(defaults, octokit, options.labelAcceptingPrs, options.since),
|
|
18
|
+
collectIssueEvents(defaults, octokit, options.since),
|
|
19
|
+
collectMergedPulls(defaults, octokit, options.since),
|
|
20
|
+
collectRepoEvents(defaults, octokit, options.since)
|
|
21
21
|
]);
|
|
22
22
|
const contributors = processContributors(issueEvents, repoEvents, options);
|
|
23
23
|
addAcceptedIssues(Object.values(acceptedIssues), contributors, options);
|
package/lib/collect/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/collect/index.ts"],"sourcesContent":["import { ContributorsContributions } from \"../ContributorsCollection.js\";\nimport { AllContributorsForRepositoryOptions } from \"../options.js\";\nimport { addAcceptedIssues } from \"./adding/addAcceptedIssues.js\";\nimport { addMergedPulls } from \"./adding/addMergedPulls.js\";\nimport { createOctokit } from \"./api.js\";\nimport { collectAcceptedIssues } from \"./collecting/collectAcceptedIssues.js\";\nimport { collectIssueEvents } from \"./collecting/collectIssueEvents.js\";\nimport { collectMergedPulls } from \"./collecting/collectMergedPulls.js\";\nimport { collectRepoEvents } from \"./collecting/collectRepoEvents.js\";\nimport { processContributors } from \"./processing/processContributors.js\";\n\nexport async function collect(\n\toptions: AllContributorsForRepositoryOptions,\n): Promise<ContributorsContributions> {\n\tconst defaults = { owner: options.owner, repo: options.repo };\n\tconst octokit = await createOctokit(options.auth);\n\n\t// 1. Collect event data from the GitHub API\n\tconst [acceptedIssues, issueEvents, mergedPulls, repoEvents] =\n\t\tawait Promise.all([\n\t\t\tcollectAcceptedIssues(
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/collect/index.ts"],"sourcesContent":["import { ContributorsContributions } from \"../ContributorsCollection.js\";\nimport { AllContributorsForRepositoryOptions } from \"../options.js\";\nimport { addAcceptedIssues } from \"./adding/addAcceptedIssues.js\";\nimport { addMergedPulls } from \"./adding/addMergedPulls.js\";\nimport { createOctokit } from \"./api.js\";\nimport { collectAcceptedIssues } from \"./collecting/collectAcceptedIssues.js\";\nimport { collectIssueEvents } from \"./collecting/collectIssueEvents.js\";\nimport { collectMergedPulls } from \"./collecting/collectMergedPulls.js\";\nimport { collectRepoEvents } from \"./collecting/collectRepoEvents.js\";\nimport { processContributors } from \"./processing/processContributors.js\";\n\nexport async function collect(\n\toptions: AllContributorsForRepositoryOptions,\n): Promise<ContributorsContributions> {\n\tconst defaults = { owner: options.owner, repo: options.repo };\n\tconst octokit = await createOctokit(options.auth);\n\n\t// 1. Collect event data from the GitHub API\n\tconst [acceptedIssues, issueEvents, mergedPulls, repoEvents] =\n\t\tawait Promise.all([\n\t\t\tcollectAcceptedIssues(\n\t\t\t\tdefaults,\n\t\t\t\toctokit,\n\t\t\t\toptions.labelAcceptingPrs,\n\t\t\t\toptions.since,\n\t\t\t),\n\t\t\tcollectIssueEvents(defaults, octokit, options.since),\n\t\t\tcollectMergedPulls(defaults, octokit, options.since),\n\t\t\tcollectRepoEvents(defaults, octokit, options.since),\n\t\t]);\n\n\t// 2. Process individual contributors from those events\n\tconst contributors = processContributors(issueEvents, repoEvents, options);\n\n\t// 3. Add additional contributors based on issues and pulls\n\taddAcceptedIssues(Object.values(acceptedIssues), contributors, options);\n\tawait addMergedPulls(mergedPulls, contributors, octokit, options);\n\n\t// 4. Collect the contributions under each contributor\n\treturn contributors.collect();\n}\n"],"mappings":";;;;;;;;;AAWA,eAAsB,QACrB,SACqC;CACrC,MAAM,WAAW;EAAE,OAAO,QAAQ;EAAO,MAAM,QAAQ;CAAK;CAC5D,MAAM,UAAU,MAAM,cAAc,QAAQ,IAAI;CAGhD,MAAM,CAAC,gBAAgB,aAAa,aAAa,cAChD,MAAM,QAAQ,IAAI;EACjB,sBACC,UACA,SACA,QAAQ,mBACR,QAAQ,KACT;EACA,mBAAmB,UAAU,SAAS,QAAQ,KAAK;EACnD,mBAAmB,UAAU,SAAS,QAAQ,KAAK;EACnD,kBAAkB,UAAU,SAAS,QAAQ,KAAK;CACnD,CAAC;CAGF,MAAM,eAAe,oBAAoB,aAAa,YAAY,OAAO;CAGzE,kBAAkB,OAAO,OAAO,cAAc,GAAG,cAAc,OAAO;CACtE,MAAM,eAAe,aAAa,cAAc,SAAS,OAAO;CAGhE,OAAO,aAAa,QAAQ;AAC7B"}
|
|
@@ -4,13 +4,19 @@ import { repoEventIsPullRequestReviewEvent } from "./repoEventIsPullRequestRevie
|
|
|
4
4
|
function processContributors(issueEvents, repoEvents, options) {
|
|
5
5
|
const contributors = new ContributorsCollection(options.ignoredLogins);
|
|
6
6
|
const maintainers = /* @__PURE__ */ new Set();
|
|
7
|
-
for (const issueEvent of issueEvents)
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
for (const issueEvent of issueEvents) {
|
|
8
|
+
const login = getMaintainerLogin(issueEvent);
|
|
9
|
+
if (login && issueEvent.issue) {
|
|
10
|
+
contributors.add(login, issueEvent.issue.number, "maintenance");
|
|
11
|
+
maintainers.add(login);
|
|
12
|
+
}
|
|
10
13
|
}
|
|
11
14
|
for (const repoEvent of repoEvents) if (repoEventIsPullRequestReviewEvent(repoEvent) && maintainers.has(repoEvent.actor.login)) contributors.add(repoEvent.actor.login, repoEvent.issue.number, "review");
|
|
12
15
|
return contributors;
|
|
13
16
|
}
|
|
17
|
+
function getMaintainerLogin(issueEvent) {
|
|
18
|
+
return issueEvent.event === "assigned" ? issueEvent.assigner?.login : issueEvent.actor?.login;
|
|
19
|
+
}
|
|
14
20
|
//#endregion
|
|
15
21
|
export { processContributors };
|
|
16
22
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processContributors.js","names":[],"sources":["../../../src/collect/processing/processContributors.ts"],"sourcesContent":["import { ContributorsCollection } from \"../../ContributorsCollection.js\";\nimport { AllContributorsForRepositoryOptions } from \"../../options.js\";\nimport { IssueEvent } from \"../collecting/collectIssueEvents.js\";\nimport { RepoEvent } from \"../collecting/collectRepoEvents.js\";\nimport { repoEventIsPullRequestReviewEvent } from \"./repoEventIsPullRequestReviewEvent.js\";\n\nexport function processContributors(\n\tissueEvents: IssueEvent[],\n\trepoEvents: Pick<RepoEvent, \"type\">[],\n\toptions: Partial<AllContributorsForRepositoryOptions>,\n) {\n\tconst contributors = new ContributorsCollection(options.ignoredLogins);\n\tconst maintainers = new Set<string>();\n\n\tfor (const issueEvent of issueEvents) {\n\t\
|
|
1
|
+
{"version":3,"file":"processContributors.js","names":[],"sources":["../../../src/collect/processing/processContributors.ts"],"sourcesContent":["import { ContributorsCollection } from \"../../ContributorsCollection.js\";\nimport { AllContributorsForRepositoryOptions } from \"../../options.js\";\nimport { IssueEvent } from \"../collecting/collectIssueEvents.js\";\nimport { RepoEvent } from \"../collecting/collectRepoEvents.js\";\nimport { repoEventIsPullRequestReviewEvent } from \"./repoEventIsPullRequestReviewEvent.js\";\n\nexport function processContributors(\n\tissueEvents: IssueEvent[],\n\trepoEvents: Pick<RepoEvent, \"type\">[],\n\toptions: Partial<AllContributorsForRepositoryOptions>,\n) {\n\tconst contributors = new ContributorsCollection(options.ignoredLogins);\n\tconst maintainers = new Set<string>();\n\n\tfor (const issueEvent of issueEvents) {\n\t\tconst login = getMaintainerLogin(issueEvent);\n\t\tif (login && issueEvent.issue) {\n\t\t\tcontributors.add(login, issueEvent.issue.number, \"maintenance\");\n\t\t\tmaintainers.add(login);\n\t\t}\n\t}\n\n\tfor (const repoEvent of repoEvents) {\n\t\tif (\n\t\t\trepoEventIsPullRequestReviewEvent(repoEvent) &&\n\t\t\tmaintainers.has(repoEvent.actor.login)\n\t\t) {\n\t\t\tcontributors.add(repoEvent.actor.login, repoEvent.issue.number, \"review\");\n\t\t}\n\t}\n\n\treturn contributors;\n}\n\nfunction getMaintainerLogin(issueEvent: IssueEvent) {\n\treturn issueEvent.event === \"assigned\"\n\t\t? issueEvent.assigner?.login\n\t\t: issueEvent.actor?.login;\n}\n"],"mappings":";;;AAMA,SAAgB,oBACf,aACA,YACA,SACC;CACD,MAAM,eAAe,IAAI,uBAAuB,QAAQ,aAAa;CACrE,MAAM,8BAAc,IAAI,IAAY;CAEpC,KAAK,MAAM,cAAc,aAAa;EACrC,MAAM,QAAQ,mBAAmB,UAAU;EAC3C,IAAI,SAAS,WAAW,OAAO;GAC9B,aAAa,IAAI,OAAO,WAAW,MAAM,QAAQ,aAAa;GAC9D,YAAY,IAAI,KAAK;EACtB;CACD;CAEA,KAAK,MAAM,aAAa,YACvB,IACC,kCAAkC,SAAS,KAC3C,YAAY,IAAI,UAAU,MAAM,KAAK,GAErC,aAAa,IAAI,UAAU,MAAM,OAAO,UAAU,MAAM,QAAQ,QAAQ;CAI1E,OAAO;AACR;AAEA,SAAS,mBAAmB,YAAwB;CACnD,OAAO,WAAW,UAAU,aACzB,WAAW,UAAU,QACrB,WAAW,OAAO;AACtB"}
|
package/lib/options.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export interface AllContributorsForRepositoryOptions {
|
|
|
9
9
|
labelTypeTool: string;
|
|
10
10
|
owner: string;
|
|
11
11
|
repo: string;
|
|
12
|
+
since?: Date;
|
|
12
13
|
testFiles: RegExp[];
|
|
13
14
|
}
|
|
14
15
|
export interface RawAllContributorsForRepositoryOptions {
|
|
@@ -48,6 +49,11 @@ export interface RawAllContributorsForRepositoryOptions {
|
|
|
48
49
|
* The name of the repository to query, such as `"all-contributors-for-repository"`.
|
|
49
50
|
*/
|
|
50
51
|
repo: string;
|
|
52
|
+
/**
|
|
53
|
+
* Only include contributions made at or after this time.
|
|
54
|
+
* Useful for repeated runs, to avoid re-requesting contributions that were already seen.
|
|
55
|
+
*/
|
|
56
|
+
since?: Date;
|
|
51
57
|
/**
|
|
52
58
|
* Regular expressions for file paths that count as tests, for merged PRs to be given a `test` contribution.
|
|
53
59
|
*/
|
package/lib/options.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","names":[],"sources":["../src/options.ts"],"mappings":";iBAiBiB;EAChB;EACA,eAAe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA,WAAW;;iBAGK;;;;EAIhB;;;;EAKA,gBAAgB;;;;EAKhB;;;;EAKA;;;;EAKA;;;;EAKA;;;;EAKA;;;;EAKA;;;;EAKA;;;;
|
|
1
|
+
{"version":3,"file":"options.d.ts","names":[],"sources":["../src/options.ts"],"mappings":";iBAiBiB;EAChB;EACA,eAAe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA,QAAQ;EACR,WAAW;;iBAGK;;;;EAIhB;;;;EAKA,gBAAgB;;;;EAKhB;;;;EAKA;;;;EAKA;;;;EAKA;;;;EAKA;;;;EAKA;;;;EAKA;;;;;EAMA,QAAQ;;;;EAKR,YAAY;;wBAGG,cACf,YAAY,yCACV"}
|
package/lib/options.js
CHANGED
|
@@ -26,6 +26,7 @@ function fillInOptions(rawOptions) {
|
|
|
26
26
|
labelTypeTool: rawOptions.labelTypeTool ?? defaultOptions.labelTypeTool,
|
|
27
27
|
owner: rawOptions.owner,
|
|
28
28
|
repo: rawOptions.repo,
|
|
29
|
+
since: rawOptions.since,
|
|
29
30
|
testFiles: rawOptions.testFiles ?? defaultOptions.testFiles
|
|
30
31
|
};
|
|
31
32
|
}
|
package/lib/options.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.js","names":[],"sources":["../src/options.ts"],"sourcesContent":["const defaultOptions = {\n\tignoredLogins: [\n\t\t/\\[bot\\]$/i,\n\t\t/^allcontributors$/i,\n\t\t/^copilot$/i,\n\t\t/^dependabot$/i,\n\t\t/^github-actions$/i,\n\t\t/^renovate$/i,\n\t],\n\tlabelAcceptingPrs: \"status: accepting prs\",\n\tlabelTypeBug: \"type: bug\",\n\tlabelTypeDocs: \"type: documentation\",\n\tlabelTypeIdeas: \"type: feature\",\n\tlabelTypeTool: \"area: tooling\",\n\ttestFiles: [/\\.(spec|test)\\.[^/]+$/i, /(^|\\/)(__tests__|tests?)\\//i],\n};\n\nexport interface AllContributorsForRepositoryOptions {\n\tauth?: string;\n\tignoredLogins: RegExp[];\n\tlabelAcceptingPrs: string;\n\tlabelTypeBug: string;\n\tlabelTypeDocs: string;\n\tlabelTypeIdeas: string;\n\tlabelTypeTool: string;\n\towner: string;\n\trepo: string;\n\ttestFiles: RegExp[];\n}\n\nexport interface RawAllContributorsForRepositoryOptions {\n\t/**\n\t * GitHub auth token to query the API with, if necessary for private repositories and/or to avoid rate limiting.\n\t */\n\tauth?: string;\n\n\t/**\n\t * Regular expressions for usernames to ignore commits from, such as bot users.\n\t */\n\tignoredLogins?: RegExp[];\n\n\t/**\n\t * Label to indicate an issue is accepting pull requests.\n\t */\n\tlabelAcceptingPrs?: string;\n\n\t/**\n\t * Label to indicate an issue is for a bug.\n\t */\n\tlabelTypeBug?: string;\n\n\t/**\n\t * Label to indicate an issue is for documentation.\n\t */\n\tlabelTypeDocs?: string;\n\n\t/**\n\t * Label to indicate an issue is for a feature.\n\t */\n\tlabelTypeIdeas?: string;\n\n\t/**\n\t * Label to indicate an issue is for tooling.\n\t */\n\tlabelTypeTool?: string;\n\n\t/**\n\t * The owner of the repository to query, such as `\"JoshuaKGoldberg\"`.\n\t */\n\towner: string;\n\n\t/**\n\t * The name of the repository to query, such as `\"all-contributors-for-repository\"`.\n\t */\n\trepo: string;\n\n\t/**\n\t * Regular expressions for file paths that count as tests, for merged PRs to be given a `test` contribution.\n\t */\n\ttestFiles?: RegExp[];\n}\n\nexport function fillInOptions(\n\trawOptions: RawAllContributorsForRepositoryOptions,\n): AllContributorsForRepositoryOptions {\n\treturn {\n\t\tauth: rawOptions.auth,\n\t\tignoredLogins: rawOptions.ignoredLogins ?? defaultOptions.ignoredLogins,\n\t\tlabelAcceptingPrs:\n\t\t\trawOptions.labelAcceptingPrs ?? defaultOptions.labelAcceptingPrs,\n\t\tlabelTypeBug: rawOptions.labelTypeBug ?? defaultOptions.labelTypeBug,\n\t\tlabelTypeDocs: rawOptions.labelTypeDocs ?? defaultOptions.labelTypeDocs,\n\t\tlabelTypeIdeas: rawOptions.labelTypeIdeas ?? defaultOptions.labelTypeIdeas,\n\t\tlabelTypeTool: rawOptions.labelTypeTool ?? defaultOptions.labelTypeTool,\n\t\towner: rawOptions.owner,\n\t\trepo: rawOptions.repo,\n\t\ttestFiles: rawOptions.testFiles ?? defaultOptions.testFiles,\n\t};\n}\n"],"mappings":";AAAA,MAAM,iBAAiB;CACtB,eAAe;EACd;EACA;EACA;EACA;EACA;EACA;CACD;CACA,mBAAmB;CACnB,cAAc;CACd,eAAe;CACf,gBAAgB;CAChB,eAAe;CACf,WAAW,CAAC,0BAA0B,6BAA6B;AACpE;
|
|
1
|
+
{"version":3,"file":"options.js","names":[],"sources":["../src/options.ts"],"sourcesContent":["const defaultOptions = {\n\tignoredLogins: [\n\t\t/\\[bot\\]$/i,\n\t\t/^allcontributors$/i,\n\t\t/^copilot$/i,\n\t\t/^dependabot$/i,\n\t\t/^github-actions$/i,\n\t\t/^renovate$/i,\n\t],\n\tlabelAcceptingPrs: \"status: accepting prs\",\n\tlabelTypeBug: \"type: bug\",\n\tlabelTypeDocs: \"type: documentation\",\n\tlabelTypeIdeas: \"type: feature\",\n\tlabelTypeTool: \"area: tooling\",\n\ttestFiles: [/\\.(spec|test)\\.[^/]+$/i, /(^|\\/)(__tests__|tests?)\\//i],\n};\n\nexport interface AllContributorsForRepositoryOptions {\n\tauth?: string;\n\tignoredLogins: RegExp[];\n\tlabelAcceptingPrs: string;\n\tlabelTypeBug: string;\n\tlabelTypeDocs: string;\n\tlabelTypeIdeas: string;\n\tlabelTypeTool: string;\n\towner: string;\n\trepo: string;\n\tsince?: Date;\n\ttestFiles: RegExp[];\n}\n\nexport interface RawAllContributorsForRepositoryOptions {\n\t/**\n\t * GitHub auth token to query the API with, if necessary for private repositories and/or to avoid rate limiting.\n\t */\n\tauth?: string;\n\n\t/**\n\t * Regular expressions for usernames to ignore commits from, such as bot users.\n\t */\n\tignoredLogins?: RegExp[];\n\n\t/**\n\t * Label to indicate an issue is accepting pull requests.\n\t */\n\tlabelAcceptingPrs?: string;\n\n\t/**\n\t * Label to indicate an issue is for a bug.\n\t */\n\tlabelTypeBug?: string;\n\n\t/**\n\t * Label to indicate an issue is for documentation.\n\t */\n\tlabelTypeDocs?: string;\n\n\t/**\n\t * Label to indicate an issue is for a feature.\n\t */\n\tlabelTypeIdeas?: string;\n\n\t/**\n\t * Label to indicate an issue is for tooling.\n\t */\n\tlabelTypeTool?: string;\n\n\t/**\n\t * The owner of the repository to query, such as `\"JoshuaKGoldberg\"`.\n\t */\n\towner: string;\n\n\t/**\n\t * The name of the repository to query, such as `\"all-contributors-for-repository\"`.\n\t */\n\trepo: string;\n\n\t/**\n\t * Only include contributions made at or after this time.\n\t * Useful for repeated runs, to avoid re-requesting contributions that were already seen.\n\t */\n\tsince?: Date;\n\n\t/**\n\t * Regular expressions for file paths that count as tests, for merged PRs to be given a `test` contribution.\n\t */\n\ttestFiles?: RegExp[];\n}\n\nexport function fillInOptions(\n\trawOptions: RawAllContributorsForRepositoryOptions,\n): AllContributorsForRepositoryOptions {\n\treturn {\n\t\tauth: rawOptions.auth,\n\t\tignoredLogins: rawOptions.ignoredLogins ?? defaultOptions.ignoredLogins,\n\t\tlabelAcceptingPrs:\n\t\t\trawOptions.labelAcceptingPrs ?? defaultOptions.labelAcceptingPrs,\n\t\tlabelTypeBug: rawOptions.labelTypeBug ?? defaultOptions.labelTypeBug,\n\t\tlabelTypeDocs: rawOptions.labelTypeDocs ?? defaultOptions.labelTypeDocs,\n\t\tlabelTypeIdeas: rawOptions.labelTypeIdeas ?? defaultOptions.labelTypeIdeas,\n\t\tlabelTypeTool: rawOptions.labelTypeTool ?? defaultOptions.labelTypeTool,\n\t\towner: rawOptions.owner,\n\t\trepo: rawOptions.repo,\n\t\tsince: rawOptions.since,\n\t\ttestFiles: rawOptions.testFiles ?? defaultOptions.testFiles,\n\t};\n}\n"],"mappings":";AAAA,MAAM,iBAAiB;CACtB,eAAe;EACd;EACA;EACA;EACA;EACA;EACA;CACD;CACA,mBAAmB;CACnB,cAAc;CACd,eAAe;CACf,gBAAgB;CAChB,eAAe;CACf,WAAW,CAAC,0BAA0B,6BAA6B;AACpE;AA0EA,SAAgB,cACf,YACsC;CACtC,OAAO;EACN,MAAM,WAAW;EACjB,eAAe,WAAW,iBAAiB,eAAe;EAC1D,mBACC,WAAW,qBAAqB,eAAe;EAChD,cAAc,WAAW,gBAAgB,eAAe;EACxD,eAAe,WAAW,iBAAiB,eAAe;EAC1D,gBAAgB,WAAW,kBAAkB,eAAe;EAC5D,eAAe,WAAW,iBAAiB,eAAe;EAC1D,OAAO,WAAW;EAClB,MAAM,WAAW;EACjB,OAAO,WAAW;EAClB,WAAW,WAAW,aAAa,eAAe;CACnD;AACD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "all-contributors-for-repository",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Generates an allcontributors list for an existing repository. 🤝",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -61,14 +61,14 @@
|
|
|
61
61
|
"eslint-plugin-regexp": "3.3.0",
|
|
62
62
|
"eslint-plugin-yml": "3.8.0",
|
|
63
63
|
"husky": "9.1.7",
|
|
64
|
-
"knip": "6.
|
|
64
|
+
"knip": "6.37.0",
|
|
65
65
|
"lint-staged": "17.5.0",
|
|
66
66
|
"prettier": "3.9.0",
|
|
67
67
|
"prettier-plugin-curly": "0.4.1",
|
|
68
68
|
"prettier-plugin-packagejson": "3.0.0",
|
|
69
69
|
"prettier-plugin-sentences-per-line": "0.2.0",
|
|
70
70
|
"prettier-plugin-sh": "0.19.0",
|
|
71
|
-
"release-it": "21.
|
|
71
|
+
"release-it": "21.1.0",
|
|
72
72
|
"tsdown": "0.23.0",
|
|
73
73
|
"typescript": "6.0.3",
|
|
74
74
|
"typescript-eslint": "8.70.0",
|