From beddfa9e4b503fc85449542e83cf5857898f77d1 Mon Sep 17 00:00:00 2001 From: Helder Oliveira Date: Mon, 10 Jun 2024 17:11:36 +0100 Subject: [PATCH 1/2] =?UTF-8?q?chore:=20=F0=9F=A4=96=20spell=20checker=20f?= =?UTF-8?q?ile=20normalisation=20(#17)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Why? Spell checker file normalisation. ## How? - Created a script to normalize the input files - Execute the normalization script in the CI/CD before the spell checkup - Update the word list ## Tickets? - [PRO-173](https://linear.app/fleekxyz/issue/PRO-173/add-content-normalization-for-spell-checker) ## Contribution checklist? - [x] The commit messages are detailed - [x] The `build` command runs locally - [x] Assets or static content are linked and stored in the project - [x] Document filename is named after the slug - [x] You've reviewed spelling using a grammar checker - [x] For documentation, guides or references, you've tested the commands and steps - [x] You've done enough research before writing ## Security checklist? - [x] Sensitive data has been identified and is being protected properly - [x] Injection has been prevented (parameterized queries, no eval or system calls) - [x] The Components are escaping output (to prevent XSS) ## References? Optionally, provide references such as links ## Preview? Optionally, provide the preview url here --------- Co-authored-by: nlc616 <97002998+nlc616@users.noreply.github.com> --- .../actions/spell-checker/ignore_words.txt | 24 ++++---------- .github/workflows/grammar-spell-checker.yml | 12 ++++++- scripts/markdown-normalizer.ts | 32 +++++++++++++++++++ 3 files changed, 49 insertions(+), 19 deletions(-) create mode 100755 scripts/markdown-normalizer.ts diff --git a/.github/actions/spell-checker/ignore_words.txt b/.github/actions/spell-checker/ignore_words.txt index 4d6e9633..228d29b9 100755 --- a/.github/actions/spell-checker/ignore_words.txt +++ b/.github/actions/spell-checker/ignore_words.txt @@ -1,5 +1,4 @@ 2fa -8Fdevelop 8f 8fdevelop astro @@ -26,25 +25,21 @@ customtitlesbydirectoryname customTitlesByDirectoryName ddos dev -Develop develop -Development development devs dns dnslink ef env -EnvVars envvars ethereum eu -️Fleek fleek +fleek's fleekchangelog01mar11 fleekreleasenotes06 fleekxyz -fleek’s flkservices fmt gatsby @@ -69,13 +64,10 @@ lon md mdx meilisearch -Meilisearch's metamask mp4 -NavBar navbar nodejs -NodeJS npm openinnewtab openInNewTab @@ -96,7 +88,6 @@ sdk signups src srcset -SrcSet stylesheets submenu submenus @@ -106,7 +97,6 @@ tld todo totp txt -TypeScript typescript ui url @@ -117,22 +107,20 @@ walkthrough webp xyz onchain -onchain serverless testnet latencygraphic onchain geo serverless -Vercel +vercel permissionless onchain deplatform -APIs -serverless +apis serverless -users’ -Functions’ +users' +functions' lodash repos -users’ +users' diff --git a/.github/workflows/grammar-spell-checker.yml b/.github/workflows/grammar-spell-checker.yml index 0e9645e9..4055fa9a 100644 --- a/.github/workflows/grammar-spell-checker.yml +++ b/.github/workflows/grammar-spell-checker.yml @@ -14,6 +14,10 @@ jobs: with: fetch-depth: 0 + - uses: oven-sh/setup-bun@v1 + with: + bun-version: latest + - name: Install Hunspell run: | sudo apt-get update @@ -31,9 +35,15 @@ jobs: echo for file in $diff; do - output=$(hunspell -l -d en_US -p .github/actions/spell-checker/ignore_words.txt "$file") + normalizedFile=$(mktemp) + + ./scripts/markdown-normalizer.ts "$file" > "$normalizedFile" + + output=$(hunspell -l -d en_US -p .github/actions/spell-checker/ignore_words.txt "$normalizedFile") typos_count=$(echo "$output" | wc -l) + rm "$normalizedFile" + if [[ -n "$output" ]]; then echo "🤓 Found the following typos in $file" echo diff --git a/scripts/markdown-normalizer.ts b/scripts/markdown-normalizer.ts new file mode 100755 index 00000000..56c8f712 --- /dev/null +++ b/scripts/markdown-normalizer.ts @@ -0,0 +1,32 @@ +#!/usr/bin/env bun + +import fs from 'fs'; + +if (!process.argv.slice(1).length) { + console.error("👹 Oops! Missing the filename argument."); + process.exit(1); +} + +const args = process.argv.slice(1); +const filePath = args[1]; +const fileContent = fs.readFileSync(filePath, 'utf-8'); + +// Markdown headings +const re1 = /---[\s\S]*?---/g; +// Code blocks +const re2 = /```[\s\S]*?```/g; +// Named URL +const re3 = /\[.*?\]\(.*?\)/g; + +try { + const content = fileContent + .replace(re1, '') + .replace(re2, '') + .replace(re3, '') + .toLowerCase(); + + process.stdout.write(content); +} catch (err) { + console.error("👹 Oops! Failed to normalize the file for some reason..."); + process.exit(1); +} From 90c72a55f31785c2e65a107da10f8841160f2227 Mon Sep 17 00:00:00 2001 From: Camila Sosa Morales Date: Mon, 10 Jun 2024 18:19:57 +0200 Subject: [PATCH 2/2] chore: update footer (#13) Demo: image image --------- Co-authored-by: nlc616 <97002998+nlc616@users.noreply.github.com> --- src/components/Footer/config.ts | 62 +++++++++++++++++++++------------ src/components/Footer/index.tsx | 6 ++-- src/settings.json | 6 ++-- 3 files changed, 47 insertions(+), 27 deletions(-) diff --git a/src/components/Footer/config.ts b/src/components/Footer/config.ts index 30019c86..f720c1b3 100644 --- a/src/components/Footer/config.ts +++ b/src/components/Footer/config.ts @@ -4,8 +4,10 @@ const { careersUrl, supportExternalUrl, reportAbuseUrl, - discordFleekCommunityUrl, statusURl, + mediaKit, + fleekNetworkWebsiteUrl, + templatesUrl, } = settings.site.resources; const { fleekPlatformOrgUrl } = settings.github; @@ -15,19 +17,19 @@ export default { developers: [ { text: 'Fleek Network', - url: 'https://fleek.network/', + url: fleekNetworkWebsiteUrl, target: '_blank', rel: 'noopener noreferrer', }, { - text: 'Github', - url: 'https://github.com/fleek-platform', + text: 'Changelog', + url: '/blog/changelog', target: '_blank', rel: 'noopener noreferrer', }, { - text: 'Changelog', - url: '/blog/changelog', + text: 'Github', + url: fleekPlatformOrgUrl, target: '_blank', rel: 'noopener noreferrer', }, @@ -38,21 +40,29 @@ export default { rel: 'noopener noreferrer', }, ], - legal: [ + company: [ { - text: 'Terms of Service', - url: '/legal/terms-of-service', + text: 'Blog', + url: '/blog', }, { - text: 'Privacy Policies', - url: '/legal/privacy-policy', + text: 'Pricing', + url: '/pricing', }, { - text: 'Report Abuse', - url: reportAbuseUrl, + text: 'Careers', + url: careersUrl, target: '_blank', rel: 'noopener noreferrer', }, + { + text: 'Terms of Service', + url: '/legal/terms-of-service', + }, + { + text: 'Privacy Policies', + url: '/legal/privacy-policy', + }, { text: 'Contact Us', url: reportAbuseUrl, @@ -75,29 +85,37 @@ export default { }, { text: 'Templates', - url: 'https://app.fleek.xyz/templates', + url: templatesUrl, target: '_blank', rel: 'noopener noreferrer', }, ], resources: [ { - text: 'Blog', - url: '/blog', - }, - { - text: 'Docs', + text: 'Documentation', url: '/docs', }, { text: 'Media Kit', - url: 'https://fleek.notion.site/Fleek-Brand-Kit-9a2bcf7eb40740a9b7e951fc951b478a', + url: mediaKit, target: '_blank', rel: 'noopener noreferrer', }, { - text: 'Careers', - url: careersUrl, + text: 'Guides', + url: '/guides', + }, + { + text: 'Support', + url: supportExternalUrl, + target: '_blank', + rel: 'noopener noreferrer', + }, + { + text: 'Report Abuse', + url: reportAbuseUrl, + target: '_blank', + rel: 'noopener noreferrer', }, ], }; diff --git a/src/components/Footer/index.tsx b/src/components/Footer/index.tsx index 197ba841..d51d0920 100644 --- a/src/components/Footer/index.tsx +++ b/src/components/Footer/index.tsx @@ -7,7 +7,7 @@ import Link, { Target } from '@components/Link'; import config from './config'; import { FaXTwitter } from 'react-icons/fa6'; -const { product, developers, legal, resources, fleekPlatformOrgUrl } = config; +const { product, developers, company, resources, fleekPlatformOrgUrl } = config; const Footer = () => { return ( @@ -108,9 +108,9 @@ const Footer = () => {
- Legal + Company
    - {legal.map((item, index) => ( + {company.map((item, index) => (