Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -173,5 +173,6 @@ dist

# Finder (MacOS) folder config
.DS_Store
docs/
/.releaserc

.astro/
931 changes: 923 additions & 8 deletions bun.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"lint": "biome check"
},
"packageManager": "[email protected]",
"workspaces": ["packages/*", "examples/*"],
"workspaces": ["packages/*", "examples/*", "website"],
"devDependencies": {
"@biomejs/biome": "1.9.4",
"@changesets/cli": "^2.28.1",
Expand Down
21 changes: 21 additions & 0 deletions website/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# build output
dist/
# generated types
.astro/

# dependencies
node_modules/

# logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*


# environment variables
.env
.env.production

# macOS-specific files
.DS_Store
43 changes: 43 additions & 0 deletions website/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Starlight Docs

[![Built with Starlight](https://astro.badg.es/v2/built-with-starlight/tiny.svg)](https://starlight.astro.build)

## 🚀 Project Structure

Inside of your Astro + Starlight project, you'll see the following folders and files:

```
.
├── public/
├── src/
│ ├── assets/
│ ├── content/
│ │ └── docs/
│ └── content.config.ts
├── astro.config.ts
├── package.json
└── tsconfig.json
```

Starlight looks for `.md` or `.mdx` files in the `src/content/docs/` directory. Each file is exposed as a route based on its file name.

Images can be added to `src/assets/` and embedded in Markdown with a relative link.

Static assets, like favicons, can be placed in the `public/` directory.

## 🧞 Commands

All commands are run from the root of the project, from a terminal:

| Command | Action |
| :------------------------ | :----------------------------------------------- |
| `bun install` | Installs dependencies |
| `bun dev` | Starts local dev server at `localhost:4321` |
| `bun build` | Build your production site to `./dist/` |
| `bun preview` | Preview your build locally, before deploying |
| `bun astro ...` | Run CLI commands like `astro add`, `astro check` |
| `bun astro -- --help` | Get help using the Astro CLI |

## 👀 Want to learn more?

Check out [Starlight’s docs](https://starlight.astro.build/), read [the Astro documentation](https://docs.astro.build), or jump into the [Astro Discord server](https://astro.build/chat).
53 changes: 53 additions & 0 deletions website/astro.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import starlight from "@astrojs/starlight";
import { defineConfig } from "astro/config";

import tailwindcss from "@tailwindcss/vite";
import starlightChangelogs from "starlight-changelogs";

const redirects = import.meta.env.REDIRECTS
? JSON.parse(import.meta.env.REDIRECTS)
: {};

// https://astro.build/config
export default defineConfig({
site: "https://retuple.pages.dev",
redirects,
integrations: [
starlight({
title: "reTuple",
tagline: "reTuple",
description:
"A TypeScript utility for Go-style structured error handling combined with powerful tooling.",
logo: {
// TODO: add dark and light logo variants
// dark: './src/assets/logo-dark.svg',
// light: './src/assets/logo-light.svg',
src: "./src/assets/logo.svg",
},
social: [
{
icon: "github",
label: "GitHub",
href: "https://github.com/maxmorozoff/try-catch-tuple",
},
],
lastUpdated: true,
editLink: {
baseUrl:
"https://github.com/maxmorozoff/try-catch-tuple/edit/main/website/",
},
customCss: [
// Path to your Tailwind base styles:
"./src/styles/global.css",
"@fontsource/commit-mono",
"@fontsource-variable/inter",
],

plugins: [starlightChangelogs()],
}),
],

vite: {
plugins: [tailwindcss()],
},
});
24 changes: 24 additions & 0 deletions website/ec.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { defineEcConfig } from "@astrojs/starlight/expressive-code";
import { pluginLineNumbers } from "@expressive-code/plugin-line-numbers";
import ecTwoSlash from "expressive-code-twoslash";

export default defineEcConfig({
themes: ["catppuccin-latte", "catppuccin-mocha"],
plugins: [
pluginLineNumbers(),
ecTwoSlash({
explicitTrigger: true,
languages: ["ts", "tsx", "js", "jsx"],
}),
],
defaultProps: {
// Disable line numbers by default
showLineNumbers: false,
// But enable line numbers for certain languages
// overridesByLang: {
// 'js,ts,html': {
// showLineNumbers: true,
// },
// },
},
});
30 changes: 30 additions & 0 deletions website/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"name": "website",
"private": true,
"type": "module",
"version": "0.0.1",
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build": "astro build",
"preview": "astro preview",
"astro": "astro"
},
"dependencies": {
"@astrojs/starlight": "^0.35.2",
"@astrojs/starlight-tailwind": "^4.0.1",
"@expressive-code/plugin-line-numbers": "^0.41.3",
"@fontsource-variable/inter": "^5.2.6",
"@fontsource/commit-mono": "^5.2.5",
"@tailwindcss/vite": "^4.1.11",
"astro": "^5.6.1",
"expressive-code-twoslash": "^0.5.3",
"sharp": "^0.34.2",
"starlight-changelogs": "^0.1.1",
"starlight-package-managers": "^0.11.0",
"tailwindcss": "^4.1.11"
},
"devDependencies": {
"typescript": "^5.9.2"
}
}
14 changes: 14 additions & 0 deletions website/public/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions website/src/assets/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions website/src/assets/nnnoise.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions website/src/content.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import path from "node:path";
import { defineCollection } from "astro:content";
import { docsLoader } from "@astrojs/starlight/loaders";
import { docsSchema } from "@astrojs/starlight/schema";
import { changelogsLoader } from "starlight-changelogs/loader";

export const collections = {
docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }),
changelogs: defineCollection({
loader: changelogsLoader([
{
provider: "changeset",
base: "changelog/try-catch-tuple",
changelog: path.resolve("../packages/try-catch-tuple/CHANGELOG.md"),
},
{
provider: "changeset",
base: "changelog/ts-plugin",
changelog: path.resolve("../packages/ts-plugin/CHANGELOG.md"),
},
]),
}),
};
Loading
Loading