Add plugin rename script by camilleislasse · Pull Request #479 · Sylius/PluginSkeleton
Hi Camille,
nice work on the automation :)
My main concern here is using Castor for what's essentially a one-time operation. After you run make rename once, Castor just sits there as a dead dev dependency in composer.json forever. The skeleton is supposed to be minimal, and we're adding a whole task runner library that'll never be used again after initial setup.
I'd suggest converting this to plain PHP using Symfony Console (which Sylius already includes anyway) and hooking it into composer's post-create-project-cmd. That way it runs automatically after
composer create-project, uses zero additional dependencies, and doesn't leave dead weight behind. The conversion is pretty straightforward, all your logic stays the same, just swap the IO layer. Any LLM can help with that in 5 minutes if needed.
Few other things that should be fixed:
You're missing composer dump-autoload after updating composer.json (line 219), which means the new namespaces won't work until someone manually runs it. Also using @ to suppress errors in file_get_contents (line 165) is risky - if file operations fail silently, users won't know what went wrong. Should check git status upfront too, otherwise someone with uncommitted changes might accidentally clobber their work. A dry-run or preview mode would be nice before actually modifying files.
Minor stuff: there's inconsistency in what files you exclude between updateFileContents and checkRemainingReferences, the hardcoded sylius_%kernel.environment% pattern might not be universal, and helper functions like toKebabCase probably deserve some tests since they're doing critical transformations.
Overall solid work though - just think the composer hook approach would be more idiomatic for a skeleton project and cleaner long-term.