Skip to content

Commit 0ac96b5

Browse files
authored
feat(shipyard): shipyard's website and docs at coss.com/shipyard (#863)
1 parent 6e01ad4 commit 0ac96b5

156 files changed

Lines changed: 18064 additions & 7 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎apps/shipyard/.gitignore‎

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.*
7+
.yarn/*
8+
!.yarn/patches
9+
!.yarn/plugins
10+
!.yarn/releases
11+
!.yarn/versions
12+
13+
# testing
14+
/coverage
15+
16+
# next.js
17+
/.next/
18+
/out/
19+
20+
# production
21+
/build
22+
23+
# misc
24+
.DS_Store
25+
*.pem
26+
27+
# debug
28+
npm-debug.log*
29+
yarn-debug.log*
30+
yarn-error.log*
31+
.pnpm-debug.log*
32+
33+
# env files (can opt-in for committing if needed)
34+
.env*
35+
36+
# vercel
37+
.vercel
38+
39+
# typescript
40+
*.tsbuildinfo
41+
next-env.d.ts
42+
43+
# fumadocs
44+
.source

‎apps/shipyard/README.md‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# shipyard
2+
3+
Shipyard's website and docs at [coss.com/shipyard](https://coss.com/shipyard):
4+
the landing page, and the docs at `/shipyard/docs` on the same Fumadocs setup
5+
as coss ui's.
6+
7+
- `app/page.tsx`, `app/landing.css`: the landing page, as it was at
8+
berthd.app. The harbour at the top is dithered on a canvas and comes alive
9+
at night (`public/assets/harbour.js`, `hero-loop.js`); the chapters' loops
10+
and line scenes load once the page has painted (`clips.js`,
11+
`scenes.css`/`scenes.json`). `components/landing/runtime.tsx` brings them
12+
in. The page keeps its own type (Inter, JetBrains Mono, in `fonts/`) and
13+
tokens; the header, the rails and the docs are coss's.
14+
- `content/docs/`: the docs, moved here from the `cosscom/shipyard`
15+
repository's `docs/` folder. `components/docs/` are its own pieces
16+
(callouts, the stage, the path of cards, screenshots in `public/shots/`,
17+
diagrams and the line scenes); `lib/rehype-reference.ts` makes the
18+
reference tables linkable.
19+
- The app's downloads, the live demo (`berthd.app/demo/`), the box's
20+
install line (`berthd.app/install`), the plugin listing and the
21+
**Review in Shipyard** bounce page stay on berthd.app: they are built and
22+
published from the `cosscom/shipyard` repository.
23+
24+
```sh
25+
bun install
26+
bun run dev --filter=shipyard # http://localhost:4100/shipyard
27+
```
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import fs from "node:fs/promises";
2+
import path from "node:path";
3+
import { type NextRequest, NextResponse } from "next/server";
4+
5+
export async function GET(
6+
_request: NextRequest,
7+
{ params }: { params: Promise<{ slug: string[] }> },
8+
) {
9+
const { slug } = await params;
10+
11+
// Construct the file path from the slug
12+
// If we have ['docs', 'filename'], look in (root) directory
13+
let filePath: string;
14+
if (slug.length === 2 && slug[0] === "docs") {
15+
filePath = path.join(
16+
process.cwd(),
17+
"content",
18+
"docs",
19+
"(root)",
20+
slug[1] || "",
21+
);
22+
} else {
23+
filePath = path.join(process.cwd(), "content", ...slug);
24+
}
25+
26+
// Check for both .mdx and .md extensions
27+
const mdxPath = filePath.endsWith(".mdx") ? filePath : `${filePath}.mdx`;
28+
const mdPath = filePath.endsWith(".md") ? filePath : `${filePath}.md`;
29+
30+
try {
31+
let content: string;
32+
33+
// Try .mdx first, then .md
34+
try {
35+
content = await fs.readFile(mdxPath, "utf-8");
36+
} catch {
37+
content = await fs.readFile(mdPath, "utf-8");
38+
}
39+
40+
// Return raw markdown with appropriate headers
41+
return new NextResponse(content, {
42+
headers: {
43+
"Cache-Control": "public, max-age=3600",
44+
"Content-Type": "text/plain; charset=utf-8",
45+
},
46+
});
47+
} catch {
48+
return NextResponse.json({ error: "File not found" }, { status: 404 });
49+
}
50+
}

‎apps/shipyard/app/apple-icon.png‎

5.42 KB
Loading

0 commit comments

Comments
 (0)