Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
atinux authored Jan 17, 2025
2 parents 7eb0b35 + 74d9f0e commit 522271c
Show file tree
Hide file tree
Showing 29 changed files with 1,863 additions and 1,290 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/autofix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 20
node-version: lts/*
cache: "pnpm"

- run: pnpm install
Expand All @@ -27,4 +27,4 @@ jobs:
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

- uses: autofix-ci/action@ff86a557419858bb967097bfc916833f5647fa8c
- uses: autofix-ci/action@551dded8c6cc8a1054039c8bc0b8b48c51dfc6ef
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 20
node-version: lts/*
cache: "pnpm"

- run: pnpm install
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: ci
name: release

on:
push:
Expand All @@ -12,14 +12,14 @@ permissions:
contents: read

jobs:
ci:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 20
node-version: lts/*
cache: "pnpm"
- run: pnpm install

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Field Name | Auto sync | Description
`description` | Yes | Short description
`repo` | No | GitHub repository. Format is `org/name` or `org/name#main/path`
`npm` | Yes | NPM package name
`icon` | No | Icon of module from [./website/public/icons](./website/public/icons) directory
`icon` | No | Icon of module from [./icons](./icons) directory
`github` | No | GitHub URL
`website` | No | Website URL
`learn_more` | No | Link to learn more (website or relevant integration website)
Expand Down
Binary file added icons/nuxt-glaze.png
Loading
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 icons/onyx.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 29 additions & 20 deletions lib/modules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,16 @@ import pLimit from 'p-limit'
import { $fetch } from 'ofetch'
import { isCI } from 'std-env'
import { Octokit } from '@octokit/rest'
import dotenv from 'dotenv'

import { categories } from './categories'
import type { ModuleInfo } from './types'
import { fetchGithubPkg, modulesDir, distDir, distFile, rootDir } from './utils'

const maintainerSocialCache: Record<string, null | { user: { name: string, email: string, socialAccounts: { nodes: Array<{ displayName: string, provider: string, url: string }> } } }> = {}

dotenv.config()

export async function sync(name: string, repo?: string, isNew: boolean = false) {
const mod = await getModule(name)

Expand Down Expand Up @@ -156,32 +162,35 @@ 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
if (!(maintainer.github in maintainerSocialCache)) {
console.log('Syncing maintainer socials with GitHub')
maintainerSocialCache[maintainer.github] = 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)
}`,
login: maintainer.github,
}).catch(() => null)
}

if (response) {
if (response.user.name) {
maintainer.name = response.user.name
const user = maintainerSocialCache[maintainer.github]?.user
if (user) {
if (user.name) {
maintainer.name = user.name
}
for (const social of response.user.socialAccounts.nodes) {
for (const social of user.socialAccounts.nodes) {
if (social.provider === 'TWITTER') {
maintainer.twitter = social.displayName.replace(/^@/, '')
}
Expand Down
4 changes: 2 additions & 2 deletions lib/version.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'node:path'
import { promises as fsp } from 'node:fs'
import hasha from 'hasha'
import { hashFile } from 'hasha'
import { rootDir, distFile } from './utils'
import { build } from './modules'

Expand All @@ -10,7 +10,7 @@ export async function version() {
const pkgFile = path.resolve(rootDir, 'package.json')
const pkg = JSON.parse(await fsp.readFile(pkgFile, 'utf8'))

const hash = hasha(await fsp.readFile(distFile, 'utf8')).substr(0, 6)
const hash = await hashFile(distFile).then(r => r.substr(0, 6))

pkg.version = pkg.version.split('-')[0] + '-' + hash

Expand Down
2 changes: 1 addition & 1 deletion modules/chatwoot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ learn_more: https://www.chatwoot.com
category: Libraries
type: 3rd-party
maintainers:
- name: Mehmet
- name: Dev
github: productdevbook
twitter: productdevbook
compatibility:
Expand Down
1 change: 1 addition & 0 deletions modules/contentstack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ maintainers:
github: timbenniks
twitter: timbenniks
avatar: https://avatars.githubusercontent.com/u/121096
bluesky: timbenniks.dev
compatibility:
nuxt: ^3.12.0
requires: {}
2 changes: 1 addition & 1 deletion modules/feed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ category: SEO
type: community
maintainers:
- name: Alexander Lichter
github: manniL
github: TheAlexLichter
twitter: TheAlexLichter
bluesky: thealexlichter.com
compatibility:
Expand Down
2 changes: 1 addition & 1 deletion modules/google-adsense.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ category: Analytics
type: community
maintainers:
- name: Alexander Lichter
github: manniL
github: TheAlexLichter
bluesky: thealexlichter.com
twitter: TheAlexLichter
- name: Troy Morehouse
Expand Down
1 change: 1 addition & 0 deletions modules/google-analytics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ maintainers:
- name: Matteo Gabriele
github: MatteoGabriele
twitter: matteo_gabriele
bluesky: matteogabriele.bsky.social
compatibility:
nuxt: ^2.0.0
requires: {}
4 changes: 2 additions & 2 deletions modules/inkline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: inkline
description: >-
Nuxt Module for Inkline, the intuitive UI UX DX Components library for Vue.js
3 Design Systems.
repo: inkline/inkline#main/packages/integrations/plugin
npm: '@inkline/plugin'
repo: inkline/inkline#main/packages/integrations/nuxt
npm: '@inkline/nuxt'
icon: inkline.svg
github: https://github.com/inkline/inkline
website: https://inkline.io
Expand Down
2 changes: 1 addition & 1 deletion modules/netlify-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ category: Deployment
type: community
maintainers:
- name: Alexander Lichter
github: manniL
github: TheAlexLichter
twitter: TheAlexLichter
bluesky: thealexlichter.com
compatibility:
Expand Down
16 changes: 16 additions & 0 deletions modules/nuxt-glaze.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: nuxt-glaze
description: Glaze.dev module for Nuxt
repo: holux-design/nuxt-glaze
npm: nuxt-glaze
icon: nuxt-glaze.png
github: https://github.com/holux-design/nuxt-glaze
website: https://glaze.dev
learn_more: ''
category: Libraries
type: 3rd-party
maintainers:
- name: Lukas Hofstätter
github: holux-design
compatibility:
nuxt: '>=3.0.0'
requires: {}
16 changes: 16 additions & 0 deletions modules/nuxt-prisma-devtools
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: nuxt-prisma-devtools
description: `nuxt-prisma-devtools` integrates Prisma Studio into Nuxt DevTools, without having to use nuxt-prisma. This is useful if you've manually integrated Prisma into Nuxt (or are using a wrapper like Zenstack).
repo: gsxdsm/nuxt-prisma-devtools
npm: nuxt-prisma-devtools
icon: ''
github: https://github.com/gsxdsm/nuxt-prisma-devtools
website: https://www.npmjs.com/package/nuxt-prisma-devtools
learn_more: ''
category: Devtools
type: community
maintainers:
- name: gsxdsm
github: gsxdsm
compatibility:
nuxt: >=3.0.0
requires: {}
1 change: 1 addition & 0 deletions modules/nuxt-svgo-loader.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ maintainers:
- name: Alex Liu
github: Mini-ghost
twitter: Minighost_Alex
bluesky: mini-ghost.bsky.social
compatibility:
nuxt: '>=3.0.0'
requires: {}
Expand Down
2 changes: 1 addition & 1 deletion modules/oku-primitives.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ maintainers:
- name: Валентин Степанов
github: teleskop150750
twitter: teleskop150750
- name: Mehmet
- name: Dev
github: productdevbook
twitter: productdevbook
compatibility:
Expand Down
2 changes: 1 addition & 1 deletion modules/pergel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ learn_more: ''
category: Devtools
type: 3rd-party
maintainers:
- name: Mehmet
- name: Dev
github: productdevbook
twitter: productdevbook
compatibility:
Expand Down
2 changes: 1 addition & 1 deletion modules/redirect.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ category: SEO
type: community
maintainers:
- name: Alexander Lichter
github: manniL
github: TheAlexLichter
twitter: TheAlexLichter
bluesky: thealexlichter.com
compatibility:
Expand Down
2 changes: 1 addition & 1 deletion modules/separate-env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ category: Extensions
type: community
maintainers:
- name: Alexander Lichter
github: manniL
github: TheAlexLichter
twitter: TheAlexLichter
bluesky: thealexlichter.com
compatibility:
Expand Down
1 change: 1 addition & 0 deletions modules/strapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ maintainers:
- name: Benjamin Canac
github: benjamincanac
twitter: benjamincanac
bluesky: benjamincanac.dev
- name: Sébastien Chopin
github: Atinux
twitter: Atinux
Expand Down
2 changes: 1 addition & 1 deletion modules/style-resources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ category: CSS
type: community
maintainers:
- name: Alexander Lichter
github: manniL
github: TheAlexLichter
twitter: TheAlexLichter
bluesky: thealexlichter.com
compatibility:
Expand Down
2 changes: 1 addition & 1 deletion modules/svg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ learn_more: ''
category: Extensions
type: community
maintainers:
- name: Brooke
- name: Brooke Holmes
github: sam3d
compatibility:
nuxt: ^2.0.0
Expand Down
1 change: 1 addition & 0 deletions modules/ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ maintainers:
- name: Benjamin Canac
github: benjamincanac
twitter: benjamincanac
bluesky: benjamincanac.dev
- name: Sébastien Chopin
github: Atinux
twitter: Atinux
Expand Down
1 change: 1 addition & 0 deletions modules/vaxee.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ type: 3rd-party
maintainers:
- name: Valerii Strilets
github: letstri
twitter: letstri
compatibility:
nuxt: ^3.0.0
requires: {}
33 changes: 18 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,23 @@
"test": "pnpm lint && pnpm sync"
},
"devDependencies": {
"@nuxt/eslint-config": "^0.3.10",
"@octokit/rest": "^21.0.2",
"@types/js-yaml": "^4.0.5",
"@types/node": "^18.17.15",
"defu": "^6.1.2",
"eslint": "^9.2.0",
"globby": "^13.2.2",
"hasha": "^5.2.2",
"jiti": "^1.20.0",
"@nuxt/eslint-config": "^0.7.5",
"@octokit/rest": "^21.1.0",
"@types/js-yaml": "^4.0.9",
"@types/node": "^18.19.70",
"defu": "^6.1.4",
"eslint": "^9.18.0",
"globby": "^14.0.2",
"hasha": "^6.0.0",
"jiti": "^2.4.2",
"js-yaml": "^4.1.0",
"ofetch": "^1.3.3",
"p-limit": "^6.1.0",
"std-env": "^3.7.0",
"typescript": "^5.2.2"
"ofetch": "^1.4.1",
"p-limit": "^6.2.0",
"std-env": "^3.8.0",
"typescript": "^5.7.3"
},
"packageManager": "pnpm@8.7.4"
}
"packageManager": "pnpm@9.15.3",
"dependencies": {
"dotenv": "^16.4.7"
}
}
Loading

0 comments on commit 522271c

Please sign in to comment.