Professional-grade Nx plugins for Apple ecosystem development
The Nx Apple Development Toolkit is a comprehensive collection of Nx plugins designed to streamline iOS, macOS, watchOS, and tvOS development within Nx monorepos. This toolkit empowers Apple developers to leverage Nx's powerful build system, dependency management, and workspace organization capabilities while maintaining native Swift development workflows.
- Unified Toolchain: Manage Swift packages, iOS apps, and shared libraries in a single workspace
- Intelligent Caching: Nx's computational caching dramatically reduces build times
- Dependency Management: Automatic detection and management of cross-project dependencies
- Developer Experience: Consistent tooling across platforms with integrated VS Code support
- Scalability: Proven architecture for large-scale development teams and complex projects
This monorepo contains several specialized Nx plugins:
The flagship plugin providing comprehensive Swift Package Manager integration:
- Automatic Project Detection: Seamlessly discovers Swift packages in your workspace
- Target Generation: Automatically creates build, test, and lint targets
- Dependency Management: Smart local and remote dependency resolution
- Code Generation: Scaffolds new Swift packages with best practices
- Cross-Platform Support: Full support for macOS, iOS, watchOS, and tvOS
Key Features:
- Zero-configuration setup for existing Swift packages
- Intelligent target inference with customizable commands
- Local workspace dependency graph integration
- Professional project scaffolding with modern Swift standards
- Node.js 18.x or later
- npm 8.x or later
- Swift 5.9 or later
- Xcode (for iOS/macOS development)
- Clone the workspace:
git clone <repository-url>
cd nx-apple-toolkit- Install dependencies:
npm install- Verify setup:
npx nx graph- Install the plugin:
npm install --save-dev @nx-apple/swift-package-manager- Configure in your workspace:
// nx.json
{
"plugins": [
{
"plugin": "@nx-apple/swift-package-manager",
"options": {
"buildCommand": "swift build",
"testCommand": "swift test",
"lintCommand": "swiftlint"
}
}
]
}- Generate your first Swift package:
npx nx generate @nx-apple/swift-package-manager:swift-package MyLibrary- Build and test:
npx nx build MyLibrary
npx nx test MyLibraryBuild all plugins in the workspace:
npx nx run-many -t buildBuild a specific plugin:
npx nx build swift-package-managerRun comprehensive test suites:
npx nx run-many -t testTest with coverage reporting:
npx nx test swift-package-manager --coverageMaintain code quality across the workspace:
npx nx run-many -t lint
npx nx format:checkTest plugin changes locally before publishing:
- Build the plugin:
npx nx build swift-package-manager- Link locally:
cd tools/swift-package-manager
npm link- Test in a sample project:
cd /path/to/test-project
npm link @nx-apple/swift-package-managerWhen ready to release:
- Version and publish:
npx nx release- Dry run to preview changes:
npx nx release --dry-runnx-apple-toolkit/
├── tools/ # Nx plugin implementations
│ └── swift-package-manager/ # Swift Package Manager plugin
│ ├── src/
│ │ ├── executors/ # Task executors
│ │ ├── generators/ # Code generators
│ │ └── lib/ # Core utilities
│ ├── README.md # Plugin documentation
│ └── package.json # Plugin configuration
├── packages/ # Future: Additional packages
├── docs/ # Comprehensive documentation
├── nx.json # Nx workspace configuration
├── package.json # Workspace dependencies
└── README.md # This file
The plugins integrate seamlessly with Nx's advanced features:
- Project Graph: Visualize dependencies between Swift packages
- Affected Commands: Build only what changed
- Distributed Task Execution: Scale builds across multiple machines
- CI/CD Integration: Optimized for modern CI providers
Enhanced developer experience with:
- Nx Console: Visual interface for running tasks and generators
- Swift Language Support: Full Swift IntelliSense and debugging
- Integrated Terminal: Run Nx commands directly in VS Code
- Workspace Management: Navigate large codebases efficiently
apps/
├── ios-app/ # iOS application
├── macos-app/ # macOS application
└── shared-cli/ # Command-line tools
libs/
├── core/ # Core business logic
├── ui-components/ # Reusable UI components
├── networking/ # Network layer
└── utilities/ # Shared utilities
- Use local dependencies for packages within the workspace
- Leverage semantic versioning for external dependencies
- Maintain dependency graphs for clear project relationships
- Regular dependency audits for security and performance
- Unit tests for individual components
- Integration tests for cross-package functionality
- E2E tests for complete application flows
- Performance tests for critical paths
We welcome contributions from the community! Please see our Contributing Guidelines for details.
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes and add tests
- Ensure all tests pass:
npx nx run-many -t test - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Submit a pull request
- TypeScript: Strict mode enabled with comprehensive type coverage
- ESLint: Enforced code style and best practices
- Prettier: Consistent code formatting
- Jest: Comprehensive test coverage (>90%)
- Documentation: TSDoc comments for all public APIs
- Documentation: Comprehensive guides and API references
- Examples: Real-world usage examples and templates
- Blog Posts: Technical deep-dives and best practices
- Video Tutorials: Step-by-step development guides
- GitHub Issues: Bug reports and feature requests
- Discussions: Community Q&A and general discussion
- Discord: Real-time community support
- Stack Overflow: Tag questions with
nx-apple
- Xcode Project Integration: Native Xcode project generation
- CocoaPods Support: Legacy dependency management
- Carthage Integration: Additional dependency manager support
- SwiftUI Previews: Integrated preview support
- Performance Monitoring: Build time optimization tools
- Complete Apple Ecosystem: Support for all Apple platforms
- Enterprise Features: Advanced team collaboration tools
- Cloud Integration: Seamless CI/CD and deployment
- Developer Tools: Enhanced debugging and profiling
This project is licensed under the MIT License - see the LICENSE file for details.