Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: sync socials with github + add bluesky #1102

Merged
merged 3 commits into from
Nov 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/autofix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,7 @@ jobs:
cache: "pnpm"
- run: pnpm install
- name: Run sync
run: npm run sync
run: pnpm sync
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- uses: autofix-ci/action@ff86a557419858bb967097bfc916833f5647fa8c
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
branches:
- main

permissions:
contents: read

jobs:
ci:
runs-on: ubuntu-latest
Expand All @@ -28,6 +31,8 @@ jobs:

- name: Sync
run: pnpm sync
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Sync Status
run: git diff --exit-code
Expand Down
40 changes: 40 additions & 0 deletions lib/modules.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import process from 'node:process'
import { resolve, join, basename, extname } from 'node:path'
import { promises as fsp, existsSync } from 'node:fs'
import * as yml from 'js-yaml'
Expand All @@ -6,6 +7,7 @@ import defu from 'defu'
import pLimit from 'p-limit'
import { $fetch } from 'ofetch'
import { isCI } from 'std-env'
import { Octokit } from '@octokit/rest'
import { categories } from './categories'
import type { ModuleInfo } from './types'
import { fetchGithubPkg, modulesDir, distDir, distFile, rootDir } from './utils'
Expand Down Expand Up @@ -153,6 +155,44 @@ export async function sync(name: string, repo?: string, isNew: boolean = false)
}
}

if (process.env.GITHUB_TOKEN) {
console.log('Syncing maintainer socials with GitHub')
const client = new Octokit({ auth: `Bearer ${process.env.GITHUB_TOKEN}` })
for (const maintainer of mod.maintainers) {
const response = await client.graphql<{ user: { name: string, email: string, socialAccounts: { nodes: Array<{ displayName: string, provider: string, url: string }> } } }>({
query: `
query ($login: String!) {
user (login: $login) {
name
email
socialAccounts(first: 100) {
nodes {
displayName
provider
url
}
}
}
}`,
login: maintainer.github,
}).catch(() => null)

if (response) {
if (response.user.name) {
maintainer.name = response.user.name
}
for (const social of response.user.socialAccounts.nodes) {
if (social.provider === 'TWITTER') {
maintainer.twitter = social.displayName.replace(/^@/, '')
}
if (social.provider === 'BLUESKY') {
maintainer.bluesky = social.displayName.replace(/^@/, '')
}
}
}
}
}

