Hi there,
I've seen multiple issues opened on the Encore repository that were caused by an already existing package.json file when requiring the related pack (the most recent one being symfony/webpack-encore#411).
Since the recipe adds this file using the copy-from-recipe configurator it fails silently when the user already has one (which may not be an uncommon situation and means that Encore won't be installed).
Also annoying: if the user decides to remove the pack it will also remove the package.json file (which has probably been modified by then) without any warning.
The first issue could probably be handled by adding a message if copy-from-recipe wasn't able to copy a file for this reason, but:
- I'm not sure that it will be enough for the users to know what they have to do (even though we could add something in the doc about it I'm afraid it won't be that obvious)
- There may be some situations where that message would probably not be needed and have the opposite effect (people being worried about a warning message that they could safely ignore)
For the second problem, package.json could probably be ignored in the removeFiles method the same way it's currently done for the ".git" repository, but I'm not sure that adding something that specific to a recipe into Flex's code would be a good idea...
Hi there,
I've seen multiple issues opened on the Encore repository that were caused by an already existing
package.jsonfile when requiring the related pack (the most recent one being symfony/webpack-encore#411).Since the recipe adds this file using the
copy-from-recipeconfigurator it fails silently when the user already has one (which may not be an uncommon situation and means that Encore won't be installed).Also annoying: if the user decides to remove the pack it will also remove the
package.jsonfile (which has probably been modified by then) without any warning.The first issue could probably be handled by adding a message if
copy-from-recipewasn't able to copy a file for this reason, but:For the second problem,
package.jsoncould probably be ignored in theremoveFilesmethod the same way it's currently done for the ".git" repository, but I'm not sure that adding something that specific to a recipe into Flex's code would be a good idea...