From 6581b9e130ac9f38c08e1c87f4ffa0cb5cc80648 Mon Sep 17 00:00:00 2001 From: Brian Douglas Date: Mon, 1 Apr 2024 16:12:34 -0700 Subject: [PATCH 1/6] feat: Use OpenSauced links instead of GitHub (#520) * swapping github links for opensauced ones. * hot points to app * fix build --- .eslintrc.cjs | 2 +- src/components/HotRepoCard.tsx | 52 +++++++++------------------------- src/lib/github.ts | 4 +-- 3 files changed, 17 insertions(+), 41 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index a726dd08..8f06d369 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -140,7 +140,7 @@ module.exports = { "arrow-spacing": "error", "block-spacing": ["error", "always"], "brace-style": ["error", "1tbs"], - "comma-dangle": ["error", "always-multiline"], + "comma-dangle": ["warn", "always-multiline"], "comma-spacing": [ "error", { diff --git a/src/components/HotRepoCard.tsx b/src/components/HotRepoCard.tsx index 6aad86e5..0693e9db 100644 --- a/src/components/HotRepoCard.tsx +++ b/src/components/HotRepoCard.tsx @@ -30,7 +30,7 @@ const HotRepoCard = ({ repoName }: HotRepoCardProps): JSX.Element => { rel="noreferrer" target="_blank" href={`${String( - `${bugReportLink} repo not found [${repoName}]&body=Please take a look why this ${repoName} not founded`, + `${bugReportLink} repo not found [${repoName}]&body=Please take a look why this ${repoName} not founded` )}`} > Report a bug @@ -43,10 +43,7 @@ const HotRepoCard = ({ repoName }: HotRepoCardProps): JSX.Element => { if (isLoading) { return (
- +
); } @@ -58,62 +55,41 @@ const HotRepoCard = ({ repoName }: HotRepoCardProps): JSX.Element => {
- Hot Repo Icon - - - {owner} - + Hot Repo Icon + + {owner}
{name} -

- {description} -

+

{description}

- - - - {humanizeNumber(issues)} - + + + {humanizeNumber(issues)}
- - - - {humanizeNumber(stars)} - + + + {humanizeNumber(stars)}
- + 0
diff --git a/src/lib/github.ts b/src/lib/github.ts index c735d0b4..0a57a2fb 100644 --- a/src/lib/github.ts +++ b/src/lib/github.ts @@ -2,10 +2,10 @@ const getAvatarLink = (username: string | null) => `https://github.com/${username ?? "github"}.png?size=460`; const getProfileLink = (username: string | null) => - `https://github.com/${username ?? ""}`; + `https://app.opensauced.pizza/user/${username ?? ""}`; const getRepoLink = (repoName: string | null) => - `https://app.opensauced.pizza/${repoName ?? ""}`; + `https://app.opensauced.pizza/s/${repoName ?? ""}`; const getRepoIssuesLink = (repoName: string | null) => `https://github.com/${repoName && `${repoName}/issues` || ""}`; From 029f091db1a0a9df04ba58aa2943145afe3e89ef Mon Sep 17 00:00:00 2001 From: Brian Douglas Date: Mon, 1 Apr 2024 23:15:16 +0000 Subject: [PATCH 2/6] chore(minor): release 2.37.0-beta.1 on beta channel [skip ci] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## [2.37.0-beta.1](https://github.com/open-sauced/hot/compare/v2.36.0...v2.37.0-beta.1) (2024-04-01) ### πŸ• Features * Use OpenSauced links instead of GitHub ([#520](https://github.com/open-sauced/hot/issues/520)) ([6581b9e](https://github.com/open-sauced/hot/commit/6581b9e130ac9f38c08e1c87f4ffa0cb5cc80648)) --- CHANGELOG.md | 7 +++++++ npm-shrinkwrap.json | 4 ++-- package.json | 2 +- public/diagram.svg | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 599a057d..a2916e53 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ > All notable changes to this project will be documented in this file +## [2.37.0-beta.1](https://github.com/open-sauced/hot/compare/v2.36.0...v2.37.0-beta.1) (2024-04-01) + + +### πŸ• Features + +* Use OpenSauced links instead of GitHub ([#520](https://github.com/open-sauced/hot/issues/520)) ([6581b9e](https://github.com/open-sauced/hot/commit/6581b9e130ac9f38c08e1c87f4ffa0cb5cc80648)) + ## [2.36.0](https://github.com/open-sauced/hot/compare/v2.35.0...v2.36.0) (2024-04-01) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 43395bff..20287ae9 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,12 +1,12 @@ { "name": "@open-sauced/hot", - "version": "2.36.0", + "version": "2.37.0-beta.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@open-sauced/hot", - "version": "2.36.0", + "version": "2.37.0-beta.1", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index b46d1815..9a2a8e1f 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@open-sauced/hot", "description": "πŸ•The site that recommends the hottest sauce.", "keywords": [], - "version": "2.36.0", + "version": "2.37.0-beta.1", "author": "TED Vortex ", "private": true, "license": "MIT", diff --git a/public/diagram.svg b/public/diagram.svg index 9307c47a..b31d883e 100644 --- a/public/diagram.svg +++ b/public/diagram.svg @@ -1 +1 @@ -liblibhookshookscomponentscomponentsassetsassetsvalidateUrl.test.tsvalidateUrl.test.tsvalidateUrl.test.tssupabase.tssupabase.tssupabase.tsvalidateUrl.tsvalidateUrl.tsvalidateUrl.tsgetDateFr...getDateFr...getDateFr...locations...locations...locations...humanize...humanize...humanize...useSupabase...useSupabase...useSupabase...useContri...useContri...useContri...useRepos...useRepos...useRepos...PrimaryNav.tsxPrimaryNav.tsxPrimaryNav.tsxFooter.tsxFooter.tsxFooter.tsxHero.tsxHero.tsxHero.tsxAdminStatusBar.tsxAdminStatusBar.tsxAdminStatusBar.tsxRecentRepoListWrap...RecentRepoListWrap...RecentRepoListWrap...RepoSubmission.tsxRepoSubmission.tsxRepoSubmission.tsxHotRepoCard.tsxHotRepoCard.tsxHotRepoCard.tsxRepoList.tsxRepoList.tsxRepoList.tsxAvatar.tsxAvatar.tsxAvatar.tsxSearchedRepoC...SearchedRepoC...SearchedRepoC...ListReposito...ListReposito...ListReposito...StarTheRepo.tsxStarTheRepo.tsxStarTheRepo.tsxRepoListWrap...RepoListWrap...RepoListWrap...SecondaryNa...SecondaryNa...SecondaryNa...HotReposi...HotReposi...HotReposi...StackedAv...StackedAv...StackedAv...styles/index.cssstyles/index.cssstyles/index.csse2e-tests/loggedO...e2e-tests/loggedO...e2e-tests/loggedO...App.tsxApp.tsxApp.tsxvite-types....vite-types....vite-types.....css.svg.ts.tsxeach dot sized by file size \ No newline at end of file +liblibhookshookscomponentscomponentsassetsassetsvalidateUrl.test.tsvalidateUrl.test.tsvalidateUrl.test.tssupabase.tssupabase.tssupabase.tsvalidateUrl.tsvalidateUrl.tsvalidateUrl.tsgetDateFr...getDateFr...getDateFr...locations...locations...locations...humanize...humanize...humanize...useSupabase...useSupabase...useSupabase...useContri...useContri...useContri...useRepos...useRepos...useRepos...PrimaryNav.tsxPrimaryNav.tsxPrimaryNav.tsxFooter.tsxFooter.tsxFooter.tsxHero.tsxHero.tsxHero.tsxAdminStatusBar.tsxAdminStatusBar.tsxAdminStatusBar.tsxRecentRepoListWrap...RecentRepoListWrap...RecentRepoListWrap...RepoSubmission.tsxRepoSubmission.tsxRepoSubmission.tsxHotRepoCard.tsxHotRepoCard.tsxHotRepoCard.tsxRepoList.tsxRepoList.tsxRepoList.tsxAvatar.tsxAvatar.tsxAvatar.tsxSearchedRepoC...SearchedRepoC...SearchedRepoC...ListReposito...ListReposito...ListReposito...StarTheRepo.tsxStarTheRepo.tsxStarTheRepo.tsxRepoListWrap...RepoListWrap...RepoListWrap...SecondaryNa...SecondaryNa...SecondaryNa...HotReposi...HotReposi...HotReposi...StackedAv...StackedAv...StackedAv...styles/index.cssstyles/index.cssstyles/index.csse2e-tests/loggedO...e2e-tests/loggedO...e2e-tests/loggedO...App.tsxApp.tsxApp.tsxvite-types....vite-types....vite-types.....css.svg.ts.tsxeach dot sized by file size \ No newline at end of file From 73afcf6e9a3b314472d5c8feea0bf5d4e59e9831 Mon Sep 17 00:00:00 2001 From: Brian Douglas Date: Sat, 13 Apr 2024 09:24:12 -0700 Subject: [PATCH 3/6] feat: Update robots.txt --- public/robots.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/robots.txt b/public/robots.txt index e9e57dc4..f30ce23d 100644 --- a/public/robots.txt +++ b/public/robots.txt @@ -1,3 +1,3 @@ -# https://www.robotstxt.org/robotstxt.html +# Allow all crawlers User-agent: * -Disallow: +Allow: / From c95ae1e8b6d700d21c0ef040b6cadce1029da780 Mon Sep 17 00:00:00 2001 From: Brian Douglas Date: Sat, 13 Apr 2024 16:26:33 +0000 Subject: [PATCH 4/6] chore(minor): release 2.37.0-beta.2 on beta channel [skip ci] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## [2.37.0-beta.2](https://github.com/open-sauced/hot/compare/v2.37.0-beta.1...v2.37.0-beta.2) (2024-04-13) ### πŸ• Features * Update robots.txt ([73afcf6](https://github.com/open-sauced/hot/commit/73afcf6e9a3b314472d5c8feea0bf5d4e59e9831)) --- CHANGELOG.md | 7 +++++++ npm-shrinkwrap.json | 4 ++-- package.json | 2 +- public/diagram.svg | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a2916e53..3180c259 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ > All notable changes to this project will be documented in this file +## [2.37.0-beta.2](https://github.com/open-sauced/hot/compare/v2.37.0-beta.1...v2.37.0-beta.2) (2024-04-13) + + +### πŸ• Features + +* Update robots.txt ([73afcf6](https://github.com/open-sauced/hot/commit/73afcf6e9a3b314472d5c8feea0bf5d4e59e9831)) + ## [2.37.0-beta.1](https://github.com/open-sauced/hot/compare/v2.36.0...v2.37.0-beta.1) (2024-04-01) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 20287ae9..5d5c37af 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,12 +1,12 @@ { "name": "@open-sauced/hot", - "version": "2.37.0-beta.1", + "version": "2.37.0-beta.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@open-sauced/hot", - "version": "2.37.0-beta.1", + "version": "2.37.0-beta.2", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 9a2a8e1f..564bb914 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@open-sauced/hot", "description": "πŸ•The site that recommends the hottest sauce.", "keywords": [], - "version": "2.37.0-beta.1", + "version": "2.37.0-beta.2", "author": "TED Vortex ", "private": true, "license": "MIT", diff --git a/public/diagram.svg b/public/diagram.svg index b31d883e..d0cb3030 100644 --- a/public/diagram.svg +++ b/public/diagram.svg @@ -1 +1 @@ -liblibhookshookscomponentscomponentsassetsassetsvalidateUrl.test.tsvalidateUrl.test.tsvalidateUrl.test.tssupabase.tssupabase.tssupabase.tsvalidateUrl.tsvalidateUrl.tsvalidateUrl.tsgetDateFr...getDateFr...getDateFr...locations...locations...locations...humanize...humanize...humanize...useSupabase...useSupabase...useSupabase...useContri...useContri...useContri...useRepos...useRepos...useRepos...PrimaryNav.tsxPrimaryNav.tsxPrimaryNav.tsxFooter.tsxFooter.tsxFooter.tsxHero.tsxHero.tsxHero.tsxAdminStatusBar.tsxAdminStatusBar.tsxAdminStatusBar.tsxRecentRepoListWrap...RecentRepoListWrap...RecentRepoListWrap...RepoSubmission.tsxRepoSubmission.tsxRepoSubmission.tsxHotRepoCard.tsxHotRepoCard.tsxHotRepoCard.tsxRepoList.tsxRepoList.tsxRepoList.tsxAvatar.tsxAvatar.tsxAvatar.tsxSearchedRepoC...SearchedRepoC...SearchedRepoC...ListReposito...ListReposito...ListReposito...StarTheRepo.tsxStarTheRepo.tsxStarTheRepo.tsxRepoListWrap...RepoListWrap...RepoListWrap...SecondaryNa...SecondaryNa...SecondaryNa...HotReposi...HotReposi...HotReposi...StackedAv...StackedAv...StackedAv...styles/index.cssstyles/index.cssstyles/index.csse2e-tests/loggedO...e2e-tests/loggedO...e2e-tests/loggedO...App.tsxApp.tsxApp.tsxvite-types....vite-types....vite-types.....css.svg.ts.tsxeach dot sized by file size \ No newline at end of file +liblibhookshookscomponentscomponentsassetsassetsvalidateUrl.test.tsvalidateUrl.test.tsvalidateUrl.test.tssupabase.tssupabase.tssupabase.tsvalidateUrl.tsvalidateUrl.tsvalidateUrl.tsgetDateFr...getDateFr...getDateFr...locations...locations...locations...humanize...humanize...humanize...useSupabase...useSupabase...useSupabase...useContri...useContri...useContri...useRepos...useRepos...useRepos...PrimaryNav.tsxPrimaryNav.tsxPrimaryNav.tsxFooter.tsxFooter.tsxFooter.tsxHero.tsxHero.tsxHero.tsxAdminStatusBar.tsxAdminStatusBar.tsxAdminStatusBar.tsxRecentRepoListWrap...RecentRepoListWrap...RecentRepoListWrap...RepoSubmission.tsxRepoSubmission.tsxRepoSubmission.tsxHotRepoCard.tsxHotRepoCard.tsxHotRepoCard.tsxRepoList.tsxRepoList.tsxRepoList.tsxAvatar.tsxAvatar.tsxAvatar.tsxSearchedRepoC...SearchedRepoC...SearchedRepoC...ListReposito...ListReposito...ListReposito...StarTheRepo.tsxStarTheRepo.tsxStarTheRepo.tsxRepoListWrap...RepoListWrap...RepoListWrap...SecondaryNa...SecondaryNa...SecondaryNa...HotReposi...HotReposi...HotReposi...StackedAv...StackedAv...StackedAv...styles/index.cssstyles/index.cssstyles/index.csse2e-tests/loggedO...e2e-tests/loggedO...e2e-tests/loggedO...App.tsxApp.tsxApp.tsxvite-types....vite-types....vite-types.....css.svg.ts.tsxeach dot sized by file size \ No newline at end of file From 69ba68380d2aee66274e17543effbd3cfd63350a Mon Sep 17 00:00:00 2001 From: Brian Douglas Date: Sat, 13 Apr 2024 10:37:41 -0700 Subject: [PATCH 5/6] feat: working hotlist with needed cleanup (#521) * working hotlist with needed cleanup * removes the hot repo cards * update test * npm run format * removes unused statusCode function * removes unused recent repo list * fix DbRepo type --- .eslintrc.cjs | 2 +- src/App.tsx | 26 +---- src/components/Hero.tsx | 26 +++-- src/components/HotRepoCard.tsx | 5 +- src/components/ListRepositories.tsx | 25 +---- src/components/PrimaryNav.tsx | 65 +++--------- src/components/RecentRepoListWrap.tsx | 138 -------------------------- src/components/RepoList.tsx | 41 +++----- src/components/RepoListWrap.tsx | 34 +------ src/components/SecondaryNav.tsx | 5 +- src/e2e-tests/loggedOutUser.spec.ts | 17 +--- src/hooks/useContributions.ts | 2 +- src/hooks/useHotList.ts | 14 +++ src/vite-types.d.ts | 2 + 14 files changed, 85 insertions(+), 317 deletions(-) delete mode 100644 src/components/RecentRepoListWrap.tsx create mode 100644 src/hooks/useHotList.ts diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 8f06d369..2863aacd 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -216,7 +216,7 @@ module.exports = { "no-trailing-spaces": "error", "no-whitespace-before-property": "error", "object-curly-newline": [ - "error", + "warn", { multiline: true, }, diff --git a/src/App.tsx b/src/App.tsx index 32874044..fd4a097c 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -2,7 +2,7 @@ import Footer from "./components/Footer"; import PrimaryNav from "./components/PrimaryNav"; import RepoListWrap from "./components/RepoListWrap"; import { initiatePostHog } from "./lib/analytics"; -import { BrowserRouter, Route, Routes } from "react-router-dom"; +import { BrowserRouter } from "react-router-dom"; import { Toaster } from "react-hot-toast"; import { SWRConfig } from "swr"; import GradBackground from "./components/GradBackground"; @@ -10,9 +10,6 @@ import Hero from "./components/Hero"; import apiFetcher from "./hooks/useSWR"; import getAppVersion from "./lib/appVersion"; -import RecentRepoListWrap from "./components/RecentRepoListWrap"; -import SecondaryNav from "./components/SecondaryNav"; -import HotRepositories from "./components/HotRepositories"; console.log( `%c @@ -47,26 +44,7 @@ const App = (): JSX.Element => {
- - - - - - } - path="/" - /> - - } - path="recent" - /> - - } - path="*" - /> - +
diff --git a/src/components/Hero.tsx b/src/components/Hero.tsx index bb302454..c62d1191 100644 --- a/src/components/Hero.tsx +++ b/src/components/Hero.tsx @@ -57,18 +57,27 @@ const Hero = () => {

{`Find `} + Open-Source Repositories +
to contribute today

- +
- search icon + search icon { placeholder="Search repositories" type="text" value={searchTerm} - onChange={(e) => setValueDebounced(e.target.value)} + onChange={e => setValueDebounced(e.target.value)} onFocus={() => setFocus(true)} onBlur={() => setTimeout(() => { setFocus(false); - }, 200) - } + }, 200)} onKeyUp={(event: React.KeyboardEvent) => { if (event.key === "Enter") { window.open(comboBoxSelection, "_blank", "noreferrer"); @@ -94,7 +102,11 @@ const Hero = () => {
- command k + command k
@@ -105,7 +117,7 @@ const Hero = () => {

Repository

- {fetchedData.map((data) => ( + {fetchedData.map(data => ( { const { repo, isLoading, isError } = useRepo(repoName); - const { data: contributions } = useContributions(repoName); if (isError) { return ( @@ -95,7 +92,7 @@ const HotRepoCard = ({ repoName }: HotRepoCardProps): JSX.Element => {
- + {/* */}
); diff --git a/src/components/ListRepositories.tsx b/src/components/ListRepositories.tsx index 9064ed6a..bc2ab1e7 100644 --- a/src/components/ListRepositories.tsx +++ b/src/components/ListRepositories.tsx @@ -4,19 +4,11 @@ import Skeleton from "react-loading-skeleton"; export declare interface ListRepositoriesProps { activeLink: string | null; - handleLoadingMore: () => void; fetchedData: DbRepo[]; title: string; - hasNextPage: boolean; } -const ListRepositories = ({ - activeLink, - handleLoadingMore, - fetchedData, - title, - hasNextPage, -}: ListRepositoriesProps): JSX.Element => { +const ListRepositories = ({ activeLink, fetchedData, title }: ListRepositoriesProps): JSX.Element => { if (!fetchedData.length) { return (
@@ -32,7 +24,7 @@ const ListRepositories = ({ } return ( -
+
@@ -41,20 +33,9 @@ const ListRepositories = ({
{fetchedData.map((item, i) => ( - + ))}
- - {fetchedData.length > 0 && hasNextPage && ( -
- -
- )}
); }; diff --git a/src/components/PrimaryNav.tsx b/src/components/PrimaryNav.tsx index d53020ac..0de05cfb 100644 --- a/src/components/PrimaryNav.tsx +++ b/src/components/PrimaryNav.tsx @@ -8,8 +8,6 @@ import openSaucedLogo from "../assets/openSauced.svg"; import { supabase } from "../lib/supabase"; import { ToastTrigger } from "../lib/reactHotToast"; -import RepoSubmission from "./RepoSubmission"; - import { useState, useEffect } from "react"; import AdminStatsBar from "./AdminStatusBar"; import { useKey } from "rooks"; @@ -21,22 +19,20 @@ const bugReportLink = const PrimaryNav = (): JSX.Element => { const { signIn, signOut, userAndTokens } = useSupabaseAuth(); const currentUser = supabase.auth.session(); - const [isFormOpen, setIsFormOpen] = useState(false); const [openAdminBar, setOpenAdminBar] = useState(false); useKey("`", () => setOpenAdminBar(!openAdminBar)); - const handleFormOpen = (state: boolean) => setIsFormOpen(state); - useEffect(() => { const fetchAuthSession = async () => { if (currentUser?.access_token) { - await fetch(`${import.meta.env.VITE_API_URL}/auth/session`, { headers: { accept: "application/json", Authorization: `Bearer ${currentUser.access_token}` } }) - .catch(err => console.log("error: ", err)); + await fetch(`${import.meta.env.VITE_API_URL}/auth/session`, { + headers: { accept: "application/json", Authorization: `Bearer ${currentUser.access_token}` }, + }).catch((err) => console.log("error: ", err)); } }; - fetchAuthSession().catch(err => console.log(err)); + fetchAuthSession().catch((err) => console.log(err)); }, [userAndTokens]); return ( @@ -46,22 +42,14 @@ const PrimaryNav = (): JSX.Element => {
- Open Sauced Logo + Open Sauced Logo OpenSauced
{userAndTokens && ( - - +
@@ -79,13 +67,9 @@ const PrimaryNav = (): JSX.Element => { />
- - -
- {
-

- {userAndTokens.user.user_metadata.full_name} -

+

{userAndTokens.user.user_metadata.full_name}

-

- {userAndTokens.user.user_metadata.user_name} -

+

{userAndTokens.user.user_metadata.user_name}

@@ -120,7 +100,8 @@ const PrimaryNav = (): JSX.Element => { {({ active }) => ( - )} - - - - {({ active }) => ( -