Skip to content

Commit

Permalink
Merge branch 'trunk' into global-styles/remove-ls-preview-elements
Browse files Browse the repository at this point in the history
  • Loading branch information
t-hamano committed May 27, 2024
2 parents f1808f5 + 2bbe6bb commit 5e48264
Show file tree
Hide file tree
Showing 2,071 changed files with 47,665 additions and 34,100 deletions.
26 changes: 25 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ const restrictedImports = [
message:
"edit-widgets is a WordPress top level package that shouldn't be imported into other packages",
},
{
name: 'classnames',
message:
"Please use `clsx` instead. It's a lighter and faster drop-in replacement for `classnames`.",
},
];

module.exports = {
Expand All @@ -87,6 +92,7 @@ module.exports = {
],
globals: {
wp: 'off',
globalThis: 'readonly',
},
settings: {
jsdoc: {
Expand All @@ -99,7 +105,7 @@ module.exports = {
'jest/expect-expect': 'off',
'react/jsx-boolean-value': 'error',
'@wordpress/dependency-group': 'error',
'@wordpress/is-gutenberg-plugin': 'error',
'@wordpress/wp-global-usage': 'error',
'@wordpress/react-no-unsafe-timeout': 'error',
'@wordpress/i18n-text-domain': [
'error',
Expand Down Expand Up @@ -407,6 +413,24 @@ module.exports = {
],
},
},
{
files: [ 'packages/edit-post/**', 'packages/edit-site/**' ],
rules: {
'no-restricted-imports': [
'error',
{
paths: [
...restrictedImports,
{
name: '@wordpress/interface',
message:
'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.',
},
],
},
],
},
},
{
files: [ 'packages/interactivity*/src/**' ],
rules: {
Expand Down
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ c56e8a1910ed74f405b74bbb12fe81dea974e5c3

# ESLint: Enable react/jsx-boolean-value
9a34927870df80ac3b2da14d71f81d20ec23e2b6

# Autofix eslint curly rule.
0221522f253e094b277a1485b7a2d186cb172632
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
/packages/block-editor/src/components/link-control @getdave

# Widgets
/packages/edit-widgets @draganescu @talldan @adamziel @kevin940726
/packages/edit-widgets @draganescu @adamziel @kevin940726
/packages/customize-widgets
/packages/widgets

Expand Down
15 changes: 11 additions & 4 deletions .github/setup-node/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ runs:
using: 'composite'
steps:
- name: Use desired version of Node.js
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version-file: '.nvmrc'
node-version: ${{ inputs.node-version }}
Expand All @@ -25,15 +25,22 @@ runs:

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

- name: Install npm dependencies
if: ${{ steps.cache-node_modules.outputs.cache-hit != 'true' }}
run: npm ci
run: |
npm ci
shell: bash
- name: Upload npm logs as an artifact on failure
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
if: failure()
with:
name: npm-logs
path: C:\npm\cache\_logs

# On cache hit, we run the post-install script to match the native `npm ci` behavior.
# An example of this is to patch `node_modules` using patch-package.
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/build-plugin-zip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:

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

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

- name: Upload artifact
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: gutenberg-plugin
path: ./gutenberg.zip
Expand All @@ -206,7 +206,7 @@ jobs:
- name: Upload release notes artifact
if: ${{ needs.bump-version.outputs.new_version }}
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: release-notes
path: ./release-notes.txt
Expand All @@ -222,7 +222,7 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
with:
fetch-depth: 2
ref: ${{ needs.bump-version.outputs.release_branch }}
Expand Down Expand Up @@ -270,12 +270,12 @@ jobs:
run: echo "version=$(echo $VERSION | cut -d / -f 3 | sed 's/-rc./ RC/' )" >> $GITHUB_OUTPUT

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

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

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

- name: Checkout (for publishing)
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
with:
path: publish
# Later, we switch this branch in the script that publishes packages.
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/bundle-size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
runs-on: ubuntu-latest

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

- uses: preactjs/compressed-size-action@8119d3d31b6e57b167e09c81dfa877eada3bcb35 # v2.5.0
- uses: preactjs/compressed-size-action@f780fd104362cfce9e118f9198df2ee37d12946c # v2.6.0
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
pattern: '{build/**/*.min.js,build/**/*.css}'
Expand Down
59 changes: 59 additions & 0 deletions .github/workflows/check-backport-changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Verify Core Backport Changlog

on:
pull_request:
types: [opened, synchronize, labeled, unlabeled]
paths:
- 'lib/**'
- '!lib/load.php'
- '!lib/experiments-page.php'
- '!lib/experimental/**'
- 'phpunit/**'
- '!phpunit/experimental/**'
- '!phpunit/blocks/**'
- 'packages/**/*.php'
- '!packages/block-library/**'
- '!packages/e2e-tests/**'
jobs:
check:
name: Check CHANGELOG diff
runs-on: ubuntu-latest
steps:
- name: 'Get PR commit count'
run: echo "PR_COMMIT_COUNT=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> "${GITHUB_ENV}"
- name: Checkout code
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
fetch-depth: ${{ env.PR_COMMIT_COUNT }}
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
- name: 'Fetch relevant history from origin'
run: git fetch origin ${{ github.event.pull_request.base.ref }}
- name: Check CHANGELOG status
if: ${{ !contains(github.event.pull_request.labels.*.name, 'No Core Sync Required') && !contains(github.event.pull_request.labels.*.name, 'Backport from WordPress Core') }}
env:
PR_NUMBER: ${{ github.event.number }}
run: |
changelog_folder="backport-changelog"
# Find any changelog file that contains the Gutenberg PR link
gutenberg_pr_url="https://github\.com/WordPress/gutenberg/pull/${PR_NUMBER}"
changelog_file=$(grep -rl "[-*] ${gutenberg_pr_url}" "${changelog_folder}" | head -n 1)
# Confirm that there is an entry containing the Gutenberg PR link
if [[ -z "${changelog_file}" ]]; then
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."
echo "If changes are related to an existing, open core PR, you may add this PR URL to the core PR's file."
echo "See $changelog_folder/readme.md for more information."
exit 1
fi
core_pr_number=$(basename "${changelog_file}" .md)
core_pr_url="https://github\.com/WordPress/wordpress-develop/pull/${core_pr_number}"
# Confirm that the entry has the correct core backport PR URL.
if ! grep -q -e "${core_pr_url}" "${changelog_file}"; then
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."
exit 1
fi
2 changes: 1 addition & 1 deletion .github/workflows/check-components-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: 'Get PR commit count'
run: echo "PR_COMMIT_COUNT=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> "${GITHUB_ENV}"
- name: Checkout code
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create-block.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
os: ['macos-latest', 'ubuntu-latest', 'windows-latest']

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

Expand Down
Loading

0 comments on commit 5e48264

Please sign in to comment.