Skip to content

INTER-2622: Derive podspec Fingerprint-iOS version from Package.swift - #285

Open
kevinmia wants to merge 1 commit into
mainfrom
chore/INTER-2622-podspec-reads-package-swift
Open

kevinmia wants to merge 1 commit into
mainfrom
chore/INTER-2622-podspec-reads-package-swift

Conversation

@kevinmia

@kevinmia kevinmia commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Ticket: https://fingerprintjs.atlassian.net/browse/INTER-2622

Mirroring the approach in the Flutter SDK's podspec. Note that the regex also tolerates the multi-line .package(...) layout used in sdk/Package.swift.

Testing: Temporarily set Package.swift to 4.2.3, where it resolved to >= 4.2.3, < 4.3.0.

@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

⚠️ This PR doesn't contain any changesets. If there are user-facing changes, don't forget to run:

pnpm exec changeset

to create a changeset.

@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Coverage report

St.❔
Category Percentage Covered / Total
🟢 Statements 91.35% 243/266
🟢 Branches 87.55% 211/241
🟢 Functions 84.21% 48/57
🟢 Lines 90.98% 232/255

Test suite run success

95 tests passing in 6 suites.

Report generated by 🧪jest coverage report action from 60a991a

Show full coverage report
St File % Stmts % Branch % Funcs % Lines Uncovered Line #s
🟢 All files 91.35 87.55 84.21 90.98
🟢  src 91.35 87.55 84.21 90.98
🟢   FingerprintClient.ts 100 90 100 100 22,41,54
🔴   FingerprintClient.web.ts 0 0 0 0 6-64
🟡   FingerprintContext.ts 66.66 100 0 66.66 6
🟢   FingerprintProvider.tsx 100 100 100 100
🟡   errors.ts 75 50 50 75 3,120
🟢   getOptionsCacheKey.ts 84 83.33 100 83.33 10,33,43,52
🔴   index.ts 0 0 0 0
🟢   tags.ts 95 94.44 100 95 31
🔴   types.ts 0 0 0 0
🟢   unwrapError.ts 100 88.46 100 100 18-19,40
🟢   unwrapError.web.ts 100 100 100 100
🔴   useFingerprint.ts 0 0 0 0 24-28
🟢   usePromiseStore.ts 100 100 100 100
🟢   useVisitorData.ts 95.91 85.71 90 95.74 166-167
🟢   utils.ts 98.57 97.36 90 98.48 10
🔴  src/specs 0 0 0 0
🔴   NativeRNFingerprint.ts 0 0 0 0

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The version regex can silently select an unrelated package requirement.

1 open finding
What changed in this PR

Derives the CocoaPods Fingerprint-iOS range from the SwiftPM manifest.

Changes:

  • Reads the lower version from Package.swift.
  • Computes the next-minor upper bound.
  • Applies the derived range to the pod dependency.
File Description
sdk/​RNFingerprint.podspec Synchronizes the CocoaPods dependency range with SwiftPM.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread sdk/RNFingerprint.podspec
@@ -1,3 +1,9 @@
# Keep CocoaPods and Swift Package Manager on the same patch range (Package.swift is the source of truth).
fingerprint_lower = File.read(File.join(__dir__, 'Package.swift'))[/\.upToNextMinor\(\s*from:\s*"([\d.]+)"\s*\)/m, 1]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we'll ever use any other dependency in the native module. We can still address it just to be extra safe; your call @kevinmia. One note: if we decide to address it, we should do the same in Flutter.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is your call. I like the suggested change because it is, even though crowded, a lot easier to make sense of because it explicitly mentions the repo URL. It is up to you guys, either way is fine

Comment thread sdk/RNFingerprint.podspec

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: perhaps it would be useful to add a comment next to the Fingerprint-iOS in Package.swift that mentions which version format should be used so that the sync works here?

This branch has not been deployed

No deployments
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.

4 participants