update package ent command and docfy readme (#27565)

This commit is contained in:
claire bontempo
2024-06-21 11:45:24 -07:00
committed by GitHub
parent 6f00ce45d2
commit 7187b6f2c3
4 changed files with 11 additions and 2 deletions

View File

@@ -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>
@@ -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_

View File

@@ -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'",

View File

@@ -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');

View File

@@ -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)