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

Moving CakePHP Rector to the community #27

Open
TomasVotruba opened this issue Oct 2, 2022 · 8 comments
Open

Moving CakePHP Rector to the community #27

TomasVotruba opened this issue Oct 2, 2022 · 8 comments

Comments

@TomasVotruba
Copy link
Member

TomasVotruba commented Oct 2, 2022

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 👍
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 🤗

Looking at cakephp/cakephp#15866 (comment),
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 👍

@samsonasik
Copy link
Collaborator

/cc @markstory @othercorey FYI

@othercorey
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Member Author

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

@samsonasik
Copy link
Collaborator

@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
Copy link
Contributor

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

@samsonasik
Copy link
Collaborator

samsonasik commented Oct 15, 2022

@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
Copy link
Collaborator

@markstory @othercorey here the PR cakephp/upgrade#197 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants