chore: remove implementação do changelog

- Remove página /changelog e seus arquivos
- Remove componentes ChangelogLink e ChangelogList
- Remove referência do header-dashboard
This commit is contained in:
Felipe Coutinho
2026-01-20 16:41:05 +00:00
parent 84ca5e64fd
commit ca0242d380
6 changed files with 0 additions and 392 deletions

View File

@@ -1,23 +0,0 @@
import PageDescription from "@/components/page-description";
import { RiGitCommitLine } from "@remixicon/react";
export const metadata = {
title: "Changelog | Opensheets",
};
export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<section className="space-y-6 px-6">
<PageDescription
icon={<RiGitCommitLine />}
title="Changelog"
subtitle="Histórico completo de alterações e atualizações do projeto."
/>
{children}
</section>
);
}

View File

@@ -1,31 +0,0 @@
import { Card, CardContent, CardHeader } from "@/components/ui/card";
import { Skeleton } from "@/components/ui/skeleton";
export default function Loading() {
return (
<main className="container mx-auto px-4 py-8 max-w-4xl">
<div className="mb-8">
<Skeleton className="h-9 w-48 mb-2" />
<Skeleton className="h-5 w-96" />
</div>
<div className="space-y-4">
{[...Array(5)].map((_, i) => (
<Card key={i}>
<CardHeader className="pb-3">
<Skeleton className="h-6 w-3/4 mb-2" />
<div className="flex gap-3">
<Skeleton className="h-4 w-20" />
<Skeleton className="h-4 w-32" />
<Skeleton className="h-4 w-24" />
</div>
</CardHeader>
<CardContent className="pt-0">
<Skeleton className="h-4 w-32" />
</CardContent>
</Card>
))}
</div>
</main>
);
}

View File

@@ -1,102 +0,0 @@
import { ChangelogList } from "@/components/changelog/changelog-list";
import { execSync } from "child_process";
type GitCommit = {
hash: string;
shortHash: string;
author: string;
date: string;
message: string;
body: string;
filesChanged: string[];
};
function getGitRemoteUrl(): string | null {
try {
const remoteUrl = execSync("git config --get remote.origin.url", {
encoding: "utf-8",
cwd: process.cwd(),
}).trim();
// Converter SSH para HTTPS se necessário
if (remoteUrl.startsWith("git@")) {
return remoteUrl
.replace("git@github.com:", "https://github.com/")
.replace("git@gitlab.com:", "https://gitlab.com/")
.replace(".git", "");
}
return remoteUrl.replace(".git", "");
} catch (error) {
console.error("Error fetching git remote URL:", error);
return null;
}
}
function getGitCommits(): GitCommit[] {
try {
// Buscar os últimos 50 commits
const commits = execSync(
'git log -50 --pretty=format:"%H|%h|%an|%ad|%s|%b" --date=iso --name-only',
{
encoding: "utf-8",
cwd: process.cwd(),
}
)
.trim()
.split("\n\n");
return commits
.map((commitBlock) => {
const lines = commitBlock.split("\n");
const [hash, shortHash, author, date, message, ...rest] =
lines[0].split("|");
// Separar body e arquivos
const bodyLines: string[] = [];
const filesChanged: string[] = [];
let isBody = true;
rest.forEach((line) => {
if (line && !line.includes("/") && !line.includes(".")) {
bodyLines.push(line);
} else {
isBody = false;
}
});
lines.slice(1).forEach((line) => {
if (line.trim()) {
filesChanged.push(line.trim());
}
});
return {
hash,
shortHash,
author,
date,
message,
body: bodyLines.join("\n").trim(),
filesChanged: filesChanged.filter(
(f) => f && !f.startsWith("git log")
),
};
})
.filter((commit) => commit.hash && commit.message);
} catch (error) {
console.error("Error fetching git commits:", error);
return [];
}
}
export default async function ChangelogPage() {
const commits = getGitCommits();
const repoUrl = getGitRemoteUrl();
return (
<main>
<ChangelogList commits={commits} repoUrl={repoUrl} />
</main>
);
}