Skip to content

Centralize sample storefront configuration#175

Open
kyle-schellen wants to merge 1 commit into
05-12-align_workspace_dev_commands_in_root_dev.ymlfrom
ks-shared-storefront-env
Open

Centralize sample storefront configuration#175
kyle-schellen wants to merge 1 commit into
05-12-align_workspace_dev_commands_in_root_dev.ymlfrom
ks-shared-storefront-env

Conversation

@kyle-schellen
Copy link
Copy Markdown
Contributor

@kyle-schellen kyle-schellen commented May 20, 2026

Depends on #69.

Stack position

This PR is the shared storefront configuration layer. It builds on the root dev.yml command foundation by introducing one repo-root sample configuration source and syncing it into the platform-specific files that Android, Swift, and React Native already consume.

The next PR wires this into repo setup/bootstrap commands. This PR intentionally keeps the entry point as the direct script, scripts/setup_storefront_env, so the configuration flow is reviewable on its own.

What changes

  • Adds a repo-root .env.example with shared sample storefront, Customer Account API, Apple Pay, and buyer identity fields.
  • Adds scripts/setup_storefront_env to create, normalize, sync, and check generated platform config files from the root .env.
  • Adds scripts/test_setup_storefront_env coverage for required-only setup, optional value sync, stale generated config detection, migration from older config shapes, and sanitized setup output.
  • Updates Android sample config loading so it reads the shared field names while preserving compatibility for existing PREFILL_EMAIL / PREFILL_PHONE values.
  • Updates Swift sample config examples and build checks so sample builds fail with a clear setup message when generated storefront config is missing or stale.
  • Updates the React Native sample to use API_VERSION, keep STOREFRONT_VERSION as a fallback, and log whether config values are present instead of printing local values.
  • Updates CI sample-build/test jobs to generate synthetic storefront config through the shared setup script.

Review notes

The platform-local .env.example / Storefront.xcconfig.example files remain as local examples, but they now point contributors toward the root .env.example plus scripts/setup_storefront_env as the preferred shared setup path.

Android schema download still reads the Android sample .env and prints the endpoint details during that human-invoked command. The shared setup script itself only prints file paths/status and avoids echoing configured values.

How to test

  • bash -n scripts/setup_storefront_env scripts/test_setup_storefront_env
  • scripts/test_setup_storefront_env
  • scripts/setup_storefront_env --check
  • With local sample values present, run scripts/setup_storefront_env and confirm these generated files are updated consistently:
    • platforms/android/samples/MobileBuyIntegration/.env
    • platforms/react-native/sample/.env
    • platforms/swift/Samples/MobileBuyIntegration/Storefront.xcconfig
    • platforms/swift/Samples/ShopifyAcceleratedCheckoutsApp/Storefront.xcconfig

Before you merge

Important

  • I've added tests to support my implementation
  • I have read and agree with the Contribution Guidelines
  • I have read and agree with the Code of Conduct
  • I've updated the relevant platform README (platforms/swift/README.md and/or platforms/android/README.md)

Releasing a new Swift version?
  • I have bumped the version in platforms/swift/ShopifyCheckoutKit.podspec
  • I have bumped the version in platforms/swift/Sources/ShopifyCheckoutKit/ShopifyCheckoutKit.swift
  • I have updated platforms/swift/CHANGELOG.md
  • I have updated the SwiftPM/CocoaPods version snippets in platforms/swift/README.md (major version only)
Releasing a new Android version?
  • I have bumped the versionName in platforms/android/lib/build.gradle
  • I have updated platforms/android/CHANGELOG.md
  • I have updated the Gradle/Maven version snippets in platforms/android/README.md

Tip

See the Contributing documentation for the full release process per platform.

Copy link
Copy Markdown
Contributor Author

kyle-schellen commented May 20, 2026

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 20, 2026

React Native — Coverage Report

Lines Statements Branches Functions
Coverage: 95%
95.26% (181/190) 92.03% (104/113) 100% (56/56)

@kyle-schellen kyle-schellen force-pushed the 05-12-align_workspace_dev_commands_in_root_dev.yml branch from c4e0c6b to ad39f4f Compare May 20, 2026 23:46
@kyle-schellen kyle-schellen force-pushed the ks-shared-storefront-env branch from d2be551 to e86923e Compare May 20, 2026 23:46
@kyle-schellen kyle-schellen self-assigned this May 20, 2026
@kyle-schellen kyle-schellen force-pushed the 05-12-align_workspace_dev_commands_in_root_dev.yml branch from ad39f4f to 1bf5d08 Compare May 20, 2026 23:59
@kyle-schellen kyle-schellen force-pushed the ks-shared-storefront-env branch from e86923e to 06f9f45 Compare May 20, 2026 23:59
@kyle-schellen kyle-schellen force-pushed the 05-12-align_workspace_dev_commands_in_root_dev.yml branch from 1bf5d08 to 8575e24 Compare May 21, 2026 00:36
@kyle-schellen kyle-schellen force-pushed the ks-shared-storefront-env branch from 06f9f45 to 0e9dc0f Compare May 21, 2026 00:36
@kyle-schellen kyle-schellen marked this pull request as ready for review May 21, 2026 01:07
@kyle-schellen kyle-schellen requested a review from a team as a code owner May 21, 2026 01:07
@kyle-schellen kyle-schellen force-pushed the ks-shared-storefront-env branch from 0e9dc0f to 8ebd042 Compare May 21, 2026 12:51
@kyle-schellen kyle-schellen force-pushed the 05-12-align_workspace_dev_commands_in_root_dev.yml branch from 8575e24 to 83df290 Compare May 21, 2026 12:51
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