Skip to content

Commit fa6e2ab

Browse files
authored
Merge pull request #258 from KomodoPlatform/dev
2 parents 1db36f7 + f043b72 commit fa6e2ab

4 files changed

+55
-11
lines changed

authors.json

+12-4
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
"username": "smk762",
1919
"commit_emails": [
2020
21-
21+
22+
2223
],
2324
"socials": {
2425
"twitter": "",
@@ -438,7 +439,10 @@
438439
},
439440
"laruh": {
440441
"username": "laruh",
441-
"commit_emails": [],
442+
"commit_emails": [
443+
444+
445+
],
442446
"socials": {
443447
"twitter": "",
444448
"linkedin": ""
@@ -449,7 +453,9 @@
449453
},
450454
"kivqa": {
451455
"username": "kivqa",
452-
"commit_emails": [],
456+
"commit_emails": [
457+
458+
],
453459
"socials": {
454460
"twitter": "",
455461
"linkedin": ""
@@ -460,7 +466,9 @@
460466
},
461467
"AndrewDelaney": {
462468
"username": "AndrewDelaney",
463-
"commit_emails": [],
469+
"commit_emails": [
470+
471+
],
464472
"socials": {
465473
"twitter": "",
466474
"linkedin": ""

utils/_fileData.json

+8
Original file line numberDiff line numberDiff line change
@@ -4721,6 +4721,10 @@
47214721
{
47224722
"name": "\"smk762\"",
47234723
"email": "[email protected]"
4724+
},
4725+
{
4726+
"name": "\"kivqa\"",
4727+
"email": "[email protected]"
47244728
}
47254729
],
47264730
"dateCreated": "2024-03-08T07:31:21.000Z",
@@ -4931,6 +4935,10 @@
49314935
{
49324936
"name": "\"gcharang\"",
49334937
"email": "[email protected]"
4938+
},
4939+
{
4940+
"name": "\"laruh\"",
4941+
"email": "[email protected]"
49344942
}
49354943
],
49364944
"dateCreated": "2024-03-08T07:31:21.000Z",

utils/_fileData_old_documentation_mod.json

+18-1
Original file line numberDiff line numberDiff line change
@@ -2082,6 +2082,10 @@
20822082
{
20832083
"name": "\"smk762\"",
20842084
"email": "[email protected]"
2085+
},
2086+
{
2087+
"name": "\"kivqa\"",
2088+
"email": "[email protected]"
20852089
}
20862090
],
20872091
"lastContributor": {
@@ -2360,6 +2364,19 @@
23602364
"email": "[email protected]"
23612365
}
23622366
},
2367+
"/komodo-defi-framework/api/v20-dev/non_fungible_tokens": {
2368+
"dateModified": "2023-07-10T00:43:36.000Z",
2369+
"contributors": [
2370+
{
2371+
"name": "\"laruh\"",
2372+
"email": "[email protected]"
2373+
}
2374+
],
2375+
"lastContributor": {
2376+
"name": "\"laruh\"",
2377+
"email": "[email protected]"
2378+
}
2379+
},
23632380
"/komodo-defi-framework/api/legacy/coins_needed_for_kick_start": {
23642381
"dateModified": "2023-07-10T00:43:36.000Z",
23652382
"contributors": [
@@ -8389,4 +8406,4 @@
83898406
"email": "[email protected]"
83908407
}
83918408
}
8392-
}
8409+
}

utils/js/get_file_author_data.js

+17-6
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@ import fs from 'fs';
22
import https from 'https';
33
import path from 'path';
44
import { spawnSync } from 'child_process';
5-
import { get } from 'http';
65
const authorsData = JSON.parse(fs.readFileSync("./authors.json", 'utf8'));
76
const oldFileData = JSON.parse(fs.readFileSync("./utils/_fileData_old_documentation_mod.json", 'utf8'));
87

98
const fileData = {};
109

1110
(async function () {
12-
const contributorsInfoUrl = "https://api.github.com/repos/komodoplatform/komodo-docs-mdx/contributors"
11+
const allContributorsDataUrl = "https://api.github.com/repos/komodoplatform/komodo-docs-mdx/contributors"
1312

1413
const options = {
1514
headers: {
@@ -18,13 +17,23 @@ const fileData = {};
1817
};
1918

2019
try {
21-
const { response } = await httpsGet(contributorsInfoUrl, options)
20+
const { response } = await httpsGet(allContributorsDataUrl, options)
2221
const contributorData = JSON.parse(response)
23-
contributorData.forEach(contributor => {
22+
for (const contributor of contributorData) {
2423
if (!authorsData[contributor.login]) {
24+
const { response } = await httpsGet(`https://api.github.com/repos/komodoplatform/komodo-docs-mdx/commits?author=${contributor.login}`, options)
25+
const contributorCommits = JSON.parse(response)
26+
console.log(contributorCommits)
27+
const commit_emails = new Set();
28+
contributorCommits.forEach(commit => {
29+
if (commit.commit && commit.commit.author && commit.commit.author.email) {
30+
commit_emails.add(commit.commit.author.email);
31+
}
32+
});
33+
console.log(commit_emails)
2534
authorsData[contributor.login] = {
2635
username: contributor.login,
27-
commit_emails: [],
36+
commit_emails: Array.from(commit_emails),
2837
socials: {
2938
twitter: "",
3039
linkedin: ""
@@ -33,7 +42,7 @@ const fileData = {};
3342
}
3443
authorsData[contributor.login].id = contributor.id
3544
authorsData[contributor.login].avatar_url = contributor.avatar_url
36-
});
45+
}
3746
} catch (error) {
3847
console.error(error);
3948
}
@@ -44,6 +53,8 @@ const fileData = {};
4453
authorsData[username].image = imgName
4554
}
4655

56+
57+
4758
fs.writeFileSync("authors.json", JSON.stringify(authorsData, null, 4))
4859

4960

0 commit comments

Comments
 (0)