all-contributors-for-repository 0.2.3 → 0.3.1

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
@@ -45,7 +45,7 @@ import { getAllContributorsForRepository } from "all-contributors-for-repository
45
45
 
46
46
  const contributors = await getAllContributorsForRepository({
47
47
  owner: "JoshuaKGoldberg",
48
- repo: "template-typescript-node-package",
48
+ repo: "create-typescript-app",
49
49
  });
50
50
 
51
51
  /*
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/Contributor.ts"],"sourcesContent":["export class Contributor {\n\treadonly contributions: Record<string, Set<number>> = {};\n\n\tadd(number: number, type: string) {\n\t\t// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n\t\t(this.contributions[type] ??= new Set()).add(number);\n\t}\n}\n"],"mappings":"AAAO,MAAM,YAAY;AAAA,EACf,gBAA6C,CAAC;AAAA,EAEvD,IAAI,QAAgB,MAAc;AAEjC,KAAC,KAAK,cAAc,IAAI,MAAM,oBAAI,IAAI,GAAG,IAAI,MAAM;AAAA,EACpD;AACD;","names":[]}
1
+ {"version":3,"sources":["../src/Contributor.ts"],"sourcesContent":["export class Contributor {\n\treadonly contributions: Record<string, Set<number>> = {};\n\n\tadd(number: number, type: string) {\n\t\t(this.contributions[type] ??= new Set()).add(number);\n\t}\n}\n"],"mappings":"AAAO,MAAM,YAAY;AAAA,EACf,gBAA6C,CAAC;AAAA,EAEvD,IAAI,QAAgB,MAAc;AACjC,KAAC,KAAK,cAAc,IAAI,MAAM,oBAAI,IAAI,GAAG,IAAI,MAAM;AAAA,EACpD;AACD;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/ContributorsCollection.ts"],"sourcesContent":["import { Contributor } from \"./Contributor.js\";\n\n/**\n * For a set of logins, the contributions under those users.\n */\nexport type ContributorsContributions = Record<\n\tstring,\n\tContributorContributions\n>;\n\n/**\n * For each contribution under a login, the issue/PR numbers that count as that type.\n */\nexport type ContributorContributions = Record<string, number[]>;\n\nexport class ContributorsCollection {\n\t#contributors: Record<string, Contributor> = {};\n\t#ignoredLogins: Set<string>;\n\n\tconstructor(ignoredLogins: Set<string>) {\n\t\tthis.#ignoredLogins = ignoredLogins;\n\t}\n\n\tadd(login: string | undefined, number: number, type: string) {\n\t\tif (login && !this.#ignoredLogins.has(login)) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n\t\t\t(this.#contributors[login.toLowerCase()] ??= new Contributor()).add(\n\t\t\t\tnumber,\n\t\t\t\ttype,\n\t\t\t);\n\t\t}\n\t}\n\n\tcollect(): ContributorsContributions {\n\t\treturn Object.fromEntries(\n\t\t\tObject.entries(this.#contributors)\n\t\t\t\t.map(\n\t\t\t\t\t([login, contributor]) =>\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\tlogin,\n\t\t\t\t\t\t\tObject.fromEntries(\n\t\t\t\t\t\t\t\tObject.entries(contributor.contributions).map(\n\t\t\t\t\t\t\t\t\t([type, numbers]) => [\n\t\t\t\t\t\t\t\t\t\ttype,\n\t\t\t\t\t\t\t\t\t\tArray.from(numbers).sort((a, b) => a - b),\n\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t] as const,\n\t\t\t\t)\n\t\t\t\t.sort(([a], [b]) => a.localeCompare(b)),\n\t\t);\n\t}\n}\n"],"mappings":"AAAA,SAAS,mBAAmB;AAerB,MAAM,uBAAuB;AAAA,EACnC,gBAA6C,CAAC;AAAA,EAC9C;AAAA,EAEA,YAAY,eAA4B;AACvC,SAAK,iBAAiB;AAAA,EACvB;AAAA,EAEA,IAAI,OAA2B,QAAgB,MAAc;AAC5D,QAAI,SAAS,CAAC,KAAK,eAAe,IAAI,KAAK,GAAG;AAE7C,OAAC,KAAK,cAAc,MAAM,YAAY,CAAC,MAAM,IAAI,YAAY,GAAG;AAAA,QAC/D;AAAA,QACA;AAAA,MACD;AAAA,IACD;AAAA,EACD;AAAA,EAEA,UAAqC;AACpC,WAAO,OAAO;AAAA,MACb,OAAO,QAAQ,KAAK,aAAa,EAC/B;AAAA,QACA,CAAC,CAAC,OAAO,WAAW,MACnB;AAAA,UACC;AAAA,UACA,OAAO;AAAA,YACN,OAAO,QAAQ,YAAY,aAAa,EAAE;AAAA,cACzC,CAAC,CAAC,MAAM,OAAO,MAAM;AAAA,gBACpB;AAAA,gBACA,MAAM,KAAK,OAAO,EAAE,KAAK,CAAC,GAAG,MAAM,IAAI,CAAC;AAAA,cACzC;AAAA,YACD;AAAA,UACD;AAAA,QACD;AAAA,MACF,EACC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;AAAA,IACxC;AAAA,EACD;AACD;","names":[]}
1
+ {"version":3,"sources":["../src/ContributorsCollection.ts"],"sourcesContent":["import { Contributor } from \"./Contributor.js\";\n\n/**\n * For a set of logins, the contributions under those users.\n */\nexport type ContributorsContributions = Record<\n\tstring,\n\tContributorContributions\n>;\n\n/**\n * For each contribution under a login, the issue/PR numbers that count as that type.\n */\nexport type ContributorContributions = Record<string, number[]>;\n\nexport class ContributorsCollection {\n\t#contributors: Record<string, Contributor> = {};\n\t#ignoredLogins: Set<string>;\n\n\tconstructor(ignoredLogins: Set<string>) {\n\t\tthis.#ignoredLogins = ignoredLogins;\n\t}\n\n\tadd(login: string | undefined, number: number, type: string) {\n\t\tif (login && !this.#ignoredLogins.has(login)) {\n\t\t\t(this.#contributors[login.toLowerCase()] ??= new Contributor()).add(\n\t\t\t\tnumber,\n\t\t\t\ttype,\n\t\t\t);\n\t\t}\n\t}\n\n\tcollect(): ContributorsContributions {\n\t\treturn Object.fromEntries(\n\t\t\tObject.entries(this.#contributors)\n\t\t\t\t.map(\n\t\t\t\t\t([login, contributor]) =>\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\tlogin,\n\t\t\t\t\t\t\tObject.fromEntries(\n\t\t\t\t\t\t\t\tObject.entries(contributor.contributions).map(\n\t\t\t\t\t\t\t\t\t([type, numbers]) => [\n\t\t\t\t\t\t\t\t\t\ttype,\n\t\t\t\t\t\t\t\t\t\tArray.from(numbers).sort((a, b) => a - b),\n\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t] as const,\n\t\t\t\t)\n\t\t\t\t.sort(([a], [b]) => a.localeCompare(b)),\n\t\t);\n\t}\n}\n"],"mappings":"AAAA,SAAS,mBAAmB;AAerB,MAAM,uBAAuB;AAAA,EACnC,gBAA6C,CAAC;AAAA,EAC9C;AAAA,EAEA,YAAY,eAA4B;AACvC,SAAK,iBAAiB;AAAA,EACvB;AAAA,EAEA,IAAI,OAA2B,QAAgB,MAAc;AAC5D,QAAI,SAAS,CAAC,KAAK,eAAe,IAAI,KAAK,GAAG;AAC7C,OAAC,KAAK,cAAc,MAAM,YAAY,CAAC,MAAM,IAAI,YAAY,GAAG;AAAA,QAC/D;AAAA,QACA;AAAA,MACD;AAAA,IACD;AAAA,EACD;AAAA,EAEA,UAAqC;AACpC,WAAO,OAAO;AAAA,MACb,OAAO,QAAQ,KAAK,aAAa,EAC/B;AAAA,QACA,CAAC,CAAC,OAAO,WAAW,MACnB;AAAA,UACC;AAAA,UACA,OAAO;AAAA,YACN,OAAO,QAAQ,YAAY,aAAa,EAAE;AAAA,cACzC,CAAC,CAAC,MAAM,OAAO,MAAM;AAAA,gBACpB;AAAA,gBACA,MAAM,KAAK,OAAO,EAAE,KAAK,CAAC,GAAG,MAAM,IAAI,CAAC;AAAA,cACzC;AAAA,YACD;AAAA,UACD;AAAA,QACD;AAAA,MACF,EACC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;AAAA,IACxC;AAAA,EACD;AACD;","names":[]}
@@ -1,3 +1,4 @@
1
+ import { descriptionToCoAuthors } from "description-to-co-authors";
1
2
  function addAcceptedIssues(acceptedIssues, contributors, options) {
2
3
  for (const acceptedIssue of acceptedIssues) {
3
4
  const labels = acceptedIssue.labels.map(
@@ -13,12 +14,20 @@ function addAcceptedIssues(acceptedIssues, contributors, options) {
13
14
  // - 🔧 `tool`: authors of merged PRs that address issues labeled as tooling
14
15
  [options.labelTypeTool, "tool"]
15
16
  ]) {
16
- if (labels.some((label) => label === labelType)) {
17
- contributors.add(
18
- acceptedIssue.user?.login,
19
- acceptedIssue.number,
20
- contribution
21
- );
17
+ if (!labels.some((label) => label === labelType)) {
18
+ continue;
19
+ }
20
+ const logins = [];
21
+ if (acceptedIssue.user) {
22
+ logins.push(acceptedIssue.user.login);
23
+ }
24
+ if (acceptedIssue.body) {
25
+ for (const coAuthor of descriptionToCoAuthors(acceptedIssue.body)) {
26
+ logins.push(coAuthor.username);
27
+ }
28
+ }
29
+ for (const login of logins) {
30
+ contributors.add(login, acceptedIssue.number, contribution);
22
31
  }
23
32
  }
24
33
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/collect/adding/addAcceptedIssues.ts"],"sourcesContent":["import { ContributorsCollection } from \"../../ContributorsCollection.js\";\nimport { AllContributorsForRepositoryOptions } from \"../../options.js\";\nimport { AcceptedIssue } from \"../collecting/collectAcceptedIssues.js\";\n\nexport function addAcceptedIssues(\n\tacceptedIssues: AcceptedIssue[],\n\tcontributors: Pick<ContributorsCollection, \"add\">,\n\toptions: Pick<\n\t\tAllContributorsForRepositoryOptions,\n\t\t`labelType${string}` & keyof AllContributorsForRepositoryOptions\n\t>,\n) {\n\tfor (const acceptedIssue of acceptedIssues) {\n\t\tconst labels = acceptedIssue.labels.map((label) =>\n\t\t\ttypeof label === \"string\" ? label : label.name,\n\t\t);\n\n\t\tfor (const [labelType, contribution] of [\n\t\t\t// 🐛 `bug`: anybody who filed an issue labeled as accepting PRs and a bug\n\t\t\t[options.labelTypeBug, \"bug\"],\n\t\t\t// - 📖 `doc`: authors of merged PRs that address issues labeled as docs\n\t\t\t[options.labelTypeDocs, \"docs\"],\n\t\t\t// 💡 `ideas`: anybody who filed an issue labeled as accepting PRs and a feature\n\t\t\t[options.labelTypeIdeas, \"ideas\"],\n\t\t\t// - 🔧 `tool`: authors of merged PRs that address issues labeled as tooling\n\t\t\t[options.labelTypeTool, \"tool\"],\n\t\t] as const) {\n\t\t\tif (labels.some((label) => label === labelType)) {\n\t\t\t\tcontributors.add(\n\t\t\t\t\tacceptedIssue.user?.login,\n\t\t\t\t\tacceptedIssue.number,\n\t\t\t\t\tcontribution,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n}\n"],"mappings":"AAIO,SAAS,kBACf,gBACA,cACA,SAIC;AACD,aAAW,iBAAiB,gBAAgB;AAC3C,UAAM,SAAS,cAAc,OAAO;AAAA,MAAI,CAAC,UACxC,OAAO,UAAU,WAAW,QAAQ,MAAM;AAAA,IAC3C;AAEA,eAAW,CAAC,WAAW,YAAY,KAAK;AAAA;AAAA,MAEvC,CAAC,QAAQ,cAAc,KAAK;AAAA;AAAA,MAE5B,CAAC,QAAQ,eAAe,MAAM;AAAA;AAAA,MAE9B,CAAC,QAAQ,gBAAgB,OAAO;AAAA;AAAA,MAEhC,CAAC,QAAQ,eAAe,MAAM;AAAA,IAC/B,GAAY;AACX,UAAI,OAAO,KAAK,CAAC,UAAU,UAAU,SAAS,GAAG;AAChD,qBAAa;AAAA,UACZ,cAAc,MAAM;AAAA,UACpB,cAAc;AAAA,UACd;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACD;","names":[]}
1
+ {"version":3,"sources":["../../../src/collect/adding/addAcceptedIssues.ts"],"sourcesContent":["import { descriptionToCoAuthors } from \"description-to-co-authors\";\n\nimport { ContributorsCollection } from \"../../ContributorsCollection.js\";\nimport { AllContributorsForRepositoryOptions } from \"../../options.js\";\nimport { AcceptedIssue } from \"../collecting/collectAcceptedIssues.js\";\n\nexport function addAcceptedIssues(\n\tacceptedIssues: AcceptedIssue[],\n\tcontributors: Pick<ContributorsCollection, \"add\">,\n\toptions: Pick<\n\t\tAllContributorsForRepositoryOptions,\n\t\t`labelType${string}` & keyof AllContributorsForRepositoryOptions\n\t>,\n) {\n\tfor (const acceptedIssue of acceptedIssues) {\n\t\tconst labels = acceptedIssue.labels.map((label) =>\n\t\t\ttypeof label === \"string\" ? label : label.name,\n\t\t);\n\n\t\tfor (const [labelType, contribution] of [\n\t\t\t// 🐛 `bug`: anybody who filed an issue labeled as accepting PRs and a bug\n\t\t\t[options.labelTypeBug, \"bug\"],\n\t\t\t// - 📖 `doc`: authors of merged PRs that address issues labeled as docs\n\t\t\t[options.labelTypeDocs, \"docs\"],\n\t\t\t// 💡 `ideas`: anybody who filed an issue labeled as accepting PRs and a feature\n\t\t\t[options.labelTypeIdeas, \"ideas\"],\n\t\t\t// - 🔧 `tool`: authors of merged PRs that address issues labeled as tooling\n\t\t\t[options.labelTypeTool, \"tool\"],\n\t\t] as const) {\n\t\t\tif (!labels.some((label) => label === labelType)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst logins = [];\n\n\t\t\tif (acceptedIssue.user) {\n\t\t\t\tlogins.push(acceptedIssue.user.login);\n\t\t\t}\n\n\t\t\tif (acceptedIssue.body) {\n\t\t\t\tfor (const coAuthor of descriptionToCoAuthors(acceptedIssue.body)) {\n\t\t\t\t\tlogins.push(coAuthor.username);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (const login of logins) {\n\t\t\t\tcontributors.add(login, acceptedIssue.number, contribution);\n\t\t\t}\n\t\t}\n\t}\n}\n"],"mappings":"AAAA,SAAS,8BAA8B;AAMhC,SAAS,kBACf,gBACA,cACA,SAIC;AACD,aAAW,iBAAiB,gBAAgB;AAC3C,UAAM,SAAS,cAAc,OAAO;AAAA,MAAI,CAAC,UACxC,OAAO,UAAU,WAAW,QAAQ,MAAM;AAAA,IAC3C;AAEA,eAAW,CAAC,WAAW,YAAY,KAAK;AAAA;AAAA,MAEvC,CAAC,QAAQ,cAAc,KAAK;AAAA;AAAA,MAE5B,CAAC,QAAQ,eAAe,MAAM;AAAA;AAAA,MAE9B,CAAC,QAAQ,gBAAgB,OAAO;AAAA;AAAA,MAEhC,CAAC,QAAQ,eAAe,MAAM;AAAA,IAC/B,GAAY;AACX,UAAI,CAAC,OAAO,KAAK,CAAC,UAAU,UAAU,SAAS,GAAG;AACjD;AAAA,MACD;AAEA,YAAM,SAAS,CAAC;AAEhB,UAAI,cAAc,MAAM;AACvB,eAAO,KAAK,cAAc,KAAK,KAAK;AAAA,MACrC;AAEA,UAAI,cAAc,MAAM;AACvB,mBAAW,YAAY,uBAAuB,cAAc,IAAI,GAAG;AAClE,iBAAO,KAAK,SAAS,QAAQ;AAAA,QAC9B;AAAA,MACD;AAEA,iBAAW,SAAS,QAAQ;AAC3B,qBAAa,IAAI,OAAO,cAAc,QAAQ,YAAY;AAAA,MAC3D;AAAA,IACD;AAAA,EACD;AACD;","names":[]}
@@ -1,9 +1,9 @@
1
- import { commitToCoAuthors } from "commit-to-co-authors";
1
+ import { descriptionToCoAuthors } from "description-to-co-authors";
2
2
  async function parseMergedPullAuthors(mergedPull, cachingCoAuthorToUsername) {
3
3
  const authors = [];
4
4
  authors.push(mergedPull.user?.login);
5
5
  if (mergedPull.body) {
6
- const coAuthors = commitToCoAuthors(mergedPull.body);
6
+ const coAuthors = descriptionToCoAuthors(mergedPull.body);
7
7
  for (const coAuthor of coAuthors) {
8
8
  authors.push(await cachingCoAuthorToUsername(coAuthor));
9
9
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/collect/parsing/parseMergedPullAuthors.ts"],"sourcesContent":["import { CachingCoAuthorToUsername } from \"co-author-to-username\";\nimport { commitToCoAuthors } from \"commit-to-co-authors\";\n\ninterface MergedPullForAuthors {\n\tbody?: string;\n\tuser?: { login?: string } | null;\n}\n\nexport async function parseMergedPullAuthors(\n\tmergedPull: MergedPullForAuthors,\n\tcachingCoAuthorToUsername: CachingCoAuthorToUsername,\n) {\n\tconst authors: (string | undefined)[] = [];\n\n\tauthors.push(mergedPull.user?.login);\n\n\tif (mergedPull.body) {\n\t\tconst coAuthors = commitToCoAuthors(mergedPull.body);\n\n\t\tfor (const coAuthor of coAuthors) {\n\t\t\tauthors.push(await cachingCoAuthorToUsername(coAuthor));\n\t\t}\n\t}\n\n\treturn Array.from(\n\t\tnew Set(\n\t\t\tauthors.filter(\n\t\t\t\t(author: string | undefined): author is string => !!author,\n\t\t\t),\n\t\t),\n\t);\n}\n"],"mappings":"AACA,SAAS,yBAAyB;AAOlC,eAAsB,uBACrB,YACA,2BACC;AACD,QAAM,UAAkC,CAAC;AAEzC,UAAQ,KAAK,WAAW,MAAM,KAAK;AAEnC,MAAI,WAAW,MAAM;AACpB,UAAM,YAAY,kBAAkB,WAAW,IAAI;AAEnD,eAAW,YAAY,WAAW;AACjC,cAAQ,KAAK,MAAM,0BAA0B,QAAQ,CAAC;AAAA,IACvD;AAAA,EACD;AAEA,SAAO,MAAM;AAAA,IACZ,IAAI;AAAA,MACH,QAAQ;AAAA,QACP,CAAC,WAAiD,CAAC,CAAC;AAAA,MACrD;AAAA,IACD;AAAA,EACD;AACD;","names":[]}
1
+ {"version":3,"sources":["../../../src/collect/parsing/parseMergedPullAuthors.ts"],"sourcesContent":["import { CachingCoAuthorToUsername } from \"co-author-to-username\";\nimport { descriptionToCoAuthors } from \"description-to-co-authors\";\n\ninterface MergedPullForAuthors {\n\tbody?: string;\n\tuser?: { login?: string } | null;\n}\n\nexport async function parseMergedPullAuthors(\n\tmergedPull: MergedPullForAuthors,\n\tcachingCoAuthorToUsername: CachingCoAuthorToUsername,\n) {\n\tconst authors: (string | undefined)[] = [];\n\n\tauthors.push(mergedPull.user?.login);\n\n\tif (mergedPull.body) {\n\t\tconst coAuthors = descriptionToCoAuthors(mergedPull.body);\n\n\t\tfor (const coAuthor of coAuthors) {\n\t\t\tauthors.push(await cachingCoAuthorToUsername(coAuthor));\n\t\t}\n\t}\n\n\treturn Array.from(\n\t\tnew Set(\n\t\t\tauthors.filter(\n\t\t\t\t(author: string | undefined): author is string => !!author,\n\t\t\t),\n\t\t),\n\t);\n}\n"],"mappings":"AACA,SAAS,8BAA8B;AAOvC,eAAsB,uBACrB,YACA,2BACC;AACD,QAAM,UAAkC,CAAC;AAEzC,UAAQ,KAAK,WAAW,MAAM,KAAK;AAEnC,MAAI,WAAW,MAAM;AACpB,UAAM,YAAY,uBAAuB,WAAW,IAAI;AAExD,eAAW,YAAY,WAAW;AACjC,cAAQ,KAAK,MAAM,0BAA0B,QAAQ,CAAC;AAAA,IACvD;AAAA,EACD;AAEA,SAAO,MAAM;AAAA,IACZ,IAAI;AAAA,MACH,QAAQ;AAAA,QACP,CAAC,WAAiD,CAAC,CAAC;AAAA,MACrD;AAAA,IACD;AAAA,EACD;AACD;","names":[]}
@@ -1,12 +1,13 @@
1
- import conventionalCommitsParser from "conventional-commits-parser";
1
+ import { CommitParser } from "conventional-commits-parser";
2
2
  const allContributorsTypes = /* @__PURE__ */ new Map([
3
3
  ["build", "infra"],
4
4
  ["ci", "infra"],
5
5
  ["docs", "doc"],
6
6
  ["test", "test"]
7
7
  ]);
8
+ const parser = new CommitParser();
8
9
  function parseMergedPullType(title) {
9
- const { type } = conventionalCommitsParser.sync(title);
10
+ const { type } = parser.parse(title);
10
11
  return (type && allContributorsTypes.get(type)) ?? "code";
11
12
  }
12
13
  export {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/collect/parsing/parseMergedPullType.ts"],"sourcesContent":["import conventionalCommitsParser from \"conventional-commits-parser\";\n\nconst allContributorsTypes = new Map([\n\t[\"build\", \"infra\"],\n\t[\"ci\", \"infra\"],\n\t[\"docs\", \"doc\"],\n\t[\"test\", \"test\"],\n]);\n\nexport function parseMergedPullType(title: string) {\n\tconst { type } = conventionalCommitsParser.sync(title);\n\n\treturn (type && allContributorsTypes.get(type)) ?? \"code\";\n}\n"],"mappings":"AAAA,OAAO,+BAA+B;AAEtC,MAAM,uBAAuB,oBAAI,IAAI;AAAA,EACpC,CAAC,SAAS,OAAO;AAAA,EACjB,CAAC,MAAM,OAAO;AAAA,EACd,CAAC,QAAQ,KAAK;AAAA,EACd,CAAC,QAAQ,MAAM;AAChB,CAAC;AAEM,SAAS,oBAAoB,OAAe;AAClD,QAAM,EAAE,KAAK,IAAI,0BAA0B,KAAK,KAAK;AAErD,UAAQ,QAAQ,qBAAqB,IAAI,IAAI,MAAM;AACpD;","names":[]}
1
+ {"version":3,"sources":["../../../src/collect/parsing/parseMergedPullType.ts"],"sourcesContent":["import { CommitParser } from \"conventional-commits-parser\";\n\nconst allContributorsTypes = new Map([\n\t[\"build\", \"infra\"],\n\t[\"ci\", \"infra\"],\n\t[\"docs\", \"doc\"],\n\t[\"test\", \"test\"],\n]);\n\nconst parser = new CommitParser();\n\nexport function parseMergedPullType(title: string) {\n\tconst { type } = parser.parse(title);\n\n\treturn (type && allContributorsTypes.get(type)) ?? \"code\";\n}\n"],"mappings":"AAAA,SAAS,oBAAoB;AAE7B,MAAM,uBAAuB,oBAAI,IAAI;AAAA,EACpC,CAAC,SAAS,OAAO;AAAA,EACjB,CAAC,MAAM,OAAO;AAAA,EACd,CAAC,QAAQ,KAAK;AAAA,EACd,CAAC,QAAQ,MAAM;AAChB,CAAC;AAED,MAAM,SAAS,IAAI,aAAa;AAEzB,SAAS,oBAAoB,OAAe;AAClD,QAAM,EAAE,KAAK,IAAI,OAAO,MAAM,KAAK;AAEnC,UAAQ,QAAQ,qBAAqB,IAAI,IAAI,MAAM;AACpD;","names":[]}
@@ -2,11 +2,11 @@ import { RepoEvent } from '../collecting/collectRepoEvents.js';
2
2
  import 'octokit';
3
3
  import '../api.js';
4
4
 
5
- type PullRequestReviewEvent = RepoEvent & {
5
+ type PullRequestReviewEvent = {
6
6
  issue: {
7
7
  number: number;
8
8
  };
9
- };
9
+ } & RepoEvent;
10
10
  declare function repoEventIsPullRequestReviewEvent(repoEvent: Pick<RepoEvent, "type">): repoEvent is PullRequestReviewEvent;
11
11
 
12
12
  export { type PullRequestReviewEvent, repoEventIsPullRequestReviewEvent };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/collect/processing/repoEventIsPullRequestReviewEvent.ts"],"sourcesContent":["import { RepoEvent } from \"../collecting/collectRepoEvents.js\";\n\nexport type PullRequestReviewEvent = RepoEvent & {\n\tissue: {\n\t\tnumber: number;\n\t};\n};\n\nexport function repoEventIsPullRequestReviewEvent(\n\trepoEvent: Pick<RepoEvent, \"type\">,\n): repoEvent is PullRequestReviewEvent {\n\treturn (\n\t\trepoEvent.type === \"PullRequestReviewEvent\" &&\n\t\t!!(repoEvent as Partial<PullRequestReviewEvent>).issue?.number\n\t);\n}\n"],"mappings":"AAQO,SAAS,kCACf,WACsC;AACtC,SACC,UAAU,SAAS,4BACnB,CAAC,CAAE,UAA8C,OAAO;AAE1D;","names":[]}
