Skip to content

Commit

Permalink
Merge branch 'master' into try/cover-background-image-auto-color
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Q committed Jul 7, 2020
2 parents 1f6ffc7 + 851127d commit 91a7aa6
Show file tree
Hide file tree
Showing 344 changed files with 4,148 additions and 3,895 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/cancel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Cancel
on: pull_request
jobs:
cancel:
name: 'Cancel Previous Runs'
runs-on: ubuntu-latest
timeout-minutes: 3
steps:
- name: Get all workflow ids and set to env variable
run: echo ::set-env name=WORKFLOW_IDS_TO_CANCEL::$(curl https://api.github.com/repos/${GITHUB_REPOSITORY}/actions/workflows -s | jq -r '.workflows | map(.id|tostring) | join(",")')

- uses: styfle/cancel-workflow-action@0.4.0
with:
workflow_id: ${{ env.WORKFLOW_IDS_TO_CANCEL }}
access_token: ${{ secrets.GITHUB_TOKEN }}
190 changes: 1 addition & 189 deletions .github/workflows/end2end-test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: End-2-End Tests
name: End-to-End Tests

on:
pull_request:
Expand Down Expand Up @@ -173,191 +173,3 @@ jobs:
run: |
$( npm bin )/wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --listTests > ~/.jest-e2e-tests
$( npm bin )/wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --cacheDirectory="$HOME/.jest-cache" --runTestsByPath $( awk 'NR % 4 == 3' < ~/.jest-e2e-tests )
author-1:
name: Author - 1

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x

- name: Npm install and build
run: |
npm ci
FORCE_REDUCED_MOTION=true npm run build
- name: Install WordPress
run: |
echo '{ "config": { "SCRIPT_DEBUG": false, "WP_PHP_BINARY": "php", "WP_TESTS_EMAIL": "admin@example.org", "WP_TESTS_TITLE": "Test Blog" } }' > .wp-env.override.json
chmod -R 767 ./ # TODO: Possibly integrate in wp-env
npm run wp-env start
- name: Add Author User
run: |
npm run wp-env run tests-cli "wp user create author author@example.com --role=author --user_pass=authpass"
npm run wp-env run tests-cli "wp post update 1 --post_author=2"
- name: Running the tests
run: |
$( npm bin )/wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --listTests > ~/.jest-e2e-tests
$( npm bin )/wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --cacheDirectory="$HOME/.jest-cache" --runTestsByPath $( awk 'NR % 4 == 0' < ~/.jest-e2e-tests )
author-2:
name: Author - 2

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x

- name: Npm install and build
run: |
npm ci
FORCE_REDUCED_MOTION=true npm run build
- name: Install WordPress
run: |
echo '{ "config": { "SCRIPT_DEBUG": false, "WP_PHP_BINARY": "php", "WP_TESTS_EMAIL": "admin@example.org", "WP_TESTS_TITLE": "Test Blog" } }' > .wp-env.override.json
chmod -R 767 ./ # TODO: Possibly integrate in wp-env
npm run wp-env start
- name: Add Author User
run: |
npm run wp-env run tests-cli "wp user create author author@example.com --role=author --user_pass=authpass"
npm run wp-env run tests-cli "wp post update 1 --post_author=2"
- name: Running the tests
run: |
$( npm bin )/wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --listTests > ~/.jest-e2e-tests
$( npm bin )/wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --cacheDirectory="$HOME/.jest-cache" --runTestsByPath $( awk 'NR % 4 == 1' < ~/.jest-e2e-tests )
author-3:
name: Author - 3

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x

- name: Npm install and build
run: |
npm ci
FORCE_REDUCED_MOTION=true npm run build
- name: Install WordPress
run: |
echo '{ "config": { "SCRIPT_DEBUG": false, "WP_PHP_BINARY": "php", "WP_TESTS_EMAIL": "admin@example.org", "WP_TESTS_TITLE": "Test Blog" } }' > .wp-env.override.json
chmod -R 767 ./ # TODO: Possibly integrate in wp-env
npm run wp-env start
- name: Add Author User
run: |
npm run wp-env run tests-cli "wp user create author author@example.com --role=author --user_pass=authpass"
npm run wp-env run tests-cli "wp post update 1 --post_author=2"
- name: Running the tests
run: |
$( npm bin )/wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --listTests > ~/.jest-e2e-tests
$( npm bin )/wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --cacheDirectory="$HOME/.jest-cache" --runTestsByPath $( awk 'NR % 4 == 2' < ~/.jest-e2e-tests )
author-4:
name: Author - 4

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x

- name: Npm install and build
run: |
npm ci
FORCE_REDUCED_MOTION=true npm run build
- name: Install WordPress
run: |
echo '{ "config": { "SCRIPT_DEBUG": false, "WP_PHP_BINARY": "php", "WP_TESTS_EMAIL": "admin@example.org", "WP_TESTS_TITLE": "Test Blog" } }' > .wp-env.override.json
chmod -R 767 ./ # TODO: Possibly integrate in wp-env
npm run wp-env start
- name: Add Author User
run: |
npm run wp-env run tests-cli "wp user create author author@example.com --role=author --user_pass=authpass"
npm run wp-env run tests-cli "wp post update 1 --post_author=2"
- name: Running the tests
run: |
$( npm bin )/wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --listTests > ~/.jest-e2e-tests
$( npm bin )/wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --cacheDirectory="$HOME/.jest-cache" --runTestsByPath $( awk 'NR % 4 == 3' < ~/.jest-e2e-tests )
3 changes: 3 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "packages/scripts/config/.markdownlint.json"
}
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
save-exact = true
engine-strict = true
5 changes: 5 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
== Changelog ==

