@aigne/doc-smith 0.8.15-beta.10 → 0.8.15-beta.11

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/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.8.15-beta.11](https://github.com/AIGNE-io/aigne-doc-smith/compare/v0.8.15-beta.10...v0.8.15-beta.11) (2025-11-04)
4
+
5
+
6
+ ### Features
7
+
8
+ * warn on invalid sources and tuning translate messages ([#241](https://github.com/AIGNE-io/aigne-doc-smith/issues/241)) ([bd786ca](https://github.com/AIGNE-io/aigne-doc-smith/commit/bd786cad8b0c6fa837511fdc2982c83b7f0095dd))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * avoid useless diagram generate ([#245](https://github.com/AIGNE-io/aigne-doc-smith/issues/245)) ([de7600f](https://github.com/AIGNE-io/aigne-doc-smith/commit/de7600fb5839be9d1f0743adc34fd08c4c11729d))
14
+ * iterate on chunk of datasource to generate structure ([#242](https://github.com/AIGNE-io/aigne-doc-smith/issues/242)) ([0b4db2a](https://github.com/AIGNE-io/aigne-doc-smith/commit/0b4db2a8cac77d6f4a1c197374b9dadbe078346b))
15
+
3
16
  ## [0.8.15-beta.10](https://github.com/AIGNE-io/aigne-doc-smith/compare/v0.8.15-beta.9...v0.8.15-beta.10) (2025-11-03)
4
17
 
5
18
 
@@ -1,32 +1,9 @@
1
1
  import { getActiveRulesForScope } from "../../utils/preferences-utils.mjs";
2
2
  import { recordUpdate } from "../../utils/history-utils.mjs";
3
+ import { buildDocumentTree } from "../../utils/docs-finder-utils.mjs";
3
4
 
4
5
  function formatDocumentStructure(structure) {
5
- // Create a map of nodes for easy lookup
6
- const nodeMap = new Map();
7
- const rootNodes = [];
8
-
9
- // First pass: create node map
10
- structure.forEach((node) => {
11
- nodeMap.set(node.path, {
12
- ...node,
13
- children: [],
14
- });
15
- });
16
-
17
- // Build the tree structure
18
- structure.forEach((node) => {
19
- if (node.parentId) {
20
- const parent = nodeMap.get(node.parentId);
21
- if (parent) {
22
- parent.children.push(nodeMap.get(node.path));
23
- } else {
24
- rootNodes.push(nodeMap.get(node.path));
25
- }
26
- } else {
27
- rootNodes.push(nodeMap.get(node.path));
28
- }
29
- });
6
+ const { rootNodes } = buildDocumentTree(structure);
30
7
 
31
8
  function printNode(node, depth = 0) {
32
9
  const INDENT_SPACES = " ";
@@ -11,13 +11,13 @@ export default async function mergeDocumentStructures(input, options) {
11
11
 
12
12
  options.context.userContext.originalDocumentStructure ??= [];
13
13
 
14
- const originalStructures = options.context.userContext.originalDocumentStructure;
14
+ const originalStructures = [...options.context.userContext.originalDocumentStructure];
15
15
 
16
16
  if (input.structures) {
17
17
  for (const item of input.structures) {
18
- const old = originalStructures.find((s) => s.path === item.path);
19
- if (old) {
20
- Object.assign(old, item);
18
+ const index = originalStructures.findIndex((s) => s.path === item.path);
19
+ if (index !== -1) {
20
+ originalStructures[index] = item;
21
21
  } else {
22
22
  originalStructures.push(item);
23
23
  }
@@ -6,7 +6,7 @@ export default async function checkNeedGenerate({ docsDir, locale, documentExecu
6
6
 
7
7
  if (mainLanguageFiles.length === 0) {
8
8
  console.log(
9
- `No documents found in the docs directory. Please run ${chalk.yellow("`aigne doc generate`")} to generate the documents`,
9
+ `No documents found in the docs directory. You can generate them with ${chalk.yellow("`aigne doc generate`")}`,
10
10
  );
11
11
  process.exit(0);
12
12
  }
@@ -11,16 +11,19 @@ export default async function checkGenerateDiagram(
11
11
  const generateAgent = options.context?.agents?.["generateDiagram"];
12
12
  let content = documentContent;
13
13
 
14
- try {
15
- const { diagramSourceCode } = await options.context.invoke(generateAgent, {
16
- documentContent,
17
- locale,
18
- });
19
- content = content.replace(placeholder, diagramSourceCode);
20
- } catch (error) {
21
- // FIXME: @zhanghan should regenerate document without diagram
22
- content = content.replace(placeholder, "");
23
- console.log(`⚠️ Skip generate any diagram: ${error.message}`);
14
+ if (content.includes(placeholder)) {
15
+ try {
16
+ const { diagramSourceCode } = await options.context.invoke(generateAgent, {
17
+ documentContent,
18
+ locale,
19
+ });
20
+ content = content.replace(placeholder, diagramSourceCode);
21
+ } catch (error) {
22
+ // FIXME: @zhanghan should regenerate document without diagram
23
+ content = content.replace(placeholder, "");
24
+ console.log(`⚠️ Skip generate any diagram: ${error.message}`);
25
+ }
24
26
  }
27
+
25
28
  return { content };
26
29
  }
@@ -6,6 +6,14 @@ import {
6
6
  getMainLanguageFiles,
7
7
  processSelectedFiles,
8
8
  } from "../../utils/docs-finder-utils.mjs";
9
+ import { DOC_ACTION } from "../../utils/constants/index.mjs";
10
+
11
+ function getFeedbackMessage(action) {
12
+ if (action === DOC_ACTION.translate) {
13
+ return "Any specific translation preferences or instructions? (Press Enter to skip):";
14
+ }
15
+ return "How would you like to improve this document? (Press Enter to skip)";
16
+ }
9
17
 
10
18
  export default async function chooseDocs(
11
19
  {
@@ -18,12 +26,13 @@ export default async function chooseDocs(
18
26
  locale,
19
27
  reset = false,
20
28
  requiredFeedback = true,
21
- title,
29
+ action,
22
30
  },
23
31
  options,
24
32
  ) {
25
33
  let foundItems = [];
26
34
  let selectedFiles = [];
35
+ const docAction = action || (isTranslate ? DOC_ACTION.translate : DOC_ACTION.update);
27
36
 
28
37
  // If docs is empty or not provided, let user select multiple documents
29
38
  if (!docs || docs.length === 0) {
@@ -37,7 +46,9 @@ export default async function chooseDocs(
37
46
 
38
47
  if (mainLanguageFiles.length === 0) {
39
48
  throw new Error(
40
- `No documents found in the docs directory. Please run ${chalk.yellow("`aigne doc generate`")} to generate the documents`,
49
+ `No documents found in the docs directory. You can generate them with ${chalk.yellow(
50
+ "`aigne doc generate`",
51
+ )}`,
41
52
  );
42
53
  }
43
54
 
@@ -66,7 +77,7 @@ export default async function chooseDocs(
66
77
 
67
78
  // Let user select multiple files
68
79
  selectedFiles = await options.prompts.checkbox({
69
- message: title || getActionText(isTranslate, "Select documents to {action}:"),
80
+ message: getActionText("Select documents to {action}:", docAction),
70
81
  source: (term) => {
71
82
  if (!term) return choices;
72
83
 
@@ -88,7 +99,7 @@ export default async function chooseDocs(
88
99
  foundItems = await processSelectedFiles(selectedFiles, documentExecutionStructure, docsDir);
89
100
  } catch (error) {
90
101
  console.log(
91
- getActionText(isTranslate, `\nFailed to select documents to {action}: ${error.message}`),
102
+ getActionText(`\nFailed to select documents to {action}: ${error.message}`, docAction),
92
103
  );
93
104
  process.exit(0);
94
105
  }
@@ -123,8 +134,7 @@ export default async function chooseDocs(
123
134
  // Prompt for feedback if not provided
124
135
  let userFeedback = feedback;
125
136
  if (!userFeedback && (requiredFeedback || foundItems?.length > 1)) {
126
- const feedbackMessage =
127
- "How should we improve this document? (Enter to skip, will auto-update from content sources):";
137
+ const feedbackMessage = getFeedbackMessage(docAction);
128
138
 
129
139
  userFeedback = await options.prompts.input({
130
140
  message: feedbackMessage,
@@ -1,3 +1,4 @@
1
+ import { DOC_ACTION } from "../../utils/constants/index.mjs";
1
2
  import {
2
3
  fileNameToFlatPath,
3
4
  findItemByFlatName,
@@ -14,6 +15,7 @@ export default async function findItemByPath(
14
15
  let foundItem = null;
15
16
  let selectedFileContent = null;
16
17
  let docPath = doc;
18
+ const docAction = isTranslate ? DOC_ACTION.translate : DOC_ACTION.update;
17
19
 
18
20
  // If docPath is empty, let user select from available documents
19
21
  if (!docPath) {
@@ -31,7 +33,7 @@ export default async function findItemByPath(
31
33
 
32
34
  // Let user select a file
33
35
  const selectedFile = await options.prompts.search({
34
- message: getActionText(isTranslate, "Select a document to {action}:"),
36
+ message: getActionText("Select a document to {action}:", docAction),
35
37
  source: async (input) => {
36
38
  if (!input || input.trim() === "") {
37
39
  return mainLanguageFiles.map((file) => ({
@@ -74,8 +76,8 @@ export default async function findItemByPath(
74
76
  console.debug(error?.message);
75
77
  throw new Error(
76
78
  getActionText(
77
- isTranslate,
78
79
  "Please run 'aigne doc generate' first to generate documents, then select which document to {action}",
80
+ docAction,
79
81
  ),
80
82
  );
81
83
  }
@@ -171,7 +171,7 @@ export default async function loadSources(
171
171
  if (dimensions.width < minImageWidth) {
172
172
  filteredImageCount++;
173
173
  console.log(
174
- `Filtered image: ${fileName} (${dimensions.width}x${dimensions.height}px < ${minImageWidth}px minimum)`,
174
+ `Ignored image: ${fileName} (${dimensions.width}x${dimensions.height}px < ${minImageWidth}px minimum)`,
175
175
  );
176
176
  return;
177
177
  }
@@ -1,5 +1,6 @@
1
1
  import { join } from "node:path";
2
2
  import fs from "fs-extra";
3
+ import { buildDocumentTree } from "../../utils/docs-finder-utils.mjs";
3
4
 
4
5
  export default async function saveSidebar({ documentStructure, docsDir }) {
5
6
  // Generate _sidebar.md
@@ -16,44 +17,22 @@ export default async function saveSidebar({ documentStructure, docsDir }) {
16
17
  }
17
18
 
18
19
  // Recursively generate sidebar text, the link path is the flattened file name
19
- function walk(node, parentSegments = [], indent = "") {
20
+ function walk(nodes, indent = "") {
20
21
  let out = "";
21
- for (const key of Object.keys(node)) {
22
- const item = node[key];
23
- const fullSegments = [...parentSegments, key];
24
- const flatFile = `${fullSegments.join("-")}.md`;
25
- if (item.__title) {
26
- const realIndent = item.__parentId === null ? "" : indent;
27
- out += `${realIndent}* [${item.__title}](/${flatFile})\n`;
28
- }
29
- const children = item.__children;
30
- if (Object.keys(children).length > 0) {
31
- out += walk(children, fullSegments, `${indent} `);
22
+ for (const node of nodes) {
23
+ const relPath = node.path.replace(/^\//, "");
24
+ const flatFile = `${relPath.split("/").join("-")}.md`;
25
+ const realIndent = node.parentId === null ? "" : indent;
26
+ out += `${realIndent}* [${node.title}](/${flatFile})\n`;
27
+
28
+ if (node.children && node.children.length > 0) {
29
+ out += walk(node.children, `${indent} `);
32
30
  }
33
31
  }
34
32
  return out;
35
33
  }
36
34
 
37
35
  function generateSidebar(documentStructure) {
38
- // Build tree structure
39
- const root = {};
40
- for (const { path, title, parentId } of documentStructure) {
41
- const relPath = path.replace(/^\//, "");
42
- const segments = relPath.split("/");
43
- let node = root;
44
- for (let i = 0; i < segments.length; i++) {
45
- const seg = segments[i];
46
- if (!node[seg])
47
- node[seg] = {
48
- __children: {},
49
- __title: null,
50
- __fullPath: segments.slice(0, i + 1).join("/"),
51
- __parentId: parentId,
52
- };
53
- if (i === segments.length - 1) node[seg].__title = title;
54
- node = node[seg].__children;
55
- }
56
- }
57
-
58
- return walk(root).replace(/\n+$/, "");
36
+ const { rootNodes } = buildDocumentTree(documentStructure);
37
+ return walk(rootNodes).replace(/\n+$/, "");
59
38
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aigne/doc-smith",
3
- "version": "0.8.15-beta.10",
3
+ "version": "0.8.15-beta.11",
4
4
  "description": "AI-driven documentation generation tool built on the AIGNE Framework",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -48,6 +48,7 @@
48
48
  "marked": "^15.0.12",
49
49
  "marked-terminal": "^7.3.0",
50
50
  "mermaid": "^11.9.0",
51
+ "minimatch": "^10.1.1",
51
52
  "open": "^10.2.0",
52
53
  "p-limit": "^7.1.1",
53
54
  "p-map": "^7.0.3",
@@ -1,7 +1,7 @@
1
1
  <data_sources>
2
2
  Following are the partial or complete data sources provided by the user to help you design the document structure. Use these data sources to inform your structural planning.
3
3
 
4
- {{ dataSources }}
4
+ {{ dataSourceChunk }}
5
5
 
6
6
 
7
7
  NOTICE: There are additional data source contents not displayed. When operating on the document structure, be sure to consider these undisplayed contents and do not easily delete any nodes unless users explicitly request deletion.
@@ -41,17 +41,22 @@ NOTICE: There are additional data source contents not displayed. When operating
41
41
  </openapi>
42
42
  {% endif %}
43
43
 
44
-
45
- <last_document_structure>
44
+ <document_info>
46
45
  projectName: |
47
46
  {{projectName}}
47
+ {% if projectDesc %}
48
48
  projectDesc: |
49
49
  {{projectDesc}}
50
+ {% endif %}
51
+ </document_info>
52
+
53
+ <last_document_structure>
50
54
 
51
55
  {% if originalDocumentStructure %}
52
56
  {{ originalDocumentStructure | yaml.stringify }}
53
57
  {% elseif userContext.originalDocumentStructure %}
54
58
  {{ userContext.originalDocumentStructure | yaml.stringify }}
59
+ {% else %}
55
60
  No previous document structure provided. generate a new structure based on the data sources!
56
61
  {% endif %}
57
62
 
@@ -5,8 +5,10 @@ You are a **Documentation Structure Refiner** with the analytical mindset of an
5
5
  <document_info>
6
6
  projectName: |
7
7
  {{projectName}}
8
+ {% if projectDesc %}
8
9
  projectDesc: |
9
10
  {{projectDesc}}
11
+ {% endif %}
10
12
  </document_info>
11
13
 
12
14
  <document_structure>
@@ -7,7 +7,7 @@
7
7
  </file_list>
8
8
 
9
9
  <data_sources>
10
- {{ dataSources }}
10
+ {{ dataSourceChunk }}
11
11
  </data_sources>
12
12
 
13
13
 
@@ -5,10 +5,10 @@ You are an **Elite Polyglot Localization and Translation Specialist** with exten
5
5
  Core Mandates:
6
6
 
7
7
  1. Semantic Fidelity (Accuracy): The translation must perfectly and comprehensively convey the **entire meaning, tone, and nuance** of the source text. **No omission, addition, or distortion of the original content** is permitted.
8
- 2. Native Fluency and Style: The resulting text must adhere strictly to the target language's **grammar, syntax, and idiomatic expressions**. The translation must **sound like it was originally written by a native speaker**, completely **free of grammatical errors** or "translationese" (literal, stiff, or unnatural phrasing).
8
+ 2. Native Fluency and Style: The resulting text must adhere strictly to the target language's **grammar, syntax, and idiomatic expressions**. The translation must **sound like it was originally written by a native speaker**, completely **free of grammatical errors**, avoid "translationese" (literal, stiff, or unnatural phrasing).
9
9
  3. Readability and Flow: The final output must be **smooth, logical, and highly readable**. Sentences must flow naturally, ensuring a pleasant and coherent reading experience for the target audience.
10
10
  4. Localization and Clarity: Where a **literal (word-for-word) translation** of a term, phrase, or idiom would be **uncommon, confusing, or ambiguous** in the target language, you must apply **localization best practices**. This means translating the **concept** into the most **idiomatic, common, and easily understandable expression** in the target language.
11
- 5. Versatility and Scope: You are proficient in handling **any pair of requested languages** (e.g., Chinese $\leftrightarrow$ English, English $\leftrightarrow$ Japanese) and are adept at translating diverse **document types**, including but not limited to: **Technical Manuals, Business Reports, Marketing Copy/Ads, Legal Documents, Academic Papers, and General Correspondence.**
11
+ 5. Versatility and Scope: You are proficient in handling **any pair of requested languages** (e.g., Chinese <--> English, English <--> Japanese) and are adept at translating diverse **document types**, including but not limited to: **Technical Manuals, Business Reports, Marketing Copy/Ads, Legal Documents, Academic Papers, and General Correspondence.**
12
12
 
13
13
  </role_and_goal>
14
14
 
@@ -549,3 +549,9 @@ export const DOC_SMITH_DIR = ".aigne/doc-smith";
549
549
  export const TMP_DIR = ".tmp";
550
550
  export const TMP_DOCS_DIR = "docs";
551
551
  export const TMP_ASSETS_DIR = "assets";
552
+
553
+ export const DOC_ACTION = {
554
+ translate: "translate",
555
+ update: "update",
556
+ clear: "clear",
557
+ };
@@ -4,12 +4,11 @@ import { pathExists } from "./file-utils.mjs";
4
4
 
5
5
  /**
6
6
  * Get action-specific text based on isTranslate flag
7
- * @param {boolean} isTranslate - Whether this is a translation action
8
7
  * @param {string} baseText - Base text template with {action} placeholder
8
+ * @param {string} action - doc action type
9
9
  * @returns {string} Text with action replaced
10
10
  */
11
- export function getActionText(isTranslate, baseText) {
12
- const action = isTranslate ? "translate" : "update";
11
+ export function getActionText(baseText, action) {
13
12
  return baseText.replace("{action}", action);
14
13
  }
15
14
 
@@ -324,3 +323,38 @@ export async function loadDocumentStructure(outputDir) {
324
323
  return null;
325
324
  }
326
325
  }
326
+
327
+ /**
328
+ * Build a tree structure from a flat document structure array using parentId
329
+ * @param {Array} documentStructure - Flat array of document structure items with path and parentId
330
+ * @returns {Object} Object containing rootNodes (array of root nodes) and nodeMap (Map for lookups)
331
+ */
332
+ export function buildDocumentTree(documentStructure) {
333
+ // Create a map of nodes for easy lookup
334
+ const nodeMap = new Map();
335
+ const rootNodes = [];
336
+
337
+ // First pass: create node map
338
+ documentStructure.forEach((node) => {
339
+ nodeMap.set(node.path, {
340
+ ...node,
341
+ children: [],
342
+ });
343
+ });
344
+
345
+ // Build the tree structure using parentId
346
+ documentStructure.forEach((node) => {
347
+ if (node.parentId) {
348
+ const parent = nodeMap.get(node.parentId);
349
+ if (parent) {
350
+ parent.children.push(nodeMap.get(node.path));
351
+ } else {
352
+ rootNodes.push(nodeMap.get(node.path));
353
+ }
354
+ } else {
355
+ rootNodes.push(nodeMap.get(node.path));
356
+ }
357
+ });
358
+
359
+ return { rootNodes, nodeMap };
360
+ }
@@ -13,6 +13,7 @@ import { debug } from "./debug.mjs";
13
13
  import { isGlobPattern } from "./utils.mjs";
14
14
  import { uploadFiles } from "./upload-files.mjs";
15
15
  import { extractApi } from "./extract-api.mjs";
16
+ import { minimatch } from "minimatch";
16
17
 
17
18
  /**
18
19
  * Check if a directory is inside a git repository using git command
@@ -859,3 +860,99 @@ export async function downloadAndUploadImage(imageUrl, docsDir, appUrl, accessTo
859
860
  return { url: imageUrl, downloadFinalPath: null };
860
861
  }
861
862
  }
863
+
864
+ /**
865
+ * Extract the path prefix from a glob pattern until the first glob character
866
+ */
867
+ export function getPathPrefix(pattern) {
868
+ const segments = pattern.split("/");
869
+ const result = [];
870
+
871
+ for (const segment of segments) {
872
+ if (isGlobPattern(segment)) {
873
+ break;
874
+ }
875
+ result.push(segment);
876
+ }
877
+
878
+ return result.join("/") || ".";
879
+ }
880
+
881
+ /**
882
+ * Check if a dir matches any exclude pattern
883
+ */
884
+ export function isDirExcluded(dir, excludePatterns) {
885
+ if (!dir || typeof dir !== "string") {
886
+ return false;
887
+ }
888
+
889
+ let normalizedDir = dir.replace(/\\/g, "/").replace(/^\.\/+/, "");
890
+ normalizedDir = normalizedDir.endsWith("/") ? normalizedDir : `${normalizedDir}/`;
891
+
892
+ for (const excludePattern of excludePatterns) {
893
+ if (minimatch(normalizedDir, excludePattern, { dot: true })) {
894
+ return true;
895
+ }
896
+ }
897
+
898
+ return false;
899
+ }
900
+
901
+ /**
902
+ * Return source paths that would be excluded by exclude patterns (files are skipped, directories use minimatch, glob patterns use path prefix heuristic)
903
+ */
904
+ export async function findInvalidSourcePaths(sourcePaths, excludePatterns) {
905
+ if (!Array.isArray(sourcePaths) || sourcePaths.length === 0) {
906
+ return [];
907
+ }
908
+
909
+ if (!Array.isArray(excludePatterns) || excludePatterns.length === 0) {
910
+ return [];
911
+ }
912
+
913
+ const invalidPaths = [];
914
+
915
+ for (const sourcePath of sourcePaths) {
916
+ if (typeof sourcePath !== "string" || !sourcePath) {
917
+ continue;
918
+ }
919
+
920
+ // Skip paths starting with "!" (exclusion patterns)
921
+ if (sourcePath.startsWith("!")) {
922
+ continue;
923
+ }
924
+
925
+ // Skip remote URLs
926
+ if (isRemoteFile(sourcePath)) {
927
+ continue;
928
+ }
929
+
930
+ // Check glob pattern: use heuristic algorithm
931
+ if (isGlobPattern(sourcePath)) {
932
+ const representativePath = getPathPrefix(sourcePath);
933
+ if (isDirExcluded(representativePath, excludePatterns)) {
934
+ invalidPaths.push(sourcePath);
935
+ }
936
+ continue;
937
+ }
938
+
939
+ try {
940
+ const stats = await stat(sourcePath);
941
+ // Skip file
942
+ if (stats.isFile()) {
943
+ continue;
944
+ }
945
+ // Check dir with minimatch
946
+ if (stats.isDirectory()) {
947
+ if (isDirExcluded(sourcePath, excludePatterns)) {
948
+ invalidPaths.push(sourcePath);
949
+ }
950
+ }
951
+ } catch {
952
+ // Path doesn't exist
953
+ invalidPaths.push(sourcePath);
954
+ }
955
+ }
956
+
957
+ return invalidPaths;
958
+ }
@@ -1,7 +1,10 @@
1
1
  import fs from "node:fs/promises";
2
+ import chalk from "chalk";
2
3
  import path from "node:path";
3
4
  import { parse } from "yaml";
4
5
  import { processConfigFields, resolveFileReferences } from "./utils.mjs";
6
+ import { DEFAULT_EXCLUDE_PATTERNS } from "./constants/index.mjs";
7
+ import { findInvalidSourcePaths, toDisplayPath } from "./file-utils.mjs";
5
8
 
6
9
  export default async function loadConfig({ config, appUrl }) {
7
10
  const configPath = path.isAbsolute(config) ? config : path.join(process.cwd(), config);
@@ -30,6 +33,22 @@ export default async function loadConfig({ config, appUrl }) {
30
33
  // Parse new configuration fields and convert keys to actual content
31
34
  const processedConfig = await processConfigFields(parsedConfig);
32
35
 
36
+ // Validate sourcePaths against exclude patterns
37
+ const sourcesPath = processedConfig.sourcesPath || parsedConfig.sourcesPath;
38
+ if (sourcesPath) {
39
+ const excludePatterns = [
40
+ ...DEFAULT_EXCLUDE_PATTERNS,
41
+ ...(processedConfig.excludePatterns || parsedConfig.excludePatterns || []),
42
+ ];
43
+
44
+ const invalidPaths = await findInvalidSourcePaths(sourcesPath, excludePatterns);
45
+ if (invalidPaths.length > 0) {
46
+ console.warn(
47
+ `⚠️ Some source paths have been excluded and will not be processed:\n${invalidPaths.map((p) => ` - ${chalk.yellow(p)}`).join("\n")}\n💡 Tip: You can remove these paths in ${toDisplayPath(configPath)}\n`,
48
+ );
49
+ }
50
+ }
51
+
33
52
  return {
34
53
  lastGitHead: parsedConfig.lastGitHead || "",
35
54
  ...parsedConfig,