From 63002095425259dc7d58172296da46218bf5c25c Mon Sep 17 00:00:00 2001 From: Spotandjake Date: Tue, 28 Jan 2025 14:30:14 -0500 Subject: [PATCH 1/5] feat: Add `prettier` formatter --- .prettierignore | 3 +++ .prettierrc.mjs | 12 ++++++++++++ package-lock.json | 49 ++++++++++++++++++++++++++++++++++++++++++++--- package.json | 7 +++++-- 4 files changed, 66 insertions(+), 5 deletions(-) create mode 100644 .prettierignore create mode 100644 .prettierrc.mjs diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..71aaec6 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,3 @@ +public/grainc.bc.mjs +grain-language-server/ +src/content/docs/ \ No newline at end of file diff --git a/.prettierrc.mjs b/.prettierrc.mjs new file mode 100644 index 0000000..7e61930 --- /dev/null +++ b/.prettierrc.mjs @@ -0,0 +1,12 @@ +/** @type {import("prettier").Config} */ +export default { + plugins: ["prettier-plugin-astro"], + overrides: [ + { + files: "*.astro", + options: { + parser: "astro", + }, + }, + ], +}; diff --git a/package-lock.json b/package-lock.json index 8f33f7f..bc39fc5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -51,7 +51,9 @@ }, "devDependencies": { "@tailwindcss/typography": "^0.5.12", - "@types/ramda": "^0.30.2" + "@types/ramda": "^0.30.2", + "prettier": "^3.4.2", + "prettier-plugin-astro": "^0.14.1" } }, "node_modules/@algolia/autocomplete-core": { @@ -6503,9 +6505,8 @@ "version": "3.4.2", "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.4.2.tgz", "integrity": "sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==", + "devOptional": true, "license": "MIT", - "optional": true, - "peer": true, "bin": { "prettier": "bin/prettier.cjs" }, @@ -6516,6 +6517,21 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, + "node_modules/prettier-plugin-astro": { + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/prettier-plugin-astro/-/prettier-plugin-astro-0.14.1.tgz", + "integrity": "sha512-RiBETaaP9veVstE4vUwSIcdATj6dKmXljouXc/DDNwBSPTp8FRkLGDSGFClKsAFeeg+13SB0Z1JZvbD76bigJw==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@astrojs/compiler": "^2.9.1", + "prettier": "^3.0.0", + "sass-formatter": "^0.7.6" + }, + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, "node_modules/prismjs": { "version": "1.29.0", "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.29.0.tgz", @@ -7019,6 +7035,13 @@ "queue-microtask": "^1.2.2" } }, + "node_modules/s.color": { + "version": "0.0.15", + "resolved": "https://registry.npmjs.org/s.color/-/s.color-0.0.15.tgz", + "integrity": "sha512-AUNrbEUHeKY8XsYr/DYpl+qk5+aM+DChopnWOPEzn8YKzOhv4l2zH6LzZms3tOZP3wwdOyc0RmTciyi46HLIuA==", + "devOptional": true, + "license": "MIT" + }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -7138,6 +7161,16 @@ "entities": "^4.4.0" } }, + "node_modules/sass-formatter": { + "version": "0.7.9", + "resolved": "https://registry.npmjs.org/sass-formatter/-/sass-formatter-0.7.9.tgz", + "integrity": "sha512-CWZ8XiSim+fJVG0cFLStwDvft1VI7uvXdCNJYXhDvowiv+DsbD1nXLiQ4zrE5UBvj5DWZJ93cwN0NX5PMsr1Pw==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "suf-log": "^2.5.3" + } + }, "node_modules/search-insights": { "version": "2.17.2", "resolved": "https://registry.npmjs.org/search-insights/-/search-insights-2.17.2.tgz", @@ -7457,6 +7490,16 @@ "node": ">=16 || 14 >=14.17" } }, + "node_modules/suf-log": { + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/suf-log/-/suf-log-2.5.3.tgz", + "integrity": "sha512-KvC8OPjzdNOe+xQ4XWJV2whQA0aM1kGVczMQ8+dStAO6KfEB140JEVQ9dE76ONZ0/Ylf67ni4tILPJB41U0eow==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "s.color": "0.0.15" + } + }, "node_modules/supports-preserve-symlinks-flag": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", diff --git a/package.json b/package.json index 925cc46..128acc6 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,8 @@ "start": "astro dev", "build": "astro build", "preview": "astro preview", - "astro": "astro" + "astro": "astro", + "format": "prettier . --write" }, "dependencies": { "@astrojs/check": "^0.9.4", @@ -55,6 +56,8 @@ }, "devDependencies": { "@tailwindcss/typography": "^0.5.12", - "@types/ramda": "^0.30.2" + "@types/ramda": "^0.30.2", + "prettier": "^3.4.2", + "prettier-plugin-astro": "^0.14.1" } } From 6bb14972ff7c8b4f99fd5074fe1586787beac802 Mon Sep 17 00:00:00 2001 From: Spotandjake Date: Tue, 28 Jan 2025 14:30:22 -0500 Subject: [PATCH 2/5] chore: Run formatter --- astro.config.mjs | 27 +- .../functions/mailing-list-unsubscribe.mts | 41 +- public/fonts/LeagueMono/OFL.md | 57 +- scripts/cli.mjs | 2 +- scripts/generateContributors.js | 37 +- src/blogAuthors.ts | 17 +- src/components/BlogAuthor.astro | 8 +- src/components/BlogEntries.astro | 26 +- src/components/BlogEntry.astro | 46 +- src/components/BlogHero.astro | 41 +- src/components/BlogThumbnail.astro | 25 +- src/components/ButtonLink.astro | 7 +- src/components/Card.astro | 4 +- src/components/Chip.astro | 5 +- src/components/CodeExamples.astro | 76 +- src/components/CommunityInfo.astro | 49 +- src/components/Contributors.astro | 76 +- src/components/CoreTeam.astro | 95 +- src/components/CoreTeamMemberInfo.astro | 56 +- src/components/DocLink.astro | 8 +- src/components/DocLinkGroup.astro | 28 +- src/components/DocLinks.astro | 23 +- src/components/DocsEntry.astro | 64 +- src/components/Footer.astro | 10 +- src/components/Hero.astro | 56 +- src/components/IconLinks.astro | 21 +- src/components/Info.astro | 20 +- src/components/InfoDetails.astro | 4 +- src/components/MailingListForm.astro | 37 +- src/components/Nav.astro | 15 +- src/components/NavLinks.astro | 31 +- src/components/NewsletterSignup.astro | 13 +- src/components/OpenSourceBlurb.astro | 90 +- src/components/Search.astro | 8 +- src/components/TableOfContents.astro | 20 +- src/components/TableOfContentsHeading.astro | 41 +- src/components/TypographyContainer.astro | 3 +- src/components/icons/ArrowLeftIcon.astro | 13 +- src/components/icons/BarsIcon.astro | 4 +- src/components/icons/BlueskyIcon.astro | 5 +- src/components/icons/ChevronRightIcon.astro | 4 +- src/components/icons/DiscordIcon.astro | 5 +- src/components/icons/ExternalIcon.astro | 3 +- src/components/icons/GithubIcon.astro | 12 +- src/components/icons/GrainLogo.astro | 22 +- src/components/icons/MastodonIcon.astro | 5 +- src/components/icons/RssIcon.astro | 5 +- src/content.config.ts | 27 +- src/content/blog/Grain-Formatter.md | 36 +- .../blog/Grain-Hearts-Hacktoberfest.md | 6 +- .../blog/New-Release-Grain-v0.3.0-Barley.md | 16 +- .../blog/announcing-grain-v0.6-emmer.md | 9 +- src/content/misc/privacy.md | 10 +- src/examples.ts | 20 +- src/global.css | 4 +- src/layouts/Layout.astro | 77 +- src/pages/blog.astro | 6 +- src/pages/blog/[post].astro | 4 +- src/pages/blog/rss.xml.ts | 4 +- src/pages/community.astro | 6 +- src/pages/docs/[...slug].astro | 16 +- src/pages/index.astro | 6 +- src/pages/privacy.astro | 33 +- src/pages/try.astro | 2 +- src/playground/compiler.js | 4 +- src/playground/editor.ts | 78 +- src/rehype/rehype-autolink-headings-config.ts | 11 +- .../rehype-content-intro-text-transformer.ts | 17 +- src/rehype/rehype-table-wrapper.ts | 52 +- src/store.ts | 5 +- src/style/docsearch.css | 9 +- src/types.d.ts | 6 +- src/utils/docsCollections.ts | 33 +- svelte.config.js | 4 +- tailwind.config.mjs | 58 +- themes/github-dark-modified-converted.json | 1026 ++++++++-------- themes/github-dark-modified-lighter.json | 49 +- themes/github-dark-modified.json | 49 +- themes/github-light-converted.json | 1044 ++++++++-------- themes/github-light.json | 1085 ++++++++--------- tsconfig.json | 2 +- 81 files changed, 2737 insertions(+), 2342 deletions(-) diff --git a/astro.config.mjs b/astro.config.mjs index 5a87bda..aab113c 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -12,8 +12,14 @@ import rehypeTableWrapper from "./src/rehype/rehype-table-wrapper"; const require = createRequire(import.meta.url); -const grainLang = JSON.parse(fs.readFileSync("./grain-language-server/editor-extensions/vscode/syntaxes/grain.json")); -const theme = JSON.parse(fs.readFileSync("./themes/github-dark-modified-lighter.json")); +const grainLang = JSON.parse( + fs.readFileSync( + "./grain-language-server/editor-extensions/vscode/syntaxes/grain.json", + ), +); +const theme = JSON.parse( + fs.readFileSync("./themes/github-dark-modified-lighter.json"), +); // https://astro.build/config export default defineConfig({ @@ -48,23 +54,20 @@ export default defineConfig({ }, build: { target: "esnext", - } + }, }, integrations: [tailwind(), svelte()], redirects: { "/docs": "/docs/intro", - "/docs/guide": "/docs/guide/basics" + "/docs/guide": "/docs/guide/basics", }, markdown: { rehypePlugins: [ rehypeSlug, - [ - rehypeAutolinkHeadings, - rehypeAutolinkHeadingsConfig, - ], + [rehypeAutolinkHeadings, rehypeAutolinkHeadingsConfig], rehypeContentIntroTextTransformer, rehypeTableWrapper, ], @@ -75,10 +78,10 @@ export default defineConfig({ code(node) { // Hack to distinguish block code from inline code in tailwind-typography node.properties["data-block"] = "true"; - } - } + }, + }, ], - langs: [{...grainLang, name: "grain"}] - } + langs: [{ ...grainLang, name: "grain" }], + }, }, }); diff --git a/netlify/functions/mailing-list-unsubscribe.mts b/netlify/functions/mailing-list-unsubscribe.mts index c1541f7..6d12b3a 100644 --- a/netlify/functions/mailing-list-unsubscribe.mts +++ b/netlify/functions/mailing-list-unsubscribe.mts @@ -29,32 +29,47 @@ export default async (req: Request, context: Context) => { } try { - const allForms = await fetch(`https://api.netlify.com/api/v1/sites/${siteId}/forms`, { - headers: { Authorization: `Bearer ${apiKey}` }, - }).then(res => res.json()); + const allForms = await fetch( + `https://api.netlify.com/api/v1/sites/${siteId}/forms`, + { + headers: { Authorization: `Bearer ${apiKey}` }, + }, + ).then((res) => res.json()); - const eligibleMailingListForms = allForms.filter((form: any) => form.name === MAILING_LIST_FORM_NAME); + const eligibleMailingListForms = allForms.filter( + (form: any) => form.name === MAILING_LIST_FORM_NAME, + ); if (eligibleMailingListForms.length !== 1) { - console.log(`Found ${eligibleMailingListForms.length} mailing list forms`); - return new Response("Unexpectedly found multiple mailing list sign up forms", { status: 500 }); + console.log( + `Found ${eligibleMailingListForms.length} mailing list forms`, + ); + return new Response( + "Unexpectedly found multiple mailing list sign up forms", + { status: 500 }, + ); } const mailingListFormId = eligibleMailingListForms[0].id; - const mailingListSubmissions = await fetch(`https://api.netlify.com/api/v1/forms/${mailingListFormId}/submissions`, { - headers: { Authorization: `Bearer ${apiKey}` }, - }).then(res => res.json()); + const mailingListSubmissions = await fetch( + `https://api.netlify.com/api/v1/forms/${mailingListFormId}/submissions`, + { + headers: { Authorization: `Bearer ${apiKey}` }, + }, + ).then((res) => res.json()); - const matchedSubmissions = mailingListSubmissions - .filter((submission: any) => submission.data.email?.trim()?.toUpperCase() === email); + const matchedSubmissions = mailingListSubmissions.filter( + (submission: any) => + submission.data.email?.trim()?.toUpperCase() === email, + ); await Promise.all( matchedSubmissions.map((submission: any) => fetch(`https://api.netlify.com/api/v1/submissions/${submission.id}`, { method: "DELETE", headers: { Authorization: `Bearer ${apiKey}` }, - }) - ) + }), + ), ); return new Response("Success"); diff --git a/public/fonts/LeagueMono/OFL.md b/public/fonts/LeagueMono/OFL.md index f545d30..bac69d6 100644 --- a/public/fonts/LeagueMono/OFL.md +++ b/public/fonts/LeagueMono/OFL.md @@ -6,14 +6,11 @@ Version 1.1 - 26 February 2007 ----- +--- -SIL Open Font License -===================== +# SIL Open Font License - -Preamble --------- +## Preamble The goals of the Open Font License (OFL) are to stimulate worldwide development of collaborative font projects, to support the font creation @@ -23,15 +20,14 @@ with others. The OFL allows the licensed fonts to be used, studied, modified and redistributed freely as long as they are not sold by themselves. The -fonts, including any derivative works, can be bundled, embedded, +fonts, including any derivative works, can be bundled, embedded, redistributed and/or sold with any software provided that any reserved names are not used by derivative works. The fonts and derivatives, however, cannot be released under any other type of license. The requirement for fonts to remain under this license does not apply to any document created using the fonts or their derivatives. -Definitions ------------ +## Definitions `"Font Software"` refers to the set of files released by the Copyright Holder(s) under this license and clearly marked as such. This may @@ -51,8 +47,7 @@ new environment. `"Author"` refers to any designer, engineer, programmer, technical writer or other person who contributed to the Font Software. -Permission & Conditions ------------------------ +## Permission & Conditions Permission is hereby granted, free of charge, to any person obtaining a copy of the Font Software, to use, study, copy, merge, embed, modify, @@ -60,40 +55,38 @@ redistribute, and sell modified and unmodified copies of the Font Software, subject to the following conditions: 1. Neither the Font Software nor any of its individual components, -in Original or Modified Versions, may be sold by itself. + in Original or Modified Versions, may be sold by itself. 2. Original or Modified Versions of the Font Software may be bundled, -redistributed and/or sold with any software, provided that each copy -contains the above copyright notice and this license. These can be -included either as stand-alone text files, human-readable headers or -in the appropriate machine-readable metadata fields within text or -binary files as long as those fields can be easily viewed by the user. + redistributed and/or sold with any software, provided that each copy + contains the above copyright notice and this license. These can be + included either as stand-alone text files, human-readable headers or + in the appropriate machine-readable metadata fields within text or + binary files as long as those fields can be easily viewed by the user. 3. No Modified Version of the Font Software may use the Reserved Font -Name(s) unless explicit written permission is granted by the corresponding -Copyright Holder. This restriction only applies to the primary font name as -presented to the users. + Name(s) unless explicit written permission is granted by the corresponding + Copyright Holder. This restriction only applies to the primary font name as + presented to the users. 4. The name(s) of the Copyright Holder(s) or the Author(s) of the Font -Software shall not be used to promote, endorse or advertise any -Modified Version, except to acknowledge the contribution(s) of the -Copyright Holder(s) and the Author(s) or with their explicit written -permission. + Software shall not be used to promote, endorse or advertise any + Modified Version, except to acknowledge the contribution(s) of the + Copyright Holder(s) and the Author(s) or with their explicit written + permission. 5. The Font Software, modified or unmodified, in part or in whole, -must be distributed entirely under this license, and must not be -distributed under any other license. The requirement for fonts to -remain under this license does not apply to any document created -using the Font Software. + must be distributed entirely under this license, and must not be + distributed under any other license. The requirement for fonts to + remain under this license does not apply to any document created + using the Font Software. -Termination ------------ +## Termination This license becomes null and void if any of the above conditions are not met. -Disclaimer ----------- +## Disclaimer THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF diff --git a/scripts/cli.mjs b/scripts/cli.mjs index 5d37c5e..c893782 100644 --- a/scripts/cli.mjs +++ b/scripts/cli.mjs @@ -24,7 +24,7 @@ async function collectGrainFiles(...segments) { dirent.name.replace(".gr", ""), ]; const contents = await fs.readFile( - path.join(stdlibDir, ...segments, dirent.name) + path.join(stdlibDir, ...segments, dirent.name), ); const importIdent = contents.toString().match(/.*?^module\s+(\w+)/m)[1]; const filepathSegment = importPathSegments.join("/"); diff --git a/scripts/generateContributors.js b/scripts/generateContributors.js index e09780b..de9a62a 100644 --- a/scripts/generateContributors.js +++ b/scripts/generateContributors.js @@ -13,26 +13,33 @@ async function generateContributors() { const repoContributions = await Promise.all( repos - .filter(repo => !repo.fork) - .map(repo => octokit.paginate(octokit.rest.repos.listContributors, { - owner: "grain-lang", - repo: repo.name, - per_page: 100, - })) + .filter((repo) => !repo.fork) + .map((repo) => + octokit.paginate(octokit.rest.repos.listContributors, { + owner: "grain-lang", + repo: repo.name, + per_page: 100, + }), + ), ); - + const contributionsFlattened = repoContributions.flat(); - const groupedByLogin = Object.groupBy(contributionsFlattened, c => c.login); - const results = Object.entries(groupedByLogin).map(([login, contributionInfos]) => ({ - login, - profileUrl: contributionInfos[0].html_url, - avatarUrl: contributionInfos[0].avatar_url, - count: contributionInfos.reduce((acc, c) => acc + c.contributions, 0) - })) + const groupedByLogin = Object.groupBy(contributionsFlattened, (c) => c.login); + const results = Object.entries(groupedByLogin).map( + ([login, contributionInfos]) => ({ + login, + profileUrl: contributionInfos[0].html_url, + avatarUrl: contributionInfos[0].avatar_url, + count: contributionInfos.reduce((acc, c) => acc + c.contributions, 0), + }), + ); const cwd = path.dirname(url.fileURLToPath(import.meta.url)); - await fs.writeFile(path.join(cwd, "..", "contributors.json"), JSON.stringify(results, undefined, 4)); + await fs.writeFile( + path.join(cwd, "..", "contributors.json"), + JSON.stringify(results, undefined, 4), + ); } await generateContributors(); diff --git a/src/blogAuthors.ts b/src/blogAuthors.ts index 551c86c..1c6a56a 100644 --- a/src/blogAuthors.ts +++ b/src/blogAuthors.ts @@ -14,8 +14,19 @@ export interface AuthorInfo { } export const authorInfoByName: Record = { - "Oscar Spencer": { blueskyProfile: "ospencer.dev", githubProfile: "ospencer", headshot: oscarHeadshot }, + "Oscar Spencer": { + blueskyProfile: "ospencer.dev", + githubProfile: "ospencer", + headshot: oscarHeadshot, + }, "Philip Blair": { githubProfile: "peblair", headshot: philipHeadshot }, - "Blaine Bublitz": { mastodonLink: "https://fosstodon.org/@phated", githubProfile: "phated", headshot: blaineHeadshot }, - "Marcus Roberts": { githubProfile: "marcusroberts", headshot: marcusHeadshot }, + "Blaine Bublitz": { + mastodonLink: "https://fosstodon.org/@phated", + githubProfile: "phated", + headshot: blaineHeadshot, + }, + "Marcus Roberts": { + githubProfile: "marcusroberts", + headshot: marcusHeadshot, + }, }; diff --git a/src/components/BlogAuthor.astro b/src/components/BlogAuthor.astro index 1123d84..5d63f6a 100644 --- a/src/components/BlogAuthor.astro +++ b/src/components/BlogAuthor.astro @@ -23,7 +23,13 @@ const { entry, imgClass, nameClass, dateClass } = Astro.props;

{entry.data.author}

- {entry.data.date.toLocaleDateString(undefined, { month: "short", day: "numeric", year: "numeric" })} + { + entry.data.date.toLocaleDateString(undefined, { + month: "short", + day: "numeric", + year: "numeric", + }) + }

diff --git a/src/components/BlogEntries.astro b/src/components/BlogEntries.astro index c73f7a3..b43ddf6 100644 --- a/src/components/BlogEntries.astro +++ b/src/components/BlogEntries.astro @@ -1,5 +1,5 @@ --- -import type { CollectionEntry } from "astro:content" +import type { CollectionEntry } from "astro:content"; import BlogThumbnail from "./BlogThumbnail.astro"; import NewsletterSignup from "./NewsletterSignup.astro"; import GrainLogo from "./icons/GrainLogo.astro"; @@ -13,16 +13,28 @@ const { entries } = Astro.props;
- {entries.map(entry => )} + {entries.map((entry) => )}
-
- - -
+
+ + +
-
developer news
+
+ developer news +
diff --git a/src/components/BlogEntry.astro b/src/components/BlogEntry.astro index 69f40fc..2bd1ee2 100644 --- a/src/components/BlogEntry.astro +++ b/src/components/BlogEntry.astro @@ -1,5 +1,5 @@ --- -import type { CollectionEntry } from "astro:content" +import type { CollectionEntry } from "astro:content"; import TypographyContainer from "./TypographyContainer.astro"; import ArrowLeftIcon from "./icons/ArrowLeftIcon.astro"; import GithubIcon from "./icons/GithubIcon.astro"; @@ -41,15 +41,47 @@ const authorInfo = authorInfoByName[entry.data.author as BlogAuthor];

Author

{entry.data.author} - {authorInfo.blueskyProfile && } - {authorInfo.mastodonLink && } - + { + authorInfo.blueskyProfile && ( + + ) + } + { + authorInfo.mastodonLink && ( + + ) + } +

Published

-

{entry.data.date.toLocaleDateString(undefined, { month: "short", day: "numeric", year: "numeric" })}

+

+ { + entry.data.date.toLocaleDateString(undefined, { + month: "short", + day: "numeric", + year: "numeric", + }) + } +

@@ -58,7 +90,9 @@ const authorInfo = authorInfoByName[entry.data.author as BlogAuthor]; alt={entry.data.coverAttribution ?? ""} class="rounded max-h-[26rem] w-full object-cover" /> -
Photo: {entry.data.coverAttribution}
+
+ Photo: {entry.data.coverAttribution} +
diff --git a/src/components/BlogHero.astro b/src/components/BlogHero.astro index 16b7d70..d813366 100644 --- a/src/components/BlogHero.astro +++ b/src/components/BlogHero.astro @@ -18,8 +18,12 @@ const { entry } = Astro.props;
- - The Grain Blog + + The Grain Blog - +
-
+
-

{entry.data.title}

+

+ {entry.data.title} +

{entry.data.subtitle}

-

{entry.body}...

- +

+ {entry.body}... +

+
Read more diff --git a/src/components/BlogThumbnail.astro b/src/components/BlogThumbnail.astro index 468e0e0..72cff4a 100644 --- a/src/components/BlogThumbnail.astro +++ b/src/components/BlogThumbnail.astro @@ -10,7 +10,9 @@ interface Props { const { entry } = Astro.props; --- -
+
- +
- {entry.data.tags?.slice(0, 2).map(t => ( - - {t} - - ))} + { + entry.data.tags + ?.slice(0, 2) + .map((t) => ( + + {t} + + )) + }
diff --git a/src/components/ButtonLink.astro b/src/components/ButtonLink.astro index 2a7fd0b..a44aafb 100644 --- a/src/components/ButtonLink.astro +++ b/src/components/ButtonLink.astro @@ -13,8 +13,8 @@ const classList = `flex w-fit items-center rounded h-12 px-5 py-3 bg-gray-90 dar const isLink = !!href; --- -{isLink - ? ( +{ + isLink ? ( @@ -24,4 +24,5 @@ const isLink = !!href; - )} + ) +} diff --git a/src/components/Card.astro b/src/components/Card.astro index 29a63bd..66764c7 100644 --- a/src/components/Card.astro +++ b/src/components/Card.astro @@ -7,7 +7,9 @@ interface Props { const { title } = Astro.props; --- -
+

{title}

diff --git a/src/components/Chip.astro b/src/components/Chip.astro index b8219a5..dc7e8f5 100644 --- a/src/components/Chip.astro +++ b/src/components/Chip.astro @@ -1,6 +1,9 @@ --- + --- -
+
diff --git a/src/components/CodeExamples.astro b/src/components/CodeExamples.astro index ed30906..3a64281 100644 --- a/src/components/CodeExamples.astro +++ b/src/components/CodeExamples.astro @@ -27,51 +27,85 @@ const lang = grainLang as any; examples.children[nextIndex].classList.remove("hidden"); currIndex = nextIndex; - const compressedCode = examples.children[currIndex].getAttribute("data-compressed-code"); - playgroundLink.setAttribute("href", `/try?code=${compressedCode}`) + const compressedCode = examples.children[currIndex].getAttribute( + "data-compressed-code", + ); + playgroundLink.setAttribute("href", `/try?code=${compressedCode}`); - selectedExample.innerHTML = examples.children[currIndex].getAttribute("data-name")!; + selectedExample.innerHTML = + examples.children[currIndex].getAttribute("data-name")!; } - document.getElementById("prev")!.addEventListener("click", () => changeView(-1)); - document.getElementById("next")!.addEventListener("click", () => changeView(+1)); + document + .getElementById("prev")! + .addEventListener("click", () => changeView(-1)); + document + .getElementById("next")! + .addEventListener("click", () => changeView(+1)); changeView(0);
-
- {codeExamples.map((example, i) => ( - - ))} +
+ { + codeExamples.map((example, i) => ( + + )) + }
-
-

-
diff --git a/src/components/CommunityInfo.astro b/src/components/CommunityInfo.astro index 0f2633d..c5152a4 100644 --- a/src/components/CommunityInfo.astro +++ b/src/components/CommunityInfo.astro @@ -7,34 +7,39 @@ import passionIcon from "../images/passion.svg"; ---
-
-
-
+
+
+
+
+
+
-

Behind the Scenes with the Grain Team

+

+ Behind the Scenes with the Grain Team +

The high-level programming language for WebAssembly

- + We are passionate about WebAssembly, programming languages, and - developer experience. Each member of the Grain core team relies - on full-time work outside of Grain. + developer experience. Each member of the Grain core team relies on + full-time work outside of Grain.
- - Grain's growth is organic. (What? We appreciate a good pun.) Core - team members initially met as classmates and colleagues or found - each other through the project. + + Grain's growth is organic. (What? We appreciate a good pun.) Core team + members initially met as classmates and colleagues or found each other + through the project.
@@ -43,9 +48,9 @@ import passionIcon from "../images/passion.svg"; iconSrc={passionIcon} iconAlt="A hand holding a heart." > - Grain is an open-source passion project. We do this because we love - it, and feel strongly that WebAssembly deserves an easy-to-use - high-level language + Grain is an open-source passion project. We do this because we love it, + and feel strongly that WebAssembly deserves an easy-to-use high-level + language
@@ -54,7 +59,9 @@ import passionIcon from "../images/passion.svg"; our volunteer contributors, we have accomplished more than we ever expected. - Let's Hang Out + Let's Hang Out
diff --git a/src/components/Contributors.astro b/src/components/Contributors.astro index 6cdb601..3e1adcc 100644 --- a/src/components/Contributors.astro +++ b/src/components/Contributors.astro @@ -14,45 +14,55 @@ const excludeList = [ "dependabot[bot]", ]; -const special = [ - "jozanza", - "cician", -] +const special = ["jozanza", "cician"]; ---
-

+

Contributors

- {contributors - .filter(x => !excludeList.includes(x.login)) - .toSorted((x, y) => { - const xSpecial = special.includes(x.login); - const ySpecial = special.includes(y.login); - if (xSpecial && !ySpecial) { - return -1; - } else if (!xSpecial && ySpecial) { - return 1; - } else { - return y.count - x.count; - } - }) - .map(contributor => ( -
- - {`Image - - {special.includes(contributor.login) && ( - 🌾 - )} -
- ))} + { + contributors + .filter((x) => !excludeList.includes(x.login)) + .toSorted((x, y) => { + const xSpecial = special.includes(x.login); + const ySpecial = special.includes(y.login); + if (xSpecial && !ySpecial) { + return -1; + } else if (!xSpecial && ySpecial) { + return 1; + } else { + return y.count - x.count; + } + }) + .map((contributor) => ( +
+ + {`Image + + {special.includes(contributor.login) && ( + + 🌾 + + )} +
+ )) + }

- 🌾 = Noteworthy contributors to the project. + 🌾 + = Noteworthy contributors to the project.

diff --git a/src/components/CoreTeam.astro b/src/components/CoreTeam.astro index 5278b29..ce42a36 100644 --- a/src/components/CoreTeam.astro +++ b/src/components/CoreTeam.astro @@ -10,7 +10,9 @@ import alexHeadshot from "../images/headshots/alex-headshot-square.jpg";
-
+

- Meet Grain's co-creator, Oscar. In 2017, Oscar, excited about WebAssembly's - possibilities, co-created Grain, an easy-to-use, flexible but functional - language that made adoption of WebAssembly simple for the world's - developers. + Meet Grain's co-creator, Oscar. In 2017, Oscar, excited about + WebAssembly's possibilities, co-created Grain, an easy-to-use, flexible + but functional language that made adoption of WebAssembly simple for the + world's developers.

- +

- Known for his problem solving and optimism, Oscar is a Principal Engineer - at F5 NGINX. + Known for his problem solving and optimism, Oscar is a Principal + Engineer at F5 NGINX.

- +

Oscar specializes in compilers, language design, OCaml, and functional - programming. When he's not working, find him on Discord or mulling over the - next big challenge. + programming. When he's not working, find him on Discord or mulling over + the next big challenge.

- +

Who he admires: Guido van Rossum, creator of Python, a language that developers adore, with a welcoming community. @@ -51,25 +53,23 @@ import alexHeadshot from "../images/headshots/alex-headshot-square.jpg"; >

Philip is Grain's co-creator. Resourceful and analytical, he works to - implement features which impact the end-user experience to enhance Grain's - ease of use, familiarity, and accessibility. + implement features which impact the end-user experience to enhance + Grain's ease of use, familiarity, and accessibility.

- +

Philip is the Senior Research Engineer at Basis Technology, where he - investigates practical applications of deep learning technologies for use - in text analytics. + investigates practical applications of deep learning technologies for + use in text analytics.

- -

- Philip is an avid runner, and especially enjoys his route along the local - river. Most afternoons, you can find Philip in his favorite neighborhood - café, sipping a coffee and working away. -

- +

- Drink of choice: double espresso, Ethiopian single-origin. + Philip is an avid runner, and especially enjoys his route along the + local river. Most afternoons, you can find Philip in his favorite + neighborhood café, sipping a coffee and working away.

+ +

Drink of choice: double espresso, Ethiopian single-origin.

- Blaine is a freelance open source developer and founder of Lead Gumshoe, an - open source consulting company. Blaine specializes in helping organizations - understand and use open source software. + Blaine is a freelance open source developer and founder of Lead Gumshoe, + an open source consulting company. Blaine specializes in helping + organizations understand and use open source software.

- +

Pragmatic with a strong work ethic, Blaine brings developer experience, tooling, language design and grant writing experience to Grain. He was @@ -93,7 +93,7 @@ import alexHeadshot from "../images/headshots/alex-headshot-square.jpg"; everything is released with 1-click. He also does the arduous work of making Grain work on Windows.

- +

When Blaine's not working, he likes to build Legos and play trading card games. He was even the final world champion for the no-longer-produced @@ -110,27 +110,27 @@ import alexHeadshot from "../images/headshots/alex-headshot-square.jpg"; >

Supportive and bold, Marcus is a champion for building teams who develop - self-sufficiently. His goal for Grain is simple: a language with easy step - up, easy development, and a full set of tooling essential for today's - developers. + self-sufficiently. His goal for Grain is simple: a language with easy + step up, easy development, and a full set of tooling essential for + today's developers.

- +

- Marcus was responsible for building Grain's language server that provides - code analysis for code editors. + Marcus was responsible for building Grain's language server that + provides code analysis for code editors.

- +

- Currently, Marcus works as the Technical Director at Nittygritty, where he - leads both the technical services part of the company and a software + Currently, Marcus works as the Technical Director at Nittygritty, where + he leads both the technical services part of the company and a software development team.

- +

On any given Friday night, you can find Marcus drinking a craft beer and surfing the web. He hasn't found the end yet.

- +

His biggest ask: That you stand to the right on the London Underground escalators. Seriously. @@ -147,8 +147,8 @@ import alexHeadshot from "../images/headshots/alex-headshot-square.jpg";

Driven by a passion for programming languages and WebAssembly, Jake brings a fresh and dynamic perspective to the Grain core team. His - contributions focus on enhancing the standard library, Jake has played - a key role in building the JSON and Number libraries, refining + contributions focus on enhancing the standard library, Jake has played a + key role in building the JSON and Number libraries, refining documentation, and supporting language server development. On occasion, he also contributes to the compiler, further expanding his expertise.

@@ -156,7 +156,8 @@ import alexHeadshot from "../images/headshots/alex-headshot-square.jpg";

Currently studying type checking and compiler development, Jake blends his curiosity for programming languages with hands-on contributions to - Grain. Outside of tech, he enjoys exploring the outdoors and engineering. + Grain. Outside of tech, he enjoys exploring the outdoors and + engineering.

@@ -174,8 +175,8 @@ import alexHeadshot from "../images/headshots/alex-headshot-square.jpg"; githubUsername="alex-snezhko" >

- Alex understands how important having a great programming language is for - building software and is motivated by the goal of making Grain an + Alex understands how important having a great programming language is + for building software and is motivated by the goal of making Grain an exceptional language that is easy and enjoyable to build with.

@@ -186,7 +187,7 @@ import alexHeadshot from "../images/headshots/alex-headshot-square.jpg";

Outside of tech, Alex enjoys gaming, building mechanical keyboards, and - heavy metal music. + heavy metal music.

diff --git a/src/components/CoreTeamMemberInfo.astro b/src/components/CoreTeamMemberInfo.astro index a4d15fa..da2709c 100644 --- a/src/components/CoreTeamMemberInfo.astro +++ b/src/components/CoreTeamMemberInfo.astro @@ -13,7 +13,9 @@ interface Props { const { profileImage, name, title, role, githubUsername } = Astro.props; --- -
+
{role}
-
+