Skip to content

Commit 6bb1497

Browse files
committed
chore: Run formatter
1 parent 6300209 commit 6bb1497

File tree

81 files changed

+2737
-2342
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+2737
-2342
lines changed

astro.config.mjs

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,14 @@ import rehypeTableWrapper from "./src/rehype/rehype-table-wrapper";
1212

1313
const require = createRequire(import.meta.url);
1414

15-
const grainLang = JSON.parse(fs.readFileSync("./grain-language-server/editor-extensions/vscode/syntaxes/grain.json"));
16-
const theme = JSON.parse(fs.readFileSync("./themes/github-dark-modified-lighter.json"));
15+
const grainLang = JSON.parse(
16+
fs.readFileSync(
17+
"./grain-language-server/editor-extensions/vscode/syntaxes/grain.json",
18+
),
19+
);
20+
const theme = JSON.parse(
21+
fs.readFileSync("./themes/github-dark-modified-lighter.json"),
22+
);
1723

1824
// https://astro.build/config
1925
export default defineConfig({
@@ -48,23 +54,20 @@ export default defineConfig({
4854
},
4955
build: {
5056
target: "esnext",
51-
}
57+
},
5258
},
5359

5460
integrations: [tailwind(), svelte()],
5561

5662
redirects: {
5763
"/docs": "/docs/intro",
58-
"/docs/guide": "/docs/guide/basics"
64+
"/docs/guide": "/docs/guide/basics",
5965
},
6066

6167
markdown: {
6268
rehypePlugins: [
6369
rehypeSlug,
64-
[
65-
rehypeAutolinkHeadings,
66-
rehypeAutolinkHeadingsConfig,
67-
],
70+
[rehypeAutolinkHeadings, rehypeAutolinkHeadingsConfig],
6871
rehypeContentIntroTextTransformer,
6972
rehypeTableWrapper,
7073
],
@@ -75,10 +78,10 @@ export default defineConfig({
7578
code(node) {
7679
// Hack to distinguish block code from inline code in tailwind-typography
7780
node.properties["data-block"] = "true";
78-
}
79-
}
81+
},
82+
},
8083
],
81-
langs: [{...grainLang, name: "grain"}]
82-
}
84+
langs: [{ ...grainLang, name: "grain" }],
85+
},
8386
},
8487
});

netlify/functions/mailing-list-unsubscribe.mts

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,32 +29,47 @@ export default async (req: Request, context: Context) => {
2929
}
3030

3131
try {
32-
const allForms = await fetch(`https://api.netlify.com/api/v1/sites/${siteId}/forms`, {
33-
headers: { Authorization: `Bearer ${apiKey}` },
34-
}).then(res => res.json());
32+
const allForms = await fetch(
33+
`https://api.netlify.com/api/v1/sites/${siteId}/forms`,
34+
{
35+
headers: { Authorization: `Bearer ${apiKey}` },
36+
},
37+
).then((res) => res.json());
3538

36-
const eligibleMailingListForms = allForms.filter((form: any) => form.name === MAILING_LIST_FORM_NAME);
39+
const eligibleMailingListForms = allForms.filter(
40+
(form: any) => form.name === MAILING_LIST_FORM_NAME,
41+
);
3742
if (eligibleMailingListForms.length !== 1) {
38-
console.log(`Found ${eligibleMailingListForms.length} mailing list forms`);
39-
return new Response("Unexpectedly found multiple mailing list sign up forms", { status: 500 });
43+
console.log(
44+
`Found ${eligibleMailingListForms.length} mailing list forms`,
45+
);
46+
return new Response(
47+
"Unexpectedly found multiple mailing list sign up forms",
48+
{ status: 500 },
49+
);
4050
}
4151

4252
const mailingListFormId = eligibleMailingListForms[0].id;
4353

44-
const mailingListSubmissions = await fetch(`https://api.netlify.com/api/v1/forms/${mailingListFormId}/submissions`, {
45-
headers: { Authorization: `Bearer ${apiKey}` },
46-
}).then(res => res.json());
54+
const mailingListSubmissions = await fetch(
55+
`https://api.netlify.com/api/v1/forms/${mailingListFormId}/submissions`,
56+
{
57+
headers: { Authorization: `Bearer ${apiKey}` },
58+
},
59+
).then((res) => res.json());
4760

48-
const matchedSubmissions = mailingListSubmissions
49-
.filter((submission: any) => submission.data.email?.trim()?.toUpperCase() === email);
61+
const matchedSubmissions = mailingListSubmissions.filter(
62+
(submission: any) =>
63+
submission.data.email?.trim()?.toUpperCase() === email,
64+
);
5065

5166
await Promise.all(
5267
matchedSubmissions.map((submission: any) =>
5368
fetch(`https://api.netlify.com/api/v1/submissions/${submission.id}`, {
5469
method: "DELETE",
5570
headers: { Authorization: `Bearer ${apiKey}` },
56-
})
57-
)
71+
}),
72+
),
5873
);
5974

