diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 51de2fb14..ab0d0176a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -127,12 +127,18 @@ comparators](docs/contributing/comparators.md) — live under The three flags `-i` (input), `-t` (target generator), and `-o` (output directory) are effectively required. Without them the tool either crashes or silently does nothing. -3. **View the generated output** +3. **Preview the generated output** ```bash - npx serve out + node packages/cli/bin/cli.mjs preview ``` + `preview` serves the existing output directory (`./out` by default) at + `http://localhost:3000`. Passing any `generate` option makes it build + first — for example, the command in step 2 with `generate` swapped for + `preview` rebuilds and then serves. It doesn't watch for changes, so run + it again after editing. + 4. **Use debug logging** Add `--log-level debug` before the `generate` subcommand to see the full pipeline trace: diff --git a/docs/contributing/commands.md b/docs/contributing/commands.md index 22b6770e5..8209599d5 100644 --- a/docs/contributing/commands.md +++ b/docs/contributing/commands.md @@ -104,7 +104,9 @@ either side of the command name (`doc-kit --log-level debug my-command` or testing in `@doc-kit/core`, with its tests in a `__tests__` directory next to it. - **Document it** with a section on the [CLI page](../cli.md) (`docs/cli.md`), - using the same option-list format as the existing commands, and in + using the same option-list format as the existing commands; with a + `### ` section in the root `README.md`, showing the example + invocation followed by the command's full `--help` output; and in `packages/cli/README.md` if it changes how people use the package. If it adds a flag that sets configuration, name the key it sets, as the `generate` options do.