1
+ {"version":3,"sources":["../../../src/collect/processing/repoEventIsPullRequestReviewEvent.ts"],"sourcesContent":["import { RepoEvent } from \"../collecting/collectRepoEvents.js\";\n\nexport type PullRequestReviewEvent = {\n\tissue: {\n\t\tnumber: number;\n\t};\n} & RepoEvent;\n\nexport function repoEventIsPullRequestReviewEvent(\n\trepoEvent: Pick<RepoEvent, \"type\">,\n): repoEvent is PullRequestReviewEvent {\n\treturn (\n\t\trepoEvent.type === \"PullRequestReviewEvent\" &&\n\t\t!!(repoEvent as Partial<PullRequestReviewEvent>).issue?.number\n\t);\n}\n"],"mappings":"AAQO,SAAS,kCACf,WACsC;AACtC,SACC,UAAU,SAAS,4BACnB,CAAC,CAAE,UAA8C,OAAO;AAE1D;","names":[]}
package/lib/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export { ContributorContributions, ContributorsContributions } from './ContributorsCollection.js';
2
2
  export { getAllContributorsForRepository } from './getAllContributorsForRepository.js';
3
- import './options.js';
3
+ export { RawAllContributorsForRepositoryOptions } from './options.js';
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n\ttype ContributorContributions,\n\ttype ContributorsContributions,\n} from \"./ContributorsCollection.js\";\nexport { getAllContributorsForRepository } from \"./getAllContributorsForRepository.js\";\n"],"mappings":"AAIA,SAAS,uCAAuC;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n\ttype ContributorContributions,\n\ttype ContributorsContributions,\n} from \"./ContributorsCollection.js\";\nexport { getAllContributorsForRepository } from \"./getAllContributorsForRepository.js\";\nexport type { RawAllContributorsForRepositoryOptions } from \"./options.js\";\n"],"mappings":"AAIA,SAAS,uCAAuC;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "all-contributors-for-repository",
3
- "version": "0.2.3",
3
+ "version": "0.3.1",
4
4
  "description": "Generates an allcontributors list for an existing repository. 🤝",
