Skip to content

Prepare dart package for publishing to pub.dev#1541

Draft
spacebear21 wants to merge 1 commit intopayjoin:masterfrom
spacebear21:publish-dart-0-1-1
Draft

Prepare dart package for publishing to pub.dev#1541
spacebear21 wants to merge 1 commit intopayjoin:masterfrom
spacebear21:publish-dart-0-1-1

Conversation

@spacebear21
Copy link
Copy Markdown
Collaborator

DRAFT: Merge #1537 first before merging/publishing this.

Blocker: native/Cargo.toml [patch] blocks break pub.dev consumers

native/Cargo.toml redirects payjoin-ffi and three workspace crates to monorepo-relative paths (../.., ../../../payjoin, …). In the monorepo this lets dart test build the wrapper against in-tree Rust
sources so newly-generated bindings get exercised against the FFI changes that produced them. For pub.dev consumers those paths don't exist.

A good solution should satisfy the following priorities, in order:

  1. the published package should work
  2. the local dev experience should be easy to reason about and work with when making changes to the core library or FFI such that they are reflected in generated bindings for tests.
  3. publishing the package should be hard to mess up, i.e. minimize footguns like "forgot a step and now the published package contains invalid patches" or "doesn't contain generated lib/payjoin.dart" bindings.

This may be achievable by using a checked in .cargo/config.toml for local dev and excluding it in .pubignore.? Or maybe just a publish script that rewrites the Cargo.toml to strip the patch sections and pin the latest rev? TBD

Remaining steps to publish (once the above lands)

From payjoin-ffi/dart/:

  1. bash scripts/generate_bindings.sh
  2. dart pub publish --dry-run: confirm lib/payjoin.dart present, no .dylib/.so/*.dll/native/target/, pubspec.yaml shows 0.1.1.
  3. dart pub publish
  4. git tag payjoin-ffi-dart-v0.1.1 && git push upstream payjoin-ffi-dart-v0.1.1
Pull Request Checklist

Please confirm the following before requesting review:

@coveralls
Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 25533002088

Coverage remained the same at 85.169%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 13519
Covered Lines: 11514
Line Coverage: 85.17%
Coverage Strength: 400.02 hits per line

💛 - Coveralls

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.

2 participants