docs: inject dartdoc comments into generated public API#114
Open
ANAMASGARD wants to merge 1 commit into
Open
Conversation
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.
Summary
Fixes #75 by adding dartdoc comments to the generated public API in
lib/bdk.dartvia a validated post-generation injection step (Option B).lib/bdk.dartis produced byuniffi-bindgenand must not be edited by hand. This PR introduces a small Dart injector that reads doc content fromscripts/dartdoc/entries.yaml, matches exact declaration anchors in the generated file, and inserts///comments after every bindings regeneration.Documented in this PR:
Wallet,Descriptor,Mnemonic,ElectrumClient,EsploraClient,Transaction,Psbtcreate/load/persist/dispose), sync (startSyncWithRevealedSpks,applyUpdate), Electrum/Esplora client setup and sync/broadcast, PSBT build/extract flowSafety guarantees:
scope_afterfor ambiguous symbols likedispose()--checkmode used in CI to catch drift afterbdk-ffiupgradesApproach
Upstream doc passthrough in
uniffi-dartis still open (uniffi-dart#59), so this keeps documentation in-repo and re-applies it automatically fromscripts/generate_bindings.sh.To change docs, edit
scripts/dartdoc/entries.yamland re-runbash ./scripts/generate_bindings.sh— notlib/bdk.dartdirectly.Files changed
scripts/dartdoc/entries.yamlscripts/inject_dartdocs.dart--checkscripts/generate_bindings.shuniffi-bindgenlib/bdk.darttest/dartdoc_injection_test.dart--checkpassjustfilejust verify-docs.github/workflows/ci.ymlCONTRIBUTING.mdTest plan
dart scripts/inject_dartdocs.dart --checkjust verify-docsdart test test/dartdoc_injection_test.dartjust analyzejust testjust docs— confirmdoc/api/pages forWallet,Descriptor,Mnemonicare populatedNotes