Skip to content

Commit

Permalink
Merge branch 'rnmobile/develop' of https://github.com/WordPress/guten…
Browse files Browse the repository at this point in the history
…berg into rnmobile/Placeholder-is-missing-on-Heading-block

* 'rnmobile/develop' of https://github.com/WordPress/gutenberg:
  Get the last master changes into the mobile develop branch (#14375)
  • Loading branch information
daniloercoli committed Mar 14, 2019
2 parents c196b68 + a981491 commit 7e2be3a
Show file tree
Hide file tree
Showing 951 changed files with 34,464 additions and 18,730 deletions.
21 changes: 11 additions & 10 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@

# Tooling
/bin @youknowriad @gziolo @aduth @ntwb @nerrad @ajitbohra
/packages/babel-plugin-import-jsx-pragma @youknowriad @gziolo @aduth @ntwb @nerrad @ajitbohra
/packages/babel-plugin-import-jsx-pragma @youknowriad @gziolo @aduth @ntwb @nerrad @ajitbohra @nosolosw
/packages/babel-plugin-makepot @youknowriad @gziolo @aduth @ntwb @nerrad @ajitbohra
/packages/babel-preset-default @youknowriad @gziolo @aduth @ntwb @nerrad @ajitbohra
/packages/babel-preset-default @youknowriad @gziolo @aduth @ntwb @nerrad @ajitbohra @nosolosw
/packages/browserslist-config @youknowriad @gziolo @aduth @ntwb @nerrad @ajitbohra
/packages/custom-templated-path-webpack-plugin @youknowriad @gziolo @aduth @ntwb @nerrad @ajitbohra
/packages/docgen @nosolosw @mkaz
/packages/e2e-test-utils @youknowriad @gziolo @aduth @ntwb @nerrad @ajitbohra
/packages/e2e-tests @youknowriad @gziolo @aduth @ntwb @nerrad @ajitbohra @talldan
/packages/eslint-plugin @youknowriad @gziolo @aduth @ntwb @nerrad @ajitbohra @nosolosw
Expand All @@ -40,12 +41,12 @@
/packages/scripts @youknowriad @gziolo @aduth @ntwb @nerrad @ajitbohra @nosolosw @mkaz

# UI Components
/packages/components @youknowriad @gziolo @aduth @chrisvanpatten @ajitbohra @jaymanpandya @jorgefilipecosta @talldan @noisysocks
/packages/compose @youknowriad @gziolo @aduth @chrisvanpatten @ajitbohra @jaymanpandya @jorgefilipecosta @talldan @noisysocks
/packages/element @youknowriad @gziolo @aduth @chrisvanpatten @ajitbohra @jaymanpandya @jorgefilipecosta @talldan @noisysocks
/packages/notices @youknowriad @gziolo @aduth @chrisvanpatten @ajitbohra @jaymanpandya @jorgefilipecosta @talldan @noisysocks
/packages/nux @youknowriad @gziolo @aduth @chrisvanpatten @ajitbohra @jaymanpandya @jorgefilipecosta @talldan @noisysocks
/packages/viewport @youknowriad @gziolo @aduth @chrisvanpatten @ajitbohra @jaymanpandya @jorgefilipecosta @talldan @noisysocks
/packages/components @youknowriad @gziolo @aduth @ajitbohra @jaymanpandya @jorgefilipecosta @talldan @noisysocks @chrisvanpatten
/packages/compose @youknowriad @gziolo @aduth @ajitbohra @jaymanpandya @jorgefilipecosta @talldan @noisysocks
/packages/element @youknowriad @gziolo @aduth @ajitbohra @jaymanpandya @jorgefilipecosta @talldan @noisysocks
/packages/notices @youknowriad @gziolo @aduth @ajitbohra @jaymanpandya @jorgefilipecosta @talldan @noisysocks
/packages/nux @youknowriad @gziolo @aduth @ajitbohra @jaymanpandya @jorgefilipecosta @talldan @noisysocks
/packages/viewport @youknowriad @gziolo @aduth @ajitbohra @jaymanpandya @jorgefilipecosta @talldan @noisysocks

# Utilities
/packages/a11y @youknowriad @gziolo @aduth
Expand Down Expand Up @@ -79,8 +80,8 @@
# Documentation
/docs @youknowriad @gziolo @chrisvanpatten @mkaz @ajitbohra @nosolosw @notnownikki

# Styles (Unowned)
*.scss @ghost
# Styles
*.scss @chrisvanpatten

# Native (Unowned)
*.native.js @ghost
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ build-module
build-style
node_modules
gutenberg.zip
languages/gutenberg.pot
/languages/gutenberg-translations.php

# Directories/files that may appear in your environment
.DS_Store
Expand Down
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ jobs:
install:
- npm ci
script:
- npm run build
- npm run lint
- npm run check-local-changes
- npm run check-licenses
- npm run test-unit -- --ci --maxWorkers=2 --cacheDirectory="$HOME/.jest-cache"

- name: PHP unit tests (Docker)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Gutenberg
[![Build Status](https://img.shields.io/travis/WordPress/gutenberg/master.svg)](https://travis-ci.org/WordPress/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/)

![Screenshot of the Gutenberg Editor, editing a post in WordPress](https://cldup.com/H0oKBfpidk.png)
Expand Down
4 changes: 2 additions & 2 deletions assets/stylesheets/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@

@mixin square-style__focus() {
color: $dark-gray-900;
outline: 1px solid $dark-gray-300;
box-shadow: none;
outline-offset: -1px;
outline: 1px dotted $dark-gray-500;
}

// Menu items.
Expand Down
1 change: 1 addition & 0 deletions assets/stylesheets/_z-index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ $z-layers: (
".edit-post-header": 30,
".block-library-button__inline-link .editor-url-input__suggestions": 6, // URL suggestions for button block above sibling inserter
".block-library-image__resize-handlers": 1, // Resize handlers above sibling inserter
".wp-block-cover__inner-container": 1, // InnerBlocks area inside cover image block
".wp-block-cover.has-background-dim::before": 1, // Overlay area inside block cover need to be higher than the video background.
".wp-block-cover__video-background": 0, // Video background inside cover block.

Expand Down
22 changes: 0 additions & 22 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,5 @@ module.exports = function( api ) {

return {
presets: [ '@wordpress/babel-preset-default' ],
plugins: [
[
'@wordpress/babel-plugin-import-jsx-pragma',
{
scopeVariable: 'createElement',
source: '@wordpress/element',
isDefault: false,
},
],
],
env: {
production: {
plugins: [
[
'@wordpress/babel-plugin-makepot',
{
output: 'languages/gutenberg.pot',
},
],
],
},
},
};
};
31 changes: 15 additions & 16 deletions bin/build-plugin-zip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,21 @@ fi
# Do a dry run of the repository reset. Prompting the user for a list of all
# files that will be removed should prevent them from losing important files!
status "Resetting the repository to pristine condition. ✨"
git clean -xdf --dry-run
warning "🚨 About to delete everything above! Is this okay? 🚨"
echo -n "[y]es/[N]o: "
read answer
if [ "$answer" != "${answer#[Yy]}" ]; then
# Remove ignored files to reset repository to pristine condition. Previous
# test ensures that changed files abort the plugin build.
status "Cleaning working directory... 🛀"
git clean -xdf
else
error "Fair enough; aborting. Tidy up your repo and try again. 🙂"
exit 1
to_clean=$(git clean -xdf --dry-run)
if [ ! -z "$to_clean" ]; then
echo $to_clean
warning "🚨 About to delete everything above! Is this okay? 🚨"
echo -n "[y]es/[N]o: "
read answer
if [ "$answer" != "${answer#[Yy]}" ]; then
# Remove ignored files to reset repository to pristine condition. Previous
# test ensures that changed files abort the plugin build.
status "Cleaning working directory... 🛀"
git clean -xdf
else
error "Fair enough; aborting. Tidy up your repo and try again. 🙂"
exit 1
fi
fi

# Download all vendor scripts
Expand Down Expand Up @@ -97,8 +100,6 @@ status "Installing dependencies... 📦"
npm install
status "Generating build... 👷‍♀️"
npm run build
status "Generating PHP file for wordpress.org to parse translations... 👷‍♂️"
npx pot-to-php ./languages/gutenberg.pot ./languages/gutenberg-translations.php gutenberg

# Temporarily modify `gutenberg.php` with production constants defined. Use a
# temp file because `bin/generate-gutenberg-php.php` reads from `gutenberg.php`
Expand All @@ -118,8 +119,6 @@ zip -r gutenberg.zip \
post-content.php \
$vendor_scripts \
$build_files \
languages/gutenberg.pot \
languages/gutenberg-translations.php \
README.md

# Reset `gutenberg.php`.
Expand Down
10 changes: 5 additions & 5 deletions bin/get-server-blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
require_once ABSPATH . WPINC . '/functions.php';
wp_load_translations_early();
wp_set_lang_dir();
require_once dirname( dirname( __FILE__ ) ) . '/lib/blocks.php';
require_once dirname( dirname( __FILE__ ) ) . '/lib/class-wp-block-type-registry.php';
require_once dirname( dirname( __FILE__ ) ) . '/lib/class-wp-block-type.php';
require_once dirname( dirname( __FILE__ ) ) . '/lib/client-assets.php';
require_once ABSPATH . WPINC . '/blocks.php';
require_once ABSPATH . WPINC . '/class-wp-block-type-registry.php';
require_once ABSPATH . WPINC . '/class-wp-block-type.php';
require_once ABSPATH . '/wp-admin/includes/post.php';

// Register server-side code for individual blocks.
foreach ( glob( dirname( dirname( __FILE__ ) ) . '/packages/block-library/src/*/index.php' ) as $block_logic ) {
Expand All @@ -36,4 +36,4 @@

do_action( 'init' );

echo json_encode( gutenberg_prepare_blocks_for_js() );
echo json_encode( get_block_editor_server_block_settings() );
2 changes: 2 additions & 0 deletions bin/install-wordpress.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ if [ "$WP_VERSION" == "latest" ]; then
# Check for WordPress updates, to make sure we're running the very latest version.
echo -e $(status_message "Updating WordPress to the latest version...")
docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run --rm -u 33 $CLI core update --quiet
echo -e $(status_message "Updating The WordPress Database...")
docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run --rm -u 33 $CLI core update-db --quiet
fi

# If the 'wordpress' volume wasn't during the down/up earlier, but the post port has changed, we need to update it.
Expand Down
2 changes: 1 addition & 1 deletion bin/packages/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ function buildJsFileFor( file, silent, environment ) {
const destPath = getBuildPath( file, buildDir );
const babelOptions = getBabelConfig( environment );
babelOptions.sourceMaps = true;
babelOptions.sourceFileName = file;
babelOptions.sourceFileName = file.replace( PACKAGES_DIR, '@wordpress' );

mkdirp.sync( path.dirname( destPath ) );
const transformed = babel.transformFileSync( file, babelOptions );
Expand Down
13 changes: 3 additions & 10 deletions bin/packages/get-babel-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,7 @@ const babel = require( '@babel/core' );
const { options: babelDefaultConfig } = babel.loadPartialConfig( {
configFile: '@wordpress/babel-preset-default',
} );
const plugins = babelDefaultConfig.plugins;
if ( ! process.env.SKIP_JSX_PRAGMA_TRANSFORM ) {
plugins.push( [ '@wordpress/babel-plugin-import-jsx-pragma', {
scopeVariable: 'createElement',
source: '@wordpress/element',
isDefault: false,
} ] );
}
const { plugins, presets } = babelDefaultConfig;

const overrideOptions = ( target, targetName, options ) => {
if ( get( target, [ 'file', 'request' ] ) === targetName ) {
Expand All @@ -37,7 +30,7 @@ const babelConfigs = {
{
plugins,
presets: map(
babelDefaultConfig.presets,
presets,
( preset ) => overrideOptions( preset, '@babel/preset-env', {
modules: 'commonjs',
} )
Expand All @@ -55,7 +48,7 @@ const babelConfigs = {
} )
),
presets: map(
babelDefaultConfig.presets,
presets,
( preset ) => overrideOptions( preset, '@babel/preset-env', {
modules: false,
} )
Expand Down
38 changes: 2 additions & 36 deletions bin/packages/get-packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
const fs = require( 'fs' );
const path = require( 'path' );
const { overEvery, compact, includes, negate } = require( 'lodash' );
const { overEvery } = require( 'lodash' );

/**
* Absolute path to packages directory.
Expand All @@ -12,36 +12,6 @@ const { overEvery, compact, includes, negate } = require( 'lodash' );
*/
const PACKAGES_DIR = path.resolve( __dirname, '../../packages' );

const {
/**
* Comma-separated string of packages to include in build.
*
* @type {string}
*/
INCLUDE_PACKAGES,

/**
* Comma-separated string of packages to exclude from build.
*
* @type {string}
*/
EXCLUDE_PACKAGES,
} = process.env;

/**
* Given a comma-separated string, returns a filter function which returns true
* if the item is contained within as a comma-separated entry.
*
* @param {Function} filterFn Filter function to call with item to test.
* @param {string} list Comma-separated list of items.
*
* @return {Function} Filter function.
*/
const createCommaSeparatedFilter = ( filterFn, list ) => {
const listItems = list.split( ',' );
return ( item ) => filterFn( listItems, item );
};

/**
* Returns true if the given base file name for a file within the packages
* directory is itself a directory.
Expand All @@ -62,11 +32,7 @@ function isDirectory( file ) {
*
* @return {boolean} Whether to include file in build.
*/
const filterPackages = overEvery( compact( [
isDirectory,
INCLUDE_PACKAGES && createCommaSeparatedFilter( includes, INCLUDE_PACKAGES ),
EXCLUDE_PACKAGES && createCommaSeparatedFilter( negate( includes ), EXCLUDE_PACKAGES ),
] ) );
const filterPackages = overEvery( isDirectory );

/**
* Returns the absolute path of all WordPress packages
Expand Down
71 changes: 71 additions & 0 deletions bin/update-readmes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#!/usr/bin/env node

const path = require( 'path' );
const { promisify } = require( 'util' );
const spawn = promisify( require( 'child_process' ).spawn );

const packages = [
'a11y',
'autop',
'blob',
'block-editor',
'block-library',
'block-serialization-default-parser',
'blocks',
'compose',
//'data',
'date',
'deprecated',
'dom',
'dom-ready',
'e2e-test-utils',
'edit-post',
'element',
'escape-html',
'html-entities',
'i18n',
'keycodes',
'plugins',
'priority-queue',
'redux-routine',
'rich-text',
'shortcode',
'url',
'viewport',
'wordcount',
];

const getArgsForPackage = ( packageName ) => {
switch ( packageName ) {
case 'rich-text':
return [
`packages/${ packageName }/src/index.js`,
`--output packages/${ packageName }/README.md`,
'--to-token',
'--ignore "unstable|experimental|^apply$|^changeListType$|^charAt$|^getSelectionStart$|^getSelectionEnd$|^indentListItems$|^insertLineBreak$|^insertLineSeparator$|^isEmptyLine$|^LINE_SEPARATOR$|^outdentListItems$"',
];
default:
return [
`packages/${ packageName }/src/index.js`,
`--output packages/${ packageName }/README.md`,
'--to-token',
'--ignore "unstable|experimental"',
];
}
};

Promise.all( packages.map( async ( packageName ) => {
const args = getArgsForPackage( packageName );
const pathToDocGen = path.join( __dirname, '..', 'node_modules', '.bin', 'docgen' );
const { status, stderr } = await spawn(
pathToDocGen,
args,
{ shell: true },
);
if ( status !== 0 ) {
throw stderr.toString();
}
} ) ).catch( ( error ) => {
process.stderr.write( `${ error }\n` );
process.exit( 1 );
} );
2 changes: 1 addition & 1 deletion docs/contributors/copy-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Here, every line has different phrasing (some start with a verb, some with a nou

Reading this list takes more work because the reader has to parse each bullet anew. They can’t assume each bullet will contain similar information.

Note: this doesn't mean every bullet has to be super short and start with an action verb! “Predicable” doesn’t have to mean “simple.” It just means that each bullet should have the same sentence structure. This list would also be fine:
Note: this doesn't mean every bullet has to be super short and start with an action verb! “Predictable” doesn’t have to mean “simple.” It just means that each bullet should have the same sentence structure. This list would also be fine:

> What can you do with this block? Lots of things!
> * Try adding a quote. Sometimes someone else said things best!
Expand Down
2 changes: 1 addition & 1 deletion docs/contributors/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The following guidelines are in place to create consistency across the project a

## Philosophy

* [Architecturial and UX Principles of Gutenberg](/docs/contributors/principles.md)
* [Architectural and UX Principles of Gutenberg](/docs/contributors/principles.md)

## Sections

Expand Down
Loading

0 comments on commit 7e2be3a

Please sign in to comment.