Building your docmap
To build your docmap, the easiest wait is to use the sugar
CLI like so:
Make sure to launch this command in your project root directory.
Sources
The docmap builder will search for all your project dependencies that have themselves a docmap.json
file at their root, and it will search inside your project for files that have 1 or more docblock(s) with a @namespace ...
tag.
This @namespace
tag is required as the builder uses it to store the item under the good namespace.
As you may doubt, the builder will not take a look inside the node_modules
directory to search for files with the @namespace
tag. This would be way to slow and not requested. In fact, the builder will take a look in your files using these glob patterns:
*
src/!(css)/*{0,4}/*.+(txt|htm|html|md|json|csv|rss|xhtml|asp|c|cgi|cfm|pl|class|cpp|cs|h|java|php|py|sh|swift|vb|js|jsp|jsx|css|ts|tsx|rs|dart|twig)
dist/+(css)/*
Here's are the excluded folders:
**/__tests__/**/*
**/__tests__.wip/**/*
**/__wip__/**/*
If you need to update or add some globs to search in, simply create a file under .sugar/docmap.config.ts
and fill it like so:
Output
By default, the build command will generate a docmap.json
file in your project root folder. We recommend you to keep this like that but if you want to update the output location, you can do so by updating the config.docmap.build.outPath
configuration.