6075
return new Response("Success");

public/fonts/LeagueMono/OFL.md

Lines changed: 25 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,11 @@
66

77
Version 1.1 - 26 February 2007
88

9-
----
9+
---
1010

11-
SIL Open Font License
12-
=====================
11+
# SIL Open Font License
1312

14-
15-
Preamble
16-
--------
13+
## Preamble
1714

1815
The goals of the Open Font License (OFL) are to stimulate worldwide
1916
development of collaborative font projects, to support the font creation
@@ -23,15 +20,14 @@ with others.
2320

2421
The OFL allows the licensed fonts to be used, studied, modified and
2522
redistributed freely as long as they are not sold by themselves. The
26-
fonts, including any derivative works, can be bundled, embedded,
23+
fonts, including any derivative works, can be bundled, embedded,
2724
redistributed and/or sold with any software provided that any reserved
2825
names are not used by derivative works. The fonts and derivatives,
2926
however, cannot be released under any other type of license. The
3027
requirement for fonts to remain under this license does not apply
3128
to any document created using the fonts or their derivatives.
3229

33-
Definitions
34-
-----------
30+
## Definitions
3531

3632
`"Font Software"` refers to the set of files released by the Copyright
3733
Holder(s) under this license and clearly marked as such. This may
@@ -51,49 +47,46 @@ new environment.
5147
`"Author"` refers to any designer, engineer, programmer, technical
5248
writer or other person who contributed to the Font Software.
5349

54-
Permission & Conditions
55-
-----------------------
50+
## Permission & Conditions
5651

5752
Permission is hereby granted, free of charge, to any person obtaining
5853
a copy of the Font Software, to use, study, copy, merge, embed, modify,
5954
redistribute, and sell modified and unmodified copies of the Font
6055
Software, subject to the following conditions:
6156

6257
1. Neither the Font Software nor any of its individual components,
63-
in Original or Modified Versions, may be sold by itself.
58+
in Original or Modified Versions, may be sold by itself.
6459

6560
2. Original or Modified Versions of the Font Software may be bundled,
66-
redistributed and/or sold with any software, provided that each copy
67-
contains the above copyright notice and this license. These can be
68-
included either as stand-alone text files, human-readable headers or
69-
in the appropriate machine-readable metadata fields within text or
70-
binary files as long as those fields can be easily viewed by the user.
61+
redistributed and/or sold with any software, provided that each copy
62+
contains the above copyright notice and this license. These can be
63+
included either as stand-alone text files, human-readable headers or
64+
in the appropriate machine-readable metadata fields within text or
65+
binary files as long as those fields can be easily viewed by the user.
7166

7267
3. No Modified Version of the Font Software may use the Reserved Font
73-
Name(s) unless explicit written permission is granted by the corresponding
74-
Copyright Holder. This restriction only applies to the primary font name as
75-
presented to the users.
68+
Name(s) unless explicit written permission is granted by the corresponding
69+
Copyright Holder. This restriction only applies to the primary font name as
70+
presented to the users.
7671

