all-contributors-for-repository 0.0.7 → 0.0.8
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 +2 -1
- package/lib/Contributor.d.ts +2 -2
- package/lib/Contributor.d.ts.map +1 -1
- package/lib/Contributor.js +2 -2
- package/lib/Contributor.js.map +1 -1
- package/lib/Contributor.test.d.ts +2 -0
- package/lib/Contributor.test.d.ts.map +1 -0
- package/lib/Contributor.test.js +25 -0
- package/lib/Contributor.test.js.map +1 -0
- package/lib/ContributorsCollection.d.ts +10 -4
- package/lib/ContributorsCollection.d.ts.map +1 -1
- package/lib/ContributorsCollection.js +10 -3
- package/lib/ContributorsCollection.js.map +1 -1
- package/lib/ContributorsCollection.test.js +12 -12
- package/lib/ContributorsCollection.test.js.map +1 -1
- package/lib/collect/collectEvents.d.ts +1 -0
- package/lib/collect/collectEvents.d.ts.map +1 -1
- package/lib/collect/collectEvents.js.map +1 -1
- package/lib/collect/eventIsPullRequestReviewEvent.d.ts +9 -0
- package/lib/collect/eventIsPullRequestReviewEvent.d.ts.map +1 -0
- package/lib/collect/eventIsPullRequestReviewEvent.js +5 -0
- package/lib/collect/eventIsPullRequestReviewEvent.js.map +1 -0
- package/lib/collect/eventIsPullRequestReviewEvent.test.d.ts +2 -0
- package/lib/collect/eventIsPullRequestReviewEvent.test.d.ts.map +1 -0
- package/lib/collect/eventIsPullRequestReviewEvent.test.js +15 -0
- package/lib/collect/eventIsPullRequestReviewEvent.test.js.map +1 -0
- package/lib/collect/index.d.ts +2 -3
- package/lib/collect/index.d.ts.map +1 -1
- package/lib/collect/index.js +9 -8
- package/lib/collect/index.js.map +1 -1
- package/lib/createAllContributorsForRepository.d.ts +3 -0
- package/lib/createAllContributorsForRepository.d.ts.map +1 -0
- package/lib/createAllContributorsForRepository.js +7 -0
- package/lib/createAllContributorsForRepository.js.map +1 -0
- package/lib/eventIsPullRequestReviewEvent.d.ts +2 -0
- package/lib/eventIsPullRequestReviewEvent.d.ts.map +1 -0
- package/lib/eventIsPullRequestReviewEvent.js +22 -0
- package/lib/eventIsPullRequestReviewEvent.js.map +1 -0
- package/lib/eventIsPullRequestReviewEvent.test.d.ts +2 -0
- package/lib/eventIsPullRequestReviewEvent.test.d.ts.map +1 -0
- package/lib/eventIsPullRequestReviewEvent.test.js +12 -0
- package/lib/eventIsPullRequestReviewEvent.test.js.map +1 -0
- package/lib/index.d.ts +2 -4
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -6
- package/lib/index.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -78,7 +78,8 @@ Additionally, based on PR [conventional commit titles](https://www.conventionalc
|
|
|
78
78
|
> import { $ } from "execa";
|
|
79
79
|
>
|
|
80
80
|
> for (const [contributor, contributions] of Object.entries(contributors)) {
|
|
81
|
-
>
|
|
81
|
+
> const contributionTypes = Object.keys(contributions).join(",");
|
|
82
|
+
> await $`npx all-contributors add ${contributor} ${contributionTypes}`;
|
|
82
83
|
> }
|
|
83
84
|
> ```
|
|
84
85
|
|
package/lib/Contributor.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare class Contributor {
|
|
2
|
-
readonly contributions: Record<string, number
|
|
3
|
-
add(
|
|
2
|
+
readonly contributions: Record<string, Set<number>>;
|
|
3
|
+
add(number: number, type: string): void;
|
|
4
4
|
}
|
|
5
5
|
//# sourceMappingURL=Contributor.d.ts.map
|
package/lib/Contributor.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Contributor.d.ts","sourceRoot":"","sources":["../src/Contributor.ts"],"names":[],"mappings":"AAAA,qBAAa,WAAW;IACvB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Contributor.d.ts","sourceRoot":"","sources":["../src/Contributor.ts"],"names":[],"mappings":"AAAA,qBAAa,WAAW;IACvB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAM;IAEzD,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;CAGhC"}
|
package/lib/Contributor.js
CHANGED
|
@@ -2,8 +2,8 @@ export class Contributor {
|
|
|
2
2
|
constructor() {
|
|
3
3
|
this.contributions = {};
|
|
4
4
|
}
|
|
5
|
-
add(
|
|
6
|
-
(this.contributions[type] ??=
|
|
5
|
+
add(number, type) {
|
|
6
|
+
(this.contributions[type] ??= new Set()).add(number);
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
//# sourceMappingURL=Contributor.js.map
|
package/lib/Contributor.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Contributor.js","sourceRoot":"","sources":["../src/Contributor.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,WAAW;IAAxB;QACU,kBAAa,
|
|
1
|
+
{"version":3,"file":"Contributor.js","sourceRoot":"","sources":["../src/Contributor.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,WAAW;IAAxB;QACU,kBAAa,GAAgC,EAAE,CAAC;IAK1D,CAAC;IAHA,GAAG,CAAC,MAAc,EAAE,IAAY;QAC/B,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,IAAI,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACtD,CAAC;CACD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Contributor.test.d.ts","sourceRoot":"","sources":["../src/Contributor.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { Contributor } from "./Contributor.js";
|
|
3
|
+
describe("Contributor", () => {
|
|
4
|
+
it("adds a new entry under a type when that type doesn't yet exist", () => {
|
|
5
|
+
const contributor = new Contributor();
|
|
6
|
+
contributor.add(1, "code");
|
|
7
|
+
expect(contributor.contributions).toEqual({ code: new Set([1]) });
|
|
8
|
+
});
|
|
9
|
+
it("adds a new entry under an existing type when that type already exists", () => {
|
|
10
|
+
const contributor = new Contributor();
|
|
11
|
+
contributor.add(1, "code");
|
|
12
|
+
contributor.add(2, "code");
|
|
13
|
+
expect(contributor.contributions).toEqual({ code: new Set([1, 2]) });
|
|
14
|
+
});
|
|
15
|
+
it("adds a new entry under a second type when that type does not already exist", () => {
|
|
16
|
+
const contributor = new Contributor();
|
|
17
|
+
contributor.add(1, "code");
|
|
18
|
+
contributor.add(2, "design");
|
|
19
|
+
expect(contributor.contributions).toEqual({
|
|
20
|
+
code: new Set([1]),
|
|
21
|
+
design: new Set([2]),
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
//# sourceMappingURL=Contributor.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Contributor.test.js","sourceRoot":"","sources":["../src/Contributor.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC5B,EAAE,CAAC,gEAAgE,EAAE,GAAG,EAAE;QACzE,MAAM,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC;QAEtC,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;QAE3B,MAAM,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACnE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uEAAuE,EAAE,GAAG,EAAE;QAChF,MAAM,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC;QAEtC,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;QAC3B,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;QAE3B,MAAM,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACtE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,4EAA4E,EAAE,GAAG,EAAE;QACrF,MAAM,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC;QAEtC,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;QAC3B,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;QAE7B,MAAM,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC;YACzC,IAAI,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;YAClB,MAAM,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;SACpB,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* For a set of logins, the contributions under those users.
|
|
3
|
+
*/
|
|
4
|
+
export type ContributorsContributions = Record<string, ContributorContributions>;
|
|
5
|
+
/**
|
|
6
|
+
* For each contribution under a login, the issue/PR numbers that count as that type.
|
|
7
|
+
*/
|
|
8
|
+
export type ContributorContributions = Record<string, number[]>;
|
|
1
9
|
export declare class ContributorsCollection {
|
|
2
10
|
#private;
|
|
3
11
|
constructor(ignoredLogins: Set<string>);
|
|
4
|
-
add(login: string | undefined, type: string): void;
|
|
5
|
-
collect():
|
|
6
|
-
[k: string]: string[];
|
|
7
|
-
};
|
|
12
|
+
add(login: string | undefined, number: number, type: string): void;
|
|
13
|
+
collect(): ContributorsContributions;
|
|
8
14
|
}
|
|
9
15
|
//# sourceMappingURL=ContributorsCollection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContributorsCollection.d.ts","sourceRoot":"","sources":["../src/ContributorsCollection.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ContributorsCollection.d.ts","sourceRoot":"","sources":["../src/ContributorsCollection.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,MAAM,CAC7C,MAAM,EACN,wBAAwB,CACxB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;AAEhE,qBAAa,sBAAsB;;gBAItB,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC;IAItC,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAS3D,OAAO,IAAI,yBAAyB;CAoBpC"}
|
|
@@ -10,20 +10,27 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
10
10
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
11
|
};
|
|
12
12
|
var _ContributorsCollection_contributors, _ContributorsCollection_ignoredLogins;
|
|
13
|
+
import { Contributor } from "./Contributor.js";
|
|
13
14
|
export class ContributorsCollection {
|
|
14
15
|
constructor(ignoredLogins) {
|
|
15
16
|
_ContributorsCollection_contributors.set(this, {});
|
|
16
17
|
_ContributorsCollection_ignoredLogins.set(this, void 0);
|
|
17
18
|
__classPrivateFieldSet(this, _ContributorsCollection_ignoredLogins, ignoredLogins, "f");
|
|
18
19
|
}
|
|
19
|
-
add(login, type) {
|
|
20
|
+
add(login, number, type) {
|
|
20
21
|
if (login && !__classPrivateFieldGet(this, _ContributorsCollection_ignoredLogins, "f").has(login)) {
|
|
21
|
-
(__classPrivateFieldGet(this, _ContributorsCollection_contributors, "f")[login.toLowerCase()] ??= new
|
|
22
|
+
(__classPrivateFieldGet(this, _ContributorsCollection_contributors, "f")[login.toLowerCase()] ??= new Contributor()).add(number, type);
|
|
22
23
|
}
|
|
23
24
|
}
|
|
24
25
|
collect() {
|
|
25
26
|
return Object.fromEntries(Object.entries(__classPrivateFieldGet(this, _ContributorsCollection_contributors, "f"))
|
|
26
|
-
.map(([
|
|
27
|
+
.map(([login, contributor]) => [
|
|
28
|
+
login,
|
|
29
|
+
Object.fromEntries(Object.entries(contributor.contributions).map(([type, numbers]) => [
|
|
30
|
+
type,
|
|
31
|
+
Array.from(numbers).sort((a, b) => a - b),
|
|
32
|
+
])),
|
|
33
|
+
])
|
|
27
34
|
.sort(([a], [b]) => a.localeCompare(b)));
|
|
28
35
|
}
|
|
29
36
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContributorsCollection.js","sourceRoot":"","sources":["../src/ContributorsCollection.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,MAAM,OAAO,sBAAsB;IAIlC,YAAY,aAA0B;QAHtC,+CAA6C,EAAE,EAAC;QAChD,wDAA4B;QAG3B,uBAAA,IAAI,yCAAkB,aAAa,MAAA,CAAC;IACrC,CAAC;IAED,GAAG,CAAC,KAAyB,EAAE,IAAY;
|
|
1
|
+
{"version":3,"file":"ContributorsCollection.js","sourceRoot":"","sources":["../src/ContributorsCollection.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAe/C,MAAM,OAAO,sBAAsB;IAIlC,YAAY,aAA0B;QAHtC,+CAA6C,EAAE,EAAC;QAChD,wDAA4B;QAG3B,uBAAA,IAAI,yCAAkB,aAAa,MAAA,CAAC;IACrC,CAAC;IAED,GAAG,CAAC,KAAyB,EAAE,MAAc,EAAE,IAAY;QAC1D,IAAI,KAAK,IAAI,CAAC,uBAAA,IAAI,6CAAe,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;YAC7C,CAAC,uBAAA,IAAI,4CAAc,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,KAAK,IAAI,WAAW,EAAE,CAAC,CAAC,GAAG,CAClE,MAAM,EACN,IAAI,CACJ,CAAC;SACF;IACF,CAAC;IAED,OAAO;QACN,OAAO,MAAM,CAAC,WAAW,CACxB,MAAM,CAAC,OAAO,CAAC,uBAAA,IAAI,4CAAc,CAAC;aAChC,GAAG,CACH,CAAC,CAAC,KAAK,EAAE,WAAW,CAAC,EAAE,EAAE,CACxB;YACC,KAAK;YACL,MAAM,CAAC,WAAW,CACjB,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,GAAG,CAC5C,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC;gBACpB,IAAI;gBACJ,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;aACzC,CACD,CACD;SACQ,CACX;aACA,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CACxC,CAAC;IACH,CAAC;CACD"}
|
|
@@ -8,30 +8,30 @@ describe("ContributorsCollection", () => {
|
|
|
8
8
|
});
|
|
9
9
|
it("adds a login when it is not ignored", () => {
|
|
10
10
|
const contributors = new ContributorsCollection(new Set());
|
|
11
|
-
contributors.add("abc", "bug");
|
|
11
|
+
contributors.add("abc", 0, "bug");
|
|
12
12
|
const actual = contributors.collect();
|
|
13
|
-
expect(actual).toEqual({ abc: [
|
|
13
|
+
expect(actual).toEqual({ abc: { bug: [0] } });
|
|
14
14
|
});
|
|
15
15
|
it("adds sorted contributions for logins when they are added in non-alphabetical order ", () => {
|
|
16
16
|
const contributors = new ContributorsCollection(new Set());
|
|
17
|
-
contributors.add("def", "tool");
|
|
18
|
-
contributors.add("abc", "tool");
|
|
19
|
-
contributors.add("abc", "bug");
|
|
20
|
-
contributors.add("abc", "code");
|
|
21
|
-
contributors.add("def", "code");
|
|
17
|
+
contributors.add("def", 1, "tool");
|
|
18
|
+
contributors.add("abc", 2, "tool");
|
|
19
|
+
contributors.add("abc", 3, "bug");
|
|
20
|
+
contributors.add("abc", 4, "code");
|
|
21
|
+
contributors.add("def", 5, "code");
|
|
22
22
|
const actual = contributors.collect();
|
|
23
23
|
expect(actual).toEqual({
|
|
24
|
-
abc: [
|
|
25
|
-
def: [
|
|
24
|
+
abc: { bug: [3], code: [4], tool: [2] },
|
|
25
|
+
def: { code: [5], tool: [1] },
|
|
26
26
|
});
|
|
27
27
|
});
|
|
28
28
|
it("does not add a login contribution when it is ignored ", () => {
|
|
29
29
|
const contributors = new ContributorsCollection(new Set(["ignored"]));
|
|
30
|
-
contributors.add("abc", "bug");
|
|
31
|
-
contributors.add("ignored", "code");
|
|
30
|
+
contributors.add("abc", 1, "bug");
|
|
31
|
+
contributors.add("ignored", 2, "code");
|
|
32
32
|
const actual = contributors.collect();
|
|
33
33
|
expect(actual).toEqual({
|
|
34
|
-
abc: [
|
|
34
|
+
abc: { bug: [1] },
|
|
35
35
|
});
|
|
36
36
|
});
|
|
37
37
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContributorsCollection.test.js","sourceRoot":"","sources":["../src/ContributorsCollection.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;IACvC,EAAE,CAAC,0CAA0C,EAAE,GAAG,EAAE;QACnD,MAAM,YAAY,GAAG,IAAI,sBAAsB,CAAC,IAAI,GAAG,EAAE,CA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EAAE,CAAC;QAEtC,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC;YACtB,GAAG,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE;SACjB,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Octokit } from "octokit";
|
|
2
2
|
import { RequestDefaults } from "./api.js";
|
|
3
|
+
export type RepoEvent = Awaited<ReturnType<typeof collectEvents>>[number];
|
|
3
4
|
export declare function collectEvents(defaults: RequestDefaults, octokit: Octokit): Promise<{
|
|
4
5
|
id: string;
|
|
5
6
|
type: string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collectEvents.d.ts","sourceRoot":"","sources":["../../src/collect/collectEvents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC,OAAO,EAAY,eAAe,EAAE,MAAM,UAAU,CAAC;AAErD,wBAAsB,aAAa,CAClC,QAAQ,EAAE,eAAe,EACzB,OAAO,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAehB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collectEvents.js","sourceRoot":"","sources":["../../src/collect/collectEvents.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAmB,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"collectEvents.js","sourceRoot":"","sources":["../../src/collect/collectEvents.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAmB,MAAM,UAAU,CAAC;AAIrD,MAAM,CAAC,KAAK,UAAU,aAAa,CAClC,QAAyB,EACzB,OAAgB;IAEhB,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;QACzD,MAAM,cAAc,GAAG,MAAM,OAAO,CAAC,OAAO,CAC3C,kCAAkC,EAClC;YACC,GAAG,OAAO;YACV,KAAK,EAAE,KAAK;SACZ,CACD,CAAC;QAEF,OAAO,cAAc,CAAC,IAAI,CAAC;IAC5B,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { RepoEvent } from "./collectEvents.js";
|
|
2
|
+
type PullRequestReviewEvent = RepoEvent & {
|
|
3
|
+
issue: {
|
|
4
|
+
number: number;
|
|
5
|
+
};
|
|
6
|
+
};
|
|
7
|
+
export declare function eventIsPullRequestReviewEvent(event: Pick<RepoEvent, "type">): event is PullRequestReviewEvent;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=eventIsPullRequestReviewEvent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eventIsPullRequestReviewEvent.d.ts","sourceRoot":"","sources":["../../src/collect/eventIsPullRequestReviewEvent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,KAAK,sBAAsB,GAAG,SAAS,GAAG;IACzC,KAAK,EAAE;QACN,MAAM,EAAE,MAAM,CAAC;KACf,CAAC;CACF,CAAC;AAEF,wBAAgB,6BAA6B,CAC5C,KAAK,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,GAC5B,KAAK,IAAI,sBAAsB,CAKjC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eventIsPullRequestReviewEvent.js","sourceRoot":"","sources":["../../src/collect/eventIsPullRequestReviewEvent.ts"],"names":[],"mappings":"AAQA,MAAM,UAAU,6BAA6B,CAC5C,KAA8B;IAE9B,OAAO,CACN,KAAK,CAAC,IAAI,KAAK,wBAAwB;QACvC,CAAC,CAAE,KAAyC,CAAC,KAAK,EAAE,MAAM,CAC1D,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eventIsPullRequestReviewEvent.test.d.ts","sourceRoot":"","sources":["../../src/collect/eventIsPullRequestReviewEvent.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { eventIsPullRequestReviewEvent } from "./eventIsPullRequestReviewEvent.js";
|
|
3
|
+
describe("eventIsPullRequestReviewEvent", () => {
|
|
4
|
+
it.each([
|
|
5
|
+
[{ type: "other" }, false],
|
|
6
|
+
[{ issue: {}, type: "other" }, false],
|
|
7
|
+
[{ issue: { number: 1 }, type: "other" }, false],
|
|
8
|
+
[{ type: "PullRequestReviewEvent" }, false],
|
|
9
|
+
[{ issue: { number: 1 }, type: "PullRequestReviewEvent" }, true],
|
|
10
|
+
])("when given %j, returns %s", (event, expected) => {
|
|
11
|
+
const actual = eventIsPullRequestReviewEvent(event);
|
|
12
|
+
expect(actual).toBe(expected);
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
//# sourceMappingURL=eventIsPullRequestReviewEvent.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eventIsPullRequestReviewEvent.test.js","sourceRoot":"","sources":["../../src/collect/eventIsPullRequestReviewEvent.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AAEnF,QAAQ,CAAC,+BAA+B,EAAE,GAAG,EAAE;IAC9C,EAAE,CAAC,IAAI,CAAC;QACP,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,KAAK,CAAC;QAC1B,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,KAAK,CAAC;QACrC,CAAC,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,KAAK,CAAC;QAChD,CAAC,EAAE,IAAI,EAAE,wBAAwB,EAAE,EAAE,KAAK,CAAC;QAC3C,CAAC,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,wBAAwB,EAAE,EAAE,IAAI,CAAC;KAChE,CAAC,CAAC,2BAA2B,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE;QACnD,MAAM,MAAM,GAAG,6BAA6B,CAAC,KAAK,CAAC,CAAC;QAEpD,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC/B,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
package/lib/collect/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
+
import { ContributorsContributions } from "../ContributorsCollection.js";
|
|
1
2
|
import { AllContributorsForRepositoryOptions } from "../options.js";
|
|
2
|
-
export declare function collect(options: AllContributorsForRepositoryOptions): Promise<
|
|
3
|
-
[k: string]: string[];
|
|
4
|
-
}>;
|
|
3
|
+
export declare function collect(options: AllContributorsForRepositoryOptions): Promise<ContributorsContributions>;
|
|
5
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/collect/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/collect/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,yBAAyB,EACzB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,mCAAmC,EAAE,MAAM,eAAe,CAAC;AAUpE,wBAAsB,OAAO,CAC5B,OAAO,EAAE,mCAAmC,GAC1C,OAAO,CAAC,yBAAyB,CAAC,CAmEpC"}
|
package/lib/collect/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { ContributorsCollection } from "../ContributorsCollection.js";
|
|
1
|
+
import { ContributorsCollection, } from "../ContributorsCollection.js";
|
|
2
2
|
import { createOctokit } from "./api.js";
|
|
3
3
|
import { collectAcceptedIssues } from "./collectAcceptedIssues.js";
|
|
4
4
|
import { collectEvents } from "./collectEvents.js";
|
|
5
5
|
import { collectIssueEvents } from "./collectIssueEvents.js";
|
|
6
6
|
import { collectMergedPulls } from "./collectMergedPulls.js";
|
|
7
|
+
import { eventIsPullRequestReviewEvent } from "./eventIsPullRequestReviewEvent.js";
|
|
7
8
|
import { parseMergedPullAuthors } from "./parsing/parseMergedPullAuthors.js";
|
|
8
9
|
import { parseMergedPullType } from "./parsing/parseMergedPullType.js";
|
|
9
10
|
export async function collect(options) {
|
|
@@ -27,32 +28,32 @@ export async function collect(options) {
|
|
|
27
28
|
[options.labelTypeTool, "tool"],
|
|
28
29
|
]) {
|
|
29
30
|
if (labels.some((label) => label === labelType)) {
|
|
30
|
-
contributors.add(acceptedIssue.user?.login, contribution);
|
|
31
|
+
contributors.add(acceptedIssue.user?.login, acceptedIssue.number, contribution);
|
|
31
32
|
}
|
|
32
33
|
}
|
|
33
34
|
}
|
|
34
|
-
// 💻 `code
|
|
35
|
+
// 💻 `code` & others: all PR authors and co-authors
|
|
35
36
|
for (const mergedPull of mergedPulls) {
|
|
36
37
|
const authors = parseMergedPullAuthors(mergedPull);
|
|
37
38
|
const type = parseMergedPullType(mergedPull.title);
|
|
38
39
|
for (const author of authors) {
|
|
39
|
-
contributors.add(author, type);
|
|
40
|
+
contributors.add(author, mergedPull.number, type);
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
// 🚧 `maintenance`: adding labels to issues and PRs, and merging PRs
|
|
43
44
|
const maintainers = new Set();
|
|
44
45
|
for (const event of issueEvents) {
|
|
45
|
-
if (event.actor) {
|
|
46
|
-
contributors.add(event.actor.login, "maintenance");
|
|
46
|
+
if (event.actor && event.issue) {
|
|
47
|
+
contributors.add(event.actor.login, event.issue.number, "maintenance");
|
|
47
48
|
maintainers.add(event.actor.login);
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
51
|
// 👀 `review`: submitting a review for a PR
|
|
51
52
|
// (restricted just to users marked as maintainers)
|
|
52
53
|
for (const event of events) {
|
|
53
|
-
if (event
|
|
54
|
+
if (eventIsPullRequestReviewEvent(event) &&
|
|
54
55
|
maintainers.has(event.actor.login)) {
|
|
55
|
-
contributors.add(event.actor.login, "review");
|
|
56
|
+
contributors.add(event.actor.login, event.issue.number, "review");
|
|
56
57
|
}
|
|
57
58
|
}
|
|
58
59
|
return contributors.collect();
|
package/lib/collect/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/collect/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/collect/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,sBAAsB,GAEtB,MAAM,8B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AC,KAAK,CAAC,CAAC;SACnC;KACD;IAED,4CAA4C;IAC5C,mDAAmD;IACnD,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE;QAC3B,IACC,6BAA6B,CAAC,KAAK,CAAC;YACpC,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,EACjC;YACD,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;SAClE;KACD;IAED,OAAO,YAAY,CAAC,OAAO,EAAE,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { RawAllContributorsForRepositoryOptions } from "./options.js";
|
|
2
|
+
export declare function createAllContributorsForRepository(rawOptions: RawAllContributorsForRepositoryOptions): Promise<import("./ContributorsCollection.js").ContributorsContributions>;
|
|
3
|
+
//# sourceMappingURL=createAllContributorsForRepository.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createAllContributorsForRepository.d.ts","sourceRoot":"","sources":["../src/createAllContributorsForRepository.ts"],"names":[],"mappings":"AACA,OAAO,EAEN,sCAAsC,EACtC,MAAM,cAAc,CAAC;AAEtB,wBAAsB,kCAAkC,CACvD,UAAU,EAAE,sCAAsC,4EAKlD"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { collect } from "./collect/index.js";
|
|
2
|
+
import { fillInOptions, } from "./options.js";
|
|
3
|
+
export async function createAllContributorsForRepository(rawOptions) {
|
|
4
|
+
const options = fillInOptions(rawOptions);
|
|
5
|
+
return await collect(options);
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=createAllContributorsForRepository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createAllContributorsForRepository.js","sourceRoot":"","sources":["../src/createAllContributorsForRepository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EACN,aAAa,GAEb,MAAM,cAAc,CAAC;AAEtB,MAAM,CAAC,KAAK,UAAU,kCAAkC,CACvD,UAAkD;IAElD,MAAM,OAAO,GAAG,aAAa,CAAC,UAAU,CAAC,CAAC;IAE1C,OAAO,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eventIsPullRequestReviewEvent.d.ts","sourceRoot":"","sources":["../src/eventIsPullRequestReviewEvent.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { Contributor } from "./Contributor.js";
|
|
3
|
+
describe("Contributor", () => {
|
|
4
|
+
it("adds a new entry under a type when that type doesn't yet exist", () => {
|
|
5
|
+
const contributor = new Contributor();
|
|
6
|
+
contributor.add(1, "code");
|
|
7
|
+
expect(contributor.contributions).toEqual({ code: [1] });
|
|
8
|
+
});
|
|
9
|
+
it("adds a new entry under an existing type when that type already exists", () => {
|
|
10
|
+
const contributor = new Contributor();
|
|
11
|
+
contributor.add(1, "code");
|
|
12
|
+
contributor.add(2, "code");
|
|
13
|
+
expect(contributor.contributions).toEqual({ code: [1, 2] });
|
|
14
|
+
});
|
|
15
|
+
it("adds a new entry under a second type when that type does not already exist", () => {
|
|
16
|
+
const contributor = new Contributor();
|
|
17
|
+
contributor.add(1, "code");
|
|
18
|
+
contributor.add(2, "design");
|
|
19
|
+
expect(contributor.contributions).toEqual({ code: [1], design: [2] });
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
//# sourceMappingURL=eventIsPullRequestReviewEvent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eventIsPullRequestReviewEvent.js","sourceRoot":"","sources":["../src/eventIsPullRequestReviewEvent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EA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@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eventIsPullRequestReviewEvent.test.d.ts","sourceRoot":"","sources":["../src/eventIsPullRequestReviewEvent.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { eventIsPullRequestReviewEvent } from "./eventIsPullRequestReviewEvent.js";
|
|
3
|
+
describe("eventIsPullRequestReviewEvent", () => {
|
|
4
|
+
it.each([
|
|
5
|
+
[{}, false],
|
|
6
|
+
[{ issue: {} }, false],
|
|
7
|
+
])("when given %s, returns %b", ([event, expected]) => {
|
|
8
|
+
const actual = eventIsPullRequestReviewEvent(event);
|
|
9
|
+
expect(actual).toBe(expected);
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
//# sourceMappingURL=eventIsPullRequestReviewEvent.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eventIsPullRequestReviewEvent.test.js","sourceRoot":"","sources":["../src/eventIsPullRequestReviewEvent.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AAEnF,QAAQ,CAAC,+BAA+B,EAAE,GAAG,EAAE;IAC9C,EAAE,CAAC,IAAI,CAAC;QACP,CAAC,EAAE,EAAE,KAAK,CAAC;QACX,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC;KACtB,CAAC,CAAC,2BAA2B,EAAE,CAAC,CAAC,KAAK,EAAE,QAAQ,CAAC,EAAE,EAAE;QACrD,MAAM,MAAM,GAAG,6BAA6B,CAAC,KAAK,CAAC,CAAC;QAEpD,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC/B,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
[k: string]: string[];
|
|
4
|
-
}>;
|
|
1
|
+
export { ContributorContributions, ContributorsContributions, } from "./ContributorsCollection.js";
|
|
2
|
+
export { createAllContributorsForRepository } from "./createAllContributorsForRepository.js";
|
|
5
3
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,wBAAwB,EACxB,yBAAyB,GACzB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,kCAAkC,EAAE,MAAM,yCAAyC,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { fillInOptions, } from "./options.js";
|
|
3
|
-
export async function createAllContributorsForRepository(rawOptions) {
|
|
4
|
-
const options = fillInOptions(rawOptions);
|
|
5
|
-
return await collect(options);
|
|
6
|
-
}
|
|
1
|
+
export { createAllContributorsForRepository } from "./createAllContributorsForRepository.js";
|
|
7
2
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,kCAAkC,EAAE,MAAM,yCAAyC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "all-contributors-for-repository",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"description": "Generates an allcontributors list for an existing repository.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"eslint-plugin-regexp": "^1.12.0",
|
|
57
57
|
"eslint-plugin-simple-import-sort": "^10.0.0",
|
|
58
58
|
"eslint-plugin-typescript-sort-keys": "^2.1.0",
|
|
59
|
-
"eslint-plugin-vitest": "^0.
|
|
59
|
+
"eslint-plugin-vitest": "^0.2.0",
|
|
60
60
|
"eslint-plugin-yml": "^1.5.0",
|
|
61
61
|
"husky": "^8.0.3",
|
|
62
62
|
"jsonc-eslint-parser": "^2.1.0",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"vitest": "^0.29.0",
|
|
76
76
|
"yaml-eslint-parser": "^1.2.0"
|
|
77
77
|
},
|
|
78
|
-
"packageManager": "pnpm@8.
|
|
78
|
+
"packageManager": "pnpm@8.4.0",
|
|
79
79
|
"engines": {
|
|
80
80
|
"node": ">=18"
|
|
81
81
|
}
|