Skip to content

Commit

Permalink
Merge pull request #1 from realslimsutton/changelog
Browse files Browse the repository at this point in the history
feat: added changelog
  • Loading branch information
realslimsutton authored Jul 13, 2024
2 parents 08569f5 + 305153a commit de9d51f
Show file tree
Hide file tree
Showing 11 changed files with 208 additions and 27 deletions.
29 changes: 29 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name-template: "v$RESOLVED_VERSION 🌈"
tag-template: "v$RESOLVED_VERSION"
categories:
- title: "🚀 Features"
labels:
- "feature"
- "enhancement"
- "feat"
- title: "🐛 Bug Fixes"
labels:
- "fix"
- "bugfix"
- "bug"
- title: "🧰 Maintenance"
label: "chore"
change-template: "- $TITLE @$AUTHOR (#$NUMBER)"
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
version-resolver:
major:
labels:
- "major"
minor:
labels:
- "minor"
patch:
labels:
- "patch"
default: patch
template: $CHANGES
24 changes: 24 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Release Drafter

on:
push:
branches:
- main
pull_request:
types: [opened, reopened, synchronize]
pull_request_target:
types: [opened, reopened, synchronize]

permissions:
contents: read

jobs:
update_release_draft:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52 changes: 52 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: "Update Changelog"

on:
release:
types: [released]

permissions:
contents: write

jobs:
update:
runs-on: ubuntu-latest
timeout-minutes: 5

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: main

- name: Update Changelog
uses: stefanzweifel/changelog-updater-action@v1
with:
latest-version: ${{ github.event.release.name }}
release-notes: ${{ github.event.release.body }}

- name: Commit updated CHANGELOG
uses: stefanzweifel/git-auto-commit-action@v5
with:
branch: main
commit_message: Update CHANGELOG
file_pattern: CHANGELOG.md

- name: Commit updated CHANGELOG
uses: stefanzweifel/git-auto-commit-action@v5
with:
branch: main
commit_message: Update CHANGELOG
file_pattern: CHANGELOG.md

Deploy-Production:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}
Empty file added CHANGELOG.md
Empty file.
Binary file modified bun.lockb
Binary file not shown.
8 changes: 8 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ const config = {
];
},
skipTrailingSlashRedirect: true,
webpack(config) {
config.module.rules.push({
test: /\.md$/,
use: "raw-loader",
});

return config;
},
};

