Skip to content

fix(docs): returns and property headings the Mintlify pipeline got wrong - #344

Merged
amitbardos merged 2 commits into
mainfrom
amitb/docs-generator-artifacts
Oct 21, 2026
Merged

amitbardos merged 2 commits into
mainfrom
amitb/docs-generator-artifacts

Conversation

@amitbardos

@amitbardos amitbardos commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Fixes the generator problems found while reviewing the @base44/platform/react reference (base44-dev/mintlify-docs#2677), which were hand-patched there. Most of them also affected the app SDK reference.

What changes in the output

App SDK

  • About 40 interface methods get their @returns sentence back, for example auth.me(): "Promise resolving to the user's profile data." It was dropped whenever the return type expanded into properties.
  • InvokeLLM no longer has a return field named an.

Nothing else a reader sees changes. The generated files also differ in two ways that never reach the published pages:

  • The README's link to AiGatewayConnection is plain text. The README isn't published, since copy-to-local-docs.js removes it.
  • 22 files lose doubled backticks (``x`` → `x`). Both forms render the same.

Platform SDK

  • SecretsQuestion.submit() no longer has a return field named the.
  • createApp(), openLiveSession() and subscribe() get their @returns sentence back.
  • onAppCreated is a #### property heading like its siblings, with ##### Parameters and Returns under it. Its parameter has a description, and its return type is void.

Causes

  • typedoc-mintlify-returns.js:
    • A plain return took its field name from /(\w+)\s+(?:instance|object|value)/. That almost always matched an article: "the values", "an object". Every plain return is now result, which already renders as the description alone.
    • When the return type expanded into properties, the parser dropped the section's own text. It now keeps it as leading text.
    • The @returns sentence can reach a section more than once: as the section's own text, from the reflection, and as a plain return's description. The section now shows it once, comparing with whitespace normalized.
    • A plain return with no signature type, such as a function-typed property, now keeps its type.
  • renderCommentParts and renderCommentPart: TypeDoc's code parts already include their backticks. Wrapping them again produced ``x``. That renders the same, but it stopped the dedupe above from matching, so useBase44Chat's @returns sentence showed twice.
  • Function-typed properties: typedoc-plugin-markdown renders them like methods (### name()), and post-processing then leaves them a level above their sibling properties. The plugin now finds these properties from the page's reflection (nameCallableProperties in typedoc-mintlify-content.js), drops the (), and moves the property's whole subsection down with it. It doesn't look for section names or heading text, and pages without such properties don't change.
  • removeNonExposedTypeLinks: it only unlinked links whose text is the type name. It now also unlinks any link to a type in types-to-delete-after-processing.json. Without this, the restored @returns sentence on ai-gateway's connection() would link to AiGatewayConnection, a page that's deleted after processing.

Not changed

  • Methods with several parameters still wrap them in a "Properties" Accordion. That has been the convention since the first docs commit, and it applies to every multi-parameter method in the app SDK.
  • Return types still show the resolved type (Base44App), not Promise<Base44App>, as everywhere else.

Testing

  • tests/unit/typedoc-mintlify.test.ts runs TypeDoc with the plugin on a small fixture (tests/unit/fixtures/typedoc-mintlify/) that has one case per fix, and checks the pages it writes. Undoing any one of the fixes fails at least one test.
  • It also unit-tests nameCallableProperties and the deleted-type unlinking. To make that possible, file-processing.js now runs only as a script, so tests can import it.
  • Regenerated both references before and after, and compared every page. The only differences are the ones listed above.
  • vitest run tests/unit in packages/sdk: 378 passed. test:types and docs in packages/platform pass.

🤖 Generated with Claude Code

- A plain return no longer takes its field name from the word before "object", "instance" or
  "value" in its description, which named fields "the" and "an".
- An interface method's Returns keeps its @returns text when its type expands into properties.
  About 40 app SDK methods and two platform ones had lost it.
- Code spans in comments are no longer wrapped in a second pair of backticks, which also let a
  function's @returns text show twice.
- A function-typed property under Properties gets a #### heading like its siblings, with its
  Parameters and Returns nested under it, and keeps a void return type.
- Links to types deleted after processing are unlinked, whatever their text.
- onAppCreated documents its app parameter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

🚀 Package Preview Available! (@base44/platform)


Install this PR's preview build with npm:

npm i @base44-preview/platform@0.4.0-pr.344.26b3201

Prefer not to change any import paths? Install using npm alias so your code still imports @base44/platform:

npm i "@base44/platform@npm:@base44-preview/platform@0.4.0-pr.344.26b3201"

Or add it to your package.json dependencies:

{
  "dependencies": {
    "@base44/platform": "npm:@base44-preview/platform@0.4.0-pr.344.26b3201"
  }
}

Preview published to npm registry — try new features instantly!

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

🚀 Package Preview Available!


Install this PR's preview build with npm:

npm i @base44-preview/sdk@0.8.55-pr.344.26b3201

Prefer not to change any import paths? Install using npm alias so your code still imports @base44/sdk:

npm i "@base44/sdk@npm:@base44-preview/sdk@0.8.55-pr.344.26b3201"

Or add it to your package.json dependencies:

{
  "dependencies": {
    "@base44/sdk": "npm:@base44-preview/sdk@0.8.55-pr.344.26b3201"
  }
}

Preview published to npm registry — try new features instantly!

…ry fix on real output

Review: the fixes matched markdown text, and weren't all covered.

- A property whose type is a function is found from the page's reflection, in the TypeDoc
  plugin, not from a "## Properties" section and literal Parameters and Returns headings in
  post-processing. Its whole subsection moves down with it, whatever its headings are called,
  and nothing changes for pages without such properties.
- The dedupe of a Returns section's text ignores how lines wrap, and also covers a plain return
  whose description is the @returns sentence, which showed it twice.
- The plain return's name is one constant.
- file-processing.js runs only as a script, so tests can import its helpers.

tests/unit/typedoc-mintlify.test.ts runs TypeDoc with the plugin on a fixture with one case per
fix and checks the pages it writes. Undoing any one fix fails a test. Both references generate
byte-identical to before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@amitbardos
amitbardos merged commit 2e779e8 into main Oct 21, 2026
6 of 7 checks passed
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.

2 participants