Skip to content

docs(sdk): regenerate the SDK reference from v2.16.1 - #657

Open
OisinKyne wants to merge 1 commit into
mainfrom
docs/sdk-reference-2.16.1
Open

OisinKyne wants to merge 1 commit into
mainfrom
docs/sdk-reference-2.16.1

Conversation

@OisinKyne

Copy link
Copy Markdown
Contributor

What

The SDK reference at /sdk was a hand-vendored TypeDoc export of @obolnetwork/obol-sdk v2.11.8. This regenerates it from v2.16.1 (tag v2.16.1, cf0106c) and adds the script that does it.

  • scripts/update-sdk-reference.mjs <path-to-obol-sdk>: runs the SDK's own TypeDoc config in the checkout, then writes docs/sdk/ and versioned_docs/version-v1.11/sdk/ (identical copies), and the items of the six SDK categories in sidebars.js and versioned_sidebars/version-v1.11-sidebars.json. It keeps existing front matter (so slugs do not move), adds sidebar_label / slug to new pages, sets the **SDK Version:** line, points the README's docs.obol.org links at pages of this site, removes pages of exports that no longer exist, and fails on broken relative links, slug collisions or local paths in the output. One line in the README documents it.
  • 106 pages (was 53): 53 added, 53 regenerated, none removed, no URL changes.
    • Classes (+22): ENR, ObolApiError, ObolSdkError and the typed errors (ValidationError, UnauthorizedError, NotFoundError, RateLimitError, ConflictError, RequestTimeoutError, SignerRequiredError, UnsupportedChainError, ChainMismatchError, DefinitionVerificationError, NotAnOperatorError, IncentivesPreflightError, PayloadValidationError, InvalidArgumentError, ExitRecombineError, InvalidBaseUrlError, ClusterLockValidationTimeoutError, ClusterLockValidationBusyError, TransactionSubmissionError)
    • Functions (+7): builderBlsCheck, depositBlsCheck, getWithdrawalRequestFee, hasUniqueDistributedKeys, isSupportedClusterVersion, resolveWithdrawalFee, validateDepositDataStructure
    • Interfaces (+3): ExitNetwork, ObolApiErrorInit, RecombineExitBlobsOptions
    • Type aliases (+10): BlsSignatureCheck, DepositKind, ExitRecombineErrorCode, GetDepositDataOptions, LockDepositData, PreflightIssue, PreflightResult, TransactionSentInfo, ValidatorDeposit, WriteOptions
    • Variables (+11): ALLOWED_OBOL_API_BASE_URLS, CONFLICT_ERROR_MSG, DEFAULT_REQUEST_TIMEOUT_MS, EXIT_NETWORKS, MERKLE_DISTRIBUTOR_RUNTIME, MIN_SUPPORTED_CLUSTER_VERSION, OBOL_TOKEN_ADDRESS, SUPPORTED_CHAIN_IDS, SUPPORTED_DEFINITION_VERSIONS, TERMS_ACCEPTED_MSG, WITHDRAWAL_REQUEST_CONTRACT_ADDRESS
  • Notable content: client.exit.recombineExitBlobs(exitBlob, options?) and its verification, client.getDepositData, claimIncentives with a Safe signer, the error classes.
  • src/css/custom.css: one rule scoped to the /sdk pages so the generated tables scroll on their own (Infima's default display: block; overflow-x: auto); tables that fit no longer stretch to the full content width. The error classes have seven-column property tables that otherwise widen the page by up to 320 px at 1440 px (/sdk/interfaces/clusterdefinition already overflows on the live site).

How to review

Everything under docs/sdk/ and versioned_docs/version-v1.11/sdk/ is generated: review the script, the sidebar diffs (insertions only) and the CSS rule, and spot-check /sdk/index, /sdk/classes/exit, /sdk/classes/exitrecombineerror.

To reproduce: check out obol-sdk at v2.16.1, yarn install --frozen-lockfile --ignore-scripts, then node scripts/update-sdk-reference.mjs <that checkout>; the result is byte-identical.

Verification

  • yarn typecheck and yarn build (onBrokenLinks: 'throw') pass.
  • All 107 /sdk pages loaded in headless Chromium at 1440 px: none overflows horizontally, no dead in-page anchors.

Not in this PR

The /sdk reference was a hand-vendored TypeDoc export of
@obolnetwork/obol-sdk v2.11.8. Regenerate it from v2.16.1 (cf0106c)
with a new script, scripts/update-sdk-reference.mjs, which runs the
SDK's TypeDoc config in a checkout and writes docs/sdk, its copy in
the latest versioned docs and the SDK sidebar categories.

106 pages (53 new, none removed, no URL changes): the typed error
classes, ENR, deposit and BLS helpers, RecombineExitBlobsOptions,
EXIT_NETWORKS and other constants. Exit.recombineExitBlobs now shows
its options and verification.

Tables on the SDK pages scroll on their own, as the error classes'
seven-column tables otherwise widen the page.
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
33.1% Duplication on New Code (required ≤ 15%)
D Security Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

This branch has not been deployed

No deployments
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