Skip to content
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

[1.2] Refactoring stubs #71

Merged
merged 42 commits into from
Nov 10, 2024
Merged

[1.2] Refactoring stubs #71

merged 42 commits into from
Nov 10, 2024

Conversation

jaspertey
Copy link
Member

@jaspertey jaspertey commented Oct 22, 2024

Changes in #69 require stubs to be refactored before 1.2 can be officially tagged and released.

  • Normalize stubs to use .stub extension instead of .php.stub (following Laravel's convention)
  • Deprecate the ddd-specific model stub, now that ddd:model extends laravel's make:model and therefore inherits the native stubs.
  • Breaking: change the location of where ddd stubs are published. They will now be published to base_path('stubs/ddd') instead of resource_path('stubs/ddd'). In other words, the ddd stubs will now be co-located alongside the framework's published stubs, within a ddd subfolder.
  • For ddd:* generators that extend Laravel's make:* equivalent, custom stubs will be resolved as follows:
    • Try stubs/ddd/*.stub (allows customizing stub for ddd only)
    • Try stubs/*.stub (shared by both make:* and ddd:*)
    • Fallback to the framework default

Todo

  • Implement ddd:publish to provide a more intuitive way to publish stubs selectively. Currently, to customize a ddd:model stub, you would have to publish all of laravel's stubs and customize the model.stub file, or make a copy of it into the ddd subfolder. The ideal workflow would be a way to publish ONLY the stub you need, and have it end up in stubs/ddd/*.stub automatically.

@npldevfr
Copy link

Hi, do you have an approximate release date for version 1.2? :)

@jaspertey
Copy link
Member Author

Hi, do you have an approximate release date for version 1.2? :)

Hey Nathan, sorry for the delay and thanks for your patience! If you're not too concerned about potential issues with stubs, you can start using 1.2 like this:

composer require lunarstorm/laravel-ddd:dev-next 

You might have to set composer.json's minimum-stability to "beta"

I dropped the v1.2.0 pre-release recently, https://github.com/lunarstorm/laravel-ddd/releases/tag/v1.2.0-beta.1 - what is the composer convention to use pre-releases? I wasn't sure. Either way, targeting dev-next will work, as I'm pushing all progress to the next branch.

@jaspertey jaspertey marked this pull request as ready for review November 10, 2024 04:49
@jaspertey jaspertey merged commit 3c73e2d into next Nov 10, 2024
21 checks passed
@jaspertey jaspertey deleted the develop-stubs branch November 10, 2024 05:24
jaspertey added a commit that referenced this pull request Nov 23, 2024
* [1.2] ddd:model options, migrations, application layer (#69)
* [1.2] Refactoring stubs (#71)
* [1.2] Custom Layers (#76)
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.

2 participants