Skip to content

Commit acfeb8d

Browse files
authored
Merge branch 'trunk' into tests/phpstan/level-0
2 parents aec7e74 + 513c48f commit acfeb8d

201 files changed

Lines changed: 7242 additions & 22045 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/pull_request_template.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,18 @@ If this is your first time contributing, you may also find reviewing these guide
1212
- Inline Documentation Standards: https://make.wordpress.org/core/handbook/best-practices/inline-documentation-standards/
1313
- Browser Support Policies: https://make.wordpress.org/core/handbook/best-practices/browser-support/
1414
- Proper spelling and grammar related best practices: https://make.wordpress.org/core/handbook/best-practices/spelling/
15+
- ✨ If you are using AI tools, you must adhere to the AI Guidelines: https://make.wordpress.org/ai/handbook/ai-guidelines/
1516
-->
1617

1718
<!-- Insert a description of your changes here -->
1819

1920
Trac ticket: <!-- insert a link to the WordPress Trac ticket here -->
2021

22+
## Use of AI Tools
23+
24+
<!--
25+
You are free to use artificial intelligence (AI) tooling to contribute, but you must disclose what tooling you are using and to what extent a pull request has been authored by AI. It is your responsibility to review and take responsibility for what AI generates. See the WordPress AI Guidelines: <https://make.wordpress.org/ai/handbook/ai-guidelines/>.
26+
-->
27+
2128
---
2229
**This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See [GitHub Pull Requests for Code Review](https://make.wordpress.org/core/handbook/contribute/git/github-pull-requests-for-code-review/) in the Core Handbook for more details.**

.github/workflows/pull-request-comments.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ jobs:
167167
[WordPress Playground](https://developer.wordpress.org/playground/) is an experimental project that creates a full WordPress instance entirely within the browser.
168168
169169
### Some things to be aware of
170-
- The Plugin and Theme Directories cannot be accessed within Playground.
171170
- All changes will be lost when closing a tab with a Playground instance.
172171
- All changes will be lost when refreshing the page.
173172
- A fresh instance is created each time the link below is clicked.

.github/workflows/reusable-performance-report-v2.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ jobs:
104104
env:
105105
BASE_SHA: ${{ steps.base-sha.outputs.result }}
106106
CODEVITALS_PROJECT_TOKEN: ${{ secrets.CODEVITALS_PROJECT_TOKEN }}
107-
HOST_NAME: www.codevitals.run
107+
HOST_NAME: codevitals.run
108108
run: |
109109
if [ -z "$CODEVITALS_PROJECT_TOKEN" ]; then
110110
echo "Performance results could not be published. 'CODEVITALS_PROJECT_TOKEN' is not set"

.github/workflows/reusable-performance.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ jobs:
347347
env:
348348
BASE_SHA: ${{ steps.base-sha.outputs.result }}
349349
CODEVITALS_PROJECT_TOKEN: ${{ secrets.CODEVITALS_PROJECT_TOKEN }}
350-
HOST_NAME: "www.codevitals.run"
350+
HOST_NAME: "codevitals.run"
351351
run: |
352352
if [ -z "$CODEVITALS_PROJECT_TOKEN" ]; then
353353
echo "Performance results could not be published. 'CODEVITALS_PROJECT_TOKEN' is not set"
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
##
2+
# A reusable workflow that tests the Gutenberg plugin build process when run within a wordpress-develop checkout.
3+
##
4+
name: Test the Gutenberg plugin Build Process
5+
6+
on:
7+
workflow_call:
8+
inputs:
9+
os:
10+
description: 'Operating system to run tests on'
11+
required: false
12+
type: 'string'
13+
default: 'ubuntu-24.04'
14+
directory:
15+
description: 'Directory to run WordPress from. Valid values are `src` or `build`'
16+
required: false
17+
type: 'string'
18+
default: 'src'
19+
20+
env:
21+
GUTENBERG_DIRECTORY: ${{ inputs.directory == 'build' && 'build' || 'src' }}/wp-content/plugins/gutenberg
22+
PUPPETEER_SKIP_DOWNLOAD: ${{ true }}
23+
NODE_OPTIONS: '--max-old-space-size=8192'
24+
25+
# Disable permissions for all available scopes by default.
26+
# Any needed permissions should be configured at the job level.
27+
permissions: {}
28+
29+
jobs:
30+
# Verifies that installing npm dependencies and building the Gutenberg plugin works as expected.
31+
#
32+
# Performs the following steps:
33+
# - Checks out the repository.
34+
# - Checks out the Gutenberg plugin into the plugins directory.
35+
# - Sets up Node.js.
36+
# - Logs debug information about the GitHub Action runner.
37+
# - Installs Gutenberg npm dependencies.
38+
# - Runs the Gutenberg build process.
39+
# - Installs Core npm dependencies.
40+
# - Builds WordPress to run from the relevant location (src or build).
41+
# - Builds Gutenberg.
42+
# - Ensures version-controlled files are not modified or deleted.
43+
build-process-tests:
44+
name: ${{ contains( inputs.os, 'macos-' ) && 'MacOS' || contains( inputs.os, 'windows-' ) && 'Windows' || 'Linux' }}
45+
permissions:
46+
contents: read
47+
runs-on: ${{ inputs.os }}
48+
timeout-minutes: 30
49+
50+
steps:
51+
- name: Checkout repository
52+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
53+
with:
54+
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
55+
persist-credentials: false
56+
57+
- name: Checkout Gutenberg plugin
58+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
59+
with:
60+
repository: 'WordPress/gutenberg'
61+
path: ${{ env.GUTENBERG_DIRECTORY }}
62+
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
63+
persist-credentials: false
64+
65+
- name: Set up Node.js
66+
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
67+
with:
68+
node-version-file: '.nvmrc'
69+
cache: npm
70+
cache-dependency-path: |
71+
package-lock.json
72+
${{ env.GUTENBERG_DIRECTORY }}/package-lock.json
73+
74+
- name: Log debug information
75+
run: |
76+
npm --version
77+
node --version
78+
curl --version
79+
git --version
80+
81+
- name: Install Gutenberg Dependencies
82+
run: npm ci
83+
working-directory: ${{ env.GUTENBERG_DIRECTORY }}
84+
85+
- name: Build Gutenberg
86+
run: npm run build
87+
working-directory: ${{ env.GUTENBERG_DIRECTORY }}
88+
89+
- name: Install Core Dependencies
90+
run: npm ci
91+
92+
- name: Build WordPress to run from ${{ inputs.directory }}
93+
run: npm run ${{ inputs.directory == 'src' && 'build:dev' || 'build' }}
94+
95+
- name: Run Gutenberg build script after building Core to run from ${{ inputs.directory }}
96+
run: npm run build
97+
working-directory: ${{ env.GUTENBERG_DIRECTORY }}
98+
99+
- name: Ensure version-controlled files are not modified or deleted during building
100+
run: git diff --exit-code

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@ wp-tests-config.php
3939
/src/wp-includes/blocks/*
4040
!/src/wp-includes/blocks/index.php
4141
/src/wp-includes/build
42-
/src/wp-includes/class-wp-block-parser.php
43-
/src/wp-includes/class-wp-block-parser-block.php
44-
/src/wp-includes/class-wp-block-parser-frame.php
4542
/src/wp-includes/theme.json
4643
/packagehash.txt
4744
/.gutenberg-hash

.jshintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"curly": true,
44
"eqeqeq": true,
55
"eqnull": true,
6-
"esversion": 10,
6+
"esversion": 11,
77
"expr": true,
88
"immed": true,
99
"noarg": true,

Gruntfile.js

Lines changed: 69 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* jshint node:true */
2-
/* jshint esversion: 6 */
2+
/* eslint-env es6 */
33
/* globals Set */
44
var webpackConfig = require( './webpack.config' );
55
var installChanged = require( 'install-changed' );
@@ -175,6 +175,17 @@ module.exports = function(grunt) {
175175
banner: BANNER_TEXT,
176176
linebreak: true
177177
},
178+
codemirror: {
179+
options: {
180+
linebreak: false,
181+
banner: require( './tools/webpack/codemirror-banner' )
182+
},
183+
files: {
184+
src: [
185+
WORKING_DIR + 'wp-includes/js/codemirror/codemirror.min.css'
186+
]
187+
}
188+
},
178189
files: {
179190
src: [
180191
WORKING_DIR + 'wp-admin/css/*.min.css',
@@ -275,7 +286,7 @@ module.exports = function(grunt) {
275286
'!wp-includes/certificates/legacy-1024bit.pem',
276287
'!.{svn,git}', // Exclude version control folders.
277288
'!wp-includes/version.php', // Exclude version.php.
278-
'!**/*.map', // The build doesn't need .map files.
289+
'!{wp-admin,wp-includes,wp-content/themes/twenty*,wp-content/plugins/akismet}/**/*.map', // The build doesn't need .map files.
279290
'!index.php', '!wp-admin/index.php',
280291
'!_index.php', '!wp-admin/_index.php'
281292
] ),
@@ -311,6 +322,33 @@ module.exports = function(grunt) {
311322
}
312323
]
313324
},
325+
'codemirror': {
326+
options: {
327+
process: function( content, srcpath ) {
328+
if ( srcpath.includes( 'htmlhint.min.js' ) ) {
329+
return content + '\nif ( window.HTMLHint && window.HTMLHint.HTMLHint ) { window.HTMLHint = window.HTMLHint.HTMLHint; }';
330+
}
331+
return content;
332+
}
333+
},
334+
files: [
335+
{
336+
[ WORKING_DIR + 'wp-includes/js/codemirror/csslint.js' ]: [ './node_modules/csslint/dist/csslint.js' ],
337+
[ WORKING_DIR + 'wp-includes/js/codemirror/esprima.js' ]: [ './node_modules/esprima/dist/esprima.js' ],
338+
[ WORKING_DIR + 'wp-includes/js/codemirror/htmlhint.js' ]: [ './node_modules/htmlhint/dist/htmlhint.min.js' ],
339+
[ WORKING_DIR + 'wp-includes/js/codemirror/jsonlint.js' ]: [ './node_modules/jsonlint/web/jsonlint.js' ],
340+
},
341+
{
342+
expand: true,
343+
cwd: SOURCE_DIR + 'js/_enqueues/vendor/codemirror/',
344+
src: [
345+
'fakejshint.js',
346+
'htmlhint-kses.js',
347+
],
348+
dest: WORKING_DIR + 'wp-includes/js/codemirror/'
349+
}
350+
]
351+
},
314352
'vendor-js': {
315353
files: [
316354
{
@@ -562,6 +600,22 @@ module.exports = function(grunt) {
562600
options: {
563601
compatibility: 'ie11'
564602
},
603+
codemirror: {
604+
files: {
605+
[ WORKING_DIR + 'wp-includes/js/codemirror/codemirror.min.css' ]: [
606+
'node_modules/codemirror/lib/codemirror.css',
607+
'node_modules/codemirror/addon/hint/show-hint.css',
608+
'node_modules/codemirror/addon/lint/lint.css',
609+
'node_modules/codemirror/addon/dialog/dialog.css',
610+
'node_modules/codemirror/addon/display/fullscreen.css',
611+
'node_modules/codemirror/addon/fold/foldgutter.css',
612+
'node_modules/codemirror/addon/merge/merge.css',
613+
'node_modules/codemirror/addon/scroll/simplescrollbars.css',
614+
'node_modules/codemirror/addon/search/matchesonscrollbar.css',
615+
'node_modules/codemirror/addon/tern/tern.css'
616+
]
617+
}
618+
},
565619
core: {
566620
expand: true,
567621
cwd: WORKING_DIR,
@@ -871,7 +925,7 @@ module.exports = function(grunt) {
871925
'wp-includes/js/tinymce/plugins/wp*/plugin.js',
872926

873927
// Exceptions.
874-
'!**/*.min.js',
928+
'!{wp-admin,wp-includes}/**/*.min.js',
875929
'!wp-admin/js/custom-header.js', // Why? We should minify this.
876930
'!wp-admin/js/farbtastic.js',
877931
'!wp-includes/js/wp-emoji-loader.js', // This is a module. See the emoji-loader task below.
@@ -921,7 +975,8 @@ module.exports = function(grunt) {
921975
webpack: {
922976
prod: webpackConfig( { environment: 'production', buildTarget: WORKING_DIR } ),
923977
dev: webpackConfig( { environment: 'development', buildTarget: WORKING_DIR } ),
924-
watch: webpackConfig( { environment: 'development', watch: true } )
978+
watch: webpackConfig( { environment: 'development', watch: true } ),
979+
codemirror: require( './tools/webpack/codemirror.config.js' )( { buildTarget: WORKING_DIR } ),
925980
},
926981
concat: {
927982
tinymce: {
@@ -1652,6 +1707,13 @@ module.exports = function(grunt) {
16521707
'uglify:moment'
16531708
] );
16541709

1710+
grunt.registerTask( 'build:codemirror', [
1711+
'webpack:codemirror',
1712+
'cssmin:codemirror',
1713+
'usebanner:codemirror',
1714+
'copy:codemirror'
1715+
] );
1716+
16551717
grunt.registerTask( 'build:webpack', [
16561718
'clean:webpack-assets',
16571719
'webpack:prod',
@@ -1679,7 +1741,7 @@ module.exports = function(grunt) {
16791741
'cssmin:rtl',
16801742
'cssmin:colors',
16811743
'cssmin:themes',
1682-
'usebanner'
1744+
'usebanner:files'
16831745
] );
16841746

16851747
grunt.registerTask( 'certificates:upgrade-package', 'Upgrades the package responsible for supplying the certificate authority certificate store bundled with WordPress.', function() {
@@ -1902,6 +1964,7 @@ module.exports = function(grunt) {
19021964
grunt.task.run( [
19031965
'build:js',
19041966
'build:css',
1967+
'build:codemirror',
19051968
'gutenberg-sync',
19061969
'gutenberg-copy',
19071970
'copy-vendor-scripts',
@@ -1913,6 +1976,7 @@ module.exports = function(grunt) {
19131976
'build:files',
19141977
'build:js',
19151978
'build:css',
1979+
'build:codemirror',
19161980
'gutenberg-sync',
19171981
'gutenberg-copy',
19181982
'copy-vendor-scripts',

0 commit comments

Comments
 (0)