Conversation
Major architectural simplification that eliminates template processing complexity
and unifies CI workflows for both template and generated projects.
## Changes
### Eliminated Complexity
- Removed templates/ directory entirely
- Deleted template-validation.yml (redundant)
- Replaced complex template processing with simple in-place sed replacement
- setup.sh: 1,244 lines → 368 lines (70% reduction)
- CI workflow: 217 lines → 95 lines (56% reduction)
### New Architecture
- Files now live in their final locations with {{PLACEHOLDERS}}
- MyProject/ is placeholder directory (gets renamed during setup)
- Single unified ci.yml that auto-configures when needed
- Same workflow works for template repo and generated projects
### Improvements
- Simpler mental model: files are where they live
- No template copying, just in-place replacement
- Can run setup.sh on template repo immediately
- CI detects unconfigured state and auto-runs setup
- Local and CI use identical scripts (no duplication)
### Fixed
- Pre-commit hook now works correctly from .git/hooks/
- Uses git rev-parse to find repo root reliably
- Sources _helpers.sh from correct location
## Benefits
1. **Easier to understand**: See actual project structure immediately
2. **Easier to maintain**: One CI workflow instead of two
3. **Faster setup**: Simple sed replacement vs template processing
4. **Same CI everywhere**: Template and generated repos use identical workflow
5. **Better DX**: Preview project structure before setup
Co-Authored-By: Claude <noreply@anthropic.com>
Implements two setup modes to support different workflows: 1. ADOPT mode (primary): Integrate with existing Xcode projects 2. GENERATE mode (secondary): Create minimal project for quick starts ## Key Changes ### Removed - MyProject/, MyProjectTests/, MyProjectUITests/ placeholder directories - No more checked-in placeholder code - Removed rename_directories() function (obsolete) ### Added Setup Modes **ADOPT Mode (Primary Workflow)** - Detects existing .xcodeproj automatically - Configures tooling around existing project structure - Respects Xcode-generated code and templates - Optional directory structure creation with --structure flag **GENERATE Mode (Quick Start)** - Creates minimal UIKit project on-demand - Generates AppDelegate, SceneDelegate, ViewController - Creates test targets with swift-testing - Configurable structure: mvvm, clean, or none ### New setup.sh Features - `--generate-minimal`: Force generation mode - `--structure <type>`: Choose directory structure (mvvm/clean/none) - Auto-detection: Checks for .xcodeproj and chooses mode intelligently - Helpful error messages when mode is ambiguous ### Functions Added - `detect_project_mode()`: Auto-detect adopt vs generate - `generate_minimal_project()`: Create minimal Swift files - `create_directory_structure()`: Flexible structure creation - `adopt_existing_project()`: Verify and configure existing project ### CI Updates - Uses `--generate-minimal` flag for template testing - Explicitly specifies `--structure mvvm` for clarity - Better detection message (distinguishes template vs derived repos) ### Documentation Updates - CLAUDE.md: Comprehensive dual-mode workflow documentation - setup.sh: Enhanced help with examples for both modes - Clear primary vs secondary workflow guidance ## Benefits 1. **Xcode-first workflow**: Use any Xcode template, add automation 2. **Flexibility**: Quick start still available with --generate-minimal 3. **No confusion**: No placeholder MyProject/ sitting in repo 4. **Testable template**: CI generates and validates automatically 5. **Clean repository**: Only config files, no placeholder code ## Migration Users upgrading should: - Old workflow still works with --generate-minimal flag - New recommended workflow: Create in Xcode first, then adopt Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Completely redesigned how we use this template project. Now using Xcode project templates is the default workflow:
./scripts/setup.sh --project-name YourAppIt is still possible to generate a simple project as well, which is what the CI will do if it does not find a configured project.yml.
Changes
Type of Change
Testing
./scripts/test.sh)./scripts/test.sh --ui)./scripts/build.sh)./scripts/lint.sh)./scripts/format.sh)Checklist