Skip to content

Syntaxkit claude#12

Merged
leogdion merged 52 commits intosyntaxkitfrom
syntaxkit-claude
Aug 30, 2025
Merged

Syntaxkit claude#12
leogdion merged 52 commits intosyntaxkitfrom
syntaxkit-claude

Conversation

@leogdion
Copy link
Copy Markdown
Member

No description provided.

leogdion and others added 20 commits August 26, 2025 19:52
- Add SwiftPackageManagerKit library target to Package.swift
- Create Sources/SwiftPackageManagerKit directory structure with Models, Execution, Analysis, Validation, and Utilities subdirectories
- Add initial SwiftPackageManagerKit.swift with version info
- Verify target builds successfully
- Complete task 1.1: SwiftPackageManagerKit target setup

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
…tion Process

- Implement comprehensive SPM JSON model classes (SPMPackageInfo, SPMProduct, SPMTarget, SPMDependency, SPMPlatform)
- Create ProcessRunner using Foundation Process with async/await wrapper
- Add SPMExecutor with methods for dump-package, resolve, build, and test operations
- Support timeout handling, error management, and working directory configuration
- Add integration test methods to verify full stack functionality
- All models handle complex nested JSON structure from swift package dump-package
- Complete subtasks 1.1, 1.2, and 1.3 with working implementation

Next: Will upgrade to Swift 6.1 and implement swift-subprocess properly

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Implement SPMAnalyzer for package data parsing
- Add SPMValidator with structure, version, and platform validation
- Mark task 1 and subtasks as complete
- Add comprehensive analysis and validation capabilities

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Add main SDK entry point with builder pattern foundation:
- PackageDSLManager class with @mainactor and Sendable compliance
- Properties for package configuration (URL, name, products, targets, dependencies)
- Initialization methods with package URL and optional custom name
- createPackage method supporting library/executable/empty types
- Builder pattern with fluent API design
- Internal specifications property for PackageSpecifications conversion

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add generatePackageSwift() method to PackageDSLManager
- Integrate with existing PackageWriter for DSL component file generation
- Add helper methods hasDSLComponents() and hasTraditionalPackageSwift()
- Implement proper error handling with PackageError mapping
- Create integration tests for PackageDSLManager functionality
- Task 2.5 marked for review - core SDK implementation nearly complete

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit completely removes SwiftSyntax dependencies from PackageDSLKit core while preserving all functionality through SyntaxKit integration and SPM JSON parsing.

## Key Changes

### 🗑️ SwiftSyntax Dependencies Removed
- Removed swift-syntax dependency from Package.swift
- Removed SwiftSyntax, SwiftParser, SwiftSyntaxBuilder products from PackageDSLKit target
- SyntaxKit package remains isolated and can continue using SwiftSyntax internally

### 🔄 Parsing Architecture Migration
- **PackageParser**: Migrated from SwiftSyntax parsing to SPM JSON parsing via SPMExecutor.dumpPackage()
- **PackageIndexWriter**: SwiftSyntax code generation replaced with SyntaxKit alternatives
- **SupportCodeBlock**: Replaced SwiftSyntax parsing with direct string reading
- **PropertyWriter**: Now uses SyntaxKit's Literal.ref() instead of direct SwiftSyntax types

### 🗂️ Removed Legacy Files
- PropertyVisitor.swift (SwiftSyntax-based parsing)
- PackageVisitor.swift (SwiftSyntax-based parsing)
- ParsingStrategy.swift (SwiftSyntax-based parsing)
- StructureStrategy.swift (SwiftSyntax-based parsing)
- PackageIndexStrategy.swift (SwiftSyntax-based parsing)
- ImportDeclSyntax.swift (deprecated, replaced by SyntaxKit)
- ParsingResult.swift (SwiftSyntax-based data structures)

### ✨ New SPM Integration
Created SPM → PackageDSLKit conversion initializers:
- Product.init(spmProduct:) - Converts SPM products to PackageDSLKit products
- Dependency.init(smpDependency:) - Converts SPM dependencies
- Target.init(smpTarget:) - Converts regular/executable targets
- TestTarget.init(smpTarget:) - Converts test targets
- SupportedPlatformSet.init(smpPlatforms:) - Converts platform requirements

### 🔧 Infrastructure Updates
- Updated CLI commands to use AsyncParsableCommand for async PackageParser
- Fixed PackageWriter to support Target.self component type
- Replaced SwiftSyntax-based PackageDirectoryConfiguration with SPM-based initialization

### ✅ Clean Architecture
- **PackageDSLKit**: SwiftSyntax-free, uses SPM JSON parsing and SyntaxKit for code generation
- **SyntaxKit**: Isolated package continuing to use SwiftSyntax internally (as intended)
- **Clear separation**: PackageDSLKit → SPM + SyntaxKit, SyntaxKit → SwiftSyntax

All tests pass. Build successful. SwiftSyntax removal complete.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
…egration tests

- Add generateTraditionalPackageSwift() method for SPM compatibility
- Fix validate() method to generate proper Package.swift for SPM validation
- Make ValidationResult Sendable to resolve concurrency issues
- Add comprehensive integration tests:
  - Complex package configuration with multiple targets/products/dependencies
  - Full SPM command validation (dump-package, resolve, build)
  - DSL and traditional Package.swift coexistence testing
  - Real Swift package creation and compilation verification

