@commercetools/nimbus-docs-build 0.0.0-canary-20251107124701
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/README.md +129 -0
- package/dist/assets/index.d.ts +5 -0
- package/dist/assets/index.d.ts.map +1 -0
- package/dist/assets/index.js +5 -0
- package/dist/assets/index.js.map +1 -0
- package/dist/assets/optimize-assets.d.ts +5 -0
- package/dist/assets/optimize-assets.d.ts.map +1 -0
- package/dist/assets/optimize-assets.js +36 -0
- package/dist/assets/optimize-assets.js.map +1 -0
- package/dist/builders/build.d.ts +6 -0
- package/dist/builders/build.d.ts.map +1 -0
- package/dist/builders/build.js +65 -0
- package/dist/builders/build.js.map +1 -0
- package/dist/builders/index.d.ts +8 -0
- package/dist/builders/index.d.ts.map +1 -0
- package/dist/builders/index.js +8 -0
- package/dist/builders/index.js.map +1 -0
- package/dist/builders/manifest-builder.d.ts +6 -0
- package/dist/builders/manifest-builder.d.ts.map +1 -0
- package/dist/builders/manifest-builder.js +19 -0
- package/dist/builders/manifest-builder.js.map +1 -0
- package/dist/builders/mdx-builder.d.ts +6 -0
- package/dist/builders/mdx-builder.d.ts.map +1 -0
- package/dist/builders/mdx-builder.js +40 -0
- package/dist/builders/mdx-builder.js.map +1 -0
- package/dist/builders/seo-builder.d.ts +6 -0
- package/dist/builders/seo-builder.d.ts.map +1 -0
- package/dist/builders/seo-builder.js +19 -0
- package/dist/builders/seo-builder.js.map +1 -0
- package/dist/builders/types-builder.d.ts +6 -0
- package/dist/builders/types-builder.d.ts.map +1 -0
- package/dist/builders/types-builder.js +18 -0
- package/dist/builders/types-builder.js.map +1 -0
- package/dist/cache/build-cache.d.ts +41 -0
- package/dist/cache/build-cache.d.ts.map +1 -0
- package/dist/cache/build-cache.js +147 -0
- package/dist/cache/build-cache.js.map +1 -0
- package/dist/cache/index.d.ts +5 -0
- package/dist/cache/index.d.ts.map +1 -0
- package/dist/cache/index.js +5 -0
- package/dist/cache/index.js.map +1 -0
- package/dist/generators/index.d.ts +8 -0
- package/dist/generators/index.d.ts.map +1 -0
- package/dist/generators/index.js +8 -0
- package/dist/generators/index.js.map +1 -0
- package/dist/generators/robots.d.ts +5 -0
- package/dist/generators/robots.d.ts.map +1 -0
- package/dist/generators/robots.js +34 -0
- package/dist/generators/robots.js.map +1 -0
- package/dist/generators/routes.d.ts +6 -0
- package/dist/generators/routes.d.ts.map +1 -0
- package/dist/generators/routes.js +77 -0
- package/dist/generators/routes.js.map +1 -0
- package/dist/generators/search.d.ts +6 -0
- package/dist/generators/search.d.ts.map +1 -0
- package/dist/generators/search.js +44 -0
- package/dist/generators/search.js.map +1 -0
- package/dist/generators/sitemap.d.ts +6 -0
- package/dist/generators/sitemap.d.ts.map +1 -0
- package/dist/generators/sitemap.js +33 -0
- package/dist/generators/sitemap.js.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/dist/parsers/filter-props.d.ts +15 -0
- package/dist/parsers/filter-props.d.ts.map +1 -0
- package/dist/parsers/filter-props.js +50 -0
- package/dist/parsers/filter-props.js.map +1 -0
- package/dist/parsers/index.d.ts +8 -0
- package/dist/parsers/index.d.ts.map +1 -0
- package/dist/parsers/index.js +8 -0
- package/dist/parsers/index.js.map +1 -0
- package/dist/parsers/parse-mdx.d.ts +20 -0
- package/dist/parsers/parse-mdx.d.ts.map +1 -0
- package/dist/parsers/parse-mdx.js +172 -0
- package/dist/parsers/parse-mdx.js.map +1 -0
- package/dist/parsers/parse-types.d.ts +24 -0
- package/dist/parsers/parse-types.d.ts.map +1 -0
- package/dist/parsers/parse-types.js +83 -0
- package/dist/parsers/parse-types.js.map +1 -0
- package/dist/parsers/process-types.d.ts +19 -0
- package/dist/parsers/process-types.d.ts.map +1 -0
- package/dist/parsers/process-types.js +44 -0
- package/dist/parsers/process-types.js.map +1 -0
- package/dist/schemas/index.d.ts +6 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +6 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/lifecycle-states.d.ts +16 -0
- package/dist/schemas/lifecycle-states.d.ts.map +1 -0
- package/dist/schemas/lifecycle-states.js +50 -0
- package/dist/schemas/lifecycle-states.js.map +1 -0
- package/dist/schemas/mdx-document.d.ts +233 -0
- package/dist/schemas/mdx-document.d.ts.map +1 -0
- package/dist/schemas/mdx-document.js +118 -0
- package/dist/schemas/mdx-document.js.map +1 -0
- package/dist/types/config.d.ts +106 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/config.js +2 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +6 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/mdx.d.ts +16 -0
- package/dist/types/mdx.d.ts.map +1 -0
- package/dist/types/mdx.js +2 -0
- package/dist/types/mdx.js.map +1 -0
- package/dist/utils/file-utils.d.ts +28 -0
- package/dist/utils/file-utils.d.ts.map +1 -0
- package/dist/utils/file-utils.js +111 -0
- package/dist/utils/file-utils.js.map +1 -0
- package/dist/utils/index.d.ts +8 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +8 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/logger.d.ts +8 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +16 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/sluggify.d.ts +17 -0
- package/dist/utils/sluggify.d.ts.map +1 -0
- package/dist/utils/sluggify.js +26 -0
- package/dist/utils/sluggify.js.map +1 -0
- package/dist/utils/validate-file-path.d.ts +23 -0
- package/dist/utils/validate-file-path.d.ts.map +1 -0
- package/dist/utils/validate-file-path.js +39 -0
- package/dist/utils/validate-file-path.js.map +1 -0
- package/dist/validation/index.d.ts +5 -0
- package/dist/validation/index.d.ts.map +1 -0
- package/dist/validation/index.js +5 -0
- package/dist/validation/index.js.map +1 -0
- package/dist/validation/validate-content.d.ts +12 -0
- package/dist/validation/validate-content.d.ts.map +1 -0
- package/dist/validation/validate-content.js +95 -0
- package/dist/validation/validate-content.js.map +1 -0
- package/package.json +49 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MDX Parser for Documentation Build System
|
|
3
|
+
*
|
|
4
|
+
* Parses MDX files with frontmatter, generates table of contents,
|
|
5
|
+
* and supports multi-view documentation (e.g., *.dev.mdx, *.api.mdx)
|
|
6
|
+
*/
|
|
7
|
+
import type { MdxDocument } from "../types/mdx.js";
|
|
8
|
+
/**
|
|
9
|
+
* Parse a single MDX file and return structured document data
|
|
10
|
+
* Supports multi-view documentation (e.g., button.dev.mdx, button.api.mdx)
|
|
11
|
+
*
|
|
12
|
+
* @param filePath - Absolute path to MDX file (should be from trusted source like file discovery)
|
|
13
|
+
* @note This function reads from discovered MDX files within the packages directory
|
|
14
|
+
*/
|
|
15
|
+
export declare function parseMdxFile(filePath: string): Promise<MdxDocument | null>;
|
|
16
|
+
/**
|
|
17
|
+
* Parse all MDX files and return a map of documents
|
|
18
|
+
*/
|
|
19
|
+
export declare function parseAllMdx(mdxFiles: string[]): Promise<Map<string, MdxDocument>>;
|
|
20
|
+
//# sourceMappingURL=parse-mdx.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-mdx.d.ts","sourceRoot":"","sources":["../../src/parsers/parse-mdx.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAUH,OAAO,KAAK,EAAE,WAAW,EAAW,MAAM,iBAAiB,CAAC;AA8E5D;;;;;;GAMG;AACH,wBAAsB,YAAY,CAChC,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CA8F7B;AAED;;GAEG;AACH,wBAAsB,WAAW,CAC/B,QAAQ,EAAE,MAAM,EAAE,GACjB,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAkBnC"}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MDX Parser for Documentation Build System
|
|
3
|
+
*
|
|
4
|
+
* Parses MDX files with frontmatter, generates table of contents,
|
|
5
|
+
* and supports multi-view documentation (e.g., *.dev.mdx, *.api.mdx)
|
|
6
|
+
*/
|
|
7
|
+
import fs from "fs/promises";
|
|
8
|
+
import path from "path";
|
|
9
|
+
import matter from "gray-matter";
|
|
10
|
+
import { remark } from "remark";
|
|
11
|
+
import remarkFlexibleToc from "remark-flexible-toc";
|
|
12
|
+
import { mdxDocumentSchema } from "../schemas/mdx-document.js";
|
|
13
|
+
import { menuToPath, getPathFromMonorepoRoot } from "../utils/index.js";
|
|
14
|
+
import { validateFilePath } from "../utils/validate-file-path.js";
|
|
15
|
+
/**
|
|
16
|
+
* Generate table of contents from MDX content (without frontmatter)
|
|
17
|
+
* @param content - The MDX content string with frontmatter already removed
|
|
18
|
+
*/
|
|
19
|
+
const generateToc = async (content) => {
|
|
20
|
+
const toc = [];
|
|
21
|
+
await remark().use(remarkFlexibleToc, { tocRef: toc }).process(content);
|
|
22
|
+
return toc || [];
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Get all view MDX files for the given base .mdx file
|
|
26
|
+
* Returns array of objects with key and filePath
|
|
27
|
+
* e.g., button.dev.mdx -> { key: "dev", filePath: "..." }
|
|
28
|
+
*/
|
|
29
|
+
const getViewMdxFiles = async (baseMdxPath) => {
|
|
30
|
+
const dir = path.dirname(baseMdxPath);
|
|
31
|
+
const basename = path.basename(baseMdxPath, ".mdx");
|
|
32
|
+
try {
|
|
33
|
+
const files = await fs.readdir(dir);
|
|
34
|
+
const viewFiles = files
|
|
35
|
+
.filter((file) => {
|
|
36
|
+
// Match pattern: component-name.{key}.mdx
|
|
37
|
+
const regex = new RegExp(`^${basename}\\.([^.]+)\\.mdx$`);
|
|
38
|
+
return regex.test(file);
|
|
39
|
+
})
|
|
40
|
+
.map((file) => {
|
|
41
|
+
// Extract key from filename
|
|
42
|
+
const regex = new RegExp(`^${basename}\\.([^.]+)\\.mdx$`);
|
|
43
|
+
const match = file.match(regex);
|
|
44
|
+
const key = match ? match[1] : "";
|
|
45
|
+
return {
|
|
46
|
+
key,
|
|
47
|
+
filePath: validateFilePath(dir, file),
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
return viewFiles;
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
return [];
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Parse a single MDX file and return its content, frontmatter, and TOC
|
|
58
|
+
*
|
|
59
|
+
* @param filePath - Absolute path to MDX file (should be pre-validated by caller)
|
|
60
|
+
* @note Callers must ensure filePath is validated to prevent path traversal
|
|
61
|
+
*/
|
|
62
|
+
const parseSingleMdx = async (filePath) => {
|
|
63
|
+
try {
|
|
64
|
+
const content = await fs.readFile(filePath, "utf8");
|
|
65
|
+
const { data: frontmatter, content: mdx } = matter(content);
|
|
66
|
+
const toc = await generateToc(mdx);
|
|
67
|
+
return { mdx, toc, frontmatter };
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Parse a single MDX file and return structured document data
|
|
75
|
+
* Supports multi-view documentation (e.g., button.dev.mdx, button.api.mdx)
|
|
76
|
+
*
|
|
77
|
+
* @param filePath - Absolute path to MDX file (should be from trusted source like file discovery)
|
|
78
|
+
* @note This function reads from discovered MDX files within the packages directory
|
|
79
|
+
*/
|
|
80
|
+
export async function parseMdxFile(filePath) {
|
|
81
|
+
try {
|
|
82
|
+
// Skip node_modules
|
|
83
|
+
if (filePath.includes("node_modules")) {
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
// Skip view files (*.{key}.mdx) as they will be processed with their main .mdx file
|
|
87
|
+
const basename = path.basename(filePath);
|
|
88
|
+
const nameWithoutMdx = basename.replace(/\.mdx$/, "");
|
|
89
|
+
if (nameWithoutMdx.includes(".")) {
|
|
90
|
+
// This is a view file, skip it
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
// Read main file content
|
|
94
|
+
const content = await fs.readFile(filePath, "utf8");
|
|
95
|
+
const { data: meta, content: mdx } = matter(content);
|
|
96
|
+
// Generate TOC for main file
|
|
97
|
+
const toc = await generateToc(mdx);
|
|
98
|
+
// Get relative path from monorepo root
|
|
99
|
+
const repoPath = await getPathFromMonorepoRoot(filePath);
|
|
100
|
+
// Get tab metadata from main file frontmatter (with defaults)
|
|
101
|
+
const mainTabTitle = meta["tab-title"] ||
|
|
102
|
+
meta["tabTitle"] ||
|
|
103
|
+
"Overview";
|
|
104
|
+
const mainTabOrder = meta["tab-order"] || meta["tabOrder"] || 0;
|
|
105
|
+
// Discover all view files (e.g., button.dev.mdx, button.api.mdx)
|
|
106
|
+
const viewFiles = await getViewMdxFiles(filePath);
|
|
107
|
+
// Build tabs array and views object
|
|
108
|
+
const tabs = [
|
|
109
|
+
{ key: "overview", title: mainTabTitle, order: mainTabOrder },
|
|
110
|
+
];
|
|
111
|
+
const views = {
|
|
112
|
+
overview: { mdx, toc },
|
|
113
|
+
};
|
|
114
|
+
// Parse each view file
|
|
115
|
+
for (const { key, filePath: viewFilePath } of viewFiles) {
|
|
116
|
+
const viewData = await parseSingleMdx(viewFilePath);
|
|
117
|
+
if (viewData) {
|
|
118
|
+
const { mdx: viewMdx, toc: viewToc, frontmatter: viewMeta } = viewData;
|
|
119
|
+
// Get tab metadata from view file frontmatter (with defaults)
|
|
120
|
+
const tabTitle = viewMeta["tab-title"] ||
|
|
121
|
+
viewMeta["tabTitle"] ||
|
|
122
|
+
key;
|
|
123
|
+
const tabOrder = viewMeta["tab-order"] ||
|
|
124
|
+
viewMeta["tabOrder"] ||
|
|
125
|
+
999;
|
|
126
|
+
tabs.push({ key, title: tabTitle, order: tabOrder });
|
|
127
|
+
views[key] = { mdx: viewMdx, toc: viewToc };
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
// Sort tabs by order (ascending)
|
|
131
|
+
tabs.sort((a, b) => a.order - b.order);
|
|
132
|
+
// Build document structure
|
|
133
|
+
const document = {
|
|
134
|
+
meta: {
|
|
135
|
+
...meta,
|
|
136
|
+
repoPath,
|
|
137
|
+
order: meta.order || 999,
|
|
138
|
+
route: menuToPath(meta.menu || []),
|
|
139
|
+
toc,
|
|
140
|
+
tabs,
|
|
141
|
+
},
|
|
142
|
+
mdx,
|
|
143
|
+
views,
|
|
144
|
+
};
|
|
145
|
+
// Validate with Zod
|
|
146
|
+
const validatedDoc = mdxDocumentSchema.parse(document);
|
|
147
|
+
return validatedDoc;
|
|
148
|
+
}
|
|
149
|
+
catch (error) {
|
|
150
|
+
console.error(`Error parsing MDX file ${filePath}:`, error);
|
|
151
|
+
return null;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Parse all MDX files and return a map of documents
|
|
156
|
+
*/
|
|
157
|
+
export async function parseAllMdx(mdxFiles) {
|
|
158
|
+
const docs = new Map();
|
|
159
|
+
// Parse all files in parallel
|
|
160
|
+
const results = await Promise.all(mdxFiles.map(async (filePath) => {
|
|
161
|
+
const doc = await parseMdxFile(filePath);
|
|
162
|
+
return { filePath, doc };
|
|
163
|
+
}));
|
|
164
|
+
// Collect results
|
|
165
|
+
for (const { doc } of results) {
|
|
166
|
+
if (!doc)
|
|
167
|
+
continue;
|
|
168
|
+
docs.set(doc.meta.repoPath, doc);
|
|
169
|
+
}
|
|
170
|
+
return docs;
|
|
171
|
+
}
|
|
172
|
+
//# sourceMappingURL=parse-mdx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-mdx.js","sourceRoot":"","sources":["../../src/parsers/parse-mdx.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7B,OAAO,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AAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,QAAkB;IAElB,MAAM,IAAI,GAAG,IAAI,GAAG,EAAuB,CAAC;IAE5C,8BAA8B;IAC9B,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,CAC/B,QAAQ,CAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE;QAC9B,MAAM,GAAG,GAAG,MAAM,YAAY,CAAC,QAAQ,CAAC,CAAC;QACzC,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC;IAC3B,CAAC,CAAC,CACH,CAAC;IAEF,kBAAkB;IAClB,KAAK,MAAM,EAAE,GAAG,EAAE,IAAI,OAAO,EAAE,CAAC;QAC9B,IAAI,CAAC,GAAG;YAAE,SAAS;QACnB,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IACnC,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ComponentDoc } from "react-docgen-typescript";
|
|
2
|
+
import type { DocsBuilderConfig } from "../types/config.js";
|
|
3
|
+
/**
|
|
4
|
+
* Parse TypeScript files and extract component props
|
|
5
|
+
* @param config - Configuration with componentIndexPath and optional propFilter
|
|
6
|
+
* @returns Array of processed component docs
|
|
7
|
+
*/
|
|
8
|
+
export declare function parseTypes(config: Pick<DocsBuilderConfig, "sources" | "propFilter">): Promise<ComponentDoc[]>;
|
|
9
|
+
/**
|
|
10
|
+
* Parse types and write to a single output file
|
|
11
|
+
* @param componentIndexPath - Path to component index file
|
|
12
|
+
* @param outputPath - Path to write types JSON
|
|
13
|
+
* @param propFilter - Optional custom prop filter
|
|
14
|
+
*/
|
|
15
|
+
export declare function parseTypesToFile(componentIndexPath: string, outputPath: string, propFilter?: DocsBuilderConfig["propFilter"]): Promise<void>;
|
|
16
|
+
/**
|
|
17
|
+
* Parse types and write individual component type files
|
|
18
|
+
* @param componentIndexPath - Path to component index file
|
|
19
|
+
* @param outputDir - Directory to write individual type files
|
|
20
|
+
* @param propFilter - Optional custom prop filter
|
|
21
|
+
* @returns Manifest mapping component names to filenames
|
|
22
|
+
*/
|
|
23
|
+
export declare function parseTypesToFiles(componentIndexPath: string, outputDir: string, propFilter?: DocsBuilderConfig["propFilter"]): Promise<Record<string, string>>;
|
|
24
|
+
//# sourceMappingURL=parse-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-types.d.ts","sourceRoot":"","sources":["../../src/parsers/parse-types.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5D;;;;GAIG;AACH,wBAAsB,UAAU,CAC9B,MAAM,EAAE,IAAI,CAAC,iBAAiB,EAAE,SAAS,GAAG,YAAY,CAAC,GACxD,OAAO,CAAC,YAAY,EAAE,CAAC,CAyBzB;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CACpC,kBAAkB,EAAE,MAAM,EAC1B,UAAU,EAAE,MAAM,EAClB,UAAU,CAAC,EAAE,iBAAiB,CAAC,YAAY,CAAC,GAC3C,OAAO,CAAC,IAAI,CAAC,CAOf;AAED;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACrC,kBAAkB,EAAE,MAAM,EAC1B,SAAS,EAAE,MAAM,EACjB,UAAU,CAAC,EAAE,iBAAiB,CAAC,YAAY,CAAC,GAC3C,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CA+BjC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TypeScript Props Parser
|
|
3
|
+
*
|
|
4
|
+
* Extracts component prop types using react-docgen-typescript
|
|
5
|
+
* with access to proper tsconfig paths
|
|
6
|
+
*/
|
|
7
|
+
import fs from "fs/promises";
|
|
8
|
+
import docgen from "react-docgen-typescript";
|
|
9
|
+
import { processComponentTypes } from "./process-types.js";
|
|
10
|
+
/**
|
|
11
|
+
* Parse TypeScript files and extract component props
|
|
12
|
+
* @param config - Configuration with componentIndexPath and optional propFilter
|
|
13
|
+
* @returns Array of processed component docs
|
|
14
|
+
*/
|
|
15
|
+
export async function parseTypes(config) {
|
|
16
|
+
try {
|
|
17
|
+
const indexPath = config.sources.componentIndexPath;
|
|
18
|
+
if (!indexPath) {
|
|
19
|
+
throw new Error("componentIndexPath is required for type parsing");
|
|
20
|
+
}
|
|
21
|
+
// Configure parser options
|
|
22
|
+
const options = {
|
|
23
|
+
savePropValueAsString: true,
|
|
24
|
+
shouldExtractLiteralValuesFromEnum: true,
|
|
25
|
+
shouldRemoveUndefinedFromOptional: true,
|
|
26
|
+
};
|
|
27
|
+
// Parse all types from the index file
|
|
28
|
+
const rawTypes = docgen.parse(indexPath, options);
|
|
29
|
+
// Process types (filter + enrich)
|
|
30
|
+
const processedTypes = processComponentTypes(rawTypes, config.propFilter);
|
|
31
|
+
return processedTypes;
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
console.error("Error parsing types:", error);
|
|
35
|
+
throw error;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Parse types and write to a single output file
|
|
40
|
+
* @param componentIndexPath - Path to component index file
|
|
41
|
+
* @param outputPath - Path to write types JSON
|
|
42
|
+
* @param propFilter - Optional custom prop filter
|
|
43
|
+
*/
|
|
44
|
+
export async function parseTypesToFile(componentIndexPath, outputPath, propFilter) {
|
|
45
|
+
const processedTypes = await parseTypes({
|
|
46
|
+
sources: { packagesDir: "", componentIndexPath },
|
|
47
|
+
propFilter,
|
|
48
|
+
});
|
|
49
|
+
await fs.writeFile(outputPath, JSON.stringify(processedTypes, null, 2));
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Parse types and write individual component type files
|
|
53
|
+
* @param componentIndexPath - Path to component index file
|
|
54
|
+
* @param outputDir - Directory to write individual type files
|
|
55
|
+
* @param propFilter - Optional custom prop filter
|
|
56
|
+
* @returns Manifest mapping component names to filenames
|
|
57
|
+
*/
|
|
58
|
+
export async function parseTypesToFiles(componentIndexPath, outputDir, propFilter) {
|
|
59
|
+
const processedTypes = await parseTypes({
|
|
60
|
+
sources: { packagesDir: "", componentIndexPath },
|
|
61
|
+
propFilter,
|
|
62
|
+
});
|
|
63
|
+
// Ensure output directory exists
|
|
64
|
+
await fs.mkdir(outputDir, { recursive: true });
|
|
65
|
+
// Write individual component type files and build manifest
|
|
66
|
+
const manifest = {};
|
|
67
|
+
for (const componentDoc of processedTypes) {
|
|
68
|
+
const componentName = componentDoc.displayName;
|
|
69
|
+
if (!componentName)
|
|
70
|
+
continue;
|
|
71
|
+
const filename = `${componentName}.json`;
|
|
72
|
+
const filePath = `${outputDir}/${filename}`;
|
|
73
|
+
// Write individual component type file
|
|
74
|
+
await fs.writeFile(filePath, JSON.stringify(componentDoc, null, 2));
|
|
75
|
+
// Add to manifest (without .json extension, similar to routes)
|
|
76
|
+
manifest[componentName] = componentName;
|
|
77
|
+
}
|
|
78
|
+
// Write manifest file
|
|
79
|
+
const manifestPath = `${outputDir}/manifest.json`;
|
|
80
|
+
await fs.writeFile(manifestPath, JSON.stringify(manifest, null, 2));
|
|
81
|
+
return manifest;
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=parse-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-types.js","sourceRoot":"","sources":["../../src/parsers/parse-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7B,OAAO,MAAM,MAAM,yBAAyB,CAAC;AAE7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAG3D;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CA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AAE,kBAAkB,EAAE;QAChD,UAAU;KACX,CAAC,CAAC;IAEH,iCAAiC;IACjC,MAAM,EAAE,CAAC,KAAK,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAE/C,2DAA2D;IAC3D,MAAM,QAAQ,GAA2B,EAAE,CAAC;IAE5C,KAAK,MAAM,YAAY,IAAI,cAAc,EAAE,CAAC;QAC1C,MAAM,aAAa,GAAG,YAAY,CAAC,WAAW,CAAC;QAC/C,IAAI,CAAC,aAAa;YAAE,SAAS;QAE7B,MAAM,QAAQ,GAAG,GAAG,aAAa,OAAO,CAAC;QACzC,MAAM,QAAQ,GAAG,GAAG,SAAS,IAAI,QAAQ,EAAE,CAAC;QAE5C,uCAAuC;QACvC,MAAM,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QAEpE,+DAA+D;QAC/D,QAAQ,CAAC,aAAa,CAAC,GAAG,aAAa,CAAC;IAC1C,CAAC;IAED,sBAAsB;IACtB,MAAM,YAAY,GAAG,GAAG,SAAS,gBAAgB,CAAC;IAClD,MAAM,EAAE,CAAC,SAAS,CAAC,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAEpE,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Post-processing pipeline for react-docgen-typescript output.
|
|
3
|
+
* Applies metadata enrichment and filtering in a single in-memory pass.
|
|
4
|
+
*/
|
|
5
|
+
import type { ComponentDoc, PropItem } from "react-docgen-typescript";
|
|
6
|
+
/**
|
|
7
|
+
* Process parsed component types in a single pass:
|
|
8
|
+
* 1. Filter out unwanted props
|
|
9
|
+
* 2. Analyze filtered props to generate component-level metadata
|
|
10
|
+
* 3. Return component with metadata and filtered props
|
|
11
|
+
*
|
|
12
|
+
* This is a single-pass, in-memory operation with no disk I/O.
|
|
13
|
+
*
|
|
14
|
+
* @param rawParsedTypes - Raw output from react-docgen-typescript
|
|
15
|
+
* @param customPropFilter - Optional custom prop filter function
|
|
16
|
+
* @returns Processed component docs with filtered props and enriched metadata
|
|
17
|
+
*/
|
|
18
|
+
export declare const processComponentTypes: (rawParsedTypes: ComponentDoc[], customPropFilter?: (prop: PropItem) => boolean) => ComponentDoc[];
|
|
19
|
+
//# sourceMappingURL=process-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-types.d.ts","sourceRoot":"","sources":["../../src/parsers/process-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAmBtE;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,qBAAqB,GAChC,gBAAgB,YAAY,EAAE,EAC9B,mBAAmB,CAAC,IAAI,EAAE,QAAQ,KAAK,OAAO,KAC7C,YAAY,EAoBd,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { shouldFilterProp } from "./filter-props.js";
|
|
2
|
+
/**
|
|
3
|
+
* Enrich component with metadata based on JSDoc tags and props.
|
|
4
|
+
* This adds aggregate information about the component at the top level.
|
|
5
|
+
*
|
|
6
|
+
* @param component - The component doc from react-docgen-typescript
|
|
7
|
+
* @returns Component-level metadata
|
|
8
|
+
*/
|
|
9
|
+
const enrichComponent = (component) => {
|
|
10
|
+
// Check if component has @supportsStyleProps JSDoc tag
|
|
11
|
+
const supportsStyleProps = "supportsStyleProps" in (component.tags || {});
|
|
12
|
+
return {
|
|
13
|
+
supportsStyleProps,
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Process parsed component types in a single pass:
|
|
18
|
+
* 1. Filter out unwanted props
|
|
19
|
+
* 2. Analyze filtered props to generate component-level metadata
|
|
20
|
+
* 3. Return component with metadata and filtered props
|
|
21
|
+
*
|
|
22
|
+
* This is a single-pass, in-memory operation with no disk I/O.
|
|
23
|
+
*
|
|
24
|
+
* @param rawParsedTypes - Raw output from react-docgen-typescript
|
|
25
|
+
* @param customPropFilter - Optional custom prop filter function
|
|
26
|
+
* @returns Processed component docs with filtered props and enriched metadata
|
|
27
|
+
*/
|
|
28
|
+
export const processComponentTypes = (rawParsedTypes, customPropFilter) => {
|
|
29
|
+
return rawParsedTypes.map((component) => {
|
|
30
|
+
// Use custom filter if provided, otherwise use default
|
|
31
|
+
const filterFn = customPropFilter || shouldFilterProp;
|
|
32
|
+
// Step 1: Filter props
|
|
33
|
+
const filteredProps = Object.fromEntries(Object.entries(component.props).filter(([, prop]) => filterFn(prop)));
|
|
34
|
+
// Step 2: Generate component-level metadata from JSDoc tags and filtered props
|
|
35
|
+
const metadata = enrichComponent(component);
|
|
36
|
+
// Step 3: Return component with metadata and filtered props
|
|
37
|
+
return {
|
|
38
|
+
...component,
|
|
39
|
+
...metadata,
|
|
40
|
+
props: filteredProps,
|
|
41
|
+
};
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=process-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-types.js","sourceRoot":"","sources":["../../src/parsers/process-types.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD;;;;;;GAMG;AACH,MAAM,eAAe,GAAG,CAAC,SAAuB,EAA2B,EAAE;IAC3E,uDAAuD;IACvD,MAAM,kBAAkB,GAAG,oBAAoB,IAAI,CAAC,SAAS,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;IAE1E,OAAO;QACL,kBAAkB;KACnB,CAAC;AACJ,CAAC,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,cAA8B,EAC9B,gBAA8C,EAC9B,EAAE;IAClB,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE;QACtC,uDAAuD;QACvD,MAAM,QAAQ,GAAG,gBAAgB,IAAI,gBAAgB,CAAC;QAEtD,uBAAuB;QACvB,MAAM,aAAa,GAAG,MAAM,CAAC,WAAW,CACtC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CACrE,CAAC;QAEF,+EAA+E;QAC/E,MAAM,QAAQ,GAAG,eAAe,CAAC,SAAS,CAAC,CAAC;QAE5C,4DAA4D;QAC5D,OAAO;YACL,GAAG,SAAS;YACZ,GAAG,QAAQ;YACX,KAAK,EAAE,aAAa;SACrB,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lifecycle state definitions for components and features
|
|
3
|
+
*/
|
|
4
|
+
export declare const lifecycleStates: readonly ["Experimental", "Alpha", "Beta", "Stable", "Deprecated", "EOL"];
|
|
5
|
+
export type LifecycleState = (typeof lifecycleStates)[number];
|
|
6
|
+
type LifecycleStateDescription = {
|
|
7
|
+
[K in LifecycleState]: {
|
|
8
|
+
label: string;
|
|
9
|
+
description: string;
|
|
10
|
+
order: number;
|
|
11
|
+
colorPalette: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export declare const lifecycleStateDescriptions: LifecycleStateDescription;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=lifecycle-states.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifecycle-states.d.ts","sourceRoot":"","sources":["../../src/schemas/lifecycle-states.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,eAAe,2EAOlB,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9D,KAAK,yBAAyB,GAAG;KAC9B,CAAC,IAAI,cAAc,GAAG;QACrB,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,MAAM,CAAC;QACpB,KAAK,EAAE,MAAM,CAAC;QACd,YAAY,EAAE,MAAM,CAAC;KACtB;CACF,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,yBA2CxC,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lifecycle state definitions for components and features
|
|
3
|
+
*/
|
|
4
|
+
export const lifecycleStates = [
|
|
5
|
+
"Experimental",
|
|
6
|
+
"Alpha",
|
|
7
|
+
"Beta",
|
|
8
|
+
"Stable",
|
|
9
|
+
"Deprecated",
|
|
10
|
+
"EOL",
|
|
11
|
+
];
|
|
12
|
+
export const lifecycleStateDescriptions = {
|
|
13
|
+
Experimental: {
|
|
14
|
+
label: "Experimental",
|
|
15
|
+
description: "Highly unstable, may be removed entirely without notice. Not for production use.",
|
|
16
|
+
order: 1,
|
|
17
|
+
colorPalette: "red",
|
|
18
|
+
},
|
|
19
|
+
Alpha: {
|
|
20
|
+
label: "Alpha",
|
|
21
|
+
description: "Still highly unstable with known bugs. Not for production use.",
|
|
22
|
+
order: 2,
|
|
23
|
+
colorPalette: "orange",
|
|
24
|
+
},
|
|
25
|
+
Beta: {
|
|
26
|
+
label: "Beta",
|
|
27
|
+
description: "More stable but subject to breaking changes. Use with caution in non-critical production.",
|
|
28
|
+
order: 3,
|
|
29
|
+
colorPalette: "amber",
|
|
30
|
+
},
|
|
31
|
+
Stable: {
|
|
32
|
+
label: "Stable",
|
|
33
|
+
description: "Production-ready, thoroughly tested, and actively maintained.",
|
|
34
|
+
order: 4,
|
|
35
|
+
colorPalette: "grass",
|
|
36
|
+
},
|
|
37
|
+
Deprecated: {
|
|
38
|
+
label: "Deprecated",
|
|
39
|
+
description: "Not for new development. Will be removed in a future version.",
|
|
40
|
+
order: 5,
|
|
41
|
+
colorPalette: "neutral",
|
|
42
|
+
},
|
|
43
|
+
EOL: {
|
|
44
|
+
label: "End-of-Life",
|
|
45
|
+
description: "No longer available. Element has been removed from the library.",
|
|
46
|
+
order: 6,
|
|
47
|
+
colorPalette: "blackAlpha",
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=lifecycle-states.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifecycle-states.js","sourceRoot":"","sources":["../../src/schemas/lifecycle-states.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,cAAc;IACd,OAAO;IACP,MAAM;IACN,QAAQ;IACR,YAAY;IACZ,KAAK;CACG,CAAC;AAaX,MAAM,CAAC,MAAM,0BAA0B,GAA8B;IACnE,YAAY,EAAE;QACZ,KAAK,EAAE,cAAc;QACrB,WAAW,EACT,kFAAkF;QACpF,KAAK,EAAE,CAAC;QACR,YAAY,EAAE,KAAK;KACpB;IACD,KAAK,EAAE;QACL,KAAK,EAAE,OAAO;QACd,WAAW,EACT,gEAAgE;QAClE,KAAK,EAAE,CAAC;QACR,YAAY,EAAE,QAAQ;KACvB;IACD,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM;QACb,WAAW,EACT,2FAA2F;QAC7F,KAAK,EAAE,CAAC;QACR,YAAY,EAAE,OAAO;KACtB;IACD,MAAM,EAAE;QACN,KAAK,EAAE,QAAQ;QACf,WAAW,EACT,+DAA+D;QACjE,KAAK,EAAE,CAAC;QACR,YAAY,EAAE,OAAO;KACtB;IACD,UAAU,EAAE;QACV,KAAK,EAAE,YAAY;QACnB,WAAW,EACT,+DAA+D;QACjE,KAAK,EAAE,CAAC;QACR,YAAY,EAAE,SAAS;KACxB;IACD,GAAG,EAAE;QACH,KAAK,EAAE,aAAa;QACpB,WAAW,EACT,iEAAiE;QACnE,KAAK,EAAE,CAAC;QACR,YAAY,EAAE,YAAY;KAC3B;CACF,CAAC"}
|