Make Composer available via npm run on host machine #9713
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
Working on a ticket on my
wordpress-developcloned instance, I wanted to lint and format my code but :composer.jsonin order to do so;composernorphpcson my host machine because those tools are already available in the container spawned.##Solutions
To lint my code I used this command :
node ./tools/local-env/scripts/docker.js run -T --rm php composer lint [my_file]@SirLouen suggested to create a new custom script in package.json enabling developers to directly invoke the composer instance of the
wordpressdevelop/phpcontainer from their host machine. Implementing this will simplifies future call to composer specific scripts from host machine (linting, formating etc ...).Trac ticket: (https://core.trac.wordpress.org/ticket/63912)