All PackageDSLManager tests now pass with full SPM integration validation.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
…ame files

- Remove SPM prefix from all types (SPMPackageInfo -> PackageInfo, SPMTarget -> Target, etc.)
- Rename all corresponding files to match new type names
- Remove namespace-conflicting SwiftPackageManagerKit struct
- Update all cross-module references to use proper qualification
- All tests passing with cleaner, more intuitive API

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
subrepo:
  subdir:   "Packages/SyntaxKit"
  merged:   "03359e2"
upstream:
  origin:   "git@github.com:brightdigit/SyntaxKit.git"
  branch:   "packagedslkit"
  commit:   "03359e2"
git-subrepo:
  version:  "0.4.9"
  origin:   "https://github.com/Homebrew/brew"
  commit:   "4d14be89e9"
subrepo:
  subdir:   "Packages/SyntaxKit"
  merged:   "e378d09"
upstream:
  origin:   "git@github.com:brightdigit/SyntaxKit.git"
  branch:   "packagedslkit"
  commit:   "e378d09"
git-subrepo:
  version:  "0.4.9"
  origin:   "https://github.com/Homebrew/brew"
  commit:   "4d14be89e9"
…ency

- Remove custom validation logic from PackageSpecifications
- Add back conditional swift-log dependency for non-Apple platforms
- Improve SwiftPackageManagerKit model parsing reliability
- Clean up debug output and error handling in dependency parsing

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Aug 27, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch syntaxkit-claude

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@codecov
Copy link
Copy Markdown

codecov bot commented Aug 27, 2025

Codecov Report

❌ Patch coverage is 37.77336% with 1252 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (syntaxkit@5444948). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...ces/SwiftPackageManagerKit/Analysis/Analyzer.swift 0.00% 104 Missing ⚠️
...Types/PackageDSLManager+DependencyManagement.swift 23.93% 89 Missing ⚠️
...urces/PackageDSLKit/Types/VersionRequirement.swift 21.42% 88 Missing ⚠️
...Kit/Types/PackageDSLManager+TargetManagement.swift 36.93% 70 Missing ⚠️
...geDSLKit/Types/PackageDirectoryConfiguration.swift 20.00% 68 Missing ⚠️
...rces/PackageDSLKit/Types/FileManager+Helpers.swift 0.00% 57 Missing ⚠️
...ackageManagerKit/Execution/Executor+Commands.swift 54.54% 55 Missing ⚠️
...ces/SwiftPackageManagerKit/Models/Dependency.swift 0.00% 52 Missing ⚠️
Sources/PackageDSLKit/Types/Product.swift 11.53% 46 Missing ⚠️
...tPackageManagerKit/Models/VersionRequirement.swift 0.00% 44 Missing ⚠️
... and 42 more
Additional details and impacted files
@@             Coverage Diff              @@
##             syntaxkit      #12   +/-   ##
============================================
  Coverage             ?   16.56%           
============================================
  Files                ?      191           
  Lines                ?     8215           
  Branches             ?        0           
============================================
  Hits                 ?     1361           
  Misses               ?     6854           
  Partials             ?        0           
Flag Coverage Δ
spm 16.53% <37.72%> (?)
swift-6.1-jammy 16.55% <37.72%> (?)
swift-6.1-jammynightly 16.55% <37.72%> (?)
swift-6.1-noble 16.55% <37.72%> (?)
swift-6.1-noblenightly 16.55% <37.72%> (?)
swift-6.2-jammynightly 16.55% <37.72%> (?)
swift-6.2-noblenightly 16.55% <37.72%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

leogdion and others added 24 commits August 27, 2025 17:24
- Split 545-line PackageDSLManager.swift into smaller, manageable files
- Create separate extensions for different responsibilities:
  - PackageDSLManager+ProductManagement.swift - Product operations
  - PackageDSLManager+DependencyManagement.swift - Dependency operations
  - PackageDSLManager+FluentAPI.swift - Convenience methods
  - PackageDSLManager+TargetManagement.swift - Target and package creation
- Change fileprivate(set) to internal(set) for extension access
- Use explicit internal import Foundation statements
- Fix critical file length linting error (545 → 121 lines in main file)
- Maintain all existing functionality and API compatibility

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Split VersionRequirement.asSPMString() into smaller methods to reduce cyclomatic complexity
- Extract Executor methods into separate extension files:
  - Executor+Commands.swift: SPM command methods (dumpPackage, buildPackage, etc.)
  - Executor+Utilities.swift: Convenience utility methods
- Centralize error handling in handleProcessRunnerError() method
- Reduce main Executor.swift from 249 lines to 83 lines
- Maintain same public API with no breaking changes
- Update ProcessRunner with typed throws syntax

Fixes file length and cyclomatic complexity linting violations.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
* "Claude PR Assistant workflow"

* "Claude Code Review workflow"
@leogdion leogdion merged commit b2f548c into syntaxkit Aug 30, 2025
43 of 44 checks passed
@leogdion leogdion deleted the syntaxkit-claude branch August 30, 2025 02:14
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