Skip to content

Commit 6def80a

Browse files
authored
feat(monorepo): implement orchestrator (#731)
* feat(monorepo): basic monorepo * feat(monorepo): implement orchestrator * rebase fixes
1 parent 72b3de6 commit 6def80a

57 files changed

Lines changed: 1453 additions & 1906 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/generate.yml

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -76,36 +76,36 @@ jobs:
7676
fail-fast: false
7777
matrix:
7878
include:
79-
- target: man-page
79+
- target: '@node-core/doc-kit/generators/man-page'
8080
input: './node/doc/api/cli.md'
8181

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

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

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

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

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

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

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

108-
- target: llms-txt
108+
- target: '@node-core/doc-kit/generators/llms-txt'
109109
input: './node/doc/api/*.md'
110110
compare: file-size
111111
steps:
@@ -140,10 +140,14 @@ jobs:
140140
- name: Install dependencies
141141
run: npm ci
142142

143+
- name: Get generator name
144+
id: generator
145+
run: echo "name=$(node -e "import('${{ matrix.target }}').then(m => console.log(m.name))")" >> "$GITHUB_OUTPUT"
146+
143147
- name: Create output directory
144-
run: mkdir -p out/${{ matrix.target }}
148+
run: mkdir -p out/${{ steps.generator.outputs.name }}
145149

146-
- name: Generate ${{ matrix.target }}
150+
- name: Generate ${{ steps.generator.outputs.name }}
147151
run: |
148152
node packages/core/bin/cli.mjs generate \
149153
-t ${{ matrix.target }} \
@@ -157,7 +161,7 @@ jobs:
157161
if: ${{ matrix.compare && needs.prepare.outputs.base-run }}
158162
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
159163
with:
160-
name: ${{ matrix.target }}
164+
name: ${{ steps.generator.outputs.name }}
161165
path: base
162166
run-id: ${{ needs.prepare.outputs.base-run }}
163167
github-token: ${{ secrets.GITHUB_TOKEN }}
@@ -169,8 +173,8 @@ jobs:
169173
run: |
170174
node scripts/comparators/${{ matrix.compare }}.mjs > out/comparison.txt
171175
172-
- name: Upload ${{ matrix.target }} artifacts
176+
- name: Upload ${{ steps.generator.outputs.name }} artifacts
173177
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
174178
with:
175-
name: ${{ matrix.target }}
179+
name: ${{ steps.generator.outputs.name }}
176180
path: out

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ The steps below will give you a general idea of how to prepare your local enviro
8989
For fast iteration during development, target a single Markdown file instead of all API docs:
9090

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

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

116116
> [!TIP]

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Options:
6868
-v, --version <semver> Target Node.js version (default: "v22.14.0")
6969
-c, --changelog <url> Changelog URL or path (default: "https://raw.githubusercontent.com/nodejs/node/HEAD/CHANGELOG.md")
7070
--git-ref <url> Git ref/commit URL (default: "https://github.com/nodejs/node/tree/HEAD")
71-
-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")
71+
-t, --target <generator...> Target generator(s) (e.g. @node-core/doc-kit/generators/web)
7272
-h, --help display help for command
7373
```
7474

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

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

105105
```sh
106106
npx doc-kit generate \
107-
-t web \
108-
-t orama-db \
107+
-t @node-core/doc-kit/generators/web \
108+
-t @node-core/doc-kit/generators/orama-db \
109109
-i "path/to/node/doc/api/*.md" \
110110
-o out \
111111
--index path/to/node/doc/api/index.md

docs/commands.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export default [
6969

7070
### Step 3: Update CLI Entry Point
7171

72-
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.
72+
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.
7373

7474
## Command Options
7575

docs/configuration.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -100,17 +100,17 @@ Configurations are merged in the following order (earlier sources take precedenc
100100

101101
CLI options map to configuration properties:
102102

103-
| CLI Option | Config Property | Example |
104-
| ---------------------- | ------------------ | ------------------------- |
105-
| `--input <path>` | `global.input` | `--input src/` |
106-
| `--output <path>` | `global.output` | `--output dist/` |
107-
| `--ignore <pattern>` | `global.ignore[]` | `--ignore test/` |
108-
| `--minify` | `global.minify` | `--minify` |
109-
| `--git-ref <ref>` | `global.ref` | `--git-ref v20.0.0` |
110-
| `--version <version>` | `global.version` | `--version 20.0.0` |
111-
| `--changelog <url>` | `global.changelog` | `--changelog https://...` |
112-
| `--index <url>` | `global.index` | `--index file://...` |
113-
| `--type-map <map>` | `metadata.typeMap` | `--type-map file://...` |
114-
| `--target <generator>` | `target` | `--target json` |
115-
| `--threads <n>` | `threads` | `--threads 4` |
116-
| `--chunk-size <n>` | `chunkSize` | `--chunk-size 10` |
103+
| CLI Option | Config Property | Example |
104+
| ---------------------- | ------------------ | ---------------------------------------------------- |
105+
| `--input <path>` | `global.input` | `--input src/` |
106+
| `--output <path>` | `global.output` | `--output dist/` |
107+
| `--ignore <pattern>` | `global.ignore[]` | `--ignore test/` |
108+
| `--minify` | `global.minify` | `--minify` |
109+
| `--git-ref <ref>` | `global.ref` | `--git-ref v20.0.0` |
110+
| `--version <version>` | `global.version` | `--version 20.0.0` |
111+
| `--changelog <url>` | `global.changelog` | `--changelog https://...` |
112+
| `--index <url>` | `global.index` | `--index file://...` |
113+
| `--type-map <map>` | `metadata.typeMap` | `--type-map file://...` |
114+
| `--target <generator>` | `target` | `--target @node-core/doc-kit/generators/legacy-json` |
115+
| `--threads <n>` | `threads` | `--threads 4` |
116+
| `--chunk-size <n>` | `chunkSize` | `--chunk-size 10` |

0 commit comments

Comments
 (0)