Skip to content

Commit 723f0f3

Browse files
authored
Merge pull request #260 from KomodoPlatform/dev
2 parents fa6e2ab + 93005f9 commit 723f0f3

15 files changed

+130
-58
lines changed

.github/workflows/get_data_lint_files_deploy.yml

+2
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ jobs:
5252

5353
- name: Get file and Author data
5454
if: github.base_ref == 'main' || github.ref == 'refs/heads/main'
55+
env:
56+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5557
run: node utils/js/get_file_author_data.js
5658

5759
- name: Validate and Update links

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,4 @@ Thumbs.db
3737
# custom
3838
filepathSlugs.json
3939
links-to-manually-check
40+
.env

authors.json

+32-19
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
"smk762": {
1818
"username": "smk762",
1919
"commit_emails": [
20-
2120
21+
2222
2323
],
2424
"socials": {
@@ -46,8 +46,8 @@
4646
"gaeacodes": {
4747
"username": "gaeacodes",
4848
"commit_emails": [
49-
"gaeacodes@gmail.com",
50-
"77043250+gaeacodes@users.noreply.github.com"
49+
"77043250+gaeacodes@users.noreply.github.com",
50+
"gaeacodes@gmail.com"
5151
],
5252
"socials": {
5353
"twitter": "",
@@ -73,12 +73,12 @@
7373
"blue-santa": {
7474
"username": "blue-santa",
7575
"commit_emails": [
76+
7677
77-
78-
78+
7979
],
8080
"socials": {
81-
"twitter": "",
81+
"twitter": "bluesanta_io",
8282
"linkedin": ""
8383
},
8484
"id": 33014953,
@@ -117,7 +117,7 @@
117117
118118
],
119119
"socials": {
120-
"twitter": "",
120+
"twitter": "techloverhd",
121121
"linkedin": ""
122122
},
123123
"id": 8881040,
@@ -127,8 +127,8 @@
127127
"Alrighttt": {
128128
"username": "Alrighttt",
129129
"commit_emails": [
130-
"mzlot555@gmail.com",
131-
130+
131+
"mzlot555@gmail.com"
132132
],
133133
"socials": {
134134
"twitter": "",
@@ -170,7 +170,7 @@
170170
171171
],
172172
"socials": {
173-
"twitter": "",
173+
"twitter": "mybrainforked",
174174
"linkedin": ""
175175
},
176176
"id": 24797699,
@@ -222,7 +222,7 @@
222222
223223
],
224224
"socials": {
225-
"twitter": "",
225+
"twitter": "0xca333",
226226
"linkedin": ""
227227
},
228228
"id": 10762374,
@@ -378,7 +378,7 @@
378378
379379
],
380380
"socials": {
381-
"twitter": "",
381+
"twitter": "dukeleto",
382382
"linkedin": ""
383383
},
384384
"id": 30298,
@@ -404,10 +404,10 @@
404404
405405
],
406406
"socials": {
407-
"twitter": "",
407+
"twitter": "stevehugue",
408408
"linkedin": ""
409409
},
410-
"id": 31395674,
410+
"id": 7686916,
411411
"avatar_url": "https://avatars.githubusercontent.com/u/7686916?v=4",
412412
"image": "StEvUgnIn.jpeg"
413413
},
@@ -417,10 +417,10 @@
417417
418418
],
419419
"socials": {
420-
"twitter": "",
420+
"twitter": "2mf",
421421
"linkedin": ""
422422
},
423-
"id": 31395674,
423+
"id": 2559459,
424424
"avatar_url": "https://avatars.githubusercontent.com/u/2559459?v=4",
425425
"image": "kolobus.jpeg"
426426
},
@@ -433,15 +433,15 @@
433433
"twitter": "",
434434
"linkedin": ""
435435
},
436-
"id": 31395674,
436+
"id": 5043201,
437437
"avatar_url": "https://avatars.githubusercontent.com/u/5043201?v=4",
438438
"image": "daemonfox.jpeg"
439439
},
440440
"laruh": {
441441
"username": "laruh",
442442
"commit_emails": [
443-
"oblomoff616@gmail.com",
444-
443+
444+
"oblomoff616@gmail.com"
445445
],
446446
"socials": {
447447
"twitter": "",
@@ -476,5 +476,18 @@
476476
"id": 30876243,
477477
"avatar_url": "https://avatars.githubusercontent.com/u/30876243?v=4",
478478
"image": "AndrewDelaney.jpeg"
479+
},
480+
"bsodmike": {
481+
"username": "bsodmike",
482+
"commit_emails": [
483+
484+
],
485+
"socials": {
486+
"twitter": "bsodmike",
487+
"linkedin": ""
488+
},
489+
"id": 368260,
490+
"avatar_url": "https://avatars.githubusercontent.com/u/368260?v=4",
491+
"image": "bsodmike.jpeg"
479492
}
480493
}

