Skip to content

Commit 5e48264

Browse files
committed
Merge branch 'trunk' into global-styles/remove-ls-preview-elements
2 parents f1808f5 + 2bbe6bb commit 5e48264

File tree

2,071 files changed

+47665
-34100
lines changed

Some content is hidden

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

2,071 files changed

+47665
-34100
lines changed

.eslintrc.js

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ const restrictedImports = [
7676
message:
7777
"edit-widgets is a WordPress top level package that shouldn't be imported into other packages",
7878
},
79+
{
80+
name: 'classnames',
81+
message:
82+
"Please use `clsx` instead. It's a lighter and faster drop-in replacement for `classnames`.",
83+
},
7984
];
8085

8186
module.exports = {
@@ -87,6 +92,7 @@ module.exports = {
8792
],
8893
globals: {
8994
wp: 'off',
95+
globalThis: 'readonly',
9096
},
9197
settings: {
9298
jsdoc: {
@@ -99,7 +105,7 @@ module.exports = {
99105
'jest/expect-expect': 'off',
100106
'react/jsx-boolean-value': 'error',
101107
'@wordpress/dependency-group': 'error',
102-
'@wordpress/is-gutenberg-plugin': 'error',
108+
'@wordpress/wp-global-usage': 'error',
103109
'@wordpress/react-no-unsafe-timeout': 'error',
104110
'@wordpress/i18n-text-domain': [
105111
'error',
@@ -407,6 +413,24 @@ module.exports = {
407413
],
408414
},
409415
},
416+
{
417+
files: [ 'packages/edit-post/**', 'packages/edit-site/**' ],
418+
rules: {
419+
'no-restricted-imports': [
420+
'error',
421+
{
422+
paths: [
423+
...restrictedImports,
424+
{
425+
name: '@wordpress/interface',
426+
message:
427+
'The edit-post and edit-site package should not directly import the interface package. They should import them from the private APIs of the editor package instead.',
428+
},
429+
],
430+
},
431+
],
432+
},
433+
},
410434
{
411435
files: [ 'packages/interactivity*/src/**' ],
412436
rules: {

.git-blame-ignore-revs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,6 @@ c56e8a1910ed74f405b74bbb12fe81dea974e5c3
1515

1616
# ESLint: Enable react/jsx-boolean-value
1717
9a34927870df80ac3b2da14d71f81d20ec23e2b6
18+
19+
# Autofix eslint curly rule.
20+
0221522f253e094b277a1485b7a2d186cb172632

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
/packages/block-editor/src/components/link-control @getdave
4848

4949
# Widgets
50-
/packages/edit-widgets @draganescu @talldan @adamziel @kevin940726
50+
/packages/edit-widgets @draganescu @adamziel @kevin940726
5151
/packages/customize-widgets
5252
/packages/widgets
5353

.github/setup-node/action.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ runs:
1010
using: 'composite'
1111
steps:
1212
- name: Use desired version of Node.js
13-
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
13+
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
1414
with:
1515
node-version-file: '.nvmrc'
1616
node-version: ${{ inputs.node-version }}
@@ -25,15 +25,22 @@ runs:
2525

2626
- name: Cache node_modules
2727
id: cache-node_modules
28-
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
28+
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
2929
with:
3030
path: '**/node_modules'
31-
key: node_modules-${{ runner.os }}-${{ steps.node-version.outputs.NODE_VERSION }}-${{ hashFiles('package-lock.json') }}
31+
key: node_modules-${{ runner.os }}-${{ runner.arch }}-${{ steps.node-version.outputs.NODE_VERSION }}-${{ hashFiles('package-lock.json') }}
3232

3333
- name: Install npm dependencies
3434
if: ${{ steps.cache-node_modules.outputs.cache-hit != 'true' }}
35-
run: npm ci
35+
run: |
36+
npm ci
3637
shell: bash
38+
- name: Upload npm logs as an artifact on failure
39+
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
40+
if: failure()
41+
with:
42+
name: npm-logs
43+
path: C:\npm\cache\_logs
3744

3845
# On cache hit, we run the post-install script to match the native `npm ci` behavior.
3946
# An example of this is to patch `node_modules` using patch-package.

.github/workflows/build-plugin-zip.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969

7070
steps:
7171
- name: Checkout code
72-
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
72+
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
7373
with:
7474
token: ${{ secrets.GUTENBERG_TOKEN }}
7575
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
@@ -165,7 +165,7 @@ jobs:
165165

166166
steps:
167167
- name: Checkout code
168-
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
168+
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
169169
with:
170170
ref: ${{ needs.bump-version.outputs.release_branch || github.ref }}
171171
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
@@ -183,7 +183,7 @@ jobs:
183183
NO_CHECKS: 'true'
184184

185185
- name: Upload artifact
186-
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
186+
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
187187
with:
188188
name: gutenberg-plugin
189189
path: ./gutenberg.zip
@@ -206,7 +206,7 @@ jobs:
206206
207207
- name: Upload release notes artifact
208208
if: ${{ needs.bump-version.outputs.new_version }}
209-
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
209+
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
210210
with:
211211
name: release-notes
212212
path: ./release-notes.txt
@@ -222,7 +222,7 @@ jobs:
222222
223223
steps:
224224
- name: Checkout code
225-
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
225+
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
226226
with:
227227
fetch-depth: 2
228228
ref: ${{ needs.bump-version.outputs.release_branch }}
@@ -270,12 +270,12 @@ jobs:
270270
run: echo "version=$(echo $VERSION | cut -d / -f 3 | sed 's/-rc./ RC/' )" >> $GITHUB_OUTPUT
271271

272272
- name: Download Plugin Zip Artifact
273-
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
273+
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
274274
with:
275275
name: gutenberg-plugin
276276

277277
- name: Download Release Notes Artifact
278-
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
278+
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
279279
with:
280280
name: release-notes
281281

@@ -311,14 +311,14 @@ jobs:
311311
if: ${{ endsWith( needs.bump-version.outputs.new_version, '-rc.1' ) }}
312312
steps:
313313
- name: Checkout (for CLI)
314-
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
314+
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
315315
with:
316316
path: main
317317
ref: trunk
318318
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
319319

320320
- name: Checkout (for publishing)
321-
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
321+
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
322322
with:
323323
path: publish
324324
# Later, we switch this branch in the script that publishes packages.

.github/workflows/bundle-size.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
runs-on: ubuntu-latest
3838

3939
steps:
40-
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
40+
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
4141
with:
4242
fetch-depth: 1
4343
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
@@ -49,7 +49,7 @@ jobs:
4949
check-latest: true
5050
cache: npm
5151

52-
- uses: preactjs/compressed-size-action@8119d3d31b6e57b167e09c81dfa877eada3bcb35 # v2.5.0
52+
- uses: preactjs/compressed-size-action@f780fd104362cfce9e118f9198df2ee37d12946c # v2.6.0
5353
with:
5454
repo-token: '${{ secrets.GITHUB_TOKEN }}'
5555
pattern: '{build/**/*.min.js,build/**/*.css}'
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Verify Core Backport Changlog
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, labeled, unlabeled]
6+
paths:
7+
- 'lib/**'
8+
- '!lib/load.php'
9+
- '!lib/experiments-page.php'
10+
- '!lib/experimental/**'
11+
- 'phpunit/**'
12+
- '!phpunit/experimental/**'
13+
- '!phpunit/blocks/**'
14+
- 'packages/**/*.php'
15+
- '!packages/block-library/**'
16+
- '!packages/e2e-tests/**'
17+
jobs:
18+
check:
19+
name: Check CHANGELOG diff
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: 'Get PR commit count'
23+
run: echo "PR_COMMIT_COUNT=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> "${GITHUB_ENV}"
24+
- name: Checkout code
25+
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
26+
with:
27+
ref: ${{ github.event.pull_request.head.ref }}
28+
repository: ${{ github.event.pull_request.head.repo.full_name }}
29+
fetch-depth: ${{ env.PR_COMMIT_COUNT }}
30+
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
31+
- name: 'Fetch relevant history from origin'
32+
run: git fetch origin ${{ github.event.pull_request.base.ref }}
33+
- name: Check CHANGELOG status
34+
if: ${{ !contains(github.event.pull_request.labels.*.name, 'No Core Sync Required') && !contains(github.event.pull_request.labels.*.name, 'Backport from WordPress Core') }}
35+
env:
36+
PR_NUMBER: ${{ github.event.number }}
37+
run: |
38+
changelog_folder="backport-changelog"
39+
40+
# Find any changelog file that contains the Gutenberg PR link
41+
gutenberg_pr_url="https://github\.com/WordPress/gutenberg/pull/${PR_NUMBER}"
42+
changelog_file=$(grep -rl "[-*] ${gutenberg_pr_url}" "${changelog_folder}" | head -n 1)
43+
44+
# Confirm that there is an entry containing the Gutenberg PR link
45+
if [[ -z "${changelog_file}" ]]; then
46+
echo "Please create a core backport PR and add a file with the path <wp-release-number>/<core-pr-number>.md in the $changelog_folder folder with the core backport PR URL and a list item with this PR URL."
47+
echo "If changes are related to an existing, open core PR, you may add this PR URL to the core PR's file."
48+
echo "See $changelog_folder/readme.md for more information."
49+
exit 1
50+
fi
51+
52+
core_pr_number=$(basename "${changelog_file}" .md)
53+
core_pr_url="https://github\.com/WordPress/wordpress-develop/pull/${core_pr_number}"
54+
55+
# Confirm that the entry has the correct core backport PR URL.
56+
if ! grep -q -e "${core_pr_url}" "${changelog_file}"; then
57+
echo "Please update the content of ${changelog_file} to include the core backport PR URL, or update the file name to match the core backport PR number."
58+
exit 1
59+
fi

.github/workflows/check-components-changelog.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: 'Get PR commit count'
2121
run: echo "PR_COMMIT_COUNT=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> "${GITHUB_ENV}"
2222
- name: Checkout code
23-
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
23+
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
2424
with:
2525
ref: ${{ github.event.pull_request.head.ref }}
2626
repository: ${{ github.event.pull_request.head.repo.full_name }}

.github/workflows/create-block.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
os: ['macos-latest', 'ubuntu-latest', 'windows-latest']
2525

2626
steps:
27-
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
27+
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
2828
with:
2929
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
3030

0 commit comments

Comments
 (0)