ClassicPress / ClassicPress-v1

A copy of ClassicPress v1.x.
1 stars 1 forks source link

Document how to install ClassicPress using composer #183

Closed nylen closed 5 years ago

nylen commented 5 years ago

We support installing ClassicPress via composer as of ClassicPress/ClassicPress#169, thanks @pierre-dargham!

Now we need to document it at https://docs.classicpress.net/installing-classicpress/. We can start with how to install the nightly build, and after beta1 is released we'll put an official package up on packagist.

Here's an example of what needs to happen to make this work: https://github.com/globalis-ms/wp-cubi/commit/fc45fac34424b3af43f8f98d0a6004e149bf6150

We should turn this into a minimal composer.json file and a set of steps / commands to make it work, ideally including making the composer.json file inaccessible from the web server.

See also: ClassicPress/ClassicPress-v1#239

nylen commented 5 years ago

Assigning @striebwj to help with this per Slack conversation.

pierre-dargham commented 5 years ago

Thank you for opening the issue, I totally agreed that we need to provide some basic documentation here. I'll try to come back to this issue and give you my thoughts asap

pierre-dargham commented 5 years ago

Hello @nylen (cc @striebwj and @johnpbloch )

I've made an example repository to show the very minimal structure needed to start a ClassicPress project with composer : https://github.com/pierre-dargham/classicpress-composer-boilerplate

The README.md provides the steps to complete the install.

I'm not sure I'll have enough time during next weeks to really contribute to the documentation, but I hope this small contribution could give you the general idea.

Based on this example, we could eventually setup a proper classicpress/classicpress-composer-boilerplate repository and package in the future, and make it the official example / boilerplate.

ideally including making the composer.json file inaccessible from the web server.

Regarding that : it's not a composer install specific problem, because for now, we'll have this file in classic installs too. First step could be to include a How to deploy ClassicPress section in the general documentation, that recommends to not deploy this file, and other files like readme.html, licence.txt ... Second step could be to check if adding composer.json export-ignore in the build .gitattributes file works (it could be enough to exclude the file from the github builds zip archives, it needs to be checked)

nylen commented 5 years ago

This is started:

If anyone has any further feedback on this documentation (@pierre-dargham or @johnpbloch especially), that would be great.

I'll leave this open because we need to update that page with instructions once 1.0.0-beta1 is released and made available on packagist.

pierre-dargham commented 5 years ago

Hi @nylen !

A little feedback here :

Notes :

Issues :

I really tried to put the very strict minimal structure into my example on https://github.com/pierre-dargham/classicpress-composer-boilerplate The only optional thing I did was requiring wpackagist-theme/twentyseventeen, but I thought it was better to have a non-broken frontend at the end of the install, so I stayed with the last default theme.

nylen commented 5 years ago

1.0.0-beta1 is released on Packagist: https://packagist.org/packages/classicpress/classicpress

Related to notes on Composer file structure: https://github.com/ClassicPress/ClassicPress/pull/242#issuecomment-440145245 cc @mikeschinkel

pierre-dargham commented 5 years ago

Thank you @nylen !

I'll try to come back to it tomorrow, run some tests, check the related discussion https://github.com/ClassicPress/ClassicPress/pull/242 and update https://github.com/pierre-dargham/classicpress-composer-boilerplate to use the official release packages, instead of the nighty builds.

nylen commented 5 years ago

I've also updated the documentation page. I'll leave this issue open because there is still more left to document here:

NOTE: We are still working on this guide, and there is a lot that is not covered yet – most importantly, turning a ClassicPress package installed this way into a working site!

nylen commented 5 years ago

A couple of WP-related guides that may be helpful here:

pierre-dargham commented 5 years ago

I've run some checks, new release package is working fine ! I've also updated https://github.com/pierre-dargham/classicpress-composer-boilerplate and its documentation

knowler commented 5 years ago

Since Bedrock (roots/bedrock) already has a working Composer setup + disables automatic updates, swapping WordPress out for ClassicPress is as easy as changing:

+   "classicpress/classicpress": "1.0.0-beta1",
-   "johnpbloch/wordpress": "4.9.8",

Then running composer update.

Full composer.json: https://gist.github.com/knowler/ef1028834beeb2aaa1b4fa9869751cd7

I don’t like the side effects of setting minimum-stability to beta or dev since plugin/theme/dependency installs can start using unstable versions, I'd prefer to see a specific version set — even if it is beta. Recommending people to change the minimum-stability could cause issues for them now and down the line after the 1.0.0 release if they forget to remove the constraint.

Also, maybe it's worth mentioning in the documentation that working Composer WordPress installations like Bedrock should work seamlessly with ClassicPress.

knowler commented 5 years ago

Alternatively, use: "classicpress/classicpress": "@beta" or "1.0.*@beta".

https://getcomposer.org/doc/04-schema.md#package-links

nylen commented 5 years ago

A bit late on addressing feedback here, but I've made the following changes to this documentation page:

If you have further suggestions for improvement, feel free to let me know here on this issue, in Slack, or on our documentation subforum.