fumapress 0.6.1 → 0.6.3

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 };
@@ -9,7 +9,7 @@ import { loader } from "fumadocs-core/source";
9
9
  import { AsyncLocalStorage } from "node:async_hooks";
10
10
  import { dynamicLoader } from "fumadocs-core/source/dynamic";
11
11
  //#region src/lib/shared.tsx
12
- var import_deepmerge = /* @__PURE__ */ __toESM(require_deepmerge());
12
+ var import_deepmerge = /* @__PURE__ */ __toESM(require_deepmerge(), 1);
13
13
  const appContext = new AsyncLocalStorage({ name: "fumapress:core" });
14
14
  function getPressContext() {
15
15
  const store = appContext.getStore();
@@ -16,7 +16,7 @@ var require_http_cache_semantics = /* @__PURE__ */ __commonJSMin(((exports, modu
16
16
  * Set of default cacheable status codes per RFC 7231 section 6.1.
17
17
  * @type {Set<number>}
18
18
  */
19
- const statusCodeCacheableByDefault = new Set([
19
+ const statusCodeCacheableByDefault = /* @__PURE__ */ new Set([
20
20
  200,
21
21
  203,
22
22
  204,
@@ -35,7 +35,7 @@ var require_http_cache_semantics = /* @__PURE__ */ __commonJSMin(((exports, modu
35
35
  * Note: This implementation does not understand partial responses (206).
36
36
  * @type {Set<number>}
37
37
  */
38
- const understoodStatuses = new Set([
38
+ const understoodStatuses = /* @__PURE__ */ new Set([
39
39
  200,
40
40
  203,
41
41
  204,
@@ -55,7 +55,7 @@ var require_http_cache_semantics = /* @__PURE__ */ __commonJSMin(((exports, modu
55
55
  * Set of HTTP error status codes.
56
56
  * @type {Set<number>}
57
57
  */
58
- const errorStatusCodes = new Set([
58
+ const errorStatusCodes = /* @__PURE__ */ new Set([
59
59
  500,
60
60
  502,
61
61
  503,
@@ -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);
@@ -3,7 +3,7 @@ import { isFullPathname } from "../../lib/pathname.js";
3
3
  import { require_http_cache_semantics } from "../../node_modules/.pnpm/http-cache-semantics@4.2.0/node_modules/http-cache-semantics/index.js";
4
4
  //#region src/plugins/image/self-hosted.utils.ts
5
5
  var import_http_cache_semantics = /* @__PURE__ */ __toESM(require_http_cache_semantics(), 1);
6
- const SAFE_IMAGE_CONTENT_TYPES = new Set([
6
+ const SAFE_IMAGE_CONTENT_TYPES = /* @__PURE__ */ new Set([
7
7
  "image/jpeg",
8
8
  "image/png",
9
9
  "image/gif",
@@ -27,16 +27,19 @@ function llmsPlugin(options = {}) {
27
27
  pathname: joinPathname(lang ?? "", basePath, ...segments)
28
28
  };
29
29
  }
30
+ function initRenderers(data) {
31
+ data.renderers ??= [];
32
+ data.renderers.push(function(res) {
33
+ res.markdownUrl ??= slugsToMarkdownPath(this.page.slugs, this.page.locale).pathname;
34
+ return res;
35
+ });
36
+ }
30
37
  return {
31
38
  name: "core:llms.txt",
32
39
  init() {
33
40
  if (this.mode === "dynamic") basePath = "/_llms.txt";
34
- this.data["core:docs-layout"] ??= {};
35
- this.data["core:docs-layout"].renderers ??= [];
36
- this.data["core:docs-layout"].renderers.push(function(res) {
37
- res.markdownUrl ??= slugsToMarkdownPath(this.page.slugs, this.page.locale).pathname;
38
- return res;
39
- });
41
+ initRenderers(this.data["core:docs-layout"] ??= {});
42
+ initRenderers(this.data["core:notebook-layout"] ??= {});
40
43
  },
41
44
  createMiddlewares({ app }) {
42
45
  if (this.mode === "static") return;
@@ -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 };
package/dist/router/fs.js CHANGED
@@ -10,8 +10,8 @@ const Methods = [
10
10
  "OPTIONS"
11
11
  ];
12
12
  const ValidMethods = new Set(Methods);
13
- const IGNORED_PATH_PARTS = new Set(["_components", "_hooks"]);
14
- const SPECIAL_BASENAME = new Set([
13
+ const IGNORED_PATH_PARTS = /* @__PURE__ */ new Set(["_components", "_hooks"]);
14
+ const SPECIAL_BASENAME = /* @__PURE__ */ new Set([
15
15
  "_layout",
16
16
  "index",
17
17
  "_root"
@@ -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.3",
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",
@@ -57,37 +58,39 @@
57
58
  "dependencies": {
58
59
  "@fuma-translate/react": "^1.0.2",
59
60
  "@orama/orama": "^3.1.18",
60
- "@takumi-rs/image-response": "^1.8.1",
61
+ "@takumi-rs/image-response": "^1.8.7",
61
62
  "class-variance-authority": "^0.7.1",
62
63
  "flexsearch": "^0.8.212",
63
- "lucide-react": "^1.17.0",
64
+ "lucide-react": "^1.22.0",
64
65
  "tailwind-merge": "^3.6.0",
65
- "vite": "^8.0.16",
66
+ "vite": "^8.1.0",
66
67
  "xml-js": "^1.6.11",
67
68
  "zod": "^4.4.3"
68
69
  },
69
70
  "devDependencies": {
70
71
  "@fastify/deepmerge": "^3.2.1",
71
- "@tailwindcss/oxide": "^4.3.0",
72
+ "@fumadocs/asyncapi": "0.0.4",
73
+ "@tailwindcss/oxide": "^4.3.2",
72
74
  "@types/http-cache-semantics": "^4.2.0",
73
75
  "@types/mdx": "^2.0.14",
74
- "@types/node": "^25.9.3",
76
+ "@types/node": "^26.0.1",
75
77
  "@types/react": "^19.2.17",
76
78
  "@types/react-dom": "^19.2.3",
77
- "fumadocs-core": "^16.10.2",
78
- "fumadocs-mdx": "^15.0.12",
79
- "fumadocs-openapi": "^11.0.1",
80
- "fumadocs-ui": "^16.10.2",
81
- "hono": "^4.12.25",
79
+ "fumadocs-core": "^16.10.7",
80
+ "fumadocs-mdx": "^15.0.13",
81
+ "fumadocs-openapi": "^11.0.6",
82
+ "fumadocs-ui": "^16.10.7",
83
+ "hono": "^4.12.27",
82
84
  "http-cache-semantics": "^4.2.0",
83
85
  "react": "^19.2.7",
84
86
  "react-dom": "^19.2.7",
85
- "sharp": "^0.35.1",
86
- "tsdown": "0.22.2",
87
+ "sharp": "^0.35.2",
88
+ "tsdown": "0.22.3",
87
89
  "typescript": "^6.0.3",
88
- "waku": "1.0.0-beta.3"
90
+ "waku": "1.0.0-beta.6"
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",
@@ -98,9 +101,12 @@
98
101
  "react": "^19.2.0",
99
102
  "react-dom": "^19.2.0",
100
103
  "sharp": "^0.34.0",
101
- "waku": "1.0.0-beta.3"
104
+ "waku": "1.0.0-beta.6"
102
105
  },
103
106
  "peerDependenciesMeta": {
107
+ "@fumadocs/asyncapi": {
108
+ "optional": true
109
+ },
104
110
  "sharp": {
105
111
  "optional": true
106
112
  },