fumapress 0.6.1 → 0.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/css/generated.css CHANGED
@@ -1 +1 @@
1
- @source inline("!ctx !sizes ---spacing -translate-x-1/2 @default @fuma-translate/react @orama/orama a above absolute absolutePath accepts active:scale-95 actually all allSizes allowed allows always and and/or any app are as associated assumes async attribute attributes await backdrop-blur-sm base basePathname be because before between bg-fd-card bg-fd-primary bg-fd-primary/10 bg-fd-secondary/80 blog blogPosts blue body border border-2 border-b border-dashed border-fd-primary border-y bottom-2 browsers bug buildImageUrl but buttonVariants by can canOptimize cannot cases cause causes change check children class-variance-authority className client cn component conditions config const content copies copy copyright core:docs-layout core:home-layout core:notebook-layout core:provider count create createBlogIndexPage createBlogLayout createBlogLayoutPage createBlogTagPage createBlogTagsPage createContext createDocsLayoutPage createHomeLayout createHomeLayoutPage createLayoutSwitch createLayoutSwitchAuto createNotebookLayoutPage createOpenAPIPage createRootLayout creationDate crossOrigin ctx currentDate cva data data-fd-home-layout-container data-version date deal decoration-fd-primary default defaultQuality defaultWidth detail detect detector deviceSizes do documentation duration-150 eager edge else empty empty:hidden en english even except export extends eye false fetch fetchPriority files first fixed flex flex-1 flex-col flex-row flex-wrap flexsearchStaticClient fn following font-medium font-mono font-semibold for framework free from fromPathname full fumadocs-core/framework fumadocs-core/source fumadocs-core/toc fumadocs-openapi/ui fumadocs-ui/i18n function furnished gap-1 gap-2 gap-4 generate generatedProps getBlogContext getLayoutProps getPressContext getTags ghost githubUrl given global green grid grid-cols-1 grid-cols-2 groupTags grouped h-12 height hereby high hook hooks hostname hover:bg-fd-accent hover:text-fd-accent-foreground how href html human i i18n if image imageSizes imageSrcSet images imagesrcset immediately import in included including incorrect indexPath indicates inherit inheritLayoutProps inherited inline-flex integer intended interface is isBlog isLoading it item items items-center items-start joinPathname js keep key kind lang language last lastModified layout layoutData layoutProps layouts left-1/2 length let level like limitation link loading locale lucide-react magnifying markdownUrl matching max-h-[min(600px,calc(100vh---spacing(30)))] max-sm:-mx-4 max-w-[1400px] max-w-[900px] max-w-[calc(100%---spacing(4))] mb-0 md:grid-cols-3 md:grid-cols-4 md:p-8 means min-h-screen min-w-0 minIndex minRatio minSize more most ms-auto mt-4 mt-6 mt-auto multiple mx-auto name navigation never new normal not note notice number object obtaining of omit on onClick onCopy onOpenChange onSearchChange only open optimized option options or oramaStaticClient orderedPosts outer overline p p-1 p-4 page pageProps panel panelButtonVariants params parsed path path/hash pathname pb-6 percent percentSizes permission permit person persons portions posts potentially prefetch preload preloadElement preloadOptions primary production prop props prose provider providerProps pt-2 pt-3.5 pt-4 push px-1.5 px-2 px-3 px-4 py-0.5 py-1 py-2 py-6 quality query query-only r react react-dom received red reference referrerPolicy refresh rel relative relevant render renderCtx renderRootMeta reproduced requests resolution resolve resolveBaseUrl resolved rest result return rights root rotate-180 rounded-2xl rounded-lg rounded-xl router run s satisfies say schema screens scroll search see sell setOpen shadow-inner shadow-md shadow-sm shall should shrink-0 significantly size-3.5 size-4 size-6 sizes sm:border sm:bottom-4 sm:grid-cols-3 sm:max-w-[400px] sm:rounded-xl software something source specified specify src srcSet srcset start string styleTag stylesHref stylesInline stylesheet subject subset substantial support supported swap tag tags tagsPath takes text text-2xl text-3xl text-fd-card-foreground text-fd-muted-foreground text-fd-primary text-fd-primary-foreground text-sm text-xs that the they this those though throw title to toc took transition-all transition-colors transition-transform translationsConfig tree true truncate type typeof uiTranslations undefined unnecessary unoptimized unstable_notFound unstable_prefetchOnEnter updated updates url use useCopyButton useDocsSearch useI18n useMemo useRouter useState useTOCItems used v valid value values variables variant viewport viewportWidthRe visually vs vw w w-full waku wasteful we whom width widths will with without would wrapper x xl:grid-cols-4 xl:grid-cols-6 z-2 z-20");
1
+ @source inline("!ctx !sizes ---spacing -translate-x-1/2 @default @fuma-translate/react @orama/orama a above absolute absolutePath accepts active:scale-95 actually all allSizes allowed allows always and and/or any app are as associated assumes async attribute attributes await backdrop-blur-sm base basePathname be because before between bg-fd-card bg-fd-primary bg-fd-primary/10 bg-fd-secondary/80 blog blogPosts blue body border border-2 border-b border-dashed border-fd-primary border-y bottom-2 browsers bug buildImageUrl but buttonVariants by can canOptimize cannot cases cause causes change check children class-variance-authority className client cn component conditions config const content copies copy copyright core:docs-layout core:home-layout core:notebook-layout core:provider count create createAsyncAPIPage createBlogIndexPage createBlogLayout createBlogLayoutPage createBlogTagPage createBlogTagsPage createContext createDocsLayoutPage createHomeLayout createHomeLayoutPage createLayoutSwitch createLayoutSwitchAuto createNotebookLayoutPage createOpenAPIPage createRootLayout creationDate crossOrigin ctx currentDate cva data data-fd-home-layout-container data-version date deal decoration-fd-primary default defaultQuality defaultWidth detail detect detector deviceSizes do documentation duration-150 eager edge else empty empty:hidden en english even except export extends eye false fetch fetchPriority files first fixed flex flex-1 flex-col flex-row flex-wrap flexsearchStaticClient fn following font-medium font-mono font-semibold for framework free from fromPathname full fumadocs-core/framework fumadocs-core/source fumadocs-core/toc fumadocs-openapi/ui fumadocs-ui/i18n function furnished gap-1 gap-2 gap-4 generate generatedProps getBlogContext getLayoutProps getPressContext getTags ghost githubUrl given global green grid grid-cols-1 grid-cols-2 groupTags grouped h-12 height hereby high hook hooks hostname hover:bg-fd-accent hover:text-fd-accent-foreground how href html human i i18n if image imageSizes imageSrcSet images imagesrcset immediately import in included including incorrect indexPath indicates inherit inheritLayoutProps inherited inline-flex integer intended interface is isBlog isLoading it item items items-center items-start joinPathname js keep key kind lang language last lastModified layout layoutData layoutProps layouts left-1/2 length let level like limitation link loading locale lucide-react magnifying markdownUrl matching max-h-[min(600px,calc(100vh---spacing(30)))] max-sm:-mx-4 max-w-[1400px] max-w-[900px] max-w-[calc(100%---spacing(4))] mb-0 md:grid-cols-3 md:grid-cols-4 md:p-8 means min-h-screen min-w-0 minIndex minRatio minSize more most ms-auto mt-4 mt-6 mt-auto multiple mx-auto name navigation never new normal not note notice number object obtaining of omit on onClick onCopy onOpenChange onSearchChange only open optimized option options or oramaStaticClient orderedPosts outer overline p p-1 p-4 page pageProps panel panelButtonVariants params parsed path path/hash pathname pb-6 percent percentSizes permission permit person persons portions posts potentially prefetch preload preloadElement preloadOptions primary production prop props prose provider providerProps pt-2 pt-3.5 pt-4 push px-1.5 px-2 px-3 px-4 py-0.5 py-1 py-2 py-6 quality query query-only r react react-dom received red reference referrerPolicy refresh rel relative relevant render renderCtx renderRootMeta reproduced requests resolution resolve resolveBaseUrl resolved rest result return rights root rotate-180 rounded-2xl rounded-lg rounded-xl router run s satisfies say schema screens scroll search see sell setOpen shadow-inner shadow-md shadow-sm shall should shrink-0 significantly size-3.5 size-4 size-6 sizes sm:border sm:bottom-4 sm:grid-cols-3 sm:max-w-[400px] sm:rounded-xl software something source specified specify src srcSet srcset start string styleTag stylesHref stylesInline stylesheet subject subset substantial support supported swap tag tags tagsPath takes text text-2xl text-3xl text-fd-card-foreground text-fd-muted-foreground text-fd-primary text-fd-primary-foreground text-sm text-xs that the they this those though throw title to toc took transition-all transition-colors transition-transform translationsConfig tree true truncate type typeof uiTranslations undefined unnecessary unoptimized unstable_notFound unstable_prefetchOnEnter updated updates url use useCopyButton useDocsSearch useI18n useMemo useRouter useState useTOCItems used v valid value values variables variant viewport viewportWidthRe visually vs vw w w-full waku wasteful we whom width widths will with without would wrapper x xl:grid-cols-4 xl:grid-cols-6 z-2 z-20");
@@ -0,0 +1,6 @@
1
+ "use client";
2
+ import { createAsyncAPIPage } from "@fumadocs/asyncapi/ui";
3
+ //#region src/components/asyncapi.tsx
4
+ var asyncapi_default = createAsyncAPIPage();
5
+ //#endregion
6
+ export { asyncapi_default as default };
@@ -0,0 +1,20 @@
1
+ import { ConfigContext } from "../config.js";
2
+ import { ServerPlugin } from "../lib/types.js";
3
+ import { FC } from "react";
4
+ import { AsyncAPIPageProps } from "@fumadocs/asyncapi/ui";
5
+ import { AsyncAPIServer } from "@fumadocs/asyncapi/server";
6
+
7
+ //#region src/plugins/asyncapi.d.ts
8
+ interface OpenAPIOptions {
9
+ server: AsyncAPIServer;
10
+ /** do not add the loader plugin for OpenAPI integration */
11
+ disableLoaderPlugin?: boolean;
12
+ /** must be a client component */
13
+ ClientAPIPage?: FC<AsyncAPIPageProps>;
14
+ }
15
+ /**
16
+ * this will register the OpenAPI adapter & required layout configs.
17
+ */
18
+ declare function asyncapiPlugin<C extends ConfigContext>(options: OpenAPIOptions): ServerPlugin<C>;
19
+ //#endregion
20
+ export { OpenAPIOptions, asyncapiPlugin };
@@ -0,0 +1,49 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { asyncapiTranslations } from "@fumadocs/asyncapi/i18n";
3
+ //#region src/plugins/asyncapi.tsx
4
+ /**
5
+ * this will register the OpenAPI adapter & required layout configs.
6
+ */
7
+ function asyncapiPlugin(options) {
8
+ const { server, disableLoaderPlugin = false } = options;
9
+ function initRenderers(data) {
10
+ (data.renderers ??= []).push(function(data) {
11
+ if (isAsyncAPI(this.page.data)) data.pageProps.full ??= true;
12
+ return data;
13
+ });
14
+ }
15
+ return {
16
+ name: "core:openapi",
17
+ init() {
18
+ this.adapters.push(adapter(options));
19
+ initRenderers(this.data["core:docs-layout"] ??= {});
20
+ initRenderers(this.data["core:notebook-layout"] ??= {});
21
+ if (this.translationsConfig) this.translationsConfig.extend(asyncapiTranslations());
22
+ },
23
+ configureLoader(options) {
24
+ if (!disableLoaderPlugin) {
25
+ options.plugins ??= [];
26
+ options.plugins.push(server.loaderPlugin());
27
+ }
28
+ return options;
29
+ }
30
+ };
31
+ }
32
+ function adapter(options) {
33
+ return {
34
+ async "core:render-body"(page) {
35
+ if (isAsyncAPI(page.data)) return /* @__PURE__ */ jsx(options.ClientAPIPage ?? (await import("../components/asyncapi.js")).default, { ...page.data.getAsyncAPIPageProps() });
36
+ },
37
+ "core:render-toc"(page) {
38
+ if (isAsyncAPI(page.data)) return page.data.toc;
39
+ },
40
+ "core:get-structured-data"(page) {
41
+ if (isAsyncAPI(page.data)) return page.data.structuredData;
42
+ }
43
+ };
44
+ }
45
+ function isAsyncAPI(data) {
46
+ return "getAsyncAPIPageProps" in data && typeof data.getAsyncAPIPageProps === "function";
47
+ }
48
+ //#endregion
49
+ export { asyncapiPlugin };
@@ -47,7 +47,7 @@ function blogPlugin({ paths = {}, isBlog = (page) => page.type === "blog", layou
47
47
  createPage({
48
48
  render: renderMode,
49
49
  path: this.i18nConfig ? joinPathname("/[lang]/(blog)", blogCtx.indexPath) : joinPathname("/(blog)", blogCtx.indexPath),
50
- staticPaths: this.i18nConfig ? Object.keys(this.i18nConfig.languages) : [],
50
+ staticPaths: this.i18nConfig ? this.i18nConfig.languages : [],
51
51
  component: IndexPage
52
52
  });
53
53
  }
@@ -57,7 +57,7 @@ function blogPlugin({ paths = {}, isBlog = (page) => page.type === "blog", layou
57
57
  createPage({
58
58
  path: joinPathname("/[lang]/(blog)", blogCtx.tagsPath),
59
59
  render: renderMode,
60
- staticPaths: Object.keys(this.i18nConfig.languages),
60
+ staticPaths: this.i18nConfig.languages,
61
61
  component: TagsPage
62
62
  });
63
63
  const groupedTags = await groupTagsI18n(this, blogPages);
@@ -2,7 +2,7 @@ import { ConfigContext } from "../config.js";
2
2
  import { Awaitable, ServerPlugin } from "../lib/types.js";
3
3
  import { FC } from "react";
4
4
  import { OpenAPIPageProps } from "fumadocs-openapi/ui";
5
- import { OpenAPIServer } from "fumadocs-openapi/server";
5
+ import { OpenAPIServer, Proxy } from "fumadocs-openapi/server";
6
6
 
7
7
  //#region src/plugins/openapi.d.ts
8
8
  interface OpenAPIOptions {
@@ -16,7 +16,7 @@ interface OpenAPIOptions {
16
16
  *
17
17
  * By default, it will create one when `proxyUrl` is specified in `createOpenAPI()`.
18
18
  */
19
- createProxy?: boolean | (() => Awaitable<ReturnType<OpenAPIServer["createProxy"]>>);
19
+ createProxy?: boolean | (() => Awaitable<Proxy>);
20
20
  }
21
21
  /**
22
22
  * this will register the OpenAPI adapter & required layout configs.
@@ -67,7 +67,7 @@ function adapter(options) {
67
67
  };
68
68
  }
69
69
  function isOpenAPI(data) {
70
- return "getAPIPageProps" in data && typeof data.getAPIPageProps === "function";
70
+ return "getOpenAPIPageProps" in data && typeof data.getOpenAPIPageProps === "function";
71
71
  }
72
72
  //#endregion
73
73
  export { openapiPlugin };
@@ -84,7 +84,7 @@ async function createRouter(userConfig) {
84
84
  fns.createPage({
85
85
  render: defaultRenderMode,
86
86
  path: "/[lang]/404",
87
- staticPaths: Object.keys(context.i18nConfig.languages),
87
+ staticPaths: context.i18nConfig.languages,
88
88
  component: layouts.notFound
89
89
  });
90
90
  if (context.mode !== "static") fns.createPage({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumapress",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "description": "An opinionated docs framework powered by Fumadocs",
5
5
  "keywords": [
6
6
  "Docs",
@@ -32,6 +32,7 @@
32
32
  "./layouts/notebook": "./dist/layouts/notebook.js",
33
33
  "./layouts/root": "./dist/layouts/root.js",
34
34
  "./layouts/switch": "./dist/layouts/switch.js",
35
+ "./plugins/asyncapi": "./dist/plugins/asyncapi.js",
35
36
  "./plugins/blog": "./dist/plugins/blog.js",
36
37
  "./plugins/flexsearch": "./dist/plugins/flexsearch.js",
37
38
  "./plugins/image/cloudflare": "./dist/plugins/image/cloudflare.js",
@@ -68,6 +69,7 @@
68
69
  },
69
70
  "devDependencies": {
70
71
  "@fastify/deepmerge": "^3.2.1",
72
+ "@fumadocs/asyncapi": "^0.0.2",
71
73
  "@tailwindcss/oxide": "^4.3.0",
72
74
  "@types/http-cache-semantics": "^4.2.0",
73
75
  "@types/mdx": "^2.0.14",
@@ -88,6 +90,7 @@
88
90
  "waku": "1.0.0-beta.3"
89
91
  },
90
92
  "peerDependencies": {
93
+ "@fumadocs/asyncapi": "0.x.x",
91
94
  "@types/mdx": "*",
92
95
  "@types/react": "*",
93
96
  "fumadocs-core": "^16.10.0",
@@ -101,6 +104,9 @@
101
104
  "waku": "1.0.0-beta.3"
102
105
  },
103
106
  "peerDependenciesMeta": {
107
+ "@fumadocs/asyncapi": {
108
+ "optional": true
109
+ },
104
110
  "sharp": {
105
111
  "optional": true
106
112
  },