Skip to content

refactor(project): move creation logic into shop package#1227

Merged
Soner (shyim) merged 2 commits into
mainfrom
feat/extract-project-scaffold
Jul 22, 2026
Merged

refactor(project): move creation logic into shop package#1227
Soner (shyim) merged 2 commits into
mainfrom
feat/extract-project-scaffold

Conversation

@shyim

Copy link
Copy Markdown
Member

Summary

  • add ShopwareProjectScaffold in internal/shop for composer, filesystem, deployment, and CI scaffolding
  • centralize project-name and folder validation, supported deployment/CI checks, version filtering, and version resolution
  • normalize scaffold defaults and enforce Shopware PaaS Elasticsearch requirements
  • move embedded scaffold templates and their tests out of cmd/project
  • reduce the Cobra command layer to CLI parsing, interaction, telemetry, environment checks, and orchestration

Why

Reusable project-creation behavior lived in the CLI package, which made it difficult to exercise independently and allowed non-CLI callers to bypass validation. Keeping the project contract in internal/shop makes the behavior directly testable and ensures the scaffold validates its target before writing files.

Impact

Direct scaffold callers now receive the same validation and normalization as the CLI. In particular, unsupported deployment or CI values are rejected, non-empty project directories are protected from overwrite, and Shopware PaaS consistently enables Elasticsearch.

Validation

  • go test ./...
  • focused coverage for the extracted validation and version-selection APIs

@shyim

Copy link
Copy Markdown
Member Author

Copilot resolve the merge conflicts in this pull request

Copilot AI commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Copilot resolve the merge conflicts in this pull request

Resolved in 2c368ca.

@shyim
Soner (shyim) marked this pull request as ready for review July 22, 2026 01:20
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 76.92308% with 45 lines in your changes missing coverage. Please review.
✅ Project coverage is 52.96%. Comparing base (b9fd35b) to head (2c368ca).

Files with missing lines Patch % Lines
internal/shop/project_scaffold.go 87.09% 12 Missing ⚠️
cmd/project/project_create_form.go 0.00% 10 Missing ⚠️
cmd/project/project_create_scaffold.go 0.00% 9 Missing ⚠️
cmd/project/project_create_validate.go 0.00% 9 Missing ⚠️
cmd/project/project_create.go 62.50% 3 Missing ⚠️
internal/shop/project_creation.go 96.96% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1227      +/-   ##
==========================================
+ Coverage   52.70%   52.96%   +0.25%     
==========================================
  Files         298      300       +2     
  Lines       23068    23108      +40     
==========================================
+ Hits        12158    12238      +80     
+ Misses      10910    10870      -40     
Flag Coverage Δ
go-test 52.96% <76.92%> (+0.25%) ⬆️

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

☔ View full report in Codecov by Harness.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@shyim
Soner (shyim) merged commit 7d39dcb into main Jul 22, 2026
3 checks passed
@shyim
Soner (shyim) deleted the feat/extract-project-scaffold branch July 22, 2026 10:52
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.

project create: failed install leaves a partial project behind and blocks retry; preflight misses required PHP extensions

5 participants