@wordpress/env 4.2.0 → 4.2.1-next.f435e9e01b.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -1
- package/lib/commands/start.js +11 -0
- package/lib/wordpress.js +14 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -621,4 +621,10 @@ You can tell `wp-env` to use a specific PHP version for compatibility and testin
|
|
|
621
621
|
}
|
|
622
622
|
```
|
|
623
623
|
|
|
624
|
-
|
|
624
|
+
## Contributing to this package
|
|
625
|
+
|
|
626
|
+
This is an individual package that's part of the Gutenberg project. The project is organized as a monorepo. It's made up of multiple self-contained software packages, each with a specific purpose. The packages in this monorepo are published to [npm](https://www.npmjs.com/) and used by [WordPress](https://make.wordpress.org/core/) as well as other software projects.
|
|
627
|
+
|
|
628
|
+
To find out more about contributing to this package or Gutenberg as a whole, please read the project's main [contributor guide](https://github.com/WordPress/gutenberg/tree/HEAD/CONTRIBUTING.md).
|
|
629
|
+
|
|
630
|
+
<br /><br /><p align="center"><img src="https://s.w.org/style/images/codeispoetry.png?1" alt="Code is Poetry." /></p>
|
package/lib/commands/start.js
CHANGED
|
@@ -174,6 +174,7 @@ module.exports = async function start( { spinner, debug, update, xdebug } ) {
|
|
|
174
174
|
|
|
175
175
|
const siteUrl = config.env.development.config.WP_SITEURL;
|
|
176
176
|
const e2eSiteUrl = config.env.tests.config.WP_TESTS_DOMAIN;
|
|
177
|
+
|
|
177
178
|
const { out: mySQLAddress } = await dockerCompose.port(
|
|
178
179
|
'mysql',
|
|
179
180
|
3306,
|
|
@@ -181,6 +182,13 @@ module.exports = async function start( { spinner, debug, update, xdebug } ) {
|
|
|
181
182
|
);
|
|
182
183
|
const mySQLPort = mySQLAddress.split( ':' ).pop();
|
|
183
184
|
|
|
185
|
+
const { out: testsMySQLAddress } = await dockerCompose.port(
|
|
186
|
+
'tests-mysql',
|
|
187
|
+
3306,
|
|
188
|
+
dockerComposeConfig
|
|
189
|
+
);
|
|
190
|
+
const testsMySQLPort = testsMySQLAddress.split( ':' ).pop();
|
|
191
|
+
|
|
184
192
|
spinner.prefixText = 'WordPress development site started'
|
|
185
193
|
.concat( siteUrl ? ` at ${ siteUrl }` : '.' )
|
|
186
194
|
.concat( '\n' )
|
|
@@ -188,6 +196,9 @@ module.exports = async function start( { spinner, debug, update, xdebug } ) {
|
|
|
188
196
|
.concat( e2eSiteUrl ? ` at ${ e2eSiteUrl }` : '.' )
|
|
189
197
|
.concat( '\n' )
|
|
190
198
|
.concat( `MySQL is listening on port ${ mySQLPort }` )
|
|
199
|
+
.concat(
|
|
200
|
+
`MySQL for automated testing is listening on port ${ testsMySQLPort }`
|
|
201
|
+
)
|
|
191
202
|
.concat( '\n' );
|
|
192
203
|
|
|
193
204
|
spinner.text = 'Done!';
|
package/lib/wordpress.js
CHANGED
|
@@ -42,7 +42,20 @@ async function checkDatabaseConnection( { dockerComposeConfigPath, debug } ) {
|
|
|
42
42
|
* @param {Object} spinner A CLI spinner which indicates progress.
|
|
43
43
|
*/
|
|
44
44
|
async function configureWordPress( environment, config, spinner ) {
|
|
45
|
-
const
|
|
45
|
+
const url = ( () => {
|
|
46
|
+
const port = config.env[ environment ].port;
|
|
47
|
+
const domain =
|
|
48
|
+
environment === 'tests'
|
|
49
|
+
? config.env.tests.config.WP_TESTS_DOMAIN
|
|
50
|
+
: config.env.development.config.WP_SITEURL;
|
|
51
|
+
if ( port === 80 ) {
|
|
52
|
+
return domain;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return `${ domain }:${ port }`;
|
|
56
|
+
} )();
|
|
57
|
+
|
|
58
|
+
const installCommand = `wp core install --url="${ url }" --title="${ config.name }" --admin_user=admin --admin_password=password --admin_email=wordpress@example.com --skip-email`;
|
|
46
59
|
|
|
47
60
|
// -eo pipefail exits the command as soon as anything fails in bash.
|
|
48
61
|
const setupCommands = [ 'set -eo pipefail', installCommand ];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/env",
|
|
3
|
-
"version": "4.2.0",
|
|
3
|
+
"version": "4.2.1-next.f435e9e01b.0",
|
|
4
4
|
"description": "A zero-config, self contained local WordPress environment for development and testing.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"scripts": {
|
|
52
52
|
"test": "echo \"Error: run tests from root\" && exit 1"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "14b2846015dfb1b440ce93accdd03842ebe5f1cd"
|
|
55
55
|
}
|