Skip to content

Commit

Permalink
Merge tag 'rnmobile/1.21.0' into rnmobile/releases-2020
Browse files Browse the repository at this point in the history
  • Loading branch information
hypest committed Feb 3, 2020
2 parents 041394d + 47b74aa commit 0d2d141
Show file tree
Hide file tree
Showing 571 changed files with 18,827 additions and 8,719 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,3 +142,4 @@ This list is manually curated to include valuable contributions by volunteers th
| @mkevins | |
| @SergioEstevao | |
| @mzorz | @mzorz |
| @akkspros | @passoniate |
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### WordPress - Web publishing software

Copyright 2011-2019 by the contributors
Copyright 2011-2020 by the contributors

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
1 change: 1 addition & 0 deletions bin/api-docs/packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const packages = [
'shortcode',
'url',
'viewport',
'warning',
'wordcount',
];

Expand Down
13 changes: 11 additions & 2 deletions bin/packages/get-packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,18 @@ function isDirectory( file ) {
* @return {boolean} Whether file is a directory.
*/
function hasModuleField( file ) {
const { module } = require( path.resolve( PACKAGES_DIR, file, 'package.json' ) );
let pkg;
try {
pkg = require( path.resolve( PACKAGES_DIR, file, 'package.json' ) );
} catch {
// If, for whatever reason, the package's `package.json` cannot be read,
// consider it as an invalid candidate. In most cases, this can happen
// when lingering directories are left in the working path when changing
// to an older branch where a package did not yet exist.
return false;
}

return ! isEmpty( module );
return ! isEmpty( pkg.module );
}

/**
Expand Down
335 changes: 335 additions & 0 deletions changelog.txt

Large diffs are not rendered by default.

67 changes: 67 additions & 0 deletions docs/contributors/env-ubuntu.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@

# 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 (19.10 and earlier) do not support the features needed for the WordPress environment.

If you are using Ubuntu 19.04 or 18.04, you can follow these [directions from Docker to install](https://docs.docker.com/install/linux/docker-ce/ubuntu/).

If you are using Ubuntu 19.10, Docker does not have a repository setup for this version. However, the binaries are the same as previous, so you can download the packages from: https://download.docker.com/linux/ubuntu/dists/disco/pool/stable/amd64/

Packages required:

* `containerd.io_1.2.10-3_amd64.deb`
* `docker-ce-cli_19.03.3~3-0~ubuntu-disco_amd64.deb`
* `docker-ce_19.03.3~3-0~ubuntu-disco_amd64.deb`

Install using: `sudo dpkg -i *.deb`

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.

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.


## Troubleshooting

If you run into this error, when running `npm run env install` from the Gutenberg directory:

```
ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running?
If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
```

First, make sure docker is running. You can check using `ps -ef | grep docker` which should show something like:

```
/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
```

If docker is not running, try to start the service using:

```
sudo systemctl start docker.service
```

If docker is running, then it is not listening how the WordPress environment is trying to communicate. Try adding the following service override file to include listening on tcp. See docker documentation, [How do I enable the remote API for dockerd](https://success.docker.com/article/how-do-i-enable-the-remote-api-for-dockerd)

```
# /etc/systemd/system/docker.service.d/override.conf
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -H fd:// -H tcp://0.0.0.0:2376
```

Restart the service from the command-line
```
sudo systemctl daemon-reload
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 env start
```

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

6 changes: 5 additions & 1 deletion docs/contributors/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ If you don't have a local WordPress environment to load Gutenberg in, we can hel
### Step 1: Installing a Local Environment
#### Quickest Method: Using Docker

The quickest way to get up and running is to use the provided Docker setup. If you don't already have it, you'll need to install Docker by following their 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).
The quickest way to get up and running is to use the provided Docker setup. If you don't already have it, you'll need to install Docker and Docker Compose.

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 Compose, [follow their instructions here](https://docs.docker.com/compose/install/), be sure to select your operating system for proper instructions.

Once Docker is installed and running, run this script to install WordPress, and build your local environment:

Expand Down
122 changes: 122 additions & 0 deletions docs/contributors/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,128 @@ Now, the branch is ready to be used to publish the npm packages.

Now, the npm packages should be ready and a patch can be created and committed into the corresponding WordPress SVN branch.


### Standalone Package Releases

The following workflow is needed when packages require bug fixes or security releases to be published to _npm_ outside of a WordPress release cycle.

Note: Both the `master` and `wp/trunk` branches are restricted and can only be _pushed_ to by the Gutenberg Core team.

Identify the commit hashes from the pull requests that need to be ported from the repo `master` branch to `wp/trunk`

The `wp/trunk` branch now needs to be prepared to release and publish the packages to _npm_.

Open a terminal and perform the following steps:
1. `git checkout master`
2. `git pull`
3. `git checkout wp/trunk`
4. `git pull`

Before porting commits check that the `wp/trunk` branch does not have any outstanding packages waiting to be published:
1. `git checkout wp/trunk`
2. `npm run publish:check`

Now _cherry-pick_ the commits from `master` to `wp/trunk`, use `-m 1 commithash` if the commit was a pull request merge commit:
1. `git cherry-pick -m 1 cb150a2`
2. `git push`

Whilst waiting for the Travis CI build for `wp/trunk` [branch to pass](https://travis-ci.com/WordPress/gutenberg/branches) identify and begin updating the `CHANGELOG.md` files:
1. `git checkout wp/trunk`
2. `npm run publish:check`
> Example
> ```shell
> npm run publish:check
> @wordpress/e2e-tests
> @wordpress/jest-preset-default
> @wordpress/scripts
> lerna success found 3 packages ready to publish
> ```
Check the versions listed in the current `CHANGELOG.md` file, looking through the commit history of a package e.g [@wordpress/scripts](https://github.com/WordPress/gutenberg/commits/master/packages/scripts) and look out for _"chore(release): publish"_ and _"Update changelogs"_ commits to determine recent version bumps, then looking at the commits since the most recent release should aid with discovering what changes have occurred since the last release.
Note: You may discover the current version of each package is not up to date, if so updating the previous released versions would be appreciated.
Begin updating the _changelogs_ based on the [Maintaining Changelogs](https://github.com/WordPress/gutenberg/blob/master/packages/README.md#maintaining-changelogs) documentation and commit the changes:
1. `git checkout wp/trunk`
2. Update each of the `CHANGELOG.md` files
3. Stage the _changelog_ changes `git add packages/`
4. `git commit -m "Update changelogs"`
5. Make a note of the commit hash of this commit
> Example
> ```
> [master 278f524f16] Update changelogs` 278f524
> ```
6. `git push`
Now that the changes have been committed to the `wp/trunk` branch and the Travis CI builds for the `wp/trunk` [branch are passing](https://travis-ci.com/WordPress/gutenberg/branches) it's time to publish the packages to npm:
1. Once again run `npm run publish:check` to confirm there are no unexpected packages ready to be published:
> Example
> ```shell
> npm run publish:check
> @wordpress/e2e-tests
> @wordpress/jest-preset-default
> @wordpress/scripts
> lerna success found 3 packages ready to publish
> ```
2. Run the [package release process](https://github.com/WordPress/gutenberg/blob/master/packages/README.md#releasing-packages) but when asked for the version numbers to choose for each package use the versions you made note of above when updating each packages `CHANGELOG.md` file.
> Truncated example of publishing process output
> ```
> npm run publish:prod
>
> Build Progress: [==============================] 100%
> lerna notice cli v3.18.2
> lerna info versioning independent
> ? Select a new version for @wordpress/e2e-tests (currently 1.9.0) Patch (1.9.1)
> ? Select a new version for @wordpress/jest-preset-default (currently 5.3.0) Patch (5.3.1)
> ? Select a new version for @wordpress/scripts (currently 6.1.0) Patch (6.1.1)
>
> Changes:
> - @wordpress/e2e-tests: 1.9.0 => 1.9.1
> - @wordpress/jest-preset-default: 5.3.0 => 5.3.1
> - @wordpress/scripts: 6.1.0 => 6.1.1
>
> ? Are you sure you want to publish these packages? Yes
> lerna info execute Skipping releases
> lerna info git Pushing tags...
> lerna info publish Publishing packages to npm...
> lerna info Verifying npm credentials
> lerna info Checking two-factor auth mode
> ? Enter OTP: 753566
> lerna success published @wordpress/jest-preset-default 5.3.1
> lerna success published @wordpress/scripts 6.1.1
> lerna success published @wordpress/e2e-tests 1.9.1
> Successfully published:
> - @wordpress/[email protected]
> - @wordpress/[email protected]
> - @wordpress/[email protected]
> lerna success published 3 packages
> ```
Now that the packages have been published the _"chore(release): publish"_ and _"Update changelogs"_ commits to `wp/trunk` need to be ported to the `master` branch:
1. `git checkout master`
2. `git pull`
3. Cherry-pick the `278f524`hash you noted above from the _"Update changelogs"_ commit made to `wp/trunk`
4. `git cherry-pick 278f524`
5. Get the commit hash from the the lerna publish commit either from the terminal or [wp/trunk commits](https://github.com/WordPress/gutenberg/commits/wp/trunk)
6. Cherry-pick the `fe6ae0d` "chore(release): publish"_ commit made to `wp/trunk`
7. `git cherry-pick fe6ae0d`
8. `git push`
Confirm the packages dependancies do not contain `file://` links in the `dependencies` or `devdependencies` section of the packages released, e.g:
> https://unpkg.com/browse/@wordpress/[email protected]/package.json
> https://unpkg.com/browse/@wordpress/[email protected]/package.json
> https://unpkg.com/browse/@wordpress/[email protected]/package.json
Time to announce the published changes in the #core-js and #core-editor Slack channels
> ```
> 📣 Successfully published:
> • @wordpress/[email protected]
> • @wordpress/[email protected]
> • @wordpress/[email protected]
> Lerna success published 3 packages
```
---------
Ta-da! 🎉
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ _Example_: Extract `src` and `alt` from each image element in the block's markup
{
images: {
type: 'array',
source: 'query'
source: 'query',
selector: 'img',
query: {
url: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ registerBlockType( 'my-plugin/book', {} );

A block requires a few properties to be specified before it can be registered successfully. These are defined through a configuration object, which includes the following:

#### Title
#### title

* **Type:** `String`

Expand All @@ -38,7 +38,7 @@ This is the display title for your block, which can be translated with our trans
title: __( 'Book' )
```

#### Description (optional)
#### description (optional)

* **Type:** `String`

Expand All @@ -48,7 +48,7 @@ This is a short description for your block, which can be translated with our tra
description: __( 'Block showing a Book card.' )
```

#### Category
#### category

* **Type:** `String` [ common | formatting | layout | widgets | embed ]

Expand All @@ -69,7 +69,7 @@ category: 'widgets',

Plugins and Themes can also register [custom block categories](/docs/designers-developers/developers/filters/block-filters.md#managing-block-categories).

#### Icon (optional)
#### icon (optional)

* **Type:** `String` | `Object`

Expand Down Expand Up @@ -100,7 +100,7 @@ icon: {
} ,
```

#### Keywords (optional)
#### keywords (optional)

* **Type:** `Array`

Expand All @@ -112,7 +112,7 @@ Sometimes a block could have aliases that help users discover it while searching
keywords: [ __( 'image' ), __( 'photo' ), __( 'pics' ) ],
```

#### Styles (optional)
#### styles (optional)

* **Type:** `Array`

Expand Down Expand Up @@ -140,7 +140,7 @@ styles: [

Plugins and Themes can also register [custom block style](/docs/designers-developers/developers/filters/block-filters.md#block-style-variations) for existing blocks.

#### Attributes (optional)
#### attributes (optional)

* **Type:** `Object`

Expand Down Expand Up @@ -168,7 +168,7 @@ attributes: {

* **See: [Attributes](/docs/designers-developers/developers/block-api/block-attributes.md).**

#### Example (optional)
#### example (optional)

* **Type:** `Object`

Expand All @@ -188,7 +188,7 @@ example: {

If `example` is not defined, the preview will not be shown. So even if no-attributes are defined, setting a empty example object `example: {}` will trigger the preview to show.

#### Transforms (optional)
#### transforms (optional)

* **Type:** `Array`

Expand Down Expand Up @@ -653,3 +653,38 @@ By default all blocks can be converted to a reusable block. If supports reusable
// Don't allow the block to be converted into a reusable block.
reusable: false,
```

## Block Collections

## `registerBlockCollection`

* **Type:** `Function`

Blocks can be added to collections, grouping together all blocks from the same origin

`registerBlockCollection` takes two parameters, `namespace` and an object of settings including `title` and `icon`.

### Namespace

* **Type:** `String`

This should match the namespace declared in the block name; the name of your plugin or theme.

### Settings

#### Title

* **Type:** `String`

This will display in the block inserter section, which will list all blocks in this collection.

#### Icon

* **Type:** `Object`

(Optional) An icon to display alongside the title in the block inserter.

```js
// Registering a block collection
registerBlockCollection( 'my-plugin', { title: 'My Plugin' } );
```
Loading

0 comments on commit 0d2d141

Please sign in to comment.