node-scripts-docs
Advanced tools
Comparing version
@@ -22,2 +22,3 @@ #!/usr/bin/env node | ||
console.info(`Working directory: ${rootDirectory}`); | ||
const withLocalScripts = Boolean(argv["include-locals"]) ?? false; | ||
const manifestPath = path_1.default.resolve(rootDirectory, "package.json"); | ||
@@ -71,3 +72,3 @@ const manifestExists = await ScriptScanner_1.ScriptScanner.canLoad(manifestPath); | ||
const validator = new Validator_1.Validator(scriptStore ?? new ScriptStore_1.ScriptStore(rootDirectory), scriptStoreFromScan, fragmentStore ?? new FragmentStore_1.FragmentStore(fragmentStorePath)); | ||
const report = validator.generateReport(); | ||
const report = validator.generateReport(withLocalScripts); | ||
if (0 < report.missingFragments.size) { | ||
@@ -128,5 +129,4 @@ console.info(` --- Missing fragments (will be generated) --- `); | ||
} | ||
const withLocalScripts = Boolean(argv["include-locals"]) ?? false; | ||
const renderer = new DocumentationRenderer_1.DocumentationRenderer(metadata); | ||
await renderer.renderFragments(fragmentStorePath); | ||
await renderer.renderFragments(fragmentStorePath, withLocalScripts); | ||
const documentation = renderer.render(withLocalScripts); | ||
@@ -133,0 +133,0 @@ const indexFile = path_1.default.resolve(fragmentStorePath, "index.md"); |
{ | ||
"name": "node-scripts-docs", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"bin": { | ||
@@ -10,3 +10,5 @@ "nsd": "output/node-scripts-docs.js" | ||
"docs:build": "docker run --rm -it -p 8000:8000 -v ${PWD}:/docs squidfunk/mkdocs-material build --site-dir=public", | ||
"docs:scripts": "yarn nsd-debug --include-locals", | ||
"docs:serve": "docker run --rm -it -p 8000:8000 -v ${PWD}:/docs squidfunk/mkdocs-material", | ||
"npm:publish": "yarn build && npm publish", | ||
"nsd-debug": "yarn build && node output/node-scripts-docs.js" | ||
@@ -16,3 +18,3 @@ }, | ||
"elapsed-time": "0.0.1", | ||
"globby": "11", | ||
"globby": "11.1.0", | ||
"marked": "4.0.10", | ||
@@ -23,6 +25,6 @@ "minimist": "1.2.5", | ||
"devDependencies": { | ||
"@types/marked": "^4", | ||
"@types/marked": "4.0.1", | ||
"@types/minimist": "1.2.2", | ||
"@types/node": "17.0.10", | ||
"@types/prettier": "^2", | ||
"@types/prettier": "2.4.3", | ||
"@types/prettier-package-json": "2.1.1", | ||
@@ -29,0 +31,0 @@ "@yarnpkg/sdks": "2.5.0", |
# node-scripts-docs | ||
## Quick Start | ||
This is a yarn [Zero-Install](https://yarnpkg.com/features/zero-installs) repository. After cloning it, you should be ready to use the code. Just in case some dependencies need to be rebuilt, run an install: | ||
```shell | ||
yarn install | ||
``` | ||
You can now run `node-scripts-docs` from the shell through `yarn`: | ||
```shell | ||
yarn nsd --check-only | ||
``` | ||
To run `nsd` on another project, you can simply pass the directory as an unlabeled argument: | ||
```shell | ||
yarn nsd ~/projects/myrepo --check-only | ||
``` | ||
Drop the `--check-only` to write the initial documentation scaffold. Then begin editing the descriptions in the generated documentation fragments right away. | ||
Whenever you've added scripts, removed scripts, updated documentation fragments, just run `yarn nsd` again to update the documentation. | ||
Refer to full documentation at https://oliversalzburg.github.io/node-scripts-docs/ |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
-100%54795
-0.99%4
-84.62%Updated