@hamur/fumadocs 0.0.0-stage → 0.0.1

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/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 productdevbook
4
+ Copyright (c) 2019 Material-UI SAS
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,31 @@
1
- # Temporary Holding Version
1
+ # @hamur/fumadocs
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The [Fumadocs](https://fumadocs.dev) framework provider for [Hamur](https://github.com/productdevbook/hamur), a full-stack web framework for Bun. `HamurProvider` gives Fumadocs the path, params, router and `Link` of a Hamur React app. It has no dependency.
4
+
5
+ ## Install
6
+
7
+ ```sh
8
+ bun add @hamur/fumadocs fumadocs-core fumadocs-ui
9
+ ```
10
+
11
+ Wrap Fumadocs' root provider in `app/app.tsx`:
12
+
13
+ ```tsx
14
+ import { Outlet } from "@hamur/adapter-react"
15
+ import { HamurProvider } from "@hamur/fumadocs"
16
+ import { RootProvider } from "fumadocs-ui/provider/base"
17
+
18
+ export default function App() {
19
+ return (
20
+ <HamurProvider>
21
+ <RootProvider>
22
+ <Outlet />
23
+ </RootProvider>
24
+ </HamurProvider>
25
+ )
26
+ }
27
+ ```
28
+
29
+ ## Docs
30
+
31
+ [Docs with Fumadocs](https://docs.productdevbook.com/recipes/docs-with-fumadocs) and the [API reference](https://docs.productdevbook.com/api-reference/fumadocs). MIT license.
@@ -0,0 +1,30 @@
1
+ // packages/fumadocs/src/index.tsx
2
+ import { Link, useRoute, useRouter } from "@hamur/adapter-react";
3
+ import { FrameworkProvider } from "fumadocs-core/framework";
4
+ import { jsxDEV } from "react/jsx-dev-runtime";
5
+ var framework = {
6
+ usePathname() {
7
+ return useRoute().path;
8
+ },
9
+ useParams() {
10
+ return useRoute().params;
11
+ },
12
+ useRouter,
13
+ Link({ href, ...props }) {
14
+ return /* @__PURE__ */ jsxDEV(Link, {
15
+ to: href,
16
+ ...props
17
+ }, undefined, false, undefined, this);
18
+ }
19
+ };
20
+ function HamurProvider({ children, Link: CustomLink, Image: CustomImage }) {
21
+ return /* @__PURE__ */ jsxDEV(FrameworkProvider, {
22
+ ...framework,
23
+ Link: CustomLink ?? framework.Link,
24
+ Image: CustomImage ?? framework.Image,
25
+ children
26
+ }, undefined, false, undefined, this);
27
+ }
28
+ export {
29
+ HamurProvider
30
+ };
@@ -0,0 +1,8 @@
1
+ import { type Framework } from "fumadocs-core/framework";
2
+ import type { ReactNode } from "react";
3
+ export interface HamurProviderProps {
4
+ children: ReactNode;
5
+ Link?: Framework["Link"];
6
+ Image?: Framework["Image"];
7
+ }
8
+ export declare function HamurProvider({ children, Link: CustomLink, Image: CustomImage }: HamurProviderProps): import("react").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,28 @@
1
1
  {
2
2
  "name": "@hamur/fumadocs",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.0.1",
4
+ "type": "module",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/productdevbook/hamur.git",
9
+ "directory": "packages/fumadocs"
10
+ },
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/types/src/index.d.ts",
14
+ "default": "./dist/src/index.js"
15
+ },
16
+ "./package.json": "./package.json"
17
+ },
18
+ "files": [
19
+ "dist",
20
+ "src"
21
+ ],
22
+ "dependencies": {},
23
+ "peerDependencies": {
24
+ "@hamur/adapter-react": "^0.0.1",
25
+ "fumadocs-core": "^16.19.8",
26
+ "react": "^19.3.1"
27
+ }
28
+ }
package/src/index.tsx ADDED
@@ -0,0 +1,30 @@
1
+ import { Link, useRoute, useRouter } from "@hamur/adapter-react"
2
+ import { type Framework, FrameworkProvider } from "fumadocs-core/framework"
3
+ import type { ReactNode } from "react"
4
+
5
+ const framework: Framework = {
6
+ usePathname() {
7
+ return useRoute().path
8
+ },
9
+ useParams() {
10
+ return useRoute().params
11
+ },
12
+ useRouter,
13
+ Link({ href, ...props }) {
14
+ return <Link to={href!} {...props} />
15
+ },
16
+ }
17
+
18
+ export interface HamurProviderProps {
19
+ children: ReactNode
20
+ Link?: Framework["Link"]
21
+ Image?: Framework["Image"]
22
+ }
23
+
24
+ export function HamurProvider({ children, Link: CustomLink, Image: CustomImage }: HamurProviderProps) {
25
+ return (
26
+ <FrameworkProvider {...framework} Link={CustomLink ?? framework.Link} Image={CustomImage ?? framework.Image}>
27
+ {children}
28
+ </FrameworkProvider>
29
+ )
30
+ }