Opened 4 years ago
Closed 4 years ago
#8317 closed enhancement (fixed)
Use @wordpress/env to ease BuddyPress contributors life
Reported by: | imath | Owned by: | netweb |
---|---|---|---|
Milestone: | 7.0.0 | Priority: | high |
Severity: | normal | Version: | |
Component: | Build/Test Tools | Keywords: | has-patch dev-feedback needs-codex |
Cc: |
Description (last modified by )
I believe we should make it easier for new contributors to quickly get started.
Setting up a development environment can be a pain and is probably a major brake to contributions. Thanks to β@wordpress/env, we can now improve this. I've just tested it: it's really awesome and we should include it asap into our repository.
What's needed ?
- βNode.js (most of us already have it!)
- βDocker Desktop
- The attached patch π
There's some great documentation βthere. For our specific need we can use a .wp-env.override.json
to customize the .wp-env.json
I've added to the patch.
For the regular .wp-env.json
, I wrote it so that WordPress is latest stable, and the master branch of the BP REST API is automatically included and activated.
To test:
- Install Docker, launch it,
- Apply the patch,
- Update node modules running
npm install
- run this
npm run wp-env start
from the command line being at the root of the BuddyPress repository - Go to
http://localhost:8888
- Tada π
When, you need to stop, simply do npm run wp-env stop
Attachments (3)
Change History (13)
#3
@
4 years ago
Thanks for your feedback @oztaser. Youβre completely right, Iβll add BP CLIπ
This ticket was mentioned in βSlack in #buddypress by imath. βView the logs.
4 years ago
#5
@
4 years ago
Per meeting last Wednesday, June 17, tested patch on the following:
β
Windows 10 Pro and better - OK
β
Windows 10 Home on Insider Build with WSL 2 - OK
β
Ubuntu server - OK
Concerned about prospective contributors with Windows 10 Home (stable version) because Docker can't be installed on their machines.
#6
@
4 years ago
- Keywords needs-codex added
Thanks a lot for your testing @mercime. It's very useful π. I understand your concern about users running Windows 10 home edition. But I believe it shouldn't block us to include this testing environment for all the other users.
I think we should write a codex page with the different ways you can set your development environment to start contributing to BuddyPress. It could look like this βdocumentation page or include links to this documentation page.
#8
@
4 years ago
I thought being able to run PHPUnit tests was missing, so I've added to the β8317.3.patch!
Once the patch is applied (and you installed Docker...), here's how to test it:
- run
npm install
- run
composer update wp-phpunit/wp-phpunit
- Launch Docker
- run
npm run wp-env start
to build the environment (WordPress Trunk, BuddyPress Trunk, BP REST master) - if you want to play with the website, you can go to
http://localhost:8888
- Otherwise (or if you finished playing) run
npm run wp-env stop
- To test BuddyPress on non-multisite, run
npm run test-php
- To test BuddyPress on multisite, run
npm run test-php-multisite
I love it! Let's have it in to ease contributions!
Hi @imath ,
I liked the idea and I've tested your patch. It looks good.
@wordpress/env supports WP-CLI as far as I can see on the GitHub repository[1]. What do you think about including BP-CLI package to the environment like BP REST.
P.S: Default login credentials are username: admin password: password, it might be helpful.
[1] βhttps://github.com/WordPress/gutenberg/tree/master/packages/env