Fix the SDK reference at the source: em dashes, stray type pages, nav order, broken examples - #272
Open
daniellekorn wants to merge 6 commits into
Open
Fix the SDK reference at the source: em dashes, stray type pages, nav order, broken examples#272daniellekorn wants to merge 6 commits into
daniellekorn wants to merge 6 commits into
Conversation
🚀 Package Preview Available!Install this PR's preview build with npm: npm i @base44-preview/sdk@0.8.46-pr.272.26d8562Prefer not to change any import paths? Install using npm alias so your code still imports npm i "@base44/sdk@npm:@base44-preview/sdk@0.8.46-pr.272.26d8562"Or add it to your {
"dependencies": {
"@base44/sdk": "npm:@base44-preview/sdk@0.8.46-pr.272.26d8562"
}
}
Preview published to npm registry — try new features instantly! |
daniellekorn
force-pushed
the
sdk-jsdoc-style
branch
from
September 6, 2026 06:15
4025782 to
f795735
Compare
daniellekorn
force-pushed
the
sdk-jsdoc-style
branch
3 times, most recently
from
September 6, 2026 06:23
6685f2d to
1ac48aa
Compare
Base44 docs style forbids em dashes, and JSDoc in this repo is published prose that renders straight into the Mintlify SDK reference. Seven of these were live on published pages. Each one is rewritten rather than mechanically swapped, preferring a comma or a sentence break. Comments only, no code changes.
The em dash rule already exists in base44-docs-writing and changelog-writing, but sdk-docs-writing had no style guidance on it, which is how em dashes reached the published SDK reference. Moves the two facts that govern all writing in this skill up to the top, since they were buried under a style bullet: this JSDoc is published prose subject to the main docs style guide, and fixes belong in the source because the generated MDX is overwritten on every run. Also notes that colons should be rare, calls out the two grammar slips that come up when rewriting an em dash away, and removes the em dashes the skill was itself using.
… actors Two pipeline config gaps, both surfaced by regenerating the published reference for the first time in a while. Supporting types are meant to be appended into the page for the module that owns them, then dropped as standalone pages. That is what appended-articles.json does for EntityHandler, SortField, ConnectorIntegrationType and the rest, and it is why the SDK Reference nav lists only modules. The types added with connectors.callApi() and app.getPublicSettings() were registered in types-to-expose.json but never added to appended-articles.json, so they rendered as standalone pages and showed up in the nav next to real modules. This appends them to their owners. The append step already unlinks the source page, so no types-to-delete-after-processing.json entry is needed. Separately, the actors page is held back. A renamed module page is treated as exposed regardless of types-to-expose.json, so actors published as an 18-line page carrying a truncated type signature, two sentences and one snippet, with connect(), subscribe(), send(), close() and unsubscribe() absent entirely. Suppressing it keeps that off the public site until the JSDoc is written.
daniellekorn
force-pushed
the
sdk-jsdoc-style
branch
from
September 6, 2026 06:26
1ac48aa to
e6cec00
Compare
TypeDoc resolved {@link AppModule.getPublicSettings} to
AppModule.mdx#getpublicsettings, but AppModule renders as app.mdx and the
type is appended into that same page, so the href pointed at a file that
does not exist.
The link was redundant in the first place. AppPublicSettingsResponse now
renders directly beneath getPublicSettings() on the app page, so a plain
code reference reads the same and cannot break.
The SDK Reference nav sorted on the full page path, so every module declared as an interface came before every module declared as a type alias, and the alphabet restarted partway down the list: agents, ai-gateway, analytics, app, app-logs, auth, connectors, functions, sso, entities, integrations Whether a module lands in TypeDoc's interfaces/ or type-aliases/ directory follows from how it happens to be declared and is invisible to a reader, so it should not drive nav order. Sorting on the page name gives one run: agents, ai-gateway, analytics, app, app-logs, auth, connectors, entities, functions, integrations, sso Applied in both places that build a nav group: copy-to-local-docs.js for mintlify-docs, and file-processing.js for the SDK's own docs.json.
1. Four auth examples and two integrations examples lost their first line of code. The pipeline promotes a leading // comment to the Mintlify code-block title, and an example without one has its first real line consumed instead. inviteUser, resetPasswordRequest, resetPassword and changePassword each published a try block with no try, and an orphaned closing brace. These six are live on the site today. Each now opens with a comment that describes the example. 2. connectors.callApi() published its query parameter as Record<string, ... | ... | ... | ... | ...>. TypeDoc truncates long inline unions, so the union is given a name, ConnectorApiQueryValue, and appended into the connectors page. It renders as Record<string, ConnectorApiQueryValue> with the definition alongside the method. Both fix the cause. Neither touches the post-processing pipeline.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Everything the regenerated SDK reference got wrong, fixed in the JSDoc and pipeline config that produce it rather than in the generated MDX, which is overwritten on every run.
One commit per concern, so this is readable commit by commit.
docs(jsdoc)docs(skill)fix(docs-gen)actorsheld backdocs(app)fix(docs-gen)fix(docs)1. Em dashes in published JSDoc
Base44 docs style forbids em dashes. JSDoc in
src/is published prose, so it renders straight into the reference. 37 occurrences across 13 files; seven were live.Each is rewritten rather than mechanically swapped, preferring a comma or a sentence break over a colon. Comments only, no code changes.
2. The skill that should have caught it
The rule existed in
base44-docs-writingandchangelog-writing, but not insdk-docs-writing, which is the skill governing this JSDoc. That gap is why they got in.Beyond adding the rule, the two facts that govern all writing in that skill move to the top, where they were previously buried inside a style bullet: this JSDoc is published prose subject to the main style guide, and fixes belong in the source because generated MDX is overwritten. Also notes that colons should be rare, calls out two grammar slips that come up when rewriting an em dash away, and removes the em dashes the skill was itself using.
3. Supporting types leaking into the nav
Supporting types are meant to be appended into the page for the module that owns them, then dropped as standalone pages.
appended-articles.jsonalready does this forEntityHandler,SortField,ConnectorIntegrationTypeand others, which is why the nav has only ever listed modules.The types added with
connectors.callApi()(#256) andapp.getPublicSettings()(#268) were registered intypes-to-expose.jsonbut never added toappended-articles.json, so they rendered as standalone pages sitting next toauthandconnectors.ConnectorApiRequest,ConnectorApiResponse,ConnectorApiResponsePhasenow append intoconnectors;AppPublicSettingsResponseintoapp. The append step already unlinks the source page, so notypes-to-delete-after-processing.jsonentry is needed.actorsis held back. A renamed module page is treated as exposed regardless oftypes-to-expose.json, soactorspublished as an 18-line page withconnect(),subscribe(),send(),close()andunsubscribe()absent entirely. Suppressing it keeps that off the site until the JSDoc is written. #273 does that and is currently a draft.4. A broken link on the new app page
AppPublicSettingsResponsecarried{@link AppModule.getPublicSettings}, which resolved toAppModule.mdx#getpublicsettings.AppModulerenders asapp.mdxand the type is appended into that same page, so the href pointed at a file that does not exist.The link was redundant anyway, since the type now renders directly beneath the method. A plain code reference reads the same and cannot break.
5. Nav order restarting the alphabet
The nav sorted on the full page path, so every module declared as an
interfacecame before every module declared as atype:Whether a module lands in TypeDoc's
interfaces/ortype-aliases/directory follows from how it happens to be declared and is invisible to a reader. Sorting on the page name gives one run:Applied in both places that build a nav group.
6. Six published examples missing their first line of code
The pipeline promotes a leading
//comment to the Mintlify code-block title. An example without one has its first real line of code consumed instead.Four
authexamples start withtry {, so what publishes is atryblock with notry, plus an orphaned closing brace:inviteUser,resetPasswordRequest,resetPassword,changePassword, and twointegrationsexamples. Each now opens with a comment describing the example.This commit also names a union that TypeDoc was truncating.
callApi()published itsqueryparameter asRecord<string, ... | ... | ... | ... | ...>; it is nowConnectorApiQueryValue, appended into the connectors page so the definition sits alongside the method. Purely a naming change, identical accepted values, no runtime effect.Deliberately not fixed: the
Picktruncationentities.list()andfilter()render their return type as`Promise<Pick\<..., ...>`, which is malformed, since the trailing[]and one>are lost and the brackets do not balance.An earlier revision patched this with a regex in
file-processing.js. It was removed.It was silently unsafe. TypeDoc's truncation drops the
[], soPromise<Pick<T,K>>andPromise<Pick<T,K>[]>collapse to the same string. A regex cannot tell them apart, and hardcodingPromise<T[]>would quietly publish a wrong type for any future method returning a single picked record.It was the wrong layer.
file-processing.jsalready carries twelve regex patches against TypeDoc's output. A thirteenth trades a visible defect for an invisible one.The real fix belongs in the TypeDoc plugin, alongside a look at whether those twelve can be replaced by something more durable.
What this does and does not publish
Merging this publishes nothing.
manual-publishisworkflow_dispatchonly,preview-publishtargets@base44-preview/sdkunder a different name, and no workflow here pushes to mintlify-docs. These changes only affect what a future regeneration produces.The mintlify-docs PR was closed (base44-dev/mintlify-docs#1997) and will be regenerated fresh once this lands.
Verification
npx tsc --noEmitcleangrep -rn '—' src/returns nothingsrc/change is comment-only except the one named type in commit 6Known and unchanged
statusunions flip with no semantic change. Verified as TypeDoc's own ordering, not a local toolchain artifact.