feat: Add build config & SonarCloud setup for CheckoutComponents#1630
feat: Add build config & SonarCloud setup for CheckoutComponents#1630bthebladeprimer wants to merge 3 commits into
Conversation
Add SonarCloud coverage exclusions for CheckoutComponents UI-only files, update podspec with localization and font resources, add Phrase translation config, CI workflow, design token tooling, and Claude Code rules/agents.
Generated by 🚫 Danger Swift against f16bfbd |
|
|
Appetize link: https://appetize.io/app/sq3qagx3azrnmucl552dcirayi |
| Package.*.swift,\ | ||
| **/CardComponentsManager.swift # Deprecated | ||
| **/CardComponentsManager.swift,\ | ||
| Sources/PrimerSDK/Classes/CheckoutComponents/Internal/Presentation/Screens/**/*,\ |
There was a problem hiding this comment.
not just CheckoutComponents/* ?
There was a problem hiding this comment.
Correct me if I am wrong, but these exclusions are not needed for this PR, correct? I would worry about merging them in then as I assume we want to get to a future (by release) where none of these exclusions exist? Might be easy to miss them and not get coverage reports as we present PRs with these files.
|
|
||
| // Custom styling for card number field | ||
| cardFormScope.cardNumberField = { label, styling in | ||
| AnyView( |
There was a problem hiding this comment.
Didn't we remove the need for AnyView for clients?
There was a problem hiding this comment.
We did. This is a leftover in the docs, thanks.
There was a problem hiding this comment.
should really be a separate pr
There was a problem hiding this comment.
If affects all PRs going forward/is not specific to CC
|
|
||
| phrase: | ||
| access_token: ${PHRASE_ACCESS_TOKEN} | ||
| project_id: 4ef09e68b0f08039c865e202d878b3e9 |
There was a problem hiding this comment.
This is hardcoded here, but appears to be prepended from the CI in .github/workflows/manual-translation-update-checkout-components.yml. Can we remove this - it is not clear which project ID will be present in the final file
| // Remove "CGFloat(" and the first ")" to extract the numeric expression. | ||
| let raw = token.value.replace(/CGFloat\$begin:math:text$/g, '').replace(/\\$end:math:text$/g, ''); | ||
| try { | ||
| value = Number(eval(raw)); |
There was a problem hiding this comment.
Low risk as these input files are controlled by us, but eval() is a code-injection vector should this code ever be used on merchant or user-facing input files
There was a problem hiding this comment.
Technically I believe we should be bundling the licence for this font with the SDK and disclosing its use somewhere.
There was a problem hiding this comment.
In the workspace diff, PrimerSwiftUIBridgeViewController.swift appears both under:
- CheckoutComponents/Internal/UI/ (new)
- Root/ (existing, from the old User Interface group)
Verify this isn't a duplicate file reference that could cause Xcode build conflicts.
There was a problem hiding this comment.
Not an approved MCP, so not useful to us right now
| "version": "0.0.0", | ||
| "type": "module", | ||
| "scripts": { | ||
| "build": "yarn run build-light && yarn run build-dark", |
There was a problem hiding this comment.
yarn here, but we have package-lock.json, not a yarn.lock. Also, README suggests to npm install. Worth tighening up these inconsistencies
| ```swift | ||
| // Example: Complete screen replacement | ||
| if let cardFormScope: DefaultCardFormScope = checkoutScope.getPaymentMethodScope(for: .paymentCard) { | ||
| cardFormScope.screen = { presentationContext in |
There was a problem hiding this comment.
Maybe a comment here as to if/how presentationContext should be used?



Summary
PrimerSDK.podspecwith resource paths forCheckoutComponentsLocalizablestrings andInterVariable.ttffontphrase_config_checkout_components.yml) and CI workflow for translation updatesContext
This is PR 1 of 15 in the CheckoutComponents PR split. It establishes build configuration and SonarCloud exclusions that all subsequent PRs depend on.
Tracking: Notion PR Review Tracker
Staging branch:
bn/feature/checkout-components-stagingTest plan
sonar-project.propertiesexclusion patterns are correct and completePrimerSDK.podspecbuilds withpod lib lint(no new Swift source yet).gitignoreadditions don't affect existing tracked files