I can’t point to a plugin or theme as an example, since the ones in the repository don’t have it. But a lot of them are on GitHub, with build processes. The result of the build is what is put into the WP repository.
I suppose Gutenberg could be an example. It comprises a lot of packages, that are released on npm, and also in core WP, and the test environment uses Node. But the scripts in the actual plugin don’t need Node since they run in the browser.
I can’t speak to Composer, since I’ve never used it, but I know theme authors that do. The code that is in the plugin can’t rely on an environment that won’t exist on most sites.
Edit: I went and read the Composer “Getting Started” page. Since it’s for pulling in dependencies, I don’t see why you would need it for a WP plugin. But then I think plugins should be small and do only one thing. If you are writing a large plugin, maybe you should reconsider what you are doing.
-
This reply was modified 4 years, 3 months ago by Joy.