Skip to content

Commit

Permalink
Merge pull request #1 from WordPress/master
Browse files Browse the repository at this point in the history
Sync with master repo
  • Loading branch information
JesserH authored Sep 9, 2020
2 parents 2300f3c + bd8bfea commit 18e551b
Show file tree
Hide file tree
Showing 428 changed files with 14,584 additions and 4,180 deletions.
7 changes: 6 additions & 1 deletion bin/packages/build-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ const BUILD_TASK_BY_EXTENSION = {
makeDir( path.dirname( outputFile ) ),
readFile( file, 'utf8' ),
] );

const builtSass = await renderSass( {
file,
includePaths: [ path.join( PACKAGES_DIR, 'base-styles' ) ],
Expand All @@ -109,6 +108,12 @@ const BUILD_TASK_BY_EXTENSION = {
'animations',
'z-index',
]
// Editor styles should be excluded from the default CSS vars output.
.concat(
file.includes( 'editor-styles.scss' )
? []
: [ 'default-custom-properties' ]
)
.map( ( imported ) => `@import "${ imported }";` )
.join( ' ' ) + contents,
} );
Expand Down
2 changes: 1 addition & 1 deletion bin/packages/watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ getPackages().forEach( ( p ) => {
fs.accessSync( srcDir, fs.F_OK );
watch(
path.resolve( p, 'src' ),
{ recursive: true },
{ recursive: true, delay: 500 },
( event, filename ) => {
if ( ! isSourceFile( filename ) ) {
return;
Expand Down
23 changes: 17 additions & 6 deletions bin/plugin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@
*/
const program = require( 'commander' );

const catchException = ( command ) => {
return async ( ...args ) => {
try {
await command( ...args );
} catch ( error ) {
console.error( error );
process.exitCode = 1;
}
};
};

/**
* Internal dependencies
*/
Expand All @@ -22,37 +33,37 @@ program
.description(
'Release an RC version of the plugin (supports only rc.1 for now)'
)
.action( releaseRC );
.action( catchException( releaseRC ) );

program
.command( 'release-plugin-stable' )
.alias( 'stable' )
.description( 'Release a stable version of the plugin' )
.action( releaseStable );
.action( catchException( releaseStable ) );

program
.command( 'prepare-packages-stable' )
.alias( 'npm-stable' )
.description(
'Prepares the packages to be published to npm as stable (latest dist-tag, production version)'
)
.action( prepareLatestDistTag );
.action( catchException( prepareLatestDistTag ) );

program
.command( 'prepare-packages-rc' )
.alias( 'npm-rc' )
.description(
'Prepares the packages to be published to npm as RC (next dist-tag, RC version)'
)
.action( prepareNextDistTag );
.action( catchException( prepareNextDistTag ) );

program
.command( 'release-plugin-changelog' )
.alias( 'changelog' )
.option( '-m, --milestone <milestone>', 'Milestone' )
.option( '-t, --token <token>', 'Github token' )
.description( 'Generates a changelog from merged Pull Requests' )
.action( getReleaseChangelog );
.action( catchException( getReleaseChangelog ) );

program
.command( 'performance-tests [branches...]' )
Expand All @@ -65,6 +76,6 @@ program
.description(
'Runs performance tests on two separate branches and outputs the result'
)
.action( runPerformanceTests );
.action( catchException( runPerformanceTests ) );

program.parse( process.argv );
167 changes: 160 additions & 7 deletions changelog.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/architecture/modularity.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function MyApp() {

```php
// myplugin.php
// Exemple of script registration dependending on the "components" and "element packages.
// Example of script registration dependending on the "components" and "element packages.
wp_register_script( 'myscript', 'pathtomyscript.js', array ('wp-components', "wp-element" ) );
```

Expand Down
4 changes: 2 additions & 2 deletions docs/contributors/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ If you don't have a local WordPress environment to load Gutenberg in, we can hel

### Step 1: Installing a Local Environment

The quickest way to get up and running is to use the [`wp-env` command](https://github.com/WordPress/gutenberg/tree/master/packages/env), which is developed within the Gutenberg source repository, and published as `@wordpress/env` to npm. In its default mode, it'll install and run a local WordPress environment for you; however, it's also possible to [configure](https://github.com/WordPress/gutenberg/blob/master/packages/env/README.md#wp-envjson) it to use a pre-existing local WordPress installation.
The quickest way to get up and running is to use the [`wp-env` command](/packages/env/README.md), that is developed within the Gutenberg source repository, and published as `@wordpress/env` to npm. By default, wp-env can install and run a local WordPress environment for you. It is also possible to configure it to use a pre-existing local WordPress installation, [see package documentation](/packages/env/README.md) for configuration details.

If you don't already have it, you'll need to install Docker and Docker Compose in order to use `wp-env`.

To install Docker, follow their instructions here for [Windows 10 Pro](https://docs.docker.com/docker-for-windows/install/), [all other version of Windows](https://docs.docker.com/toolbox/toolbox_install_windows/), [macOS](https://docs.docker.com/docker-for-mac/install/), or [Linux](https://docs.docker.com/v17.12/install/linux/docker-ce/ubuntu/#install-using-the-convenience-script). If running Ubuntu, see these [extended instructions for help and troubleshooting](/docs/contributors/env-ubuntu.md).
To install Docker, follow the instructions for [Windows 10 Pro](https://docs.docker.com/docker-for-windows/install/), [all other version of Windows](https://docs.docker.com/toolbox/toolbox_install_windows/), [macOS](https://docs.docker.com/docker-for-mac/install/), or [Linux](https://docs.docker.com/v17.12/install/linux/docker-ce/ubuntu/#install-using-the-convenience-script). If running Ubuntu, see these [extended instructions for help and troubleshooting](/docs/designers-developers/developers/tutorials/devenv/docker-ubuntu.md).

To install Docker Compose, [follow their instructions here](https://docs.docker.com/compose/install/), be sure to select your operating system for proper instructions.

Expand Down
3 changes: 2 additions & 1 deletion docs/contributors/versions-in-wordpress.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Versions in WordPress

With each WordPress release cycle, various versions of Gutenberg are included. This has created confusion over time as people try to figure out how best to debug problems and report bugs appropriately. To make this easier for everyone to keep track of, this document serves as a canonical list of the Gutenberg versions integrated into each WordPress release. Of note, during the beta period for WordPress releases, additional bug fixes from later Gutenberg releases than those noted are cherry-picked into the WordPress release as necessary.
With each major release of WordPress a new version of Gutenberg is included. This has caused confusion over time as people have tried to figure out how to best debug problems and report bugs appropriately. To make this easier we have made this document to serve as a canonical list of the Gutenberg versions integrated into each major WordPress release. Of note, during the beta period of a WordPress release, additional bug fixes from later Gutenberg releases than those noted are added into the WordPress release where it is needed.

If anything looks incorrect here, please bring it up in #core-editor in [WordPress.org slack](https://make.wordpress.org/chat/).

| Gutenberg Versions | WordPress Version |
| ------------------ | ----------------- |
| 7.6-8.5 | 5.5.1 |
| 7.6-8.5 | 5.5 |
| 6.6-7.5 | 5.4.2 |
| 6.6-7.5 | 5.4.0 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,10 @@ then the nested template part's child blocks will not be returned. This way,
the template block itself is considered part of the parent, but the children
are not.

You can override this behavior with the includeControlledInnerBlocks setting.
So if you call `getBlock( TP, { WPGetBlockSettings: true } )`, it will return
all nested blocks, including all child inner block controllers and their children.

_Parameters_

- _state_ `Object`: Editor state.
- _clientId_ `string`: Block client ID.
- _settings_ `?WPGetBlockSettings`: A settings object.

_Returns_

Expand Down Expand Up @@ -282,8 +277,7 @@ _Returns_

Returns all block objects for the current post being edited as an array in
the order they appear in the post. Note that this will exclude child blocks
of nested inner block controllers unless the `includeControlledInnerBlocks`
setting is set to true.
of nested inner block controllers.

Note: It's important to memoize this selector to avoid return a new instance
on each call. We use the block cache state for each top-level block of the
Expand All @@ -295,7 +289,6 @@ _Parameters_

- _state_ `Object`: Editor state.
- _rootClientId_ `?string`: Optional root client ID of block list.
- _settings_ `?WPGetBlockSettings`: A settings object.

_Returns_

Expand Down
2 changes: 1 addition & 1 deletion docs/designers-developers/developers/data/data-core.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ _Parameters_

_Returns_

- `(?Object|null)`: Record.
- `?Object`: Record.

<a name="getEntityRecordEdits" href="#getEntityRecordEdits">#</a> **getEntityRecordEdits**

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This tutorial was written for Gutenberg version 8.5.
1. [What is needed to create a block-based theme?](/docs/designers-developers/developers/tutorials/block-based-themes/README.md#what-is-needed-to-create-a-block-based-theme)
2. [Creating the theme](/docs/designers-developers/developers/tutorials/block-based-themes/README.md#creating-the-theme)
3. [Creating the templates and template parts](/docs/designers-developers/developers/tutorials/block-based-themes/README.md#creating-the-templates-and-template-parts)
4. [Experimental-theme.json -Global styles](/docs/designers-developers/developers/tutorials/block-based-themes/README.md#experimental-themejson--global-styles)
4. [Experimental-theme.json -Global styles](/docs/designers-developers/developers/tutorials/block-based-themes/README.md#experimental-theme-json-global-styles)
5. [Adding blocks](/docs/designers-developers/developers/tutorials/block-based-themes/block-based-themes-2-adding-blocks.md)

## What is needed to create a block-based theme?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This tutorial covers general concepts and structure for creating basic blocks.

The block editor provides a [components package](/packages/components/README.md) which contains numerous prebuilt components you can use to build your block.

You can visually browse the components and what their implementation looks like using the Storybook tool published at https://wordpress.github.io/gutenberg.
You can visually browse the components and what their implementation looks like using the Storybook tool published at [https://wordpress.github.io/gutenberg](https://wordpress.github.io/gutenberg).

## Additional Tutorials

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# How to setup local WordPress environment on Ubuntu

This article covers setting up the local WordPress development environment using Docker on Ubuntu. The docker binaries included in the Ubuntu repositories (20.04 and earlier) do not support the features needed for the WordPress environment.
This article covers setting up the local WordPress development environment using Docker on Ubuntu.

You can follow these [directions from Docker to install](https://docs.docker.com/install/linux/docker-ce/ubuntu/) or [download the packages manually](https://download.docker.com/linux/ubuntu/dists/disco/pool/stable/amd64/) (download the last version of each and install using: `sudo dpkg -i *.deb`).
For Ubuntu 20.04.1, the standard docker binaries in the repository work as needed:

```
sudo apt install docker.io docker-compose
```

Additionally, you need to install `docker-compose`, you can follow the [directions from Docker](https://docs.docker.com/compose/install/) or simply [download the latest binary](https://github.com/docker/compose/releases) from GitHub releases.
For earlier versions of Ubuntu, the docker binaries included in repositories did not support the features needed for the WordPress environment.

After downloading the binary file `docker-compose-Linux-x86_64`, rename to just `docker-compose` and copy it to `/usr/local/bin` or another spot in your PATH.
- For Ubuntu prior to 20.04.1, follow these [directions from Docker to install](https://docs.docker.com/install/linux/docker-ce/ubuntu/). Additionally `docker-compose` is required, you may need to install separately, see [ Docker compose documentation](https://docs.docker.com/compose/install/).

## Troubleshooting

Expand Down Expand Up @@ -49,7 +53,8 @@ sudo systemctl restart docker.service
After restarting the services, set the environment variable DOCKER_HOST and try starting using:

```
DOCKER_HOST=http://127.0.0.1:2376 npm run wp-env start
export DOCKER_HOST=tcp://127.0.0.1:2376
npm run wp-env start
```

Your environment should be setup at: http://localhost:8889/
Your environment should be setup at: http://localhost:8888/
Loading

0 comments on commit 18e551b

Please sign in to comment.