Skip to content

docs(fern): add local library autodocs without Fern auth#2102

Open
lbliii wants to merge 2 commits into
mainfrom
lbliii/test-fern-unauth-docs
Open

docs(fern): add local library autodocs without Fern auth#2102
lbliii wants to merge 2 commits into
mainfrom
lbliii/test-fern-unauth-docs

Conversation

@lbliii

@lbliii lbliii commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Description

Adds a nemo-curator-local path-based library entry so contributors can run npm run generate:library:local (Fern --local) without Fern login, using Docker to parse ../nemo_curator locally. CI and publish/preview workflows are pinned to --library nemo-curator so the git-based remote generation path is unchanged. Also bumps the Fern CLI pin to 5.50.4 and documents both flows in fern/README.md, fern/AUTODOCS_GUIDE.md, and the docs agent skill.

Usage

cd fern
npm run generate:library:local   # no Fern auth; requires Docker
npm run generate:library         # full reference via git; needs fern login or FERN_TOKEN

Checklist

  • I am familiar with the Contributing Guide.
  • New or Existing tests cover these changes.
  • The documentation is up to date with these changes.

Made with Cursor

Add a nemo-curator-local path-based library entry for Docker-based
generation via --local, pin CI to the git-based nemo-curator library,
and bump the Fern CLI pin to 5.50.4.

Signed-off-by: Lawrence Lane <llane@nvidia.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@lbliii lbliii requested review from a team as code owners June 22, 2026 19:10
@lbliii lbliii requested review from ayushdg and removed request for a team June 22, 2026 19:10
@copy-pr-bot

copy-pr-bot Bot commented Jun 22, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Pin docs-generate-library to the git-based nemo-curator entry and add
docs-generate-library-local for unauthenticated Docker-based generation.

Signed-off-by: Lawrence Lane <llane@nvidia.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@greptile-apps

greptile-apps Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR introduces a nemo-curator-local library entry in fern/docs.yml (using input.path: ../nemo_curator) so contributors can generate the Python API reference locally via Docker without Fern authentication, while keeping CI and preview/publish workflows pinned to the git-based nemo-curator entry. The Fern CLI pin in fern.config.json is also bumped from 5.29.0 to 5.50.4, and documentation is updated across README.md, AUTODOCS_GUIDE.md, and the docs agent skill.

  • Two library entries, one output folder: Both nemo-curator and nemo-curator-local write to product-docs/nemo-curator/Full-Library-Reference/ (gitignored). The local Docker parser is explicitly documented as a beta subset (~fewer pages) and should not be confused with the full reference produced by CI.
  • CI workflows correctly scoped: Both publish-fern-docs.yml and fern-docs-preview-comment.yml now explicitly pass --library nemo-curator, preventing the path-based entry from being invoked in the cloud context.
  • fern generate --docs step is unguarded: The final publish/preview command has no --library filter; whether Fern re-processes the libraries: block during this step (and what it does with input.path entries when --local is absent) should be verified.

Confidence Score: 4/5

Safe to merge for the documentation and dev-workflow changes; the one unverified path is whether fern generate --docs silently skips or errors on the nemo-curator-local entry.

The changes are well-scoped docs and tooling additions. The explicit --library nemo-curator pinning in both CI workflows is the right call. The main open question is how fern generate --docs behaves when two library entries are present and only one has been pre-generated — that step is unfiltered in both the publish and preview workflows, and if Fern re-invokes library generation there, the input.path entry could fail.

fern/docs.yml (dual-entry shared output) and .github/workflows/publish-fern-docs.yml (unguarded fern generate --docs step).

Important Files Changed

