@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,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File system utility functions
|
|
3
|
+
*/
|
|
4
|
+
import fs from "fs/promises";
|
|
5
|
+
import path from "path";
|
|
6
|
+
/**
|
|
7
|
+
* Recursively find the monorepo root by checking for "workspaces" in package.json.
|
|
8
|
+
* @param dir The starting directory to search from.
|
|
9
|
+
* @returns The absolute path to the monorepo root or null if not found.
|
|
10
|
+
*/
|
|
11
|
+
export async function findMonorepoRoot(dir) {
|
|
12
|
+
const packageJsonPath = path.join(dir, "package.json");
|
|
13
|
+
try {
|
|
14
|
+
const packageJsonContent = await fs.readFile(packageJsonPath, "utf8");
|
|
15
|
+
const packageJson = JSON.parse(packageJsonContent);
|
|
16
|
+
if (packageJson.workspaces) {
|
|
17
|
+
return dir;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
// Ignore errors (e.g., file not found or invalid JSON) and continue
|
|
22
|
+
}
|
|
23
|
+
const parentDir = path.dirname(dir);
|
|
24
|
+
if (parentDir === dir) {
|
|
25
|
+
// Reached the filesystem root
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
return findMonorepoRoot(parentDir);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Get the relative path from the monorepo root to the specified file path.
|
|
32
|
+
* @param filePath The file path to calculate the relative path for.
|
|
33
|
+
* @returns The relative path from the monorepo root to the file path.
|
|
34
|
+
* @throws If the monorepo root cannot be found.
|
|
35
|
+
*/
|
|
36
|
+
export async function getPathFromMonorepoRoot(filePath) {
|
|
37
|
+
const absoluteFilePath = path.resolve(filePath);
|
|
38
|
+
const startingDir = path.dirname(absoluteFilePath);
|
|
39
|
+
const monorepoRoot = await findMonorepoRoot(startingDir);
|
|
40
|
+
if (!monorepoRoot) {
|
|
41
|
+
throw new Error('Monorepo root not found. Ensure a package.json with a "workspaces" property exists.');
|
|
42
|
+
}
|
|
43
|
+
return path.relative(monorepoRoot, absoluteFilePath);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Find all files with a specific extension recursively
|
|
47
|
+
* @param dir Directory to search
|
|
48
|
+
* @param extension File extension to match (e.g., ".mdx")
|
|
49
|
+
* @returns Array of file paths
|
|
50
|
+
*/
|
|
51
|
+
export async function findFiles(dir, extension) {
|
|
52
|
+
const files = [];
|
|
53
|
+
try {
|
|
54
|
+
const entries = await fs.readdir(dir, { withFileTypes: true });
|
|
55
|
+
for (const entry of entries) {
|
|
56
|
+
const fullPath = path.join(dir, entry.name);
|
|
57
|
+
if (entry.isDirectory()) {
|
|
58
|
+
// Skip node_modules and dist
|
|
59
|
+
if (entry.name === "node_modules" || entry.name === "dist") {
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
const subFiles = await findFiles(fullPath, extension);
|
|
63
|
+
files.push(...subFiles);
|
|
64
|
+
}
|
|
65
|
+
else if (entry.isFile()) {
|
|
66
|
+
if (path.extname(entry.name).toLowerCase() === extension.toLowerCase()) {
|
|
67
|
+
files.push(fullPath);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
catch {
|
|
73
|
+
// Ignore permission errors
|
|
74
|
+
}
|
|
75
|
+
return files;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Find all files matching multiple extensions
|
|
79
|
+
* @param dir Directory to search
|
|
80
|
+
* @param extensions Array of extensions to match
|
|
81
|
+
* @returns Array of file paths
|
|
82
|
+
*/
|
|
83
|
+
export async function findFilesByExtensions(dir, extensions) {
|
|
84
|
+
const files = [];
|
|
85
|
+
try {
|
|
86
|
+
const entries = await fs.readdir(dir, { withFileTypes: true });
|
|
87
|
+
for (const entry of entries) {
|
|
88
|
+
const fullPath = path.join(dir, entry.name);
|
|
89
|
+
if (entry.isDirectory()) {
|
|
90
|
+
// Skip node_modules and dist directories
|
|
91
|
+
if (entry.name === "node_modules" || entry.name === "dist") {
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
// Recursively search subdirectories
|
|
95
|
+
const subFiles = await findFilesByExtensions(fullPath, extensions);
|
|
96
|
+
files.push(...subFiles);
|
|
97
|
+
}
|
|
98
|
+
else if (entry.isFile()) {
|
|
99
|
+
const ext = path.extname(entry.name).toLowerCase();
|
|
100
|
+
if (extensions.includes(ext)) {
|
|
101
|
+
files.push(fullPath);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
catch {
|
|
107
|
+
// Ignore permission errors, etc.
|
|
108
|
+
}
|
|
109
|
+
return files;
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=file-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-utils.js","sourceRoot":"","sources":["../../src/utils/file-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,GAAW;IAChD,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;IAEvD,IAAI,CAAC;QACH,MAAM,kBAAkB,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;QACtE,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;QAEnD,IAAI,WAAW,CAAC,UAAU,EAAE,CAAC;YAC3B,OAAO,GAAG,CAAC;QACb,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,oEAAoE;IACtE,CAAC;IAED,MAAM,SA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AE,EAAE,CAAC;gBAC1B,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC;gBACnD,IAAI,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;oBAC7B,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBACvB,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,iCAAiC;IACnC,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simple logging utilities with colored output
|
|
3
|
+
*/
|
|
4
|
+
export declare const flog: (str: string) => void;
|
|
5
|
+
export declare const errorLog: (str: string) => void;
|
|
6
|
+
export declare const warnLog: (str: string) => void;
|
|
7
|
+
export declare const successLog: (str: string) => void;
|
|
8
|
+
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,eAAO,MAAM,IAAI,GAAI,KAAK,MAAM,SAE/B,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,KAAK,MAAM,SAEnC,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,KAAK,MAAM,SAElC,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,KAAK,MAAM,SAErC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simple logging utilities with colored output
|
|
3
|
+
*/
|
|
4
|
+
export const flog = (str) => {
|
|
5
|
+
console.log("\x1b[32m%s\x1b[0m", `\n ➜ ${str}\n`);
|
|
6
|
+
};
|
|
7
|
+
export const errorLog = (str) => {
|
|
8
|
+
console.error("\x1b[31m%s\x1b[0m", `\n ✗ ${str}\n`);
|
|
9
|
+
};
|
|
10
|
+
export const warnLog = (str) => {
|
|
11
|
+
console.warn("\x1b[33m%s\x1b[0m", `\n ⚠ ${str}\n`);
|
|
12
|
+
};
|
|
13
|
+
export const successLog = (str) => {
|
|
14
|
+
console.log("\x1b[32m%s\x1b[0m", `\n ✓ ${str}\n`);
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,GAAW,EAAE,EAAE;IAClC,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,SAAS,GAAG,IAAI,CAAC,CAAC;AACrD,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAAW,EAAE,EAAE;IACtC,OAAO,CAAC,KAAK,CAAC,mBAAmB,EAAE,SAAS,GAAG,IAAI,CAAC,CAAC;AACvD,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,GAAW,EAAE,EAAE;IACrC,OAAO,CAAC,IAAI,CAAC,mBAAmB,EAAE,SAAS,GAAG,IAAI,CAAC,CAAC;AACtD,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,GAAW,EAAE,EAAE;IACxC,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,SAAS,GAAG,IAAI,CAAC,CAAC;AACrD,CAAC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* String to URL slug conversion utilities
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Create a URL-compatible slug from a string
|
|
6
|
+
* Simple implementation to avoid dependency on 'slug' package
|
|
7
|
+
* @param str - The string to be converted to a slug
|
|
8
|
+
* @returns The slugified string
|
|
9
|
+
*/
|
|
10
|
+
export declare const sluggify: (str: string) => string;
|
|
11
|
+
/**
|
|
12
|
+
* Transforms a menu from an mdx-file's frontmatter to a path
|
|
13
|
+
* @param menu - The menu array from the frontmatter
|
|
14
|
+
* @returns The path created by joining the slugified menu items
|
|
15
|
+
*/
|
|
16
|
+
export declare const menuToPath: (menu: string[]) => string;
|
|
17
|
+
//# sourceMappingURL=sluggify.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sluggify.d.ts","sourceRoot":"","sources":["../../src/utils/sluggify.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,GAAI,KAAK,MAAM,KAAG,MAOtC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,UAAU,GAAI,MAAM,MAAM,EAAE,KAAG,MAE3C,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* String to URL slug conversion utilities
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Create a URL-compatible slug from a string
|
|
6
|
+
* Simple implementation to avoid dependency on 'slug' package
|
|
7
|
+
* @param str - The string to be converted to a slug
|
|
8
|
+
* @returns The slugified string
|
|
9
|
+
*/
|
|
10
|
+
export const sluggify = (str) => {
|
|
11
|
+
return str
|
|
12
|
+
.toLowerCase()
|
|
13
|
+
.trim()
|
|
14
|
+
.replace(/[^\w\s-]/g, "") // Remove special characters
|
|
15
|
+
.replace(/[\s_-]+/g, "-") // Replace spaces, underscores with single dash
|
|
16
|
+
.replace(/^-+|-+$/g, ""); // Remove leading/trailing dashes
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Transforms a menu from an mdx-file's frontmatter to a path
|
|
20
|
+
* @param menu - The menu array from the frontmatter
|
|
21
|
+
* @returns The path created by joining the slugified menu items
|
|
22
|
+
*/
|
|
23
|
+
export const menuToPath = (menu) => {
|
|
24
|
+
return menu.map((item) => sluggify(item)).join("/");
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=sluggify.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sluggify.js","sourceRoot":"","sources":["../../src/utils/sluggify.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAAW,EAAU,EAAE;IAC9C,OAAO,GAAG;SACP,WAAW,EAAE;SACb,IAAI,EAAE;SACN,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,4BAA4B;SACrD,OAAO,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC,+CAA+C;SACxE,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,CAAC,iCAAiC;AAC/D,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,IAAc,EAAU,EAAE;IACnD,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,IAAY,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC9D,CAAC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validates that a file path doesn't escape from the base directory.
|
|
3
|
+
* Prevents path traversal attacks by ensuring the resolved path
|
|
4
|
+
* stays within the intended base directory.
|
|
5
|
+
*
|
|
6
|
+
* @param baseDir - The base directory that the path must remain within
|
|
7
|
+
* @param pathSegments - Path segments to join and validate
|
|
8
|
+
* @returns The validated absolute path
|
|
9
|
+
* @throws Error if path traversal is detected
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* // Valid path
|
|
14
|
+
* validateFilePath('/app/routes', 'component-button.json')
|
|
15
|
+
* // Returns: '/app/routes/component-button.json'
|
|
16
|
+
*
|
|
17
|
+
* // Invalid path (traversal attempt)
|
|
18
|
+
* validateFilePath('/app/routes', '../../../etc/passwd')
|
|
19
|
+
* // Throws: Error('Invalid file path: ../../../etc/passwd (traversal detected)')
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare function validateFilePath(baseDir: string, ...pathSegments: string[]): string;
|
|
23
|
+
//# sourceMappingURL=validate-file-path.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-file-path.d.ts","sourceRoot":"","sources":["../../src/utils/validate-file-path.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,MAAM,EACf,GAAG,YAAY,EAAE,MAAM,EAAE,GACxB,MAAM,CAwBR"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import path from "path";
|
|
2
|
+
/**
|
|
3
|
+
* Validates that a file path doesn't escape from the base directory.
|
|
4
|
+
* Prevents path traversal attacks by ensuring the resolved path
|
|
5
|
+
* stays within the intended base directory.
|
|
6
|
+
*
|
|
7
|
+
* @param baseDir - The base directory that the path must remain within
|
|
8
|
+
* @param pathSegments - Path segments to join and validate
|
|
9
|
+
* @returns The validated absolute path
|
|
10
|
+
* @throws Error if path traversal is detected
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* // Valid path
|
|
15
|
+
* validateFilePath('/app/routes', 'component-button.json')
|
|
16
|
+
* // Returns: '/app/routes/component-button.json'
|
|
17
|
+
*
|
|
18
|
+
* // Invalid path (traversal attempt)
|
|
19
|
+
* validateFilePath('/app/routes', '../../../etc/passwd')
|
|
20
|
+
* // Throws: Error('Invalid file path: ../../../etc/passwd (traversal detected)')
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export function validateFilePath(baseDir, ...pathSegments) {
|
|
24
|
+
// Join all path segments
|
|
25
|
+
const joined = path.join(...pathSegments);
|
|
26
|
+
// Normalize to resolve any '..' sequences
|
|
27
|
+
const normalized = path.normalize(joined);
|
|
28
|
+
// Resolve to absolute path relative to base directory
|
|
29
|
+
const resolved = path.resolve(baseDir, normalized);
|
|
30
|
+
// Get absolute base directory path
|
|
31
|
+
const absoluteBase = path.resolve(baseDir);
|
|
32
|
+
// Ensure the resolved path starts with the base directory
|
|
33
|
+
if (!resolved.startsWith(absoluteBase + path.sep) &&
|
|
34
|
+
resolved !== absoluteBase) {
|
|
35
|
+
throw new Error(`Invalid file path: attempted to access '${joined}' outside base directory '${baseDir}'`);
|
|
36
|
+
}
|
|
37
|
+
return resolved;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=validate-file-path.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-file-path.js","sourceRoot":"","sources":["../../src/utils/validate-file-path.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,gBAAgB,CAC9B,OAAe,EACf,GAAG,YAAsB;IAEzB,yBAAyB;IACzB,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC,CAAC;IAE1C,0CAA0C;IAC1C,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAE1C,sDAAsD;IACtD,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IAEnD,mCAAmC;IACnC,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAE3C,0DAA0D;IAC1D,IACE,CAAC,QAAQ,CAAC,UAAU,CAAC,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC;QAC7C,QAAQ,KAAK,YAAY,EACzB,CAAC;QACD,MAAM,IAAI,KAAK,CACb,2CAA2C,MAAM,6BAA6B,OAAO,GAAG,CACzF,CAAC;IACJ,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/validation/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/validation/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Content Validation
|
|
3
|
+
*
|
|
4
|
+
* Validates documentation content for common issues
|
|
5
|
+
*/
|
|
6
|
+
import type { MdxDocument } from "../types/mdx.js";
|
|
7
|
+
import type { ValidationError } from "../types/config.js";
|
|
8
|
+
/**
|
|
9
|
+
* Validate all documentation content
|
|
10
|
+
*/
|
|
11
|
+
export declare function validateContent(docs: Map<string, MdxDocument>): ValidationError[];
|
|
12
|
+
//# sourceMappingURL=validate-content.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-content.d.ts","sourceRoot":"","sources":["../../src/validation/validate-content.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAG1D;;GAEG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,GAC7B,eAAe,EAAE,CAuGnB"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { flog } from "../utils/logger.js";
|
|
2
|
+
/**
|
|
3
|
+
* Validate all documentation content
|
|
4
|
+
*/
|
|
5
|
+
export function validateContent(docs) {
|
|
6
|
+
const errors = [];
|
|
7
|
+
for (const [filePath, doc] of docs) {
|
|
8
|
+
// Validate required frontmatter fields
|
|
9
|
+
if (!doc.meta.id) {
|
|
10
|
+
errors.push({
|
|
11
|
+
file: filePath,
|
|
12
|
+
message: "Missing required field: id",
|
|
13
|
+
severity: "error",
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
if (!doc.meta.title) {
|
|
17
|
+
errors.push({
|
|
18
|
+
file: filePath,
|
|
19
|
+
message: "Missing required field: title",
|
|
20
|
+
severity: "error",
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
// Warn about missing description
|
|
24
|
+
if (!doc.meta.description) {
|
|
25
|
+
errors.push({
|
|
26
|
+
file: filePath,
|
|
27
|
+
message: "Missing recommended field: description",
|
|
28
|
+
severity: "warning",
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
// Warn about missing tags
|
|
32
|
+
if (!doc.meta.tags || doc.meta.tags.length === 0) {
|
|
33
|
+
errors.push({
|
|
34
|
+
file: filePath,
|
|
35
|
+
message: "Missing recommended field: tags",
|
|
36
|
+
severity: "warning",
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
// Validate menu structure
|
|
40
|
+
if (!doc.meta.menu || doc.meta.menu.length === 0) {
|
|
41
|
+
errors.push({
|
|
42
|
+
file: filePath,
|
|
43
|
+
message: "Missing or empty menu array",
|
|
44
|
+
severity: "error",
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
// Check for empty content
|
|
48
|
+
if (!doc.mdx || doc.mdx.trim().length === 0) {
|
|
49
|
+
errors.push({
|
|
50
|
+
file: filePath,
|
|
51
|
+
message: "Document has no content",
|
|
52
|
+
severity: "error",
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
// Check for broken internal links (basic check)
|
|
56
|
+
const internalLinkPattern = /\[.*?\]\(\/[^)]+\)/g;
|
|
57
|
+
const matches = doc.mdx.match(internalLinkPattern);
|
|
58
|
+
if (matches) {
|
|
59
|
+
for (const match of matches) {
|
|
60
|
+
// Extract path
|
|
61
|
+
const path = match.match(/\((\/[^)]+)\)/)?.[1];
|
|
62
|
+
if (path &&
|
|
63
|
+
!path.startsWith("/images/") &&
|
|
64
|
+
!path.startsWith("/public/")) {
|
|
65
|
+
// This is an internal doc link - could validate it exists
|
|
66
|
+
// For now, just log it as info
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
// Report validation results
|
|
72
|
+
const errorCount = errors.filter((e) => e.severity === "error").length;
|
|
73
|
+
const warningCount = errors.filter((e) => e.severity === "warning").length;
|
|
74
|
+
if (errorCount > 0) {
|
|
75
|
+
console.error(`\n❌ Found ${errorCount} validation errors:`);
|
|
76
|
+
errors
|
|
77
|
+
.filter((e) => e.severity === "error")
|
|
78
|
+
.forEach((err) => {
|
|
79
|
+
console.error(` ${err.file}: ${err.message}`);
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
if (warningCount > 0) {
|
|
83
|
+
console.warn(`\n⚠️ Found ${warningCount} validation warnings:`);
|
|
84
|
+
errors
|
|
85
|
+
.filter((e) => e.severity === "warning")
|
|
86
|
+
.forEach((err) => {
|
|
87
|
+
console.warn(` ${err.file}: ${err.message}`);
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
if (errors.length === 0) {
|
|
91
|
+
flog("[Validation] All content valid ✓");
|
|
92
|
+
}
|
|
93
|
+
return errors;
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=validate-content.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-content.js","sourceRoot":"","sources":["../../src/validation/validate-content.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C;;GAEG;AACH,MAAM,UAAU,eAAe,CAC7B,IAA8B;IAE9B,MAAM,MAAM,GAAsB,EAAE,CAAC;IAErC,KAAK,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC;QACnC,uCAAuC;QACvC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;YACjB,MAAM,CAAC,IAAI,CAAC;gBACV,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,4BAA4B;gBACrC,QAAQ,EAAE,OAAO;aAClB,CAAC,CAAC;QACL,CAAC;QAED,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;YACpB,MAAM,CAAC,IAAI,CAAC;gBACV,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,+BAA+B;gBACxC,QAAQ,EAAE,OAAO;aAClB,CAAC,CAAC;QACL,CAAC;QAED,iCAAiC;QACjC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;YAC1B,MAAM,CAAC,IAAI,CAAC;gBACV,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,wCAAwC;gBACjD,QAAQ,EAAE,SAAS;aACpB,CAAC,CAAC;QACL,CAAC;QAED,0BAA0B;QAC1B,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACjD,MAAM,CAAC,IAAI,CAAC;gBACV,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,iCAAiC;gBAC1C,QAAQ,EAAE,SAAS;aACpB,CAAC,CAAC;QACL,CAAC;Q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AAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,MAAM,CAAC;IAE3E,IAAI,UAAU,GAAG,CAAC,EAAE,CAAC;QACnB,OAAO,CAAC,KAAK,CAAC,aAAa,UAAU,qBAAqB,CAAC,CAAC;QAC5D,MAAM;aACH,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,OAAO,CAAC;aACrC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YACf,OAAO,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,IAAI,KAAK,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;QACjD,CAAC,CAAC,CAAC;IACP,CAAC;IAED,IAAI,YAAY,GAAG,CAAC,EAAE,CAAC;QACrB,OAAO,CAAC,IAAI,CAAC,eAAe,YAAY,uBAAuB,CAAC,CAAC;QACjE,MAAM;aACH,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,SAAS,CAAC;aACvC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YACf,OAAO,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,IAAI,KAAK,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;QAChD,CAAC,CAAC,CAAC;IACP,CAAC;IAED,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,IAAI,CAAC,kCAAkC,CAAC,CAAC;IAC3C,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@commercetools/nimbus-docs-build",
|
|
3
|
+
"version": "0.0.0-canary-20251107124701",
|
|
4
|
+
"description": "Documentation build system for Nimbus design system - handles MDX parsing, TypeScript type extraction, and documentation generation",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"default": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"./package.json": "./package.json"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist",
|
|
19
|
+
"package.json",
|
|
20
|
+
"README.md"
|
|
21
|
+
],
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"gray-matter": "^4.0.3",
|
|
24
|
+
"react-docgen-typescript": "^2.4.0",
|
|
25
|
+
"remark": "^15.0.1",
|
|
26
|
+
"remark-flexible-toc": "^1.2.3",
|
|
27
|
+
"to-vfile": "^8.0.0",
|
|
28
|
+
"zod": "^4.1.12"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@types/node": "^24.7.1",
|
|
32
|
+
"typescript": "~5.9.3"
|
|
33
|
+
},
|
|
34
|
+
"peerDependencies": {},
|
|
35
|
+
"publishConfig": {
|
|
36
|
+
"access": "public",
|
|
37
|
+
"registry": "https://registry.npmjs.org/"
|
|
38
|
+
},
|
|
39
|
+
"repository": {
|
|
40
|
+
"type": "git",
|
|
41
|
+
"url": "https://github.com/commercetools/nimbus.git",
|
|
42
|
+
"directory": "packages/nimbus-docs-build"
|
|
43
|
+
},
|
|
44
|
+
"scripts": {
|
|
45
|
+
"build": "tsc",
|
|
46
|
+
"dev": "tsc --watch",
|
|
47
|
+
"typecheck": "tsc --noEmit"
|
|
48
|
+
}
|
|
49
|
+
}
|