How to transfer unsupported composer packages to us
The procedure is simple, but you can get stuck on a lot of things. For an example, I'll give you the conversion of the Translation module contributte/translation
- I copy the contributte/translation directory from the vendor directory to our app. Either Utils or Components or something like that. Depending on what it is
- I remove the dependency using composer remove --no-update contributte/translation
- What can happen here is that the package also had some dependencies and it will output something like
- Removing symfony/translation-contracts (v2.5.2)- Removing symfony/translation (v5.4.14) .....
- If it only removed the requested package and nothing else, then fine. If it removed any others, you need to manually add them to the requirement in composer.json. In this case:
"symfony/translation-contracts": "2.5.2", "symfony/translation": "5.4.14", ....
- What can happen here is that the package also had some dependencies and it will output something like
- Then run composer update contributte/translation. This should remove the translation and leave the other packages if you added the requirement.
- Now the most important part. DELETE the project cache (temp/cache). If you don't do this, nette won't see the copied package.
- Another thing is that PhpStorm will pretend that no namespaces are visible and thus no classes. They are visible, it's just that PhpStorm hasn't reindexed, so just go to FILE | INVALIDATE CACHES and choose "Clear VCS Log chaces and indexes" there. It will reload and you should be able to see everything...
- As a last step, it's good to go through the code and fix the depracated stuff (there's usually more than enough of it) and possibly change the namespace to something custom. But with that comes the fact that you need to modify something in config.neon... sometimes you will need to add something anyway (for example add a component like Service).