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 basic composer.json file. #1297

Closed

Conversation

alexmacarthur
Copy link

Changes proposed in this Pull Request:

I'd be helpful to be able to require the _s theme via Composer using the Composer Installers package, which would automatically place the wordpress-theme type in the specified themes directory.

An example of how someone might leverage this Composer file can be seen here:
https://github.com/alexmacarthur/wp-skateboard/tree/starter-theme-underscores

As a solution to all of this, I've created a very basic composer.json file. It can certainly be improved, but contains all the essential information as a starting point.

@grappler
Copy link
Collaborator

grappler commented Jun 3, 2018

Thank you @alexmacarthur for the PR.

We were discussing in #1291 about adding a composer.json file to define the dependencies on tools like PHPCS.

There are three main groups of uses for _s

  1. Themes for WordPress.com
  2. Themes for WordPress.org
  3. Custom Themes for clients

The composer.json is only useful for the last group as WordPress.com does not use composer(as far as I know). For WordPress.org there is https://wpackagist.org/

One question on my mind is:

What happens to the composer.json when the theme is generated from underscores.me?

I see two options.

  1. Not include it in the final zip
  2. Include it in the final zip but make sure the name is changed correctly
  3. Not to include it by default but allow an option for it.

I don't think we should include the composer.json by default as most people would not delete it. We could look into adding a new option to underscores.me but that will take time. Previous discussion can be found in Automattic/underscores.me#31

@alexmacarthur
Copy link
Author

Thanks for the feedback, @grappler. Agreed, the value for something like this would be found by people using Composer in their development, and I don't think it'd be worth including in the underscores.me generator.

Would there be any harm in including the file in the repo anyway, and then having people do what they want with it after that? And if there is harm, would the value outweigh that harm?

I'm obviously partial to having a Composer file included in the repo itself, but I'm also not aware of the scope of what it might impact.

@tomjn
Copy link

tomjn commented Aug 7, 2018

I would consider adding the file, and changing the package type to project, people aren't meant to install underscores as a theme, but to use it as a starter project

Otherwise I would add the composer installers package as a dependency

@Ismail-elkorchi
Copy link
Contributor

@alexmacarthur Thank you for the Pull Request. Closing as composer.json file was added in #1386.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants