From 10f8dc9ce4df7c2f1b4b5b077317bb08a5709ddd Mon Sep 17 00:00:00 2001 From: Zack Maril Date: Sat, 22 Aug 2026 10:13:52 -0400 Subject: [PATCH 1/2] site: adopt the shared Powderworks reading system straitjacket.dev was the only fleet site not wearing the family clothes. It now installs @thepowderworks/fumadocs directly from github:PowderworksCode/docs and uses its config, i18n wiring, provider, MDX components, search dialog, nav builder, and theme. - src/lib/site.ts declares the site to definePowderworksSite; nav title, mark, and GitHub link come from the package. - Provider, search dialog, and MDX components are the package's; straitjacket keeps only thin local wrappers. - global.css imports the shared theme after the fumadocs preset, so pages render in the powderworks paper-and-ink palette with the project accent extension points available. - trustedDependencies runs the package prepare script so a git install produces dist/. Dark-only rendering stays as it was; flipping to system preference is one prop on PowderworksProvider when wanted. --- site/bun.lock | 6 ++++ site/package.json | 6 +++- site/src/app/global.css | 1 + site/src/components/mdx.tsx | 12 +++---- site/src/components/provider.tsx | 10 ++++-- site/src/components/search.tsx | 56 ++++---------------------------- site/src/lib/i18n.ts | 7 ++++ site/src/lib/layout.shared.tsx | 20 ++---------- site/src/lib/site.ts | 11 +++++++ 9 files changed, 52 insertions(+), 77 deletions(-) create mode 100644 site/src/lib/i18n.ts create mode 100644 site/src/lib/site.ts diff --git a/site/bun.lock b/site/bun.lock index 14754fa..4f13e47 100644 --- a/site/bun.lock +++ b/site/bun.lock @@ -6,6 +6,7 @@ "name": "site", "dependencies": { "@orama/orama": "^3.1.18", + "@thepowderworks/fumadocs": "github:PowderworksCode/docs", "cnfast": "^0.0.8", "fumadocs-core": "16.11.1", "fumadocs-mdx": "15.1.0", @@ -30,6 +31,9 @@ }, }, }, + "trustedDependencies": [ + "@thepowderworks/fumadocs", + ], "packages": { "@alloc/quick-lru": ["@alloc/quick-lru@5.2.0", "", {}, "sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw=="], @@ -345,6 +349,8 @@ "@tailwindcss/postcss": ["@tailwindcss/postcss@4.3.2", "", { "dependencies": { "@alloc/quick-lru": "^5.2.0", "@tailwindcss/node": "4.3.2", "@tailwindcss/oxide": "4.3.2", "postcss": "^8.5.15", "tailwindcss": "4.3.2" } }, "sha512-rjVWYCa7Ngbi5AarT6k8TkxUG3Wl1QKzHdIZVsjZSzf36Jmo2IKZt/NHRAwly8oDkbBOH0YTu+CHuf9jPxMc+g=="], + "@thepowderworks/fumadocs": ["@thepowderworks/fumadocs@github:PowderworksCode/docs#c830471", { "peerDependencies": { "@orama/orama": "^3.1.18", "fumadocs-core": "16.11.1", "fumadocs-ui": "16.11.1", "next": ">=16.2.0 <17", "react": ">=19.2.0 <20", "react-dom": ">=19.2.0 <20" } }, "PowderworksCode-docs-c830471", "sha512-GoiAIW9SPM0qbQa4y6gMBSte5X2MX2umEQEuK3yj/nwpS0/uVNVjMsKFDnhu9B7uZCx/scbvCeFN+9qs5ZtMKw=="], + "@types/debug": ["@types/debug@4.1.13", "", { "dependencies": { "@types/ms": "*" } }, "sha512-KSVgmQmzMwPlmtljOomayoR89W4FynCAi3E8PPs7vmDVPe84hT+vGPKkJfThkmXs0x0jAaa9U8uW8bbfyS2fWw=="], "@types/estree": ["@types/estree@1.0.9", "", {}, "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg=="], diff --git a/site/package.json b/site/package.json index c4d7c27..2b0f366 100644 --- a/site/package.json +++ b/site/package.json @@ -14,6 +14,7 @@ }, "dependencies": { "@orama/orama": "^3.1.18", + "@thepowderworks/fumadocs": "github:PowderworksCode/docs", "cnfast": "^0.0.8", "fumadocs-core": "16.11.1", "fumadocs-mdx": "15.1.0", @@ -35,5 +36,8 @@ "tailwindcss": "^4.3.1", "typescript": "^6.0.3", "wrangler": "^4.123.0" - } + }, + "trustedDependencies": [ + "@thepowderworks/fumadocs" + ] } diff --git a/site/src/app/global.css b/site/src/app/global.css index 488ce0e..bdcc47d 100644 --- a/site/src/app/global.css +++ b/site/src/app/global.css @@ -1,6 +1,7 @@ @import "tailwindcss"; @import "fumadocs-ui/css/neutral.css"; @import "fumadocs-ui/css/preset.css"; +@import "@thepowderworks/fumadocs/theme.css"; html { scrollbar-gutter: stable; diff --git a/site/src/components/mdx.tsx b/site/src/components/mdx.tsx index 62ce6e5..4673c25 100644 --- a/site/src/components/mdx.tsx +++ b/site/src/components/mdx.tsx @@ -1,14 +1,14 @@ -import defaultMdxComponents from "fumadocs-ui/mdx"; import type { MDXComponents } from "mdx/types"; +import { + getPowderworksMDXComponents, + useMDXComponents as usePowderworksMDXComponents, +} from "@thepowderworks/fumadocs/mdx"; export function getMDXComponents(components?: MDXComponents) { - return { - ...defaultMdxComponents, - ...components, - } satisfies MDXComponents; + return getPowderworksMDXComponents(components); } -export const useMDXComponents = getMDXComponents; +export const useMDXComponents = usePowderworksMDXComponents; declare global { type MDXProvidedComponents = ReturnType; diff --git a/site/src/components/provider.tsx b/site/src/components/provider.tsx index e01398d..5421461 100644 --- a/site/src/components/provider.tsx +++ b/site/src/components/provider.tsx @@ -1,15 +1,19 @@ "use client"; -import { RootProvider } from "fumadocs-ui/provider/next"; + +import { PowderworksProvider } from "@thepowderworks/fumadocs/provider"; import type { ReactNode } from "react"; import SearchDialog from "@/components/search"; +import { translations } from "@/lib/i18n"; export function Provider({ children }: { children: ReactNode }) { return ( - {children} - + ); } diff --git a/site/src/components/search.tsx b/site/src/components/search.tsx index 30685d0..ab93d4d 100644 --- a/site/src/components/search.tsx +++ b/site/src/components/search.tsx @@ -1,54 +1,10 @@ -// Search dialog over the static Orama index. Supported languages: -// https://docs.orama.com/docs/orama-js/supported-languages "use client"; -import { create } from "@orama/orama"; -import { useDocsSearch } from "fumadocs-core/search/client"; -import { oramaStaticClient } from "fumadocs-core/search/client/orama-static"; -import { - SearchDialog, - SearchDialogClose, - SearchDialogContent, - SearchDialogHeader, - SearchDialogIcon, - SearchDialogInput, - SearchDialogList, - SearchDialogOverlay, - type SharedProps, -} from "fumadocs-ui/components/dialog/search"; -import { useI18n } from "fumadocs-ui/contexts/i18n"; - -function initOrama() { - return create({ - schema: { _: "string" }, - language: "english", - }); -} -export default function DefaultSearchDialog(props: SharedProps) { - const { locale } = useI18n(); - const { search, setSearch, query } = useDocsSearch({ - client: oramaStaticClient({ - initOrama, - locale, - }), - }); +import { + PowderworksSearchDialog, + type PowderworksSearchProps, +} from "@thepowderworks/fumadocs/search"; - return ( - - - - - - - - - - - - ); +export default function SearchDialog(props: PowderworksSearchProps) { + return ; } diff --git a/site/src/lib/i18n.ts b/site/src/lib/i18n.ts new file mode 100644 index 0000000..714c654 --- /dev/null +++ b/site/src/lib/i18n.ts @@ -0,0 +1,7 @@ +import { definePowderworksI18n } from "@thepowderworks/fumadocs/i18n"; +import { site } from "./site"; + +export const { translations } = definePowderworksI18n( + site.locales, + site.defaultLocale, +); diff --git a/site/src/lib/layout.shared.tsx b/site/src/lib/layout.shared.tsx index 291f217..4bec478 100644 --- a/site/src/lib/layout.shared.tsx +++ b/site/src/lib/layout.shared.tsx @@ -1,26 +1,12 @@ +import { createPowderworksBaseOptions } from "@thepowderworks/fumadocs/layout"; import type { BaseLayoutProps } from "fumadocs-ui/layouts/shared"; -import { appName, gitConfig } from "./shared"; +import { site } from "./site"; export function baseOptions( links: BaseLayoutProps["links"] = [], ): BaseLayoutProps { return { - nav: { - title: ( - - - {appName} - - ), - }, + ...createPowderworksBaseOptions(site, site.defaultLocale), links, - githubUrl: `https://github.com/${gitConfig.user}/${gitConfig.repo}`, }; } diff --git a/site/src/lib/site.ts b/site/src/lib/site.ts new file mode 100644 index 0000000..33699db --- /dev/null +++ b/site/src/lib/site.ts @@ -0,0 +1,11 @@ +import { definePowderworksSite } from "@thepowderworks/fumadocs/config"; + +export const site = definePowderworksSite({ + name: "Straitjacket", + description: "A secret scanner, but for slop.", + repository: "PowderworksCode/straitjacket", + siteUrl: "https://straitjacket.dev", + mark: { src: "/strait-face.png", alt: "Straitjacket" }, + locales: [{ code: "en", name: "English", searchLanguage: "english" }], + defaultLocale: "en", +}); From c8562e1a549f6d7cf48bc763ee4cb4a6c6c4b169 Mon Sep 17 00:00:00 2001 From: Zack Maril Date: Sat, 22 Aug 2026 10:20:49 -0400 Subject: [PATCH 2/2] site: keep the shared plumbing, drop the fleet palette The powderworks theme's warm paper and flame orange read as a well- known AI-lab aesthetic, which is not this site. The theme import is gone, so pages render in fumadocs neutral exactly as before the adoption; only two small nav-title rules stay local to style the package's markup classes. What remains from the shared package is everything invisible: site config, i18n wiring, provider, search dialog, MDX components, and the nav builder. --- site/src/app/global.css | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/site/src/app/global.css b/site/src/app/global.css index bdcc47d..ad2d6d5 100644 --- a/site/src/app/global.css +++ b/site/src/app/global.css @@ -1,7 +1,21 @@ @import "tailwindcss"; @import "fumadocs-ui/css/neutral.css"; @import "fumadocs-ui/css/preset.css"; -@import "@thepowderworks/fumadocs/theme.css"; + +/* The shared package's nav markup uses these class names; keep them styled + * here in this site's own visual language instead of importing the fleet + * theme's paper-and-flame palette. */ +.pw-nav-title { + display: inline-flex; + align-items: center; + gap: 0.5rem; +} + +.pw-nav-mark { + width: 1.375rem; + height: 1.375rem; + border-radius: 0.125rem; +} html { scrollbar-gutter: stable;