Validate tvOS bundle identifiers#591
Conversation
Greptile SummaryThis PR adds a
Confidence Score: 3/5The validation logic is correct but the dry-run ship path returns the raw, un-normalized bundleId while the real ship path uses the trimmed value — callers relying on dry-run output to preview the exact ID used in production will see a different string if the input had surrounding whitespace. The packages/targets/tv-tvos/src/index.ts — specifically the Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[build / ship called] --> B[buildPlan]
B --> C[requireBundleId]
C --> D{bundleId present?}
D -- no --> E[throw: tv-tvos requires bundleId]
D -- yes --> F{matches BUNDLE_ID_PATTERN?}
F -- no --> G[throw: must be valid reverse-DNS identifier]
F -- yes --> H[return trimmed bundleId]
H --> I[artifactPath uses plan.bundleId ✓]
H --> J[archivePath uses plan.bundleId ✓]
H --> K[plan.bundleId in buildPlan result ✓]
K --> L{dryRun?}
L -- yes --> M["meta.bundleId: config.bundleId ⚠️ raw value"]
L -- no --> N["id: plan.bundleId@version ✓"]
K --> O["build log: config.bundleId ⚠️ raw value"]
|
| @@ -87,7 +98,7 @@ export default defineTarget<Config>({ | |||
| }; | |||
There was a problem hiding this comment.
Dry-run meta returns raw, un-normalized bundleId
The ship dry-run block returns bundleId: config.bundleId (line 93) while the actual-ship path returns plan.bundleId (line 101). plan.bundleId is the trimmed, validated value produced by requireBundleId. If a caller passes a bundleId with surrounding whitespace (e.g. " com.acme.tvos"), buildPlan will successfully validate and trim it, but the dry-run response will echo back the pre-trim value — diverging from the real ship result. The rest of this PR explicitly switched to plan.bundleId for the log and return ID; this one spot was missed.
Fixes #590.
Changes:
Validation: