Skip to content

Commit

Permalink
Merge changes published in the Gutenberg plugin v6.9 release
Browse files Browse the repository at this point in the history
  • Loading branch information
gziolo committed Nov 14, 2019
1 parent 4441a24 commit cc1f277
Show file tree
Hide file tree
Showing 872 changed files with 30,800 additions and 11,739 deletions.
4 changes: 3 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ module.exports = {
},
excludedFiles: [
'**/*.@(android|ios|native).js',
'**/@(benchmark|test|__tests__)/**/*.js',
'**/benchmark/**/*.js',
'**/@(__mocks__|__tests__|test)/**/*.js',
'**/@(storybook|stories)/**/*.js',
],
},
{
Expand Down
8 changes: 4 additions & 4 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
/packages/custom-templated-path-webpack-plugin @ntwb @nerrad @ajitbohra
/packages/docgen @nosolosw
/packages/e2e-test-utils @gziolo @ntwb @nerrad @ajitbohra
/packages/e2e-tests @gziolo @ntwb @nerrad @ajitbohra @talldan
/packages/e2e-tests @ntwb @nerrad @ajitbohra @talldan
/packages/eslint-plugin @gziolo @ntwb @nerrad @ajitbohra
/packages/jest-console @gziolo @ntwb @nerrad @ajitbohra
/packages/jest-preset-default @gziolo @ntwb @nerrad @ajitbohra
Expand All @@ -51,9 +51,9 @@
/packages/scripts @youknowriad @gziolo @ntwb @nerrad @ajitbohra

# UI Components
/packages/components @youknowriad @gziolo @ajitbohra @jaymanpandya @jorgefilipecosta @talldan @chrisvanpatten
/packages/compose @youknowriad @gziolo @ajitbohra @jaymanpandya @jorgefilipecosta @talldan
/packages/element @youknowriad @gziolo @ajitbohra @jaymanpandya @jorgefilipecosta @talldan
/packages/components @youknowriad @ajitbohra @jaymanpandya @jorgefilipecosta @talldan @chrisvanpatten
/packages/compose @youknowriad @ajitbohra @jaymanpandya @jorgefilipecosta @talldan
/packages/element @youknowriad @ajitbohra @jaymanpandya @jorgefilipecosta @talldan
/packages/notices @ajitbohra @jaymanpandya @jorgefilipecosta @talldan
/packages/nux @ajitbohra @jaymanpandya @jorgefilipecosta @talldan @noisysocks
/packages/viewport @youknowriad @ajitbohra @jaymanpandya @jorgefilipecosta @talldan
Expand Down
1 change: 1 addition & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@
- [ ] My code follows the accessibility standards. <!-- Guidelines: https://make.wordpress.org/core/handbook/best-practices/coding-standards/accessibility-coding-standards/ -->
- [ ] My code has proper inline documentation. <!-- Guidelines: https://make.wordpress.org/core/handbook/best-practices/inline-documentation-standards/javascript/ -->
- [ ] I've included developer documentation if appropriate. <!-- Handbook: https://developer.wordpress.org/block-editor/ -->
- [ ] I've updated all React Native files affected by any refactorings/renamings in this PR. <!-- React Native mobile Gutenberg guidelines: https://github.com/WordPress/gutenberg/blob/master/docs/contributors/native-mobile.md -->.
39 changes: 39 additions & 0 deletions .npmpackagejsonlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"extends": "@wordpress/npm-package-json-lint-config",
"rules": {
"description-format": [
"error",
{
"requireCapitalFirstLetter": true,
"requireEndingPeriod": true
}
],
"prefer-no-devDependencies": "error",
"require-publishConfig": "error",
"require-repository-directory": "error",
"valid-values-author": [
"error",
[
"The WordPress Contributors"
]
],
"valid-values-publishConfig": [
"error",
[
{
"access": "public"
}
]
]
},
"overrides": [
{
"patterns": [ "./package.json" ],
"rules": {
"require-publishConfig": "off",
"require-repository-directory": "off",
"prefer-no-devDependencies": "off"
}
}
]
}
34 changes: 20 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ branches:
only:
- master
- rnmobile/master
- wp/trunk
- rnmobile/releases
- /wp\/.*/

env:
global:
Expand Down Expand Up @@ -195,18 +196,23 @@ jobs:
- $( 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 )

- stage: deploy
if: branch = master
name: Deploy Playground
env: INSTALL_WORDPRESS=false
install:
- npm ci
before_deploy:
- npm run playground:build -- --public-url '/gutenberg'
- npm run design-system:build
deploy:
provider: pages
skip_cleanup: true
github_token: $GITHUB_TOKEN
keep_history: true
local_dir: playground/dist
on:
branch: master

allow_failures:
- name: JavaScript native mobile tests

