Skip to content
Open
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
32 changes: 18 additions & 14 deletions .github/workflows/generate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,36 +76,36 @@ jobs:
fail-fast: false
matrix:
include:
- target: man-page
- target: '@node-core/doc-kit/generators/man-page'
input: './node/doc/api/cli.md'

- target: addon-verify
- target: '@node-core/doc-kit/generators/addon-verify'
input: './node/doc/api/addons.md'

- target: api-links
- target: '@node-core/doc-kit/generators/api-links'
input: './node/lib/*.js'
compare: object-assertion

- target: orama-db
- target: '@node-core/doc-kit/generators/orama-db'
input: './node/doc/api/*.md'
compare: file-size

- target: json-simple
- target: '@node-core/doc-kit/generators/json-simple'
input: './node/doc/api/*.md'

- target: legacy-json
- target: '@node-core/doc-kit/generators/legacy-json'
input: './node/doc/api/*.md'
compare: object-assertion

- target: legacy-html
- target: '@node-core/doc-kit/generators/legacy-html'
input: './node/doc/api/*.md'
compare: file-size

- target: web
- target: '@node-core/doc-kit/generators/web'
input: './node/doc/api/*.md'
compare: file-size

- target: llms-txt
- target: '@node-core/doc-kit/generators/llms-txt'
input: './node/doc/api/*.md'
compare: file-size
steps:
Expand Down Expand Up @@ -140,10 +140,14 @@ jobs:
- name: Install dependencies
run: npm ci

- name: Get generator name
id: generator
run: echo "name=$(node -e "import('${{ matrix.target }}').then(m => console.log(m.name))")" >> "$GITHUB_OUTPUT"

- name: Create output directory
run: mkdir -p out/${{ matrix.target }}
run: mkdir -p out/${{ steps.generator.outputs.name }}

- name: Generate ${{ matrix.target }}
- name: Generate ${{ steps.generator.outputs.name }}
run: |
node packages/core/bin/cli.mjs generate \
-t ${{ matrix.target }} \
Expand All @@ -157,7 +161,7 @@ jobs:
if: ${{ matrix.compare && needs.prepare.outputs.base-run }}
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: ${{ matrix.target }}
name: ${{ steps.generator.outputs.name }}
path: base
run-id: ${{ needs.prepare.outputs.base-run }}
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -169,8 +173,8 @@ jobs:
run: |
node scripts/comparators/${{ matrix.compare }}.mjs > out/comparison.txt

- name: Upload ${{ matrix.target }} artifacts
- name: Upload ${{ steps.generator.outputs.name }} artifacts
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: ${{ matrix.target }}
name: ${{ steps.generator.outputs.name }}
path: out
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ The steps below will give you a general idea of how to prepare your local enviro
For fast iteration during development, target a single Markdown file instead of all API docs:

```bash
node bin/cli.mjs generate \
node packages/core/bin/cli.mjs generate \
-t legacy-html \
-i ../node/doc/api/fs.md \
-o out \
Expand All @@ -110,7 +110,7 @@ The steps below will give you a general idea of how to prepare your local enviro
Add `--log-level debug` before the `generate` subcommand to see the full pipeline trace:

```bash
node bin/cli.mjs --log-level debug generate -t legacy-html -i ../node/doc/api/fs.md -o out
node packages/core/bin/cli.mjs --log-level debug generate -t legacy-html -i ../node/doc/api/fs.md -o out
```

> [!TIP]
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Options:
-v, --version <semver> Target Node.js version (default: "v22.14.0")
-c, --changelog <url> Changelog URL or path (default: "https://raw.githubusercontent.com/nodejs/node/HEAD/CHANGELOG.md")
--git-ref <url> Git ref/commit URL (default: "https://github.com/nodejs/node/tree/HEAD")
-t, --target [modes...] Target generator modes (choices: "json-simple", "legacy-html", "legacy-html-all", "man-page", "legacy-json", "legacy-json-all", "addon-verify", "api-links", "orama-db", "llms-txt")
-t, --target <generator...> Target generator(s) (e.g. @node-core/doc-kit/generators/web)
-h, --help display help for command
```

Expand All @@ -91,8 +91,8 @@ To generate a 1:1 match with the [legacy tooling](https://github.com/nodejs/node

```sh
npx doc-kit generate \
-t legacy-html \
-t legacy-json \
-t @node-core/doc-kit/generators/legacy-html \
-t @node-core/doc-kit/generators/legacy-json \
-i "path/to/node/doc/api/*.md" \
-o out \
--index path/to/node/doc/api/index.md
Expand All @@ -104,8 +104,8 @@ To generate [our redesigned documentation pages](https://nodejs-api-docs-tooling

```sh
npx doc-kit generate \
-t web \
-t orama-db \
-t @node-core/doc-kit/generators/web \
-t @node-core/doc-kit/generators/orama-db \
-i "path/to/node/doc/api/*.md" \
-o out \
--index path/to/node/doc/api/index.md
Expand Down
2 changes: 1 addition & 1 deletion docs/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export default [

### Step 3: Update CLI Entry Point

The CLI in `bin/cli.mjs` automatically loads commands from `bin/commands/index.mjs`, so no changes are needed there if you followed step 2.
The CLI in `packages/core/bin/cli.mjs` automatically loads commands from `bin/commands/index.mjs`, so no changes are needed there if you followed step 2.

## Command Options

Expand Down
28 changes: 14 additions & 14 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,17 +100,17 @@ Configurations are merged in the following order (earlier sources take precedenc

CLI options map to configuration properties:

| CLI Option | Config Property | Example |
| ---------------------- | ------------------ | ------------------------- |
| `--input <path>` | `global.input` | `--input src/` |
| `--output <path>` | `global.output` | `--output dist/` |
| `--ignore <pattern>` | `global.ignore[]` | `--ignore test/` |
| `--minify` | `global.minify` | `--minify` |
| `--git-ref <ref>` | `global.ref` | `--git-ref v20.0.0` |
| `--version <version>` | `global.version` | `--version 20.0.0` |
| `--changelog <url>` | `global.changelog` | `--changelog https://...` |
| `--index <url>` | `global.index` | `--index file://...` |
| `--type-map <map>` | `metadata.typeMap` | `--type-map file://...` |
| `--target <generator>` | `target` | `--target json` |
| `--threads <n>` | `threads` | `--threads 4` |
| `--chunk-size <n>` | `chunkSize` | `--chunk-size 10` |
| CLI Option | Config Property | Example |
| ---------------------- | ------------------ | ---------------------------------------------------- |
| `--input <path>` | `global.input` | `--input src/` |
| `--output <path>` | `global.output` | `--output dist/` |
| `--ignore <pattern>` | `global.ignore[]` | `--ignore test/` |
| `--minify` | `global.minify` | `--minify` |
| `--git-ref <ref>` | `global.ref` | `--git-ref v20.0.0` |
| `--version <version>` | `global.version` | `--version 20.0.0` |
| `--changelog <url>` | `global.changelog` | `--changelog https://...` |
| `--index <url>` | `global.index` | `--index file://...` |
| `--type-map <map>` | `metadata.typeMap` | `--type-map file://...` |
| `--target <generator>` | `target` | `--target @node-core/doc-kit/generators/legacy-json` |
| `--threads <n>` | `threads` | `--threads 4` |
| `--chunk-size <n>` | `chunkSize` | `--chunk-size 10` |
Loading