-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: convert to monorepo structure with engine package #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: convert to monorepo structure with engine package #4
Conversation
- Move core engine source from src/ to packages/engine/src/ - Move tests from tests/ to packages/engine/tests/ - Update demo to reference engine as workspace dependency - Convert root package.json to monorepo workspace configuration - Update CI/CD workflows for new structure - Remove standalone documentation files (now in package)
Pull Request Review: Monorepo RefactorOverall AssessmentThis is a well-structured refactor that successfully converts the project to a monorepo structure. The changes are extensive but follow best practices for workspace management. The refactor maintains backward compatibility while improving the project organization. ✅ Strengths1. Clean Monorepo Architecture
2. Improved Build System
3. Good CI/CD Updates
4. Proper Git Configuration
5. Package Configuration
|
- Create @clockwork-engine/platform-memory package with MemoryPlatformLayer - Create @clockwork-engine/platform-web-pixi package with WebPlatformLayer - Rename packages/engine to packages/core - Move pixi.js and pixi-viewport dependencies to platform-web-pixi - Export platform utilities from core for use by platform packages - Update demo to import from new platform packages - Update all test imports to use new package names
Pull Request ReviewOverviewThis PR successfully converts the clockwork-engine project to a monorepo structure, splitting the platform-specific code into separate packages. Overall, this is a well-executed refactor with 188 changed files (+659/-1714 lines). The monorepo structure improves modularity and maintainability. Issues Found🔴 Critical: Coverage File Path Mismatch (.github/workflows/ci.yml:55)Issue: The coverage upload step references the wrong path: file: ./packages/engine/lcov.infoProblem: The package is named Fix Required: file: ./packages/core/lcov.infoBest Practices & Recommendations✅ Strengths
🟡 Minor Concerns
Code QualityArchitecture
TypeScript Usage
Build Configuration
Performance ConsiderationsBuild Performance
Development Experience
Security ConcernsDependencies
Package Publishing
Test CoverageTesting Strategy
Test Organization
SummaryThis is a well-executed monorepo refactor that successfully separates concerns and improves the project architecture. The code quality is high, and the migration is comprehensive. Required Changes:
Recommended Changes:
Approval Recommendation:Approve after fixing the critical coverage path issue. The other items are optional improvements that can be addressed in follow-up PRs. Review conducted following CLAUDE.md guidelines and Clockwork Engine architecture principles. |
- Add build scripts to platform-web-pixi and platform-memory packages - Update test server to serve platform-web-pixi bundle - Update browser test imports to use /dist/platform-web-pixi.js - Re-export AudioContextState, BlendMode, TextureFiltering, asSpritesheetId from platform-web-pixi for browser bundle convenience
Pull Request Review: Monorepo RefactoringSummaryThis is a major architectural refactoring that converts the clockwork-engine from a monolithic package to a well-structured monorepo with three distinct packages:
The refactoring demonstrates excellent separation of concerns and sets up a solid foundation for future platform implementations. ✅ Strengths1. Architecture & Design
2. Build System
3. CI/CD Updates
4. Package Metadata
|
Add development and production browser bundles to platform-memory package, matching the pattern used in platform-web-pixi: - platform-memory.js (dev bundle with sourcemap) - platform-memory.min.js (minified bundle with sourcemap)
Pull Request Review: Monorepo RefactorI've completed a thorough review of this PR. This is a significant architectural improvement that splits the engine into well-organized packages. Here's my detailed feedback: ✅ Code Quality & ArchitectureExcellent Design Decisions
🐛 Issues Found🔴 Critical: Coverage Path Bug in CIFile: file: ./packages/engine/lcov.infoProblem: The path should be Impact: Coverage reporting to Coveralls will fail Fix: file: ./packages/core/lcov.info
|
Handle cases where base frame times are very small (< 1ms) by using an absolute threshold instead of percentage comparison, which is unreliable due to timing noise at sub-millisecond precision.
Code Review: Monorepo RefactoringOverviewThis PR successfully refactors the clockwork-engine into a well-structured monorepo with three separate packages:
Overall Assessment: The refactoring is well-executed with clean separation of concerns. The architecture properly decouples platform-specific code from the core engine. ✅ StrengthsArchitecture & Code Quality
CI/CD Improvements
Best Practices
|
Add --ignore-errors unused to lcov remove command to handle stale demo/* pattern that no longer matches after monorepo refactor.
Pull Request Review: Monorepo RefactoringOverall AssessmentThis is a well-executed monorepo refactoring that successfully splits the Clockwork Engine into modular packages. The changes follow good software architecture principles by separating platform-specific code from the core engine. The refactoring maintains backward compatibility while enabling better code organization and independent versioning. Overall Grade: 8.5/10 - Strong refactoring with a few minor issues to address. Code Quality & Architecture ✅Strengths
Potential Issues 🐛Critical Issues1. Path Mismatch in CI Workflow (packages/core vs packages/engine) The CI workflow at 2. Path Mismatch in Release Workflow The release workflow at Minor Issues3. Demo TypeScript Version Mismatch
4. Unused Alias in Vite Config
Build System & Performance ⚡Strengths
ConsiderationsBuild Order Dependency: The root build script has hardcoded build order which is fine since platform packages depend on core, but consider using Buns native workspace build features for automatic dependency resolution in the future. Security 🔒No Major Concerns
Recommendations
Test Coverage 🧪Observations
Missing
Best Practices & Conventions 📝Followed Well
Suggestions
Breaking Changes AssessmentUser Impact: LOW ✅For end users who only import the main package:
For developers working on the engine:
Action ItemsMust Fix Before Merge
Should Fix
Nice to Have
Testing RecommendationsBefore merging, please verify coverage file path is correct and all build/test commands work in the CI environment. ConclusionThis is a strong refactoring that improves the codebase architecture significantly. The separation of concerns between core engine and platform-specific implementations is exactly the right approach and aligns well with the platform abstraction layer design. The main issues are minor path mismatches in CI/CD configuration files that need immediate fixing. Once those are addressed, this PR will be ready to merge. Great work on maintaining clean separation and proper dependency management throughout this significant restructuring! 🎉 Reviewed with reference to CLAUDE.md guidelines |
Update lcov.info path from packages/engine to packages/core to match the monorepo structure.
Pull Request Review: Monorepo RefactoringOverviewThis PR successfully refactors the clockwork-engine from a single-package repository into a well-structured monorepo with clear separation between core engine logic and platform-specific implementations. ✅ Code Quality & ArchitectureCore Package - Zero dependencies on platform-specific implementations, pure deterministic game engine logic, clean platform abstraction via interfaces Platform Implementations:
Dependency Flow: Acyclic and clean, no circular dependencies detected ✅ Best Practices
✅ CI/CD ConfigurationMinor Issue Found: Release workflow references packages/engine/CHANGELOG.md instead of packages/core/CHANGELOG.md Fix needed in .github/workflows/release.yml:41: - if [ -f "packages/engine/CHANGELOG.md" ]; then
+ if [ -f "packages/core/CHANGELOG.md" ]; then✅ Test Coverage
✅ Performance & Security
📊 Statistics
Recommendations
✅ Final Verdict: APPROVEThis is an excellent refactoring demonstrating strong software engineering:
The code is ready to merge after fixing the release workflow path. Excellent work! 🚀 Reviewed by: Claude Code | Date: 2025-12-12 |
- Move comprehensive docs from packages/core/README.md to root README.md - Update package references from @hiddentao/clockwork-engine to @clockwork-engine/core - Add packages table showing all monorepo packages - Update usage examples to show platform layer creation - Add brief README.md to each package (core, platform-web-pixi, platform-memory)
Pull Request Review: Monorepo RefactorOverviewThis PR refactors the clockwork-engine project into a monorepo structure, separating the core engine from platform-specific implementations. This is a significant architectural improvement. Strengths
Critical IssueLocation: .github/workflows/release.yml:40 The path references Impact: Release workflow will fail Other Concerns
Overall AssessmentScore: 8/10 Well-executed refactoring with excellent architecture. Fix the release.yml path before merging. Other issues can be follow-up PRs. Great work! |
- Create scripts/run.ts for running commands across packages with include/exclude flags - Create scripts/release.ts for streamlined release workflow - Move CHANGELOG.md to root and add .versionrc.json config - Update release.yml workflow to use root CHANGELOG path - Simplify package.json release scripts to use new tooling - Remove release scripts from core package (handled at root)
PR Review: Monorepo ConversionOverviewThis PR successfully converts the Clockwork Engine from a monolithic structure to a well-organized monorepo with separate packages. The refactoring creates a clean separation between the core engine, platform-specific implementations, and the demo application. Stats: 195 files changed, +1,435 / -1,825 lines ✅ Strengths1. Excellent Architecture & Separation of Concerns
2. Build System & Tooling
3. CI/CD Improvements
4. Documentation Updates
|
Platform packages depend on core, so it must be built first. Sort packages with core first, then alphabetically.
Pull Request Review: Monorepo RefactorOverall AssessmentThis is a well-structured monorepo refactor that successfully separates the engine core from platform-specific implementations. The changes demonstrate good architectural thinking and improve the project's modularity. ✅ 🎯 StrengthsArchitecture & Design
Code Quality
CI/CD
|
Code Review: Monorepo RefactoringOverviewThis is a well-executed monorepo refactoring that successfully splits the engine into modular packages with clear separation of concerns. The changes are primarily structural with minimal code modifications, which reduces risk. ✅ StrengthsArchitecture & Design
Code Quality
Build & CI/CD
🔍 Issues & Concerns1. Missing Package Build Scripts (CRITICAL)The new platform packages ( // packages/platform-web-pixi/package.json:43
"build": "bun run scripts/build.ts"Problem: These packages don't have a Recommendation:
2. Version Sync Configuration Incomplete (HIGH)
{
"packageFiles": ["packages/core/package.json"],
"bumpFiles": ["packages/core/package.json"]
}Problem: Platform packages won't get version bumps automatically by commit-and-tag-version. Current Mitigation: Recommendation: Either document this clearly OR update 3. Git Commit Amending in Release (MEDIUM - Security)
await run("git commit --amend --no-edit", "Amending commit with synced versions")Concern: This bypasses pre-commit hooks (--no-verify not used, so hooks run on initial commit but not amend). Recommendation:
4. Peer Dependency Version Range (MEDIUM)Platform packages use "peerDependencies": {
"@clockwork-engine/core": "^2.7.0"
}Concern: This allows Recommendation: Consider using exact version matching or tilde 5. Missing READMEs for Platform Packages (LOW)Platform packages list README.md in Recommendation: Verify platform packages have adequate README documentation. 6. Coverage Path in CI (LOW)CI workflow references coverage at new location: file: ./packages/core/lcov.infoVerification needed: Ensure 🧪 Testing & ValidationGood:
Needs Verification:
📊 Breaking Changes AssessmentFor End Users: BREAKING CHANGE
|
No description provided.