5
5
  "repository": {
6
6
  "type": "git",
@@ -37,42 +37,42 @@
37
37
  "*": "prettier --ignore-unknown --write"
38
38
  },
39
39
  "dependencies": {
40
- "co-author-to-username": "^0.1.0",
41
- "commit-to-co-authors": "^0.1.0",
42
- "conventional-commits-parser": "^5.0.0",
43
- "octokit": "^3.1.2"
40
+ "co-author-to-username": "^0.1.1",
41
+ "conventional-commits-parser": "^6.0.0",
42
+ "description-to-co-authors": "^0.3.0",
43
+ "octokit": "^4.0.0"
44
44
  },
45
45
  "devDependencies": {
46
- "@release-it/conventional-changelog": "^8.0.1",
46
+ "@release-it/conventional-changelog": "^9.0.0",
47
47
  "@types/conventional-commits-parser": "^5.0.0",
48
- "@types/eslint": "^8.56.2",
49
- "@typescript-eslint/eslint-plugin": "^6.18.1",
50
- "@typescript-eslint/parser": "^7.0.0",
48
+ "@types/eslint": "^9.0.0",
49
+ "@typescript-eslint/eslint-plugin": "^8.0.1",
50
+ "@typescript-eslint/parser": "^8.0.1",
51
51
  "@vitest/coverage-v8": "^1.1.3",
52
- "console-fail-test": "^0.4.0",
52
+ "console-fail-test": "^0.5.0",
53
53
  "cspell": "^8.3.2",
54
- "eslint": "^8.56.0",
55
- "eslint-plugin-deprecation": "^2.0.0",
54
+ "eslint": "^8.57.0",
55
+ "eslint-plugin-deprecation": "^3.0.0",
56
56
  "eslint-plugin-eslint-comments": "^3.2.0",
57
- "eslint-plugin-jsdoc": "^48.0.2",
57
+ "eslint-plugin-jsdoc": "^50.0.0",
58
58
  "eslint-plugin-jsonc": "^2.11.2",
59
- "eslint-plugin-markdown": "^3.0.1",
59
+ "eslint-plugin-markdown": "^5.0.0",
60
60
  "eslint-plugin-n": "^17.0.0",
61
61
  "eslint-plugin-no-only-tests": "^3.1.0",
62
62
  "eslint-plugin-perfectionist": "^2.5.0",
63
63
  "eslint-plugin-regexp": "^2.2.0",
64
- "eslint-plugin-vitest": "^0.4.0",
64
+ "eslint-plugin-vitest": "^0.5.0",
65
65
  "eslint-plugin-yml": "^1.11.0",
66
66
  "husky": "^9.0.0",
67
67
  "jsonc-eslint-parser": "^2.4.0",
68
- "knip": "5.27.0",
68
+ "knip": "5.39.2",
69
69
  "lint-staged": "^15.2.0",
70
- "markdownlint": "^0.34.0",
71
- "markdownlint-cli": "^0.41.0",
72
- "npm-package-json-lint": "^7.1.0",
73
- "npm-package-json-lint-config-default": "^6.0.0",
70
+ "markdownlint": "^0.37.0",
71
+ "markdownlint-cli": "^0.43.0",
72
+ "npm-package-json-lint": "^8.0.0",
73
+ "npm-package-json-lint-config-default": "^7.0.0",
74
74
  "prettier": "^3.1.1",
75
- "prettier-plugin-curly": "^0.2.0",
75
+ "prettier-plugin-curly": "^0.3.0",
76
76
  "prettier-plugin-packagejson": "^2.4.9",
77
77
  "release-it": "^17.0.1",
78
78
  "sentences-per-line": "^0.2.1",
@@ -82,7 +82,7 @@
82
82
  "vitest": "^1.1.3",
83
83
  "yaml-eslint-parser": "^1.2.2"
84
84
  },
85
- "packageManager": "pnpm@9.6.0",
85
+ "packageManager": "pnpm@9.15.0",
86
86
  "engines": {
87
87
  "node": ">=18"
88
88
  },