deprecated-packages / rector-cakephp

[DEPRECATED] Use following package instead
https://github.com/cakephp/upgrade
MIT License
20 stars 3 forks source link

Moving CakePHP Rector to the community #27

Open TomasVotruba opened 1 year ago

TomasVotruba commented 1 year ago

Hi @cakephp community,

in past few months, we've moved few core framework Rector extensions to their own communities. It gives the community full power and freedome to decide and add to the upgrade set, it works very well :+1: See: https://getrector.org/blog/separating-typo3-and-nette-as-community-packages

Now it's time to move this repository from the core to the community as well :hugs:

Looking at https://github.com/cakephp/cakephp/issues/15866#issuecomment-916490079, it seems the way to go is already using CakePHP community package: https://github.com/cakephp/upgrade

Now we make single place to handle CakePHP upgrades the official https://github.com/cakephp/upgrade

Feel free to re-use or copy anything from this repository :+1:

samsonasik commented 1 year ago

/cc @markstory @othercorey FYI

othercorey commented 1 year ago

I think this would be preferred. We already have some organization issues with rector upgrades for cake 5 since we don't maintain the package.

The upgrade package was used to perform other non-rector upgrades in the past. Now, its just a rector wrapper, and it might be time to simply rely on a rector package.

markstory commented 1 year ago

Makes sense to me as well. In the past rector has has handled doing upgrades to these rulesets when there were breaking changes. With this project and other packages moving to other communities will there be fewer breaking changes in rector?

TomasVotruba commented 1 year ago

Exactly. The less external complexity per unique framework, the more stability 👍

samsonasik commented 1 year ago

@markstory rector-cakephp no longer exists in scoped rector:dev-main, see

https://github.com/rectorphp/rector/tree/32c7260742dc9f3f39c1633afeedcea34d7bdfa7/vendor/rector

Please try latest rector/rector:dev-main and copy rules from here, for note, the config needs to make autowire working can be followed by:

https://github.com/rectorphp/rector-cakephp/blob/a489bf049d6672d9ecdc03280f3f0f29c810cdd4/config/config.php#L10-L16

You can modify to target the cakephp-upgrade path directory that the rules and services copied.

othercorey commented 1 year ago

@TomasVotruba Can you clarify the transition path for us? What specifically do you need us to deliver?

samsonasik commented 1 year ago

@othercorey cakephp/upgrade is using CakePHPSetList from this package, which previously included in scoped vendor/ of rector/rector:<=0.14.5:

https://github.com/rectorphp/rector/tree/0.14.5/vendor/rector/rector-cakephp

As current rector/rector:dev-main no longer deliver rector/rector-cakephp package under vendor/

https://github.com/rectorphp/rector/tree/a0186945857fec715079795f4f955b9dfa9f89cf/vendor/rector

consuming cakephp/upgrade will cause error in next release, eg: rector/rector: 0.14.6,

I think you can try:

  1. update rector dependency to rector/rector:dev-main at cakephp/upgrade
  2. move the rules from here to there

Then, on next release, you can update rector dependency to whatever next release number is, eg: rector/rector: ^0.14.6

samsonasik commented 1 year ago

@markstory @othercorey here the PR https://github.com/cakephp/upgrade/pull/197 :)