From a024b412aa895d1d52cc9b3236b29bec24ac54ae Mon Sep 17 00:00:00 2001 From: Luca Forstner Date: Mon, 29 Jul 2024 10:45:35 +0200 Subject: [PATCH 1/4] ref: Remove old changelog code --- .env.example | 4 - .github/workflows/algolia-index.yml | 4 - .github/workflows/lint-404s.yml | 4 - app/changelog/%5Fadmin/[id]/edit/page.tsx | 96 ----- app/changelog/%5Fadmin/confirm.tsx | 25 -- app/changelog/%5Fadmin/create/page.tsx | 65 ---- app/changelog/%5Fadmin/layout.tsx | 33 -- app/changelog/%5Fadmin/loading.tsx | 13 - app/changelog/%5Fadmin/page.tsx | 140 ------- app/changelog/%5Fadmin/upload/route.tsx | 44 --- app/changelog/[slug]/loading.tsx | 13 - app/changelog/[slug]/page.tsx | 121 ------ app/changelog/error.tsx | 39 -- app/changelog/feed.xml/route.ts | 41 -- app/changelog/globals.css | 1 - app/changelog/header.tsx | 37 -- app/changelog/layout.tsx | 30 -- app/changelog/loading.tsx | 41 -- app/changelog/not-found.tsx | 23 -- app/changelog/page.tsx | 41 -- app/changelog/utils.ts | 21 -- app/globals.css | 14 +- app/layout.tsx | 3 +- prisma/migrations/0_init/migration.sql | 121 ------ prisma/schema.prisma | 80 ---- prisma/seed/seed.mjs | 84 ----- public/changelog/assets/hero.png | Bin 882909 -> 0 bytes public/changelog/assets/squiggle.png | Bin 28701 -> 0 bytes public/{changelog/assets => }/og.png | Bin src/actions/changelog.ts | 147 -------- src/components/changelog/article.tsx | 79 ---- .../changelog/articleFooter/index.tsx | 24 -- .../changelog/articleFooter/styles.module.css | 5 - src/components/changelog/date.tsx | 16 - src/components/changelog/editor.tsx | 214 ----------- src/components/changelog/fileUpload.tsx | 33 -- src/components/changelog/forwardRefEditor.tsx | 18 - src/components/changelog/list.tsx | 234 ------------ src/components/changelog/loginButton.tsx | 31 -- src/components/changelog/navbar.tsx | 178 --------- src/components/changelog/pagination.tsx | 107 ------ src/components/changelog/tag.tsx | 15 - src/components/changelog/titleSlug.tsx | 49 --- src/components/changelog/ui/Button/index.tsx | 62 --- .../changelog/ui/Button/styles.module.scss | 106 ------ src/components/changelog/ui/Input.tsx | 32 -- src/components/changelog/ui/Select.tsx | 27 -- src/components/changelog/uploadImage.ts | 20 - src/constants.ts | 352 ------------------ src/middleware.ts | 3 +- 50 files changed, 7 insertions(+), 2883 deletions(-) delete mode 100644 app/changelog/%5Fadmin/[id]/edit/page.tsx delete mode 100644 app/changelog/%5Fadmin/confirm.tsx delete mode 100644 app/changelog/%5Fadmin/create/page.tsx delete mode 100644 app/changelog/%5Fadmin/layout.tsx delete mode 100644 app/changelog/%5Fadmin/loading.tsx delete mode 100644 app/changelog/%5Fadmin/page.tsx delete mode 100644 app/changelog/%5Fadmin/upload/route.tsx delete mode 100644 app/changelog/[slug]/loading.tsx delete mode 100644 app/changelog/[slug]/page.tsx delete mode 100644 app/changelog/error.tsx delete mode 100644 app/changelog/feed.xml/route.ts delete mode 100644 app/changelog/globals.css delete mode 100644 app/changelog/header.tsx delete mode 100644 app/changelog/layout.tsx delete mode 100644 app/changelog/loading.tsx delete mode 100644 app/changelog/not-found.tsx delete mode 100644 app/changelog/page.tsx delete mode 100644 app/changelog/utils.ts delete mode 100644 prisma/migrations/0_init/migration.sql delete mode 100644 prisma/schema.prisma delete mode 100644 prisma/seed/seed.mjs delete mode 100644 public/changelog/assets/hero.png delete mode 100644 public/changelog/assets/squiggle.png rename public/{changelog/assets => }/og.png (100%) delete mode 100644 src/actions/changelog.ts delete mode 100644 src/components/changelog/article.tsx delete mode 100644 src/components/changelog/articleFooter/index.tsx delete mode 100644 src/components/changelog/articleFooter/styles.module.css delete mode 100644 src/components/changelog/date.tsx delete mode 100644 src/components/changelog/editor.tsx delete mode 100644 src/components/changelog/fileUpload.tsx delete mode 100644 src/components/changelog/forwardRefEditor.tsx delete mode 100644 src/components/changelog/list.tsx delete mode 100644 src/components/changelog/loginButton.tsx delete mode 100644 src/components/changelog/navbar.tsx delete mode 100644 src/components/changelog/pagination.tsx delete mode 100644 src/components/changelog/tag.tsx delete mode 100644 src/components/changelog/titleSlug.tsx delete mode 100644 src/components/changelog/ui/Button/index.tsx delete mode 100644 src/components/changelog/ui/Button/styles.module.scss delete mode 100644 src/components/changelog/ui/Input.tsx delete mode 100644 src/components/changelog/ui/Select.tsx delete mode 100644 src/components/changelog/uploadImage.ts delete mode 100644 src/constants.ts diff --git a/.env.example b/.env.example index 94533a182c849..2075bd01721f4 100644 --- a/.env.example +++ b/.env.example @@ -5,7 +5,3 @@ NEXT_PUBLIC_ALGOLIA_APP_ID=OOK48W9UCL NEXT_PUBLIC_ALGOLIA_SEARCH_KEY=ca98597f559459c216891b75989832f8 - -DATABASE_URL=postgresql://postgres:postgres@localhost:5432/changelog -NEXTAUTH_URL=http://localhost:3000 -NEXTAUTH_SECRET=secret diff --git a/.github/workflows/algolia-index.yml b/.github/workflows/algolia-index.yml index 37bfa5ea348e0..ebe5c52cabff2 100644 --- a/.github/workflows/algolia-index.yml +++ b/.github/workflows/algolia-index.yml @@ -33,10 +33,6 @@ jobs: - run: yarn install --frozen-lockfile if: steps.cache.outputs.cache-hit != 'true' - # Remove the changelog directory to avoid a build error due to missing `DATABASE_URL` - # and save some build time. - - run: rm -r app/changelog - # bun seems to be the most straightforward way to run a TypeScript script # without introducing another dependency like ts-node or tsx for everyone else diff --git a/.github/workflows/lint-404s.yml b/.github/workflows/lint-404s.yml index f0383875b5281..35e20ea42f448 100644 --- a/.github/workflows/lint-404s.yml +++ b/.github/workflows/lint-404s.yml @@ -35,10 +35,6 @@ jobs: - run: yarn install --frozen-lockfile if: steps.cache.outputs.cache-hit != 'true' - # Remove the changelog directory to avoid a build error due to missing `DATABASE_URL` - # and save some build time. - - run: rm -r app/changelog - - run: yarn build if: steps.filter.outputs.docs == 'true' diff --git a/app/changelog/%5Fadmin/[id]/edit/page.tsx b/app/changelog/%5Fadmin/[id]/edit/page.tsx deleted file mode 100644 index 4eaec1fa5e0a0..0000000000000 --- a/app/changelog/%5Fadmin/[id]/edit/page.tsx +++ /dev/null @@ -1,96 +0,0 @@ -import {Fragment, Suspense} from 'react'; -import Link from 'next/link'; - -import {editChangelog} from 'sentry-docs/actions/changelog'; -import {FileUpload} from 'sentry-docs/components/changelog/fileUpload'; -import {ForwardRefEditor} from 'sentry-docs/components/changelog/forwardRefEditor'; -import {TitleSlug} from 'sentry-docs/components/changelog/titleSlug'; -import {Button} from 'sentry-docs/components/changelog/ui/Button'; -import {Select} from 'sentry-docs/components/changelog/ui/Select'; -import prisma from 'sentry-docs/prisma'; - -export default async function ChangelogCreatePage({params}) { - const categories = await prisma.category.findMany({ - orderBy: { - name: 'asc', - }, - }); - const changelog = await prisma.changelog.findUnique({ - where: {id: params.id}, - include: { - author: true, - categories: true, - }, - }); - - if (!changelog) { - return ( - -
-

Changelog not found

-
-
- Return to Changelogs list -
-
- ); - } - - return ( -
-
- - - -
- - - - This will be shown in the list - -
-
- - - - ); -} diff --git a/app/changelog/%5Fadmin/create/page.tsx b/app/changelog/%5Fadmin/create/page.tsx deleted file mode 100644 index fc0f211dc9756..0000000000000 --- a/app/changelog/%5Fadmin/create/page.tsx +++ /dev/null @@ -1,65 +0,0 @@ -import {Fragment} from 'react'; -import Link from 'next/link'; - -import {createChangelog} from 'sentry-docs/actions/changelog'; -import {FileUpload} from 'sentry-docs/components/changelog/fileUpload'; -import {ForwardRefEditor} from 'sentry-docs/components/changelog/forwardRefEditor'; -import {TitleSlug} from 'sentry-docs/components/changelog/titleSlug'; -import {Button} from 'sentry-docs/components/changelog/ui/Button'; -import {Select} from 'sentry-docs/components/changelog/ui/Select'; -import prisma from 'sentry-docs/prisma'; - -export default async function ChangelogCreatePage() { - const categories = await prisma.category.findMany({ - orderBy: { - name: 'asc', - }, - }); - - return ( -
-
- - -
- -