doccupine 0.0.144 → 0.0.145
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/generator/api-reference-generator.d.ts +4 -2
- package/dist/generator/api-reference-generator.js +32 -31
- package/dist/generator/app-scaffolder.d.ts +1 -2
- package/dist/generator/app-scaffolder.js +1 -6
- package/dist/generator/generated-route-manager.d.ts +4 -3
- package/dist/generator/generated-route-manager.js +34 -11
- package/dist/generator/page-catalog.d.ts +4 -0
- package/dist/generator/page-catalog.js +8 -1
- package/dist/generator/project-config-repository.d.ts +8 -0
- package/dist/generator/project-config-repository.js +73 -15
- package/dist/generator/secure-source-fs.d.ts +5 -1
- package/dist/generator/secure-source-fs.js +112 -3
- package/dist/generator/site-artifacts.d.ts +3 -2
- package/dist/generator/site-artifacts.js +6 -9
- package/dist/generator/watch-coordinator.d.ts +3 -2
- package/dist/generator/watch-coordinator.js +29 -11
- package/dist/lib/config-manager.d.ts +1 -0
- package/dist/lib/config-manager.js +194 -12
- package/dist/lib/generated-artifacts.d.ts +8 -2
- package/dist/lib/generated-artifacts.js +25 -6
- package/dist/lib/openapi.d.ts +4 -0
- package/dist/lib/openapi.js +36 -4
- package/dist/mdx-to-nextjs-generator.d.ts +43 -9
- package/dist/mdx-to-nextjs-generator.js +679 -211
- package/dist/templates/mdx/api-playground.mdx.d.ts +1 -1
- package/dist/templates/mdx/api-playground.mdx.js +11 -2
- package/dist/templates/mdx/commands.mdx.d.ts +1 -1
- package/dist/templates/mdx/commands.mdx.js +26 -1
- package/dist/templates/mdx/media-and-assets.mdx.d.ts +1 -1
- package/dist/templates/mdx/media-and-assets.mdx.js +5 -0
- package/dist/templates/mdx/model-context-protocol.mdx.d.ts +1 -1
- package/dist/templates/mdx/model-context-protocol.mdx.js +2 -1
- package/dist/templates/mdx/platform/api-playground.mdx.d.ts +1 -1
- package/dist/templates/mdx/platform/api-playground.mdx.js +2 -2
- package/dist/templates/mdx/platform/publishing.mdx.d.ts +1 -1
- package/dist/templates/mdx/platform/publishing.mdx.js +3 -3
- package/dist/templates/mdx/what-is-doccupine.mdx.d.ts +1 -1
- package/dist/templates/mdx/what-is-doccupine.mdx.js +8 -3
- package/dist/templates/package.js +1 -1
- package/package.json +2 -2
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { MDXFile, PageMeta, SectionConfig, FontConfig, AnalyticsConfig, NormalizedOpenApiSpec } from "./lib/types.js";
|
|
2
2
|
import type { OperationDescriptor } from "./lib/openapi-types.js";
|
|
3
|
+
interface GeneratedPageCommit {
|
|
4
|
+
rollback(): Promise<void>;
|
|
5
|
+
}
|
|
3
6
|
export declare class MDXToNextJSGenerator {
|
|
4
7
|
private watchDir;
|
|
5
8
|
private outputDir;
|
|
@@ -24,10 +27,17 @@ export declare class MDXToNextJSGenerator {
|
|
|
24
27
|
private projectConfigRepository;
|
|
25
28
|
private publicAssetManager;
|
|
26
29
|
private watchCoordinator;
|
|
30
|
+
private retainExistingMdxOutput;
|
|
31
|
+
private mdxSnapshotInitialized;
|
|
32
|
+
private successfulMdxPages;
|
|
33
|
+
private successfulMdxContent;
|
|
34
|
+
private successfulMdxSourcesBySlug;
|
|
35
|
+
private collisionBlockedMdxSources;
|
|
27
36
|
constructor(watchDir: string, outputDir: string, openApiSpecs?: NormalizedOpenApiSpec[], rootDir?: string);
|
|
28
37
|
private outputPath;
|
|
29
38
|
private readMdxSourceFile;
|
|
30
|
-
private
|
|
39
|
+
private writeStarterFilesIfEmpty;
|
|
40
|
+
private refreshInitialDoccupineConfig;
|
|
31
41
|
init(): Promise<void>;
|
|
32
42
|
createNextJSStructure(): Promise<void>;
|
|
33
43
|
createStartingDocs(): Promise<void>;
|
|
@@ -48,6 +58,7 @@ export declare class MDXToNextJSGenerator {
|
|
|
48
58
|
private withApiReferenceSection;
|
|
49
59
|
private reloadSections;
|
|
50
60
|
private maybeUpdateSections;
|
|
61
|
+
private reconcileMdxSources;
|
|
51
62
|
private determineSectionForFile;
|
|
52
63
|
handleConfigFileChange(filePath: string): Promise<void>;
|
|
53
64
|
handleConfigFileDelete(filePath: string): Promise<void>;
|
|
@@ -60,8 +71,23 @@ export declare class MDXToNextJSGenerator {
|
|
|
60
71
|
handlePublicFileDelete(filePath: string): Promise<void>;
|
|
61
72
|
startWatching(): Promise<void>;
|
|
62
73
|
private parseMDXFile;
|
|
74
|
+
private captureMdxPass;
|
|
63
75
|
private buildRealPagesMeta;
|
|
64
76
|
private buildAllPagesMeta;
|
|
77
|
+
private mergeAllPagesMeta;
|
|
78
|
+
private successfulPagesInSourceOrder;
|
|
79
|
+
private recordSuccessfulMdxPage;
|
|
80
|
+
private removeSuccessfulMdxPage;
|
|
81
|
+
private captureSuccessfulMdxState;
|
|
82
|
+
private restoreSuccessfulMdxState;
|
|
83
|
+
private rollbackPageCommits;
|
|
84
|
+
private rollbackFailedMdxCommit;
|
|
85
|
+
private rollbackCommittedMdxChange;
|
|
86
|
+
private dropMissingMdxSnapshots;
|
|
87
|
+
private commitMdxSnapshot;
|
|
88
|
+
private refreshMdxDerivedOutput;
|
|
89
|
+
private readAggregateMdxSource;
|
|
90
|
+
private homepageSource;
|
|
65
91
|
private removeOwnedRoute;
|
|
66
92
|
private removeStaleMdxRoutes;
|
|
67
93
|
/**
|
|
@@ -72,6 +98,7 @@ export declare class MDXToNextJSGenerator {
|
|
|
72
98
|
* end instead of once per file (which is what made large builds O(n²)).
|
|
73
99
|
*/
|
|
74
100
|
private writePageForFile;
|
|
101
|
+
private retryMdxPages;
|
|
75
102
|
/**
|
|
76
103
|
* Regenerates every file that depends on the full set of pages (pages index,
|
|
77
104
|
* root/site layout, sitemap, llms files, section redirects). Parses all MDX
|
|
@@ -85,21 +112,24 @@ export declare class MDXToNextJSGenerator {
|
|
|
85
112
|
getAllMDXFiles(): Promise<string[]>;
|
|
86
113
|
generateRootLayout(): Promise<string>;
|
|
87
114
|
generateSiteLayout(pages?: PageMeta[]): Promise<string>;
|
|
88
|
-
generateSectionIndexPages(pages?: PageMeta[]): Promise<void>;
|
|
115
|
+
generateSectionIndexPages(pages?: PageMeta[], declaredSlugs?: Set<string>): Promise<void>;
|
|
89
116
|
/**
|
|
90
117
|
* Removes section index redirects written earlier in this session whose
|
|
91
118
|
* section has since disappeared (e.g. the API Reference section after the
|
|
92
|
-
* `openapi` config is removed mid-watch).
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
* init() wipes app/ - so in-session tracking is enough.
|
|
119
|
+
* `openapi` config is removed mid-watch). Slugs now occupied by real pages
|
|
120
|
+
* are preserved. Fresh processes start clean anyway - init() wipes app/ -
|
|
121
|
+
* so in-session tracking is enough.
|
|
96
122
|
*/
|
|
97
123
|
private cleanupStaleSectionIndexPages;
|
|
98
124
|
/** Best-effort removal of now-empty directories up to (not incl.) stopDir. */
|
|
99
125
|
private removeEmptyDirsUpTo;
|
|
126
|
+
private generatedFileSegments;
|
|
127
|
+
private readGeneratedFile;
|
|
128
|
+
private restoreGeneratedFile;
|
|
129
|
+
private commitRenderedPage;
|
|
100
130
|
generatePageFromMDX(mdxFile: MDXFile, options?: {
|
|
101
131
|
apiOperation?: OperationDescriptor;
|
|
102
|
-
}): Promise<
|
|
132
|
+
}): Promise<GeneratedPageCommit>;
|
|
103
133
|
/** Parses the configured OpenAPI spec(s) into the shared registry. */
|
|
104
134
|
private loadOpenApiRegistry;
|
|
105
135
|
/**
|
|
@@ -120,12 +150,15 @@ export declare class MDXToNextJSGenerator {
|
|
|
120
150
|
* so specs added mid-session are watched without a restart.
|
|
121
151
|
*/
|
|
122
152
|
private syncOpenApiSpecWatcher;
|
|
153
|
+
private openApiSourceState;
|
|
154
|
+
private loadStableOpenApiRegistry;
|
|
155
|
+
private applyStableOpenApiRefresh;
|
|
123
156
|
/**
|
|
124
157
|
* Reparses the spec(s) and rewrites everything derived from them: the
|
|
125
158
|
* endpoint pages and allowlist, the sections (the "API Reference" section
|
|
126
159
|
* appears and disappears with the registry), and the site aggregates.
|
|
127
160
|
*/
|
|
128
|
-
private
|
|
161
|
+
private applyOpenApiRefresh;
|
|
129
162
|
/** Reparses the spec(s) and regenerates the API reference on a watch event. */
|
|
130
163
|
handleOpenApiChange(): Promise<void>;
|
|
131
164
|
/**
|
|
@@ -138,7 +171,7 @@ export declare class MDXToNextJSGenerator {
|
|
|
138
171
|
*/
|
|
139
172
|
handleDoccupineConfigChange(): Promise<void>;
|
|
140
173
|
updatePagesIndex(): Promise<void>;
|
|
141
|
-
updateSectionIndex(sectionSlug: string, frontmatter: Record<string, any>, mdxContent: string, sourcePath?: string): Promise<
|
|
174
|
+
updateSectionIndex(sectionSlug: string, frontmatter: Record<string, any>, mdxContent: string, sourcePath?: string): Promise<GeneratedPageCommit>;
|
|
142
175
|
updateRootLayout(pages?: PageMeta[]): Promise<void>;
|
|
143
176
|
loadSiteUrl(): Promise<string | null>;
|
|
144
177
|
updateSitemap(pages?: PageMeta[]): Promise<void>;
|
|
@@ -146,3 +179,4 @@ export declare class MDXToNextJSGenerator {
|
|
|
146
179
|
updateLlmsFiles(pages?: PageMeta[]): Promise<void>;
|
|
147
180
|
stop(): Promise<void>;
|
|
148
181
|
}
|
|
182
|
+
export {};
|