data-for-gpts/all-content.txt

+5-1
Original file line numberDiff line numberDiff line change
@@ -57689,7 +57689,11 @@ cd ~
5768957689
git clone https://github.com/KomodoPlatform/komodo-defi-framework --branch mm2.1 --single-branch && cd komodo-defi-framework
5769057690
```
5769157691

57692-
Compile the source code.
57692+
<Note type="warning">
57693+
For development, please use the `dev` branch `git clone https://github.com/KomodoPlatform/komodo-defi-framework --branch dev` instead of a specific release branch.
57694+
</Note>
57695+
57696+
Compile the source code:
5769357697

5769457698
```bash
5769557699
cargo build --features native -vv

data-for-gpts/komodo-defi-framework-content.txt

+5-1
Original file line numberDiff line numberDiff line change
@@ -25401,7 +25401,11 @@ cd ~
2540125401
git clone https://github.com/KomodoPlatform/komodo-defi-framework --branch mm2.1 --single-branch && cd komodo-defi-framework
2540225402
```
2540325403

25404-
Compile the source code.
25404+
<Note type="warning">
25405+
For development, please use the `dev` branch `git clone https://github.com/KomodoPlatform/komodo-defi-framework --branch dev` instead of a specific release branch.
25406+
</Note>
25407+
25408+
Compile the source code:
2540525409

2540625410
```bash
2540725411
cargo build --features native -vv
Loading
Loading

preview-images/previewImgTimeStamps.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@
214214
"/komodo-defi-framework/changelog": "2024-03-08T15:53:57.000Z",
215215
"/komodo-defi-framework": "2024-04-11T16:31:02.000Z",
216216
"/komodo-defi-framework/setup/configure-mm2-json": "2024-03-11T05:04:37.000Z",
217-
"/komodo-defi-framework/setup": "2024-04-03T09:17:49.000Z",
217+
"/komodo-defi-framework/setup": "2024-05-02T15:13:31.000Z",
218218
"/komodo-defi-framework/tutorials/additional-information": "2024-03-08T15:53:57.000Z",
219219
"/komodo-defi-framework/tutorials/api-docker-telegram": "2024-04-03T09:17:49.000Z",
220220
"/komodo-defi-framework/tutorials/api-metrics": "2024-04-03T09:17:49.000Z",

src/images/authors/bsodmike.jpeg

30.6 KB
Loading

src/pages/komodo-defi-framework/setup/index.mdx

+5-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,11 @@ cd ~
149149
git clone https://github.com/KomodoPlatform/komodo-defi-framework --branch mm2.1 --single-branch && cd komodo-defi-framework
150150
```
151151

152-
Compile the source code.
152+
<Note type="warning">
153+
For development, please use the `dev` branch `git clone https://github.com/KomodoPlatform/komodo-defi-framework --branch dev` instead of a specific release branch.
154+
</Note>
155+
156+
Compile the source code:
153157

154158
```bash
155159
cargo build --features native -vv

utils/_fileData.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -5252,12 +5252,16 @@
52525252
}
52535253
},
52545254
"/komodo-defi-framework/setup": {
5255-
"dateModified": "2024-04-03T09:17:49.000Z",
5255+
"dateModified": "2024-05-02T15:13:31.000Z",
52565256
"contributors": [
52575257
{
52585258
"name": "\"gcharang\"",
52595259
"email": "[email protected]"
52605260
},
5261+
{
5262+
"name": "\"Michael de Silva\"",
5263+
"email": "[email protected]"
5264+
},
52615265
{
52625266
"name": "\"gaeacodes\"",
52635267
"email": "[email protected]"

utils/_searchIndex.json

+1-1
Large diffs are not rendered by default.

utils/js/get_file_author_data.js

+59-33
Original file line numberDiff line numberDiff line change
@@ -4,57 +4,83 @@ import path from 'path';
44
import { spawnSync } from 'child_process';
55
const authorsData = JSON.parse(fs.readFileSync("./authors.json", 'utf8'));
66
const oldFileData = JSON.parse(fs.readFileSync("./utils/_fileData_old_documentation_mod.json", 'utf8'));
7+
import dotenv from 'dotenv';
8+
dotenv.config();
79

810
const fileData = {};
911

1012
(async function () {
1113
const allContributorsDataUrl = "https://api.github.com/repos/komodoplatform/komodo-docs-mdx/contributors"
1214

15+
const latest100CommitsUrl = "https://api.github.com/repos/komodoplatform/komodo-docs-mdx/commits?sha=dev&per_page=100"
16+
17+
const userDataUrl = (login) => `https://api.github.com/users/${login}`
18+
1319
const options = {
1420
headers: {
15-
'User-Agent': 'komodo-docs-mdx-ci'
21+
'User-Agent': 'komodo-docs-mdx-ci',
22+
'Accept': 'application/vnd.github+json',
23+
'X-GitHub-Api-Version': '2022-11-28',
24+
'Authorization': `Bearer ${process.env.LOCAL_GH_TOKEN ?? process.env.GH_TOKEN}`
1625
}
1726
};
1827

