Skip to content

Commit 9154198

Browse files
committed
Update dev-dependencies
1 parent 145e8d2 commit 9154198

File tree

6 files changed

+101
-105
lines changed

6 files changed

+101
-105
lines changed

asset/big.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
width: calc(12.333 * (1em + 1ex));
1313
}
1414

15-
@media (min-width: 48.01em) {
15+
@media (width > 48em) {
1616
.readme {
1717
padding-left: calc(1em + 1ex);
1818
padding-right: calc(1em + 1ex);
@@ -102,7 +102,7 @@
102102
}
103103
}
104104

105-
@media (min-width: 62.01em) {
105+
@media (width > 62em) {
106106
.readme {
107107
padding-left: 0;
108108
padding-right: 0;

asset/index.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,7 @@ a.tag:focus .count {
828828
border-bottom-color: var(--gray-3);
829829
}
830830

831-
@media (max-width: 48em) {
831+
@media (width <= 48em) {
832832
.x-show-l {
833833
display: none;
834834
}

crawl/ecosystem.js

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -60,26 +60,25 @@ const main = promisify(
6060
.use(writeReadmes).run
6161
)
6262

63-
main({
64-
ghToken,
65-
npmToken,
66-
repos: [],
67-
topics: constantTopic,
68-
orgs: constantCollective
69-
}).then(
70-
(result) => {
71-
console.log(
72-
chalk.green('✓') + ' done (%d packages, %d projects, %d readmes)',
73-
result.packages.length,
74-
result.projects.length,
75-
result.readmes.length
76-
)
77-
},
78-
(error) => {
79-
console.log(chalk.red('✖') + ' error')
80-
throw error
81-
}
82-
)
63+
try {
64+
// @ts-expect-error: fine.
65+
const result = await main({
66+
ghToken,
67+
npmToken,
68+
repos: [],
69+
topics: constantTopic,
70+
orgs: constantCollective
71+
})
72+
console.log(
73+
chalk.green('✓') + ' done (%d packages, %d projects, %d readmes)',
74+
result.packages.length,
75+
result.projects.length,
76+
result.readmes.length
77+
)
78+
} catch (error) {
79+
console.log(chalk.red('✖') + ' error')
80+
throw error
81+
}
8382

8483
async function findProjectsByTopic(ctx) {
8584
const {topics, repos} = ctx
@@ -242,7 +241,6 @@ async function searchTopic(ctx) {
242241
`
243242

244243
while (!done) {
245-
// eslint-disable-next-line no-await-in-loop
246244
response = await fetch(ghEndpoint, {
247245
method: 'POST',
248246
body: JSON.stringify({
@@ -301,7 +299,6 @@ async function searchOrg(ctx) {
301299
`
302300

303301
while (!done) {
304-
// eslint-disable-next-line no-await-in-loop
305302
response = await fetch(ghEndpoint, {
306303
method: 'POST',
307304
body: JSON.stringify({query, variables: {org, after}}),

crawl/sponsors.js

Lines changed: 56 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -47,74 +47,73 @@ const query = `query($slug: String) {
4747
}
4848
`
4949

50-
Promise.all([
51-
fs.readFile(path.join('crawl', 'sponsors.txt')).then((d) =>
52-
String(d)
53-
.split('\n')
54-
.map((d) => {
55-
const spam = d.charAt(0) === '-'
56-
return {oc: spam ? d.slice(1) : d, spam}
57-
})
58-
),
50+
const [buf, response] = await Promise.all([
51+
fs.readFile(path.join('crawl', 'sponsors.txt')),
5952
fetch(endpoint, {
6053
method: 'POST',
6154
body: JSON.stringify({query, variables}),
6255
headers: {
6356
'Content-Type': 'application/json',
6457
'Api-Key': token
6558
}
66-
}).then((response) => response.json())
59+
})
6760
])
68-
.then(([control, response]) => {
69-
const seen = []
70-
const members = response.data.collective.members.nodes
71-
.map((d) => {
72-
const oc = d.account.slug
73-
const github = d.account.githubHandle || undefined
74-
const twitter = d.account.twitterHandle || undefined
75-
let url = d.account.website || undefined
76-
const info = control.find((d) => d.oc === oc)
77-
78-
if (url === ghBase + github || url === twBase + twitter) {
79-
url = undefined
80-
}
8161

82-
if (!info) {
83-
console.log(
84-
chalk.red('✖') +
85-
' @%s is an unknown sponsor, please define whether it’s spam or not in `sponsors.txt`',
86-
oc
87-
)
88-
}
62+
const control = String(buf)
63+
.split('\n')
64+
.map((d) => {
65+
const spam = d.charAt(0) === '-'
66+
return {oc: spam ? d.slice(1) : d, spam}
67+
})
68+
/** @type {any} */
69+
const json = await response.json()
8970

90-
return {
91-
spam: !info || info.spam,
92-
name: d.account.name,
93-
description: d.account.description || undefined,
94-
image: d.account.imageUrl,
95-
oc,
96-
github,
97-
twitter,
98-
url,
99-
gold:
100-
(d.tier && d.tier.name && /gold/i.test(d.tier.name)) || undefined,
101-
amount: d.totalDonations.value
102-
}
103-
})
104-
.filter((d) => {
105-
const ignore = d.spam || seen.includes(d.oc) // Ignore dupes in data.
106-
seen.push(d.oc)
107-
return d.amount > min && !ignore
108-
})
109-
.sort(sort)
110-
.map((d) => Object.assign(d, {amount: undefined}))
111-
112-
return fs.writeFile(
113-
outpath,
114-
'export const sponsors = ' + JSON.stringify(members, null, 2) + '\n'
115-
)
71+
const seen = []
72+
const members = json.data.collective.members.nodes
73+
.map((d) => {
74+
const oc = d.account.slug
75+
const github = d.account.githubHandle || undefined
76+
const twitter = d.account.twitterHandle || undefined
77+
let url = d.account.website || undefined
78+
const info = control.find((d) => d.oc === oc)
79+
80+
if (url === ghBase + github || url === twBase + twitter) {
81+
url = undefined
82+
}
83+
84+
if (!info) {
85+
console.log(
86+
chalk.red('✖') +
87+
' @%s is an unknown sponsor, please define whether it’s spam or not in `sponsors.txt`',
88+
oc
89+
)
90+
}
91+
92+
return {
93+
spam: !info || info.spam,
94+
name: d.account.name,
95+
description: d.account.description || undefined,
96+
image: d.account.imageUrl,
97+
oc,
98+
github,
99+
twitter,
100+
url,
101+
gold: (d.tier && d.tier.name && /gold/i.test(d.tier.name)) || undefined,
102+
amount: d.totalDonations.value
103+
}
104+
})
105+
.filter((d) => {
106+
const ignore = d.spam || seen.includes(d.oc) // Ignore dupes in data.
107+
seen.push(d.oc)
108+
return d.amount > min && !ignore
116109
})
117-
.catch(console.error)
110+
.sort(sort)
111+
.map((d) => Object.assign(d, {amount: undefined}))
112+
113+
await fs.writeFile(
114+
outpath,
115+
'export const sponsors = ' + JSON.stringify(members, null, 2) + '\n'
116+
)
118117

119118
function sort(a, b) {
120119
return b.amount - a.amount

crawl/team.js

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,16 @@ const headers = {Authorization: 'bearer ' + ghToken}
2020
const base = 'https://raw.githubusercontent.com/unifiedjs/collective/HEAD/data/'
2121
const files = ['humans.yml', 'teams.yml']
2222

23-
for (const filename of files)
24-
fetch(base + filename, {headers})
25-
.then((d) => d.text())
26-
.then((d) => {
27-
const stem = path.basename(filename, path.extname(filename))
28-
return fs.writeFile(
29-
path.join('data', stem + '.js'),
30-
'export const ' +
31-
stem +
32-
' = ' +
33-
JSON.stringify(yaml.load(d), null, 2) +
34-
'\n'
35-
)
36-
})
23+
for (const filename of files) {
24+
const response = await fetch(base + filename, {headers})
25+
const d = await response.text()
26+
const stem = path.basename(filename, path.extname(filename))
27+
await fs.writeFile(
28+
path.join('data', stem + '.js'),
29+
'export const ' +
30+
stem +
31+
' = ' +
32+
JSON.stringify(yaml.load(d), null, 2) +
33+
'\n'
34+
)
35+
}

package.json

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@
2020
"bytes": "^3.0.0",
2121
"chalk": "^5.0.0",
2222
"compute-mean": "^3.0.0",
23-
"cssnano": "^5.0.0",
24-
"cssnano-preset-advanced": "^5.0.0",
23+
"cssnano": "^6.0.0",
24+
"cssnano-preset-advanced": "^6.0.0",
2525
"d3-scale": "^4.0.0",
2626
"deepmerge": "^4.0.0",
2727
"dictionary-en": "^3.0.0",
2828
"dotenv": "^16.0.0",
29-
"esbuild": "^0.15.0",
29+
"esbuild": "^0.17.0",
3030
"flexsearch": "^0.7.0",
31-
"glob": "^8.0.0",
31+
"glob": "^9.0.0",
3232
"hast-util-find-and-replace": "^4.0.0",
3333
"hast-util-heading-rank": "^2.0.0",
3434
"hast-util-sanitize": "^4.0.0",
@@ -45,7 +45,7 @@
4545
"pick-random": "^4.0.0",
4646
"pluralize": "^8.0.0",
4747
"postcss": "^8.0.0",
48-
"postcss-preset-env": "^7.0.0",
48+
"postcss-preset-env": "^8.0.0",
4949
"prettier": "^2.0.0",
5050
"pretty-bytes": "^6.0.0",
5151
"random-useragent": "^0.5.0",
@@ -83,12 +83,12 @@
8383
"retext-spell": "^5.0.0",
8484
"retext-syntax-mentions": "^3.0.0",
8585
"retext-syntax-urls": "^3.0.0",
86-
"sharp": "^0.31.0",
86+
"sharp": "^0.32.0",
8787
"spdx-license-list": "^6.0.0",
8888
"strip-comments": "^2.0.0",
89-
"stylelint": "^14.0.0",
89+
"stylelint": "^15.0.0",
9090
"stylelint-config-prettier": "^9.0.0",
91-
"stylelint-config-standard": "^29.0.0",
91+
"stylelint-config-standard": "^32.0.0",
9292
"to-vfile": "^7.0.0",
9393
"trough": "^2.0.0",
9494
"unified": "^10.0.0",
@@ -97,7 +97,7 @@
9797
"vfile-mkdirp": "^3.0.0",
9898
"vfile-rename": "^2.0.0",
9999
"vfile-reporter": "^7.0.0",
100-
"xo": "^0.52.0"
100+
"xo": "^0.53.0"
101101
},
102102
"scripts": {
103103
"start": "budo --dir build",
@@ -124,6 +124,7 @@
124124
"prettier": true,
125125
"rules": {
126126
"complexity": "off",
127+
"no-await-in-loop": "off",
127128
"unicorn/no-array-callback-reference": "off",
128129
"unicorn/no-array-for-each": "off",
129130
"unicorn/no-array-reduce": "off"

0 commit comments

Comments
 (0)