@openpkg-ts/adapters 0.3.5 → 0.3.6

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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  SidebarKindBadge
3
- } from "../../shared/chunk-t3t704xs.js";
3
+ } from "../shared/chunk-zx6z8199.js";
4
4
  export {
5
5
  SidebarKindBadge
6
6
  };
@@ -1,14 +1,20 @@
1
1
  import {
2
- registerAdapter
3
- } from "../registry.js";
4
- import {
2
+ SUPPORTED_KINDS,
5
3
  SidebarKindBadge
6
- } from "../shared/chunk-t3t704xs.js";
4
+ } from "./shared/chunk-zx6z8199.js";
7
5
 
8
6
  // src/fumadocs/index.ts
9
7
  import * as fs from "node:fs";
10
8
  import * as path from "node:path";
11
9
  import { createDocs as createDocs2 } from "@openpkg-ts/sdk";
10
+
11
+ // src/registry.ts
12
+ var registry = new Map;
13
+ function registerAdapter(adapter) {
14
+ registry.set(adapter.id, adapter);
15
+ }
16
+
17
+ // src/fumadocs/index.ts
12
18
  import {
13
19
  buildSignatureString,
14
20
  createDocs as createDocs3,
@@ -40,18 +46,6 @@ import {
40
46
 
41
47
  // src/fumadocs/plugin.ts
42
48
  import { createElement } from "react";
43
- var SUPPORTED_KINDS = new Set([
44
- "function",
45
- "class",
46
- "interface",
47
- "type",
48
- "enum",
49
- "variable",
50
- "namespace",
51
- "module",
52
- "reference",
53
- "external"
54
- ]);
55
49
  function openpkgPlugin(options = {}) {
56
50
  const { showBadges = true } = options;
57
51
  return {
@@ -75,31 +69,11 @@ function openpkgPlugin(options = {}) {
75
69
  }
76
70
  // src/fumadocs/source.ts
77
71
  import { createDocs } from "@openpkg-ts/sdk";
78
- var KIND_ORDER = ["function", "class", "interface", "type", "enum", "variable"];
79
- var KIND_LABELS = {
80
- function: "Functions",
81
- class: "Classes",
82
- interface: "Interfaces",
83
- type: "Types",
84
- enum: "Enums",
85
- variable: "Variables",
86
- namespace: "Namespaces",
87
- module: "Modules",
88
- reference: "References",
89
- external: "External"
90
- };
91
- var KIND_SLUGS = {
92
- function: "functions",
93
- class: "classes",
94
- interface: "interfaces",
95
- type: "types",
96
- enum: "enums",
97
- variable: "variables",
98
- namespace: "namespaces",
99
- module: "modules",
100
- reference: "references",
101
- external: "externals"
102
- };
72
+ import {
73
+ DISPLAY_KIND_ORDER,
74
+ KIND_LABELS,
75
+ KIND_SLUGS
76
+ } from "@openpkg-ts/spec";
103
77
  function pluralizeKind(kind) {
104
78
  return KIND_SLUGS[kind] || `${kind}s`;
105
79
  }
@@ -146,7 +120,7 @@ function openpkgSource(options) {
146
120
  if (indexPage) {
147
121
  rootPages.push("index");
148
122
  }
149
- for (const kind of KIND_ORDER) {
123
+ for (const kind of DISPLAY_KIND_ORDER) {
150
124
  if (groupedByKind.has(kind)) {
151
125
  rootPages.push(`...${pluralizeKind(kind)}`);
152
126
  }
@@ -173,7 +147,7 @@ function openpkgSource(options) {
173
147
  }
174
148
  });
175
149
  }
176
- for (const kind of KIND_ORDER) {
150
+ for (const kind of DISPLAY_KIND_ORDER) {
177
151
  const kindExports = groupedByKind.get(kind);
178
152
  if (!kindExports || kindExports.length === 0)
179
153
  continue;
@@ -1,18 +1,8 @@
1
1
  // src/fumadocs/components/sidebar-badge.tsx
2
+ import { KIND_LABELS } from "@openpkg-ts/spec";
2
3
  import { KindBadge as UIKindBadge } from "@openpkg-ts/ui/badge";
3
4
  import { createElement } from "react";
4
- var SUPPORTED_KINDS = new Set([
5
- "function",
6
- "class",
7
- "interface",
8
- "type",
9
- "enum",
10
- "variable",
11
- "namespace",
12
- "module",
13
- "reference",
14
- "external"
15
- ]);
5
+ var SUPPORTED_KINDS = new Set(Object.keys(KIND_LABELS));
16
6
  function SidebarKindBadge({ kind, className }) {
17
7
  if (!SUPPORTED_KINDS.has(kind))
18
8
  return null;
@@ -23,4 +13,4 @@ function SidebarKindBadge({ kind, className }) {
23
13
  });
24
14
  }
25
15
 
26
- export { SidebarKindBadge };
16
+ export { SUPPORTED_KINDS, SidebarKindBadge };
package/dist/registry.js CHANGED
@@ -14,5 +14,3 @@ export {
14
14
  listAdapters,
15
15
  getAdapter
16
16
  };
17
-
18
- export { registerAdapter };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openpkg-ts/adapters",
3
- "version": "0.3.5",
3
+ "version": "0.3.6",
4
4
  "description": "Framework adapters for OpenPkg - Fumadocs, Docusaurus, Mintlify, etc.",
5
5
  "keywords": [
6
6
  "openpkg",
@@ -19,18 +19,19 @@
19
19
  "license": "MIT",
20
20
  "author": "Ryan Waits",
21
21
  "type": "module",
22
+ "main": "./dist/registry.js",
22
23
  "exports": {
23
24
  ".": {
24
- "import": "./src/registry.ts",
25
- "types": "./src/registry.ts"
25
+ "import": "./dist/registry.js",
26
+ "types": "./dist/registry.d.ts"
26
27
  },
27
28
  "./fumadocs": {
28
- "import": "./src/fumadocs/index.ts",
29
- "types": "./src/fumadocs/index.ts"
29
+ "import": "./dist/fumadocs/index.js",
30
+ "types": "./dist/fumadocs/index.d.ts"
30
31
  },
31
32
  "./fumadocs/components": {
32
- "import": "./dist/components/index.js",
33
- "types": "./dist/components/index.d.ts"
33
+ "import": "./dist/fumadocs/components/index.js",
34
+ "types": "./dist/fumadocs/components/index.d.ts"
34
35
  },
35
36
  "./fumadocs/css": "./src/fumadocs/styles/docskit.css"
36
37
  },
@@ -47,7 +48,7 @@
47
48
  "dependencies": {
48
49
  "@openpkg-ts/sdk": "^0.35.0",
49
50
  "@openpkg-ts/spec": "^0.34.1",
50
- "@openpkg-ts/ui": "^0.1.6"
51
+ "@openpkg-ts/ui": "^0.1.7"
51
52
  },
52
53
  "peerDependencies": {
53
54
  "fumadocs-core": "^16.0.0",