@supatent/supatent-docs 0.1.0 → 0.1.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.
Files changed (2) hide show
  1. package/README.md +70 -0
  2. package/package.json +18 -8
package/README.md ADDED
@@ -0,0 +1,70 @@
1
+ # @supatent/supatent-docs
2
+
3
+ SSR docs framework for Next.js using Supatent content.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm i @supatent/supatent-docs
9
+ ```
10
+
11
+ ## Minimal setup
12
+
13
+ ```ts
14
+ // docs.config.ts
15
+ import { defineDocsConfig } from "@supatent/supatent-docs";
16
+
17
+ export const docsConfig = defineDocsConfig({
18
+ supatent: {
19
+ baseUrl: process.env.SUPATENT_BASE_URL || "https://app.supatent.ai",
20
+ projectSlug: process.env.SUPATENT_PROJECT_SLUG!,
21
+ },
22
+ schemas: {
23
+ settings: process.env.DOCS_SCHEMA_SETTINGS!,
24
+ page: process.env.DOCS_SCHEMA_PAGE!,
25
+ category: process.env.DOCS_SCHEMA_CATEGORY!,
26
+ },
27
+ routing: {
28
+ basePath: process.env.DOCS_BASE_PATH || "/docs",
29
+ defaultLocale: process.env.DOCS_DEFAULT_LOCALE || "en-US",
30
+ locales: (process.env.DOCS_LOCALES || "en-US").split(",").map((x) => x.trim()),
31
+ fallbackMode: process.env.DOCS_FALLBACK_MODE === "none" ? "none" : "defaultLocale",
32
+ },
33
+ });
34
+ ```
35
+
36
+ ```ts
37
+ // app/layout.tsx
38
+ import "@supatent/supatent-docs/styles.css";
39
+
40
+ export { docsMetadata as metadata } from "@supatent/supatent-docs/next";
41
+ export { DocsRootLayout as default } from "@supatent/supatent-docs/next";
42
+ ```
43
+
44
+ ```ts
45
+ // app/page.tsx
46
+ export { DocsHomePage as default } from "@supatent/supatent-docs/next";
47
+ ```
48
+
49
+ ```ts
50
+ // next.config.ts
51
+ import type { NextConfig } from "next";
52
+ import { withSupatentDocs } from "@supatent/supatent-docs/next-config";
53
+
54
+ const nextConfig: NextConfig = {};
55
+ export default withSupatentDocs(nextConfig);
56
+ ```
57
+
58
+ ```ts
59
+ // middleware.ts
60
+ import { docsMiddleware } from "@supatent/supatent-docs/next";
61
+
62
+ export const middleware = docsMiddleware;
63
+ export const config = {
64
+ matcher: ["/((?!_next|api|favicon.ico|robots.txt|sitemap.xml).*)"],
65
+ };
66
+ ```
67
+
68
+ For the full integration guide and examples, see:
69
+ - [Repo README](https://github.com/supatent/supatent-docs/blob/main/README.md)
70
+ - [Integration test shell](https://github.com/supatent/supatent-docs/tree/main/test_project)
package/package.json CHANGED
@@ -1,21 +1,17 @@
1
1
  {
2
2
  "name": "@supatent/supatent-docs",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "private": false,
5
+ "description": "SSR docs framework for Next.js using Supatent content.",
5
6
  "type": "module",
6
7
  "main": "./dist/index.js",
7
8
  "types": "./dist/index.d.ts",
8
9
  "files": [
10
+ "README.md",
9
11
  "dist",
10
12
  "src",
11
13
  "runtime"
12
14
  ],
13
- "scripts": {
14
- "prepare:runtime": "node scripts/prepare-runtime.mjs",
15
- "build": "pnpm run prepare:runtime && tsup --config tsup.config.ts",
16
- "clean": "rm -rf dist",
17
- "prepack": "pnpm run build"
18
- },
19
15
  "exports": {
20
16
  ".": {
21
17
  "types": "./dist/index.d.ts",
@@ -41,9 +37,23 @@
41
37
  "publishConfig": {
42
38
  "access": "public"
43
39
  },
40
+ "repository": {
41
+ "type": "git",
42
+ "url": "https://github.com/supatent/supatent-docs.git",
43
+ "directory": "packages/supatent-docs"
44
+ },
45
+ "homepage": "https://github.com/supatent/supatent-docs#readme",
46
+ "bugs": {
47
+ "url": "https://github.com/supatent/supatent-docs/issues"
48
+ },
44
49
  "peerDependencies": {
45
50
  "next": "^16.1.6",
46
51
  "react": "^19.2.4",
47
52
  "react-dom": "^19.2.4"
53
+ },
54
+ "scripts": {
55
+ "prepare:runtime": "node scripts/prepare-runtime.mjs",
56
+ "build": "pnpm run prepare:runtime && tsup --config tsup.config.ts",
57
+ "clean": "rm -rf dist"
48
58
  }
49
- }
59
+ }