Skip to content

Commit

Permalink
Merge pull request #260 from KomodoPlatform/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
gcharang committed May 3, 2024
2 parents fa6e2ab + 93005f9 commit 723f0f3
Show file tree
Hide file tree
Showing 15 changed files with 130 additions and 58 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/get_data_lint_files_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ jobs:

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

- name: Validate and Update links
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ Thumbs.db
# custom
filepathSlugs.json
links-to-manually-check
.env
51 changes: 32 additions & 19 deletions authors.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"smk762": {
"username": "smk762",
"commit_emails": [
"smk762@iinet.net.au",
"35845239+smk762@users.noreply.github.com",
"smk762@iinet.net.au",
"smk@komodoplatform.com"
],
"socials": {
Expand Down Expand Up @@ -46,8 +46,8 @@
"gaeacodes": {
"username": "gaeacodes",
"commit_emails": [
"gaeacodes@gmail.com",
"77043250+gaeacodes@users.noreply.github.com"
"77043250+gaeacodes@users.noreply.github.com",
"gaeacodes@gmail.com"
],
"socials": {
"twitter": "",
Expand All @@ -73,12 +73,12 @@
"blue-santa": {
"username": "blue-santa",
"commit_emails": [
"33014953+siddhartha-crypto@users.noreply.github.com",
"siddhartha-crypto@protonmail.com",
"siddharthakomodo@gmail.com",
"33014953+siddhartha-crypto@users.noreply.github.com"
"siddharthakomodo@gmail.com"
],
"socials": {
"twitter": "",
"twitter": "bluesanta_io",
"linkedin": ""
},
"id": 33014953,
Expand Down Expand Up @@ -117,7 +117,7 @@
"saddam007@gmail.com"
],
"socials": {
"twitter": "",
"twitter": "techloverhd",
"linkedin": ""
},
"id": 8881040,
Expand All @@ -127,8 +127,8 @@
"Alrighttt": {
"username": "Alrighttt",
"commit_emails": [
"mzlot555@gmail.com",
"36680730+Alrighttt@users.noreply.github.com"
"36680730+Alrighttt@users.noreply.github.com",
"mzlot555@gmail.com"
],
"socials": {
"twitter": "",
Expand Down Expand Up @@ -170,7 +170,7 @@
"tlysakov@gmail.com"
],
"socials": {
"twitter": "",
"twitter": "mybrainforked",
"linkedin": ""
},
"id": 24797699,
Expand Down Expand Up @@ -222,7 +222,7 @@
"ca333@users.noreply.github.com"
],
"socials": {
"twitter": "",
"twitter": "0xca333",
"linkedin": ""
},
"id": 10762374,
Expand Down Expand Up @@ -378,7 +378,7 @@
"duke@leto.net"
],
"socials": {
"twitter": "",
"twitter": "dukeleto",
"linkedin": ""
},
"id": 30298,
Expand All @@ -404,10 +404,10 @@
"steve.huguenin-elie@protonmail.ch"
],
"socials": {
"twitter": "",
"twitter": "stevehugue",
"linkedin": ""
},
"id": 31395674,
"id": 7686916,
"avatar_url": "https://avatars.githubusercontent.com/u/7686916?v=4",
"image": "StEvUgnIn.jpeg"
},
Expand All @@ -417,10 +417,10 @@
"mihail@fedorov.net"
],
"socials": {
"twitter": "",
"twitter": "2mf",
"linkedin": ""
},
"id": 31395674,
"id": 2559459,
"avatar_url": "https://avatars.githubusercontent.com/u/2559459?v=4",
"image": "kolobus.jpeg"
},
Expand All @@ -433,15 +433,15 @@
"twitter": "",
"linkedin": ""
},
"id": 31395674,
"id": 5043201,
"avatar_url": "https://avatars.githubusercontent.com/u/5043201?v=4",
"image": "daemonfox.jpeg"
},
"laruh": {
"username": "laruh",
"commit_emails": [
"oblomoff616@gmail.com",
"laruh@users.noreply.github.com"
"laruh@users.noreply.github.com",
"oblomoff616@gmail.com"
],
"socials": {
"twitter": "",
Expand Down Expand Up @@ -476,5 +476,18 @@
"id": 30876243,
"avatar_url": "https://avatars.githubusercontent.com/u/30876243?v=4",
"image": "AndrewDelaney.jpeg"
},
"bsodmike": {
"username": "bsodmike",
"commit_emails": [
"michael@mwdesilva.com"
],
"socials": {
"twitter": "bsodmike",
"linkedin": ""
},
"id": 368260,
"avatar_url": "https://avatars.githubusercontent.com/u/368260?v=4",
"image": "bsodmike.jpeg"
}
}
6 changes: 5 additions & 1 deletion data-for-gpts/all-content.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57689,7 +57689,11 @@ cd ~
git clone https://github.com/KomodoPlatform/komodo-defi-framework --branch mm2.1 --single-branch && cd komodo-defi-framework
```

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

Compile the source code:

```bash
cargo build --features native -vv
Expand Down
6 changes: 5 additions & 1 deletion data-for-gpts/komodo-defi-framework-content.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25401,7 +25401,11 @@ cd ~
git clone https://github.com/KomodoPlatform/komodo-defi-framework --branch mm2.1 --single-branch && cd komodo-defi-framework
```

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

Compile the source code:

```bash
cargo build --features native -vv
Expand Down
Binary file modified preview-images/optimized/pre-komodo-defi-framework-setup.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified preview-images/original/pre-komodo-defi-framework-setup.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion preview-images/previewImgTimeStamps.json
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@
"/komodo-defi-framework/changelog": "2024-03-08T15:53:57.000Z",
"/komodo-defi-framework": "2024-04-11T16:31:02.000Z",
"/komodo-defi-framework/setup/configure-mm2-json": "2024-03-11T05:04:37.000Z",
"/komodo-defi-framework/setup": "2024-04-03T09:17:49.000Z",
"/komodo-defi-framework/setup": "2024-05-02T15:13:31.000Z",
"/komodo-defi-framework/tutorials/additional-information": "2024-03-08T15:53:57.000Z",
"/komodo-defi-framework/tutorials/api-docker-telegram": "2024-04-03T09:17:49.000Z",
"/komodo-defi-framework/tutorials/api-metrics": "2024-04-03T09:17:49.000Z",
Expand Down
Binary file added src/images/authors/bsodmike.jpeg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion src/pages/komodo-defi-framework/setup/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,11 @@ cd ~
git clone https://github.com/KomodoPlatform/komodo-defi-framework --branch mm2.1 --single-branch && cd komodo-defi-framework
```

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

Compile the source code:

```bash
cargo build --features native -vv
Expand Down
6 changes: 5 additions & 1 deletion utils/_fileData.json
Original file line number Diff line number Diff line change
Expand Up @@ -5252,12 +5252,16 @@
}
},
"/komodo-defi-framework/setup": {
"dateModified": "2024-04-03T09:17:49.000Z",
"dateModified": "2024-05-02T15:13:31.000Z",
"contributors": [
{
"name": "\"gcharang\"",
"email": "21151592+gcharang@users.noreply.github.com"
},
{
"name": "\"Michael de Silva\"",
"email": "michael@mwdesilva.com"
},
{
"name": "\"gaeacodes\"",
"email": "gaeacodes@gmail.com"
Expand Down
2 changes: 1 addition & 1 deletion utils/_searchIndex.json

Large diffs are not rendered by default.

92 changes: 59 additions & 33 deletions utils/js/get_file_author_data.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,57 +4,83 @@ import path from 'path';
import { spawnSync } from 'child_process';
const authorsData = JSON.parse(fs.readFileSync("./authors.json", 'utf8'));
const oldFileData = JSON.parse(fs.readFileSync("./utils/_fileData_old_documentation_mod.json", 'utf8'));
import dotenv from 'dotenv';
dotenv.config();

const fileData = {};

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

const latest100CommitsUrl = "https://api.github.com/repos/komodoplatform/komodo-docs-mdx/commits?sha=dev&per_page=100"

const userDataUrl = (login) => `https://api.github.com/users/${login}`

const options = {
headers: {
'User-Agent': 'komodo-docs-mdx-ci'
'User-Agent': 'komodo-docs-mdx-ci',
'Accept': 'application/vnd.github+json',
'X-GitHub-Api-Version': '2022-11-28',
'Authorization': `Bearer ${process.env.LOCAL_GH_TOKEN ?? process.env.GH_TOKEN}`
}
};

try {
const { response } = await httpsGet(allContributorsDataUrl, options)
const contributorData = JSON.parse(response)
for (const contributor of contributorData) {
if (!authorsData[contributor.login]) {
const { response } = await httpsGet(`https://api.github.com/repos/komodoplatform/komodo-docs-mdx/commits?author=${contributor.login}`, options)
const contributorCommits = JSON.parse(response)
console.log(contributorCommits)
const commit_emails = new Set();
contributorCommits.forEach(commit => {
if (commit.commit && commit.commit.author && commit.commit.author.email) {
commit_emails.add(commit.commit.author.email);
}
});
console.log(commit_emails)
authorsData[contributor.login] = {
username: contributor.login,
commit_emails: Array.from(commit_emails),
socials: {
twitter: "",
linkedin: ""
}
const { response: contributorsRes } = await httpsGet(allContributorsDataUrl, options)
const contributorData = JSON.parse(contributorsRes)
const { response: commitsRes } = await httpsGet(latest100CommitsUrl, options)
const commitData = JSON.parse(commitsRes)

const contributorLogins = new Set();
contributorData.forEach(contributor => contributorLogins.add(contributor.login))
commitData.forEach(commit => commit.author && contributorLogins.add(commit.author.login))
Object.values(authorsData).forEach(author => contributorLogins.add(author.username))
for (const contributorLogin of Array.from(contributorLogins)) {
const isMissingInContributorData = !Object.values(authorsData).find(author => author.username === contributorLogin) || !contributorData.find(contributor => contributor.login === contributorLogin)
console.log(contributorLogin)

const { response } = await httpsGet(`https://api.github.com/repos/komodoplatform/komodo-docs-mdx/commits?sha=dev&author=${contributorLogin}`, options)
const contributorCommits = JSON.parse(response)
const commit_emails = new Set();
contributorCommits.forEach(commit => {
if (commit.commit && commit.commit.author && commit.commit.author.email) {
commit_emails.add(commit.commit.author.email);
}
});

authorsData[contributorLogin]?.commit_emails.forEach(email => commit_emails.add(email))


authorsData[contributorLogin] = authorsData[contributorLogin] ?? {}

//console.log(commit_emails)
console.log(contributorLogin)

authorsData[contributorLogin].username = contributorLogin
authorsData[contributorLogin].commit_emails = Array.from(commit_emails).sort()
const authorSocials = authorsData[contributorLogin].socials

const { response: userDataRes } = await httpsGet(userDataUrl(contributorLogin), options)
const userData = JSON.parse(userDataRes)
console.log(userData)

authorsData[contributorLogin].socials = {
...authorSocials,
twitter: userData.twitter_username ?? authorSocials?.twitter ?? "",
linkedin: authorSocials?.linkedin ?? ""
}
authorsData[contributor.login].id = contributor.id
authorsData[contributor.login].avatar_url = contributor.avatar_url

authorsData[contributorLogin].id = userData.id
const imageUrl = userData.avatar_url
authorsData[contributorLogin].avatar_url = imageUrl
const imgName = await downloadImage(imageUrl, contributorLogin)
authorsData[contributorLogin].image = imgName
}
} catch (error) {
console.error(error);
console.error(error)
throw new Error(error)
}

for (const username in authorsData) {
const imageUrl = authorsData[username].avatar_url
const imgName = await downloadImage(imageUrl, username)
authorsData[username].image = imgName
}



fs.writeFileSync("authors.json", JSON.stringify(authorsData, null, 4))


Expand Down
13 changes: 13 additions & 0 deletions utils/js/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions utils/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"@sindresorhus/slugify": "^2.2.1",
"acorn": "^8.10.0",
"axios": "^1.6.7",
"dotenv": "^16.4.5",
"mdx-annotations": "^0.1.3",
"remark": "^14.0.3",
"remark-gfm": "^3.0.1",
Expand Down

0 comments on commit 723f0f3

Please sign in to comment.