Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/beige-parents-bake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@mittwald/hello-world-extension": patch
---

added scripts to clean up code samples and reduce this project to a nearly blank slate
53 changes: 53 additions & 0 deletions cleanup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/usr/bin/env bash

ask(){ read -p "$1" a; [ $a = "yes" ]; }

set -e

rmWebhooks() {
rm -r ./src/routes/api/
pnpm run build
}

rmDbRelation() {
awk '!/references/' ./src/db/schema.ts > tmp.ts && mv tmp.ts ./src/db/schema.ts
}

rmDb() {
rm ./src/db/schema.ts
touch ./src/db/schema.ts
}

rmComments() {
rm -fr src/components/comments src/domain/comments src/serverFunctions/comments
awk '!/Comment/' ./src/components/Dashboard.tsx > tmp.tsx && mv tmp.tsx ./src/components/Dashboard.tsx
pnpm format:fix
}

rmFragments() {
awk '!/Dashboard/' ./src/routes/index.tsx > tmp.ts && mv tmp.ts ./src/routes/index.tsx
rm -fr ./src/components/*
pnpm format:fix
}

cleanup() {
jq '.scripts |= with_entries(select(.key | startswith(\"cleanup\") | not))' package.json > tmp.json
mv tmp.json package.json
}

rmGit() {
ask 'cleanup git?[yes/no]' && rm -rf ./.git
}

all() {
rmWebhooks
rmDb
rmComments
rmFragments
cleanup
rmGit
rm ./cleanup.sh
}

pnpm install

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
"docker:prod": "docker compose up",
"docker:prod:build": "docker compose up --build",
"docker:prod:down": "docker compose down",
"publish-package": "pnpm run build && pnpm run check && changeset version && changeset publish"
"publish-package": "pnpm run build && pnpm run check && changeset version && changeset publish",
"cleanup:all": "./cleanup.sh -- all",
"cleanup:webhook": "./cleanup.sh -- rmDbRelation rmWebhooks"
},
"dependencies": {
"@mittwald/api-client": "^4.267.0",
Expand Down
28 changes: 28 additions & 0 deletions src/components/Dashboard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { ColumnLayout } from "@mittwald/flow-remote-react-components";
import { APIReferenceCard } from "@/components/APIReferenceCard.tsx";
import { CommentsCard } from "@/components/comments/CommentsCard";
import { DeveloperPortalCard } from "@/components/DeveloperPortalCard.tsx";
import { FlowDocumentationCard } from "@/components/FlowDocumentationCard.tsx";
import { GreetingCard } from "@/components/GreetingCard.tsx";
import { ProjectCard } from "@/components/project/ProjectCard.tsx";
import { ReadmeCard } from "@/components/ReadmeCard.tsx";

export function Dashboard() {
return (
<>
<ColumnLayout m={[1]} l={[3, 2]}>
<ColumnLayout m={[1]}>
<GreetingCard />
<ProjectCard />
<CommentsCard />
</ColumnLayout>
<ColumnLayout m={[1]}>
<DeveloperPortalCard />
<APIReferenceCard />
<FlowDocumentationCard />
</ColumnLayout>
</ColumnLayout>
<ReadmeCard />
</>
);
}
26 changes: 4 additions & 22 deletions src/routes/index.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import { ColumnLayout, Section } from "@mittwald/flow-remote-react-components";
import { Title } from "@mittwald/mstudio-ext-react-components";
import { createFileRoute } from "@tanstack/react-router";
import { APIReferenceCard } from "@/components/APIReferenceCard.tsx";
import { CommentsCard } from "@/components/comments/CommentsCard";
import { DeveloperPortalCard } from "@/components/DeveloperPortalCard.tsx";
import { FlowDocumentationCard } from "@/components/FlowDocumentationCard.tsx";
import { GreetingCard } from "@/components/GreetingCard.tsx";
import { ProjectCard } from "@/components/project/ProjectCard.tsx";
import { ReadmeCard } from "@/components/ReadmeCard.tsx";
import { Dashboard } from "@/components/Dashboard";
import { Title } from "@mittwald/mstudio-ext-react-components";
import { Section } from "@mittwald/flow-remote-react-components";

export const Route = createFileRoute("/")({
component: App,
Expand All @@ -19,19 +13,7 @@ function App() {
<>
<Title>Hallo Contributor!</Title>
<Section>
<ColumnLayout m={[1]} l={[3, 2]}>
<ColumnLayout m={[1]}>
<GreetingCard />
<ProjectCard />
<CommentsCard />
</ColumnLayout>
<ColumnLayout m={[1]}>
<DeveloperPortalCard />
<APIReferenceCard />
<FlowDocumentationCard />
</ColumnLayout>
</ColumnLayout>
<ReadmeCard />
<Dashboard />
</Section>
</>
);
Expand Down