7772
4. The name(s) of the Copyright Holder(s) or the Author(s) of the Font
78-
Software shall not be used to promote, endorse or advertise any
79-
Modified Version, except to acknowledge the contribution(s) of the
80-
Copyright Holder(s) and the Author(s) or with their explicit written
81-
permission.
73+
Software shall not be used to promote, endorse or advertise any
74+
Modified Version, except to acknowledge the contribution(s) of the
75+
Copyright Holder(s) and the Author(s) or with their explicit written
76+
permission.
8277

8378
5. The Font Software, modified or unmodified, in part or in whole,
84-
must be distributed entirely under this license, and must not be
85-
distributed under any other license. The requirement for fonts to
86-
remain under this license does not apply to any document created
87-
using the Font Software.
79+
must be distributed entirely under this license, and must not be
80+
distributed under any other license. The requirement for fonts to
81+
remain under this license does not apply to any document created
82+
using the Font Software.
8883

89-
Termination
90-
-----------
84+
## Termination
9185

9286
This license becomes null and void if any of the above conditions are
9387
not met.
9488

95-
Disclaimer
96-
----------
89+
## Disclaimer
9790

9891
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
9992
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF

scripts/cli.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ async function collectGrainFiles(...segments) {
2424
dirent.name.replace(".gr", ""),
2525
];
2626
const contents = await fs.readFile(
27-
path.join(stdlibDir, ...segments, dirent.name)
27+
path.join(stdlibDir, ...segments, dirent.name),
2828
);
2929
const importIdent = contents.toString().match(/.*?^module\s+(\w+)/m)[1];
3030
const filepathSegment = importPathSegments.join("/");

scripts/generateContributors.js

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,33 @@ async function generateContributors() {
1313

1414
const repoContributions = await Promise.all(
1515
repos
16-
.filter(repo => !repo.fork)
17-
.map(repo => octokit.paginate(octokit.rest.repos.listContributors, {
18-
owner: "grain-lang",
19-
repo: repo.name,
20-
per_page: 100,
21-
}))
16+
.filter((repo) => !repo.fork)
17+
.map((repo) =>
18+
octokit.paginate(octokit.rest.repos.listContributors, {
19+
owner: "grain-lang",
20+
repo: repo.name,
21+
per_page: 100,
22+
}),
23+
),
2224
);
23-
25+
2426
const contributionsFlattened = repoContributions.flat();
2527

26-
const groupedByLogin = Object.groupBy(contributionsFlattened, c => c.login);
27-
const results = Object.entries(groupedByLogin).map(([login, contributionInfos]) => ({
28-
login,
29-
profileUrl: contributionInfos[0].html_url,
30-
avatarUrl: contributionInfos[0].avatar_url,
31-
count: contributionInfos.reduce((acc, c) => acc + c.contributions, 0)
32-
}))
28+
const groupedByLogin = Object.groupBy(contributionsFlattened, (c) => c.login);
29+
const results = Object.entries(groupedByLogin).map(
30+
([login, contributionInfos]) => ({
31+
login,
32+
profileUrl: contributionInfos[0].html_url,
33+
avatarUrl: contributionInfos[0].avatar_url,
34+
count: contributionInfos.reduce((acc, c) => acc + c.contributions, 0),
35+
}),
36+
);
3337

3438
const cwd = path.dirname(url.fileURLToPath(import.meta.url));
35-
await fs.writeFile(path.join(cwd, "..", "contributors.json"), JSON.stringify(results, undefined, 4));
39+
await fs.writeFile(
40+
path.join(cwd, "..", "contributors.json"),
41+
JSON.stringify(results, undefined, 4),
42+
);
3643
}
3744

3845
await generateContributors();

src/blogAuthors.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,19 @@ export interface AuthorInfo {
1414
}
1515

1616
export const authorInfoByName: Record<BlogAuthor, AuthorInfo> = {
17-
"Oscar Spencer": { blueskyProfile: "ospencer.dev", githubProfile: "ospencer", headshot: oscarHeadshot },
17+
"Oscar Spencer": {
18+
blueskyProfile: "ospencer.dev",
19+
githubProfile: "ospencer",
20+
headshot: oscarHeadshot,
21+
},
1822
"Philip Blair": { githubProfile: "peblair", headshot: philipHeadshot },
19-
"Blaine Bublitz": { mastodonLink: "https://fosstodon.org/@phated", githubProfile: "phated", headshot: blaineHeadshot },
20-
"Marcus Roberts": { githubProfile: "marcusroberts", headshot: marcusHeadshot },
23+
"Blaine Bublitz": {
24+
mastodonLink: "https://fosstodon.org/@phated",
25+
githubProfile: "phated",
26+
headshot: blaineHeadshot,
27+
},
28+
"Marcus Roberts": {
29+
githubProfile: "marcusroberts",
30+
headshot: marcusHeadshot,
31+
},
2132
};