1928
try {
20-
const { response } = await httpsGet(allContributorsDataUrl, options)
21-
const contributorData = JSON.parse(response)
22-
for (const contributor of contributorData) {
23-
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)
34-
authorsData[contributor.login] = {
35-
username: contributor.login,
36-
commit_emails: Array.from(commit_emails),
37-
socials: {
38-
twitter: "",
39-
linkedin: ""
40-
}
29+
const { response: contributorsRes } = await httpsGet(allContributorsDataUrl, options)
30+
const contributorData = JSON.parse(contributorsRes)
31+
const { response: commitsRes } = await httpsGet(latest100CommitsUrl, options)
32+
const commitData = JSON.parse(commitsRes)
33+
34+
const contributorLogins = new Set();
35+
contributorData.forEach(contributor => contributorLogins.add(contributor.login))
36+
commitData.forEach(commit => commit.author && contributorLogins.add(commit.author.login))
37+
Object.values(authorsData).forEach(author => contributorLogins.add(author.username))
38+
for (const contributorLogin of Array.from(contributorLogins)) {
39+
const isMissingInContributorData = !Object.values(authorsData).find(author => author.username === contributorLogin) || !contributorData.find(contributor => contributor.login === contributorLogin)
40+
console.log(contributorLogin)
41+
42+
const { response } = await httpsGet(`https://api.github.com/repos/komodoplatform/komodo-docs-mdx/commits?sha=dev&author=${contributorLogin}`, options)
43+
const contributorCommits = JSON.parse(response)
44+
const commit_emails = new Set();
45+
contributorCommits.forEach(commit => {
46+
if (commit.commit && commit.commit.author && commit.commit.author.email) {
47+
commit_emails.add(commit.commit.author.email);
4148
}
49+
});
50+
51+
authorsData[contributorLogin]?.commit_emails.forEach(email => commit_emails.add(email))
52+
53+
54+
authorsData[contributorLogin] = authorsData[contributorLogin] ?? {}
55+
56+
//console.log(commit_emails)
57+
console.log(contributorLogin)
58+
59+
authorsData[contributorLogin].username = contributorLogin
60+
authorsData[contributorLogin].commit_emails = Array.from(commit_emails).sort()
61+
const authorSocials = authorsData[contributorLogin].socials
62+
63+
const { response: userDataRes } = await httpsGet(userDataUrl(contributorLogin), options)
64+
const userData = JSON.parse(userDataRes)
65+
console.log(userData)
66+
67+
authorsData[contributorLogin].socials = {
68+
...authorSocials,
69+
twitter: userData.twitter_username ?? authorSocials?.twitter ?? "",
70+
linkedin: authorSocials?.linkedin ?? ""
4271
}
43-
authorsData[contributor.login].id = contributor.id
44-
authorsData[contributor.login].avatar_url = contributor.avatar_url
72+
73+
authorsData[contributorLogin].id = userData.id
74+
const imageUrl = userData.avatar_url
75+
authorsData[contributorLogin].avatar_url = imageUrl
76+
const imgName = await downloadImage(imageUrl, contributorLogin)
77+
authorsData[contributorLogin].image = imgName
4578
}
4679
} catch (error) {
47-
console.error(error);
80+
console.error(error)
81+
throw new Error(error)
4882
}
4983

50-
for (const username in authorsData) {
51-
const imageUrl = authorsData[username].avatar_url
52-
const imgName = await downloadImage(imageUrl, username)
53-
authorsData[username].image = imgName
54-
}
55-
56-
57-
5884
fs.writeFileSync("authors.json", JSON.stringify(authorsData, null, 4))
5985

6086

utils/js/package-lock.json

+13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

utils/js/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"@sindresorhus/slugify": "^2.2.1",
1616
"acorn": "^8.10.0",
1717
"axios": "^1.6.7",
18+
"dotenv": "^16.4.5",
1819
"mdx-annotations": "^0.1.3",
1920
"remark": "^14.0.3",
2021
"remark-gfm": "^3.0.1",

0 commit comments

Comments
 (0)