= 8.5.0-rc.1 =

To be provided later.


= 8.4.0 =

### Features
Expand Down
52 changes: 32 additions & 20 deletions docs/contributors/document.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The [Make WordPress Docs blog](https://make.wordpress.org/docs/) is the primary

Real-time discussions for documentation take place in the `#docs` channel in [Make WordPress Slack](https://make.wordpress.org/chat) (registration required). Weekly meetings for the Documentation team are on Mondays at 14:00UTC.

The Gutenberg project uses GitHub for managing code and tracking issues. The main repository is at: [https://github.com/WordPress/gutenberg](https://github.com/WordPress/gutenberg). To find documentation issues to work on, browse [issues with documentation label](https://github.com/WordPress/gutenberg/issues?utf8=%E2%9C%93&q=is%3Aopen+is%3Aissue+label%3A%22%5BType%5D+Documentation%22+).
The Gutenberg project uses GitHub for managing code and tracking issues. The main repository is at: [https://github.com/WordPress/gutenberg](https://github.com/WordPress/gutenberg). To find documentation issues to work on, browse [issues with documentation label](https://github.com/WordPress/gutenberg/issues?utf8=%E2%9C%93&q=is%3Aopen+is%3Aissue+label%3A%22%5BType%5D+Documentation%22+).

## Documentation Types

Expand All @@ -19,7 +19,6 @@ There are two major sets of documentation for the Gutenberg project:

The rest of this document covers contributing to the Block Editor Handbook.


## Block Editor Handbook Process

The Block Editor Handbook is a mix of markdown files in the `/docs/` directory of the [Gutenberg project repository](https://github.com/WordPress/gutenberg/) and generated documentation from the packages.
Expand Down Expand Up @@ -51,15 +50,15 @@ To add a new documentation page:

It's likely that at some point you will want to link to other documentation pages. It's worth emphasizing that all documents can be browsed in different contexts:

- Block Editor Handbook
- GitHub website
- npm website
- Block Editor Handbook
- GitHub website
- npm website

To create links that work in all contexts, you should use absolute path links without the `https://github.com/WordPress/gutenberg` prefix. You can reference files using the following patterns:

- `/docs/*.md`
- `/packages/*/README.md`
- `/packages/components/src/**/README.md`
- `/docs/*.md`
- `/packages/*/README.md`
- `/packages/components/src/**/README.md`

This way they will be properly handled in all three aforementioned contexts.

Expand All @@ -71,23 +70,36 @@ A unique feature to the Gutenberg documentation is the `codetabs` toggle, this a

Here is an example `codetabs` section:

{% codetabs %}
{% ESNext %}
```js
// ESNext code here
```
{% ES5 %}
```js
// ES5 code here
```
{% end %}
{% codetabs %}
{% ESNext %}
```js
// ESNext code here
```
{% ES5 %}
```js
// ES5 code here
```
{% end %}

The preferred format for code examples is ESNext, which should also be the default viewed. The example placed first in source will be shown as the default.

Note: not all code examples are required to include ES5 code. The guidance is to include `ES5` code for beginner tutorials, but the majority of code in Gutenberg packages and across the larger React and JavaScript ecosystem is in ESNext.

### Editor Config

You should configure your editor to use Prettier to auto-format markdown documents. See the [Getting Started documentation](/docs/contributors/develop/getting-started/) for complete details.

An example config for using Visual Studio Code and the Prettier extensions:

```json
"\[markdown\]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
```

## Resources

- [Copy Guidelines](/docs/contributors/copy-guide.md) for writing instructions, documentations, or other contributions to Gutenberg project.
- [Copy Guidelines](/docs/contributors/copy-guide.md) for writing instructions, documentations, or other contributions to Gutenberg project.

- [Tone and Voice Guide](https://make.wordpress.org/docs/handbook/documentation-team-handbook/tone-and-voice-guide/) from WordPress Documentation.
- [Tone and Voice Guide](https://make.wordpress.org/docs/handbook/documentation-team-handbook/tone-and-voice-guide/) from WordPress Documentation.
14 changes: 2 additions & 12 deletions docs/contributors/env-ubuntu.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
# 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.
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.

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`
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`).

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.

Expand Down
15 changes: 8 additions & 7 deletions docs/contributors/getting-started.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# Getting Started


Gutenberg is built using the [latest active LTS release](https://github.com/nodejs/Release#release-schedule) of [Node.js](https://nodejs.org/en/), along with the latest version of [NPM](http://npmjs.com/).

The easiest way to install and manage node and NPM (on macOS, Linux, or Windows 10 with the Linux Subsystem) is by using [nvm](https://github.com/creationix/nvm). Once nvm is installed, you can install the correct version of Node by running nvm install --latest-npm in the Gutenberg directory.

>**Note:** If you find yourself needing to build older versions of Gutenberg, nvm makes that process easier too. Because Gutenberg's `.nvmrc` file is regularly updated to the current available LTS release, running `nvm install` on an older branch will install whichever LTS version was active at that time.
> **Note:** If you find yourself needing to build older versions of Gutenberg, nvm makes that process easier too. Because Gutenberg's `.nvmrc` file is regularly updated to the current available LTS release, running `nvm install` on an older branch will install whichever LTS version was active at that time.
Once you have Node installed, run these scripts from within your local Gutenberg repository:

Expand Down Expand Up @@ -71,14 +70,12 @@ Another way to upload after building is to run `npm run build:plugin-zip` to cre

> Storybook is an open source tool for developing UI components in isolation for React, React Native and more. It makes building stunning UIs organized and efficient.
The Gutenberg repository also includes [Storybook] integration that allows testing and developing in a WordPress-agnostic context. This is very helpful for developing reusable components and trying generic JavaScript modules without any backend dependency.
The Gutenberg repository also includes [Storybook](https://storybook.js.org/) integration that allows testing and developing in a WordPress-agnostic context. This is very helpful for developing reusable components and trying generic JavaScript modules without any backend dependency.

You can launch Storybook by running `npm run storybook:dev` locally. It will open in your browser automatically.

You can also test Storybook for the current `master` branch on GitHub Pages: [https://wordpress.github.io/gutenberg/](https://wordpress.github.io/gutenberg/)

[Storybook]: https://storybook.js.org/

## Developer Tools

We recommend configuring your editor to automatically check for syntax and lint errors. This will help you save time as you develop by automatically fixing minor formatting issues. Here are some directions for setting up Visual Studio Code, a popular editor used by many of the core developers, these tools are also available for other editors.
Expand Down Expand Up @@ -106,13 +103,17 @@ With the extension installed, ESLint will use the [.eslintrc.js](https://github.
To use Prettier with Visual Studio Code, you should install the [Prettier - Code formatter extension](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode). You can then configure it to be the default formatter and to automatically fix issues on save, by adding the following to your settings.

```json
"[javascript]": {
"\[javascript\]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"\[markdown\]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
```

This will use the `.prettierrc.js` file included in the root of the Gutenberg repository.
This will use the `.prettierrc.js` file included in the root of the Gutenberg repository. The config is included from the [@wordpress/prettier-config](/packages/prettier-config/README.md) package.

If you only want to use this configuration with the Gutenberg project, create a directory called .vscode at the top-level of Gutenberg, and place your settings in a settings.json there. Visual Studio Code refers to this as Workplace Settings, and only apply to the project.

Expand Down
Loading

0 comments on commit 91a7aa6

Please sign in to comment.