before_deploy:
- npm install
- npm run playground:build -- --public-url '/gutenberg'

deploy:
provider: pages
skip_cleanup: true
github_token: $GITHUB_TOKEN
keep_history: true
local_dir: playground/dist
on:
branch: master
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Gutenberg
[![Build Status](https://img.shields.io/travis/com/WordPress/gutenberg/master.svg)](https://travis-ci.com/WordPress/gutenberg)
[![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lernajs.io/)
[![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lerna.js.org)

![Screenshot of the Gutenberg Editor, editing a post in WordPress](https://cldup.com/H0oKBfpidk.png)
![Screenshot of the Gutenberg Editor, editing a post in WordPress](https://cldup.com/R84R5fNgrI.png)

This repo is the development hub for the <a href="https://make.wordpress.org/core/2017/01/04/focus-tech-and-design-leads/">editor focus in WordPress Core</a>. `Gutenberg` is the project name.

Expand Down Expand Up @@ -32,7 +32,6 @@ Here's why we're looking at the whole editing screen, as opposed to just the con
4. **A fresh look at content creation.** Considering the whole interface lays a solid foundation for the next focus: full site customization.
5. **Modern tooling.** Looking at the full editor screen also gives WordPress the opportunity to drastically modernize the foundation, and take steps towards a more fluid and JavaScript-powered future that fully leverages the WordPress REST API.

![Writing in Gutenberg 1.6](https://make.wordpress.org/core/files/2017/10/gutenberg-typing-1_6.gif)

## Blocks

Expand Down
23 changes: 17 additions & 6 deletions bin/commander.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const uuid = require( 'uuid/v4' );

// Config
const gitRepoOwner = 'WordPress';
const gitRepoURL = 'git@github.com:' + gitRepoOwner + '/gutenberg.git';
const gitRepoURL = 'https://github.com/' + gitRepoOwner + '/gutenberg.git';
const svnRepoURL = 'https://plugins.svn.wordpress.org/gutenberg';

// Working Directories
Expand All @@ -31,6 +31,16 @@ const success = chalk.bold.green;

// Utils

/**
* Small utility used to read an uncached version of a JSON file
*
* @param {string} fileName
*/
function readJSONFile( fileName ) {
const data = fs.readFileSync( fileName, 'utf8' );
return JSON.parse( data );
}

/**
* Asks the user for a confirmation to continue or abort otherwise
*
Expand Down Expand Up @@ -85,6 +95,7 @@ function runShellScript( script, cwd ) {
env: {
NO_CHECKS: true,
PATH: process.env.PATH,
HOME: process.env.HOME,
},
stdio: [ 'inherit', 'ignore', 'inherit' ],
} );
Expand Down Expand Up @@ -250,7 +261,7 @@ async function runReleaseBranchCreationStep( abortMessage ) {
await runStep( 'Creating the release branch', abortMessage, async () => {
const simpleGit = SimpleGit( gitWorkingDirectoryPath );
const packageJsonPath = gitWorkingDirectoryPath + '/package.json';
const packageJson = require( packageJsonPath );
const packageJson = readJSONFile( packageJsonPath );
const parsedVersion = semver.parse( packageJson.version );

// Follow the WordPress version guidelines to compute the version to be used
Expand Down Expand Up @@ -294,15 +305,15 @@ async function runReleaseBranchCheckoutStep( abortMessage ) {
await runStep( 'Getting into the release branch', abortMessage, async () => {
const simpleGit = SimpleGit( gitWorkingDirectoryPath );
const packageJsonPath = gitWorkingDirectoryPath + '/package.json';
const masterPackageJson = require( packageJsonPath );
const masterPackageJson = readJSONFile( packageJsonPath );
const masterParsedVersion = semver.parse( masterPackageJson.version );
releaseBranch = 'release/' + masterParsedVersion.major + '.' + masterParsedVersion.minor;

// Creating the release branch
await simpleGit.checkout( releaseBranch );
console.log( '>> The local release branch ' + success( releaseBranch ) + ' has been successfully checked out.' );

const releaseBranchPackageJson = require( packageJsonPath );
const releaseBranchPackageJson = readJSONFile( packageJsonPath );
const releaseBranchParsedVersion = semver.parse( releaseBranchPackageJson.version );

if ( releaseBranchParsedVersion.prerelease && releaseBranchParsedVersion.prerelease.length ) {
Expand Down Expand Up @@ -341,8 +352,8 @@ async function runBumpPluginVersionAndCommitStep( version, abortMessage ) {
const packageJsonPath = gitWorkingDirectoryPath + '/package.json';
const packageLockPath = gitWorkingDirectoryPath + '/package-lock.json';
const pluginFilePath = gitWorkingDirectoryPath + '/gutenberg.php';
const packageJson = require( packageJsonPath );
const packageLock = require( packageLockPath );
const packageJson = readJSONFile( packageJsonPath );
const packageLock = readJSONFile( packageLockPath );
const newPackageJson = {
...packageJson,
version,
Expand Down
11 changes: 10 additions & 1 deletion bin/get-vendor-scripts.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,13 @@ function wp_add_inline_script() {}

require_once dirname( dirname( __FILE__ ) ) . '/lib/client-assets.php';

gutenberg_register_vendor_scripts();
/**
* Hi, phpcs
*/
function run_gutenberg_register_vendor_scripts() {
global $wp_scripts;

gutenberg_register_vendor_scripts( $wp_scripts );
}

run_gutenberg_register_vendor_scripts();
2 changes: 1 addition & 1 deletion bin/packages/build-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const BUILD_TASK_BY_EXTENSION = {

const builtSass = await renderSass( {
file,
includePaths: [ path.resolve( __dirname, '../../assets/stylesheets' ) ],
includePaths: [ path.join( PACKAGES_DIR, 'base-styles' ) ],
data: (
[
'colors',
Expand Down
5 changes: 3 additions & 2 deletions bin/packages/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,9 @@ if ( files.length ) {
`${ PACKAGES_DIR }/*/src/*.scss`,
], {
ignore: [
`**/test/**`,
`**/__mocks__/**`,
`**/benchmark/**`,
`**/{__mocks__,__tests__,test}/**`,
`**/{storybook,stories}/**`,
],
onlyFiles: true,
} );
Expand Down
63 changes: 3 additions & 60 deletions bin/packages/post-css-config.js
Original file line number Diff line number Diff line change
@@ -1,64 +1,7 @@
const { adminColorSchemes } = require( '@wordpress/base-styles' );

module.exports = [
require( '@wordpress/postcss-themes' )( {
defaults: {
primary: '#0085ba',
secondary: '#11a0d2',
toggle: '#11a0d2',
button: '#007cba',
outlines: '#007cba',
},
themes: {
'admin-color-light': {
primary: '#0085ba',
secondary: '#c75726',
toggle: '#11a0d2',
button: '#0085ba',
outlines: '#007cba',
},
'admin-color-blue': {
primary: '#82b4cb',
secondary: '#d9ab59',
toggle: '#82b4cb',
button: '#d9ab59',
outlines: '#417e9B',
},
'admin-color-coffee': {
primary: '#c2a68c',
secondary: '#9fa47b',
toggle: '#c2a68c',
button: '#c2a68c',
outlines: '#59524c',
},
'admin-color-ectoplasm': {
primary: '#a7b656',
secondary: '#c77430',
toggle: '#a7b656',
button: '#a7b656',
outlines: '#523f6d',
},
'admin-color-midnight': {
primary: '#e14d43',
secondary: '#77a6b9',
toggle: '#77a6b9',
button: '#e14d43',
outlines: '#497b8d',
},
'admin-color-ocean': {
primary: '#a3b9a2',
secondary: '#a89d8a',
toggle: '#a3b9a2',
button: '#a3b9a2',
outlines: '#5e7d5e',
},
'admin-color-sunrise': {
primary: '#d1864a',
secondary: '#c8b03c',
toggle: '#c8b03c',
button: '#d1864a',
outlines: '#837425',
},
},
} ),
require( '@wordpress/postcss-themes' )( adminColorSchemes ),
require( 'autoprefixer' )( { grid: true } ),
require( 'postcss-color-function' ),
];
2 changes: 1 addition & 1 deletion bin/packages/watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const exists = ( filename ) => {
// and files with a suffix of .test or .spec (e.g. blocks.test.js),
// and deceitful source-like files, such as editor swap files.
const isSourceFile = ( filename ) => {
return ! [ /\/(__tests__|test)\/.+.js$/, /.\.(spec|test)\.js$/ ].some( ( regex ) => regex.test( filename ) ) && /.\.(js|json|scss)$/.test( filename );
return ! [ /\/(benchmark|__mocks__|__tests__|test|storybook|stories)\/.+.js$/, /.\.(spec|test)\.js$/ ].some( ( regex ) => regex.test( filename ) ) && /.\.(js|json|scss)$/.test( filename );
};

const rebuild = ( filename ) => filesToBuild.set( filename, true );
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"dealerdirect/phpcodesniffer-composer-installer": "^0.5.0",
"squizlabs/php_codesniffer": "^3.4.2",
"phpcompatibility/php-compatibility": "^9.2.0",
"wp-coding-standards/wpcs": "^2.1.1"
"wp-coding-standards/wpcs": "^2.1.1",
"sirbrillig/phpcs-variable-analysis": "^2.7"
},
"require": {
"composer/installers": "~1.0"
Expand Down
Loading

0 comments on commit cc1f277

Please sign in to comment.