@blaaiz/docs-core 0.3.0 → 0.5.0
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/{chunk-ICDBGTIJ.js → chunk-ZWDLAW5M.js} +98 -44
- package/dist/chunk-ZWDLAW5M.js.map +1 -0
- package/dist/generator.cjs +150 -49
- package/dist/generator.cjs.map +1 -1
- package/dist/generator.js +55 -8
- package/dist/generator.js.map +1 -1
- package/dist/index.cjs +96 -42
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +49 -7
- package/dist/index.d.ts +49 -7
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/skills/SKILL.md +5 -0
- package/dist/chunk-ICDBGTIJ.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -617,15 +617,48 @@ interface PlannedApiPage {
|
|
|
617
617
|
/** Position within the group. */
|
|
618
618
|
readonly order: number;
|
|
619
619
|
}
|
|
620
|
+
/**
|
|
621
|
+
* A child folder of a planned API group, at its position among the group's
|
|
622
|
+
* pages. The generator merges these with the resolved page slugs to write the
|
|
623
|
+
* group's `meta.json` in declared order.
|
|
624
|
+
*
|
|
625
|
+
* @public
|
|
626
|
+
*/
|
|
627
|
+
interface PlannedGroupChild {
|
|
628
|
+
readonly order: number;
|
|
629
|
+
/** The child folder's name within the group directory. */
|
|
630
|
+
readonly folder: string;
|
|
631
|
+
}
|
|
620
632
|
/**
|
|
621
633
|
* A planned API group folder. The generator fills its page order once the
|
|
622
|
-
* operation slugs are known
|
|
634
|
+
* operation slugs are known, interleaving {@link PlannedGroupChild} folders at
|
|
635
|
+
* their declared positions. A group with `root: true` is an API tab's folder.
|
|
623
636
|
*
|
|
624
637
|
* @public
|
|
625
638
|
*/
|
|
626
639
|
interface PlannedApiGroup {
|
|
627
640
|
readonly dir: string;
|
|
628
641
|
readonly title: string;
|
|
642
|
+
readonly children: readonly PlannedGroupChild[];
|
|
643
|
+
/** Set on an API tab's own folder, so the sidebar scopes to the tab. */
|
|
644
|
+
readonly root?: boolean;
|
|
645
|
+
/** The tab's icon, on a `root` group. */
|
|
646
|
+
readonly icon?: string;
|
|
647
|
+
}
|
|
648
|
+
/**
|
|
649
|
+
* A doc page declared inside an API tab, at its position among the group's
|
|
650
|
+
* operations. The generator links it into the group's `meta.json`: the page
|
|
651
|
+
* keeps living in its own folder, outside the generated tree.
|
|
652
|
+
*
|
|
653
|
+
* @public
|
|
654
|
+
*/
|
|
655
|
+
interface PlannedApiDocLink {
|
|
656
|
+
/** Page path relative to the docs output directory, without extension. */
|
|
657
|
+
readonly file: string;
|
|
658
|
+
/** The generated group folder whose meta lists the link. */
|
|
659
|
+
readonly dir: string;
|
|
660
|
+
/** Position within the group. */
|
|
661
|
+
readonly order: number;
|
|
629
662
|
}
|
|
630
663
|
/**
|
|
631
664
|
* A `meta.json` file the plan wants written.
|
|
@@ -647,8 +680,13 @@ interface DocsTreePlan {
|
|
|
647
680
|
readonly specs: readonly string[];
|
|
648
681
|
readonly apiPages: readonly PlannedApiPage[];
|
|
649
682
|
readonly apiGroups: readonly PlannedApiGroup[];
|
|
650
|
-
/** Fully-known meta files: the root, tab folders, and doc groups. */
|
|
683
|
+
/** Fully-known meta files: the root, doc tab folders, and doc groups. */
|
|
651
684
|
readonly metas: readonly PlannedMeta[];
|
|
685
|
+
/**
|
|
686
|
+
* Doc pages declared inside API tabs, each linked into its group's meta at
|
|
687
|
+
* its declared position.
|
|
688
|
+
*/
|
|
689
|
+
readonly apiDocLinks: readonly PlannedApiDocLink[];
|
|
652
690
|
}
|
|
653
691
|
/**
|
|
654
692
|
* Options for {@link planDocsTree}.
|
|
@@ -656,23 +694,27 @@ interface DocsTreePlan {
|
|
|
656
694
|
* @public
|
|
657
695
|
*/
|
|
658
696
|
interface PlanDocsTreeOptions {
|
|
659
|
-
/** Folder for generated API pages. Default `api`. */
|
|
697
|
+
/** Folder for generated API pages when one tab publishes them. Default `api`. */
|
|
660
698
|
readonly apiDir?: string;
|
|
661
699
|
}
|
|
662
700
|
/**
|
|
663
701
|
* Plan the content tree for a navigation.
|
|
664
702
|
*
|
|
665
703
|
* Conventions (Mintlify-shaped):
|
|
666
|
-
* - A tab whose items reference OpenAPI files becomes
|
|
667
|
-
*
|
|
704
|
+
* - A tab whose items reference OpenAPI files becomes an API tab. With one API
|
|
705
|
+
* tab its folder is `apiDir`; with several, each tab's folder is its
|
|
706
|
+
* slugified title, so tabs never collide. Groups become nested folders named
|
|
707
|
+
* by slugified group title, to any depth.
|
|
668
708
|
* - A tab of doc pages becomes the folder its pages share (their first path
|
|
669
|
-
* segment); a doc group's pages must share one directory.
|
|
709
|
+
* segment); a doc group's pages must share one directory. Doc groups nest.
|
|
670
710
|
* - Root-level doc pages (no `/` in the path) are listed in the root meta.
|
|
671
711
|
* - Tab folders get `root: true`, so the sidebar scopes to the active tab.
|
|
712
|
+
* - Sidebar order is declaration order, pages and groups interleaved.
|
|
672
713
|
*
|
|
673
714
|
* @param navigation - the parsed navigation
|
|
674
715
|
* @param options - the API folder name
|
|
675
716
|
* @returns the plan the generator executes
|
|
717
|
+
* @throws when two sibling groups slugify to the same folder
|
|
676
718
|
* @public
|
|
677
719
|
*/
|
|
678
720
|
declare function planDocsTree(navigation: Navigation, options?: PlanDocsTreeOptions): DocsTreePlan;
|
|
@@ -1252,4 +1294,4 @@ declare class OpenApiMergeError extends Error {
|
|
|
1252
1294
|
*/
|
|
1253
1295
|
declare function mergeOpenApiDocuments(inputs: readonly unknown[], options: MergeOpenApiOptions): OpenApiDocument;
|
|
1254
1296
|
|
|
1255
|
-
export { AiConfig, type AiMessage, type AskAiDocumentsSource, type AskAiRoute, type AskAiRouteOptions, type AskAiSource, type AuthGateOptions, type BuildSitemapOptions, type CreateMarkdownRouteOptions, type CreateTryItProxyOptions, DocsConfig, type DocsMetadata, type DocsRobots, type DocsSitemapEntry, type DocsTreePlan, type EmailSignInOptions, type FetchLike, type GoogleAuthHandlers, type GoogleAuthOptions, type IndexedDocument, InvalidNavigationError, type MarkdownRoute, type MdxReader, type MdxToMarkdownOptions, type MergeOpenApiOptions, Navigation, OpenApiDocument, OpenApiInfo, OpenApiMergeError, type OpenApiOperationRef, OpenApiServer, type PageSeo, type PlanDocsTreeOptions, type PlannedApiGroup, type PlannedApiPage, type PlannedMeta, ProxyTargetError, SESSION_COOKIE, type SearchDocument, type SearchIndex, type SearchResult, type SecretSignInOptions, type SessionPayload, type SignOutOptions, type SiteAuth, type SiteAuthOptions, type SitemapChangeFrequency, type SitemapEntry, ThemeConfig, type TryItEnvelope, type TryItProxyRoute, assertAllowedTarget, buildMetadata, buildRobots, buildSearchIndex, buildSessionCookie, buildSitemap, buildThemeCss, clearSessionCookie, createAskAiRoute, createAuthGate, createEmailSignIn, createGoogleAuth, createMarkdownRoute, createSecretSignIn, createSignOut, createSiteAuth, createTryItProxy, createTryItProxyRoute, isAllowedEmail, mdxToMarkdown, mergeOpenApiDocuments, openApiOperationToMarkdown, parseNavigation, planDocsTree, readCookie, searchIndex, signSession, unwrapProxyTarget, verifySession };
|
|
1297
|
+
export { AiConfig, type AiMessage, type AskAiDocumentsSource, type AskAiRoute, type AskAiRouteOptions, type AskAiSource, type AuthGateOptions, type BuildSitemapOptions, type CreateMarkdownRouteOptions, type CreateTryItProxyOptions, DocsConfig, type DocsMetadata, type DocsRobots, type DocsSitemapEntry, type DocsTreePlan, type EmailSignInOptions, type FetchLike, type GoogleAuthHandlers, type GoogleAuthOptions, type IndexedDocument, InvalidNavigationError, type MarkdownRoute, type MdxReader, type MdxToMarkdownOptions, type MergeOpenApiOptions, Navigation, OpenApiDocument, OpenApiInfo, OpenApiMergeError, type OpenApiOperationRef, OpenApiServer, type PageSeo, type PlanDocsTreeOptions, type PlannedApiDocLink, type PlannedApiGroup, type PlannedApiPage, type PlannedGroupChild, type PlannedMeta, ProxyTargetError, SESSION_COOKIE, type SearchDocument, type SearchIndex, type SearchResult, type SecretSignInOptions, type SessionPayload, type SignOutOptions, type SiteAuth, type SiteAuthOptions, type SitemapChangeFrequency, type SitemapEntry, ThemeConfig, type TryItEnvelope, type TryItProxyRoute, assertAllowedTarget, buildMetadata, buildRobots, buildSearchIndex, buildSessionCookie, buildSitemap, buildThemeCss, clearSessionCookie, createAskAiRoute, createAuthGate, createEmailSignIn, createGoogleAuth, createMarkdownRoute, createSecretSignIn, createSignOut, createSiteAuth, createTryItProxy, createTryItProxyRoute, isAllowedEmail, mdxToMarkdown, mergeOpenApiDocuments, openApiOperationToMarkdown, parseNavigation, planDocsTree, readCookie, searchIndex, signSession, unwrapProxyTarget, verifySession };
|
package/dist/index.d.ts
CHANGED
|
@@ -617,15 +617,48 @@ interface PlannedApiPage {
|
|
|
617
617
|
/** Position within the group. */
|
|
618
618
|
readonly order: number;
|
|
619
619
|
}
|
|
620
|
+
/**
|
|
621
|
+
* A child folder of a planned API group, at its position among the group's
|
|
622
|
+
* pages. The generator merges these with the resolved page slugs to write the
|
|
623
|
+
* group's `meta.json` in declared order.
|
|
624
|
+
*
|
|
625
|
+
* @public
|
|
626
|
+
*/
|
|
627
|
+
interface PlannedGroupChild {
|
|
628
|
+
readonly order: number;
|
|
629
|
+
/** The child folder's name within the group directory. */
|
|
630
|
+
readonly folder: string;
|
|
631
|
+
}
|
|
620
632
|
/**
|
|
621
633
|
* A planned API group folder. The generator fills its page order once the
|
|
622
|
-
* operation slugs are known
|
|
634
|
+
* operation slugs are known, interleaving {@link PlannedGroupChild} folders at
|
|
635
|
+
* their declared positions. A group with `root: true` is an API tab's folder.
|
|
623
636
|
*
|
|
624
637
|
* @public
|
|
625
638
|
*/
|
|
626
639
|
interface PlannedApiGroup {
|
|
627
640
|
readonly dir: string;
|
|
628
641
|
readonly title: string;
|
|
642
|
+
readonly children: readonly PlannedGroupChild[];
|
|
643
|
+
/** Set on an API tab's own folder, so the sidebar scopes to the tab. */
|
|
644
|
+
readonly root?: boolean;
|
|
645
|
+
/** The tab's icon, on a `root` group. */
|
|
646
|
+
readonly icon?: string;
|
|
647
|
+
}
|
|
648
|
+
/**
|
|
649
|
+
* A doc page declared inside an API tab, at its position among the group's
|
|
650
|
+
* operations. The generator links it into the group's `meta.json`: the page
|
|
651
|
+
* keeps living in its own folder, outside the generated tree.
|
|
652
|
+
*
|
|
653
|
+
* @public
|
|
654
|
+
*/
|
|
655
|
+
interface PlannedApiDocLink {
|
|
656
|
+
/** Page path relative to the docs output directory, without extension. */
|
|
657
|
+
readonly file: string;
|
|
658
|
+
/** The generated group folder whose meta lists the link. */
|
|
659
|
+
readonly dir: string;
|
|
660
|
+
/** Position within the group. */
|
|
661
|
+
readonly order: number;
|
|
629
662
|
}
|
|
630
663
|
/**
|
|
631
664
|
* A `meta.json` file the plan wants written.
|
|
@@ -647,8 +680,13 @@ interface DocsTreePlan {
|
|
|
647
680
|
readonly specs: readonly string[];
|
|
648
681
|
readonly apiPages: readonly PlannedApiPage[];
|
|
649
682
|
readonly apiGroups: readonly PlannedApiGroup[];
|
|
650
|
-
/** Fully-known meta files: the root, tab folders, and doc groups. */
|
|
683
|
+
/** Fully-known meta files: the root, doc tab folders, and doc groups. */
|
|
651
684
|
readonly metas: readonly PlannedMeta[];
|
|
685
|
+
/**
|
|
686
|
+
* Doc pages declared inside API tabs, each linked into its group's meta at
|
|
687
|
+
* its declared position.
|
|
688
|
+
*/
|
|
689
|
+
readonly apiDocLinks: readonly PlannedApiDocLink[];
|
|
652
690
|
}
|
|
653
691
|
/**
|
|
654
692
|
* Options for {@link planDocsTree}.
|
|
@@ -656,23 +694,27 @@ interface DocsTreePlan {
|
|
|
656
694
|
* @public
|
|
657
695
|
*/
|
|
658
696
|
interface PlanDocsTreeOptions {
|
|
659
|
-
/** Folder for generated API pages. Default `api`. */
|
|
697
|
+
/** Folder for generated API pages when one tab publishes them. Default `api`. */
|
|
660
698
|
readonly apiDir?: string;
|
|
661
699
|
}
|
|
662
700
|
/**
|
|
663
701
|
* Plan the content tree for a navigation.
|
|
664
702
|
*
|
|
665
703
|
* Conventions (Mintlify-shaped):
|
|
666
|
-
* - A tab whose items reference OpenAPI files becomes
|
|
667
|
-
*
|
|
704
|
+
* - A tab whose items reference OpenAPI files becomes an API tab. With one API
|
|
705
|
+
* tab its folder is `apiDir`; with several, each tab's folder is its
|
|
706
|
+
* slugified title, so tabs never collide. Groups become nested folders named
|
|
707
|
+
* by slugified group title, to any depth.
|
|
668
708
|
* - A tab of doc pages becomes the folder its pages share (their first path
|
|
669
|
-
* segment); a doc group's pages must share one directory.
|
|
709
|
+
* segment); a doc group's pages must share one directory. Doc groups nest.
|
|
670
710
|
* - Root-level doc pages (no `/` in the path) are listed in the root meta.
|
|
671
711
|
* - Tab folders get `root: true`, so the sidebar scopes to the active tab.
|
|
712
|
+
* - Sidebar order is declaration order, pages and groups interleaved.
|
|
672
713
|
*
|
|
673
714
|
* @param navigation - the parsed navigation
|
|
674
715
|
* @param options - the API folder name
|
|
675
716
|
* @returns the plan the generator executes
|
|
717
|
+
* @throws when two sibling groups slugify to the same folder
|
|
676
718
|
* @public
|
|
677
719
|
*/
|
|
678
720
|
declare function planDocsTree(navigation: Navigation, options?: PlanDocsTreeOptions): DocsTreePlan;
|
|
@@ -1252,4 +1294,4 @@ declare class OpenApiMergeError extends Error {
|
|
|
1252
1294
|
*/
|
|
1253
1295
|
declare function mergeOpenApiDocuments(inputs: readonly unknown[], options: MergeOpenApiOptions): OpenApiDocument;
|
|
1254
1296
|
|
|
1255
|
-
export { AiConfig, type AiMessage, type AskAiDocumentsSource, type AskAiRoute, type AskAiRouteOptions, type AskAiSource, type AuthGateOptions, type BuildSitemapOptions, type CreateMarkdownRouteOptions, type CreateTryItProxyOptions, DocsConfig, type DocsMetadata, type DocsRobots, type DocsSitemapEntry, type DocsTreePlan, type EmailSignInOptions, type FetchLike, type GoogleAuthHandlers, type GoogleAuthOptions, type IndexedDocument, InvalidNavigationError, type MarkdownRoute, type MdxReader, type MdxToMarkdownOptions, type MergeOpenApiOptions, Navigation, OpenApiDocument, OpenApiInfo, OpenApiMergeError, type OpenApiOperationRef, OpenApiServer, type PageSeo, type PlanDocsTreeOptions, type PlannedApiGroup, type PlannedApiPage, type PlannedMeta, ProxyTargetError, SESSION_COOKIE, type SearchDocument, type SearchIndex, type SearchResult, type SecretSignInOptions, type SessionPayload, type SignOutOptions, type SiteAuth, type SiteAuthOptions, type SitemapChangeFrequency, type SitemapEntry, ThemeConfig, type TryItEnvelope, type TryItProxyRoute, assertAllowedTarget, buildMetadata, buildRobots, buildSearchIndex, buildSessionCookie, buildSitemap, buildThemeCss, clearSessionCookie, createAskAiRoute, createAuthGate, createEmailSignIn, createGoogleAuth, createMarkdownRoute, createSecretSignIn, createSignOut, createSiteAuth, createTryItProxy, createTryItProxyRoute, isAllowedEmail, mdxToMarkdown, mergeOpenApiDocuments, openApiOperationToMarkdown, parseNavigation, planDocsTree, readCookie, searchIndex, signSession, unwrapProxyTarget, verifySession };
|
|
1297
|
+
export { AiConfig, type AiMessage, type AskAiDocumentsSource, type AskAiRoute, type AskAiRouteOptions, type AskAiSource, type AuthGateOptions, type BuildSitemapOptions, type CreateMarkdownRouteOptions, type CreateTryItProxyOptions, DocsConfig, type DocsMetadata, type DocsRobots, type DocsSitemapEntry, type DocsTreePlan, type EmailSignInOptions, type FetchLike, type GoogleAuthHandlers, type GoogleAuthOptions, type IndexedDocument, InvalidNavigationError, type MarkdownRoute, type MdxReader, type MdxToMarkdownOptions, type MergeOpenApiOptions, Navigation, OpenApiDocument, OpenApiInfo, OpenApiMergeError, type OpenApiOperationRef, OpenApiServer, type PageSeo, type PlanDocsTreeOptions, type PlannedApiDocLink, type PlannedApiGroup, type PlannedApiPage, type PlannedGroupChild, type PlannedMeta, ProxyTargetError, SESSION_COOKIE, type SearchDocument, type SearchIndex, type SearchResult, type SecretSignInOptions, type SessionPayload, type SignOutOptions, type SiteAuth, type SiteAuthOptions, type SitemapChangeFrequency, type SitemapEntry, ThemeConfig, type TryItEnvelope, type TryItProxyRoute, assertAllowedTarget, buildMetadata, buildRobots, buildSearchIndex, buildSessionCookie, buildSitemap, buildThemeCss, clearSessionCookie, createAskAiRoute, createAuthGate, createEmailSignIn, createGoogleAuth, createMarkdownRoute, createSecretSignIn, createSignOut, createSiteAuth, createTryItProxy, createTryItProxyRoute, isAllowedEmail, mdxToMarkdown, mergeOpenApiDocuments, openApiOperationToMarkdown, parseNavigation, planDocsTree, readCookie, searchIndex, signSession, unwrapProxyTarget, verifySession };
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { AI_PROVIDER_MODELS, AI_PROVIDER_NAMES, AiConfigError, DocsConfigError, InvalidNavigationError, OpenApiMergeError, ProxyTargetError, SESSION_COOKIE, assertAllowedTarget, buildMetadata, buildRobots, buildSearchIndex, buildSessionCookie, buildSitemap, buildThemeCss, clearSessionCookie, createAskAiRoute, createAuthGate, createEmailSignIn, createGoogleAuth, createMarkdownRoute, createSecretSignIn, createSignOut, createSiteAuth, createTryItProxy, createTryItProxyRoute, defineDocsConfig, isAllowedEmail, mdxToMarkdown, mergeOpenApiDocuments, openApiOperationToMarkdown, parseNavigation, planDocsTree, readCookie, resolveAiConfig, searchIndex, signSession, unwrapProxyTarget, validateDocsConfig, verifySession } from './chunk-
|
|
1
|
+
export { AI_PROVIDER_MODELS, AI_PROVIDER_NAMES, AiConfigError, DocsConfigError, InvalidNavigationError, OpenApiMergeError, ProxyTargetError, SESSION_COOKIE, assertAllowedTarget, buildMetadata, buildRobots, buildSearchIndex, buildSessionCookie, buildSitemap, buildThemeCss, clearSessionCookie, createAskAiRoute, createAuthGate, createEmailSignIn, createGoogleAuth, createMarkdownRoute, createSecretSignIn, createSignOut, createSiteAuth, createTryItProxy, createTryItProxyRoute, defineDocsConfig, isAllowedEmail, mdxToMarkdown, mergeOpenApiDocuments, openApiOperationToMarkdown, parseNavigation, planDocsTree, readCookie, resolveAiConfig, searchIndex, signSession, unwrapProxyTarget, validateDocsConfig, verifySession } from './chunk-ZWDLAW5M.js';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blaaiz/docs-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Neutral, self-hostable documentation framework core — navigation parsing, OpenAPI merging, MDX doc components, and a hardened try-it proxy. Config and content live in each consuming site.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"documentation",
|
package/skills/SKILL.md
CHANGED
|
@@ -264,6 +264,11 @@ them is a one-file change:
|
|
|
264
264
|
carrying the `home-*` classes from `@blaaiz/docs-core/styles/home.css`.
|
|
265
265
|
Clicking a link enters the sidebar shell under `/docs`. Sites scaffolded by
|
|
266
266
|
`create-docs-core` ship this shape.
|
|
267
|
+
|
|
268
|
+
In an `.mdx` file, never wrap loose text in a literal `<p>`: MDX wraps
|
|
269
|
+
multi-line text in its own paragraph element, which nests `<p>` inside
|
|
270
|
+
`<p>` and breaks hydration. Use a `<div>` with the same class.
|
|
271
|
+
|
|
267
272
|
- **No landing**: the file is a three-line `redirect('/docs')` and readers
|
|
268
273
|
land directly in the docs.
|
|
269
274
|
|