Files
fba61f409c Support different modes for depending on RevenueCat when using Tuist (#5888)
* WIP

* Merge branch 'main' into default-tuist-to-local-swift-package

* Cleanup

* Merge branch 'main' into default-tuist-to-local-swift-package

* Fix error with RevenueCatUI

* Removes project v3LoadShedderIntegration from tuist integration

* Add both CI.xcconfig and Local.xcconfig if they are both available

* Remove unnecessary package

* Remove purchases-ios as s tuist dependency

It's already resolved in Tuist/ProjectDescriptionHelpers/ProjectDescriptionPackages.swift

* New tuist project "RevenueCatTests" containing all test targets

* Merge branch 'main' into default-tuist-to-local-swift-package

* Fix Tuist dependency mode issues and clean up project structure

- Use exhaustive switch in ProjectDescriptionPackages instead of if/else if
- Extract shared allDestinations/allDeploymentTargets into ProjectDescriptionHelpers (DRY)
- Fix duplicate ReceiptParser scheme across RevenueCat and RevenueCatTests projects
- Remove stale cross-project test target references from schemes
- Fix bundleId typo in BackendCustomEntitlementsIntegrationTests
- Restore purchases-ios in Tuist/Package.swift for remoteXcodeProject mode
- Make RevenueCat/RevenueCatUI workspace inclusion conditional on dependency mode
- Fix BinarySizeTest to use shared dependency helpers instead of removed APIs
- Fix misleading doc comments on internal dependency helpers

Co-authored-by: Cursor <cursoragent@cursor.com>

* Remove and gitignore file

* Fix Bundle.module ambiguity in RevenueCatUITests and add explicit scheme

Use Bundle.revenueCatUI instead of Bundle.module to resolve ambiguity
when both RevenueCat and RevenueCatUI are imported via @testable in SPM
modes (each module synthesises its own internal Bundle.module).

Add explicit RevenueCatUITests scheme to RevenueCatTests project for
proper scheme generation during full tuist generate.

Made-with: Cursor

* Fix BinarySizeTest localSource deps and remove dead code

Revert BinarySizeTest localSource to explicit .project(target:)
references — it manages its own integration modes independently of
DependencyMode, and the switch to .revenueCat/.revenueCatUI broke it
in the default localSwiftPackage mode (no SPM package declared).

Remove unused allDeploymentTargets constant from RevenueCatUI project.

Made-with: Cursor

* Add priority flush with rate limiting and queuing for feature events

Priority events (paywall impressions, custom paywall events) now trigger
an immediate flush to the backend. A rate limiter (5 calls/60s) prevents
excessive network requests from rapid tracking calls. When a priority
event arrives during an in-progress flush, it is queued and drained
after the current flush completes.

* Extract EventsManagerStrings to separate file to fix file length lint

* Fix integration tests: use non-priority events for flush tests

The `.impression` event now triggers a priority flush, which can
consume the event before the test's explicit `flushPaywallEvents`
call. Replace with `.cancel` (non-priority) since these tests
verify flush mechanics, not event-type behavior.

* Fix duplicate RevenueCat targets in localSwiftPackage mode

Exclude RevenueCat/RevenueCatUI Tuist projects from the workspace when
using localSwiftPackage dependency mode, since the local SPM package
already provides these targets. Including both caused "Multiple commands
produce" build errors (e.g. in the BinarySizeTest CI job).

Also update BinarySizeTest's localSource integration to use SPM package
dependencies instead of Tuist project target references, consistent with
the workspace no longer including those projects in SPM mode.

Made-with: Cursor

* Move rate limiter check to drain phase to prevent queued events from exhausting capacity

When multiple priority events arrived during an in-progress flush, each
one called shouldProceed() on the rate limiter but they all coalesced
into a single pending flush. This wasted rate limiter capacity without
performing actual flushes. Now the rate limiter is only checked when a
flush actually starts in startPendingPriorityFlushIfNeeded().

* Add missing packages declaration to RCTTester project

RCTTester uses .revenueCat and .revenueCatUI dependencies which resolve
to SPM package products in localSwiftPackage mode, but was missing the
packages: .projectPackages declaration needed to provide the package source.

Made-with: Cursor

* Fix Bundle.module resolution for RevenueCatUI snapshot tests

Use #if SWIFT_PACKAGE to select the correct resource bundle in test code:
- SPM builds (CI): Bundle.module resolves to the test target's bundle,
  which contains the test images (header.heic, background.heic)
- Tuist builds: Bundle.revenueCatUI resolves to RevenueCatUI's bundle,
  avoiding ambiguity between multiple Bundle.module definitions

Made-with: Cursor

* Remove internal jwsRepresentation from ObjC API tester

jwsRepresentation is @objc internal on StoreTransaction — it is not part
of the public API (absent from .swiftinterface files). Previously this
compiled because Tuist framework targets expose internal @objc members
in the generated -Swift.h header, but SPM packages only expose public
members.

Made-with: Cursor

* Revert "Merge remote-tracking branch 'origin/rickvdl/priority-flush-events' into default-tuist-to-local-swift-package"

This reverts commit aa585aa9c2, reversing
changes made to 7d10a496ad.

* Restore BinarySizeTest localSource to use Xcode project targets

localSource now uses .project(target:path:) like on main, with
TUIST_RC_XCODE_PROJECT=true set in CI so the workspace includes the
RevenueCat/RevenueCatUI projects. spm uses local SPM package refs.

Added documentation explaining why BinarySizeTest manages its own
dependency integration independently of Environment.dependencyMode.

Made-with: Cursor

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Facundo Menzella <facumenzella@users.noreply.github.com>
Co-authored-by: Rick van der Linden <rick.vanderlinden@revenuecat.com>
2026-03-06 16:33:28 +01:00

39 lines
1.0 KiB
Swift

import ProjectDescription
import ProjectDescriptionHelpers
let project = Project(
name: "MagicWeatherApp",
organizationName: .revenueCatOrgName,
packages: .projectPackages,
settings: .appProject,
targets: [
.target(
name: "MagicWeather",
destinations: .iOS,
product: .app,
bundleId: "com.revenuecat.sampleapp",
deploymentTargets: .iOS("15.0"),
infoPlist: .extendingDefault(
with: [
"UILaunchScreen": [
"UIColorName": "",
"UIImageName": "",
]
]
),
sources: [
"MagicWeather/Sources/**/*.swift",
"MagicWeather/Constants.swift"
],
resources: [
"MagicWeather/Resources/**/*.xcassets",
],
dependencies: [
.revenueCat,
.revenueCatUI,
],
settings: .appTarget
)
]
)