Skip to content

chore(api): consume the published contract packages - #645

Merged
bmc08gt merged 2 commits into
mainfrom
chore/spm-client-protocol
Aug 25, 2026
Merged

chore(api): consume the published contract packages#645
bmc08gt merged 2 commits into
mainfrom
chore/spm-client-protocol

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

FlipcashAPI vendored a copy of both proto sets and their generated Swift, and Scripts/run
regenerated it locally. Both are gone. The package now depends on
ocp-client-protocol and
flipcash2-client-protocol at
0.1.0 and re-exports them, so the contract is generated once instead of once per app. The
Android side consumes the Kotlin half of the same two packages in
code-android-app#1325.

Why the umbrella instead of importing the modules directly

Exports.swift is two @_exported import lines. That keeps import FlipcashAPI working in all
109 files that write it, and it means no target gains a package dependency — the app already
reaches FlipcashAPI transitively through FlipcashCore, which is the only thing that names it
(.package(path: "../FlipcashAPI")). No .pbxproj edits.

FlipcashAPI held no hand-written code, so there is nothing left in it but the re-export.

One filename changed, no code did

The released Swift is byte-identical to what was committed here, except that Core's messaging
service shipped as flipcash_messaging_v1_messaging_service.*. That prefix came from
Scripts/run, which renamed the file to avoid a basename collision with the OCP messaging
service inside the single merged module. The two packages are separate modules now, so the
collision cannot happen and the rename is gone with it. The Swift type names
(Flipcash_Messaging_V1_* vs Ocp_Messaging_V1_*) were always distinct and are unchanged.

grpc-swift-2 and grpc-swift-protobuf also leave this manifest — they arrive transitively from
the packages, which pin them.

Second commit: the pipeline that fed the deleted directories

Scripts/run, pull_protos, generate, and install-grpc-swift-2-plugin.sh cloned upstream
into FlipcashAPI/Sources and ran protoc over it. Those paths no longer exist, so the scripts
are dead. Scripts/gengoogle stays — it builds the Firebase plist and never touched protos.

The docs that described the pipeline are updated rather than deleted: technology-stack.md,
hard-rules.md, the CLAUDE.md index and generated-files rule, and the proto-change-tracer
agent's chain diagram. The fetch-protos skill keeps its name and its useful half — trace the
impact, scaffold the service stubs — but its first four steps are a version bump now, and
releasing a contract change points at the package repos, where it stays a deliberate human step.

Follow-ups, deliberately not here

Retiring scripts/proto-parity.sh and the client repos' verify-parity.sh: both compare each
app's own generated output against the packages', and neither app has independent output left
once this and #1325 land.

FlipcashAPI vendored a copy of both proto sets and their generated Swift. It now
depends on code-payments/ocp-client-protocol and code-payments/flipcash2-client-protocol
at 0.1.0 and re-exports them, so the contract is generated in one place instead of
once per app. Android consumes the Kotlin half of the same two packages.

Exports.swift uses @_exported so `import FlipcashAPI` keeps working: none of the 109
importers change, and no target gains a package dependency, because the app already
reaches FlipcashAPI transitively through FlipcashCore.

The released Swift is byte-identical to what was committed here, with one filename
difference: Core's messaging service shipped as flipcash_messaging_v1_* because the
local generator renamed it to dodge a basename collision in the merged module. The
two packages are separate modules, so the collision is gone and the rename with it —
the Swift types (Flipcash_Messaging_V1_* vs Ocp_Messaging_V1_*) never differed.

grpc-swift-2 and grpc-swift-protobuf drop out of this manifest; they arrive
transitively from the packages, which pin them.
Scripts/run cloned the upstream contract repos into FlipcashAPI/Sources and drove
protoc over the result. Those directories are gone, so the script and the three it
calls now write into nothing. Scripts/gengoogle stays — it builds the Firebase plist
and has never had anything to do with protos.

Docs that described the local pipeline described a pipeline that no longer exists:
technology-stack.md, hard-rules.md, the CLAUDE.md index and generated-files rule, the
proto-change-tracer agent's chain diagram, and the fetch-protos skill. The skill keeps
its name and its useful half — trace the impact, scaffold the service stubs — but its
first four steps are now a version bump rather than a regeneration, and its release
step points at the package repos, where releasing is a deliberate human step.
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