Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add template/composer.json #63

Closed
GaryJones opened this issue Oct 10, 2017 · 3 comments
Closed

Add template/composer.json #63

GaryJones opened this issue Oct 10, 2017 · 3 comments

Comments

@GaryJones
Copy link
Contributor

Adding a composer.json template would encourage developers to make their plugins available via Packagist, and also allow local install of dependencies.

Currently, WPCS + PHPCS is made available via a global composer install here for Travis.

I haven't yet found a template for the plugin's composer.json, but adding WPCS + PHPCS + PHPCompatibility + DealerDirect/phpcodesniffer-composer-installer to a composer.json would make PHPCS runnable from local, without Travis.

@danielbachhuber
Copy link
Member

I can't think of any issues with adding a composer.json for wp scaffold plugin.

However, the original reason for installing WPCS as a global install was to avoid overwriting an existing composer.json in wp scaffold plugin-tests. As such, an implementation for wp scaffold plugin-tests that wanted to create a composer.json would also need to programmatically modify an existing composer.json.

@jrfnl
Copy link
Contributor

jrfnl commented Jul 20, 2018

As noted in #161, I'd strongly advise to use the phpcompatibility/phpcompatibility-wp dependency instead of PHPCompatibility.

@NicktheGeek
Copy link

I was thinking about this and I agree that editing an existing composer file is a potential issue. However, that could be a potential issue regardless. Someone might have an existing project they want to add tests to.

So I thought instead of reinventing the wheel in order to update the composer.json file, can/should the wp scaffold plugin file check to see if the composer file exists and if it does use shell_exec() or something similar to run the composer commands to add the packages to the project?

@GaryJones GaryJones closed this as not planned Won't fix, can't repro, duplicate, stale Dec 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants