Skip to content

Commit

Permalink
chore: merge branch 'antfu-collective-main'
Browse files Browse the repository at this point in the history
  • Loading branch information
StarHeartHunt committed May 3, 2024
2 parents 51ec2a2 + 4e46ba5 commit 6449047
Show file tree
Hide file tree
Showing 27 changed files with 4,294 additions and 3,530 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v2
uses: pnpm/action-setup@v3

- name: Set node
uses: actions/setup-node@v4
Expand Down
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export default defineConfig({

// Rendering configs
width: 800,
renderer: 'tiers' | 'circles',
formats: ['json', 'svg', 'png'],
tiers: [
// Past sponsors, currently only supports GitHub
Expand Down Expand Up @@ -119,14 +120,29 @@ const sponsors = await fetchSponsors(token, login)

Check the type definition or source code for more utils available.

## Sponsors
## Renderers

We provide two renderers built-in:

- `tiers`: Render sponsors in tiers.
- `circles`: Render sponsors in packed circles.

### Tiers Renderer

<p align="center">
<a href="https://cdn.jsdelivr.net/gh/antfu/static/sponsors.svg">
<img src='https://cdn.jsdelivr.net/gh/antfu/static/sponsors.svg'/>
</a>
</p>

### Circles Renderer

<p align="center">
<a href="https://cdn.jsdelivr.net/gh/antfu/static/sponsors.circles.svg">
<img src='https://cdn.jsdelivr.net/gh/antfu/static/sponsors.circles.svg'/>
</a>
</p>

## License

[MIT](./LICENSE) License © 2022 [Anthony Fu](https://github.com/antfu)
3 changes: 0 additions & 3 deletions bin/sponsorkit.js

This file was deleted.

2 changes: 2 additions & 0 deletions bin/sponsorkit.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env node
import '../dist/cli.mjs'
3 changes: 0 additions & 3 deletions build.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,4 @@ export default defineBuildConfig({
],
declaration: true,
clean: true,
rollup: {
emitCJS: true,
},
})
4 changes: 2 additions & 2 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const antfu = require('@antfu/eslint-config').default
import antfu from '@antfu/eslint-config'

module.exports = antfu({
export default antfu({
ignores: ['sponsorkit', '**/sponsorkit/**'],
})
6 changes: 4 additions & 2 deletions example/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{
"type": "module",
"private": true,
"scripts": {
"build": "sponsorkit"
"build": "@mooncellwiki/sponsorkit",
"build:dev": "esno ../src/cli.ts"
},
"devDependencies": {
"sponsorkit": "latest"
"@mooncellwiki/sponsorkit": "workspace:*"
}
}
30 changes: 25 additions & 5 deletions example/sponsor.config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { defineConfig, presets } from 'sponsorkit'
import { defineConfig, tierPresets } from 'sponsorkit'

export default defineConfig({
// includePrivate: true,
tiers: [
{
title: 'Past Sponsors',
monthlyDollars: -1,
preset: presets.xs,
preset: tierPresets.xs,
},
{
title: 'Backers',
Expand All @@ -20,7 +20,7 @@ export default defineConfig({
{
title: 'Sponsors',
monthlyDollars: 10,
preset: presets.medium,
preset: tierPresets.medium,
// to insert custom elements after the tier block
composeAfter: (composer, _tierSponsors, _config) => {
composer.addSpan(10)
Expand All @@ -29,12 +29,32 @@ export default defineConfig({
{
title: 'Silver Sponsors',
monthlyDollars: 50,
preset: presets.large,
preset: tierPresets.large,
},
{
title: 'Gold Sponsors',
monthlyDollars: 100,
preset: presets.xl,
preset: tierPresets.xl,
},
],

// Run multiple renders with different configurations
renders: [
{
name: 'sponsors',
width: 800,
formats: ['svg', 'png'],
},
{
name: 'sponsors-wide',
width: 1000,
formats: ['svg'],
},
{
renderer: 'circles',
name: 'sponsors-circles',
width: 1000,
includePastSponsors: true,
},
],
})
33 changes: 19 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"name": "@mooncellwiki/sponsorkit",
"type": "module",
"version": "0.10.1",
"packageManager": "pnpm@8.15.6",
"packageManager": "pnpm@9.0.6",
"description": "Toolkit for generating sponsors images",
"author": "StarHeartHunt <[email protected]>",
"license": "MIT",
Expand All @@ -21,15 +22,14 @@
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
"import": "./dist/index.mjs"
}
},
"main": "./dist/index.cjs",
"main": "./dist/index.mjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"bin": {
"sponsorkit": "./bin/sponsorkit.js"
"sponsorkit": "./bin/sponsorkit.mjs"
},
"files": [
"bin",
Expand All @@ -47,28 +47,33 @@
"dependencies": {
"consola": "^3.2.3",
"csv-parse": "^5.5.5",
"datauri": "^4.1.0",
"d3-hierarchy": "^3.1.2",
"dotenv": "^16.4.5",
"node-html-parser": "^6.1.13",
"ofetch": "^1.3.4",
"p-limit": "^5.0.0",
"picocolors": "^1.0.0",
"sharp": "^0.33.3",
"unconfig": "^0.3.12",
"unconfig": "^0.3.13",
"yargs": "^17.7.2"
},
"devDependencies": {
"@antfu/eslint-config": "^2.12.2",
"@antfu/eslint-config": "^2.16.1",
"@antfu/ni": "^0.21.12",
"@antfu/utils": "^0.7.7",
"@types/node": "^20.12.5",
"@types/d3-hierarchy": "^3.1.7",
"@types/node": "^20.12.8",
"@types/yargs": "^17.0.32",
"bumpp": "^9.4.0",
"eslint": "^8.57.0",
"bumpp": "^9.4.1",
"eslint": "^9.1.1",
"esno": "^4.7.0",
"jiti": "^1.21.0",
"typescript": "^5.4.4",
"typescript": "^5.4.5",
"unbuild": "^2.0.0",
"vite": "^5.2.8",
"vitest": "^1.4.0"
"vite": "^5.2.11",
"vitest": "^1.5.3"
},
"resolutions": {
"@mooncellwiki/sponsorkit": "workspace:*"
}
}
Loading

0 comments on commit 6449047

Please sign in to comment.