@openpkg-ts/doc-generator 0.6.2 → 0.6.4
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/dist/react-styled.d.ts +4 -1
- package/dist/react-styled.js +37 -41
- package/dist/react.js +21 -25
- package/package.json +2 -2
- package/dist/cli.js +0 -387
- package/dist/index.d.ts +0 -819
- package/dist/index.js +0 -75
- package/dist/shared/server-4yabn81t.js +0 -1300
package/dist/react-styled.d.ts
CHANGED
|
@@ -218,7 +218,7 @@ interface TypeTableProps {
|
|
|
218
218
|
* ```
|
|
219
219
|
*/
|
|
220
220
|
declare function TypeTable({ items, showRequired, className, renderRow }: TypeTableProps): React.ReactNode;
|
|
221
|
-
import { CodeTabs, ImportSection, CodeTab, CodeTabsProps, ImportSectionProps } from "@
|
|
221
|
+
import { CodeTabs, ImportSection, CodeTab, CodeTabsProps, ImportSectionProps } from "@openpkg-ts/ui/api";
|
|
222
222
|
import { OpenPkg as OpenPkg7 } from "@openpkg-ts/spec";
|
|
223
223
|
import { OpenPkg as OpenPkg6, SpecExport as SpecExport3, SpecExportKind as SpecExportKind4, SpecType } from "@openpkg-ts/spec";
|
|
224
224
|
interface HTMLOptions {
|
|
@@ -670,6 +670,9 @@ interface NestedPropertyItemProps {
|
|
|
670
670
|
/**
|
|
671
671
|
* Single parameter with expand capability for nested objects.
|
|
672
672
|
* Features expandable nested params, type annotations, and required/optional badges.
|
|
673
|
+
*
|
|
674
|
+
* @deprecated Use APIParameterItem from @openpkg-ts/ui with specParamToAPIParam adapter.
|
|
675
|
+
* Will be removed in next major version.
|
|
673
676
|
*/
|
|
674
677
|
declare function ParameterItem({ param, depth, className }: ParameterItemProps): React.ReactNode;
|
|
675
678
|
import { OpenPkg as OpenPkg14, SpecExport as SpecExport8 } from "@openpkg-ts/spec";
|
package/dist/react-styled.js
CHANGED
|
@@ -3432,6 +3432,25 @@ var require_link = __commonJS((exports, module) => {
|
|
|
3432
3432
|
// src/components/headless/CollapsibleMethod.tsx
|
|
3433
3433
|
import { useEffect, useState } from "react";
|
|
3434
3434
|
|
|
3435
|
+
// src/core/format.ts
|
|
3436
|
+
function getMemberBadges(member) {
|
|
3437
|
+
const badges = [];
|
|
3438
|
+
const visibility = member.visibility ?? "public";
|
|
3439
|
+
if (visibility !== "public") {
|
|
3440
|
+
badges.push(visibility);
|
|
3441
|
+
}
|
|
3442
|
+
const flags = member.flags;
|
|
3443
|
+
if (flags?.static)
|
|
3444
|
+
badges.push("static");
|
|
3445
|
+
if (flags?.readonly)
|
|
3446
|
+
badges.push("readonly");
|
|
3447
|
+
if (flags?.async)
|
|
3448
|
+
badges.push("async");
|
|
3449
|
+
if (flags?.abstract)
|
|
3450
|
+
badges.push("abstract");
|
|
3451
|
+
return badges;
|
|
3452
|
+
}
|
|
3453
|
+
|
|
3435
3454
|
// src/core/query.ts
|
|
3436
3455
|
function formatSchema(schema) {
|
|
3437
3456
|
if (!schema)
|
|
@@ -3552,25 +3571,15 @@ function CollapsibleMethod({
|
|
|
3552
3571
|
const [expanded, setExpanded] = useState(defaultExpanded);
|
|
3553
3572
|
const sig = member.signatures?.[0];
|
|
3554
3573
|
const hasParams = sig?.parameters && sig.parameters.length > 0;
|
|
3555
|
-
const visibility = member.visibility ?? "public";
|
|
3556
|
-
const flags = member.flags;
|
|
3557
|
-
const isStatic = flags?.static;
|
|
3558
|
-
const isAsync = flags?.async;
|
|
3559
3574
|
const returnType = formatReturnType(sig);
|
|
3560
3575
|
const paramPreview = formatParamPreview(sig?.parameters);
|
|
3576
|
+
const badges = getMemberBadges(member);
|
|
3561
3577
|
const toggle = () => setExpanded(!expanded);
|
|
3562
3578
|
useEffect(() => {
|
|
3563
3579
|
if (typeof window !== "undefined" && window.location.hash === `#${member.name}`) {
|
|
3564
3580
|
setExpanded(true);
|
|
3565
3581
|
}
|
|
3566
3582
|
}, [member.name]);
|
|
3567
|
-
const badges = [];
|
|
3568
|
-
if (visibility !== "public")
|
|
3569
|
-
badges.push(visibility);
|
|
3570
|
-
if (isStatic)
|
|
3571
|
-
badges.push("static");
|
|
3572
|
-
if (isAsync)
|
|
3573
|
-
badges.push("async");
|
|
3574
3583
|
return /* @__PURE__ */ jsxs("div", {
|
|
3575
3584
|
id: member.name,
|
|
3576
3585
|
className,
|
|
@@ -3911,11 +3920,6 @@ function groupMembersByKind(members) {
|
|
|
3911
3920
|
return groups;
|
|
3912
3921
|
}
|
|
3913
3922
|
function MemberRow({ member }) {
|
|
3914
|
-
const visibility = member.visibility ?? "public";
|
|
3915
|
-
const flags = member.flags;
|
|
3916
|
-
const isStatic = flags?.static;
|
|
3917
|
-
const isAbstract = flags?.abstract;
|
|
3918
|
-
const isReadonly = flags?.readonly;
|
|
3919
3923
|
const type = formatSchema(member.schema);
|
|
3920
3924
|
const sig = member.signatures?.[0];
|
|
3921
3925
|
let signature = "";
|
|
@@ -3927,15 +3931,7 @@ function MemberRow({ member }) {
|
|
|
3927
3931
|
const returnType = formatSchema(sig.returns?.schema) ?? "void";
|
|
3928
3932
|
signature = `(${params.join(", ")}): ${returnType}`;
|
|
3929
3933
|
}
|
|
3930
|
-
const badges =
|
|
3931
|
-
if (visibility !== "public")
|
|
3932
|
-
badges.push(visibility);
|
|
3933
|
-
if (isStatic)
|
|
3934
|
-
badges.push("static");
|
|
3935
|
-
if (isAbstract)
|
|
3936
|
-
badges.push("abstract");
|
|
3937
|
-
if (isReadonly)
|
|
3938
|
-
badges.push("readonly");
|
|
3934
|
+
const badges = getMemberBadges(member);
|
|
3939
3935
|
return /* @__PURE__ */ jsxs4("div", {
|
|
3940
3936
|
"data-member": member.name,
|
|
3941
3937
|
children: [
|
|
@@ -4193,14 +4189,14 @@ function TypeTable({
|
|
|
4193
4189
|
});
|
|
4194
4190
|
}
|
|
4195
4191
|
// src/components/styled/index.ts
|
|
4196
|
-
import { CodeTabs, ImportSection } from "@
|
|
4192
|
+
import { CodeTabs, ImportSection } from "@openpkg-ts/ui/api";
|
|
4197
4193
|
|
|
4198
4194
|
// src/components/styled/sections/ClassSection.tsx
|
|
4199
4195
|
import {
|
|
4200
4196
|
APIParameterItem,
|
|
4201
4197
|
APISection,
|
|
4202
4198
|
ParameterList
|
|
4203
|
-
} from "@
|
|
4199
|
+
} from "@openpkg-ts/ui/docskit";
|
|
4204
4200
|
|
|
4205
4201
|
// src/adapters/spec-to-docskit.ts
|
|
4206
4202
|
function specSchemaToAPISchema(schema) {
|
|
@@ -4338,7 +4334,7 @@ function formatMethodSignature(member) {
|
|
|
4338
4334
|
const paramStr = params.map((p) => `${p.name}${p.required === false ? "?" : ""}: ${formatSchema(p.schema)}`).join(", ");
|
|
4339
4335
|
return `(${paramStr}): ${returnType}`;
|
|
4340
4336
|
}
|
|
4341
|
-
function
|
|
4337
|
+
function getMemberBadges2(member) {
|
|
4342
4338
|
const badges = [];
|
|
4343
4339
|
const flags = member.flags;
|
|
4344
4340
|
if (member.visibility && member.visibility !== "public") {
|
|
@@ -4418,7 +4414,7 @@ const instance = new ${exp.name}(${constructorParams.map((p) => p.name).join(",
|
|
|
4418
4414
|
className: "mt-6",
|
|
4419
4415
|
children: [
|
|
4420
4416
|
staticProperties.map((member) => {
|
|
4421
|
-
const badges =
|
|
4417
|
+
const badges = getMemberBadges2(member);
|
|
4422
4418
|
return /* @__PURE__ */ jsx8(APIParameterItem, {
|
|
4423
4419
|
name: member.name,
|
|
4424
4420
|
type: formatSchema(member.schema),
|
|
@@ -4426,7 +4422,7 @@ const instance = new ${exp.name}(${constructorParams.map((p) => p.name).join(",
|
|
|
4426
4422
|
}, member.name);
|
|
4427
4423
|
}),
|
|
4428
4424
|
staticMethods.map((member) => {
|
|
4429
|
-
const badges =
|
|
4425
|
+
const badges = getMemberBadges2(member);
|
|
4430
4426
|
return /* @__PURE__ */ jsx8(APIParameterItem, {
|
|
4431
4427
|
name: `${member.name}()`,
|
|
4432
4428
|
type: formatMethodSignature(member),
|
|
@@ -4439,7 +4435,7 @@ const instance = new ${exp.name}(${constructorParams.map((p) => p.name).join(",
|
|
|
4439
4435
|
title: "Methods",
|
|
4440
4436
|
className: "mt-6",
|
|
4441
4437
|
children: instanceMethods.map((member) => {
|
|
4442
|
-
const badges =
|
|
4438
|
+
const badges = getMemberBadges2(member);
|
|
4443
4439
|
return /* @__PURE__ */ jsx8(APIParameterItem, {
|
|
4444
4440
|
name: `${member.name}()`,
|
|
4445
4441
|
type: formatMethodSignature(member),
|
|
@@ -4451,7 +4447,7 @@ const instance = new ${exp.name}(${constructorParams.map((p) => p.name).join(",
|
|
|
4451
4447
|
title: "Properties",
|
|
4452
4448
|
className: "mt-6",
|
|
4453
4449
|
children: instanceProperties.map((member) => {
|
|
4454
|
-
const badges =
|
|
4450
|
+
const badges = getMemberBadges2(member);
|
|
4455
4451
|
return /* @__PURE__ */ jsx8(APIParameterItem, {
|
|
4456
4452
|
name: member.name,
|
|
4457
4453
|
type: formatSchema(member.schema),
|
|
@@ -4481,7 +4477,7 @@ import {
|
|
|
4481
4477
|
APIParameterItem as APIParameterItem2,
|
|
4482
4478
|
APISection as APISection2,
|
|
4483
4479
|
ParameterList as ParameterList2
|
|
4484
|
-
} from "@
|
|
4480
|
+
} from "@openpkg-ts/ui/docskit";
|
|
4485
4481
|
import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
4486
4482
|
|
|
4487
4483
|
function EnumSection({ export: exp, spec }) {
|
|
@@ -4559,7 +4555,7 @@ function EnumPage({ export: exp, spec }) {
|
|
|
4559
4555
|
}
|
|
4560
4556
|
|
|
4561
4557
|
// src/components/styled/ExportIndexPage.tsx
|
|
4562
|
-
import { cn as cn2 } from "@
|
|
4558
|
+
import { cn as cn2 } from "@openpkg-ts/ui/lib/utils";
|
|
4563
4559
|
|
|
4564
4560
|
// ../../node_modules/lucide-react/dist/esm/createLucideIcon.js
|
|
4565
4561
|
import { forwardRef as forwardRef2, createElement as createElement2 } from "react";
|
|
@@ -22597,7 +22593,7 @@ import { useState as useState4, useMemo } from "react";
|
|
|
22597
22593
|
|
|
22598
22594
|
// src/components/styled/ExportCard.tsx
|
|
22599
22595
|
var import_link3 = __toESM(require_link(), 1);
|
|
22600
|
-
import { cn } from "@
|
|
22596
|
+
import { cn } from "@openpkg-ts/ui/lib/utils";
|
|
22601
22597
|
import { jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
22602
22598
|
|
|
22603
22599
|
var KIND_COLORS = {
|
|
@@ -22822,7 +22818,7 @@ import {
|
|
|
22822
22818
|
APISection as APISection3,
|
|
22823
22819
|
ParameterList as ParameterList3,
|
|
22824
22820
|
ResponseBlock
|
|
22825
|
-
} from "@
|
|
22821
|
+
} from "@openpkg-ts/ui/docskit";
|
|
22826
22822
|
import { jsx as jsx14, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
22827
22823
|
|
|
22828
22824
|
function FunctionSection({
|
|
@@ -22924,7 +22920,7 @@ import {
|
|
|
22924
22920
|
APIParameterItem as APIParameterItem4,
|
|
22925
22921
|
APISection as APISection4,
|
|
22926
22922
|
ParameterList as ParameterList4
|
|
22927
|
-
} from "@
|
|
22923
|
+
} from "@openpkg-ts/ui/docskit";
|
|
22928
22924
|
import { jsx as jsx16, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
22929
22925
|
|
|
22930
22926
|
function formatMethodSignature2(member) {
|
|
@@ -23040,7 +23036,7 @@ import {
|
|
|
23040
23036
|
APIParameterItem as APIParameterItem5,
|
|
23041
23037
|
APISection as APISection5,
|
|
23042
23038
|
ParameterList as ParameterList5
|
|
23043
|
-
} from "@
|
|
23039
|
+
} from "@openpkg-ts/ui/docskit";
|
|
23044
23040
|
import { jsx as jsx18, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
23045
23041
|
|
|
23046
23042
|
function VariableSection({
|
|
@@ -23203,8 +23199,8 @@ function APIPage({
|
|
|
23203
23199
|
}
|
|
23204
23200
|
}
|
|
23205
23201
|
// src/components/styled/FullAPIReferencePage.tsx
|
|
23206
|
-
import { APIReferencePage } from "@
|
|
23207
|
-
import { cn as cn3 } from "@
|
|
23202
|
+
import { APIReferencePage } from "@openpkg-ts/ui/docskit";
|
|
23203
|
+
import { cn as cn3 } from "@openpkg-ts/ui/lib/utils";
|
|
23208
23204
|
import { useState as useState5, useMemo as useMemo2, useEffect as useEffect2, useRef, useCallback } from "react";
|
|
23209
23205
|
|
|
23210
23206
|
// src/components/styled/sections/ExportSection.tsx
|
|
@@ -23488,7 +23484,7 @@ function FullAPIReferencePage({
|
|
|
23488
23484
|
});
|
|
23489
23485
|
}
|
|
23490
23486
|
// src/components/styled/ParameterItem.tsx
|
|
23491
|
-
import { cn as cn4 } from "@
|
|
23487
|
+
import { cn as cn4 } from "@openpkg-ts/ui/lib/utils";
|
|
23492
23488
|
import { useState as useState6 } from "react";
|
|
23493
23489
|
import { jsx as jsx23, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
23494
23490
|
|
package/dist/react.js
CHANGED
|
@@ -20,6 +20,25 @@ var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports,
|
|
|
20
20
|
// src/components/headless/CollapsibleMethod.tsx
|
|
21
21
|
import { useEffect, useState } from "react";
|
|
22
22
|
|
|
23
|
+
// src/core/format.ts
|
|
24
|
+
function getMemberBadges(member) {
|
|
25
|
+
const badges = [];
|
|
26
|
+
const visibility = member.visibility ?? "public";
|
|
27
|
+
if (visibility !== "public") {
|
|
28
|
+
badges.push(visibility);
|
|
29
|
+
}
|
|
30
|
+
const flags = member.flags;
|
|
31
|
+
if (flags?.static)
|
|
32
|
+
badges.push("static");
|
|
33
|
+
if (flags?.readonly)
|
|
34
|
+
badges.push("readonly");
|
|
35
|
+
if (flags?.async)
|
|
36
|
+
badges.push("async");
|
|
37
|
+
if (flags?.abstract)
|
|
38
|
+
badges.push("abstract");
|
|
39
|
+
return badges;
|
|
40
|
+
}
|
|
41
|
+
|
|
23
42
|
// src/core/query.ts
|
|
24
43
|
function formatSchema(schema) {
|
|
25
44
|
if (!schema)
|
|
@@ -140,25 +159,15 @@ function CollapsibleMethod({
|
|
|
140
159
|
const [expanded, setExpanded] = useState(defaultExpanded);
|
|
141
160
|
const sig = member.signatures?.[0];
|
|
142
161
|
const hasParams = sig?.parameters && sig.parameters.length > 0;
|
|
143
|
-
const visibility = member.visibility ?? "public";
|
|
144
|
-
const flags = member.flags;
|
|
145
|
-
const isStatic = flags?.static;
|
|
146
|
-
const isAsync = flags?.async;
|
|
147
162
|
const returnType = formatReturnType(sig);
|
|
148
163
|
const paramPreview = formatParamPreview(sig?.parameters);
|
|
164
|
+
const badges = getMemberBadges(member);
|
|
149
165
|
const toggle = () => setExpanded(!expanded);
|
|
150
166
|
useEffect(() => {
|
|
151
167
|
if (typeof window !== "undefined" && window.location.hash === `#${member.name}`) {
|
|
152
168
|
setExpanded(true);
|
|
153
169
|
}
|
|
154
170
|
}, [member.name]);
|
|
155
|
-
const badges = [];
|
|
156
|
-
if (visibility !== "public")
|
|
157
|
-
badges.push(visibility);
|
|
158
|
-
if (isStatic)
|
|
159
|
-
badges.push("static");
|
|
160
|
-
if (isAsync)
|
|
161
|
-
badges.push("async");
|
|
162
171
|
return /* @__PURE__ */ jsxs("div", {
|
|
163
172
|
id: member.name,
|
|
164
173
|
className,
|
|
@@ -499,11 +508,6 @@ function groupMembersByKind(members) {
|
|
|
499
508
|
return groups;
|
|
500
509
|
}
|
|
501
510
|
function MemberRow({ member }) {
|
|
502
|
-
const visibility = member.visibility ?? "public";
|
|
503
|
-
const flags = member.flags;
|
|
504
|
-
const isStatic = flags?.static;
|
|
505
|
-
const isAbstract = flags?.abstract;
|
|
506
|
-
const isReadonly = flags?.readonly;
|
|
507
511
|
const type = formatSchema(member.schema);
|
|
508
512
|
const sig = member.signatures?.[0];
|
|
509
513
|
let signature = "";
|
|
@@ -515,15 +519,7 @@ function MemberRow({ member }) {
|
|
|
515
519
|
const returnType = formatSchema(sig.returns?.schema) ?? "void";
|
|
516
520
|
signature = `(${params.join(", ")}): ${returnType}`;
|
|
517
521
|
}
|
|
518
|
-
const badges =
|
|
519
|
-
if (visibility !== "public")
|
|
520
|
-
badges.push(visibility);
|
|
521
|
-
if (isStatic)
|
|
522
|
-
badges.push("static");
|
|
523
|
-
if (isAbstract)
|
|
524
|
-
badges.push("abstract");
|
|
525
|
-
if (isReadonly)
|
|
526
|
-
badges.push("readonly");
|
|
522
|
+
const badges = getMemberBadges(member);
|
|
527
523
|
return /* @__PURE__ */ jsxs4("div", {
|
|
528
524
|
"data-member": member.name,
|
|
529
525
|
children: [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openpkg-ts/doc-generator",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.4",
|
|
4
4
|
"description": "API doc generator consuming OpenPkg specs. TypeDoc alternative for modern doc frameworks.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"openpkg",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"test:watch": "bun test --watch"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@
|
|
58
|
+
"@openpkg-ts/ui": "workspace:*",
|
|
59
59
|
"@openpkg-ts/spec": "^0.11.1",
|
|
60
60
|
"commander": "^14.0.0"
|
|
61
61
|
},
|