src/components/BlogAuthor.astro

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,13 @@ const { entry, imgClass, nameClass, dateClass } = Astro.props;
2323
<div class="w-fit">
2424
<p class={`whitespace-nowrap ${nameClass ?? ""}`}>{entry.data.author}</p>
2525
<p class={`text-color-dim ${dateClass ?? ""}`}>
26-
{entry.data.date.toLocaleDateString(undefined, { month: "short", day: "numeric", year: "numeric" })}
26+
{
27+
entry.data.date.toLocaleDateString(undefined, {
28+
month: "short",
29+
day: "numeric",
30+
year: "numeric",
31+
})
32+
}
2733
</p>
2834
</div>
2935
</div>

src/components/BlogEntries.astro

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
import type { CollectionEntry } from "astro:content"
2+
import type { CollectionEntry } from "astro:content";
33
import BlogThumbnail from "./BlogThumbnail.astro";
44
import NewsletterSignup from "./NewsletterSignup.astro";
55
import GrainLogo from "./icons/GrainLogo.astro";
@@ -13,16 +13,28 @@ const { entries } = Astro.props;
1313

1414
<div class="max-w-[80rem] mx-auto px-4">
1515
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-5 lg:gap-12">
16-
{entries.map(entry => <BlogThumbnail entry={entry} />)}
16+
{entries.map((entry) => <BlogThumbnail entry={entry} />)}
1717
</div>
1818

19-
<div class="relative rounded-lg my-8 lg:my-20 w-full h-64 md:h-52 bg-gray-variant-90 dark:bg-gray-variant-80 overflow-hidden">
20-
<div class="hidden md:block absolute z-20 -left-72 w-96 h-80 opacity-80 bg-purple-40 transform -skew-x-[45deg]"></div>
21-
<div class="hidden md:block absolute z-10 left-5 w-72 h-80 bg-[radial-gradient(#6B40E4,#DF573A)] transform -skew-x-[45deg]"></div>
22-
<div class="absolute px-6 md:px-12 lg:px-20 w-full top-1/2 transform -translate-y-1/2 flex gap-6 z-30 text-white items-center flex-col md:flex-row justify-center md:justify-between">
19+
<div
20+
class="relative rounded-lg my-8 lg:my-20 w-full h-64 md:h-52 bg-gray-variant-90 dark:bg-gray-variant-80 overflow-hidden"
21+
>
22+
<div
23+
class="hidden md:block absolute z-20 -left-72 w-96 h-80 opacity-80 bg-purple-40 transform -skew-x-[45deg]"
24+
>
25+
</div>
26+
<div
27+
class="hidden md:block absolute z-10 left-5 w-72 h-80 bg-[radial-gradient(#6B40E4,#DF573A)] transform -skew-x-[45deg]"
28+
>
29+
</div>
30+
<div
31+
class="absolute px-6 md:px-12 lg:px-20 w-full top-1/2 transform -translate-y-1/2 flex gap-6 z-30 text-white items-center flex-col md:flex-row justify-center md:justify-between"
32+
>
2333
<div class="flex items-center gap-2">
2434
<GrainLogo class="w-10 h-10 lg:w-16 lg:h-16 fill-white" />
25-
<div class="font-bold text-3xl md:text-4xl lg:text-5xl">developer news</div>
35+
<div class="font-bold text-3xl md:text-4xl lg:text-5xl">
36+
developer news
37+
</div>
2638
</div>
2739
<div class="md:w-[20rem] lg:w-[24rem]">
2840
<NewsletterSignup />

0 commit comments

Comments
 (0)