Skip to content

Try: hoist ShopifyCheckoutKit.podspec to the repo root, keep protocol in place#76

Draft
kieran-osgood-shopify wants to merge 17 commits into
mainfrom
kieran-osgood/ko/podspec-hoisted-to-repo-root
Draft

Try: hoist ShopifyCheckoutKit.podspec to the repo root, keep protocol in place#76
kieran-osgood-shopify wants to merge 17 commits into
mainfrom
kieran-osgood/ko/podspec-hoisted-to-repo-root

Conversation

@kieran-osgood-shopify
Copy link
Copy Markdown
Contributor

Reverts the file move from PR #65 so ShopifyCheckoutProtocol stays under
protocol/languages/swift/, and instead moves ShopifyCheckoutKit.podspec from
platforms/swift/ to the repository root. With the podspec at the root, both
source trees are 'inside' the pod's working directory and can be globbed
without using .. paths:

core.source_files = [
  'platforms/swift/Sources/ShopifyCheckoutKit/**/*.swift',
  'protocol/languages/swift/Sources/ShopifyCheckoutProtocol/**/*.swift',
]

Other changes:

  • License path simplified from '../../LICENSE' to 'LICENSE'.
  • AcceleratedCheckouts subspec source/resource paths re-rooted similarly.
  • Updated docs that referenced the old podspec path
    (.github/CONTRIBUTING.md, .github/pull_request_template.md).
  • Restored protocol/languages/swift/{Package.swift,README.md,.gitignore}.
  • Root Package.swift target paths point back at protocol/languages/swift.
  • #if !COCOAPODS guards in ShopifyCheckoutKit are kept (under CocoaPods both
    targets compile into one module, so the import would be unresolvable).

RESULT: works.

bundle exec pod lib lint ShopifyCheckoutKit.podspec --allow-warnings
-> ShopifyCheckoutKit passed validation.

Both subspecs (Core and AcceleratedCheckouts) build cleanly. The only
diagnostics are the pre-existing JSONAny Sendable warnings in the generated
Models.swift, identical to PR #65's baseline.

Lint must be invoked from the repo root, e.g.:
BUNDLE_GEMFILE=platforms/swift/Gemfile bundle exec pod lib lint
ShopifyCheckoutKit.podspec --allow-warnings

Trade-offs vs PR #65:

  • No duplicated source tree; protocol files live in one place.
  • No #if !COCOAPODS source-import guards needed beyond what PR Wire Swift kit for UCP events #65 already
    added (kept for safety).
  • Podspec lives at the repo root, slightly unusual for a multi-platform
    monorepo. CONTRIBUTING.md / PR template updated to reflect the new path.
  • The Gemfile remains under platforms/swift/, so contributors need to set
    BUNDLE_GEMFILE when running pod commands from the root (or we move the
    Gemfile too in a follow-up).

markmur and others added 17 commits May 12, 2026 21:28
CocoaPods silently drops source_files paths outside the spec dir, so
'../../protocol/languages/swift/...' globs were not bundled and 'pod
lib lint' failed with 6 'cannot find CheckoutProtocol in scope' errors.
Move the Swift protocol sources physically under
platforms/swift/Sources/ShopifyCheckoutProtocol and replace the SPM
location with a symlink so the SPM target path stays inside its
package root.

The earlier sed rename in generate_models.sh anchored on a trailing
space ('struct Binding ') but quicktype emits 'struct Binding:' with
no whitespace, so the rename never fired and the SwiftUI sample app
failed with 'Binding is ambiguous'. Switch to BSD word-boundary
anchors so all identifier sites get rewritten, and regenerate
Models.swift.
Keep one copy of the Swift protocol sources under
protocol/languages/swift/Sources/ShopifyCheckoutProtocol (their
conceptual home, alongside the schemas and other language ports) and
expose them inside the podspec dir via a symlink at
platforms/swift/Sources/ShopifyCheckoutProtocol. CocoaPods' source_files
glob follows the symlink, so the Core subspec still compiles them.

Point the generator OUTPUT back at the canonical path.
… in place

Reverts the file move from PR #65 so ShopifyCheckoutProtocol stays under
protocol/languages/swift/, and instead moves ShopifyCheckoutKit.podspec from
platforms/swift/ to the repository root. With the podspec at the root, both
source trees are 'inside' the pod's working directory and can be globbed
without using `..` paths:

    core.source_files = [
      'platforms/swift/Sources/ShopifyCheckoutKit/**/*.swift',
      'protocol/languages/swift/Sources/ShopifyCheckoutProtocol/**/*.swift',
    ]

Other changes:
  * License path simplified from '../../LICENSE' to 'LICENSE'.
  * AcceleratedCheckouts subspec source/resource paths re-rooted similarly.
  * Updated docs that referenced the old podspec path
    (.github/CONTRIBUTING.md, .github/pull_request_template.md).
  * Restored protocol/languages/swift/{Package.swift,README.md,.gitignore}.
  * Root Package.swift target paths point back at protocol/languages/swift.
  * #if !COCOAPODS guards in ShopifyCheckoutKit are kept (under CocoaPods both
    targets compile into one module, so the import would be unresolvable).

RESULT: works.

  bundle exec pod lib lint ShopifyCheckoutKit.podspec --allow-warnings
    -> ShopifyCheckoutKit passed validation.

Both subspecs (Core and AcceleratedCheckouts) build cleanly. The only
diagnostics are the pre-existing JSONAny Sendable warnings in the generated
Models.swift, identical to PR #65's baseline.

Lint must be invoked from the repo root, e.g.:
  BUNDLE_GEMFILE=platforms/swift/Gemfile bundle exec pod lib lint \
    ShopifyCheckoutKit.podspec --allow-warnings

Trade-offs vs PR #65:
  + No duplicated source tree; protocol files live in one place.
  + No #if !COCOAPODS source-import guards needed beyond what PR #65 already
    added (kept for safety).
  - Podspec lives at the repo root, slightly unusual for a multi-platform
    monorepo. CONTRIBUTING.md / PR template updated to reflect the new path.
  - The Gemfile remains under platforms/swift/, so contributors need to set
    BUNDLE_GEMFILE when running pod commands from the root (or we move the
    Gemfile too in a follow-up).
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/ko/podspec-hoisted-to-repo-root branch from 487e5eb to 61fa482 Compare May 13, 2026 10:12
@markmur markmur force-pushed the swift/remove-delegations branch 2 times, most recently from e1e9d50 to 3241a78 Compare May 13, 2026 11:50
Base automatically changed from swift/remove-delegations to main May 13, 2026 11:56
An error occurred while trying to automatically change base from swift/remove-delegations to main May 13, 2026 11:57
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