Filename Overview
fern/docs.yml Adds nemo-curator-local library entry with input.path: ../nemo_curator and the same output path as nemo-curator; both entries share ./product-docs/nemo-curator/Full-Library-Reference.
fern/package.json Adds generate:library:local script using npx -y fern-api@latest, consistent with all other scripts; pins generate:library to --library nemo-curator.
fern/fern.config.json Bumps Fern CLI pin from 5.29.0 to 5.50.4; note that npm scripts use @latest rather than this pinned version.
.github/workflows/publish-fern-docs.yml Correctly scopes library generation to --library nemo-curator, preventing accidental invocation of the nemo-curator-local path-based entry during publish.
.github/workflows/fern-docs-preview-comment.yml Same --library nemo-curator pin as publish workflow; CI isolation remains intact.
Makefile Adds docs-generate-library-local target and corresponding .PHONY entry; both targets are symmetric and correct.
.claude/skills/nemo-curator-docs/SKILL.md Documents both library entries and their trade-offs (page count, auth requirements) clearly.
fern/README.md Adds 'Library reference without Fern login' section; troubleshooting entry updated with the local alternative.
fern/AUTODOCS_GUIDE.md Extends the generation section with the --local --library nemo-curator-local command; accurate and concise.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    subgraph LocalDev["Local Development (no auth)"]
        A["npm run generate:library:local"] --> B["fern docs md generate --local --library nemo-curator-local"]
        B --> C["Docker: fernapi/fern-python-library-docs-parser"]
        C --> D["input.path: ../nemo_curator"]
        D --> E["Output: Full-Library-Reference/ (fewer pages, beta)"]
    end

    subgraph FullLocal["Local Full Reference (auth required)"]
        F["npm run generate:library"] --> G["fern docs md generate --library nemo-curator"]
        G --> H["Cloud Fern parser (FERN_TOKEN)"]
        H --> I["input.git: github.com/NVIDIA-NeMo/Curator"]
        I --> J["Output: Full-Library-Reference/ (424 pages)"]
    end

    subgraph CI["CI / Publish Workflows"]
        K["Push docs/v* tag OR PR"] --> L["fern docs md generate --library nemo-curator"]
        L --> M["Cloud Fern parser (DOCS_FERN_TOKEN secret)"]
        M --> N["input.git: github.com/NVIDIA-NeMo/Curator"]
        N --> O["Output: Full-Library-Reference/"]
        O --> P["fern generate --docs / --preview"]
        P --> Q["Published or Preview site"]
    end

    E -.->|same gitignored folder| O
    J -.->|same gitignored folder| O
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    subgraph LocalDev["Local Development (no auth)"]
        A["npm run generate:library:local"] --> B["fern docs md generate --local --library nemo-curator-local"]
        B --> C["Docker: fernapi/fern-python-library-docs-parser"]
        C --> D["input.path: ../nemo_curator"]
        D --> E["Output: Full-Library-Reference/ (fewer pages, beta)"]
    end

    subgraph FullLocal["Local Full Reference (auth required)"]
        F["npm run generate:library"] --> G["fern docs md generate --library nemo-curator"]
        G --> H["Cloud Fern parser (FERN_TOKEN)"]
        H --> I["input.git: github.com/NVIDIA-NeMo/Curator"]
        I --> J["Output: Full-Library-Reference/ (424 pages)"]
    end

    subgraph CI["CI / Publish Workflows"]
        K["Push docs/v* tag OR PR"] --> L["fern docs md generate --library nemo-curator"]
        L --> M["Cloud Fern parser (DOCS_FERN_TOKEN secret)"]
        M --> N["input.git: github.com/NVIDIA-NeMo/Curator"]
        N --> O["Output: Full-Library-Reference/"]
        O --> P["fern generate --docs / --preview"]
        P --> Q["Published or Preview site"]
    end

    E -.->|same gitignored folder| O
    J -.->|same gitignored folder| O
Loading

Comments Outside Diff (1)

  1. .github/workflows/publish-fern-docs.yml, line 59-63 (link)

    P2 fern generate --docs has no library filter — verify it skips the libraries: block

    The preceding step explicitly filters to --library nemo-curator, but the fern generate --docs publish step has no such flag. If Fern's publish command internally re-processes every entry in the libraries: block, it will encounter nemo-curator-local with input.path: ../nemo_curator. Without the --local Docker flag, Fern would attempt cloud-based generation against a local filesystem path, which is likely to fail and break the publish job. The same concern applies to the preview workflow. Worth a quick manual confirm (or a CI run) that fern generate --docs only consumes pre-generated MDX and does not re-invoke library generation.

Reviews (1): Last reviewed commit: "docs(fern): align Makefile library gener..." | Re-trigger Greptile

Comment thread fern/docs.yml
Comment on lines +186 to +191
nemo-curator-local:
input:
path: ../nemo_curator
output:
path: ./product-docs/nemo-curator/Full-Library-Reference
lang: python

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Shared output path produces silently smaller reference on local machines

Both nemo-curator and nemo-curator-local write to the same Full-Library-Reference/ directory. Running generate:library:local after generate:library overwrites the full 424-page set with the beta Docker-parsed subset. A developer iterating locally may not notice the missing pages until they compare output sizes. The docs call this out, but a runtime guard — even just an echo warning — in the Makefile/npm script that the local flow produces fewer pages and overwrites any previous full generation would prevent confusion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant