diff --git a/ui/docs/how-to-docfy.md b/ui/docs/how-to-docfy.md index 644cfed706..50871acf8c 100644 --- a/ui/docs/how-to-docfy.md +++ b/ui/docs/how-to-docfy.md @@ -13,7 +13,9 @@ Side nav links correspond to the file + directory structure within the `docs/` d ## generating component docs -The `docs/components` directory is where _generated_ markdown files for components live after running `yarn docs`. **Do not edit component markdown files directly**. Instead, update markdown by making changes to the `jsdoc` and then re-running the generate command. The `docs/components/*` files are included in `.gitignore` so they are not pushed to main. `jsdoc-to-markdown` errors log in the console. +The `docs/components` directory is where _generated_ component markdown files are located after running `yarn docs`. **Do not edit component markdown files directly**. Instead, update markdown by making changes to the `jsdoc` and then re-running the generate command. The `docs/components/*` files are included in `.gitignore` so they are not pushed to main. `jsdoc-to-markdown` errors log in the console. + +> _If you have never run the `yarn docs` command before, you need to create the `docs/components` directory locally before running `yarn docfy-md` so the markdown has a place to go. `mkdir docs/components`_ ``` yarn docfy-md @@ -24,9 +26,10 @@ yarn docfy-md | Command | Description | | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | | `yarn docs` | generate markdown file for every\* component in the `addon/core` directory | -| `yarn docfy-md some-component-name` | generate markdown file for specific component | +| `yarn docfy-md some-component-name` | generate markdown file for **specific** component | | `yarn docfy-md read-more core` | generate markdown for `read-more` component in the `core` addon | | `yarn docfy-md pki-test null ./lib/pki/addon/components/pki-key-usage.ts` | optional third arg is the full component filepath (first arg will become markdown file name) | +| `mkdir docs/components` | create directory where the generated component markdown files will go | | `rm -f ./docs/components/*` | cleanup and delete generated component markdown files | > _\*replication and `shamir/*` components are skipped as these are not reused and should eventually be moved outside the `addon/core` directory_ diff --git a/ui/package.json b/ui/package.json index 35c1619db5..0377d0a7b6 100644 --- a/ui/package.json +++ b/ui/package.json @@ -32,6 +32,7 @@ "test": "concurrently --kill-others-on-fail -P -c \"auto\" -n lint:js,lint:hbs,vault \"yarn:lint:js:quiet\" \"yarn:lint:hbs:quiet\" \"node scripts/start-vault.js {@}\" --", "test:enos": "concurrently --kill-others-on-fail -P -c \"auto\" -n lint:js,lint:hbs,enos \"yarn:lint:js:quiet\" \"yarn:lint:hbs:quiet\" \"node scripts/enos-test-ember.js {@}\" --", "test:oss": "yarn run test -f='!enterprise' --split=8 --preserve-test-name --parallel", + "test:ent": "node scripts/start-vault.js -f='enterprise'", "test:quick": "node scripts/start-vault.js --split=8 --preserve-test-name --parallel", "test:quick-oss": "node scripts/start-vault.js -f='!enterprise' --split=8 --preserve-test-name --parallel", "test:filter": "node scripts/start-vault.js --server -f='!enterprise'", diff --git a/ui/scripts/docfy-md.js b/ui/scripts/docfy-md.js index a3f126cd6c..35758f6a11 100644 --- a/ui/scripts/docfy-md.js +++ b/ui/scripts/docfy-md.js @@ -13,6 +13,8 @@ yarn docfy-md some-component or if the docs are for a component in an in-repo-addon or an engine: yarn docfy-md some-component name-of-engine + +see the readme ui/docs/how-to-docfy.md for more info */ const fs = require('fs'); diff --git a/ui/scripts/generate-docs.sh b/ui/scripts/generate-docs.sh index d1be67c3df..268a9ad9e0 100644 --- a/ui/scripts/generate-docs.sh +++ b/ui/scripts/generate-docs.sh @@ -2,6 +2,9 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 +echo "Create components/ directory" +mkdir docs/components/ + echo "Generating markdown files for components in core addon..." # iterate over every .ts and .js file in core/addon/components (including nested files)