Skip to content

Repair two rendering defects in the SDK reference - #275

Closed
daniellekorn wants to merge 1 commit into
sdk-jsdoc-stylefrom
sdk-render-fixes
Closed

Repair two rendering defects in the SDK reference#275
daniellekorn wants to merge 1 commit into
sdk-jsdoc-stylefrom
sdk-render-fixes

Conversation

@daniellekorn

@daniellekorn daniellekorn commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

Two ways the generated reference renders wrong. The first is live on the site today.

Note

Based on sdk-jsdoc-style (#272), not main. Merge #272 first and this retargets automatically.

Both fix the cause. Neither touches the post-processing pipeline.

1. Six examples are missing their first line of code (live now)

The pipeline promotes a leading // comment to the Mintlify code-block title. An example without one has its first real line of code consumed as the title instead.

Four auth examples start with try {, so what publishes is a try block with no try, plus an orphaned closing brace:

```typescript try {                                   ← consumed as the title
  await base44.auth.inviteUser('newuser@example.com', 'user');
  console.log('Invitation sent successfully!');
} catch (error) {                                      ← catch with nothing to catch
  console.error('Failed to send invitation:', error);
}

Affected: inviteUser, resetPasswordRequest, resetPassword, changePassword, and two integrations examples. Each now opens with a comment describing what the example does, which fixes the code and gives the block a useful title.

2. A truncated union on connectors.callApi()

The query parameter published as:

Record<string, ... | ... | ... | ... | ...>

TypeDoc truncates long inline unions, so the union is given a name:

/** A value acceptable as a query parameter on {@link ConnectorApiRequest.query}. */
export type ConnectorApiQueryValue = string | number | boolean | Array<string | number>;

It now renders as Record<string, ConnectorApiQueryValue>, and the type is appended into the connectors page so the definition sits alongside the method rather than being a name the reader cannot resolve. Purely a naming change: the accepted values are identical and there is no runtime effect.

This is not live yet. It would have shipped with the next regeneration.

Deliberately not fixed: the Pick truncation

entities.list() and filter() render their return type as:

`Promise<Pick\<..., ...>`

which is malformed, since the trailing [] and one > are lost and the angle brackets do not balance.

An earlier revision of this PR patched it with a regex in file-processing.js. That has been removed, for two reasons.

It was silently unsafe. TypeDoc's truncation drops the [], so Promise<Pick<T,K>> and Promise<Pick<T,K>[]> collapse to the same string. A regex cannot tell them apart. Hardcoding the replacement as Promise<T[]> is right for the two methods that hit it today and would quietly publish a wrong type for any future method returning a single picked record.

It was the wrong layer. file-processing.js already carries twelve regex patches against TypeDoc's output (Fix 1, Fix 2 & 3, Fix 4, Fix 4b, Fix 5, Fix 6 twice, Fix 7, 7a, 7b, 7c). Adding a thirteenth trades a visible defect for an invisible one and grows a pile that should be shrinking.

Leaving it visible is the honest state. The real fix belongs in the TypeDoc plugin, alongside a look at whether those twelve patches can be replaced by something more durable.

Verification

Also not fixed here

Eleven more examples in the source lack a leading comment, but none currently reaches a published page. They sit in internal files (client.ts, axios-client.ts, auth-utils.types.ts), in analytics.types.ts where the block renders differently, or in actors.types.ts, which #273 holds back.

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown

🚀 Package Preview Available!


Install this PR's preview build with npm:

npm i @base44-preview/sdk@0.8.46-pr.275.68973a5

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.46-pr.275.68973a5"

Or add it to your package.json dependencies:

{
  "dependencies": {
    "@base44/sdk": "npm:@base44-preview/sdk@0.8.46-pr.275.68973a5"
  }
}

Preview published to npm registry — try new features instantly!

@github-actions github-actions Bot added the docs-draft PR has auto-drafted documentation suggestions label Sep 6, 2026
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.
@daniellekorn daniellekorn changed the title Repair three rendering defects in the SDK reference Repair two rendering defects in the SDK reference Sep 6, 2026
@daniellekorn

Copy link
Copy Markdown
Collaborator Author

Folded into #272 as ea0f567. Both PRs fix defects in the generated SDK reference at the source, and they touch three of the same files (connectors.types.ts, auth.types.ts, appended-articles.json), so splitting them meant reviewing the same files twice for the same kind of change. Neither had picked up a review, so there was nothing to disrupt by combining them.

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

Labels

docs-draft PR has auto-drafted documentation suggestions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant