fluid-project / hearth

A simple starter kit for the Laravel framework.
BSD 3-Clause "New" or "Revised" License
3 stars 4 forks source link

Upgrading an existing project's use of Hearth #18

Open waharnum opened 3 years ago

waharnum commented 3 years ago

This question occurs to me as I look at updating my testing work on eds-app - what would we need to do to make it easier to upgrade the use of Hearth in an existing project?

Right now, it seems the steps look like this, assuming you're updating from the main branch:

  1. Make sure you've versioned your existing work
  2. Run composer update
  3. Run artisan hearth:install
  4. Manually merge any changes to files that Hearth has replaced, such as the routes in web.php

Questions/Ideas:

  1. Can we extract the customizations Hearth needs to make and inject them at an appropriate place in files that are likely to be touched in a project using Hearth, rather than overwriting? (for web.php, something like what is described at https://5balloons.info/split-and-organise-laravel-routes-into-multiple-files/)

  2. Can we make the artisan hearth:install process more interactive, or make use of Git-style diffing?

These are not urgent, but worth thinking about due to experiences of drift / challenging upgrades on past projects trying to establish a common building base.

greatislander commented 3 years ago
  1. Can we extract the customizations Hearth needs to make and inject them at an appropriate place in files that are likely to be touched in a project using Hearth, rather than overwriting? (for web.php, something like what is described at https://5balloons.info/split-and-organise-laravel-routes-into-multiple-files/)

I agree, this would be a great improvement. I could imagine splitting the routes into files per model, so web.php would require:

Etc. Then custom routes could go in their own files, also imported into web.php.

greatislander commented 3 years ago

In terms of install interactivity, it may be as simple as: https://laravel.com/docs/8.x/artisan#prompting-for-input

All the stub copying could be made conditional based on user input. So:

Install user model? (yes/no)

Etc.

waharnum commented 3 years ago

Tagging as good first issue and assigning myself - I will see about doing this as part of getting more familiar with Hearth directly as opposed to as a user.

greatislander commented 3 years ago

@waharnum sounds good— I'm working on the multilingual improvements we discussed last week (among other things, I've created a CrowdIn account for the project to manage translating strings provided by Hearth). I'm using a GitHub project to track issues in the 1.0.0 milestone if you want to add yours there too: https://github.com/fluid-project/hearth/projects/1