export default config;
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"db:migrate": "drizzle-kit migrate",
"db:push": "drizzle-kit push",
"db:studio": "drizzle-kit studio",
"dev": "next dev --turbo",
"dev": "next dev",
"lint": "next lint",
"start": "next start"
},
Expand Down Expand Up @@ -60,12 +60,15 @@
"next-themes": "^0.3.0",
"partysocket": "^1.0.1",
"postgres": "^3.4.4",
"raw-loader": "^4.0.2",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-hook-form": "^7.52.1",
"react-icon-cloud": "^4.1.4",
"react-intersection-observer": "^9.10.3",
"react-markdown": "^9.0.1",
"react-timeago": "^7.2.0",
"remark-gfm": "^4.0.0",
"sharp": "^0.33.4",
"sonner": "^1.5.0",
"tailwind-merge": "^2.4.0",
Expand All @@ -75,6 +78,8 @@
"zod": "^3.23.8"
},
"devDependencies": {
"@tailwindcss/forms": "^0.5.7",
"@tailwindcss/typography": "^0.5.13",
"@types/eslint": "^8.56.10",
"@types/node": "^20.14.10",
"@types/react": "^18.3.3",
Expand Down
24 changes: 11 additions & 13 deletions src/app/(public)/_components/navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ export function DesktopNavigation({ user }: { user: User | null }) {
[pathname],
);

const isBlogPage = React.useMemo(
() => isRouteActive(pathname, "/blog"),
const isChangelogPage = React.useMemo(
() => isRouteActive(pathname, "/changelog"),
[pathname],
);

Expand Down Expand Up @@ -161,8 +161,8 @@ export function DesktopNavigation({ user }: { user: User | null }) {
className={cn({
"bg-transparent hover:bg-transparent focus:bg-transparent data-[active]:bg-transparent data-[state=open]:bg-transparent":
true,
"text-muted-foreground": !isBlogPage,
"text-accent-foreground": isBlogPage,
"text-muted-foreground": !isChangelogPage,
"text-accent-foreground": isChangelogPage,
})}
>
Resources
Expand All @@ -171,12 +171,11 @@ export function DesktopNavigation({ user }: { user: User | null }) {
<NavigationMenuContent>
<ul className="grid w-[550px] grid-cols-2 p-2">
<DesktopListItem
href="#"
title="Blog"
active={isBlogPage}
comingSoon={true}
href="/changelog"
title="Changelog"
active={isChangelogPage}
>
Read our latest blog posts.
Read our latest changes.
</DesktopListItem>

<DesktopListItem href="/#faq" title="FAQ" active={false}>
Expand Down Expand Up @@ -337,12 +336,11 @@ export function MobileNavigation() {
<CollapsibleContent>
<div className="-mx-6 grid gap-6 bg-muted p-6">
<MobileListDropdownItem
href="#"
title="Blog"
href="/changelog"
title="Changelog"
onClick={() => setOpen(false)}
comingSoon={true}
>
Read our latest blog posts.
Read our latest changes.
</MobileListDropdownItem>

<MobileListDropdownItem
Expand Down
67 changes: 67 additions & 0 deletions src/app/(public)/changelog/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import PageHeader from "../_components/page-header";
import Markdown from "react-markdown";
import remarkGfm from "remark-gfm";
import changelog from "~/../CHANGELOG.md";
import { Card, CardContent } from "~/components/ui/card";

export default function ChangelogPage() {
return (
<>
<PageHeader>Changelog</PageHeader>

<article className="prose xl:prose-xl container mx-auto">
<Card>
<CardContent>
<Markdown
remarkPlugins={[remarkGfm]}
components={{
h1: Header1,
h2: Header2,
h3: Header3,
p: Paragraph,
ol: OrderedList,
ul: UnorderedList,
table: Table,
}}
>
{String(changelog)}
</Markdown>
</CardContent>
</Card>
</article>
</>
);
}

function Header1(props: React.HTMLAttributes<HTMLHeadingElement>) {
return <h2 className="mb-2 mt-6 text-5xl font-bold" {...props} />;
}

function Header2(props: React.HTMLAttributes<HTMLHeadingElement>) {
return <h2 className="mb-2 mt-6 text-3xl font-bold" {...props} />;
}

function Header3(props: React.HTMLAttributes<HTMLHeadingElement>) {
return <h2 className="mb-2 mt-6 text-xl font-bold" {...props} />;
}

function Paragraph(props: React.HTMLAttributes<HTMLParagraphElement>) {
return <p className="mb-4" {...props} />;
}

function OrderedList(props: React.HTMLAttributes<HTMLOListElement>) {
return <ol className="ml-8 list-decimal" {...props} />;
}

function UnorderedList(props: React.HTMLAttributes<HTMLUListElement>) {
return <ul className="ml-8 list-disc" {...props} />;
}

function Table(props: React.HTMLAttributes<HTMLTableElement>) {
return (
<table
className="my-2 w-full table-auto rounded-lg border text-center"
{...props}
/>
);
}
21 changes: 8 additions & 13 deletions src/app/(public)/heroes/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,15 @@ export default async function Heroes() {

return (
<>
<div className="absolute h-full w-full bg-[radial-gradient(#e5e7eb_1px,transparent_1px)] [background-size:16px_16px] [mask-image:radial-gradient(ellipse_50%_50%_at_50%_50%,#000_70%,transparent_100%)] dark:hidden"></div>
<div className="absolute hidden h-full w-full bg-[radial-gradient(#404040_1px,transparent_1px)] [background-size:16px_16px] [mask-image:radial-gradient(ellipse_50%_50%_at_50%_50%,#000_70%,transparent_100%)] dark:block"></div>
<PageHeader>Heroes</PageHeader>

<div className="relative">
<PageHeader>Heroes</PageHeader>

<div className="container relative mx-auto">
<div className="w-full rounded-lg border bg-background shadow-xl">
<MarketItemsProvider>
<HeroesProvider>
<HeroTable />
</HeroesProvider>
</MarketItemsProvider>
</div>
<div className="container mx-auto">
<div className="w-full rounded-lg border bg-background shadow-xl">
<MarketItemsProvider>
<HeroesProvider>
<HeroTable />
</HeroesProvider>
</MarketItemsProvider>
</div>
</div>
</>
Expand Down
3 changes: 3 additions & 0 deletions vercel.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"git": {
"deploymentEnabled": false
},
"rewrites": [
{
"source": "/api/xsolla/:path*",
Expand Down

0 comments on commit de9d51f

Please sign in to comment.