Skip to content

Comments

fix(docs): align refreshed guides with current SDK APIs#629

Open
snissn wants to merge 6 commits intomasterfrom
fix/pr-628-docs-api-drift
Open

fix(docs): align refreshed guides with current SDK APIs#629
snissn wants to merge 6 commits intomasterfrom
fix/pr-628-docs-api-drift

Conversation

@snissn
Copy link

@snissn snissn commented Feb 24, 2026

Summary

This PR is a reviewed, merge-ready version of the docs/refresh work from #628 with follow-up fixes found during deep-dive API/compile validation.

It includes all changes from #628 plus targeted corrections to keep developer-guide examples aligned with the current SDK/Core/React APIs and strict docs compilation.

Why this is needed

During review of #628, several docs examples were semantically or type-level out of sync with the latest APIs (some in non-Twoslash blocks, so they were not initially caught by type checks).

These issues would create confusing copy/paste failures or incorrect guidance even when docs built successfully.

Changes made

docs/src/content/docs/developer-guides/react-integration.mdx

  • Fixed useAccountInfo example to avoid passing address: undefined under exactOptionalPropertyTypes.
  • Fixed useDataSets example to pass address only when available.
  • Added explicit wallet-connected guards in examples.

docs/src/content/docs/developer-guides/storage/storage-context.mdx

  • Fixed batch-upload example to use supported UploadPieceStreamingData (Uint8Array[]) instead of File[] for StorageContext.upload.
  • Updated piece-list example to reflect getPieces() returning PieceRecord (prints piece.pieceCid).
  • Corrected deletion docs text/signature to deletePiece({ piece: ... }).
  • Corrected download examples to current options-object API:
    • synapse.storage.download({ pieceCid, ... })
    • context.download({ pieceCid, ... })
  • Corrected inheritance snippet (Synapse.create is sync in current API).

docs/src/content/docs/developer-guides/synapse.md

  • Updated getProviderInfo signature docs to string | bigint.

docs/src/content/docs/developer-guides/synapse-core.mdx

  • Replaced invalid short private key example (0x1) with a valid 32-byte hex key literal for Twoslash correctness.

Mergeability and readiness deep-dive

Validation performed

  • pnpm build (repo root): ✅ pass
  • cd docs && pnpm build: ✅ pass
    • only non-blocking docs-plugin warnings remain (existing/reference warnings)

Reviewer notes

  • Risk is low: docs-only changes.
  • Impact is high for developer correctness: examples now match current API behavior and signatures.

@socket-security
Copy link

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn High
Obfuscated code: npm vite is 91.0% likely obfuscated

Confidence: 0.91

Location: Package overview

From: ?npm/@hugomrdias/docs@0.1.11npm/vite-tsconfig-paths@6.1.1npm/astro@5.17.3npm/vite@6.4.1

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/vite@6.4.1. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

@cloudflare-workers-and-pages
Copy link

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
synapse-dev 417ba51 Commit Preview URL

Branch Preview URL
Feb 24 2026, 09:21 PM

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

Labels

None yet

Projects

Status: 📌 Triage

Development

Successfully merging this pull request may close these issues.

2 participants