feat: Add craft init, validate commands and improve onboarding#732
feat: Add craft init, validate commands and improve onboarding#732
Conversation
|
69ce415 to
6966b74
Compare
|
@sentry review |
|
@cursoragent review |
|
Perfect! I've completed a comprehensive review of this PR. Let me provide my analysis. Review SummaryStatus: ✅ Approved - Ready to Merge All tests are passing (841/842), the build is successful, and the linter shows no errors (only minor warnings about unused variables). The PR author has already addressed @BYK's review comments in the most recent commit. Key Changes Validated1. New Commands ✅
2. Smart Defaults ✅When
3. First Release Improvements ✅
4. PR Comments Addressed ✅Both of @BYK's comments were addressed in commit
/** Default bump type for first release when using auto-versioning */
const DEFAULT_FIRST_RELEASE_BUMP: BumpType = 'minor';The new approach is better because it:
Code Quality AssessmentArchitecture: ✅ Excellent
Testing: ✅ Comprehensive
Documentation: ✅ Thorough
Minor Observations (Non-blocking)The linter shows 159 warnings but these are all pre-existing issues in the codebase (unused imports, unused variables in test files). None are introduced by this PR. RecommendationApprove and merge. This is a high-quality PR that significantly improves the onboarding experience for Craft. The implementation is solid, well-tested, and all review feedback has been addressed. |
Add new commands and features to improve the onboarding experience: - craft init: Auto-detect project type and generate configuration - Detects npm, pypi, crates, docker, gem, pub-dev targets - Generates .craft.yml with smart defaults - Creates GitHub Actions workflows (release, publish, changelog-preview) - craft validate: Validate configuration and workflows - Checks YAML syntax and schema - Validates target names and regex patterns - Warns about deprecated fields and missing best practices - Smart defaults for minVersion >= 2.20.0 - changelog.policy defaults to 'auto' - versioning.policy defaults to 'auto' (>= 2.14.0) - First release improvements - Defaults to version 0.1.0 when no tags exist - Creates CHANGELOG.md automatically with auto policy - Documentation updates for all new features
- Fix docs: Change 'craft prepare auto' to 'craft prepare' in quick example - Merge first release logic with version calculation: - Use default bump type (minor) instead of hardcoded version - Allow explicit bump types to work for first release (e.g., major -> 1.0.0) - More consistent code flow
Makes the test portable across environments with custom TMPDIR settings.
String comparison was incorrectly evaluating versions like '2.3.0' as greater than '2.20.0'. Now uses parseVersion() and versionGreaterOrEqualThan() for proper semver comparison.
Updates all references to the smart defaults minimum version across source code, tests, and documentation.
a6e0979 to
227dfe7
Compare


Summary
Improves the Craft onboarding experience by reducing the trial-and-error typically required to set up Craft for a new project.
New Commands
craft init: Auto-detects project type and generates configuration.craft.ymlwith smart defaults (minVersion: 2.21.0).python-versionorpyproject.toml)craft validate: Validates configuration and workflowsincludeNames/excludeNamesSmart Defaults
When
minVersion >= 2.21.0:changelog.policydefaults toauto(wasnone)versioning.policydefaults toautowhen>= 2.14.0(wasmanual)First Release Improvements
0.1.0when no git tags existCHANGELOG.mdwhen using auto changelog policyDocumentation
- Updated getting-started guide with
- Documented smart defaults behavior in configuration reference
- Added first release workflow guide
Cursor Bugbot reviewed your changes and found no issues for commit 227dfe7craft initquick start