Skip to content

docs: add library tutorials chapter (steem-js + steemgosdk demos) - #51

Merged
ety001 merged 1 commit into
masterfrom
feat/tutorials-library-demos
Nov 3, 2026
Merged

ety001 merged 1 commit into
masterfrom
feat/tutorials-library-demos

Conversation

@ety001

@ety001 ety001 commented Nov 3, 2026

Copy link
Copy Markdown
Member

Library tutorials chapter (steem-js + steemgosdk demos)

Phase-7 tutorials chapter: migrates the usage examples of the two official Steem client libraries into a new en-only docs/tutorials/ section.

  • steem-js (JavaScript/TypeScript, npm @steemit/steem-js 1.2.4) — source: steem-js/docs/ (README.md + signedCall-examples.md + signature-verification-examples.md + RPC-AUTH-MIGRATION.md), repo: https://github.com/steemit/steem-js
  • steemgosdk (Go, module github.com/steemit/steemgosdk) — source: steemgosdk/docs/ (examples.md + signed-call.md), repo: https://github.com/steemit/steemgosdk

The internal engineering notes of the steem-js repo (refactoring-2025, any-type-analysis, BASELINE_VALUES, DEBUG, OPERATIONS-JSON-PITFALLS) were deliberately not migrated; the one sentence in the broadcast page that linked to OPERATIONS-JSON-PITFALLS.md was trimmed accordingly.

New pages (9) + sidebar

Page Content
docs/tutorials/index.md Tutorial overview: library positioning, page navigation, GitHub links, pointer to the generated API Reference
docs/tutorials/steem-js/index.md Installation, browser usage, configuration (config.set / setUrl / setOptions / multiple instances), JSON-RPC overview, API routing, usage examples, TypeScript support, error handling
docs/tutorials/steem-js/read-api.md Full read-side catalogue: Tags, Blog, Discussions, Blocks, Global Properties, Keys, Accounts, Market, Authority/Validation, Votes, Content, Witnesses + Login/Follow APIs + offline Authentication/Formatter/Utils
docs/tutorials/steem-js/broadcast.md Broadcast API + complete Broadcast Operations catalogue (incl. multisig, binary transaction serialization)
docs/tutorials/steem-js/signed-calls.md signedCall/signedCallAsync + signature verification — the two library example guides merged with the README sections
docs/tutorials/steem-js/rpc-auth-migration.md RPC-auth test-suite migration guide (full migration; local machine paths generalized in prose)
docs/tutorials/steemgosdk/index.md Basic Setup, API examples, Auth (keys/WIF/memo) examples, Steem URI examples
docs/tutorials/steemgosdk/broadcast.md Broadcast examples (votes, transfers, encrypted memos, comments, beneficiaries, multi-op txs), Complete examples, CustomJson examples, Notes
docs/tutorials/steemgosdk/signed-call.md SignedCall API documentation (full) + the SignedCall examples section from examples.md

config.mts: en root sidebar gains a Tutorials group between Guides and Services (overview + 5 steem-js pages + 3 steemgosdk pages). Other locales untouched (en-only, consistent with the existing Guides chapters; the i18nRouting caveat in config covers this).

Section placement decisions

  • steem-js README "Usage Examples", "TypeScript Support", "Error Handling" and "Security Notes" went to the steem-js index page (getting-started context); Login/Follow/Authentication/Formatter/Utils went to read-api (read/offline utilities); "Transaction serialization (binary)" stayed inside broadcast (it documents the broadcast/signing wire format).
  • steemgosdk examples.md sections were split across the three pages: Auth + Steem URI → index; Complete + CustomJson + Notes → broadcast; SignedCall → signed-call page (merged with signed-call.md).

Code-block audit (machine-verified)

Every fenced code block of every source file appears in the output pages byte-for-byte (fence language tags and block bodies unchanged; verified by script, multiset comparison over (lang, content)):

