Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add command to run enterprise tests and update docfy readme #27565

Merged
merged 1 commit into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions ui/docs/how-to-docfy.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <component name> <addon or engine> <full filepath>
Expand All @@ -24,9 +26,10 @@ yarn docfy-md <component name> <addon or engine> <full filepath>
| 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_
Expand Down
1 change: 1 addition & 0 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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'",
Expand Down
2 changes: 2 additions & 0 deletions ui/scripts/docfy-md.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
3 changes: 3 additions & 0 deletions ui/scripts/generate-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading