The integration of the ai/ directory into the JSDoc generation process introduced non-class modules (e.g., ai/examples) into the Docs app navigation tree. These items, lacking proper class definitions, caused the Docs app to crash or display empty pages because they often resulted in srcPath: null in the generated structure.json.
Goal
Refine the buildScripts/docs/jsdocx.mjs script to filter out these invalid items and ensure a clean navigation tree.
Implementation Details
- Filter Invalid Leaves: Modify
jsdocx.mjs to exclude leaf nodes from neoStructure where srcPath is null. This effectively removes items that jsdocx could not resolve to a valid source file path for the Docs app (e.g., scripts in ai/examples).
- Prune Empty Folders: Implement a recursive pruning logic to remove directory nodes that become empty after their children are filtered out. This ensures the navigation tree doesn't contain empty folders like
ai.examples.
- Preserve Roots: Ensure that top-level structure (like
src and apps) is preserved if valid content exists.
Verification
- Confirm that
docs/output/structure.json no longer contains items like Neo.ai.examples.benchmark_scientific.
- Confirm that valid classes like
Neo.ai.mcp.server.github-workflow.Server are still present.
- Verify the Docs app loads without errors when navigating the tree.
The integration of the
ai/directory into the JSDoc generation process introduced non-class modules (e.g.,ai/examples) into the Docs app navigation tree. These items, lacking proper class definitions, caused the Docs app to crash or display empty pages because they often resulted insrcPath: nullin the generatedstructure.json.Goal
Refine the
buildScripts/docs/jsdocx.mjsscript to filter out these invalid items and ensure a clean navigation tree.Implementation Details
jsdocx.mjsto exclude leaf nodes fromneoStructurewheresrcPathisnull. This effectively removes items thatjsdocxcould not resolve to a valid source file path for the Docs app (e.g., scripts inai/examples).ai.examples.srcandapps) is preserved if valid content exists.Verification
docs/output/structure.jsonno longer contains items likeNeo.ai.examples.benchmark_scientific.Neo.ai.mcp.server.github-workflow.Serverare still present.