Source file Language Blocks Migrated
steem-js README.md bash 1 1
steem-js README.md html 2 2
steem-js README.md javascript 171 171
steem-js README.md typescript 1 1
steem-js signature-verification-examples.md javascript 16 16
steem-js signedCall-examples.md javascript 14 14
steem-js RPC-AUTH-MIGRATION.md typescript 4 4
steem-js RPC-AUTH-MIGRATION.md (untagged) 3 3
steem-js RPC-AUTH-MIGRATION.md bash 2 2
steemgosdk examples.md go 39 39
steemgosdk signed-call.md go 14 14
steemgosdk signed-call.md bash 1 1
Total 268 268

No source block was dropped, cherry-picked, or altered; no extra code blocks were introduced in the new prose. Only heading wording/placement and navigation prose were adjusted (frontmatter, page intros, cross-page links, "Where to go next" sections).

Quality gates

  1. node --check on all 201 javascript blocks: PASS (201/201). Each block was extracted to a temp file and parse-checked (strategies: plain CJS, ESM .mjs, async-wrapper, expression wrapper for return-value object literals). The 5 typescript blocks were additionally parse-checked with tsc --noEmit --noResolve — README's TS block is syntactically clean; two RPC-AUTH blocks contain ... ellipsis placeholders that never parsed (see defects below).
  2. Runtime: 3 read demos executed live against https://api.steemit.com from a temporary harness inside the steem-js checkout (deleted afterwards): getAccountsAsync(['ned','dan']) → both accounts returned; getOpsInBlockAsync(10000001, false) → 16 ops (first: vote); getDynamicGlobalPropertiesAsync() → head_block_number 111009518. All succeeded.
  3. gofmt -e on all 53 go blocks: PASS (53/53). Full-file blocks parse as-is (31); statement/func fragments parse with a harness wrapper (21) and one import+statement fragment with an import-split harness (1). Fragment wrapping is check-harness only — page content is untouched.
  4. NODE_OPTIONS=--max-old-space-size=8192 pnpm build → exit 0 (268.97s, docs:gen + VitePress 1.6.4; all 9 tutorial pages rendered into dist/tutorials/; VitePress dead-link check passed).

Source defects preserved (not silently fixed)

Structural (markdown), repaired only at the fence level — block bodies byte-identical:

  1. steem-js/docs/README.md L245: a ```javascript fence is never closed; the next fence at L271 was silently swallowed by naive renderers. Migration adds the missing closing fence after L267.
  2. steem-js/docs/signedCall-examples.md L453: stray orphan closing fence after the signedCallAsync section (it would otherwise turn the following prose into a code block). Migration drops the stray line.

Suspected outdated / non-compilable content, kept verbatim as in the originals:

  1. RPC-AUTH-MIGRATION.md L26/L38: assert.equal(...) and expect(...).toBe(...) use bare ... placeholders — not valid TS/JS syntax (illustrative elision in the source doc).
  2. steemgosdk/docs/signed-call.md "Custom Verification" block mixes a package import with top-level statements — not a compilable Go unit as written.
  3. Several steem-js demos still reference long-standing fixtures from older eras (ned/dan accounts, block 10000001, 0.19.2 version strings in return examples, conveyor.is_email_registered signed-call target). They are documentation samples and were preserved unchanged; the three demos we actually executed work against the live node.

Site conventions

  • Every page: frontmatter title + explicit # H1; internal links in .html form (directory form for section index pages); pages interlink via intros and "Where to go next" sections.
  • Where a README deep-dive overlaps an existing API method page, the demos stay and the page top points to the generated reference (e.g. read-api → condenser_api.get_accounts, broadcast → /api/broadcast_ops/).
  • steemgosdk docs' dead developers.steem.io resource links were replaced by GitHub repo + in-site API Reference links.

🚫 Not merging — left for review.

Phase 7: migrate the usage examples of the two official client libraries
into a new en-only docs/tutorials/ section (9 pages) and add an en-root
sidebar Tutorials group between Guides and Services.

All 268 source code blocks are migrated byte-for-byte (machine-audited).
Quality gates: node --check 201/201 js blocks, 3 read demos executed
against https://api.steemit.com, gofmt -e 53/53 go blocks, pnpm build
exit 0.
@ety001
ety001 merged commit 15415fa into master Nov 3, 2026
1 check passed
@ety001
ety001 deleted the feat/tutorials-library-demos branch November 3, 2026 19:01
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