// Default description
if (!mod.description) {
mod.description = pkg.description
Expand Down
1 change: 1 addition & 0 deletions lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export interface MaintainerInfo {
name: string
github: string
twitter?: string
bluesky?: string
}

export interface GithubContributor {
Expand Down
5 changes: 3 additions & 2 deletions modules/ackee.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ learn_more: https://ackee.electerious.com
category: Analytics
type: 3rd-party
maintainers:
- name: bdrtsky
- name: Serhii Bedrytskyi
github: bdrtsky
- name: Sebastien Chopin
- name: SΓ©bastien Chopin
github: Atinux
twitter: Atinux
bluesky: atinux.com
compatibility:
nuxt: ^2.0.0
requires: {}
1 change: 1 addition & 0 deletions modules/agility-cms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ maintainers:
github: joelvarty
avatar: >-
https://avatars.githubusercontent.com/u/4520625?s=400&u=95fcb09b5ead7bb09fb9950e4e7a115a8a4377e8&v=4
twitter: joelvarty
compatibility:
nuxt: ^2.0.0
requires: {}
1 change: 1 addition & 0 deletions modules/algolia.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ maintainers:
- name: Jakub Andrzejewski
github: Baroshem
avatar: https://avatars2.githubusercontent.com/u/37120330?v=4?s=80
twitter: jacobandrewsky
- name: Yasser Lahbibi
github: yassilah
avatar: https://avatars.githubusercontent.com/u/13403295?v=4
Expand Down
2 changes: 1 addition & 1 deletion modules/alias.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ learn_more: ''
category: Extensions
type: 3rd-party
maintainers:
- name: kdydesign
- name: Dev.DY
github: kdydesign
compatibility:
nuxt: ^2.0.0
Expand Down
2 changes: 1 addition & 1 deletion modules/amp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ learn_more: https://amp.dev/
category: Performance
type: community
maintainers:
- name: Ahad Birang
- name: Farnabaz
github: farnabaz
twitter: a_birang
compatibility:
Expand Down
3 changes: 2 additions & 1 deletion modules/animejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ learn_more: ''
category: Libraries
type: 3rd-party
maintainers:
- name: ivodolenc
- name: Ivo Dolenc
github: ivodolenc
twitter: ivodolenc
compatibility:
nuxt: ^2.0.0 || >=3.0.0
requires: {}
2 changes: 1 addition & 1 deletion modules/aos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ learn_more: ''
category: Libraries
type: 3rd-party
maintainers:
- name: egidiusmengelberg
- name: Egidius Mengelberg
github: egidiusmengelberg
compatibility:
nuxt: '>=3.0.0'
Expand Down
1 change: 1 addition & 0 deletions modules/api-shield.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ type: 3rd-party
maintainers:
- name: rrd
github: rrd108
twitter: radharadhya
compatibility:
nuxt: '>=3.0.0'
requires: {}
2 changes: 1 addition & 1 deletion modules/apollo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ type: community
maintainers:
- name: Conrawl Rogers
github: diizzayy
twitter: diizzayy
twitter: Diizzayy
avatar: https://avatars.githubusercontent.com/diizzayy?v=4
compatibility:
nuxt: ^2.0.0 || >=3.0.0
Expand Down
3 changes: 2 additions & 1 deletion modules/appwrite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ learn_more: ''
category: Database
type: 3rd-party
maintainers:
- name: Hrdtr
- name: Herdi Tr.
github: Hrdtr
twitter: hrdtr_
compatibility:
nuxt: '>=3.0.0'
requires: {}
3 changes: 2 additions & 1 deletion modules/arco-design-nuxt-module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ learn_more: https://github.com/wiidede/arco-design-nuxt-module#readme
category: UI
type: 3rd-party
maintainers:
- name: wiidede
- name: ε°ηš„ηš„ DeDe
github: wiidede
twitter: wiixdede
compatibility:
nuxt: '>=3.0.0'
requires: {}
2 changes: 1 addition & 1 deletion modules/artivue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ learn_more: https://github.com/Eschricht/artivue
category: UI
type: 3rd-party
maintainers:
- name: Eschricht
- name: Johannes Eschricht
github: Eschricht
compatibility:
nuxt: '>=3.0.0'
Expand Down
4 changes: 3 additions & 1 deletion modules/auth-utils.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ learn_more: ''
category: Security
type: 3rd-party
maintainers:
- name: atinux
- name: SΓ©bastien Chopin
github: atinux
twitter: Atinux
bluesky: atinux.com
compatibility:
nuxt: '>=3.0.0'
requires: {}
1 change: 1 addition & 0 deletions modules/auth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ maintainers:
- name: Pooya Parsa
github: pi0
twitter: _pi0_
bluesky: pi0.io
- name: JoΓ£o Pedro Antunes Silva
github: JoaoPedroAS51
compatibility:
Expand Down
2 changes: 1 addition & 1 deletion modules/authjs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ learn_more: https://authjs.dev/
category: Security
type: 3rd-party
maintainers:
- name: Hebilicious
- name: Heb
github: Hebilicious
twitter: its_hebilicious
compatibility:
Expand Down
3 changes: 2 additions & 1 deletion modules/authorization.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ learn_more: https://soubiran.dev/posts/nuxt-going-full-stack-how-to-handle-autho
category: Security
type: 3rd-party
maintainers:
- name: EstΓ©ban Soubiran
- name: EstΓ©ban
github: barbapapazes
twitter: soubiran_
bluesky: soubiran.dev
compatibility:
nuxt: '>=3.0.0'
requires: {}
1 change: 1 addition & 0 deletions modules/axios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ maintainers:
- name: Pooya Parsa
github: pi0
twitter: _pi0_
bluesky: pi0.io
compatibility:
nuxt: ^2.0.0
requires: {}
3 changes: 2 additions & 1 deletion modules/basic-auth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ learn_more: ''
category: Security
type: 3rd-party
maintainers:
- name: potato4d
- name: Takuma HANATANI
github: potato4d
twitter: potato4d
compatibility:
nuxt: ^2.0.0
requires: {}
1 change: 1 addition & 0 deletions modules/bootstrap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ maintainers:
- name: Pooya Parsa
github: pi0
twitter: _pi0_
bluesky: pi0.io
- name: Jacob MΓΌller
github: jackmu95
twitter: jackmu95
Expand Down
1 change: 1 addition & 0 deletions modules/browserconfig.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ maintainers:
- name: Pooya Parsa
github: pi0
twitter: _pi0_
bluesky: pi0.io
compatibility:
nuxt: ^2.0.0
requires: {}
1 change: 1 addition & 0 deletions modules/buefy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ type: 3rd-party
maintainers:
- name: Walter Tommasi
github: jtommy
twitter: walter_tommasi
compatibility:
nuxt: ^2.0.0
requires: {}
2 changes: 1 addition & 1 deletion modules/bugsnag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ learn_more: https://www.bugsnag.com/
category: Monitoring
type: 3rd-party
maintainers:
- name: JulianMar
- name: Julian Martin
github: JulianMar
twitter: julian_martin96
compatibility:
Expand Down
2 changes: 1 addition & 1 deletion modules/bulma-slim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ learn_more: https://bulma.io/
category: UI
type: 3rd-party
maintainers:
- name: mustardamus
- name: Sebastian Senf
github: mustardamus
compatibility:
nuxt: ^2.0.0
Expand Down
4 changes: 3 additions & 1 deletion modules/capo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ learn_more: ''
category: Performance
type: 3rd-party
maintainers:
- name: danielroe
- name: Daniel Roe
github: danielroe
twitter: danielcroe
bluesky: danielroe.dev
compatibility:
nuxt: '>=3.0.0'
requires: {}
3 changes: 2 additions & 1 deletion modules/chatwoot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ learn_more: https://www.chatwoot.com
category: Libraries
type: 3rd-party
maintainers:
- name: productdevbook
- name: Mehmet
github: productdevbook
twitter: productdevbook
compatibility:
nuxt: '>=3.0.0'
requires: {}
3 changes: 2 additions & 1 deletion modules/clarity-analytics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ learn_more: https://clarity.microsoft.com/
category: Analytics
type: 3rd-party
maintainers:
- name: Barbapapazes
- name: EstΓ©ban
github: Barbapapazes
twitter: soubiran_
bluesky: soubiran.dev
compatibility:
nuxt: '>=3.0.0'
requires: {}
3 changes: 2 additions & 1 deletion modules/client-init.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ learn_more: ''
category: Extensions
type: 3rd-party
maintainers:
- name: potato4d
- name: Takuma HANATANI
github: potato4d
twitter: potato4d
compatibility:
nuxt: ^2.0.0
requires: {}
3 changes: 2 additions & 1 deletion modules/cloudflare-analytics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ learn_more: https://www.cloudflare.com/web-analytics/
category: Analytics
type: 3rd-party
maintainers:
- name: hamlogic
- name: 0xHam
github: hamlogic
twitter: hamlogic
- name: Fabian B.
github: madebyfabian
twitter: madebyfabian
Expand Down
1 change: 1 addition & 0 deletions modules/cloudinary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ maintainers:
- name: Maya Shavin
github: mayashavin
twitter: MayaShavin
bluesky: mayashavin.com
compatibility:
nuxt: ^2.0.0
requires: {}
1 change: 1 addition & 0 deletions modules/color-mode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ maintainers:
- name: SΓ©bastien Chopin
github: Atinux
twitter: Atinux
bluesky: atinux.com
compatibility:
nuxt: ^2.0.0 || >=3.0.0
requires:
Expand Down
1 change: 1 addition & 0 deletions modules/component-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ maintainers:
- name: Pooya Parsa
github: pi0
twitter: _pi0_
bluesky: pi0.io
compatibility:
nuxt: ^2.0.0
requires: {}
Loading