Skip to content

Commit

Permalink
can biome shut up now pls
Browse files Browse the repository at this point in the history
  • Loading branch information
laulauland committed Sep 16, 2024
1 parent 3c79222 commit 7ccf471
Show file tree
Hide file tree
Showing 20 changed files with 291 additions and 286 deletions.
8 changes: 4 additions & 4 deletions www/.prettierrc.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ export default {
{
files: "*.astro",
options: {
parser: "astro",
},
},
],
parser: "astro"
}
}
]
};
40 changes: 20 additions & 20 deletions www/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,75 +7,75 @@ import rehypeAutolinkHeadings from "rehype-autolink-headings";
// https://astro.build/config
export default defineConfig({
redirects: {
"/docs": "/docs/get-started",
"/docs": "/docs/get-started"
},
experimental: {
contentIntellisense: true,
contentIntellisense: true
},
integrations: [
starlight({
logo: {
src: "@/assets/fp-logo.png",
replacesTitle: true,
replacesTitle: true
},
title: "Fiberplane",
description:
"Fiberplane is an API client and a local debugging companion for Hono API.",
social: {
github: "https://github.com/fiberplane/fpx",
discord: "https://discord.com/invite/cqdY6SpfVR",
discord: "https://discord.com/invite/cqdY6SpfVR"
},
sidebar: [
{
label: "Quickstart",
items: ["docs/get-started"],
items: ["docs/get-started"]
},
{
label: "Components",
autogenerate: { directory: "docs/components" },
autogenerate: { directory: "docs/components" }
},
{
label: "Features",
autogenerate: { directory: "docs/features" },
autogenerate: { directory: "docs/features" }
},
{
label: "nav",
items: [
{ link: "/changelog", label: "Changelog" },
{ link: "/blog", label: "Blog" },
{ link: "/docs", label: "Docs" },
],
},
{ link: "/docs", label: "Docs" }
]
}
],
components: {
Header: "@/components/Header.astro",
Pagination: "@/components/Pagination.astro",
ThemeProvider: "@/components/ThemeProvider.astro",
Sidebar: "@/components/Sidebar.astro",
Hero: "@/components/Hero.astro",
Hero: "@/components/Hero.astro"
},
customCss: ["@/main.css"],
expressiveCode: {
themes: ["github-dark", "github-light"],
styleOverrides: {
borderRadius: "var(--border-radius)",
},
},
borderRadius: "var(--border-radius)"
}
}
}),
// NOTE: if we ever go to server rendering or hybrid rendering,
// we'll need to specify manually which icon sets to include
// https://github.com/natemoo-re/astro-icon?tab=readme-ov-file#configinclude
icon(),
icon()
],
markdown: {
rehypePlugins: [
rehypeHeadingIds,
[
rehypeAutolinkHeadings,
{
behavior: "wrap",
},
],
],
},
behavior: "wrap"
}
]
]
}
});
2 changes: 1 addition & 1 deletion www/biome.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
"extends": ["../biome.jsonc"],
"files": {
"ignore": ["dist", "node_modules", "src/*.ts.example"],
"ignore": ["dist", "node_modules", "src/*.ts.example"]
}
}
2 changes: 1 addition & 1 deletion www/src/components/Header.astro
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type NavEntry = SidebarEntry & { type: "link" };
const { sidebar } = Astro.props;
const nav = sidebar.find(
(entry) => entry.type === "group" && entry.label === "nav",
(entry) => entry.type === "group" && entry.label === "nav"
) as { entries: NavEntry[] } | undefined;
const navEntries = nav?.entries || [];
---
Expand Down
4 changes: 2 additions & 2 deletions www/src/components/Hero.astro
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if (image && "file" in image) {
icon,
link: href,
text,
variant,
variant
}) => (
<LinkButton
{href}
Expand All @@ -39,7 +39,7 @@ if (image && "file" in image) {
{text}
{icon?.html && <Fragment set:html={icon.html} />}
</LinkButton>
),
)
)
}
</div>
Expand Down
2 changes: 1 addition & 1 deletion www/src/components/PackageManagers.astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
import {
PackageManagers as AllPackageManagers,
type PackageManagersProps,
type PackageManagersProps
} from "starlight-package-managers";
type Props = PackageManagersProps;
Expand Down
4 changes: 2 additions & 2 deletions www/src/components/Platforms.astro
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ const {
frame = "code",
icons = true,
platforms,
title = undefined,
title = undefined
} = Astro.props;
const singlePlatform = platforms?.length === 1 ? platforms[0] : undefined;
const ecFrame = frame === "terminal" ? "terminal" : "code";
function getTabItemProps(platform: Platform) {
const props: ComponentProps<typeof TabItem> = {
label: PLATFORMS[PLATFORM_KEYS.indexOf(platform)],
label: PLATFORMS[PLATFORM_KEYS.indexOf(platform)]
};
const icon = getIcon(platform) as ComponentProps<typeof TabItem>["icon"];
if (icons && icon) {
Expand Down
4 changes: 2 additions & 2 deletions www/src/components/Sidebar.astro
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ const [sidebar, nav] = sidebarAndNav.reduce<[SidebarEntry[], NavEntry[]]>(
([sidebar, nav], item: SidebarEntry) => {
if (item.label === "nav" && item.type === "group" && "entries" in item) {
nav = item.entries.filter(
(entry): entry is NavEntry => entry.type === "link",
(entry): entry is NavEntry => entry.type === "link"
);
} else {
sidebar.push(item);
}
return [sidebar, nav];
},
[[], []],
[[], []]
);
---

Expand Down
6 changes: 3 additions & 3 deletions www/src/components/SidebarSublist.astro
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import { Icon } from "astro-icon/components";
// doesn't export them in its types'
import type {
Link,
SidebarEntry,
SidebarEntry
} from "node_modules/@astrojs/starlight/utils/navigation";
/** Turn the nested tree structure of a sidebar into a flat list of all the links. */
function flattenSidebar(sidebar: SidebarEntry[]): Link[] {
return sidebar.flatMap((entry) =>
entry.type === "group" ? flattenSidebar(entry.entries) : entry,
entry.type === "group" ? flattenSidebar(entry.entries) : entry
);
}
Expand All @@ -29,7 +29,7 @@ function resolveGroupIcon(label: string): string {
const groupIcons: Record<string, string> = {
Quickstart: "lucide:rocket",
Components: "lucide:component",
Features: "lucide:hammer",
Features: "lucide:hammer"
};
if (!(label in groupIcons)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ We still have regular Redux reducers in TypeScript, as not all of our state slic
```typescript
export default function reducer(
state = initialState,
action: Action,
action: Action
): StateWithSideEffects<State> {
const result = reducerBridge(action); // This calls the Rust reducer.
state = stateUpdateReducer(state, result.stateUpdate);
Expand Down
Loading

0 comments on commit 7ccf471

Please sign in to comment.