Skip to content

T47 mvc new - #60

Merged
niden merged 4 commits into
masterfrom
T47-mvc-new
Oct 14, 2026
Merged

niden merged 4 commits into
masterfrom
T47-mvc-new

Conversation

@niden

@niden niden commented Oct 14, 2026

Copy link
Copy Markdown
Member

Hello!

In raising this pull request, I confirm the following:

  • I have checked that another pull request for this purpose does not exist
  • I wrote some tests for this PR
  • composer test, composer cs and composer analyze all pass
  • I have created a PR for the documentation about this change, if user facing

  • Added new --flavor=adr|mvc: crest new my-app --flavor=mvc writes an MVC project that runs: AppFront with Phalcon\Mvc\Application, a dispatcher provider and a view provider in src/Providers/, IndexController and its base in src/Controllers/, and the views in themes/default/. new asks for the flavor first.
  • Added new --template-engine: the view engine of an MVC project. It accepts phtml, the default. An ADR project has no views, so the option stops new.
  • Added stub:publish --flavor: the flavor of a project stub before the project exists, adr by default. When the flavor does not have the project stub and another flavor does, the error says which: pass --flavor=mvc.
  • Added the MVC default paths provider (src/Providers) and views (themes/default), and the MVC project stubs project-front, project-readme, project-provider-dispatcher, project-phtml-provider, project-phtml-layout and project-phtml-index.
  • Added Crest\Generator\Project: Skeleton (the files, the values and the first artifacts of the project of a flavor), AdrSkeleton, MvcSkeleton, Skeletons, Answers and TemplateEngines, and Crest\Generator\ControllerBase.
  • Changed the project stubs: project-compose, project-composer, project-config, project-dockerfile, project-env, project-gitignore, project-htrouter, project-index and project-launcher are the same in both flavors, and moved to resources/stubs/shared/. A copy that was published into resources/stubs/adr/ still wins for ADR projects, and has no effect on MVC projects. To use one copy for both flavors, publish it again.
  • Changed the project-config stub: 'flavor' => '{{ flavor }}'. Crest\Project\Settings has the flavor as its first value.
  • Changed the error of the new key: it names the published project-config that new used.
  • Changed new: it checks that the written crest.php has the chosen flavor. A published project-config with a fixed flavor stops it, with an error that names the stub.
  • Moved Crest\Command\Make\ControllerCommand::BASE and BASE_FOLDER to Crest\Generator\ControllerBase::NAME and FOLDER.

Thanks

niden added 4 commits October 14, 2026 06:48
Assisted-by: Claude Code
Assisted-by: Claude Code
Assisted-by: Claude Code
Assisted-by: Claude Code
@niden
niden requested a review from Jeckerson October 14, 2026 11:52
@niden niden self-assigned this Oct 14, 2026
@niden niden added the enhancement New feature or request label Oct 14, 2026
@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown

Code Metrics Report

master (dd811be) #60 (ce913f0) +/-
Coverage 99.6% 99.6% +0.0%
Test Execution Time - 5s +5s
Details
  |                     | master (dd811be) | #60 (ce913f0) |  +/-  |
  |---------------------|------------------|---------------|-------|
+ | Coverage            |            99.6% |         99.6% | +0.0% |
  |   Files             |               65 |            72 |    +7 |
  |   Lines             |             1753 |          1885 |  +132 |
+ |   Covered           |             1746 |          1878 |  +132 |
- | Test Execution Time |                - |            5s |   +5s |

Code coverage of files in pull request scope (100.0% → 100.0%, patch 100.0%)

Files Coverage +/- Patch Coverage Status
src/Command/InitCommand.php 100.0% 0.0% 100.0% modified
src/Command/Make/ControllerCommand.php 100.0% 0.0% 100.0% modified
src/Command/NewCommand.php 100.0% 0.0% 100.0% modified
src/Command/Stub/PublishCommand.php 100.0% 0.0% 100.0% modified
src/Generator/ControllerBase.php 100.0% +100.0% 100.0% added
src/Generator/Project/AdrSkeleton.php 100.0% +100.0% 100.0% added
src/Generator/Project/Answers.php 100.0% +100.0% 100.0% added
src/Generator/Project/MvcSkeleton.php 100.0% +100.0% 100.0% added
src/Generator/Project/Skeleton.php 0.0% 0.0% - added
src/Generator/Project/Skeletons.php 100.0% +100.0% 100.0% added
src/Generator/Project/TemplateEngines.php 100.0% +100.0% 100.0% added
src/Project/Config.php 100.0% 0.0% 100.0% modified
src/Project/Settings.php 100.0% 0.0% 100.0% modified
src/Project/Survey.php 100.0% 0.0% 100.0% modified

Reported by octocov

@niden
niden merged commit 4c3d284 into master Oct 14, 2026
24 checks passed
@niden
niden deleted the T47-mvc-new branch October 14, 2026 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant