Skip to content

Commit c8df406

Browse files
committed
Merge branch 'trunk' into 9.8-sync-with-trunk
2 parents 1b2d136 + a35646f commit c8df406

File tree

3,284 files changed

+9837
-7668
lines changed

Some content is hidden

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

3,284 files changed

+9837
-7668
lines changed

.github/project-community-pr-assigner.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
- team: woo-fse
111111
- team: ghidorah
112112

113-
"plugins/woocommerce-blocks/**/*":
113+
"plugins/woocommerce/client/blocks/**/*":
114114
- team: rubik
115115
- team: woo-fse
116116

.github/workflows/ci.yml

+40-20
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ jobs:
5252
with:
5353
filters: |
5454
needs-code-validation:
55-
- '!((**/*.md)|(**/changelog/*)|(.github/**)|(.husky/**)|(.cursor/**)|(.gitignore))'
55+
- '!((**/*.md)|(**/changelog/*)|(.github/**)|(.husky/**)|(.cursor/**)|(.gitignore)|(**/readme.txt))'
5656
needs-changelog-validation:
57-
- '{packages,plugins}/*/!(changelog/**)/**'
57+
- '{packages,plugins}/*/!((changelog/*)|(readme.txt))'
5858
needs-markdown-validation:
5959
- '!(.github/**)/**/*.md'
6060
needs-syncpack-validation:
@@ -182,7 +182,7 @@ jobs:
182182
RELEASE_TAG: ${{ github.ref_name }}
183183
ARTIFACT_NAME: ${{ github.ref_name == 'nightly' && 'woocommerce-trunk-nightly.zip' || 'woocommerce.zip' }}
184184
# band-aid to get the path to wp-env.json for blocks e2e tests, until they're migrated to plugins/woocommerce
185-
WP_ENV_CONFIG_PATH: ${{ github.workspace }}/${{ matrix.testEnv.start == 'env:start:blocks' && 'plugins/woocommerce-blocks' || matrix.projectPath }}
185+
WP_ENV_CONFIG_PATH: ${{ github.workspace }}/${{ matrix.testEnv.start == 'env:start:blocks' && 'plugins/woocommerce/client/blocks' || matrix.projectPath }}
186186
run: node .github/workflows/scripts/override-wp-env-plugins.js
187187

188188
- name: 'Start Test Environment'
@@ -487,7 +487,7 @@ jobs:
487487
488488
validate-changelog:
489489
name: 'Validate changelog'
490-
if: ${{ !cancelled() && github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'trunk' && needs.identify-jobs-to-run.outputs.needs-changelog-validation == 'true' && ! contains( github.event.pull_request.body, '[x] This Pull Request does not require a changelog' ) }}
490+
if: ${{ !cancelled() && github.event_name == 'pull_request' && github.event.pull_request.user.login != 'github-actions[bot]' && github.event.pull_request.base.ref == 'trunk' && needs.identify-jobs-to-run.outputs.needs-changelog-validation == 'true' && ! contains( github.event.pull_request.body, '[x] This Pull Request does not require a changelog' ) }}
491491
needs: [ 'identify-jobs-to-run' ]
492492
runs-on: ubuntu-latest
493493
permissions:
@@ -585,28 +585,35 @@ jobs:
585585
NC="\e[0m"
586586
set -e
587587
rc=0
588-
changed_files="${{ steps.repo-changed-files.outputs.all_changed_files }}"
589-
if [ -n "$changed_files" ]; then
588+
added_and_modified_docs="${{ steps.repo-changed-files.outputs.added_files }} ${{ steps.repo-changed-files.outputs.modified_files }}"
589+
590+
if [ -n "$added_and_modified_docs" ]; then
590591
lint_results=""
591-
for file in $changed_files; do
592+
593+
for file in $added_and_modified_docs; do
592594
lint_result=$( { cat "$file" | markdownlint --stdin ; } 2>&1 ) || rc="$?"
593595
if [ $rc -ne 0 ]; then
596+
echo -e "${RED}[err] $file${NC}"
594597
lint_results="$lint_results\n>>>Linting failed for file: $file <<<\n$lint_result\n--------"
598+
else
599+
echo -e "${GREEN}[ok] $file${NC}"
595600
fi
596601
done
602+
597603
if [ $rc -ne 0 ]; then
598604
echo -e "${RED}Linting failed for one or more files${NC}"
599605
echo -e "$lint_results"
600606
exit 1
601607
else
602608
echo -e "${GREEN}Linting successful for all files.${NC}"
603609
fi
610+
604611
else
605612
echo "No repo markdown files changed."
606613
fi
607614
608615
- name: Validate - manifest files for monorepo documentation
609-
id: is-valid-json
616+
id: manifest-validation
610617
run: node .github/workflows/scripts/is-valid-json.js docs/docs-manifest.json
611618

612619
- name: Validate - changed markdown files from monorepo documentation
@@ -616,25 +623,34 @@ jobs:
616623
NC="\e[0m"
617624
set -e
618625
rc=0
619-
changed_files="${{ steps.docs-changed-files.outputs.all_changed_files }}"
620-
changed_manifest="${{ steps.docs-manifest.outputs.all_changed_files }}"
621-
is_valid_json="${{ steps.is-valid-json.outputs.is-valid-json }}"
626+
any_docs_changed=${{ steps.docs-changed-files.outputs.any_modified }}
622627
storybook="no"
628+
623629
for L in ${{github.event.pull_request.labels.*.name}}
624630
do
625631
if [ $L == "type: storybook" ]; then
626632
storybook="yes"
627633
fi
628634
done
629-
if [ -n "$changed_files" ]; then
635+
636+
if [ "$any_docs_changed" == "true" ]; then
637+
added_and_modified_docs="${{ steps.docs-changed-files.outputs.added_files }} ${{ steps.docs-changed-files.outputs.modified_files }}"
638+
manifest_changed="${{ steps.docs-manifest.outputs.any_changed }}"
639+
is_manifest_valid_json="${{ steps.manifest-validation.outputs.is-valid-json }}"
630640
lint_results=""
631641
failed_check=""
632-
for file in $changed_files; do
633-
lint_result=$( { cat "$file" | markdownlint --stdin -c docs/.markdownlint.json ; } 2>&1 ) || rc="$?"
634-
if [ $rc -ne 0 ]; then
635-
lint_results="$lint_results\n>>>Linting failed for file: $file <<<\n$lint_result\n--------"
636-
fi
637-
done
642+
643+
if [ -n "$added_and_modified_docs" ]; then
644+
for file in $added_and_modified_docs; do
645+
lint_result=$( { cat "$file" | markdownlint --stdin -c docs/.markdownlint.json ; } 2>&1 ) || rc="$?"
646+
if [ $rc -ne 0 ]; then
647+
echo -e "${RED}[err] $file${NC}"
648+
lint_results="$lint_results\n>>>Linting failed for file: $file <<<\n$lint_result\n--------"
649+
else
650+
echo -e "${GREEN}[ok] $file${NC}"
651+
fi
652+
done
653+
fi
638654
639655
if [ $rc -ne 0 ]; then
640656
echo -e "${RED}Linting failed for one or more files${NC}"
@@ -645,13 +661,17 @@ jobs:
645661
fi
646662
647663
if [ "$storybook" == "no" ]; then
648-
if [ -z "$changed_manifest" ]; then
664+
if [ "$manifest_changed" == "false" ]; then
649665
echo -e "${RED}Changes in the docs folder require updating the manifest${NC}"
650666
failed_check="manifest"
667+
else
668+
echo -e "${GREEN}[ok] docs/docs-manifest.json (updated)${NC}"
651669
fi
652-
if [ "$is_valid_json" == "no" ]; then
670+
if [ "$is_manifest_valid_json" == "no" ]; then
653671
echo -e "${RED}'docs/docs-manifest.json' is not valid JSON${NC}"
654672
failed_check="manifest"
673+
else
674+
echo -e "${GREEN}[ok] docs/docs-manifest.json (valid)${NC}"
655675
fi
656676
if [ "$failed_check" == "manifest" ]; then
657677
echo -e "Generate a manifest with 'pnpm utils md-docs create docs woocommerce -o docs/docs-manifest.json'"

.github/workflows/deprecated/blocks-playwright.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
pull_request:
55
paths:
66
- '.github/workflows/blocks-playwright.yml' # This file
7-
- 'plugins/woocommerce-blocks/**'
7+
- 'plugins/woocommerce/client/blocks/**'
88
- 'plugins/woocommerce/src/Blocks/**'
99
- 'plugins/woocommerce/templates/**'
1010
- 'plugins/woocommerce/patterns/**'
@@ -17,7 +17,7 @@ on:
1717
- trunk
1818
paths:
1919
- '.github/workflows/blocks-playwright.yml' # This file
20-
- 'plugins/woocommerce-blocks/**'
20+
- 'plugins/woocommerce/client/blocks/**'
2121
- 'plugins/woocommerce/src/Blocks/**'
2222
- 'plugins/woocommerce/templates/**'
2323
- 'plugins/woocommerce/patterns/**'
@@ -36,7 +36,7 @@ jobs:
3636
runs-on: ubuntu-latest
3737
defaults:
3838
run:
39-
working-directory: plugins/woocommerce-blocks
39+
working-directory: plugins/woocommerce/client/blocks
4040
strategy:
4141
fail-fast: false
4242
matrix:
@@ -68,15 +68,15 @@ jobs:
6868
if: ${{ !cancelled() }}
6969
with:
7070
name: failures-artifacts-shard-${{ matrix.shardIndex }}
71-
path: plugins/woocommerce-blocks/tests/e2e/artifacts/test-results
71+
path: plugins/woocommerce/client/blocks/tests/e2e/artifacts/test-results
7272
if-no-files-found: ignore
7373

7474
- name: Archive flaky test reports
7575
uses: actions/upload-artifact@v4
7676
if: ${{ !cancelled() }}
7777
with:
7878
name: flaky-tests-report-shard-${{ matrix.shardIndex }}
79-
path: plugins/woocommerce-blocks/flaky-tests
79+
path: plugins/woocommerce/client/blocks/flaky-tests
8080
if-no-files-found: ignore
8181

8282
merge-artifacts:

.github/workflows/pr-assess-bundle-size.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
BROWSERSLIST_IGNORE_OLD_DATA: true
6767
with:
6868
repo-token: '${{ secrets.GITHUB_TOKEN }}'
69-
pattern: './{packages/js/!(*e2e*|*internal*|*test*|*plugin*|*create*),plugins/woocommerce-blocks,plugins/woocommerce/client/admin,plugins/woocommerce/client/legacy}/{build,build-style}/**/*.{js,css}'
69+
pattern: './{packages/js/!(*e2e*|*internal*|*test*|*plugin*|*create*),plugins/woocommerce/client/blocks,plugins/woocommerce/client/admin,plugins/woocommerce/client/legacy}/{build,build-style}/**/*.{js,css}'
7070
install-script: 'pnpm install --filter="@woocommerce/plugin-woocommerce..." --frozen-lockfile --config.dedupe-peer-dependents=false --ignore-scripts'
7171
build-script: '--filter="@woocommerce/plugin-woocommerce" build'
7272
clean-script: '--if-present clean:build'

.github/workflows/scripts/run-metrics.sh

+9-5
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,17 @@ if [ "$GITHUB_EVENT_NAME" == "push" ] || [ "$GITHUB_EVENT_NAME" == "pull_request
2121

2222
if [ "$GITHUB_EVENT_NAME" == "push" ]
2323
then
24-
# Use-case: performance comparison on trunk push with fixed reference point
25-
# It should be 3d7d7f02017383937f1a4158d433d0e5d44b3dc9, but we pick 55f855a2e6d769b5ae44305b2772eb30d3e721df
26-
# where compare-perf reporting mode was introduced for processing the provided reports.
24+
# Use-case: performance comparison on trunk push with fixed reference
25+
# point It should be 3d7d7f02017383937f1a4158d433d0e5d44b3dc9, but we
26+
# pick 55f855a2e6d769b5ae44305b2772eb30d3e721df where compare-perf
27+
# reporting mode was introduced for processing the provided reports.
2728
BASE_SHA=55f855a2e6d769b5ae44305b2772eb30d3e721df
2829
else
29-
# Use-case: performance comparison on PRs changes.
30-
BASE_SHA=$GITHUB_BASE_SHA
30+
# Use-case: performance comparison on PRs changes. We need to explicitly
31+
# fetch trunk because $GITHUB_BASE_SHA might point to the base of a PR
32+
# chain rather than trunk.
33+
git fetch --depth=1 --no-tags origin trunk
34+
BASE_SHA=$(git rev-parse origin/trunk)
3135
fi
3236
HEAD_BRANCH=$(git rev-parse --abbrev-ref HEAD)
3337
WP_VERSION=$(awk -F ': ' '/^Tested up to/{print $2}' readme.txt)

.syncpackrc

+11-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
"@wordpress/data-controls",
4545
"@wordpress/date",
4646
"@wordpress/editor",
47-
"@wordpress/dependency-extraction-webpack-plugin",
4847
"@wordpress/deprecated",
4948
"@wordpress/dom",
5049
"@wordpress/dom-ready",
@@ -233,7 +232,6 @@
233232
"@wordpress/stylelint-config",
234233
"@wordpress/scripts",
235234
"@wordpress/jest-console",
236-
"@wordpress/dependency-extraction-webpack-plugin",
237235
"@wordpress/e2e-test-utils",
238236
"@wordpress/jest-preset-default",
239237
"@wordpress/postcss-plugins-preset",
@@ -311,6 +309,17 @@
311309
"pinVersion": "^1.15.0"
312310
},
313311
{
312+
"label": "@wordpress/* build-dependencies (always ahead of runtime-dependencies)",
313+
"dependencies": [
314+
"@wordpress/dependency-extraction-webpack-plugin"
315+
],
316+
"packages": [
317+
"**"
318+
],
319+
"pinVersion": "next"
320+
},
321+
{
322+
"label": "@wordpress/* runtime-dependencies",
314323
"dependencies": [
315324
"@wordpress/**"
316325
],

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Once you've installed all of the prerequisites, the following will prepare all o
2525
# Ensure that correct version of Node is installed and being used
2626
nvm install
2727
# Install the PHP and Composer dependencies for all of the plugins, packages, and tools
28-
pnpm install
28+
pnpm install -frozen-lockfile
2929
# Build all of the plugins, packages, and tools in the monorepo
3030
pnpm build
3131
```

bin/wp-env-with-wp-641.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const fs = require( 'fs' );
22
const path = require( 'path' );
33

44
const wpEnvRaw = fs.readFileSync(
5-
path.join( __dirname, '../plugins/woocommerce-blocks/.wp-env.json' )
5+
path.join( __dirname, '../plugins/woocommerce/client/blocks/.wp-env.json' )
66
);
77
const wpEnv = JSON.parse( wpEnvRaw );
88

docs/block-theme-development/css-styling.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ tags: reference
99
> [!IMPORTANT]
1010
> We strongly discourage writing CSS code based on existing block class names and prioritize using global styles when possible. We especially discourage writing CSS selectors that rely on a specific block being a descendant of another one, as users can move blocks around freely, so they are prone to breaking. Similar to WordPress itself, we consider the HTML structure within components, blocks, and block templates to be "private", and subject to further change in the future, so using CSS to target the internals of a block or a block template is _not recommended or supported_.
1111
12-
WooCommerce Blocks follows BEM for class names, as [stated in our coding guidelines](https://github.com/woocommerce/woocommerce/blob/trunk/plugins/woocommerce-blocks/docs/contributors/coding-guidelines.md). All classes start with one of these two prefixes:
12+
WooCommerce Blocks follows BEM for class names, as [stated in our coding guidelines](../../plugins/woocommerce/client/blocks/docs/contributors/coding-guidelines.md). All classes start with one of these two prefixes:
1313

1414
* `.wc-block-`: class names specific to a single block.
1515
* `.wc-block-components-`: class names specific to a component. The component might be reused by different blocks.
@@ -69,4 +69,3 @@ WC Blocks use the [`hidden` HTML attribute](https://developer.mozilla.org/en-US/
6969
## Legacy classes from WooCommerce (.price, .star-rating, .button...)
7070

7171
WooCommerce Blocks avoids using legacy unprefixed classes as much as possible. However, you might find some of them that have been added for backwards compatibility. We still encourage themes to use the prefixed classes when possible, this avoids conflicts with other plugins, the editor, etc.
72-

0 commit comments

Comments
 (0)