Skip to content

Add project validation for Watch app and App Clip embedding#43

Closed
EvanBacon wants to merge 1 commit intomainfrom
add-project-validation
Closed

Add project validation for Watch app and App Clip embedding#43
EvanBacon wants to merge 1 commit intomainfrom
add-project-validation

Conversation

@EvanBacon
Copy link
Owner

Summary

  • Adds validateProject() function to detect common App Store submission issues before upload
  • Catches Watch app embedding errors that cause "The bundle is not contained in a correctly named directory. It should be under Watch."
  • Also validates App Clip embedding configuration
  • Fixes AnyBuildPhase export to use export type since it's a type alias

Validation Checks

Code Description
WATCH_EMBED_MISSING No "Embed Watch Content" build phase in main target
WATCH_EMBED_WRONG_PATH dstPath is not $(CONTENTS_FOLDER_PATH)/Watch
WATCH_EMBED_WRONG_SUBFOLDER dstSubfolderSpec is not 16 (Products Directory)
WATCH_NOT_IN_EMBED Watch app product not in embed phase files
APPCLIP_EMBED_* Same checks for App Clips

Usage

import { XcodeProject, validateProject } from '@bacons/xcode';

const project = XcodeProject.open('path/to/project.pbxproj');
const issues = validateProject(project);

for (const issue of issues) {
  console.log(`[${issue.severity}] ${issue.code}: ${issue.message}`);
}

Test plan

  • Added validation tests for watch app embedding
  • Tests pass with bun test
  • Full test suite passes (620 tests)

🤖 Generated with Claude Code

Adds validateProject() function to detect common App Store submission
issues before upload:

- WATCH_EMBED_MISSING: Missing "Embed Watch Content" build phase
- WATCH_EMBED_WRONG_PATH: dstPath not set to $(CONTENTS_FOLDER_PATH)/Watch
- WATCH_EMBED_WRONG_SUBFOLDER: dstSubfolderSpec not set to 16
- WATCH_NOT_IN_EMBED: Watch product not included in embed phase
- APPCLIP_EMBED_*: Same checks for App Clips

This catches the "The bundle is not contained in a correctly named
directory. It should be under Watch." error before App Store submission.

Also fixes AnyBuildPhase export to use `export type` since it's a type alias.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@EvanBacon EvanBacon closed this Feb 28, 2026
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