Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update WordPress Packages #347

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,16 @@ env:
- WP_INSTALL: true
- PHP_FPM_UID: "`id -u`"
- PHP_FPM_GID: "`id -g`"
- PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true

jobs:
include:
- env: WP_TRAVISCI=test:e2e PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=
- env: WP_TRAVISCI=test:e2e
name: E2E Tests
- env: WP_TRAVISCI=lint:php COMPOSER_INSTALL=true NPM_INSTALL=false WP_INSTALL=false
name: PHP Linting
- env: WP_TRAVISCI=test:compat COMPOSER_INSTALL=true NPM_INSTALL=false WP_INSTALL=false
name: "PHP Compatibility Check"
- env: WP_TRAVISCI=travis:js WP_INSTALL=false PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=
- env: WP_TRAVISCI=travis:js WP_INSTALL=false
name: JS Tests
- env: LOCAL_PHP=7.4-fpm WP_TRAVISCI=test:php
name: "PHPUnit Tests: PHP 7.4"
Expand Down Expand Up @@ -76,7 +75,7 @@ before_script:
fi
- npm --version
- node --version
- nvm install 10.13.0
- nvm install --latest-npm
Copy link

@ntsekouras ntsekouras Jun 26, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nvm installs nodejs and you removed it to update npm.

nvm install 10.13.0 I think it should stay as before (or use newer node.. I don't know the requirements ).

nvm install --latest-npm tries to update npm

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, isn't this what Gutenberg does?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm looking into Travis CI, as I haven't used it before, but it's definitely a different command, that does the above. Maybe node is already installed or installed in some other place.

Since it was there in WordPress Travis, it should stay there, except some change in node installation has happened.

Also the command --latest-npm is in different Travis hooks:
Wordpress: before_script
GB: before_install

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With nodejs installation comes the npm too.. So it might explain the Puppeteer not found module... ?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot(1)

So it actually installs new nodejs

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If Puppeteer isn’t installed then it means that the lock file wasn’t properly updated. The simplest way to fix it is to install the alias that wp-scripts uses as a dev dependency for the project, example:

https://github.com/WordPress/gutenberg/blob/7060b11b9b9efc00e099c9092fe520402d77ee4b/package.json#L180

It’s a bug in npm’s implementation.

Copy link
Member Author

@ellatrix ellatrix Jun 26, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're still getting this error:

Downloading Chromium r737027 - 118.4 Mb [====================] 100% 0.0s 
Chromium (737027) downloaded to /Applications/MAMP/htdocs/wordpress-git/node_modules/@wordpress/scripts/node_modules/puppeteer/.local-chromium/mac-737027
Error: Could not find browser revision 737027. Run "npm install" or "yarn install" to download a browser binary.
  at ChromeLauncher.launch (/Applications/MAMP/htdocs/wordpress-git/node_modules/puppeteer/lib/Launcher.js:200:23)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like Chromium is downloaded to node_modules/@wordpress/scripts/node_modules/puppeteer, while puppeteer runs from node_modules/puppeteer.

- |
if [[ "$NPM_INSTALL" == "true" ]]; then
npm ci
Expand Down
13,748 changes: 7,848 additions & 5,900 deletions package-lock.json

Large diffs are not rendered by default.

105 changes: 53 additions & 52 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
"last 2 Opera versions"
],
"devDependencies": {
"@wordpress/custom-templated-path-webpack-plugin": "1.6.0",
"@wordpress/dependency-extraction-webpack-plugin": "2.4.0",
"@wordpress/e2e-test-utils": "4.3.1",
"@wordpress/library-export-default-webpack-plugin": "1.6.0",
"@wordpress/scripts": "6.2.0",
"@wordpress/custom-templated-path-webpack-plugin": "1.7.0",
"@wordpress/dependency-extraction-webpack-plugin": "2.8.0",
"@wordpress/e2e-test-utils": "4.10.0",
"@wordpress/library-export-default-webpack-plugin": "1.7.0",
"@wordpress/scripts": "12.0.0",
"autoprefixer": "9.6.2",
"check-node-version": "4.0.1",
"copy-webpack-plugin": "^5.1.1",
Expand Down Expand Up @@ -63,6 +63,7 @@
"jquery-migrate": "1.4.1",
"matchdep": "~2.0.0",
"node-sass": "~4.14.1",
"puppeteer": "npm:puppeteer-core@3.0.0",
"qunit": "~2.9.0",
"sinon": "~9.0.0",
"sinon-test": "~3.0.0",
Expand All @@ -76,53 +77,53 @@
},
"dependencies": {
"@babel/polyfill": "7.4.4",
"@wordpress/a11y": "2.7.0",
"@wordpress/annotations": "1.12.3",
"@wordpress/api-fetch": "3.11.0",
"@wordpress/autop": "2.6.0",
"@wordpress/blob": "2.7.0",
"@wordpress/block-directory": "1.5.8",
"@wordpress/block-editor": "3.7.8",
"@wordpress/block-library": "2.14.8",
"@wordpress/block-serialization-default-parser": "3.5.0",
"@wordpress/blocks": "6.12.3",
"@wordpress/components": "9.2.6",
"@wordpress/compose": "3.11.0",
"@wordpress/core-data": "2.12.3",
"@wordpress/data": "4.14.2",
"@wordpress/data-controls": "1.8.2",
"@wordpress/date": "3.8.0",
"@wordpress/deprecated": "2.7.0",
"@wordpress/dom": "2.8.0",
"@wordpress/dom-ready": "2.7.0",
"@wordpress/edit-post": "3.13.10",
"@wordpress/editor": "9.12.8",
"@wordpress/element": "2.11.0",
"@wordpress/escape-html": "1.7.0",
"@wordpress/format-library": "1.14.8",
"@wordpress/hooks": "2.7.0",
"@wordpress/html-entities": "2.6.0",
"@wordpress/i18n": "3.9.0",
"@wordpress/icons": "1.1.0",
"@wordpress/is-shallow-equal": "1.8.0",
"@wordpress/keyboard-shortcuts": "1.1.2",
"@wordpress/keycodes": "2.9.0",
"@wordpress/list-reusable-blocks": "1.13.6",
"@wordpress/media-utils": "1.7.2",
"@wordpress/notices": "2.0.2",
"@wordpress/nux": "3.12.6",
"@wordpress/plugins": "2.12.0",
"@wordpress/primitives": "1.1.0",
"@wordpress/priority-queue": "1.5.1",
"@wordpress/redux-routine": "3.7.0",
"@wordpress/rich-text": "3.12.2",
"@wordpress/server-side-render": "1.8.6",
"@wordpress/shortcode": "2.6.0",
"@wordpress/token-list": "1.9.0",
"@wordpress/url": "2.11.0",
"@wordpress/viewport": "2.13.2",
"@wordpress/warning": "1.0.0",
"@wordpress/wordcount": "2.7.0",
"@wordpress/a11y": "2.11.0",
"@wordpress/annotations": "1.19.0",
"@wordpress/api-fetch": "3.18.0",
"@wordpress/autop": "2.9.0",
"@wordpress/blob": "2.9.0",
"@wordpress/block-directory": "1.12.0",
"@wordpress/block-editor": "4.2.0",
"@wordpress/block-library": "2.21.0",
"@wordpress/block-serialization-default-parser": "3.7.0",
"@wordpress/blocks": "6.19.0",
"@wordpress/components": "9.9.0",
"@wordpress/compose": "3.18.0",
"@wordpress/core-data": "2.19.0",
"@wordpress/data": "4.21.0",
"@wordpress/data-controls": "1.15.0",
"@wordpress/date": "3.10.0",
"@wordpress/deprecated": "2.9.0",
"@wordpress/dom": "2.12.0",
"@wordpress/dom-ready": "2.10.0",
"@wordpress/edit-post": "3.20.0",
"@wordpress/editor": "9.19.0",
"@wordpress/element": "2.15.0",
"@wordpress/escape-html": "1.9.0",
"@wordpress/format-library": "1.21.0",
"@wordpress/hooks": "2.9.0",
"@wordpress/html-entities": "2.8.0",
"@wordpress/i18n": "3.14.0",
"@wordpress/icons": "2.3.0",
"@wordpress/is-shallow-equal": "2.1.0",
"@wordpress/keyboard-shortcuts": "1.8.0",
"@wordpress/keycodes": "2.14.0",
"@wordpress/list-reusable-blocks": "1.20.0",
"@wordpress/media-utils": "1.14.0",
"@wordpress/notices": "2.7.0",
"@wordpress/nux": "3.19.0",
"@wordpress/plugins": "2.19.0",
"@wordpress/primitives": "1.6.0",
"@wordpress/priority-queue": "1.7.0",
"@wordpress/redux-routine": "3.10.0",
"@wordpress/rich-text": "3.19.0",
"@wordpress/server-side-render": "1.15.0",
"@wordpress/shortcode": "2.9.0",
"@wordpress/token-list": "1.11.0",
"@wordpress/url": "2.17.0",
"@wordpress/viewport": "2.20.0",
"@wordpress/warning": "1.2.0",
"@wordpress/wordcount": "2.10.0",
"backbone": "1.4.0",
"clipboard": "2.0.6",
"core-js-url-browser": "3.6.4",
Expand Down
18 changes: 9 additions & 9 deletions src/wp-admin/includes/post.php
Original file line number Diff line number Diff line change
Expand Up @@ -2179,33 +2179,33 @@ function use_block_editor_for_post_type( $post_type ) {
function get_block_categories( $post ) {
$default_categories = array(
array(
'slug' => 'common',
'title' => __( 'Common Blocks' ),
'slug' => 'text',
'title' => _x( 'Text', 'block category' ),
'icon' => null,
),
array(
'slug' => 'formatting',
'title' => __( 'Formatting' ),
'slug' => 'media',
'title' => _x( 'Media', 'block category' ),
'icon' => null,
),
array(
'slug' => 'layout',
'title' => __( 'Layout Elements' ),
'slug' => 'design',
'title' => _x( 'Design', 'block category' ),
'icon' => null,
),
array(
'slug' => 'widgets',
'title' => __( 'Widgets' ),
'title' => _x( 'Widgets', 'block category' ),
'icon' => null,
),
array(
'slug' => 'embed',
'title' => __( 'Embeds' ),
'title' => _x( 'Embeds', 'block category' ),
'icon' => null,
),
array(
'slug' => 'reusable',
'title' => __( 'Reusable Blocks' ),
'title' => _x( 'Reusable Blocks', 'block category' ),
'icon' => null,
),
);
Expand Down
21 changes: 2 additions & 19 deletions src/wp-includes/blocks/archives.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,26 +116,9 @@ function render_block_core_archives( $attributes ) {
* Register archives block.
*/
function register_block_core_archives() {
register_block_type(
'core/archives',
register_block_type_from_metadata(
__DIR__ . '/archives',
array(
'attributes' => array(
'align' => array(
'type' => 'string',
'enum' => array( 'left', 'center', 'right', 'wide', 'full' ),
),
'className' => array(
'type' => 'string',
),
'displayAsDropdown' => array(
'type' => 'boolean',
'default' => false,
),
'showPostCounts' => array(
'type' => 'boolean',
'default' => false,
),
),
'render_callback' => 'render_block_core_archives',
)
);
Expand Down
9 changes: 2 additions & 7 deletions src/wp-includes/blocks/block.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,9 @@ function render_block_core_block( $attributes ) {
* Registers the `core/block` block.
*/
function register_block_core_block() {
register_block_type(
'core/block',
register_block_type_from_metadata(
__DIR__ . '/block',
array(
'attributes' => array(
'ref' => array(
'type' => 'number',
),
),
'render_callback' => 'render_block_core_block',
)
);
Expand Down
19 changes: 2 additions & 17 deletions src/wp-includes/blocks/calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,24 +52,9 @@ function render_block_core_calendar( $attributes ) {
* Registers the `core/calendar` block on server.
*/
function register_block_core_calendar() {
register_block_type(
'core/calendar',
register_block_type_from_metadata(
__DIR__ . '/calendar',
array(
'attributes' => array(
'align' => array(
'type' => 'string',
'enum' => array( 'left', 'center', 'right', 'wide', 'full' ),
),
'className' => array(
'type' => 'string',
),
'month' => array(
'type' => 'integer',
),
'year' => array(
'type' => 'integer',
),
),
'render_callback' => 'render_block_core_calendar',
)
);
Expand Down
25 changes: 2 additions & 23 deletions src/wp-includes/blocks/categories.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,30 +89,9 @@ function onCatChange() {
* Registers the `core/categories` block on server.
*/
function register_block_core_categories() {
register_block_type(
'core/categories',
register_block_type_from_metadata(
__DIR__ . '/categories',
array(
'attributes' => array(
'align' => array(
'type' => 'string',
'enum' => array( 'left', 'center', 'right', 'wide', 'full' ),
),
'className' => array(
'type' => 'string',
),
'displayAsDropdown' => array(
'type' => 'boolean',
'default' => false,
),
'showHierarchy' => array(
'type' => 'boolean',
'default' => false,
),
'showPostCounts' => array(
'type' => 'boolean',
'default' => false,
),
),
'render_callback' => 'render_block_core_categories',
)
);
Expand Down
37 changes: 2 additions & 35 deletions src/wp-includes/blocks/latest-comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,42 +152,9 @@ function render_block_core_latest_comments( $attributes = array() ) {
* Registers the `core/latest-comments` block.
*/
function register_block_core_latest_comments() {
register_block_type(
'core/latest-comments',
register_block_type_from_metadata(
__DIR__ . '/latest-comments',
array(
'attributes' => array(
'align' => array(
'type' => 'string',
'enum' => array(
'left',
'center',
'right',
'wide',
'full',
),
),
'className' => array(
'type' => 'string',
),
'commentsToShow' => array(
'type' => 'number',
'default' => 5,
'minimum' => 1,
'maximum' => 100,
),
'displayAvatar' => array(
'type' => 'boolean',
'default' => true,
),
'displayDate' => array(
'type' => 'boolean',
'default' => true,
),
'displayExcerpt' => array(
'type' => 'boolean',
'default' => true,
),
),
'render_callback' => 'render_block_core_latest_comments',
)
);
Expand Down
Loading