Skip to content

Commit

Permalink
chore(component): Add Astrobook integration
Browse files Browse the repository at this point in the history
Preview component per-component design.
  • Loading branch information
5ouma committed Nov 8, 2024
1 parent 165ecc0 commit 67463b4
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 2 deletions.
10 changes: 9 additions & 1 deletion astro.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
import type { AstroIntegration } from "astro";
import { defineConfig } from "astro/config";
import astrobook from "astrobook";

export default defineConfig({});
const integrations: AstroIntegration[] = [];

if (process.env.ASTROBOOK) {
integrations.push(astrobook({ directory: "src/components" }));
}

export default defineConfig({ integrations });
Binary file modified bun.lockb
Binary file not shown.
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"version": "0.0.0",
"scripts": {
"dev": "astro dev",
"astrobook": "ASTROBOOK=1 astro dev",
"build": "astro build",
"preview": "astro preview",
"check:astro": "astro check",
Expand All @@ -15,6 +16,8 @@
},
"devDependencies": {
"@astrojs/check": "0.9.4",
"@biomejs/biome": "1.9.4"
"@biomejs/biome": "1.9.4",
"@types/node": "22.9.0",
"astrobook": "0.5.1"
}
}
11 changes: 11 additions & 0 deletions src/components/Bio/Bio.stories.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import Bio from "./Bio.astro";
import * as stories from "./story.ts";

export default {
title: "Bio",
component: Bio,
};

export const Default = { args: stories.Default };
export const Japanese = { args: stories.Japanese };
export const Long = { args: stories.Long };
20 changes: 20 additions & 0 deletions src/components/Bio/story.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import type { Props } from "./Bio.astro";

export const Default: Props = {
name: "Bio Name",
description: "Bio Description",
icon: "https://github.com/withastro.png",
};

export const Japanese: Props = {
name: "名前",
description: "説明",
icon: "https://github.com/withastro.png",
};

export const Long: Props = {
name: "Long Long Long Long Long Long Long Long Long Long Long Long Long Long Long Long Long Long Long Long Long Long Long Long Bio Name",
description:
"Long Long Long Long Long Long Long Long Long Long Long Long Long Long Long Long Long Long Long Long Long Long Long Long Bio Description",
icon: "https://github.com/withastro.png",
};

0 comments on commit 67463b4

Please sign in to comment.