diff --git a/.github/files/gh-autorelease/files/autorelease.sh b/.github/files/gh-autorelease/files/autorelease.sh index cf26c71e6bb21..45e6a75475798 100755 --- a/.github/files/gh-autorelease/files/autorelease.sh +++ b/.github/files/gh-autorelease/files/autorelease.sh @@ -2,32 +2,42 @@ set -eo pipefail +: "${GH_TOKEN:?Build argument needs to be set and non-empty.}" : "${GITHUB_REF:?Build argument needs to be set and non-empty.}" : "${GITHUB_SHA:?Build argument needs to be set and non-empty.}" -: "${API_TOKEN_GITHUB:?Build argument needs to be set and non-empty.}" -: "${GITHUB_API_URL:?Build argument needs to be set and non-empty.}" -: "${GITHUB_REPOSITORY:?Build argument needs to be set and non-empty.}" -## Determine tag -if [[ ! "$GITHUB_REF" =~ ^refs/tags/v?[0-9]+(\.[0-9]+)+(-[a-z0-9._-]+)?$ ]]; then - echo "::error::Expected GITHUB_REF like \`refs/tags/v1.2.3\` or \`refs/tags/1.2.3\`, got \`$GITHUB_REF\`" +if [[ ! -f composer.json ]]; then + echo '::error::No composer.json. Did it get excluded from the mirror?' exit 1 fi -TAG="${GITHUB_REF#refs/tags/}" -## Check for alphas -if [[ "$TAG" =~ -(alpha|a\.[0-9]*[02468])$ ]]; then - echo "Not creating a release for alpha version $TAG" - exit 0 -fi -echo "Creating release for $TAG" +## Determine tag +ROLLING_MODE= +if [[ "$GITHUB_REF" =~ ^refs/tags/v?[0-9]+(\.[0-9]+)+(-[a-z0-9._-]+)?$ ]]; then + TAG="${GITHUB_REF#refs/tags/}" -## Determine slug and title format. -if [[ ! -f composer.json ]]; then - echo '::error::No composer.json. Did it get excluded from the mirror?' + ## Check for alphas + if [[ "$TAG" =~ -(alpha|a\.[0-9]*[02468])$ ]]; then + echo "Not creating a release for alpha version $TAG" + exit 0 + fi +elif [[ "$GITHUB_REF" == "refs/heads/trunk" ]]; then + if ! jq -e '.extra.autorelease["rolling-release"]? // false' composer.json > /dev/null; then + echo "::notice::Skipping trunk release because autorelease rolling mode is not enabled." + exit 0 + fi + ROLLING_MODE=true + CURRENT_VER=$( sed -nEe 's/^## \[?([^]]*)\]? - .*/\1/;T;p;q' CHANGELOG.md || true ) + GIT_SUFFIX=$( git log -1 --format=%h . ) + TAG="$CURRENT_VER+rolling.$GIT_SUFFIX" +else + echo "::error::Expected GITHUB_REF like \`refs/tags/v1.2.3\` or \`refs/tags/1.2.3\` or \`refs/heads/trunk\` for rolling releases, got \`$GITHUB_REF\`" exit 1 fi +echo "Creating release for $TAG" + +## Determine slug and title format. SLUG="$(jq -r '.extra.autorelease.slug? // .extra["wp-plugin-slug"] // .extra["beta-plugin-slug"] // ( .name | sub( "^.*/"; "" ) )' composer.json)" if [[ -z "$SLUG" ]]; then echo '::error::Failed to get slug from composer.json.' @@ -48,76 +58,75 @@ echo "::group::Creating $SLUG.zip" git archive -v --output="$SLUG.zip" --prefix="$SLUG/" HEAD 2>&1 echo "::endgroup::" -## Create the release note. -# Extract the changelog section. -echo "::group::Extracting release notes" -if [[ ! -f CHANGELOG.md ]]; then - echo '::endgroup::' - echo '::error::No CHANGELOG.md for release notes.' - exit 1 -fi -SCRIPT=" - /^## \\[?$(sed 's/[.\[\]\\*^$\/()+?{}|]/\\&/g' <<<"${TAG#v}")\\]? - / { - bc +if [[ -z "$ROLLING_MODE" ]]; then + ## Create the release note. + # Extract the changelog section. + echo "::group::Extracting release notes" + if [[ ! -f CHANGELOG.md ]]; then + echo '::endgroup::' + echo '::error::No CHANGELOG.md for release notes.' + exit 1 + fi + SCRIPT=" + /^## \\[?$(sed 's/[.\[\]\\*^$\/()+?{}|]/\\&/g' <<<"${TAG#v}")\\]? - / { + bc + :a + n + /^## / { + q + } + :c + s/^## \[([^]]+)\]/## \1/ + p + ba + } + " + ENTRY=$(sed -n -E -e "$SCRIPT" CHANGELOG.md) + if [[ -z "$ENTRY" ]]; then + echo '::endgroup::' + echo "::error::Failed to find section for ${TAG#v} in CHANGELOG.md" + exit 1 + fi + + # Strip unwanted sections. + SCRIPT=" :a - n - /^## / { - q + /^### .* This section will not be copied to readme\.txt/ { + :b + n + /^#/ ba + bb } - :c - s/^## \[([^]]+)\]/## \1/ p - ba - } -" -ENTRY=$(sed -n -E -e "$SCRIPT" CHANGELOG.md) -if [[ -z "$ENTRY" ]]; then - echo '::endgroup::' - echo "::error::Failed to find section for ${TAG#v} in CHANGELOG.md" - exit 1 + " + ENTRY=$(sed -n -E -e "$SCRIPT" <<<"$ENTRY") + + echo "Release notes:" + echo "-----" + echo "$ENTRY" + echo "-----" + echo "::endgroup::" +else + ## Using a brief explanation for the rolling release note. + ENTRY="### Rolling release based on the trunk branch." +fi + +if [[ -n "$ROLLING_MODE" ]]; then + echo "::group::Deleting stale rolling release" + + for R in $( gh release list --limit 100 --json tagName --jq '.[].tagName | select( contains( "rolling" ) )' ); do + echo "Found $R, deleting" + gh release delete "$R" --cleanup-tag --yes + done + + echo "::endgroup::" fi -# Strip unwanted sections. -SCRIPT=" - :a - /^### .* This section will not be copied to readme\.txt/ { - :b - n - /^#/ ba - bb - } - p -" -ENTRY=$(sed -n -E -e "$SCRIPT" <<<"$ENTRY") - -echo "Release notes:" -echo "-----" -echo "$ENTRY" -echo "-----" -echo "::endgroup::" echo "::group::Creating release" -curl -v -L \ - --write-out '%{response_code}' \ - --output out.json \ - --request POST \ - --header "authorization: Bearer $API_TOKEN_GITHUB" \ - --header 'content-type: application/json' \ - --header 'accept: application/vnd.github.v3+json' \ - --url "${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/releases" \ - --data "$(jq -n --arg tag "$TAG" --arg sha "$GITHUB_SHA" --arg title "$TITLE" --arg body "$ENTRY" '{ tag_name: $tag, target_commitish: $sha, name: $title, body: $body}')" \ - 2>&1 > code.txt -cat out.json -echo -[[ "$(&1 echo "::endgroup::" diff --git a/.github/files/gh-autorelease/workflows/autorelease.yml b/.github/files/gh-autorelease/workflows/autorelease.yml index 7fb76b4f8ae94..5109e151dd388 100644 --- a/.github/files/gh-autorelease/workflows/autorelease.yml +++ b/.github/files/gh-autorelease/workflows/autorelease.yml @@ -9,6 +9,8 @@ on: - 'v?[0-9]+.[0-9]+.[0-9]+-*' - 'v?[0-9]+.[0-9]+.[0-9]+.[0-9]+' - 'v?[0-9]+.[0-9]+.[0-9]+.[0-9]+-*' + branches: + - 'trunk' jobs: publish: @@ -18,5 +20,5 @@ jobs: - uses: actions/checkout@v4 - name: Create release env: - API_TOKEN_GITHUB: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: ./.github/files/autorelease.sh diff --git a/.github/files/pr-update-to.sh b/.github/files/pr-update-to.sh index 40946335b1f40..5458931c39f41 100755 --- a/.github/files/pr-update-to.sh +++ b/.github/files/pr-update-to.sh @@ -27,19 +27,6 @@ function update_tag { cd $(dirname "${BASH_SOURCE[0]}")/../.. BASE="$PWD" -# If this commit updated a changelog, assume it was a release and update the tag. -echo "Checking for changes to changelogs..." -FILES=() -for FILE in projects/*/*/composer.json; do - PROJECT="${FILE%/composer.json}" - cd "$BASE/$PROJECT" - FILES+=( "$(realpath -m --relative-to="$BASE" "$(jq -r '.extra.changelogger.changelog // "CHANGELOG.md"' composer.json)")" ) -done -cd "$BASE" -for F in $(git -c core.quotepath=off diff --name-only HEAD^..HEAD "${FILES[@]}"); do - update_tag "pr-update-to-${F%/*}" -done - # If this commit changed tool versions, update the tag so PRs get rechecked with the new versions. echo "Checking for changes to .github/versions.sh..." git diff --exit-code --name-only HEAD^..HEAD .github/versions.sh || update_tag "pr-update-to" diff --git a/.github/files/renovate-post-upgrade.sh b/.github/files/renovate-post-upgrade.sh index 2e15d16f93d7b..6f6aaef839d24 100755 --- a/.github/files/renovate-post-upgrade.sh +++ b/.github/files/renovate-post-upgrade.sh @@ -60,16 +60,7 @@ for DIR in $(git -c core.quotepath=off diff --name-only HEAD | sed -nE 's!^(proj echo "Adding change file for $SLUG" cd "$DIR" - CHANGES_DIR="$(jq -r '.extra.changelogger["changes-dir"] // "changelog"' composer.json)" - if [[ -d "$CHANGES_DIR" && "$(ls -- "$CHANGES_DIR")" ]]; then - changelogger_add 'Updated package dependencies.' '' --filename="${CHANGEFILE}" --filename-auto-suffix - else - changelogger_add 'Updated package dependencies.' '' --filename="${CHANGEFILE}" --filename-auto-suffix - echo "Updating version for $SLUG" - PRERELEASE=$(alpha_tag composer.json 0) - VER=$(changelogger version next --default-first-version --prerelease="$PRERELEASE") || { echo "$VER"; exit 1; } - "$BASE/tools/project-version.sh" -u "$VER" "$SLUG" - fi + changelogger_add 'Updated package dependencies.' '' --filename="${CHANGEFILE}" --filename-auto-suffix cd "$BASE" done diff --git a/.github/workflows/block-performance.yml b/.github/workflows/block-performance.yml index 60fee1fca10ff..8e553204cc1ac 100644 --- a/.github/workflows/block-performance.yml +++ b/.github/workflows/block-performance.yml @@ -3,6 +3,7 @@ name: Jetpack block performance on: schedule: - cron: '0 */12 * * *' + workflow_dispatch: env: # Work around a bug in node 18.18.0. See https://github.com/webpack-contrib/thread-loader/issues/191 for details. @@ -18,20 +19,13 @@ jobs: - uses: actions/setup-node@v4 with: - node-version: 16 + node-version: 20 - uses: actions/checkout@v4 with: repository: 'WordPress/gutenberg' path: 'gutenberg' - - name: Build Gutenberg - working-directory: gutenberg - run: | - npm ci - npx playwright install chromium --with-deps - npm run build:packages - - uses: actions/cache@v4 with: path: ~/.npm @@ -39,6 +33,13 @@ jobs: restore-keys: | ${{ runner.os }}-node- + - name: Build Gutenberg + working-directory: gutenberg + run: | + npm ci + npx playwright install chromium --with-deps + npm run build:packages + - name: Setup tools for J uses: ./.github/actions/tool-setup @@ -87,6 +88,7 @@ jobs: with: name: test-output-block-perf path: tools/e2e-commons/results + include-hidden-files: true test-reports: name: "Trigger test report workflow" diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 655c07f4bac79..43b0038a0df38 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -304,6 +304,7 @@ jobs: with: name: test-output-${{ matrix.project }} path: ${{ matrix.path }}/output + include-hidden-files: true test-report: name: "Test report" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 39e20a92f7aee..caef4109236b8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -220,6 +220,7 @@ jobs: with: name: ${{ matrix.artifact }} path: artifacts + include-hidden-files: true retention-days: 7 storybook-test: diff --git a/composer.lock b/composer.lock index 2285fd933742c..9984862038b01 100644 --- a/composer.lock +++ b/composer.lock @@ -13,7 +13,7 @@ "dist": { "type": "path", "url": "projects/packages/ignorefile", - "reference": "3ac0481862de59f65856b3ac2e086d9cdc86a8fd" + "reference": "7c4c4f2d0cf54ddfdccfc65095777552daa9f85d" }, "require": { "php": ">=7.0" @@ -30,7 +30,7 @@ }, "autotagger": true, "branch-alias": { - "dev-trunk": "2.1.x-dev" + "dev-trunk": "2.0.x-dev" } }, "autoload": { @@ -60,7 +60,7 @@ "dist": { "type": "path", "url": "projects/packages/codesniffer", - "reference": "891b1551e10d864bc4654bd034ce0487ad849425" + "reference": "063d36d1b969cf188a2a0a4c363c0ae2d09011c8" }, "require": { "automattic/vipwpcs": "^3.0", @@ -83,7 +83,7 @@ "link-template": "https://github.com/Automattic/jetpack-codesniffer/compare/v${old}...v${new}" }, "branch-alias": { - "dev-trunk": "4.0.x-dev" + "dev-trunk": "3.0.x-dev" } }, "autoload": { diff --git a/docs/development-environment.md b/docs/development-environment.md index 4ec862476f509..79a541d12811c 100644 --- a/docs/development-environment.md +++ b/docs/development-environment.md @@ -164,7 +164,7 @@ If you're ready to start, you should see all green `SUCCESS` messages. If the sc Once you're all set here, you can continue developing. If you're setting up an local environment and want to start testing immediately, please ensure you build the projects you need. -`jetpack build` will provide prompts to determine the project you need or you can pass it a complete command, like `jetpack build plugins/jetpack --with-deps` +`jetpack build` will provide prompts to determine the project you need or you can pass it a complete command, like `jetpack build plugins/jetpack --deps` ### Testing Jetpack cloud features diff --git a/docs/quick-start.md b/docs/quick-start.md index 281da4710e742..4983dfd9db3dd 100644 --- a/docs/quick-start.md +++ b/docs/quick-start.md @@ -102,7 +102,7 @@ Note: This is for Automattician use only. For other methods, check out [ngrok](. Once you have a local copy of Jetpack and all development tools installed, you can start developing. 1. Make sure the plugin you're developing is activated on your WordPress site. -2. [Build your project](#building-your-project) using `jetpack build [type/project]`, such as `jetpack build plugins/jetpack` +2. [Build your project](development-environment.md#building-your-project) using `jetpack build [type/project]` and including its dependencies, such as `jetpack build plugins/jetpack --deps` 3. Access the plugin's dashboard in your browser. By default the development build above will run once and if you change any of the files, you need to run `jetpack build` again to see the changes on the site. If you want to avoid that, you can run a continuous build that will rebuild anytime it sees any changes on your local filesystem. To run it, use: diff --git a/projects/github-actions/repo-gardening/changelog/add-more-eslint-rules b/projects/github-actions/repo-gardening/changelog/add-more-eslint-rules new file mode 100644 index 0000000000000..2b32cb03e644c --- /dev/null +++ b/projects/github-actions/repo-gardening/changelog/add-more-eslint-rules @@ -0,0 +1,5 @@ +Significance: patch +Type: fixed +Comment: Fix new eslint sniffs. Should be no change in functionality. + + diff --git a/projects/github-actions/repo-gardening/changelog/try-no-version-bumps-in-trunk b/projects/github-actions/repo-gardening/changelog/try-no-version-bumps-in-trunk new file mode 100644 index 0000000000000..91efe85c55e06 --- /dev/null +++ b/projects/github-actions/repo-gardening/changelog/try-no-version-bumps-in-trunk @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Un-bump version numbers in trunk. The build will now update the version numbers as needed for mirrors. + + diff --git a/projects/github-actions/repo-gardening/package.json b/projects/github-actions/repo-gardening/package.json index 5b642d7a584af..37615c57e66b8 100644 --- a/projects/github-actions/repo-gardening/package.json +++ b/projects/github-actions/repo-gardening/package.json @@ -1,6 +1,6 @@ { "name": "repo-gardening", - "version": "5.1.0-alpha", + "version": "5.0.0", "description": "Manage Pull Requests and issues in your Open Source project (automate labelling, milestones, feedback to PR authors, ...)", "author": "Automattic", "license": "GPL-2.0-or-later", diff --git a/projects/github-actions/repo-gardening/src/tasks/check-description/index.js b/projects/github-actions/repo-gardening/src/tasks/check-description/index.js index c8cfb9e4c5c2c..7a5512750d968 100644 --- a/projects/github-actions/repo-gardening/src/tasks/check-description/index.js +++ b/projects/github-actions/repo-gardening/src/tasks/check-description/index.js @@ -67,7 +67,7 @@ async function hasProgressLabel( octokit, owner, repo, number ) { async function getMilestoneDates( plugin, nextMilestone ) { let releaseDate = 'none scheduled'; let codeFreezeDate; - if ( nextMilestone && nextMilestone.hasOwnProperty( 'due_on' ) && nextMilestone.due_on ) { + if ( nextMilestone && Object.hasOwn( nextMilestone, 'due_on' ) && nextMilestone.due_on ) { releaseDate = moment( nextMilestone.due_on ).format( 'LL' ); // Look for a code freeze date in the milestone description. diff --git a/projects/github-actions/required-review/changelog/try-no-version-bumps-in-trunk b/projects/github-actions/required-review/changelog/try-no-version-bumps-in-trunk new file mode 100644 index 0000000000000..91efe85c55e06 --- /dev/null +++ b/projects/github-actions/required-review/changelog/try-no-version-bumps-in-trunk @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Un-bump version numbers in trunk. The build will now update the version numbers as needed for mirrors. + + diff --git a/projects/github-actions/required-review/package.json b/projects/github-actions/required-review/package.json index c9979345b3fb2..23f457596be82 100644 --- a/projects/github-actions/required-review/package.json +++ b/projects/github-actions/required-review/package.json @@ -1,6 +1,6 @@ { "name": "required-review", - "version": "4.0.1-alpha", + "version": "4.0.0", "description": "Check that a Pull Request has reviews from required teams.", "main": "index.js", "author": "Automattic", diff --git a/projects/github-actions/test-results-to-slack/changelog/try-no-version-bumps-in-trunk b/projects/github-actions/test-results-to-slack/changelog/try-no-version-bumps-in-trunk new file mode 100644 index 0000000000000..91efe85c55e06 --- /dev/null +++ b/projects/github-actions/test-results-to-slack/changelog/try-no-version-bumps-in-trunk @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Un-bump version numbers in trunk. The build will now update the version numbers as needed for mirrors. + + diff --git a/projects/github-actions/test-results-to-slack/package.json b/projects/github-actions/test-results-to-slack/package.json index 482ccc99fc211..7ac0f009ff539 100644 --- a/projects/github-actions/test-results-to-slack/package.json +++ b/projects/github-actions/test-results-to-slack/package.json @@ -1,6 +1,6 @@ { "name": "test-results-to-slack", - "version": "0.3.1-alpha", + "version": "0.3.0", "description": "GitHub Action to send Slack notifications with test results", "author": "Automattic", "license": "GPL-2.0-or-later", diff --git a/projects/js-packages/ai-client/changelog/update-jetpack-ai-add-fair-usage-message-on-extension-ai-control b/projects/js-packages/ai-client/changelog/update-jetpack-ai-add-fair-usage-message-on-extension-ai-control new file mode 100644 index 0000000000000..1d373fa53cda5 --- /dev/null +++ b/projects/js-packages/ai-client/changelog/update-jetpack-ai-add-fair-usage-message-on-extension-ai-control @@ -0,0 +1,4 @@ +Significance: minor +Type: added + +Jetpack AI: support fair usage messaging on the Extension AI Control component. diff --git a/projects/js-packages/ai-client/src/components/ai-control/extension-ai-control.tsx b/projects/js-packages/ai-client/src/components/ai-control/extension-ai-control.tsx index 2265d77f9aede..c29fc11b63248 100644 --- a/projects/js-packages/ai-client/src/components/ai-control/extension-ai-control.tsx +++ b/projects/js-packages/ai-client/src/components/ai-control/extension-ai-control.tsx @@ -10,7 +10,12 @@ import React, { forwardRef } from 'react'; /** * Internal dependencies */ -import { GuidelineMessage, ErrorMessage, UpgradeMessage } from '../message/index.js'; +import { + GuidelineMessage, + ErrorMessage, + UpgradeMessage, + FairUsageLimitMessage, +} from '../message/index.js'; import AIControl from './ai-control.js'; import './style.scss'; /** @@ -31,6 +36,7 @@ type ExtensionAIControlProps = { error?: RequestingErrorProps; requestsRemaining?: number; showUpgradeMessage?: boolean; + showFairUsageMessage?: boolean; upgradeUrl?: string; wrapperRef?: React.MutableRefObject< HTMLDivElement | null >; onChange?: ( newValue: string ) => void; @@ -62,6 +68,7 @@ export function ExtensionAIControl( error, requestsRemaining, showUpgradeMessage = false, + showFairUsageMessage = false, upgradeUrl, wrapperRef, onChange, @@ -215,6 +222,8 @@ export function ExtensionAIControl( upgradeUrl={ upgradeUrl } /> ); + } else if ( showFairUsageMessage ) { + message = ; } else if ( showUpgradeMessage ) { message = ( fair usage policy", + 'jetpack-ai-client' + ); + const element = createInterpolateElement( message, { + link: ( + + ), + } ); + + return { element }; +} + /** * React component to render an upgrade message for free tier users * diff --git a/projects/js-packages/babel-plugin-replace-textdomain/changelog/add-more-eslint-rules b/projects/js-packages/babel-plugin-replace-textdomain/changelog/add-more-eslint-rules new file mode 100644 index 0000000000000..2b32cb03e644c --- /dev/null +++ b/projects/js-packages/babel-plugin-replace-textdomain/changelog/add-more-eslint-rules @@ -0,0 +1,5 @@ +Significance: patch +Type: fixed +Comment: Fix new eslint sniffs. Should be no change in functionality. + + diff --git a/projects/js-packages/babel-plugin-replace-textdomain/src/index.js b/projects/js-packages/babel-plugin-replace-textdomain/src/index.js index 02a26a2d71398..86241269e7486 100644 --- a/projects/js-packages/babel-plugin-replace-textdomain/src/index.js +++ b/projects/js-packages/babel-plugin-replace-textdomain/src/index.js @@ -50,7 +50,7 @@ module.exports = ( babel, opts ) => { callee = callee.expressions[ callee.expressions.length - 1 ]; } const funcName = t.isMemberExpression( callee ) ? callee.property.name : callee.name; - if ( ! functions.hasOwnProperty( funcName ) ) { + if ( ! Object.hasOwn( functions, funcName ) ) { return; } const idx = functions[ funcName ]; diff --git a/projects/js-packages/boost-score-api/changelog/add-more-eslint-rules b/projects/js-packages/boost-score-api/changelog/add-more-eslint-rules new file mode 100644 index 0000000000000..2b32cb03e644c --- /dev/null +++ b/projects/js-packages/boost-score-api/changelog/add-more-eslint-rules @@ -0,0 +1,5 @@ +Significance: patch +Type: fixed +Comment: Fix new eslint sniffs. Should be no change in functionality. + + diff --git a/projects/js-packages/boost-score-api/tests/index.test.js b/projects/js-packages/boost-score-api/tests/index.test.js index 16f3ad24ccf98..3453f99e98bd2 100644 --- a/projects/js-packages/boost-score-api/tests/index.test.js +++ b/projects/js-packages/boost-score-api/tests/index.test.js @@ -82,7 +82,8 @@ describe( 'getScoreMovementPercentage', () => { expect( getScoreMovementPercentage( changedMockData.scores ) ).toBe( 0 ); - ( changedMockData.scores.noBoost.desktop = 80 ), ( changedMockData.scores.noBoost.mobile = 70 ); + changedMockData.scores.noBoost.desktop = 80; + changedMockData.scores.noBoost.mobile = 70; expect( getScoreMovementPercentage( changedMockData.scores ) ).toBe( 13 ); } ); diff --git a/projects/js-packages/components/changelog/add-more-eslint-rules b/projects/js-packages/components/changelog/add-more-eslint-rules new file mode 100644 index 0000000000000..2b32cb03e644c --- /dev/null +++ b/projects/js-packages/components/changelog/add-more-eslint-rules @@ -0,0 +1,5 @@ +Significance: patch +Type: fixed +Comment: Fix new eslint sniffs. Should be no change in functionality. + + diff --git a/projects/js-packages/components/tools/jp-redirect/index.ts b/projects/js-packages/components/tools/jp-redirect/index.ts index c2033c2e63343..0058c14d218b2 100644 --- a/projects/js-packages/components/tools/jp-redirect/index.ts +++ b/projects/js-packages/components/tools/jp-redirect/index.ts @@ -45,7 +45,7 @@ export default function getRedirectUrl( source: string, args: GetRedirectUrlArgs if ( ! Object.keys( queryVars ).includes( 'site' ) && typeof jetpack_redirects !== 'undefined' && - jetpack_redirects.hasOwnProperty( 'currentSiteRawUrl' ) + Object.hasOwn( jetpack_redirects, 'currentSiteRawUrl' ) ) { queryVars.site = jetpack_redirects.currentBlogID ?? jetpack_redirects.currentSiteRawUrl; } diff --git a/projects/js-packages/config/changelog/add-more-eslint-rules b/projects/js-packages/config/changelog/add-more-eslint-rules new file mode 100644 index 0000000000000..2b32cb03e644c --- /dev/null +++ b/projects/js-packages/config/changelog/add-more-eslint-rules @@ -0,0 +1,5 @@ +Significance: patch +Type: fixed +Comment: Fix new eslint sniffs. Should be no change in functionality. + + diff --git a/projects/js-packages/config/src/index.js b/projects/js-packages/config/src/index.js index 44a326a2edcc6..e7fd2d8b03b61 100644 --- a/projects/js-packages/config/src/index.js +++ b/projects/js-packages/config/src/index.js @@ -12,7 +12,7 @@ try { } const jetpackConfigHas = key => { - return jetpackConfig.hasOwnProperty( key ); + return Object.hasOwn( jetpackConfig, key ); }; const jetpackConfigGet = key => { diff --git a/projects/js-packages/eslint-changed/changelog/try-no-version-bumps-in-trunk b/projects/js-packages/eslint-changed/changelog/try-no-version-bumps-in-trunk new file mode 100644 index 0000000000000..91efe85c55e06 --- /dev/null +++ b/projects/js-packages/eslint-changed/changelog/try-no-version-bumps-in-trunk @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Un-bump version numbers in trunk. The build will now update the version numbers as needed for mirrors. + + diff --git a/projects/js-packages/eslint-changed/package.json b/projects/js-packages/eslint-changed/package.json index ae64558d9b528..1cc6ebabdf16e 100644 --- a/projects/js-packages/eslint-changed/package.json +++ b/projects/js-packages/eslint-changed/package.json @@ -1,6 +1,6 @@ { "name": "@automattic/eslint-changed", - "version": "2.0.9-alpha", + "version": "2.0.8", "description": "Run eslint on files, but only report warnings and errors from lines that were changed.", "homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/eslint-changed/#readme", "type": "module", diff --git a/projects/js-packages/eslint-changed/src/cli.js b/projects/js-packages/eslint-changed/src/cli.js index fc23ced57c25d..5790f0a5b9f77 100755 --- a/projects/js-packages/eslint-changed/src/cli.js +++ b/projects/js-packages/eslint-changed/src/cli.js @@ -6,7 +6,7 @@ import { Command } from 'commander'; import { ESLint } from 'eslint'; import parseDiff from 'parse-diff'; -const APP_VERSION = '2.0.9-alpha'; +const APP_VERSION = '2.0.8'; /** * Create a Commander instance. diff --git a/projects/js-packages/eslint-config-target-es/changelog/try-no-version-bumps-in-trunk b/projects/js-packages/eslint-config-target-es/changelog/try-no-version-bumps-in-trunk new file mode 100644 index 0000000000000..91efe85c55e06 --- /dev/null +++ b/projects/js-packages/eslint-config-target-es/changelog/try-no-version-bumps-in-trunk @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Un-bump version numbers in trunk. The build will now update the version numbers as needed for mirrors. + + diff --git a/projects/js-packages/eslint-config-target-es/package.json b/projects/js-packages/eslint-config-target-es/package.json index 3f3289c0cae4c..4f1ebdebfee67 100644 --- a/projects/js-packages/eslint-config-target-es/package.json +++ b/projects/js-packages/eslint-config-target-es/package.json @@ -1,6 +1,6 @@ { "name": "@automattic/eslint-config-target-es", - "version": "2.2.0-alpha", + "version": "2.1.0", "description": "ESLint sharable config to activate eslint-plugin-es checks based on browserslist targets.", "homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/eslint-config-target-es/README.md#readme", "bugs": { diff --git a/projects/js-packages/i18n-check-webpack-plugin/changelog/add-more-eslint-rules b/projects/js-packages/i18n-check-webpack-plugin/changelog/add-more-eslint-rules new file mode 100644 index 0000000000000..2b32cb03e644c --- /dev/null +++ b/projects/js-packages/i18n-check-webpack-plugin/changelog/add-more-eslint-rules @@ -0,0 +1,5 @@ +Significance: patch +Type: fixed +Comment: Fix new eslint sniffs. Should be no change in functionality. + + diff --git a/projects/js-packages/i18n-check-webpack-plugin/src/GettextExtractor.js b/projects/js-packages/i18n-check-webpack-plugin/src/GettextExtractor.js index 6cd362e8f2da1..fb8f6e06c5533 100644 --- a/projects/js-packages/i18n-check-webpack-plugin/src/GettextExtractor.js +++ b/projects/js-packages/i18n-check-webpack-plugin/src/GettextExtractor.js @@ -156,7 +156,7 @@ class GettextExtractor { return; } - if ( ! this.#functions.hasOwnProperty( callee.name ) ) { + if ( ! Object.hasOwn( this.#functions, callee.name ) ) { return; } diff --git a/projects/js-packages/idc/changelog/add-more-eslint-rules b/projects/js-packages/idc/changelog/add-more-eslint-rules new file mode 100644 index 0000000000000..2b32cb03e644c --- /dev/null +++ b/projects/js-packages/idc/changelog/add-more-eslint-rules @@ -0,0 +1,5 @@ +Significance: patch +Type: fixed +Comment: Fix new eslint sniffs. Should be no change in functionality. + + diff --git a/projects/js-packages/idc/components/idc-screen/index.jsx b/projects/js-packages/idc/components/idc-screen/index.jsx index 054b4ecbb80d9..0336fc13345e1 100644 --- a/projects/js-packages/idc/components/idc-screen/index.jsx +++ b/projects/js-packages/idc/components/idc-screen/index.jsx @@ -55,11 +55,11 @@ const IDCScreen = props => { initializeAnalytics( tracksEventData, tracksUserData ); if ( tracksEventData ) { - if ( tracksEventData.hasOwnProperty( 'isAdmin' ) && tracksEventData.isAdmin ) { + if ( Object.hasOwn( tracksEventData, 'isAdmin' ) && tracksEventData.isAdmin ) { trackAndBumpMCStats( 'notice_view' ); } else { trackAndBumpMCStats( 'non_admin_notice_view', { - page: tracksEventData.hasOwnProperty( 'currentScreen' ) + page: Object.hasOwn( tracksEventData, 'currentScreen' ) ? tracksEventData.currentScreen : false, } ); diff --git a/projects/js-packages/idc/tools/tracking.jsx b/projects/js-packages/idc/tools/tracking.jsx index 37af2592521ea..315f919dd834b 100644 --- a/projects/js-packages/idc/tools/tracking.jsx +++ b/projects/js-packages/idc/tools/tracking.jsx @@ -9,18 +9,18 @@ import analytics from '@automattic/jetpack-analytics'; export function initializeAnalytics( tracksEventData, tracksUserData ) { if ( tracksUserData && - tracksUserData.hasOwnProperty( 'userid' ) && - tracksUserData.hasOwnProperty( 'username' ) + Object.hasOwn( tracksUserData, 'userid' ) && + Object.hasOwn( tracksUserData, 'username' ) ) { analytics.initialize( tracksUserData.userid, tracksUserData.username ); } if ( tracksEventData ) { - if ( tracksEventData.hasOwnProperty( 'blogID' ) ) { + if ( Object.hasOwn( tracksEventData, 'blogID' ) ) { analytics.assignSuperProps( { blog_id: tracksEventData.blogID } ); } - if ( tracksEventData.hasOwnProperty( 'platform' ) ) { + if ( Object.hasOwn( tracksEventData, 'platform' ) ) { analytics.assignSuperProps( { platform: tracksEventData.platform } ); } } diff --git a/projects/js-packages/image-guide/changelog/try-no-version-bumps-in-trunk b/projects/js-packages/image-guide/changelog/try-no-version-bumps-in-trunk new file mode 100644 index 0000000000000..91efe85c55e06 --- /dev/null +++ b/projects/js-packages/image-guide/changelog/try-no-version-bumps-in-trunk @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Un-bump version numbers in trunk. The build will now update the version numbers as needed for mirrors. + + diff --git a/projects/js-packages/image-guide/package.json b/projects/js-packages/image-guide/package.json index 3c2bfa39a1d18..e7bc461174a84 100644 --- a/projects/js-packages/image-guide/package.json +++ b/projects/js-packages/image-guide/package.json @@ -1,6 +1,6 @@ { "name": "@automattic/jetpack-image-guide", - "version": "0.5.11-alpha", + "version": "0.5.10", "description": "Go through the dom to analyze image size on screen vs actual file size.", "homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/image-guide/#readme", "type": "module", diff --git a/projects/js-packages/publicize-components/changelog/try-no-version-bumps-in-trunk b/projects/js-packages/publicize-components/changelog/try-no-version-bumps-in-trunk new file mode 100644 index 0000000000000..91efe85c55e06 --- /dev/null +++ b/projects/js-packages/publicize-components/changelog/try-no-version-bumps-in-trunk @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Un-bump version numbers in trunk. The build will now update the version numbers as needed for mirrors. + + diff --git a/projects/js-packages/publicize-components/package.json b/projects/js-packages/publicize-components/package.json index 61cc2fcbb4bba..94e3384c7834f 100644 --- a/projects/js-packages/publicize-components/package.json +++ b/projects/js-packages/publicize-components/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@automattic/jetpack-publicize-components", - "version": "0.63.1-alpha", + "version": "0.63.0", "description": "A library of JS components required by the Publicize editor plugin", "homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/publicize-components/#readme", "bugs": { diff --git a/projects/js-packages/react-data-sync-client/changelog/try-no-version-bumps-in-trunk b/projects/js-packages/react-data-sync-client/changelog/try-no-version-bumps-in-trunk new file mode 100644 index 0000000000000..91efe85c55e06 --- /dev/null +++ b/projects/js-packages/react-data-sync-client/changelog/try-no-version-bumps-in-trunk @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Un-bump version numbers in trunk. The build will now update the version numbers as needed for mirrors. + + diff --git a/projects/js-packages/react-data-sync-client/package.json b/projects/js-packages/react-data-sync-client/package.json index 339fb6f89886e..c87ed178ff0f9 100644 --- a/projects/js-packages/react-data-sync-client/package.json +++ b/projects/js-packages/react-data-sync-client/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@automattic/jetpack-react-data-sync-client", - "version": "0.1.4-alpha", + "version": "0.1.3", "description": "DataSync client for React", "homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/react-data-sync-client/#readme", "bugs": { diff --git a/projects/js-packages/storybook/changelog/try-no-version-bumps-in-trunk b/projects/js-packages/storybook/changelog/try-no-version-bumps-in-trunk new file mode 100644 index 0000000000000..91efe85c55e06 --- /dev/null +++ b/projects/js-packages/storybook/changelog/try-no-version-bumps-in-trunk @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Un-bump version numbers in trunk. The build will now update the version numbers as needed for mirrors. + + diff --git a/projects/js-packages/storybook/package.json b/projects/js-packages/storybook/package.json index e423f5340087d..729898c526148 100644 --- a/projects/js-packages/storybook/package.json +++ b/projects/js-packages/storybook/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@automattic/jetpack-storybook", - "version": "0.5.0-alpha", + "version": "0.4.1", "description": "Jetpack components storybook", "homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/storybook/#readme", "bugs": { diff --git a/projects/js-packages/svelte-data-sync-client/changelog/try-no-version-bumps-in-trunk b/projects/js-packages/svelte-data-sync-client/changelog/try-no-version-bumps-in-trunk new file mode 100644 index 0000000000000..91efe85c55e06 --- /dev/null +++ b/projects/js-packages/svelte-data-sync-client/changelog/try-no-version-bumps-in-trunk @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Un-bump version numbers in trunk. The build will now update the version numbers as needed for mirrors. + + diff --git a/projects/js-packages/svelte-data-sync-client/package.json b/projects/js-packages/svelte-data-sync-client/package.json index 2aed4f1ebb874..71d6112815637 100644 --- a/projects/js-packages/svelte-data-sync-client/package.json +++ b/projects/js-packages/svelte-data-sync-client/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@automattic/jetpack-svelte-data-sync-client", - "version": "0.3.6-alpha", + "version": "0.3.5", "description": "A Svelte.js client for the wp-js-data-sync package", "homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/svelte-data-sync-client/#readme", "type": "module", diff --git a/projects/packages/codesniffer/changelog/try-no-version-bumps-in-trunk b/projects/packages/codesniffer/changelog/try-no-version-bumps-in-trunk new file mode 100644 index 0000000000000..91efe85c55e06 --- /dev/null +++ b/projects/packages/codesniffer/changelog/try-no-version-bumps-in-trunk @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Un-bump version numbers in trunk. The build will now update the version numbers as needed for mirrors. + + diff --git a/projects/packages/codesniffer/composer.json b/projects/packages/codesniffer/composer.json index 001e510aadd7d..4d92d6469c253 100644 --- a/projects/packages/codesniffer/composer.json +++ b/projects/packages/codesniffer/composer.json @@ -58,7 +58,7 @@ "link-template": "https://github.com/Automattic/jetpack-codesniffer/compare/v${old}...v${new}" }, "branch-alias": { - "dev-trunk": "4.0.x-dev" + "dev-trunk": "3.0.x-dev" } }, "config": { diff --git a/projects/packages/connection/changelog/add-more-eslint-rules b/projects/packages/connection/changelog/add-more-eslint-rules new file mode 100644 index 0000000000000..2b32cb03e644c --- /dev/null +++ b/projects/packages/connection/changelog/add-more-eslint-rules @@ -0,0 +1,5 @@ +Significance: patch +Type: fixed +Comment: Fix new eslint sniffs. Should be no change in functionality. + + diff --git a/projects/packages/connection/src/identity-crisis/_inc/admin.jsx b/projects/packages/connection/src/identity-crisis/_inc/admin.jsx index 1f899d7932098..8d731738722e0 100644 --- a/projects/packages/connection/src/identity-crisis/_inc/admin.jsx +++ b/projects/packages/connection/src/identity-crisis/_inc/admin.jsx @@ -9,7 +9,7 @@ import './style.scss'; * The initial renderer function. */ function render() { - if ( ! window.hasOwnProperty( 'JP_IDENTITY_CRISIS__INITIAL_STATE' ) ) { + if ( ! Object.hasOwn( window, 'JP_IDENTITY_CRISIS__INITIAL_STATE' ) ) { return; } @@ -47,10 +47,10 @@ function render() { tracksUserData={ tracksUserData || {} } tracksEventData={ tracksEventData } customContent={ - consumerData.hasOwnProperty( 'customContent' ) ? consumerData.customContent : {} + Object.hasOwn( consumerData, 'customContent' ) ? consumerData.customContent : {} } isAdmin={ isAdmin } - logo={ consumerData.hasOwnProperty( 'logo' ) ? consumerData.logo : undefined } + logo={ Object.hasOwn( consumerData, 'logo' ) ? consumerData.logo : undefined } possibleDynamicSiteUrlDetected={ possibleDynamicSiteUrlDetected } isDevelopmentSite={ isDevelopmentSite } /> diff --git a/projects/packages/forms/changelog/fix-dropdown-failing-e2e-test b/projects/packages/forms/changelog/fix-dropdown-failing-e2e-test new file mode 100644 index 0000000000000..b38b38100393a --- /dev/null +++ b/projects/packages/forms/changelog/fix-dropdown-failing-e2e-test @@ -0,0 +1,5 @@ +Significance: patch +Type: fixed +Comment: Render option field as a div in the editor + + diff --git a/projects/packages/forms/changelog/try-no-version-bumps-in-trunk b/projects/packages/forms/changelog/try-no-version-bumps-in-trunk new file mode 100644 index 0000000000000..91efe85c55e06 --- /dev/null +++ b/projects/packages/forms/changelog/try-no-version-bumps-in-trunk @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Un-bump version numbers in trunk. The build will now update the version numbers as needed for mirrors. + + diff --git a/projects/packages/forms/changelog/update-contact-form-block-api b/projects/packages/forms/changelog/update-contact-form-block-api new file mode 100644 index 0000000000000..dbc5ada1eb81e --- /dev/null +++ b/projects/packages/forms/changelog/update-contact-form-block-api @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Forms: update child blocks to Block API v3 diff --git a/projects/packages/forms/src/blocks/contact-form/child-blocks.js b/projects/packages/forms/src/blocks/contact-form/child-blocks.js index d7b89470fbb7a..30db4224f093d 100644 --- a/projects/packages/forms/src/blocks/contact-form/child-blocks.js +++ b/projects/packages/forms/src/blocks/contact-form/child-blocks.js @@ -1,4 +1,4 @@ -import { InnerBlocks } from '@wordpress/block-editor'; +import { InnerBlocks, useBlockProps } from '@wordpress/block-editor'; import { createBlock, getBlockType } from '@wordpress/blocks'; import { Path } from '@wordpress/components'; import { Fragment } from '@wordpress/element'; @@ -17,6 +17,7 @@ import { useFormWrapper } from './util/form'; import renderMaterialIcon from './util/render-material-icon'; const FieldDefaults = { + apiVersion: 3, category: 'contact-form', supports: { reusable: false, @@ -229,6 +230,7 @@ const FieldDefaults = { }; const OptionFieldDefaults = { + apiVersion: 3, category: 'contact-form', edit: JetpackFieldOptionEdit, attributes: { @@ -675,7 +677,15 @@ export const childBlocks = [ /> ), edit: editMultiField( 'checkbox' ), - save: () => , + save: () => { + const blockProps = useBlockProps.save(); + + return ( +
+ +
+ ); + }, attributes: { ...FieldDefaults.attributes, label: { @@ -713,7 +723,15 @@ export const childBlocks = [ ), edit: editMultiField( 'radio' ), - save: () => , + save: () => { + const blockProps = useBlockProps.save(); + + return ( +
+ +
+ ); + }, attributes: { ...FieldDefaults.attributes, label: { diff --git a/projects/packages/forms/src/blocks/contact-form/components/jetpack-field-checkbox.js b/projects/packages/forms/src/blocks/contact-form/components/jetpack-field-checkbox.js index 5f5ab1a645c57..06a0782c60db0 100644 --- a/projects/packages/forms/src/blocks/contact-form/components/jetpack-field-checkbox.js +++ b/projects/packages/forms/src/blocks/contact-form/components/jetpack-field-checkbox.js @@ -3,6 +3,7 @@ import { InspectorControls, PanelColorSettings, BlockControls, + useBlockProps, } from '@wordpress/block-editor'; import { PanelBody, ToggleControl } from '@wordpress/components'; import { compose, withInstanceId } from '@wordpress/compose'; @@ -27,6 +28,11 @@ function JetpackFieldCheckbox( props ) { } = props; const { blockStyle } = useJetpackFieldStyles( attributes ); + const blockProps = useBlockProps( { + id: `jetpack-field-checkbox-${ instanceId }`, + className: 'jetpack-field jetpack-field-checkbox', + style: blockStyle, + } ); return ( <> @@ -37,11 +43,7 @@ function JetpackFieldCheckbox( props ) { /> -
+
{ + const blockProps = useBlockProps( { + id: `jetpack-field-consent-${ instanceId }`, + className: 'jetpack-field jetpack-field-consent', + } ); + return ( -
+
{ consentType === 'explicit' && ( ) } diff --git a/projects/packages/forms/src/blocks/contact-form/components/jetpack-field-datepicker.js b/projects/packages/forms/src/blocks/contact-form/components/jetpack-field-datepicker.js index 6ba9ba74ceda8..ab41c2a6d3977 100644 --- a/projects/packages/forms/src/blocks/contact-form/components/jetpack-field-datepicker.js +++ b/projects/packages/forms/src/blocks/contact-form/components/jetpack-field-datepicker.js @@ -1,3 +1,4 @@ +import { useBlockProps } from '@wordpress/block-editor'; import { SelectControl } from '@wordpress/components'; import { compose } from '@wordpress/compose'; import { __ } from '@wordpress/i18n'; @@ -40,15 +41,17 @@ const JetpackDatePicker = props => { const { blockStyle, fieldStyle } = useJetpackFieldStyles( attributes ); const formStyle = useFormStyle( clientId ); - - const classes = clsx( 'jetpack-field', { - 'is-selected': isSelected, - 'has-placeholder': !! placeholder, + const blockProps = useBlockProps( { + className: clsx( 'jetpack-field', { + 'is-selected': isSelected, + 'has-placeholder': !! placeholder, + } ), + style: blockStyle, } ); return ( <> -
+
+
-
+
{ return createBlock( name, { @@ -48,45 +44,26 @@ export const JetpackFieldOptionEdit = ( { removeBlock( clientId ); }; - const onFocus = () => { - // TODO: move cursor to end - }; - - useEffect( () => { - const element = labelRef.current; - - element?.addEventListener( 'focus', onFocus ); - - if ( isSelected ) { - // Timeout is necessary for the focus to be effective - setTimeout( () => element?.focus(), 0 ); - } - - return () => { - element?.removeEventListener( 'focus', onFocus ); - }; - }, [ isSelected, labelRef ] ); - const supportsSplitting = supportsParagraphSplitting(); const type = name.replace( 'jetpack/field-option-', '' ); const classes = clsx( 'jetpack-field-option', `field-option-${ type }` ); return ( -
+
setAttributes( { label: val } ) } - onReplace={ onReplace } onRemove={ handleDelete } + onReplace={ onReplace } preserveWhiteSpace={ false } withoutInteractiveFormatting - ref={ labelRef } { ...( supportsSplitting ? {} : { onSplit: handleSplit } ) } />
diff --git a/projects/packages/forms/src/blocks/contact-form/components/jetpack-field-textarea.js b/projects/packages/forms/src/blocks/contact-form/components/jetpack-field-textarea.js index b616f37be6d9c..9363cb66e43a3 100644 --- a/projects/packages/forms/src/blocks/contact-form/components/jetpack-field-textarea.js +++ b/projects/packages/forms/src/blocks/contact-form/components/jetpack-field-textarea.js @@ -1,3 +1,4 @@ +import { useBlockProps } from '@wordpress/block-editor'; import { compose } from '@wordpress/compose'; import { useEffect } from '@wordpress/element'; import clsx from 'clsx'; @@ -21,12 +22,15 @@ const JetpackFieldTextarea = props => { placeholder, width, } = props; + const formStyle = useFormStyle( clientId ); const { blockStyle, fieldStyle } = useJetpackFieldStyles( attributes ); - - const classes = clsx( 'jetpack-field jetpack-field-textarea', { - 'is-selected': isSelected, - 'has-placeholder': ! isEmpty( placeholder ), + const blockProps = useBlockProps( { + className: clsx( 'jetpack-field jetpack-field-textarea', { + 'is-selected': isSelected, + 'has-placeholder': ! isEmpty( placeholder ), + } ), + style: blockStyle, } ); useEffect( () => { @@ -38,7 +42,7 @@ const JetpackFieldTextarea = props => { return ( <> -
+
{ const { blockStyle, fieldStyle } = useJetpackFieldStyles( attributes ); const formStyle = useFormStyle( clientId ); - - const classes = clsx( 'jetpack-field', { - 'is-selected': isSelected, - 'has-placeholder': ! isEmpty( placeholder ), + const blockProps = useBlockProps( { + className: clsx( 'jetpack-field', { + 'is-selected': isSelected, + 'has-placeholder': ! isEmpty( placeholder ), + } ), + style: blockStyle, } ); return ( <> -
+
; + elt = ; + } else { + elt = ( + + ); } - return ( - - ); - } - - if ( ! hasInnerBlocks && registerBlockVariation ) { - return renderVariationPicker(); - } + } else if ( ! hasInnerBlocks && registerBlockVariation ) { + elt = renderVariationPicker(); + } else { + elt = ( + <> + + { ! attributes.formTitle && ( + + + { __( + 'Add a heading inside the form or before it to help everybody identify it.', + 'jetpack-forms' + ) } + { ' ' } + + ) } + + + + + { renderSubmissionSettings() } + + + + - return ( - <> - - { ! attributes.formTitle && ( - - - { __( - 'Add a heading inside the form or before it to help everybody identify it.', - 'jetpack-forms' + { isSalesForceExtensionEnabled && salesforceData?.sendToSalesforce && ( + + ) } + { ! ( isSimpleSite() || isAtomicSite() ) && ( + + { canUserInstallPlugins && ( + + + ) } - { ' ' } - - ) } - - - - - { renderSubmissionSettings() } - - - - + + + + + ) } + - { isSalesForceExtensionEnabled && salesforceData?.sendToSalesforce && ( - + - ) } - { ! ( isSimpleSite() || isAtomicSite() ) && ( - - { canUserInstallPlugins && ( - - - - ) } - - - - - ) } - +
+ + ); + } -
- -
- - ); + return
{ elt }
; } ); diff --git a/projects/packages/forms/src/blocks/contact-form/editor.scss b/projects/packages/forms/src/blocks/contact-form/editor.scss index 55e98b23939b2..31f6d919b2456 100644 --- a/projects/packages/forms/src/blocks/contact-form/editor.scss +++ b/projects/packages/forms/src/blocks/contact-form/editor.scss @@ -41,14 +41,14 @@ } } - > .block-editor-inner-blocks > .block-editor-block-list__layout { + .block-editor-inner-blocks .block-editor-block-list__layout { display: flex; flex-wrap: wrap; justify-content: flex-start; flex-direction: row; gap: var(--wp--style--block-gap, 1.5rem); - > .wp-block { + .wp-block { flex: 0 0 100%; margin: 0; @@ -593,7 +593,7 @@ .jetpack-contact-form { padding: 16px; - > .block-editor-inner-blocks > .block-editor-block-list__layout { + .block-editor-inner-blocks .block-editor-block-list__layout { margin: 0; } } diff --git a/projects/packages/forms/src/blocks/contact-form/index.js b/projects/packages/forms/src/blocks/contact-form/index.js index be342b30eb823..5fbabeea63cfa 100644 --- a/projects/packages/forms/src/blocks/contact-form/index.js +++ b/projects/packages/forms/src/blocks/contact-form/index.js @@ -43,6 +43,7 @@ const icon = renderMaterialIcon( ); export const settings = { + apiVersion: 3, title: __( 'Form', 'jetpack-forms' ), description: __( 'Create forms to collect data from site visitors and manage their responses.', diff --git a/projects/packages/ignorefile/changelog/try-no-version-bumps-in-trunk b/projects/packages/ignorefile/changelog/try-no-version-bumps-in-trunk new file mode 100644 index 0000000000000..91efe85c55e06 --- /dev/null +++ b/projects/packages/ignorefile/changelog/try-no-version-bumps-in-trunk @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Un-bump version numbers in trunk. The build will now update the version numbers as needed for mirrors. + + diff --git a/projects/packages/ignorefile/composer.json b/projects/packages/ignorefile/composer.json index 4c2679bd44e99..3b0a837703bd4 100644 --- a/projects/packages/ignorefile/composer.json +++ b/projects/packages/ignorefile/composer.json @@ -41,7 +41,7 @@ }, "autotagger": true, "branch-alias": { - "dev-trunk": "2.1.x-dev" + "dev-trunk": "2.0.x-dev" } } } diff --git a/projects/packages/jetpack-mu-wpcom/.phan/baseline.php b/projects/packages/jetpack-mu-wpcom/.phan/baseline.php index 8ad1f891b16bb..bb58e6850074b 100644 --- a/projects/packages/jetpack-mu-wpcom/.phan/baseline.php +++ b/projects/packages/jetpack-mu-wpcom/.phan/baseline.php @@ -14,9 +14,9 @@ // PhanUndeclaredClassMethod : 20+ occurrences // PhanTypeMismatchArgumentProbablyReal : 15+ occurrences // PhanTypeMismatchReturnProbablyReal : 10+ occurrences - // PhanUndeclaredConstant : 10+ occurrences // PhanUndeclaredFunction : 10+ occurrences // PhanTypeMismatchReturn : 8 occurrences + // PhanUndeclaredConstant : 7 occurrences // PhanTypeArraySuspiciousNullable : 6 occurrences // PhanNoopNew : 5 occurrences // PhanParamTooMany : 4 occurrences diff --git a/projects/packages/jetpack-mu-wpcom/changelog/add-more-eslint-rules b/projects/packages/jetpack-mu-wpcom/changelog/add-more-eslint-rules new file mode 100644 index 0000000000000..2b32cb03e644c --- /dev/null +++ b/projects/packages/jetpack-mu-wpcom/changelog/add-more-eslint-rules @@ -0,0 +1,5 @@ +Significance: patch +Type: fixed +Comment: Fix new eslint sniffs. Should be no change in functionality. + + diff --git a/projects/packages/jetpack-mu-wpcom/changelog/try-no-version-bumps-in-trunk b/projects/packages/jetpack-mu-wpcom/changelog/try-no-version-bumps-in-trunk new file mode 100644 index 0000000000000..91efe85c55e06 --- /dev/null +++ b/projects/packages/jetpack-mu-wpcom/changelog/try-no-version-bumps-in-trunk @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Un-bump version numbers in trunk. The build will now update the version numbers as needed for mirrors. + + diff --git a/projects/packages/jetpack-mu-wpcom/changelog/update-newspack-blocks b/projects/packages/jetpack-mu-wpcom/changelog/update-newspack-blocks new file mode 100644 index 0000000000000..6a7f4b1b00f8d --- /dev/null +++ b/projects/packages/jetpack-mu-wpcom/changelog/update-newspack-blocks @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Newspack blocks: Updated from 3.5 to 4.0.1 diff --git a/projects/packages/jetpack-mu-wpcom/package.json b/projects/packages/jetpack-mu-wpcom/package.json index 3af1d4f0ea8d4..4c572f2a9a109 100644 --- a/projects/packages/jetpack-mu-wpcom/package.json +++ b/projects/packages/jetpack-mu-wpcom/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@automattic/jetpack-mu-wpcom", - "version": "5.59.1-alpha", + "version": "5.59.0", "description": "Enhances your site with features powered by WordPress.com", "homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/packages/jetpack-mu-wpcom/#readme", "bugs": { @@ -23,7 +23,7 @@ "clean": "rm -rf src/build/", "watch": "pnpm run build-production-js && pnpm webpack watch", "e2e-tests": "playwright test --config src/features/verbum-comments/playwright.config.ts", - "sync:newspack-blocks": "./bin/sync-newspack-blocks.sh --release=v3.5.0" + "sync:newspack-blocks": "./bin/sync-newspack-blocks.sh" }, "optionalDependencies": { "react": "^18.2.0", diff --git a/projects/packages/jetpack-mu-wpcom/src/class-jetpack-mu-wpcom.php b/projects/packages/jetpack-mu-wpcom/src/class-jetpack-mu-wpcom.php index d80e6d8d5933a..4144312a48b3c 100644 --- a/projects/packages/jetpack-mu-wpcom/src/class-jetpack-mu-wpcom.php +++ b/projects/packages/jetpack-mu-wpcom/src/class-jetpack-mu-wpcom.php @@ -15,7 +15,7 @@ * Jetpack_Mu_Wpcom main class. */ class Jetpack_Mu_Wpcom { - const PACKAGE_VERSION = '5.59.1-alpha'; + const PACKAGE_VERSION = '5.59.0'; const PKG_DIR = __DIR__ . '/../'; const BASE_DIR = __DIR__ . '/'; const BASE_FILE = __FILE__; diff --git a/projects/packages/jetpack-mu-wpcom/src/common/tour-kit/hooks/use-keydown-handler.ts b/projects/packages/jetpack-mu-wpcom/src/common/tour-kit/hooks/use-keydown-handler.ts index 6ea129fe08f2e..1cdf93219b40e 100644 --- a/projects/packages/jetpack-mu-wpcom/src/common/tour-kit/hooks/use-keydown-handler.ts +++ b/projects/packages/jetpack-mu-wpcom/src/common/tour-kit/hooks/use-keydown-handler.ts @@ -20,13 +20,22 @@ const useKeydownHandler = ( { onEscape, onArrowRight, onArrowLeft }: Props ): vo switch ( event.key ) { case 'Escape': - onEscape && ( onEscape(), ( handled = true ) ); + if ( onEscape ) { + onEscape(); + handled = true; + } break; case 'ArrowRight': - onArrowRight && ( onArrowRight(), ( handled = true ) ); + if ( onArrowRight ) { + onArrowRight(); + handled = true; + } break; case 'ArrowLeft': - onArrowLeft && ( onArrowLeft(), ( handled = true ) ); + if ( onArrowLeft ) { + onArrowLeft(); + handled = true; + } break; default: break; diff --git a/projects/packages/jetpack-mu-wpcom/src/features/custom-css/custom-css/js/core-customizer-css-preview.js b/projects/packages/jetpack-mu-wpcom/src/features/custom-css/custom-css/js/core-customizer-css-preview.js index 51bf49d713f2a..b4b702e369cd4 100644 --- a/projects/packages/jetpack-mu-wpcom/src/features/custom-css/custom-css/js/core-customizer-css-preview.js +++ b/projects/packages/jetpack-mu-wpcom/src/features/custom-css/custom-css/js/core-customizer-css-preview.js @@ -20,7 +20,7 @@ // Sass or Less require Partial -- so ajax call to get it from PHP. // We can explicitly override for specific providers by testing if `'sass' === preprocessor` - if ( jpCustomizerCssPreview.preprocessors.hasOwnProperty( preprocessor ) ) { + if ( Object.hasOwn( jpCustomizerCssPreview.preprocessors, preprocessor ) ) { return api.selectiveRefresh.Partial.prototype.refresh.call( partial ); } diff --git a/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/README.md b/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/README.md index 8e5e8295c9961..a4cc12220990b 100644 --- a/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/README.md +++ b/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/README.md @@ -36,10 +36,17 @@ Once your changes land on the Newspack side, coordinate with the team (over issu While being in `projects/packages/jetpack-mu-wpcom` directory, you can run: ``` -pnpm run sync:newspack-blocks +pnpm run sync:newspack-blocks --release= ``` -This will pull the code from the release and integrate it into this repository. Please review changes, make sure to update `NEWSPACK_BLOCKS__VERSION` in [index.php](./index.php) and commit. +This will pull the code from the release and integrate it into this repository. Please: + 1. Review changes + 2. Keep the PHPCS config if still necessary + 3. Ensure [htmlentities uses ENT_COMPAT](https://github.com/Automattic/jetpack/pull/38873/commits/16f57e6f01b6eed98a19cd0299261ce5ac075b8e) + 4. Update the phan baseline with `jetpack phan --update-baseline packages/jetpack-mu-wpcom` + 4. Update `NEWSPACK_BLOCKS__VERSION` in [index.php](./index.php) + 5. Ensure that the blocks `block.json` has `"textdomain": "jetpack-mu-wpcom"` + 6. Commit. ### Local development diff --git a/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/index.php b/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/index.php index 2e2e00fe77ca9..83bbe4855c5d9 100644 --- a/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/index.php +++ b/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/index.php @@ -11,6 +11,7 @@ define( 'NEWSPACK_BLOCKS__BLOCKS_DIRECTORY', Jetpack_Mu_Wpcom::BASE_DIR . 'build/' ); define( 'NEWSPACK_BLOCKS__PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); +define( 'NEWSPACK_BLOCKS__VERSION', '4.0.1' ); require_once __DIR__ . '/../../utils.php'; require_once __DIR__ . '/synced-newspack-blocks/class-newspack-blocks.php'; diff --git a/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/blocks/carousel/create-swiper.js b/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/blocks/carousel/create-swiper.js index 949b9390d42f8..151b9a0000201 100644 --- a/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/blocks/carousel/create-swiper.js +++ b/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/blocks/carousel/create-swiper.js @@ -62,8 +62,8 @@ function deactivateSlide( slide ) { * @param {Element} els.play - Play button element * @param {Element} els.pause - Pause button element * @param {Element} els.pagination - Pagination element - * @param {object} config - Swiper config - * @returns {object} Swiper instance + * @param {Object} config - Swiper config + * @return {Object} Swiper instance */ export default function createSwiper( els, config = {} ) { const isVisible = 0 < els.container.offsetWidth && 0 < els.container.offsetHeight; diff --git a/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/blocks/carousel/edit.js b/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/blocks/carousel/edit.js index b4f9fecd3a6da..c4a066ae61f1f 100644 --- a/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/blocks/carousel/edit.js +++ b/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/blocks/carousel/edit.js @@ -238,8 +238,8 @@ class Edit extends Component { ]; return ( - -
+ ( +
{ hasNoPosts && (
@@ -365,7 +365,7 @@ class Edit extends Component { ) }
- + { postsToShow && ( @@ -570,8 +570,8 @@ class Edit extends Component { - - ); + ) + ); } } diff --git a/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/blocks/carousel/editor.scss b/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/blocks/carousel/editor.scss index c2ffad27ea966..4cb2594373e8d 100644 --- a/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/blocks/carousel/editor.scss +++ b/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/blocks/carousel/editor.scss @@ -1,4 +1,4 @@ -@use '../../shared/sass/placeholder'; +@use "../../shared/sass/placeholder"; .wp-block-newspack-blocks-carousel { .swiper-wrapper { @@ -14,7 +14,7 @@ &:active, &:focus, &:hover { - color: rgba( 255, 255, 255, 0.75 ); + color: rgba(255, 255, 255, 0.75); } } .post-thumbnail img { diff --git a/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/blocks/carousel/view.scss b/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/blocks/carousel/view.scss index 3bb432c436eda..4679e48722ee0 100644 --- a/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/blocks/carousel/view.scss +++ b/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/blocks/carousel/view.scss @@ -1,7 +1,7 @@ -@use '../../shared/sass/variables'; -@use '../../shared/sass/mixins'; -@use '../../shared/sass/colors'; -@use '../../shared/sass/preview'; +@use "../../shared/sass/variables"; +@use "../../shared/sass/mixins"; +@use "../../shared/sass/colors"; +@use "../../shared/sass/preview"; .wp-block-newspack-blocks-carousel { position: relative; @@ -20,7 +20,7 @@ &:active, &:focus, &:hover { - color: rgba( 255, 255, 255, 0.75 ); + color: rgba(255, 255, 255, 0.75); } } .entry-title { @@ -53,7 +53,7 @@ } .entry-wrapper { bottom: 0; - background-color: rgba( black, 0.5 ); + background-color: rgba(black, 0.5); color: white; left: 0; padding: 1.5em; @@ -73,19 +73,19 @@ &:active, &:focus, &:hover { - color: rgba( 255, 255, 255, 0.75 ); + color: rgba(255, 255, 255, 0.75); } } } .entry-caption { - margin-top: var( --wp--preset--spacing--00, var( --wp--preset--spacing--20, 0.5rem ) ); + margin-top: var(--wp--preset--spacing--00, var(--wp--preset--spacing--20, 0.5rem)); width: 100%; figcaption { color: #fff; - font-size: var( --wp--preset--font-size--x-small, var( --newspack-theme-font-size-sm, 0.8em ) ); - line-height: var( --wp--custom--line-height--x-small, var( --newspack-theme-font-line-height-body, 1.6 ) ); + font-size: var(--wp--preset--font-size--x-small, var(--newspack-theme-font-size-sm, 0.8em)); + line-height: var(--wp--custom--line-height--x-small, var(--newspack-theme-font-line-height-body, 1.6)); a { font-weight: 400; @@ -127,7 +127,7 @@ bottom: 0; display: flex; flex-wrap: wrap; - height: calc( 1.5em + 12px ); + height: calc(1.5em + 12px); justify-content: center; padding: 0; position: relative; @@ -158,7 +158,7 @@ } } .swiper-button { - background-color: rgba( black, 0.5 ); + background-color: rgba(black, 0.5); background-position: center; background-repeat: no-repeat; background-size: 24px; @@ -173,10 +173,10 @@ width: 48px; &:focus, &:hover { - background-color: rgba( black, 0.75 ); + background-color: rgba(black, 0.75); } &:focus { - box-shadow: inset 0 0 0 2px rgba( black, 0.75 ), inset 0 0 0 4px white; + box-shadow: inset 0 0 0 2px rgba(black, 0.75), inset 0 0 0 4px white; outline: 0; } } @@ -200,16 +200,16 @@ content: none; } .swiper-button-next { - background-image: url( "data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%3E%3Cpath%20d='M5.88%204.12L13.76%2012l-7.88%207.88L8%2022l10-10L8%202z'%20fill='white'/%3E%3Cpath%20fill='none'%20d='M0 0h24v24H0z'/%3E%3C/svg%3E" ); + background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%3E%3Cpath%20d='M5.88%204.12L13.76%2012l-7.88%207.88L8%2022l10-10L8%202z'%20fill='white'/%3E%3Cpath%20fill='none'%20d='M0 0h24v24H0z'/%3E%3C/svg%3E"); left: auto; right: 1.5em; } .swiper-button-prev { - background-image: url( "data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%3E%3Cpath%20d='M18%204.12L10.12%2012%2018%2019.88%2015.88%2022l-10-10%2010-10z'%20fill='white'/%3E%3Cpath%20fill='none'%20d='M0 0h24v24H0z'/%3E%3C/svg%3E" ); + background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%3E%3Cpath%20d='M18%204.12L10.12%2012%2018%2019.88%2015.88%2022l-10-10%2010-10z'%20fill='white'/%3E%3Cpath%20fill='none'%20d='M0 0h24v24H0z'/%3E%3C/svg%3E"); } .swiper-button-pause, .swiper-button-play { - background-image: url( "data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%3E%3Cpath%20d='M6%2019h4V5H6v14zm8-14v14h4V5h-4z'%20fill='white'/%3E%3Cpath%20d='M0%200h24v24H0z'%20fill='none'/%3E%3C/svg%3E" ); + background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%3E%3Cpath%20d='M6%2019h4V5H6v14zm8-14v14h4V5h-4z'%20fill='white'/%3E%3Cpath%20d='M0%200h24v24H0z'%20fill='none'/%3E%3C/svg%3E"); display: none; margin-top: 0; position: absolute; @@ -219,7 +219,7 @@ z-index: 9; } .swiper-button-play { - background-image: url( "data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%3E%3Cpath%20d='M8%205v14l11-7z'%20fill='white'/%3E%3Cpath%20d='M0 0h24v24H0z'%20fill='none'/%3E%3C/svg%3E" ); + background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%3E%3Cpath%20d='M8%205v14l11-7z'%20fill='white'/%3E%3Cpath%20d='M0 0h24v24H0z'%20fill='none'/%3E%3C/svg%3E"); } /* Swiper Slide */ @@ -248,7 +248,7 @@ flex-wrap: wrap; align-items: center; margin-top: 0.5em; - .byline:not( :last-child ) { + .byline:not(:last-child) { margin-right: 1.5em; } } @@ -369,7 +369,7 @@ &.plus-author { font-size: 0.9em; - &:not( :last-child ) { + &:not(:last-child) { margin-bottom: 0.5rem; } } diff --git a/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/blocks/homepage-articles/block.json b/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/blocks/homepage-articles/block.json index 0ea12f3d854fd..55143540cbf39 100644 --- a/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/blocks/homepage-articles/block.json +++ b/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/blocks/homepage-articles/block.json @@ -215,7 +215,9 @@ }, "postType": { "type": "array", - "default": [ "post" ], + "default": [ + "post" + ], "items": { "type": "string" } @@ -226,7 +228,9 @@ }, "includedPostStatuses": { "type": "array", - "default": [ "publish" ], + "default": [ + "publish" + ], "items": { "type": "string" } diff --git a/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/blocks/homepage-articles/class-wp-rest-newspack-articles-controller.php b/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/blocks/homepage-articles/class-wp-rest-newspack-articles-controller.php index 80d6d32d5bfad..d35a74895283f 100644 --- a/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/blocks/homepage-articles/class-wp-rest-newspack-articles-controller.php +++ b/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/blocks/homepage-articles/class-wp-rest-newspack-articles-controller.php @@ -144,7 +144,7 @@ public function get_items( $request ) { array_merge( $article_query_args, array( - 'post__not_in' => $exclude_ids, + 'post__not_in' => $exclude_ids, // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_post__not_in ) ) : array_merge( diff --git a/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/blocks/homepage-articles/edit.tsx b/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/blocks/homepage-articles/edit.tsx index e3a21c00c2b71..f0b03e754c1d1 100644 --- a/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/blocks/homepage-articles/edit.tsx +++ b/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/blocks/homepage-articles/edit.tsx @@ -1,4 +1,4 @@ -/* eslint-disable jsx-a11y/anchor-is-valid */ +/* eslint-disable jsx-a11y/anchor-is-valid, @typescript-eslint/no-explicit-any */ /** * Internal dependencies @@ -352,7 +352,6 @@ class Edit extends Component< HomepageArticlesProps > { return ( - { /* @ts-ignore */ } @@ -830,8 +829,6 @@ class Edit extends Component< HomepageArticlesProps > { export default compose( [ withColors( { textColor: 'color' } ), - // @ts-ignore withSelect( postsBlockSelector ), - // @ts-ignore withDispatch( postsBlockDispatch ), ] as any )( Edit ); diff --git a/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/blocks/homepage-articles/editor.scss b/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/blocks/homepage-articles/editor.scss index e5167864ab12f..f4641de9b2a97 100644 --- a/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/blocks/homepage-articles/editor.scss +++ b/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/blocks/homepage-articles/editor.scss @@ -1,7 +1,7 @@ -@use '../../shared/sass/variables'; -@use '../../shared/sass/placeholder'; -@use '../../shared/sass/colors'; -@use '../../shared/sass/mixins'; +@use "../../shared/sass/variables"; +@use "../../shared/sass/placeholder"; +@use "../../shared/sass/colors"; +@use "../../shared/sass/mixins"; .wpnbha { article .entry-title { @@ -50,7 +50,7 @@ &--disabled { position: relative; &::after { - content: ''; + content: ""; position: absolute; z-index: 2; width: 100%; diff --git a/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/blocks/homepage-articles/store.js b/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/blocks/homepage-articles/store.js index 31c06e32417b3..c3a009931f936 100644 --- a/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/blocks/homepage-articles/store.js +++ b/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/blocks/homepage-articles/store.js @@ -88,7 +88,7 @@ const createCacheKey = JSON.stringify; /** * Get posts for a single block. * - * @yields + * @yield * @param {object} block - an object with a postsQuery and a clientId */ function* getPostsForBlock( block ) { @@ -115,7 +115,7 @@ function* getPostsForBlock( block ) { * * @param {string} clientId * - * @returns {boolean} whether the block uses deduplication + * @return {boolean} whether the block uses deduplication */ function shouldDeduplicate( clientId ) { const { getBlock } = select( 'core/block-editor' ); @@ -127,7 +127,7 @@ const createFetchPostsSaga = blockNames => { /** * "worker" Saga: will be fired on REFLOW actions * - * @yields + * @yield */ function* fetchPosts() { // debounce by 300ms @@ -186,7 +186,7 @@ const createFetchPostsSaga = blockNames => { * if new reflow happens during this time, the reflow from before * will be cancelled. * - * @yields + * @yield */ return function* fetchPostsSaga() { yield takeLatest( 'REFLOW', fetchPosts ); diff --git a/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/blocks/homepage-articles/utils.ts b/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/blocks/homepage-articles/utils.ts index aa44608e741c6..cfeb040771de9 100644 --- a/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/blocks/homepage-articles/utils.ts +++ b/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/blocks/homepage-articles/utils.ts @@ -259,10 +259,7 @@ export const postsBlockSelector = ( isUIDisabled: isUIDisabled(), error: getError( { clientId } ), topBlocksClientIdsInOrder: blocks.map( block => block.clientId ), - latestPosts: isEditorBlock - ? getPosts( { clientId } ) - : // For block preview, display static content. - getPreviewPosts( attributes ), + latestPosts: isEditorBlock ? getPosts( { clientId } ) : getPreviewPosts( attributes ), // For block preview, display static content. }; return props; @@ -280,6 +277,7 @@ export const postsBlockDispatch = ( ) => { return { // Only editor blocks can trigger reflows. + // @ts-ignore It's a string. triggerReflow: isEditorBlock ? dispatch( STORE_NAMESPACE ).reflow : () => undefined, }; }; diff --git a/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/blocks/homepage-articles/view.scss b/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/blocks/homepage-articles/view.scss index b076fd36b7621..136a6bcf2ffba 100644 --- a/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/blocks/homepage-articles/view.scss +++ b/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/blocks/homepage-articles/view.scss @@ -1,6 +1,6 @@ -@use '../../shared/sass/variables'; -@use '../../shared/sass/mixins'; -@use '../../shared/sass/preview'; +@use "../../shared/sass/variables"; +@use "../../shared/sass/mixins"; +@use "../../shared/sass/preview"; :root { --wpnbha-col-gap: 1em; @@ -62,7 +62,7 @@ display: flex; flex-flow: row wrap; justify-content: flex-start; - gap: var( --wpnbha-col-gap ); + gap: var(--wpnbha-col-gap); padding: 0; list-style: none; } @@ -73,7 +73,7 @@ } .article-section-title { - margin-bottom: calc( 1em - var( --wpnbha-col-gap ) ); + margin-bottom: calc(1em - var(--wpnbha-col-gap)); } } @@ -81,24 +81,24 @@ // width of column - ( column gap / number of columns * number of gaps ) &.columns-3 article, &.columns-6 article { - flex-basis: calc( 33.33% - ( var( --wpnbha-col-gap ) / 3 * 2 ) - 0.1px ); + flex-basis: calc(33.33% - ( var(--wpnbha-col-gap) / 3 * 2 ) - 0.1px); } &.is-style-borders.columns-3 article, &.is-style-borders.columns-6 article { - flex-basis: calc( 33.33% - ( 2 * var( --wpnbha-col-gap ) / 3 * 2 ) - 1.1px ); + flex-basis: calc(33.33% - ( 2 * var(--wpnbha-col-gap) / 3 * 2 ) - 1.1px); } &.columns-2 article, &.columns-4 article, &.columns-5 article { - flex-basis: calc( 50% - ( var( --wpnbha-col-gap ) / 2 ) - 0.1px ); + flex-basis: calc(50% - ( var(--wpnbha-col-gap) / 2 ) - 0.1px); } &.is-style-borders.columns-2 article, &.is-style-borders.columns-4 article, &.is-style-borders.columns-5 article { - flex-basis: calc( 50% - ( 2 * var( --wpnbha-col-gap ) / 2 ) - 1.1px ); + flex-basis: calc(50% - ( 2 * var(--wpnbha-col-gap) / 2 ) - 1.1px); } &.columns-5 article:last-of-type, @@ -109,29 +109,29 @@ @include mixins.media( tablet ) { &.columns-4 article { - flex-basis: calc( 25% - ( var( --wpnbha-col-gap ) / 4 * 3 ) - 0.1px ); + flex-basis: calc(25% - ( var(--wpnbha-col-gap) / 4 * 3 ) - 0.1px); } &.is-style-borders.columns-4 article { - flex-basis: calc( 25% - ( 2 * var( --wpnbha-col-gap ) / 4 * 3 ) - 1.1px ); + flex-basis: calc(25% - ( 2 * var(--wpnbha-col-gap) / 4 * 3 ) - 1.1px); } &.columns-5 article, &.columns-5 article:last-of-type { - flex-basis: calc( 20% - ( var( --wpnbha-col-gap ) / 5 * 4 ) - 0.1px ); + flex-basis: calc(20% - ( var(--wpnbha-col-gap) / 5 * 4 ) - 0.1px); } &.is-style-borders.columns-5 article, &.is-style-borders.columns-5 article:last-of-type { - flex-basis: calc( 20% - ( 2 * var( --wpnbha-col-gap ) / 5 * 4 ) - 1.1px ); + flex-basis: calc(20% - ( 2 * var(--wpnbha-col-gap) / 5 * 4 ) - 1.1px); } &.columns-6 article { - flex-basis: calc( 16.6666% - ( var( --wpnbha-col-gap ) / 6 * 5 ) - 0.1px ); + flex-basis: calc(16.6666% - ( var(--wpnbha-col-gap) / 6 * 5 ) - 0.1px); } &.is-style-borders.columns-6 article { - flex-basis: calc( 16.6666% - ( 2 * var( --wpnbha-col-gap ) / 6 * 5 ) - 1.1px ); + flex-basis: calc(16.6666% - ( 2 * var(--wpnbha-col-gap) / 6 * 5 ) - 1.1px); } } @@ -239,7 +239,7 @@ } .entry-meta { - .byline:not( :last-child ) { + .byline:not(:last-child) { margin-right: 1.5em; } @@ -273,7 +273,7 @@ figcaption { color: inherit; } - .entry-meta span:not( .avatar ) { + .entry-meta span:not(.avatar) { opacity: 0.8; } } @@ -299,8 +299,8 @@ } &::after { - background: rgba( 0, 0, 0, 0.5 ); - content: ''; + background: rgba(0, 0, 0, 0.5); + content: ""; inset: 0; position: absolute; z-index: 1; @@ -331,7 +331,7 @@ bottom: 1em; /* autoprefixer: ignore next */ -webkit-box-orient: vertical; - color: rgba( white, 0.9 ); + color: rgba(white, 0.9); display: -webkit-box; font-style: italic; left: 0; @@ -348,7 +348,7 @@ a, a:visited { - color: #fff; + color: #fff; } @include mixins.media( desktop ) { @@ -450,11 +450,11 @@ text-align: inherit; } - .entry-date:not( :first-child ) { + .entry-date:not(:first-child) { margin-left: 1.5em; } - .entry-meta .byline:not( :last-child ) { + .entry-meta .byline:not(:last-child) { margin: 0; } } @@ -492,7 +492,7 @@ &.plus-author { font-size: 0.9em; - &:not( :last-child ) { + &:not(:last-child) { margin-bottom: 0.5rem; } } @@ -688,13 +688,13 @@ .wpnbha.is-style-borders { article { - border: solid rgba( 0, 0, 0, 0.2 ); + border: solid rgba(0, 0, 0, 0.2); border-width: 0 0 1px; box-sizing: content-box; padding-bottom: 1em; &:last-of-type { - &:not( :first-of-type ) { + &:not(:first-of-type) { border-bottom: 0; padding-right: 0; } @@ -710,19 +710,19 @@ &.columns-2, &.columns-4, &.columns-5 { - article:nth-of-type( odd ):not( :last-of-type ) { + article:nth-of-type(odd):not(:last-of-type) { border-width: 0 1px 0 0; - padding-right: var( --wpnbha-col-gap ); + padding-right: var(--wpnbha-col-gap); } } &.columns-3, &.columns-6 { article { - &:nth-of-type( 3n + 1 ):not( :last-of-type ), - &:nth-of-type( 3n + 2 ):not( :last-of-type ) { + &:nth-of-type(3n + 1):not(:last-of-type), + &:nth-of-type(3n + 2):not(:last-of-type) { border-width: 0 1px 0 0; - padding-right: var( --wpnbha-col-gap ); + padding-right: var(--wpnbha-col-gap); } } } @@ -732,17 +732,17 @@ &.is-grid { article { border-width: 0 1px 0 0; - padding-right: var( --wpnbha-col-gap ); + padding-right: var(--wpnbha-col-gap); } } &.is-grid article:last-of-type, &.columns-1 article, - &.columns-2 article:nth-of-type( 2n ), - &.columns-3 article:nth-of-type( 3n ), - &.columns-4 article:nth-of-type( 4n ), - &.columns-5 article:nth-of-type( 5n ), - &.columns-6 article:nth-of-type( 6n ) { + &.columns-2 article:nth-of-type(2n), + &.columns-3 article:nth-of-type(3n), + &.columns-4 article:nth-of-type(4n), + &.columns-5 article:nth-of-type(5n), + &.columns-6 article:nth-of-type(6n) { border: 0; padding-right: 0; } @@ -751,9 +751,9 @@ @keyframes wpnbha-loading-animation { from { - transform: rotate( 0deg ); + transform: rotate(0deg); } to { - transform: rotate( 360deg ); + transform: rotate(360deg); } -} \ No newline at end of file +} diff --git a/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/class-newspack-blocks-api.php b/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/class-newspack-blocks-api.php index 272e427da3ece..2d1a428d213fe 100644 --- a/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/class-newspack-blocks-api.php +++ b/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/class-newspack-blocks-api.php @@ -254,7 +254,7 @@ public static function posts_endpoint( $request ) { $args = Newspack_Blocks::build_articles_query( $attributes, apply_filters( 'newspack_blocks_block_name', 'newspack-blocks/homepage-articles' ) ); if ( $attributes['exclude'] && count( $attributes['exclude'] ) ) { - $args['post__not_in'] = $attributes['exclude']; + $args['post__not_in'] = $attributes['exclude']; // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_post__not_in } if ( $attributes['include'] && count( $attributes['include'] ) ) { diff --git a/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/class-newspack-blocks.php b/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/class-newspack-blocks.php index 8427ae469a907..2685df500ef0f 100644 --- a/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/class-newspack-blocks.php +++ b/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/class-newspack-blocks.php @@ -611,21 +611,22 @@ public static function build_articles_query( $attributes, $block_name ) { 'is_newspack_query' => true, ); if ( $specific_mode && $specific_posts ) { - $args['nopaging'] = true; - $args['post__in'] = $specific_posts; - $args['orderby'] = 'post__in'; + $args['posts_per_page'] = count( $specific_posts ); + $args['post__in'] = $specific_posts; + $args['orderby'] = 'post__in'; } else { $args['posts_per_page'] = $posts_to_show; if ( ! self::should_deduplicate_block( $attributes ) ) { - $args['post__not_in'] = array( get_the_ID() ); + $args['post__not_in'] = array( get_the_ID() ); // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_post__not_in } else { if ( count( $newspack_blocks_all_specific_posts_ids ) ) { - $args['post__not_in'] = $newspack_blocks_all_specific_posts_ids; + $args['post__not_in'] = $newspack_blocks_all_specific_posts_ids; // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_post__not_in } - $args['post__not_in'] = array_merge( + $current_post_id = get_the_ID(); + $args['post__not_in'] = array_merge( // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_post__not_in $args['post__not_in'] ?? array(), array_keys( $newspack_blocks_post_id ), - get_the_ID() ? array( get_the_ID() ) : array() + is_singular() && $current_post_id ? array( $current_post_id ) : array() ); } if ( $categories && count( $categories ) ) { diff --git a/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/components/autocomplete-tokenfield.js b/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/components/autocomplete-tokenfield.js index d246693388bcf..08dd060acf04f 100644 --- a/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/components/autocomplete-tokenfield.js +++ b/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/components/autocomplete-tokenfield.js @@ -69,7 +69,7 @@ class AutocompleteTokenField extends Component { * Get a list of labels for input values. * * @param {Array} values - Array of values (ids, etc.). - * @returns {Array} array of valid labels corresponding to the values. + * @return {Array} array of valid labels corresponding to the values. */ getLabelsForValues( values ) { const { validValues } = this.state; @@ -84,7 +84,7 @@ class AutocompleteTokenField extends Component { * Get a list of values for input labels. * * @param {Array} labels - Array of labels from the tokens. - * @returns {Array} Array of valid values corresponding to the labels. + * @return {Array} Array of valid values corresponding to the labels. */ getValuesForLabels( labels ) { const { validValues } = this.state; @@ -159,7 +159,7 @@ class AutocompleteTokenField extends Component { /** * To populate the tokens, we need to convert the values into a human-readable label. * - * @returns {Array} An array of token label strings. + * @return {Array} An array of token label strings. */ getTokens() { const { tokens } = this.props; diff --git a/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/components/query-controls.js b/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/components/query-controls.js index 6de5172bf4098..8541c8cfe3f98 100644 --- a/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/components/query-controls.js +++ b/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/components/query-controls.js @@ -252,147 +252,145 @@ class QueryControls extends Component { return tax ? tax.terms : []; }; - return ( - <> - { enableSpecific && ( - - ) } - { specificMode ? ( - - ) : ( - <> - - { onAuthorsChange && ( - - ) } - { onCategoriesChange && ( - - ) } - { onIncludeSubcategoriesChange && ( - - ) } - { onTagsChange && ( - - ) } - { onCustomTaxonomiesChange && - registeredCustomTaxonomies.map( tax => ( - { - customTaxonomiesPrepareChange( - customTaxonomies, - onCustomTaxonomiesChange, - tax.slug, - value - ); - } } - fetchSuggestions={ search => - this.fetchCustomTaxonomiesSuggestions( tax.slug, search ) - } - fetchSavedInfo={ termIds => this.fetchSavedCustomTaxonomies( tax.slug, termIds ) } - label={ tax.label } - /> - ) ) } - { onTagExclusionsChange && ( -

- -

- ) } - { showAdvancedFilters && ( - <> - { onTagExclusionsChange && ( - - ) } - { onCategoryExclusionsChange && ( - - ) } - { registeredCustomTaxonomies && - onCustomTaxonomyExclusionsChange && - registeredCustomTaxonomies.map( ( { label, slug } ) => ( - this.fetchSavedCustomTaxonomies( slug, termIds ) } - fetchSuggestions={ search => - this.fetchCustomTaxonomiesSuggestions( slug, search ) - } - key={ `${ slug }-exclusions-selector` } - label={ sprintf( - // translators: %s is the custom taxonomy label. - __( 'Excluded %s', 'jetpack-mu-wpcom' ), - label - ) } - onChange={ value => - customTaxonomiesPrepareChange( - customTaxonomyExclusions, - onCustomTaxonomyExclusionsChange, - slug, - value - ) - } - tokens={ getTermsOfCustomTaxonomy( customTaxonomyExclusions, slug ) } - /> - ) ) } - - ) } - - ) } - - ); + return (<> + { enableSpecific && ( + + ) } + { specificMode ? ( + + ) : ( + <> + + { onAuthorsChange && ( + + ) } + { onCategoriesChange && ( + + ) } + { onIncludeSubcategoriesChange && ( + + ) } + { onTagsChange && ( + + ) } + { onCustomTaxonomiesChange && + registeredCustomTaxonomies.map( tax => ( + { + customTaxonomiesPrepareChange( + customTaxonomies, + onCustomTaxonomiesChange, + tax.slug, + value + ); + } } + fetchSuggestions={ search => + this.fetchCustomTaxonomiesSuggestions( tax.slug, search ) + } + fetchSavedInfo={ termIds => this.fetchSavedCustomTaxonomies( tax.slug, termIds ) } + label={ tax.label } + /> + ) ) } + { onTagExclusionsChange && ( +

+ +

+ ) } + { showAdvancedFilters && ( + <> + { onTagExclusionsChange && ( + + ) } + { onCategoryExclusionsChange && ( + + ) } + { registeredCustomTaxonomies && + onCustomTaxonomyExclusionsChange && + registeredCustomTaxonomies.map( ( { label, slug } ) => ( + this.fetchSavedCustomTaxonomies( slug, termIds ) } + fetchSuggestions={ search => + this.fetchCustomTaxonomiesSuggestions( slug, search ) + } + key={ `${ slug }-exclusions-selector` } + label={ sprintf( + // translators: %s is the custom taxonomy label. + __( 'Excluded %s', 'jetpack-mu-wpcom' ), + label + ) } + onChange={ value => + customTaxonomiesPrepareChange( + customTaxonomyExclusions, + onCustomTaxonomyExclusionsChange, + slug, + value + ) + } + tokens={ getTermsOfCustomTaxonomy( customTaxonomyExclusions, slug ) } + /> + ) ) } + + ) } + + ) } + ); }; } diff --git a/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/package.json b/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/package.json index 629794205e3ae..fe0b1adffe4a3 100644 --- a/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/package.json +++ b/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/package.json @@ -1,58 +1,58 @@ { "name": "@automattic/newspack-blocks", - "version": "3.5.0", + "version": "4.0.1", "author": "Automattic", "devDependencies": { - "@rushstack/eslint-patch": "^1.10.3", - "@testing-library/dom": "^10.2.0", + "@rushstack/eslint-patch": "^1.10.4", + "@testing-library/dom": "^10.4.0", "@testing-library/user-event": "^14.5.2", - "@types/lodash": "^4.17.5", - "@types/lodash.debounce": "^4.0.9", - "eslint": "^7.32.0", + "@types/lodash": "^4.17.7", + "@wordpress/browserslist-config": "^6.0.0", + "eslint": "^8.57.0", "fetch-mock-jest": "^1.5.1", "html-entities": "^2.5.2", "identity-obj-proxy": "^3.0.0", "lint-staged": "^15.2.7", - "newspack-scripts": "^5.5.1", - "postcss-scss": "^4.0.9", - "prettier": "npm:wp-prettier@^2.6.2-beta-1", - "stylelint": "^15.11.0" + "newspack-components": "^3.0.0", + "newspack-scripts": "^5.5.2", + "postcss-scss": "^4.0.9" }, "description": "=== Newspack Blocks === Contributors: (this should be a list of wordpress.org userid's) Donate link: https://example.com/ Tags: comments, spam Requires at least: 4.5 Tested up to: 5.1.1 Stable tag: 0.1.0 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html", "dependencies": { "classnames": "^2.5.1", - "lodash": "^4.17.21", - "newspack-components": "^2.2.1", - "react": "^17.0.2", - "redux": "^4.2.1", + "redux": "^5.0.0", "redux-saga": "^1.3.0", "regenerator-runtime": "^0.14.1", - "swiper": "11.1.4" + "swiper": "11.1.8" }, "scripts": { "cm": "newspack-scripts commit", "semantic-release": "newspack-scripts release --files=newspack-blocks.php", - "build": "newspack-scripts build", - "start": "npm ci && newspack-scripts watch", - "watch": "newspack-scripts watch", + "clean": "rm -rf dist", + "build": "npm run clean && newspack-scripts wp-scripts build", + "start": "npm ci --legacy-peer-deps && npm run watch", + "watch": "npm run clean && newspack-scripts wp-scripts start", "test": "newspack-scripts test", "lint": "npm run lint:scss && npm run lint:js", - "lint:js": "eslint 'src/**/*.{js,jsx,ts,tsx}'", - "lint:js:staged": "eslint --ext .js,.jsx,.ts,.tsx", + "lint:js": "newspack-scripts wp-scripts lint-js '**/{src,includes}/**/*.{js,jsx,ts,tsx}'", + "lint:js:staged": "newspack-scripts wp-scripts lint-js --ext .js,.jsx,.ts,.tsx", + "fix:js": "newspack-scripts wp-scripts lint-js --fix '**/{src,includes}/**/*.{js,jsx,ts,tsx}'", + "format:js": "newspack-scripts wp-scripts format '**/{src,includes}/**/*.{js,jsx,ts,tsx}'", + "lint:php": "./vendor/bin/phpcs", "lint:php:staged": "./vendor/bin/phpcs --filter=GitStaged", - "format:js": "prettier 'src/**/*.{js,jsx,ts,tsx}' --write", - "lint:scss": "stylelint '**/*.scss' --customSyntax postcss-scss --config=./node_modules/newspack-scripts/config/stylelint.config.js", - "format:scss": "prettier --write 'src/**/*.scss'", - "lint:scss:staged": "stylelint --customSyntax postcss-scss --config=./node_modules/newspack-scripts/config/stylelint.config.js", + "fix:php": "./vendor/bin/phpcbf", + "lint:scss": "newspack-scripts wp-scripts lint-style '**/{src,includes}/**/*.scss' --customSyntax postcss-scss", + "lint:scss:staged": "newspack-scripts wp-scripts lint-style --customSyntax postcss-scss", + "format:scss": "newspack-scripts wp-scripts lint-style '**/{src,includes}/**/*.scss' --customSyntax postcss-scss --fix", "i18n": "NODE_ENV=production npm run build; bash ./bin/update-translations.sh", "typescript:check": "newspack-scripts typescript-check", "release": "npm run build && npm run semantic-release", - "release:archive": "rm -rf release && mkdir -p release && rsync -r . ./release/newspack-blocks --exclude-from='./.distignore' && cd release && zip -r newspack-blocks.zip newspack-blocks", - "postinstall": "rm -rf node_modules/newspack-scripts/node_modules/prettier" + "release:archive": "rm -rf release && mkdir -p release && rsync -r . ./release/newspack-blocks --exclude-from='./.distignore' && cd release && zip -r newspack-blocks.zip newspack-blocks" }, "lint-staged": { "*.scss": "npm run lint:scss:staged", "*.(js|jsx)": "npm run lint:js:staged", + "*.(ts|tsx)": "npm run typescript:check", "*.php": "npm run lint:php:staged" }, "repository": { @@ -62,5 +62,8 @@ "license": "GPL-3.0-or-later", "bugs": { "url": "https://github.com/Automattic/newspack-blocks/issues" + }, + "overrides": { + "path-to-regexp": "1.7.0" } } diff --git a/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/shared/sass/_colors.scss b/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/shared/sass/_colors.scss index 520b5142c98f7..ad799c3dd9df1 100644 --- a/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/shared/sass/_colors.scss +++ b/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/shared/sass/_colors.scss @@ -7,20 +7,20 @@ $color__text-main: #111; $color__text-light: #767676; $color__text-input-focus: #111; $color__border: #ccc; -$color__error: #D63638; -$color__success: #008A20; +$color__error: #d63638; +$color__success: #008a20; $color__info: #dfdfdf; $color__gray: #757575; $color__gray-lighter: #f0f0f0; -$newspack-ui-color-neutral-0: #FFF; -$newspack-ui-color-neutral-5: #F7F7F7; -$newspack-ui-color-neutral-10: #F0F0F0; -$newspack-ui-color-neutral-20: #E0E0E0; -$newspack-ui-color-neutral-30: #DDD; -$newspack-ui-color-neutral-40: #CCC; +$newspack-ui-color-neutral-0: #fff; +$newspack-ui-color-neutral-5: #f7f7f7; +$newspack-ui-color-neutral-10: #f0f0f0; +$newspack-ui-color-neutral-20: #e0e0e0; +$newspack-ui-color-neutral-30: #ddd; +$newspack-ui-color-neutral-40: #ccc; $newspack-ui-color-neutral-50: #949494; -$newspack-ui-color-neutral-60: #6C6C6C; +$newspack-ui-color-neutral-60: #6c6c6c; $newspack-ui-color-neutral-70: #00000070; -$newspack-ui-color-neutral-80: #3E3E3E; -$newspack-ui-color-neutral-90: #1E1E1E; +$newspack-ui-color-neutral-80: #3e3e3e; +$newspack-ui-color-neutral-90: #1e1e1e; $newspack-ui-color-neutral-100: #000; diff --git a/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/shared/sass/_mixins.scss b/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/shared/sass/_mixins.scss index 26fcb874b199a..83b939f27c073 100644 --- a/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/shared/sass/_mixins.scss +++ b/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/shared/sass/_mixins.scss @@ -1,4 +1,4 @@ -@use './variables'; +@use "./variables"; @mixin media( $res ) { @if mobile == $res { @@ -37,6 +37,6 @@ height: 1px; width: 1px; overflow: hidden; - clip: rect( 1px, 1px, 1px, 1px ); + clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; /* added line */ } diff --git a/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/shared/sass/_placeholder.scss b/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/shared/sass/_placeholder.scss index 2465e8bb66610..c3f50d1f3cfb9 100644 --- a/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/shared/sass/_placeholder.scss +++ b/projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/shared/sass/_placeholder.scss @@ -1,4 +1,4 @@ -.wp-block[data-type^='newspack-blocks/'] { +.wp-block[data-type^="newspack-blocks/"] { .component-placeholder__align-center { align-items: center; } diff --git a/projects/packages/masterbar/changelog/try-no-version-bumps-in-trunk b/projects/packages/masterbar/changelog/try-no-version-bumps-in-trunk new file mode 100644 index 0000000000000..91efe85c55e06 --- /dev/null +++ b/projects/packages/masterbar/changelog/try-no-version-bumps-in-trunk @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Un-bump version numbers in trunk. The build will now update the version numbers as needed for mirrors. + + diff --git a/projects/packages/masterbar/package.json b/projects/packages/masterbar/package.json index 1a670a8a15865..c239558812d16 100644 --- a/projects/packages/masterbar/package.json +++ b/projects/packages/masterbar/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@automattic/jetpack-masterbar", - "version": "0.8.1-alpha", + "version": "0.8.0", "description": "The WordPress.com Toolbar feature replaces the default admin bar and offers quick links to the Reader, all your sites, your WordPress.com profile, and notifications.", "homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/packages/masterbar/#readme", "bugs": { diff --git a/projects/packages/masterbar/src/class-main.php b/projects/packages/masterbar/src/class-main.php index 0e6c5e8a1500b..21427bea3a753 100644 --- a/projects/packages/masterbar/src/class-main.php +++ b/projects/packages/masterbar/src/class-main.php @@ -14,7 +14,7 @@ */ class Main { - const PACKAGE_VERSION = '0.8.1-alpha'; + const PACKAGE_VERSION = '0.8.0'; /** * Initializer. diff --git a/projects/packages/my-jetpack/_inc/components/idc-modal/index.js b/projects/packages/my-jetpack/_inc/components/idc-modal/index.js index c3184daa30be8..75f61158b362c 100644 --- a/projects/packages/my-jetpack/_inc/components/idc-modal/index.js +++ b/projects/packages/my-jetpack/_inc/components/idc-modal/index.js @@ -16,7 +16,7 @@ function IDCModal() { return null; } - if ( ! window.hasOwnProperty( 'JP_IDENTITY_CRISIS__INITIAL_STATE' ) ) { + if ( ! Object.hasOwn( window, 'JP_IDENTITY_CRISIS__INITIAL_STATE' ) ) { return null; } diff --git a/projects/packages/my-jetpack/changelog/add-more-eslint-rules b/projects/packages/my-jetpack/changelog/add-more-eslint-rules new file mode 100644 index 0000000000000..2b32cb03e644c --- /dev/null +++ b/projects/packages/my-jetpack/changelog/add-more-eslint-rules @@ -0,0 +1,5 @@ +Significance: patch +Type: fixed +Comment: Fix new eslint sniffs. Should be no change in functionality. + + diff --git a/projects/packages/my-jetpack/changelog/try-no-version-bumps-in-trunk b/projects/packages/my-jetpack/changelog/try-no-version-bumps-in-trunk new file mode 100644 index 0000000000000..91efe85c55e06 --- /dev/null +++ b/projects/packages/my-jetpack/changelog/try-no-version-bumps-in-trunk @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Un-bump version numbers in trunk. The build will now update the version numbers as needed for mirrors. + + diff --git a/projects/packages/my-jetpack/package.json b/projects/packages/my-jetpack/package.json index 2b9094fdd102b..3735b0ac72a5d 100644 --- a/projects/packages/my-jetpack/package.json +++ b/projects/packages/my-jetpack/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@automattic/jetpack-my-jetpack", - "version": "4.33.1-alpha", + "version": "4.33.0", "description": "WP Admin page with information and configuration shared among all Jetpack stand-alone plugins", "homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/packages/my-jetpack/#readme", "bugs": { diff --git a/projects/packages/my-jetpack/src/class-initializer.php b/projects/packages/my-jetpack/src/class-initializer.php index 67a7ff1ee44a9..b0be741ad3c7b 100644 --- a/projects/packages/my-jetpack/src/class-initializer.php +++ b/projects/packages/my-jetpack/src/class-initializer.php @@ -42,7 +42,7 @@ class Initializer { * * @var string */ - const PACKAGE_VERSION = '4.33.1-alpha'; + const PACKAGE_VERSION = '4.33.0'; /** * HTML container ID for the IDC screen on My Jetpack page. diff --git a/projects/packages/plugin-deactivation/changelog/try-no-version-bumps-in-trunk b/projects/packages/plugin-deactivation/changelog/try-no-version-bumps-in-trunk new file mode 100644 index 0000000000000..91efe85c55e06 --- /dev/null +++ b/projects/packages/plugin-deactivation/changelog/try-no-version-bumps-in-trunk @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Un-bump version numbers in trunk. The build will now update the version numbers as needed for mirrors. + + diff --git a/projects/packages/plugin-deactivation/package.json b/projects/packages/plugin-deactivation/package.json index 788f7bfa7871b..7a21c67011c2c 100644 --- a/projects/packages/plugin-deactivation/package.json +++ b/projects/packages/plugin-deactivation/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@automattic/jetpack-plugin-deactivation", - "version": "0.2.2-alpha", + "version": "0.2.1", "description": "Intercept plugin deactivation with a dialog", "homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/packages/plugin-deactivation/#readme", "bugs": { diff --git a/projects/packages/plugin-deactivation/src/class-deactivation-handler.php b/projects/packages/plugin-deactivation/src/class-deactivation-handler.php index 90110343b772d..dd0ce7517c1be 100644 --- a/projects/packages/plugin-deactivation/src/class-deactivation-handler.php +++ b/projects/packages/plugin-deactivation/src/class-deactivation-handler.php @@ -21,7 +21,7 @@ class Deactivation_Handler { * * @var string */ - const PACKAGE_VERSION = '0.2.2-alpha'; + const PACKAGE_VERSION = '0.2.1'; /** * Slug of the plugin to intercept deactivation for. diff --git a/projects/packages/publicize/changelog/try-no-version-bumps-in-trunk b/projects/packages/publicize/changelog/try-no-version-bumps-in-trunk new file mode 100644 index 0000000000000..91efe85c55e06 --- /dev/null +++ b/projects/packages/publicize/changelog/try-no-version-bumps-in-trunk @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Un-bump version numbers in trunk. The build will now update the version numbers as needed for mirrors. + + diff --git a/projects/packages/publicize/package.json b/projects/packages/publicize/package.json index 9a80d121389ac..b417481070cd8 100644 --- a/projects/packages/publicize/package.json +++ b/projects/packages/publicize/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@automattic/jetpack-publicize", - "version": "0.50.1-alpha", + "version": "0.50.0", "description": "Publicize makes it easy to share your site’s posts on several social media networks automatically when you publish a new post.", "homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/packages/publicize/#readme", "bugs": { diff --git a/projects/packages/schema/changelog/try-no-version-bumps-in-trunk b/projects/packages/schema/changelog/try-no-version-bumps-in-trunk new file mode 100644 index 0000000000000..91efe85c55e06 --- /dev/null +++ b/projects/packages/schema/changelog/try-no-version-bumps-in-trunk @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Un-bump version numbers in trunk. The build will now update the version numbers as needed for mirrors. + + diff --git a/projects/packages/schema/src/class-schema.php b/projects/packages/schema/src/class-schema.php index 9e689099572d6..a5bb133d15fa5 100644 --- a/projects/packages/schema/src/class-schema.php +++ b/projects/packages/schema/src/class-schema.php @@ -65,7 +65,7 @@ * $parsed_data = $my_schema->parse($input_data); */ class Schema { - const PACKAGE_VERSION = '0.1.1-alpha'; + const PACKAGE_VERSION = '0.1.0'; public static function as_string() { return new Schema_Parser( new Type_String() ); diff --git a/projects/packages/search/changelog/add-more-eslint-rules b/projects/packages/search/changelog/add-more-eslint-rules new file mode 100644 index 0000000000000..2b32cb03e644c --- /dev/null +++ b/projects/packages/search/changelog/add-more-eslint-rules @@ -0,0 +1,5 @@ +Significance: patch +Type: fixed +Comment: Fix new eslint sniffs. Should be no change in functionality. + + diff --git a/projects/packages/search/changelog/fix-paid-requests-localization b/projects/packages/search/changelog/fix-paid-requests-localization new file mode 100644 index 0000000000000..7e14e4a1878d1 --- /dev/null +++ b/projects/packages/search/changelog/fix-paid-requests-localization @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +Search: Use the user's locale when formatting request limits. diff --git a/projects/packages/search/src/dashboard/components/pages/upsell-page/index.jsx b/projects/packages/search/src/dashboard/components/pages/upsell-page/index.jsx index 0f1f94230161c..8c5bd8bc74a01 100644 --- a/projects/packages/search/src/dashboard/components/pages/upsell-page/index.jsx +++ b/projects/packages/search/src/dashboard/components/pages/upsell-page/index.jsx @@ -3,6 +3,7 @@ import { Container, Col, PricingCard, + getUserLocale, AdminSectionHero, ProductPrice, PricingTable, @@ -155,7 +156,7 @@ const OldPricingComponent = ( { sendToCart } ) => { const NewPricingComponent = ( { sendToCartPaid, sendToCartFree } ) => { const siteDomain = useSelect( select => select( STORE_ID ).getCalypsoSlug(), [] ); - + const localeSlug = getUserLocale(); const priceBefore = useSelect( select => select( STORE_ID ).getPriceBefore() / 12, [] ); const priceAfter = useSelect( select => select( STORE_ID ).getPriceAfter() / 12, [] ); const priceCurrencyCode = useSelect( select => select( STORE_ID ).getPriceCurrencyCode(), [] ); @@ -166,7 +167,7 @@ const NewPricingComponent = ( { sendToCartPaid, sendToCartFree } ) => { const { hasConnectionError } = useConnectionErrorNotice(); const paidRecordsLimitRaw = useSelect( select => select( STORE_ID ).getPaidRecordsLimit(), [] ); - const paidRecordsLimit = new Intl.NumberFormat( 'en-US', { + const paidRecordsLimit = new Intl.NumberFormat( localeSlug, { notation: 'compact', compactDisplay: 'short', } ).format( paidRecordsLimitRaw ); @@ -176,14 +177,14 @@ const NewPricingComponent = ( { sendToCartPaid, sendToCartFree } ) => { const unlimitedText = __( 'Unlimited', 'jetpack-search-pkg' ); const paidRequestsLimit = hasUnlimitedRequests ? unlimitedText - : new Intl.NumberFormat( 'en-US', { + : new Intl.NumberFormat( localeSlug, { notation: 'compact', compactDisplay: 'short', } ).format( paidRequestsLimitRaw ); const unitPrice = useSelect( select => select( STORE_ID ).getAdditionalUnitPrice(), [] ); const unitQuantityRaw = useSelect( select => select( STORE_ID ).getAdditionalUnitQuantity(), [] ); - const unitQuantity = new Intl.NumberFormat( 'en-US', { + const unitQuantity = new Intl.NumberFormat( localeSlug, { notation: 'compact', compactDisplay: 'short', } ).format( unitQuantityRaw ); diff --git a/projects/packages/search/src/instant-search/components/search-filters.jsx b/projects/packages/search/src/instant-search/components/search-filters.jsx index ce9f773f54b42..599aef5498470 100644 --- a/projects/packages/search/src/instant-search/components/search-filters.jsx +++ b/projects/packages/search/src/instant-search/components/search-filters.jsx @@ -49,7 +49,7 @@ class SearchFilters extends Component { ); renderStaticFilterComponent = configuration => { - if ( configuration.hasOwnProperty( 'visible' ) && ! configuration.visible ) { + if ( Object.hasOwn( configuration, 'visible' ) && ! configuration.visible ) { return null; } diff --git a/projects/packages/search/src/instant-search/components/tabbed-search-filters.jsx b/projects/packages/search/src/instant-search/components/tabbed-search-filters.jsx index cbc990a5dbf06..ddaaea3f3b870 100644 --- a/projects/packages/search/src/instant-search/components/tabbed-search-filters.jsx +++ b/projects/packages/search/src/instant-search/components/tabbed-search-filters.jsx @@ -13,7 +13,7 @@ class TabbedSearchFilters extends Component { }; renderStaticFilterComponent = configuration => { - if ( configuration.hasOwnProperty( 'visible' ) && ! configuration.visible ) { + if ( Object.hasOwn( configuration, 'visible' ) && ! configuration.visible ) { return null; } diff --git a/projects/packages/stub-generator/changelog/try-no-version-bumps-in-trunk b/projects/packages/stub-generator/changelog/try-no-version-bumps-in-trunk new file mode 100644 index 0000000000000..91efe85c55e06 --- /dev/null +++ b/projects/packages/stub-generator/changelog/try-no-version-bumps-in-trunk @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Un-bump version numbers in trunk. The build will now update the version numbers as needed for mirrors. + + diff --git a/projects/packages/stub-generator/src/Application.php b/projects/packages/stub-generator/src/Application.php index faebc75a7e203..fab34334c2e40 100644 --- a/projects/packages/stub-generator/src/Application.php +++ b/projects/packages/stub-generator/src/Application.php @@ -28,7 +28,7 @@ */ class Application extends SingleCommandApplication { - const VERSION = '1.0.1-alpha'; + const VERSION = '1.0.0'; /** * Exit code to use. diff --git a/projects/packages/transport-helper/changelog/try-no-version-bumps-in-trunk b/projects/packages/transport-helper/changelog/try-no-version-bumps-in-trunk new file mode 100644 index 0000000000000..91efe85c55e06 --- /dev/null +++ b/projects/packages/transport-helper/changelog/try-no-version-bumps-in-trunk @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Un-bump version numbers in trunk. The build will now update the version numbers as needed for mirrors. + + diff --git a/projects/packages/transport-helper/package.json b/projects/packages/transport-helper/package.json index bf72ef83e6edc..11f05ef0bb7f0 100644 --- a/projects/packages/transport-helper/package.json +++ b/projects/packages/transport-helper/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@automattic/jetpack-transport-helper", - "version": "0.2.4-alpha", + "version": "0.2.3", "description": "Package to help transport server communication", "homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/packages/transport-helper/#readme", "bugs": { diff --git a/projects/packages/transport-helper/src/class-package-version.php b/projects/packages/transport-helper/src/class-package-version.php index c3df3c936cd38..0de17ee12d34f 100644 --- a/projects/packages/transport-helper/src/class-package-version.php +++ b/projects/packages/transport-helper/src/class-package-version.php @@ -16,7 +16,7 @@ */ class Package_Version { - const PACKAGE_VERSION = '0.2.4-alpha'; + const PACKAGE_VERSION = '0.2.3'; const PACKAGE_SLUG = 'transport-helper'; diff --git a/projects/packages/videopress/changelog/add-more-eslint-rules b/projects/packages/videopress/changelog/add-more-eslint-rules new file mode 100644 index 0000000000000..2b32cb03e644c --- /dev/null +++ b/projects/packages/videopress/changelog/add-more-eslint-rules @@ -0,0 +1,5 @@ +Significance: patch +Type: fixed +Comment: Fix new eslint sniffs. Should be no change in functionality. + + diff --git a/projects/packages/videopress/src/client/block-editor/blocks/video/components/player/index.tsx b/projects/packages/videopress/src/client/block-editor/blocks/video/components/player/index.tsx index c60e8eba1c1f2..6c8ea329fc27e 100644 --- a/projects/packages/videopress/src/client/block-editor/blocks/video/components/player/index.tsx +++ b/projects/packages/videopress/src/client/block-editor/blocks/video/components/player/index.tsx @@ -160,7 +160,7 @@ export default function Player( { const { atTime, previewOnHover, previewAtTime, previewLoopDuration, type } = attributes.posterData; - let timeToSetPlayerPosition = undefined; + let timeToSetPlayerPosition; if ( type === 'video-frame' ) { if ( previewOnHover ) { timeToSetPlayerPosition = previewAtTime; diff --git a/projects/packages/videopress/src/client/utils/map-object-keys-to-camel-case/index.ts b/projects/packages/videopress/src/client/utils/map-object-keys-to-camel-case/index.ts index a09f114eeed67..095228d70f6f2 100644 --- a/projects/packages/videopress/src/client/utils/map-object-keys-to-camel-case/index.ts +++ b/projects/packages/videopress/src/client/utils/map-object-keys-to-camel-case/index.ts @@ -32,7 +32,7 @@ export function mapObjectKeysToCamel( originalObject, deleteOriginalProp = false const object = Object.assign( {}, originalObject ); for ( const key in object ) { - if ( object.hasOwnProperty( key ) && isSnake( key ) ) { + if ( Object.hasOwn( object, key ) && isSnake( key ) ) { object[ snakeToCamel( key ) ] = object[ key ]; if ( deleteOriginalProp ) { diff --git a/projects/packages/wp-js-data-sync/changelog/try-no-version-bumps-in-trunk b/projects/packages/wp-js-data-sync/changelog/try-no-version-bumps-in-trunk new file mode 100644 index 0000000000000..91efe85c55e06 --- /dev/null +++ b/projects/packages/wp-js-data-sync/changelog/try-no-version-bumps-in-trunk @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Un-bump version numbers in trunk. The build will now update the version numbers as needed for mirrors. + + diff --git a/projects/packages/wp-js-data-sync/composer.json b/projects/packages/wp-js-data-sync/composer.json index 97f6a0932c28d..b6aa57a611e3e 100644 --- a/projects/packages/wp-js-data-sync/composer.json +++ b/projects/packages/wp-js-data-sync/composer.json @@ -50,7 +50,7 @@ }, "autotagger": true, "branch-alias": { - "dev-trunk": "0.5.x-dev" + "dev-trunk": "0.4.x-dev" }, "textdomain": "jetpack-wp-js-data-sync", "version-constants": { diff --git a/projects/packages/wp-js-data-sync/package.json b/projects/packages/wp-js-data-sync/package.json index 9de91e647f6f1..d353e9fda8f41 100644 --- a/projects/packages/wp-js-data-sync/package.json +++ b/projects/packages/wp-js-data-sync/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@automattic/jetpack-wp-js-data-sync", - "version": "0.5.0-alpha", + "version": "0.4.5", "description": "A package to setup REST API and script localization to pass data to a JavaScript client.", "homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/packages/wp-js-data-sync/#readme", "bugs": { diff --git a/projects/packages/wp-js-data-sync/src/class-data-sync.php b/projects/packages/wp-js-data-sync/src/class-data-sync.php index 1f617de29a81f..d79aba54bcaf4 100644 --- a/projects/packages/wp-js-data-sync/src/class-data-sync.php +++ b/projects/packages/wp-js-data-sync/src/class-data-sync.php @@ -70,7 +70,7 @@ final class Data_Sync { - const PACKAGE_VERSION = '0.5.0-alpha'; + const PACKAGE_VERSION = '0.4.5'; /** * @var Registry diff --git a/projects/packages/yoast-promo/changelog/try-no-version-bumps-in-trunk b/projects/packages/yoast-promo/changelog/try-no-version-bumps-in-trunk new file mode 100644 index 0000000000000..91efe85c55e06 --- /dev/null +++ b/projects/packages/yoast-promo/changelog/try-no-version-bumps-in-trunk @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Un-bump version numbers in trunk. The build will now update the version numbers as needed for mirrors. + + diff --git a/projects/packages/yoast-promo/package.json b/projects/packages/yoast-promo/package.json index 7b029d450b023..c5cc17b1b9421 100644 --- a/projects/packages/yoast-promo/package.json +++ b/projects/packages/yoast-promo/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@automattic/jetpack-yoast-promo", - "version": "0.2.1-alpha", + "version": "0.2.0", "description": "Components used to promote Yoast as part of our collaboration", "homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/packages/yoast-promo/#readme", "bugs": { diff --git a/projects/packages/yoast-promo/src/class-yoast-promo.php b/projects/packages/yoast-promo/src/class-yoast-promo.php index fad517628aecc..a3a180a5d6d59 100644 --- a/projects/packages/yoast-promo/src/class-yoast-promo.php +++ b/projects/packages/yoast-promo/src/class-yoast-promo.php @@ -12,7 +12,7 @@ */ class Yoast_Promo { - const PACKAGE_VERSION = '0.2.1-alpha'; + const PACKAGE_VERSION = '0.2.0'; /** * Script handle for the JS file we enqueue in the post editor. diff --git a/projects/plugins/automattic-for-agencies-client/automattic-for-agencies-client.php b/projects/plugins/automattic-for-agencies-client/automattic-for-agencies-client.php index cf0ab2c28873a..bb7a70e835469 100644 --- a/projects/plugins/automattic-for-agencies-client/automattic-for-agencies-client.php +++ b/projects/plugins/automattic-for-agencies-client/automattic-for-agencies-client.php @@ -4,7 +4,7 @@ * Plugin Name: Automattic for Agencies Client * Plugin URI: https://wordpress.org/plugins/automattic-for-agencies-client * Description: Securely connect your clients’ sites to the Automattic for Agencies Sites Dashboard. Manage your sites from one place and see what needs attention. - * Version: 0.3.0-alpha + * Version: 0.2.1 * Author: Automattic * Author URI: https://automattic.com/for-agencies/ * License: GPLv2 or later diff --git a/projects/plugins/automattic-for-agencies-client/changelog/try-no-version-bumps-in-trunk b/projects/plugins/automattic-for-agencies-client/changelog/try-no-version-bumps-in-trunk new file mode 100644 index 0000000000000..91efe85c55e06 --- /dev/null +++ b/projects/plugins/automattic-for-agencies-client/changelog/try-no-version-bumps-in-trunk @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Un-bump version numbers in trunk. The build will now update the version numbers as needed for mirrors. + + diff --git a/projects/plugins/automattic-for-agencies-client/composer.json b/projects/plugins/automattic-for-agencies-client/composer.json index 9c9797f266fe8..902ead34da426 100644 --- a/projects/plugins/automattic-for-agencies-client/composer.json +++ b/projects/plugins/automattic-for-agencies-client/composer.json @@ -73,6 +73,6 @@ "automattic/jetpack-autoloader": true, "automattic/jetpack-composer-plugin": true }, - "autoloader-suffix": "c4802e05bbcf59fd3b6350e8d3e5482c_automattic_for_agencies_clientⓥ0_3_0_alpha" + "autoloader-suffix": "c4802e05bbcf59fd3b6350e8d3e5482c_automattic_for_agencies_clientⓥ0_2_1" } } diff --git a/projects/plugins/backup/changelog/try-no-version-bumps-in-trunk b/projects/plugins/backup/changelog/try-no-version-bumps-in-trunk new file mode 100644 index 0000000000000..91efe85c55e06 --- /dev/null +++ b/projects/plugins/backup/changelog/try-no-version-bumps-in-trunk @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Un-bump version numbers in trunk. The build will now update the version numbers as needed for mirrors. + + diff --git a/projects/plugins/backup/composer.json b/projects/plugins/backup/composer.json index 19ee4e581ea26..095b8ef28b795 100644 --- a/projects/plugins/backup/composer.json +++ b/projects/plugins/backup/composer.json @@ -34,7 +34,7 @@ "minimum-stability": "dev", "prefer-stable": true, "config": { - "autoloader-suffix": "9559eef123208b7d1b9c15b978567267_backupⓥ2_8_alpha", + "autoloader-suffix": "9559eef123208b7d1b9c15b978567267_backupⓥ2_7", "allow-plugins": { "automattic/jetpack-autoloader": true, "automattic/jetpack-composer-plugin": true diff --git a/projects/plugins/backup/jetpack-backup.php b/projects/plugins/backup/jetpack-backup.php index a5be4e6f37a2f..1b35b0b85515c 100644 --- a/projects/plugins/backup/jetpack-backup.php +++ b/projects/plugins/backup/jetpack-backup.php @@ -4,7 +4,7 @@ * Plugin Name: Jetpack VaultPress Backup * Plugin URI: https://jetpack.com/jetpack-backup * Description: Easily restore or download a backup of your site from a specific moment in time. - * Version: 2.8-alpha + * Version: 2.7 * Author: Automattic - Jetpack Backup team * Author URI: https://jetpack.com/ * License: GPLv2 or later diff --git a/projects/plugins/beta/changelog/try-no-version-bumps-in-trunk b/projects/plugins/beta/changelog/try-no-version-bumps-in-trunk new file mode 100644 index 0000000000000..91efe85c55e06 --- /dev/null +++ b/projects/plugins/beta/changelog/try-no-version-bumps-in-trunk @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Un-bump version numbers in trunk. The build will now update the version numbers as needed for mirrors. + + diff --git a/projects/plugins/beta/composer.json b/projects/plugins/beta/composer.json index 97d11702c35e1..ab4113a8b57f5 100644 --- a/projects/plugins/beta/composer.json +++ b/projects/plugins/beta/composer.json @@ -35,7 +35,7 @@ "prefer-stable": true, "config": { "sort-packages": true, - "autoloader-suffix": "567fa3f555de8fd218dfdc1688bb97b5_betaⓥ4_1_1_alpha", + "autoloader-suffix": "567fa3f555de8fd218dfdc1688bb97b5_betaⓥ4_1_0", "allow-plugins": { "automattic/jetpack-autoloader": true } diff --git a/projects/plugins/beta/jetpack-beta.php b/projects/plugins/beta/jetpack-beta.php index 135402d078468..a11a245568569 100644 --- a/projects/plugins/beta/jetpack-beta.php +++ b/projects/plugins/beta/jetpack-beta.php @@ -3,7 +3,7 @@ * Plugin Name: Jetpack Beta Tester * Plugin URI: https://jetpack.com/beta/ * Description: Use the Beta plugin to get a sneak peek at new features and test them on your site. - * Version: 4.1.1-alpha + * Version: 4.1.0 * Author: Automattic * Author URI: https://jetpack.com/ * Update URI: https://jetpack.com/download-jetpack-beta/ @@ -35,7 +35,7 @@ } define( 'JPBETA__PLUGIN_FOLDER', dirname( plugin_basename( __FILE__ ) ) ); -define( 'JPBETA_VERSION', '4.1.1-alpha' ); +define( 'JPBETA_VERSION', '4.1.0' ); define( 'JETPACK_BETA_PLUGINS_URL', 'https://betadownload.jetpack.me/plugins.json' ); diff --git a/projects/plugins/boost/app/modules/image-guide/src/index.ts b/projects/plugins/boost/app/modules/image-guide/src/index.ts index 60ac6042d6077..ac73bdb538e13 100644 --- a/projects/plugins/boost/app/modules/image-guide/src/index.ts +++ b/projects/plugins/boost/app/modules/image-guide/src/index.ts @@ -30,7 +30,7 @@ async function fetchWeightUsingProxy( url: string ): Promise< Response > { // If the JSON data contains the content length, create a new response object with the JSON headers and the original response body. const headers = new Headers(); for ( const key in json.data ) { - if ( json.data.hasOwnProperty( key ) ) { + if ( Object.hasOwn( json.data, key ) ) { headers.set( key, json.data[ key ] ); } } diff --git a/projects/plugins/boost/changelog/add-more-eslint-rules b/projects/plugins/boost/changelog/add-more-eslint-rules new file mode 100644 index 0000000000000..2b32cb03e644c --- /dev/null +++ b/projects/plugins/boost/changelog/add-more-eslint-rules @@ -0,0 +1,5 @@ +Significance: patch +Type: fixed +Comment: Fix new eslint sniffs. Should be no change in functionality. + + diff --git a/projects/plugins/boost/changelog/try-no-version-bumps-in-trunk b/projects/plugins/boost/changelog/try-no-version-bumps-in-trunk new file mode 100644 index 0000000000000..91efe85c55e06 --- /dev/null +++ b/projects/plugins/boost/changelog/try-no-version-bumps-in-trunk @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Un-bump version numbers in trunk. The build will now update the version numbers as needed for mirrors. + + diff --git a/projects/plugins/boost/composer.json b/projects/plugins/boost/composer.json index 10cb7ed01711d..7e31095e3bcd0 100644 --- a/projects/plugins/boost/composer.json +++ b/projects/plugins/boost/composer.json @@ -3,7 +3,7 @@ "description": "Boost your WordPress site's performance, from the creators of Jetpack", "type": "library", "license": "GPL-2.0-or-later", - "version": "3.4.8-alpha", + "version": "3.4.7", "authors": [ { "name": "Automattic, Inc.", @@ -74,7 +74,7 @@ "platform": { "ext-intl": "0.0.0" }, - "autoloader-suffix": "b1e77e6231d50e7663f84529b6a3dfda_jetpack_boostⓥ3_4_8_alpha", + "autoloader-suffix": "b1e77e6231d50e7663f84529b6a3dfda_jetpack_boostⓥ3_4_7", "allow-plugins": { "roots/wordpress-core-installer": true, "automattic/jetpack-autoloader": true, diff --git a/projects/plugins/boost/composer.lock b/projects/plugins/boost/composer.lock index 81b063e27864c..21a446b3cad8c 100644 --- a/projects/plugins/boost/composer.lock +++ b/projects/plugins/boost/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "771aea156b7717df00cf23fd962e044c", + "content-hash": "454eed89648b0b11d6701a5ce9cbe4dd", "packages": [ { "name": "automattic/jetpack-a8c-mc-stats", @@ -1866,7 +1866,7 @@ "dist": { "type": "path", "url": "../../packages/wp-js-data-sync", - "reference": "47509e3b3baaea36a0ae646e8054b742455361b0" + "reference": "0c37b41f53f82a21dfb1ba97d4aeaf90e37e1dc9" }, "require": { "automattic/jetpack-schema": "@dev", @@ -1888,7 +1888,7 @@ }, "autotagger": true, "branch-alias": { - "dev-trunk": "0.5.x-dev" + "dev-trunk": "0.4.x-dev" }, "textdomain": "jetpack-wp-js-data-sync", "version-constants": { diff --git a/projects/plugins/boost/jetpack-boost.php b/projects/plugins/boost/jetpack-boost.php index e192ea617e27d..c33a2a30e116a 100644 --- a/projects/plugins/boost/jetpack-boost.php +++ b/projects/plugins/boost/jetpack-boost.php @@ -9,7 +9,7 @@ * Plugin Name: Jetpack Boost * Plugin URI: https://jetpack.com/boost * Description: Boost your WordPress site's performance, from the creators of Jetpack - * Version: 3.4.8-alpha + * Version: 3.4.7 * Author: Automattic - Jetpack Site Speed team * Author URI: https://jetpack.com/boost/ * License: GPL-2.0+ @@ -29,7 +29,7 @@ die; } -define( 'JETPACK_BOOST_VERSION', '3.4.8-alpha' ); +define( 'JETPACK_BOOST_VERSION', '3.4.7' ); define( 'JETPACK_BOOST_SLUG', 'jetpack-boost' ); if ( ! defined( 'JETPACK_BOOST_CLIENT_NAME' ) ) { diff --git a/projects/plugins/boost/package.json b/projects/plugins/boost/package.json index f31639a28a006..d53bcd0bb6a18 100644 --- a/projects/plugins/boost/package.json +++ b/projects/plugins/boost/package.json @@ -1,6 +1,6 @@ { "name": "jetpack-boost", - "version": "3.4.8-alpha", + "version": "3.4.7", "description": "Boost your WordPress site's performance, from the creators of Jetpack", "directories": { "test": "tests" diff --git a/projects/plugins/boost/tests/e2e/specs/page-cache/page-cache.test.js b/projects/plugins/boost/tests/e2e/specs/page-cache/page-cache.test.js index c11a43f319288..4d5fda06826c2 100644 --- a/projects/plugins/boost/tests/e2e/specs/page-cache/page-cache.test.js +++ b/projects/plugins/boost/tests/e2e/specs/page-cache/page-cache.test.js @@ -58,7 +58,7 @@ test.describe( 'Cache module', () => { } expect( - response.headers().hasOwnProperty( 'X-Jetpack-Boost-Cache'.toLowerCase() ), + Object.hasOwn( response.headers(), 'X-Jetpack-Boost-Cache'.toLowerCase() ), 'Page Cache header should not be present' ).toBeFalsy(); } ); @@ -122,13 +122,13 @@ test.describe( 'Cache module', () => { // First visit should always be a miss. if ( totalVisits === 1 ) { expect( - responseHeaders.hasOwnProperty( cacheHeaderName ) && + Object.hasOwn( responseHeaders, cacheHeaderName ) && responseHeaders[ cacheHeaderName ] === 'miss', 'Page Cache header should be set to miss on first visit.' ).toBeTruthy(); } else { expect( - responseHeaders.hasOwnProperty( cacheHeaderName ) && + Object.hasOwn( responseHeaders, cacheHeaderName ) && responseHeaders[ cacheHeaderName ] === 'hit', 'Page Cache header should be set to hit on second visit.' ).toBeTruthy(); diff --git a/projects/plugins/crm/ZeroBSCRM.php b/projects/plugins/crm/ZeroBSCRM.php index 122609e38c0ef..510e48fecc161 100644 --- a/projects/plugins/crm/ZeroBSCRM.php +++ b/projects/plugins/crm/ZeroBSCRM.php @@ -3,7 +3,7 @@ * Plugin Name: Jetpack CRM * Plugin URI: https://jetpackcrm.com * Description: Jetpack CRM is the simplest CRM for WordPress. Self host your own Customer Relationship Manager using WP. - * Version: 6.4.5-alpha + * Version: 6.4.4 * Author: Automattic - Jetpack CRM team * Author URI: https://jetpackcrm.com * Text Domain: zero-bs-crm diff --git a/projects/plugins/crm/changelog/try-no-version-bumps-in-trunk b/projects/plugins/crm/changelog/try-no-version-bumps-in-trunk new file mode 100644 index 0000000000000..91efe85c55e06 --- /dev/null +++ b/projects/plugins/crm/changelog/try-no-version-bumps-in-trunk @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Un-bump version numbers in trunk. The build will now update the version numbers as needed for mirrors. + + diff --git a/projects/plugins/crm/composer.json b/projects/plugins/crm/composer.json index cd8b2ce1407df..353644f8509a1 100644 --- a/projects/plugins/crm/composer.json +++ b/projects/plugins/crm/composer.json @@ -42,7 +42,7 @@ ] }, "config": { - "autoloader-suffix": "06c775433a83ed276f0a1d8ac25f93ba_crmⓥ6_4_5_alpha", + "autoloader-suffix": "06c775433a83ed276f0a1d8ac25f93ba_crmⓥ6_4_4", "allow-plugins": { "automattic/jetpack-autoloader": true, "automattic/jetpack-composer-plugin": true, diff --git a/projects/plugins/crm/package.json b/projects/plugins/crm/package.json index 0a3c6b80e3d62..72b26f6339553 100644 --- a/projects/plugins/crm/package.json +++ b/projects/plugins/crm/package.json @@ -1,6 +1,6 @@ { "name": "@automattic/jetpack-crm", - "version": "6.4.5-alpha", + "version": "6.4.4", "description": "The CRM for WordPress", "author": "Automattic", "license": "GPL-2.0", diff --git a/projects/plugins/debug-helper/changelog/add-more-eslint-rules b/projects/plugins/debug-helper/changelog/add-more-eslint-rules new file mode 100644 index 0000000000000..b295a1d1a8826 --- /dev/null +++ b/projects/plugins/debug-helper/changelog/add-more-eslint-rules @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +Actually call `e.preventDefault()` in various 'click' handlers. diff --git a/projects/plugins/debug-helper/changelog/try-no-version-bumps-in-trunk b/projects/plugins/debug-helper/changelog/try-no-version-bumps-in-trunk new file mode 100644 index 0000000000000..91efe85c55e06 --- /dev/null +++ b/projects/plugins/debug-helper/changelog/try-no-version-bumps-in-trunk @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Un-bump version numbers in trunk. The build will now update the version numbers as needed for mirrors. + + diff --git a/projects/plugins/debug-helper/modules/inc/js/broken-token.js b/projects/plugins/debug-helper/modules/inc/js/broken-token.js index c716f3301ec54..29a865812a8d8 100644 --- a/projects/plugins/debug-helper/modules/inc/js/broken-token.js +++ b/projects/plugins/debug-helper/modules/inc/js/broken-token.js @@ -8,12 +8,12 @@ class BrokenToken { ); this.setCustomBlogTokenButton.addEventListener( 'click', e => { - e.preventDefault; + e.preventDefault(); this.displayEditBlogToken(); } ); this.cancelEditBlogTokenButton.addEventListener( 'click', e => { - e.preventDefault; + e.preventDefault(); this.cancelEditBlogToken(); } ); @@ -26,12 +26,12 @@ class BrokenToken { ); this.setCustomUserTokenButton.addEventListener( 'click', e => { - e.preventDefault; + e.preventDefault(); this.displayEditUserToken(); } ); this.cancelEditUserTokenButton.addEventListener( 'click', e => { - e.preventDefault; + e.preventDefault(); this.cancelEditUserToken(); } ); @@ -41,12 +41,12 @@ class BrokenToken { this.cancelEditBlogIDButton = document.getElementById( 'broken-token-cancel-edit-blog-id' ); this.setCustomBlogIDButton.addEventListener( 'click', e => { - e.preventDefault; + e.preventDefault(); this.displayEditBlogID(); } ); this.cancelEditBlogIDButton.addEventListener( 'click', e => { - e.preventDefault; + e.preventDefault(); this.cancelEditBlogID(); } ); } diff --git a/projects/plugins/debug-helper/plugin.php b/projects/plugins/debug-helper/plugin.php index bc90c8b493f4f..56754fe72d512 100644 --- a/projects/plugins/debug-helper/plugin.php +++ b/projects/plugins/debug-helper/plugin.php @@ -3,7 +3,7 @@ * Plugin Name: Jetpack Debug Tools * Description: Give me a Jetpack connection, and I'll break it every way possible. * Author: Automattic - Jetpack Crew - * Version: 2.1.0-alpha + * Version: 2.0.1 * Text Domain: jetpack * * @package automattic/jetpack-debug-helper. @@ -33,7 +33,7 @@ * The plugin version. * Increase that if you do any edits to ensure refreshing the cached assets. */ -define( 'JETPACK_DEBUG_HELPER_VERSION', '2.1.0-alpha' ); +define( 'JETPACK_DEBUG_HELPER_VERSION', '2.0.1' ); /** * Include file names from the modules directory here. diff --git a/projects/plugins/jetpack/_inc/client/components/jetpack-notices/index.jsx b/projects/plugins/jetpack/_inc/client/components/jetpack-notices/index.jsx index 808bdb3bc04f1..c70ecf81b2e3d 100644 --- a/projects/plugins/jetpack/_inc/client/components/jetpack-notices/index.jsx +++ b/projects/plugins/jetpack/_inc/client/components/jetpack-notices/index.jsx @@ -185,7 +185,8 @@ class JetpackNotices extends React.Component { this.state = { isMasterbarNoticeDismissed: cookieParsed && - cookieParsed.hasOwnProperty( + Object.hasOwn( + cookieParsed, 'jetpack_deprecate_dismissed[jetpack-masterbar-admin-removal-notice]' ) && '1' === @@ -209,7 +210,7 @@ class JetpackNotices extends React.Component { render() { const siteDataErrors = this.props.siteDataErrors.filter( error => - error.hasOwnProperty( 'action' ) + Object.hasOwn( error, 'action' ) ); const isUserConnectScreen = this.props.location.pathname.startsWith( '/connect-user' ); diff --git a/projects/plugins/jetpack/_inc/client/components/jetpack-notices/jetpack-connection-errors.jsx b/projects/plugins/jetpack/_inc/client/components/jetpack-notices/jetpack-connection-errors.jsx index 5175343774e08..0a73fbb68a955 100644 --- a/projects/plugins/jetpack/_inc/client/components/jetpack-notices/jetpack-connection-errors.jsx +++ b/projects/plugins/jetpack/_inc/client/components/jetpack-notices/jetpack-connection-errors.jsx @@ -56,7 +56,7 @@ export default class JetpackConnectionErrors extends React.Component { error.action, error.message, error.code, - error.hasOwnProperty( 'data' ) ? error.data : {}, + Object.hasOwn( error, 'data' ) ? error.data : {}, supportURl ); @@ -67,10 +67,10 @@ export default class JetpackConnectionErrors extends React.Component { render() { const errorsToDisplay = {}; - const errors = this.props.errors.filter( error => error.hasOwnProperty( 'action' ) ); + const errors = this.props.errors.filter( error => Object.hasOwn( error, 'action' ) ); for ( const error of errors ) { - if ( ! errorsToDisplay.hasOwnProperty( error.action ) ) { + if ( ! Object.hasOwn( errorsToDisplay, error.action ) ) { errorsToDisplay[ error.action ] = error; } } diff --git a/projects/plugins/jetpack/_inc/client/product-descriptions/index.jsx b/projects/plugins/jetpack/_inc/client/product-descriptions/index.jsx index c4fc3eb864be5..6c5134ada0ea2 100644 --- a/projects/plugins/jetpack/_inc/client/product-descriptions/index.jsx +++ b/projects/plugins/jetpack/_inc/client/product-descriptions/index.jsx @@ -24,7 +24,7 @@ const ProductDescriptions = props => { if ( ! isLoading ) { Object.values( SUPPORTED_PRODUCTS ).forEach( function ( key ) { - if ( ! products.hasOwnProperty( key ) ) { + if ( ! Object.hasOwn( products, key ) ) { return; } diff --git a/projects/plugins/jetpack/_inc/client/product-descriptions/product-description/index.jsx b/projects/plugins/jetpack/_inc/client/product-descriptions/product-description/index.jsx index a86bd48175946..57a41fa2f9f76 100644 --- a/projects/plugins/jetpack/_inc/client/product-descriptions/product-description/index.jsx +++ b/projects/plugins/jetpack/_inc/client/product-descriptions/product-description/index.jsx @@ -27,7 +27,7 @@ const getRelatedProductPlan = ( product, availableProductsAndPlans ) => { if ( isEmpty( product.includedInPlans ) || - ! availableProductsAndPlans.hasOwnProperty( upsellPlan ) || + ! Object.hasOwn( availableProductsAndPlans, upsellPlan ) || ! product.includedInPlans.includes( upsellPlan ) ) { return false; @@ -38,7 +38,7 @@ const getRelatedProductPlan = ( product, availableProductsAndPlans ) => { const renderProduct = ( product, offers, priority, hasRelatedPlan ) => { const illustration = - ! hasRelatedPlan && productIllustrations.hasOwnProperty( product.key ) + ! hasRelatedPlan && Object.hasOwn( productIllustrations, product.key ) ? productIllustrations[ product.key ] : undefined; let cta, icon; diff --git a/projects/plugins/jetpack/_inc/client/state/connection/reducer.js b/projects/plugins/jetpack/_inc/client/state/connection/reducer.js index 8e30ae1d751f0..3062aaff5c056 100644 --- a/projects/plugins/jetpack/_inc/client/state/connection/reducer.js +++ b/projects/plugins/jetpack/_inc/client/state/connection/reducer.js @@ -300,7 +300,7 @@ export function isConnectingUser( state ) { * @return {string|null} string if feature label exists, false otherwise. */ export function getConnectingUserFeatureLabel( state ) { - return state.jetpack.connection.requests.hasOwnProperty( 'connectingUserFeatureLabel' ) + return Object.hasOwn( state.jetpack.connection.requests, 'connectingUserFeatureLabel' ) ? state.jetpack.connection.requests.connectingUserFeatureLabel : null; } @@ -312,7 +312,7 @@ export function getConnectingUserFeatureLabel( state ) { * @return {string|null} string if "from" value exists, false otherwise. */ export function getConnectingUserFrom( state ) { - return state.jetpack.connection.requests.hasOwnProperty( 'connectingUserFrom' ) + return Object.hasOwn( state.jetpack.connection.requests, 'connectingUserFrom' ) ? state.jetpack.connection.requests.connectingUserFrom : null; } diff --git a/projects/plugins/jetpack/_inc/client/state/initial-state/reducer.js b/projects/plugins/jetpack/_inc/client/state/initial-state/reducer.js index d7a45a876e9bf..2ae0caf2a9f54 100644 --- a/projects/plugins/jetpack/_inc/client/state/initial-state/reducer.js +++ b/projects/plugins/jetpack/_inc/client/state/initial-state/reducer.js @@ -652,7 +652,7 @@ export function getInitialRecommendationsStep( state ) { */ export function getConnectionErrors( state ) { return get( state.jetpack.initialState, [ 'connectionStatus', 'errors' ], [] ).filter( error => - error.hasOwnProperty( 'action' ) + Object.hasOwn( error, 'action' ) ); } diff --git a/projects/plugins/jetpack/_inc/client/state/site/reducer.js b/projects/plugins/jetpack/_inc/client/state/site/reducer.js index edc49435cbe0d..d74135abe1cd5 100644 --- a/projects/plugins/jetpack/_inc/client/state/site/reducer.js +++ b/projects/plugins/jetpack/_inc/client/state/site/reducer.js @@ -167,14 +167,14 @@ export const errors = ( state = {}, action ) => { } return assign( {}, state, { - message: action.error.hasOwnProperty( 'response' ) + message: Object.hasOwn( action.error, 'response' ) ? action.error.response.message : defaultErrorMessage, action: resolveAction, - code: action.error.hasOwnProperty( 'response' ) + code: Object.hasOwn( action.error, 'response' ) ? action.error.response.code : 'fetch_site_data_fail_other', - data: action.error.hasOwnProperty( 'response' ) ? action.error.response.data : {}, + data: Object.hasOwn( action.error, 'response' ) ? action.error.response.data : {}, } ); default: return state; diff --git a/projects/plugins/jetpack/changelog/add-jetpack-ai-guidelines-link b/projects/plugins/jetpack/changelog/add-jetpack-ai-guidelines-link new file mode 100644 index 0000000000000..6b4e6ad90cacc --- /dev/null +++ b/projects/plugins/jetpack/changelog/add-jetpack-ai-guidelines-link @@ -0,0 +1,4 @@ +Significance: minor +Type: other + +AI Assistant: add AI Guidelines link to the AI Assistant sidebar panel diff --git a/projects/plugins/jetpack/changelog/add-more-eslint-rules b/projects/plugins/jetpack/changelog/add-more-eslint-rules new file mode 100644 index 0000000000000..0f8d7bc5efd93 --- /dev/null +++ b/projects/plugins/jetpack/changelog/add-more-eslint-rules @@ -0,0 +1,5 @@ +Significance: patch +Type: other +Comment: Fix new eslint sniffs. Should be no change in functionality. + + diff --git a/projects/plugins/jetpack/changelog/fix-install-instructions b/projects/plugins/jetpack/changelog/fix-install-instructions new file mode 100644 index 0000000000000..cf13959481ea3 --- /dev/null +++ b/projects/plugins/jetpack/changelog/fix-install-instructions @@ -0,0 +1,4 @@ +Significance: patch +Type: other + +Update Quick Start instructions diff --git a/projects/plugins/jetpack/changelog/try-no-version-bumps-in-trunk b/projects/plugins/jetpack/changelog/try-no-version-bumps-in-trunk new file mode 100644 index 0000000000000..12a34c0b4acba --- /dev/null +++ b/projects/plugins/jetpack/changelog/try-no-version-bumps-in-trunk @@ -0,0 +1,5 @@ +Significance: patch +Type: other +Comment: Un-bump version numbers in trunk. The build will now update the version numbers as needed for mirrors. + + diff --git a/projects/plugins/jetpack/changelog/update-contact-form-block-api b/projects/plugins/jetpack/changelog/update-contact-form-block-api new file mode 100644 index 0000000000000..98d3e28b9dc5a --- /dev/null +++ b/projects/plugins/jetpack/changelog/update-contact-form-block-api @@ -0,0 +1,4 @@ +Significance: patch +Type: other + +Button Block: update to Block API v3 diff --git a/projects/plugins/jetpack/changelog/update-jetpack-ai-add-fair-usage-message-on-extension-ai-control b/projects/plugins/jetpack/changelog/update-jetpack-ai-add-fair-usage-message-on-extension-ai-control new file mode 100644 index 0000000000000..729bf31f35b9b --- /dev/null +++ b/projects/plugins/jetpack/changelog/update-jetpack-ai-add-fair-usage-message-on-extension-ai-control @@ -0,0 +1,4 @@ +Significance: minor +Type: other + +Jetpack AI: support fair usage messaging on the Extension AI Control component. diff --git a/projects/plugins/jetpack/changelog/update-jetpack-ai-add-renewal-date-to-fair-usage-messaging b/projects/plugins/jetpack/changelog/update-jetpack-ai-add-renewal-date-to-fair-usage-messaging new file mode 100644 index 0000000000000..1f740b48e3724 --- /dev/null +++ b/projects/plugins/jetpack/changelog/update-jetpack-ai-add-renewal-date-to-fair-usage-messaging @@ -0,0 +1,4 @@ +Significance: patch +Type: other + +Jetpack AI: add usage policy link and renewal date to fair usage messaging. diff --git a/projects/plugins/jetpack/changelog/update-jetpack-ai-breve-a8c-dictionary b/projects/plugins/jetpack/changelog/update-jetpack-ai-breve-a8c-dictionary new file mode 100644 index 0000000000000..9c01f54e8372b --- /dev/null +++ b/projects/plugins/jetpack/changelog/update-jetpack-ai-breve-a8c-dictionary @@ -0,0 +1,4 @@ +Significance: patch +Type: other + +AI Assistant: Add A8c dictionary diff --git a/projects/plugins/jetpack/changelog/update-jetpack-ai-breve-add-to-dictionary-without-flickering b/projects/plugins/jetpack/changelog/update-jetpack-ai-breve-add-to-dictionary-without-flickering new file mode 100644 index 0000000000000..e6181dd6d8f45 --- /dev/null +++ b/projects/plugins/jetpack/changelog/update-jetpack-ai-breve-add-to-dictionary-without-flickering @@ -0,0 +1,4 @@ +Significance: patch +Type: other + +AI Assistant: Fix flickering when adding word to Breve dictionary diff --git a/projects/plugins/jetpack/changelog/update-notification-locale-source b/projects/plugins/jetpack/changelog/update-notification-locale-source new file mode 100644 index 0000000000000..b42711e0c5db4 --- /dev/null +++ b/projects/plugins/jetpack/changelog/update-notification-locale-source @@ -0,0 +1,4 @@ +Significance: patch +Type: other + +Notifications: Use profile locale to match menu language diff --git a/projects/plugins/jetpack/composer.json b/projects/plugins/jetpack/composer.json index 989f1ba911ff0..bada036b838f3 100644 --- a/projects/plugins/jetpack/composer.json +++ b/projects/plugins/jetpack/composer.json @@ -102,7 +102,7 @@ "platform": { "ext-intl": "0.0.0" }, - "autoloader-suffix": "f11009ded9fc4592b6a05b61ce272b3c_jetpackⓥ13_8_a_8", + "autoloader-suffix": "f11009ded9fc4592b6a05b61ce272b3c_jetpackⓥ13_8_a_7", "allow-plugins": { "automattic/jetpack-autoloader": true, "automattic/jetpack-composer-plugin": true diff --git a/projects/plugins/jetpack/extensions/blocks/ai-assistant/components/quota-exceeded-message/index.tsx b/projects/plugins/jetpack/extensions/blocks/ai-assistant/components/quota-exceeded-message/index.tsx index 7c3feca5a26e4..a7a8f17ce8e96 100644 --- a/projects/plugins/jetpack/extensions/blocks/ai-assistant/components/quota-exceeded-message/index.tsx +++ b/projects/plugins/jetpack/extensions/blocks/ai-assistant/components/quota-exceeded-message/index.tsx @@ -25,6 +25,62 @@ type QuotaExceededMessageProps = { }; const debug = debugFactory( 'jetpack-ai-assistant:upgrade-prompt' ); + +/** + * The fair usage notice message for the AI Assistant block. + * @return {ReactElement} the fair usage notice message, with the proper link and date. + */ +const useFairUsageNoticeMessage = () => { + const { usagePeriod } = useAiFeature(); + + const getFormattedUsagePeriodStartDate = planUsagePeriod => { + if ( ! planUsagePeriod?.nextStart ) { + return null; + } + + const nextUsagePeriodStartDate = new Date( planUsagePeriod.nextStart ); + return ( + nextUsagePeriodStartDate.toLocaleString( 'default', { month: 'long' } ) + + ' ' + + nextUsagePeriodStartDate.getDate() + ); + }; + + const getFairUsageNoticeMessage = resetDateString => { + const fairUsageMessage = __( + "You've reached this month's request limit, per our fair usage policy.", + 'jetpack' + ); + + if ( ! resetDateString ) { + return fairUsageMessage; + } + + // Translators: %s is the date when the requests will reset. + const dateMessage = __( 'Requests will reset on %s.', 'jetpack' ); + const formattedDateMessage = sprintf( dateMessage, resetDateString ); + + return `${ fairUsageMessage } ${ formattedDateMessage }`; + }; + + const nextUsagePeriodStartDateString = getFormattedUsagePeriodStartDate( usagePeriod ); + + // Get the proper template based on the presence of the next usage period start date. + const fairUsageNoticeMessage = getFairUsageNoticeMessage( nextUsagePeriodStartDateString ); + + const fairUsageNoticeMessageElement = createInterpolateElement( fairUsageNoticeMessage, { + link: ( + + ), + } ); + + return fairUsageNoticeMessageElement; +}; + /** * The default upgrade prompt for the AI Assistant block, containing the Upgrade button and linking * to the checkout page or the Jetpack AI interstitial page. @@ -215,12 +271,10 @@ const VIPUpgradePrompt = ( { * @return {ReactElement} the Notice component with the fair usage message. */ const FairUsageNotice = () => { + const useFairUsageNoticeMessageElement = useFairUsageNoticeMessage(); return ( - - { __( - 'You exceeded your current quota of requests. Check the usage policy for more information.', - 'jetpack' - ) } + + { useFairUsageNoticeMessageElement } ); }; diff --git a/projects/plugins/jetpack/extensions/blocks/ai-assistant/inline-extensions/components/ai-assistant-input/index.tsx b/projects/plugins/jetpack/extensions/blocks/ai-assistant/inline-extensions/components/ai-assistant-input/index.tsx index 0c8eceb89c2a6..90356810fd123 100644 --- a/projects/plugins/jetpack/extensions/blocks/ai-assistant/inline-extensions/components/ai-assistant-input/index.tsx +++ b/projects/plugins/jetpack/extensions/blocks/ai-assistant/inline-extensions/components/ai-assistant-input/index.tsx @@ -76,6 +76,13 @@ export default function AiAssistantInput( { [ requireUpgrade, requestingState ] ); + /** + * Show the fair usage message when the site is on the unlimited tier and was flagged as requireUpgrade. + */ + const showFairUsageMessage = useMemo( () => { + return requireUpgrade && currentTier?.value === 1; + }, [ requireUpgrade, currentTier ] ); + const handleSend = useCallback( () => { tracks.recordEvent( 'jetpack_ai_assistant_extension_generate', { block_type: blockType, @@ -165,6 +172,7 @@ export default function AiAssistantInput( { error={ requestingError } requestsRemaining={ requestsRemaining } showUpgradeMessage={ showUpgradeMessage } + showFairUsageMessage={ showFairUsageMessage } upgradeUrl={ checkoutUrl } onChange={ setValue } onSend={ handleSend } diff --git a/projects/plugins/jetpack/extensions/blocks/button/edit.js b/projects/plugins/jetpack/extensions/blocks/button/edit.js index 40b991494d7c5..c1d57607b21c3 100644 --- a/projects/plugins/jetpack/extensions/blocks/button/edit.js +++ b/projects/plugins/jetpack/extensions/blocks/button/edit.js @@ -3,6 +3,7 @@ import { RichText, __experimentalUseGradient as useGradient, // eslint-disable-line @wordpress/no-unsafe-wp-apis withColors, + useBlockProps, } from '@wordpress/block-editor'; import { compose } from '@wordpress/compose'; import { __ } from '@wordpress/i18n'; @@ -36,7 +37,9 @@ export function ButtonEdit( props ) { : {}; /* eslint-enable react-hooks/rules-of-hooks */ - const blockClasses = clsx( 'wp-block-button', className ); + const blockProps = useBlockProps( { + className: clsx( 'wp-block-button', className ), + } ); const buttonClasses = clsx( 'wp-block-button__link', { 'has-background': backgroundColor.color || gradientValue, @@ -61,7 +64,7 @@ export function ButtonEdit( props ) { }; return ( -
+
+
{ 'blockEditor.useSetting.before', 'extensions/blocks/button/test/controls', ( value, path ) => { - if ( overrideSettings.hasOwnProperty( path ) ) { + if ( Object.hasOwn( overrideSettings, path ) ) { return overrideSettings[ path ]; } return value; diff --git a/projects/plugins/jetpack/extensions/blocks/map/mapbox-utils/index.js b/projects/plugins/jetpack/extensions/blocks/map/mapbox-utils/index.js index 621f39398278a..7646b76e9b6ca 100644 --- a/projects/plugins/jetpack/extensions/blocks/map/mapbox-utils/index.js +++ b/projects/plugins/jetpack/extensions/blocks/map/mapbox-utils/index.js @@ -1,5 +1,5 @@ export const googlePoint2Mapbox = google_point => - google_point.hasOwnProperty( 'lat' ) && google_point.hasOwnProperty( 'lng' ) + Object.hasOwn( google_point, 'lat' ) && Object.hasOwn( google_point, 'lng' ) ? google_point // Already a valid Mapbox point. : { // Legacy point, supported here to avoid block deprecation. diff --git a/projects/plugins/jetpack/extensions/blocks/map/test/controls.js b/projects/plugins/jetpack/extensions/blocks/map/test/controls.js index 6bc990eb5a577..b178c98a4f90f 100644 --- a/projects/plugins/jetpack/extensions/blocks/map/test/controls.js +++ b/projects/plugins/jetpack/extensions/blocks/map/test/controls.js @@ -20,7 +20,7 @@ beforeAll( () => { 'blockEditor.useSetting.before', 'extensions/blocks/button/test/controls', ( value, path ) => { - if ( overrideSettings.hasOwnProperty( path ) ) { + if ( Object.hasOwn( overrideSettings, path ) ) { return overrideSettings[ path ]; } return value; diff --git a/projects/plugins/jetpack/extensions/blocks/story/player/lib/shadow-root.js b/projects/plugins/jetpack/extensions/blocks/story/player/lib/shadow-root.js index 03c217d964fa0..d16062f4f567e 100644 --- a/projects/plugins/jetpack/extensions/blocks/story/player/lib/shadow-root.js +++ b/projects/plugins/jetpack/extensions/blocks/story/player/lib/shadow-root.js @@ -1,7 +1,7 @@ import { createPortal, useCallback, useEffect, useState } from '@wordpress/element'; export const shadowRootSupported = - window && window.Element && window.Element.prototype.hasOwnProperty( 'attachShadow' ); + window && window.Element && Object.hasOwn( window.Element.prototype, 'attachShadow' ); export default function ShadowRoot( { enabled, diff --git a/projects/plugins/jetpack/extensions/blocks/subscriptions/deprecated/v1/index.js b/projects/plugins/jetpack/extensions/blocks/subscriptions/deprecated/v1/index.js index 7a034bf5e7514..e836b8ba35191 100644 --- a/projects/plugins/jetpack/extensions/blocks/subscriptions/deprecated/v1/index.js +++ b/projects/plugins/jetpack/extensions/blocks/subscriptions/deprecated/v1/index.js @@ -21,7 +21,7 @@ export default { }, isEligible: attr => { // Newer block versions do not have `subscribeButton` attribute. - if ( ! attr.hasOwnProperty( 'subscribeButton' ) || ! isEmpty( attr.subscribeButton ) ) { + if ( ! Object.hasOwn( attr, 'subscribeButton' ) || ! isEmpty( attr.subscribeButton ) ) { return false; } return true; diff --git a/projects/plugins/jetpack/extensions/blocks/subscriptions/email-preview.js b/projects/plugins/jetpack/extensions/blocks/subscriptions/email-preview.js index 6c12b9d6f7abd..f22b79d9138a0 100644 --- a/projects/plugins/jetpack/extensions/blocks/subscriptions/email-preview.js +++ b/projects/plugins/jetpack/extensions/blocks/subscriptions/email-preview.js @@ -273,7 +273,7 @@ export function NewsletterPreviewModal( { isOpen, onClose, postId } ) { ); useEffect( () => { - if ( isOpen && ! previewCache.hasOwnProperty( selectedAccess ) ) { + if ( isOpen && ! Object.hasOwn( previewCache, selectedAccess ) ) { fetchPreview( selectedAccess ); } else if ( isOpen ) { setIsLoading( false ); diff --git a/projects/plugins/jetpack/extensions/blocks/subscriptions/test/controls.js b/projects/plugins/jetpack/extensions/blocks/subscriptions/test/controls.js index 77a52f9da4a9e..4116dae5cfc67 100644 --- a/projects/plugins/jetpack/extensions/blocks/subscriptions/test/controls.js +++ b/projects/plugins/jetpack/extensions/blocks/subscriptions/test/controls.js @@ -23,7 +23,7 @@ beforeAll( () => { 'blockEditor.useSetting.before', 'extensions/blocks/button/test/controls', ( value, path ) => { - if ( overrideSettings.hasOwnProperty( path ) ) { + if ( Object.hasOwn( overrideSettings, path ) ) { return overrideSettings[ path ]; } return value; diff --git a/projects/plugins/jetpack/extensions/blocks/tiled-gallery/deprecated/v1/layout/index.js b/projects/plugins/jetpack/extensions/blocks/tiled-gallery/deprecated/v1/layout/index.js index f10bfcd9eb182..225f208c6c4a9 100644 --- a/projects/plugins/jetpack/extensions/blocks/tiled-gallery/deprecated/v1/layout/index.js +++ b/projects/plugins/jetpack/extensions/blocks/tiled-gallery/deprecated/v1/layout/index.js @@ -130,7 +130,7 @@ function photonWpcomImage( url, opts = {} ) { // Build query for ( const [ k, v ] of Object.entries( opts ) ) { urlObj.searchParams.set( - photonLibMappings.hasOwnProperty( k ) ? photonLibMappings[ k ] : k, + Object.hasOwn( photonLibMappings, k ) ? photonLibMappings[ k ] : k, v ); } diff --git a/projects/plugins/jetpack/extensions/blocks/tiled-gallery/deprecated/v2/utils/index.js b/projects/plugins/jetpack/extensions/blocks/tiled-gallery/deprecated/v2/utils/index.js index 8cb05e2b2a457..35c7fed679c04 100644 --- a/projects/plugins/jetpack/extensions/blocks/tiled-gallery/deprecated/v2/utils/index.js +++ b/projects/plugins/jetpack/extensions/blocks/tiled-gallery/deprecated/v2/utils/index.js @@ -145,7 +145,7 @@ function photonWpcomImage( url, opts = {} ) { // Build query for ( const [ k, v ] of Object.entries( opts ) ) { urlObj.searchParams.set( - photonLibMappings.hasOwnProperty( k ) ? photonLibMappings[ k ] : k, + Object.hasOwn( photonLibMappings, k ) ? photonLibMappings[ k ] : k, v ); } diff --git a/projects/plugins/jetpack/extensions/blocks/tiled-gallery/deprecated/v3/utils/index.js b/projects/plugins/jetpack/extensions/blocks/tiled-gallery/deprecated/v3/utils/index.js index d9b16d62baae8..bd5e423839eb8 100644 --- a/projects/plugins/jetpack/extensions/blocks/tiled-gallery/deprecated/v3/utils/index.js +++ b/projects/plugins/jetpack/extensions/blocks/tiled-gallery/deprecated/v3/utils/index.js @@ -146,7 +146,7 @@ function photonWpcomImage( url, opts = {} ) { // Build query for ( const [ k, v ] of Object.entries( opts ) ) { urlObj.searchParams.set( - photonLibMappings.hasOwnProperty( k ) ? photonLibMappings[ k ] : k, + Object.hasOwn( photonLibMappings, k ) ? photonLibMappings[ k ] : k, v ); } diff --git a/projects/plugins/jetpack/extensions/blocks/tiled-gallery/deprecated/v4/utils/index.js b/projects/plugins/jetpack/extensions/blocks/tiled-gallery/deprecated/v4/utils/index.js index 18380ce3d602f..14c28fe86ca47 100644 --- a/projects/plugins/jetpack/extensions/blocks/tiled-gallery/deprecated/v4/utils/index.js +++ b/projects/plugins/jetpack/extensions/blocks/tiled-gallery/deprecated/v4/utils/index.js @@ -153,7 +153,7 @@ function photonWpcomImage( url, opts = {} ) { // Build query for ( const [ k, v ] of Object.entries( opts ) ) { urlObj.searchParams.set( - photonLibMappings.hasOwnProperty( k ) ? photonLibMappings[ k ] : k, + Object.hasOwn( photonLibMappings, k ) ? photonLibMappings[ k ] : k, v ); } diff --git a/projects/plugins/jetpack/extensions/blocks/tiled-gallery/deprecated/v6/utils/index.js b/projects/plugins/jetpack/extensions/blocks/tiled-gallery/deprecated/v6/utils/index.js index 18380ce3d602f..14c28fe86ca47 100644 --- a/projects/plugins/jetpack/extensions/blocks/tiled-gallery/deprecated/v6/utils/index.js +++ b/projects/plugins/jetpack/extensions/blocks/tiled-gallery/deprecated/v6/utils/index.js @@ -153,7 +153,7 @@ function photonWpcomImage( url, opts = {} ) { // Build query for ( const [ k, v ] of Object.entries( opts ) ) { urlObj.searchParams.set( - photonLibMappings.hasOwnProperty( k ) ? photonLibMappings[ k ] : k, + Object.hasOwn( photonLibMappings, k ) ? photonLibMappings[ k ] : k, v ); } diff --git a/projects/plugins/jetpack/extensions/blocks/tiled-gallery/utils/index.js b/projects/plugins/jetpack/extensions/blocks/tiled-gallery/utils/index.js index d605dc369ec28..9a4e4f2ac3c6e 100644 --- a/projects/plugins/jetpack/extensions/blocks/tiled-gallery/utils/index.js +++ b/projects/plugins/jetpack/extensions/blocks/tiled-gallery/utils/index.js @@ -153,7 +153,7 @@ function photonWpcomImage( url, opts = {} ) { // Build query for ( const [ k, v ] of Object.entries( opts ) ) { urlObj.searchParams.set( - photonLibMappings.hasOwnProperty( k ) ? photonLibMappings[ k ] : k, + Object.hasOwn( photonLibMappings, k ) ? photonLibMappings[ k ] : k, v ); } diff --git a/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/ai-assistant-plugin-sidebar/index.tsx b/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/ai-assistant-plugin-sidebar/index.tsx index 45d2236875b59..4a9047e726ae7 100644 --- a/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/ai-assistant-plugin-sidebar/index.tsx +++ b/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/ai-assistant-plugin-sidebar/index.tsx @@ -126,6 +126,12 @@ const JetpackAndSettingsContent = ( { { __( 'Learn more about Jetpack AI', 'jetpack' ) } + + + + { __( 'AI Guidelines', 'jetpack' ) } + + ); }; diff --git a/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/ai-image/components/carrousel.tsx b/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/ai-image/components/carrousel.tsx index 800befe5559cc..a8d97c7c362eb 100644 --- a/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/ai-image/components/carrousel.tsx +++ b/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/ai-image/components/carrousel.tsx @@ -82,7 +82,7 @@ export default function Carrousel( { ); - const total = images?.filter?.( item => item?.generating || item.hasOwnProperty( 'image' ) ) + const total = images?.filter?.( item => item?.generating || Object.hasOwn( item, 'image' ) ) ?.length; const actual = current === 0 && total === 0 ? 0 : current + 1; diff --git a/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/breve/features/spelling-mistakes/a8c.ts b/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/breve/features/spelling-mistakes/a8c.ts new file mode 100644 index 0000000000000..f4eb03738ded2 --- /dev/null +++ b/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/breve/features/spelling-mistakes/a8c.ts @@ -0,0 +1,18 @@ +export default `Automattic +Tumblr +WooCommerce +Jetpack +Simplenote +WPScan +Crowdsignal +Cloudup +Akismet +Longreads +Newspack +Gravatar +BuddyPress +bbPress +WordCamp +Automatticians +Automattician +Mullenweg`; diff --git a/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/breve/features/spelling-mistakes/index.ts b/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/breve/features/spelling-mistakes/index.ts index cd625c81cdf18..7175586da3dfb 100644 --- a/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/breve/features/spelling-mistakes/index.ts +++ b/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/breve/features/spelling-mistakes/index.ts @@ -9,6 +9,7 @@ import nspell from 'nspell'; * Internal dependencies */ import getDictionary from '../../utils/get-dictionary'; +import a8c from './a8c'; /** * Types */ @@ -105,6 +106,9 @@ export const getSpellChecker = ( { language = 'en' }: { language?: string } = {} ); exceptions.forEach( exception => spellChecker.add( exception ) ); + // Add the Automattic dictionary + spellChecker.personal( a8c ); + spellCheckers[ language ] = spellChecker; return spellCheckers[ language ]; @@ -143,7 +147,7 @@ export const addTextToDictionary = ( // Recompute the spell checker on the next call delete spellCheckers[ language ]; - reloadDictionary( SPELLING_MISTAKES.name ); + reloadDictionary(); debug( 'Added text to the dictionary', text ); }; @@ -154,10 +158,15 @@ export const suggestSpellingFixes = ( ) => { const spellChecker = getSpellChecker( { language } ); - if ( ! spellChecker ) { + if ( ! spellChecker || ! text ) { return []; } + // capital_P_dangit + if ( text.toLocaleLowerCase() === 'wordpress' ) { + return [ 'WordPress' ]; + } + const suggestions = spellChecker.suggest( text ); return suggestions; diff --git a/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/breve/store/actions.ts b/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/breve/store/actions.ts index 72ebf415c5482..9ce094a8367d4 100644 --- a/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/breve/store/actions.ts +++ b/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/breve/store/actions.ts @@ -90,13 +90,9 @@ export function invalidateSingleSuggestion( feature: string, blockId: string, id }; } -export function reloadDictionary( feature: string ) { - return ( { dispatch } ) => { - dispatch( setDictionaryLoading( feature, true ) ); - - setTimeout( () => { - dispatch( setDictionaryLoading( feature, false ) ); - }, 100 ); +export function reloadDictionary() { + return { + type: 'RELOAD_DICTIONARY', }; } diff --git a/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/breve/store/reducer.ts b/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/breve/store/reducer.ts index 1c97518ccdf51..40f90e998ae8b 100644 --- a/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/breve/store/reducer.ts +++ b/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/breve/store/reducer.ts @@ -76,6 +76,13 @@ export function configuration( loading, }; } + + case 'RELOAD_DICTIONARY': { + return { + ...state, + reload: ! state.reload, + }; + } } return state; diff --git a/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/breve/store/selectors.ts b/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/breve/store/selectors.ts index fcd481d8a3b4d..05f35ae1536ef 100644 --- a/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/breve/store/selectors.ts +++ b/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/breve/store/selectors.ts @@ -39,6 +39,10 @@ export function getDisabledFeatures( state: BreveState ) { return state.configuration?.disabled; } +export function getReloadFlag( state: BreveState ) { + return state.configuration?.reload; +} + // Suggestions export function getBlockMd5( state: BreveState, blockId: string ) { diff --git a/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/breve/types.ts b/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/breve/types.ts index bf5ac42d73fca..f2e152c4feaea 100644 --- a/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/breve/types.ts +++ b/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/breve/types.ts @@ -19,6 +19,7 @@ export type BreveState = { enabled?: boolean; disabled?: Array< string >; loading?: Array< string >; + reload?: boolean; }; suggestions?: { [ key: string ]: { @@ -67,6 +68,7 @@ export type BreveSelect = { suggestion: string; }; getIgnoredSuggestions: ( { blockId }: { blockId: string } ) => Array< string >; + getReloadFlag: () => boolean; }; export type BreveDispatch = { @@ -78,7 +80,7 @@ export type BreveDispatch = { setDictionaryLoading( feature: string, loading: boolean ): void; invalidateSuggestions: ( blockId: string ) => void; invalidateSingleSuggestion: ( feature: string, blockId: string, id: string ) => void; - reloadDictionary: ( feature: string ) => void; + reloadDictionary: () => void; ignoreSuggestion: ( blockId: string, id: string ) => void; setBlockMd5: ( blockId: string, md5: string ) => void; setSuggestions: ( suggestions: { @@ -118,6 +120,7 @@ export type SpellChecker = { correct: ( word: string ) => boolean; suggest: ( word: string ) => Array< string >; add: ( word: string ) => void; + personal: ( dic: string ) => void; }; export type SpellingDictionaryContext = { diff --git a/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/breve/utils/register-format.ts b/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/breve/utils/register-format.ts index a36cf92a90ec4..cb219cb272cdb 100644 --- a/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/breve/utils/register-format.ts +++ b/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/breve/utils/register-format.ts @@ -50,6 +50,7 @@ export function registerBreveHighlight( feature: BreveFeature ) { isFeatureEnabled, isProofreadEnabled, isFeatureDictionaryLoading, + getReloadFlag, } = select( 'jetpack/ai-breve' ) as BreveSelect; const { getAiAssistantFeature } = select( 'wordpress-com/plans' ); @@ -60,6 +61,7 @@ export function registerBreveHighlight( feature: BreveFeature ) { isFeatureEnabled: isFeatureEnabled( config.name ), ignored: getIgnoredSuggestions( { blockId: blockClientId } ), isFeatureDictionaryLoading: isFeatureDictionaryLoading( config.name ), + reloadFlag: getReloadFlag(), // Used to force a reload of the highlights }; }, diff --git a/projects/plugins/jetpack/extensions/plugins/launchpad-save-modal/index.js b/projects/plugins/jetpack/extensions/plugins/launchpad-save-modal/index.js index 6bd8a22727d09..4415b46466752 100644 --- a/projects/plugins/jetpack/extensions/plugins/launchpad-save-modal/index.js +++ b/projects/plugins/jetpack/extensions/plugins/launchpad-save-modal/index.js @@ -32,7 +32,7 @@ const updateLaunchpadSaveModalBrowserConfig = config => { } for ( const editableProp of LAUNCHPAD_SAVE_MODAL_EDITABLE_PROPS ) { - if ( config.hasOwnProperty( editableProp ) ) { + if ( Object.hasOwn( config, editableProp ) ) { window.Jetpack_LaunchpadSaveModal[ editableProp ] = config[ editableProp ]; } } diff --git a/projects/plugins/jetpack/jetpack.php b/projects/plugins/jetpack/jetpack.php index b3f68ab39d133..045dbb2047e26 100644 --- a/projects/plugins/jetpack/jetpack.php +++ b/projects/plugins/jetpack/jetpack.php @@ -4,7 +4,7 @@ * Plugin URI: https://jetpack.com * Description: Security, performance, and marketing tools made by WordPress experts. Jetpack keeps your site protected so you can focus on more important things. * Author: Automattic - * Version: 13.8-a.8 + * Version: 13.8-a.7 * Author URI: https://jetpack.com * License: GPL2+ * Text Domain: jetpack @@ -34,7 +34,7 @@ define( 'JETPACK__MINIMUM_WP_VERSION', '6.5' ); define( 'JETPACK__MINIMUM_PHP_VERSION', '7.0' ); -define( 'JETPACK__VERSION', '13.8-a.8' ); +define( 'JETPACK__VERSION', '13.8-a.7' ); /** * Constant used to fetch the connection owner token @@ -184,7 +184,7 @@ function jetpack_admin_missing_files() { $message = sprintf( wp_kses( /* translators: Placeholder is a link to a support document. */ - __( 'Your installation of Jetpack is incomplete. If you installed Jetpack from GitHub, please refer to this document to set up your development environment. Jetpack must have Composer dependencies installed and built via the build command: jetpack build plugins/jetpack --with-deps', 'jetpack' ), + __( 'Your installation of Jetpack is incomplete. If you installed Jetpack from GitHub, please refer to this document to set up your development environment. Jetpack must have Composer dependencies installed and built via the build command: jetpack build plugins/jetpack --deps', 'jetpack' ), array( 'a' => array( 'href' => array(), diff --git a/projects/plugins/jetpack/modules/infinite-scroll/infinity.js b/projects/plugins/jetpack/modules/infinite-scroll/infinity.js index 7f3f422a7f6d6..e880c15bfc9c4 100644 --- a/projects/plugins/jetpack/modules/infinite-scroll/infinity.js +++ b/projects/plugins/jetpack/modules/infinite-scroll/infinity.js @@ -129,7 +129,7 @@ } for ( var key in arguments[ i ] ) { - if ( arguments[ i ].hasOwnProperty( key ) ) { + if ( Object.hasOwn( arguments[ i ], key ) ) { out[ key ] = arguments[ i ][ key ]; } } diff --git a/projects/plugins/jetpack/modules/notes.php b/projects/plugins/jetpack/modules/notes.php index 0b1f3bed6938f..eee9643a30aaf 100644 --- a/projects/plugins/jetpack/modules/notes.php +++ b/projects/plugins/jetpack/modules/notes.php @@ -173,7 +173,7 @@ public function admin_bar_menu() { return; } - $wpcom_locale = get_locale(); + $user_locale = get_user_locale(); if ( ! class_exists( 'GP_Locales' ) ) { if ( defined( 'JETPACK__GLOTPRESS_LOCALES_PATH' ) && file_exists( JETPACK__GLOTPRESS_LOCALES_PATH ) ) { @@ -182,9 +182,9 @@ public function admin_bar_menu() { } if ( class_exists( 'GP_Locales' ) ) { - $wpcom_locale_object = GP_Locales::by_field( 'wp_locale', $wpcom_locale ); - if ( $wpcom_locale_object instanceof GP_Locale ) { - $wpcom_locale = $wpcom_locale_object->slug; + $jetpack_locale_object = GP_Locales::by_field( 'slug', $user_locale ); + if ( $jetpack_locale_object instanceof GP_Locale ) { + $user_locale = $jetpack_locale_object->slug; } } @@ -196,7 +196,7 @@ public function admin_bar_menu() { 'id' => 'notes', 'title' => $title, 'meta' => array( - 'html' => '' . $third_party_cookie_check_iframe, + 'html' => '' . $third_party_cookie_check_iframe, 'class' => 'menupop', ), 'parent' => 'top-secondary', diff --git a/projects/plugins/jetpack/modules/videopress/js/videopress-plupload.js b/projects/plugins/jetpack/modules/videopress/js/videopress-plupload.js index 99efce6fda2f7..1418b16c57ea1 100644 --- a/projects/plugins/jetpack/modules/videopress/js/videopress-plupload.js +++ b/projects/plugins/jetpack/modules/videopress/js/videopress-plupload.js @@ -99,7 +99,7 @@ window.wp = window.wp || {}; ! isIE && 'flash' === plupload.predictRuntime( this.plupload ) && ( ! this.plupload.required_features || - ! this.plupload.required_features.hasOwnProperty( 'send_binary_string' ) ) + ! Object.hasOwn( this.plupload.required_features, 'send_binary_string' ) ) ) { this.plupload.required_features = this.plupload.required_features || {}; this.plupload.required_features.send_binary_string = true; diff --git a/projects/plugins/jetpack/modules/widgets/simple-payments/customizer.js b/projects/plugins/jetpack/modules/widgets/simple-payments/customizer.js index cef1db3ca143b..08dfffe4fa7b2 100644 --- a/projects/plugins/jetpack/modules/widgets/simple-payments/customizer.js +++ b/projects/plugins/jetpack/modules/widgets/simple-payments/customizer.js @@ -301,9 +301,10 @@ } var productEmail = widgetForm.find( '.jetpack-simple-payments-form-product-email' ).val(); - var isProductEmailValid = /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test( - productEmail - ); + var isProductEmailValid = + /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test( + productEmail + ); if ( ! productEmail || ! isProductEmailValid ) { widgetForm.find( '.jetpack-simple-payments-form-product-email' ).addClass( 'invalid' ); errors = true; @@ -378,7 +379,7 @@ }; data.forEach( function ( item ) { - if ( validCodes.hasOwnProperty( item.code ) ) { + if ( Object.hasOwn( validCodes, item.code ) ) { widgetForm .find( '.jetpack-simple-payments-form-' + validCodes[ item.code ] ) .addClass( 'invalid' ); diff --git a/projects/plugins/jetpack/modules/wpgroho.js b/projects/plugins/jetpack/modules/wpgroho.js index 9261fe0c1a659..33c79d5afc90f 100644 --- a/projects/plugins/jetpack/modules/wpgroho.js +++ b/projects/plugins/jetpack/modules/wpgroho.js @@ -7,7 +7,7 @@ if ( ! arguments[ i ] ) continue; for ( var key in arguments[ i ] ) { - if ( arguments[ i ].hasOwnProperty( key ) ) out[ key ] = arguments[ i ][ key ]; + if ( Object.hasOwn( arguments[ i ], key ) ) out[ key ] = arguments[ i ][ key ]; } } diff --git a/projects/plugins/jetpack/package.json b/projects/plugins/jetpack/package.json index 22f10d1c21e24..b21e808d0eb26 100644 --- a/projects/plugins/jetpack/package.json +++ b/projects/plugins/jetpack/package.json @@ -1,6 +1,6 @@ { "name": "Jetpack", - "version": "13.8.0-a.8", + "version": "13.8.0-a.7", "private": true, "description": "[Jetpack](https://jetpack.com/) is a WordPress plugin that supercharges your self-hosted WordPress site with the awesome cloud power of [WordPress.com](https://wordpress.com).", "homepage": "https://jetpack.com", diff --git a/projects/plugins/jetpack/tools/static-site-generator-webpack-plugin.js b/projects/plugins/jetpack/tools/static-site-generator-webpack-plugin.js index be3c81d0b1ac4..a9bab50abf2a5 100644 --- a/projects/plugins/jetpack/tools/static-site-generator-webpack-plugin.js +++ b/projects/plugins/jetpack/tools/static-site-generator-webpack-plugin.js @@ -34,7 +34,7 @@ class StaticSiteGeneratorWebpackPlugin { /* includeGlobals: */ true ); - if ( render.hasOwnProperty( 'default' ) ) { + if ( Object.hasOwn( render, 'default' ) ) { render = render.default; } diff --git a/projects/plugins/migration/changelog/try-no-version-bumps-in-trunk b/projects/plugins/migration/changelog/try-no-version-bumps-in-trunk new file mode 100644 index 0000000000000..91efe85c55e06 --- /dev/null +++ b/projects/plugins/migration/changelog/try-no-version-bumps-in-trunk @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Un-bump version numbers in trunk. The build will now update the version numbers as needed for mirrors. + + diff --git a/projects/plugins/migration/composer.json b/projects/plugins/migration/composer.json index 4e14f923d5901..4d5c7160597ae 100644 --- a/projects/plugins/migration/composer.json +++ b/projects/plugins/migration/composer.json @@ -71,6 +71,6 @@ "automattic/jetpack-autoloader": true, "automattic/jetpack-composer-plugin": true }, - "autoloader-suffix": "c4802e05bbcf59fd3b6350e8d3e5482c_migrationⓥ3_0_0_alpha" + "autoloader-suffix": "c4802e05bbcf59fd3b6350e8d3e5482c_migrationⓥ2_0_0" } } diff --git a/projects/plugins/migration/wpcom-migration.php b/projects/plugins/migration/wpcom-migration.php index ab4f2bb834c71..4f95626c54dda 100644 --- a/projects/plugins/migration/wpcom-migration.php +++ b/projects/plugins/migration/wpcom-migration.php @@ -4,7 +4,7 @@ * Plugin Name: Move to WordPress.com * Plugin URI: https://wordpress.org/plugins/wpcom-migration * Description: A WordPress plugin that helps users to migrate their sites to WordPress.com. - * Version: 3.0.0-alpha + * Version: 2.0.0 * Author: Automattic * Author URI: https://wordpress.com/ * License: GPLv2 or later diff --git a/projects/plugins/protect/changelog/add-more-eslint-rules b/projects/plugins/protect/changelog/add-more-eslint-rules new file mode 100644 index 0000000000000..2b32cb03e644c --- /dev/null +++ b/projects/plugins/protect/changelog/add-more-eslint-rules @@ -0,0 +1,5 @@ +Significance: patch +Type: fixed +Comment: Fix new eslint sniffs. Should be no change in functionality. + + diff --git a/projects/plugins/protect/changelog/try-no-version-bumps-in-trunk b/projects/plugins/protect/changelog/try-no-version-bumps-in-trunk new file mode 100644 index 0000000000000..91efe85c55e06 --- /dev/null +++ b/projects/plugins/protect/changelog/try-no-version-bumps-in-trunk @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Un-bump version numbers in trunk. The build will now update the version numbers as needed for mirrors. + + diff --git a/projects/plugins/protect/composer.json b/projects/plugins/protect/composer.json index a914975f4b6c7..2cf02d8e2d77f 100644 --- a/projects/plugins/protect/composer.json +++ b/projects/plugins/protect/composer.json @@ -79,6 +79,6 @@ "automattic/jetpack-autoloader": true, "automattic/jetpack-composer-plugin": true }, - "autoloader-suffix": "c4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ3_0_1_alpha" + "autoloader-suffix": "c4802e05bbcf59fd3b6350e8d3e5482c_protectⓥ3_0_0_beta" } } diff --git a/projects/plugins/protect/jetpack-protect.php b/projects/plugins/protect/jetpack-protect.php index e2e0c303a5838..8e20259d4aafc 100644 --- a/projects/plugins/protect/jetpack-protect.php +++ b/projects/plugins/protect/jetpack-protect.php @@ -3,7 +3,7 @@ * Plugin Name: Jetpack Protect * Plugin URI: https://wordpress.org/plugins/jetpack-protect * Description: Security tools that keep your site safe and sound, from posts to plugins. - * Version: 3.0.1-alpha + * Version: 3.0.0-beta * Author: Automattic - Jetpack Security team * Author URI: https://jetpack.com/protect/ * License: GPLv2 or later @@ -32,7 +32,7 @@ exit; } -define( 'JETPACK_PROTECT_VERSION', '3.0.1-alpha' ); +define( 'JETPACK_PROTECT_VERSION', '3.0.0-beta' ); define( 'JETPACK_PROTECT_DIR', plugin_dir_path( __FILE__ ) ); define( 'JETPACK_PROTECT_ROOT_FILE', __FILE__ ); define( 'JETPACK_PROTECT_ROOT_FILE_RELATIVE_PATH', plugin_basename( __FILE__ ) ); diff --git a/projects/plugins/protect/src/js/components/marked-lines/index.jsx b/projects/plugins/protect/src/js/components/marked-lines/index.jsx index 154513a7cbbde..2010581cd8981 100644 --- a/projects/plugins/protect/src/js/components/marked-lines/index.jsx +++ b/projects/plugins/protect/src/js/components/marked-lines/index.jsx @@ -56,7 +56,7 @@ const MarkedLines = ( { context } ) => {
{ Object.keys( lines ).map( lineNumber => { - const hasMarks = marks.hasOwnProperty( lineNumber ); + const hasMarks = Object.hasOwn( marks, lineNumber ); return (
{
{ Object.keys( lines ).map( lineNumber => { const lineContent = lines[ lineNumber ] || ' '; - const hasMarks = marks.hasOwnProperty( lineNumber ); + const hasMarks = Object.hasOwn( marks, lineNumber ); return (
realtime backup and automated security scanning from VaultPress. Activate, enter your registration key, and never worry again. Need some help? - * Version: 3.0.1-alpha + * Version: 3.0.0 * Author: Automattic * Author URI: http://vaultpress.com/?utm_source=author-uri&utm_medium=plugin-description&utm_campaign=1.0 * License: GPL2+ @@ -17,7 +17,7 @@ defined( 'ABSPATH' ) || die(); define( 'VAULTPRESS__MINIMUM_PHP_VERSION', '7.0' ); -define( 'VAULTPRESS__VERSION', '3.0.1-alpha' ); +define( 'VAULTPRESS__VERSION', '3.0.0' ); define( 'VAULTPRESS__PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); /** diff --git a/projects/plugins/videopress/changelog/try-no-version-bumps-in-trunk b/projects/plugins/videopress/changelog/try-no-version-bumps-in-trunk new file mode 100644 index 0000000000000..91efe85c55e06 --- /dev/null +++ b/projects/plugins/videopress/changelog/try-no-version-bumps-in-trunk @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Un-bump version numbers in trunk. The build will now update the version numbers as needed for mirrors. + + diff --git a/projects/plugins/videopress/composer.json b/projects/plugins/videopress/composer.json index eb7c179157bd1..8065aa4ac5c45 100644 --- a/projects/plugins/videopress/composer.json +++ b/projects/plugins/videopress/composer.json @@ -58,6 +58,6 @@ "automattic/jetpack-autoloader": true, "automattic/jetpack-composer-plugin": true }, - "autoloader-suffix": "c4802e05bbcf59fd3b6350e8d3e5482c_videopressⓥ2_0_alpha" + "autoloader-suffix": "c4802e05bbcf59fd3b6350e8d3e5482c_videopressⓥ1_9" } } diff --git a/projects/plugins/videopress/jetpack-videopress.php b/projects/plugins/videopress/jetpack-videopress.php index a3b14ce909f2b..3e59d692e9669 100644 --- a/projects/plugins/videopress/jetpack-videopress.php +++ b/projects/plugins/videopress/jetpack-videopress.php @@ -4,7 +4,7 @@ * Plugin Name: Jetpack VideoPress * Plugin URI: https://wordpress.org/plugins/jetpack-videopress * Description: High quality, ad-free video. - * Version: 2.0-alpha + * Version: 1.9 * Author: Automattic - Jetpack Video team * Author URI: https://jetpack.com/videopress/ * License: GPLv2 or later diff --git a/projects/plugins/wpcomsh/changelog/add-autotagger-trunk-rolling-releases b/projects/plugins/wpcomsh/changelog/add-autotagger-trunk-rolling-releases new file mode 100644 index 0000000000000..f7dd01d5442a4 --- /dev/null +++ b/projects/plugins/wpcomsh/changelog/add-autotagger-trunk-rolling-releases @@ -0,0 +1,4 @@ +Significance: patch +Type: added + +Added a switch that will enable rolling trunk releases. diff --git a/projects/plugins/wpcomsh/changelog/add-autotagger-trunk-rolling-releases#2 b/projects/plugins/wpcomsh/changelog/add-autotagger-trunk-rolling-releases#2 new file mode 100644 index 0000000000000..9aa70e3ec1f75 --- /dev/null +++ b/projects/plugins/wpcomsh/changelog/add-autotagger-trunk-rolling-releases#2 @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Updated composer.lock. + + diff --git a/projects/plugins/wpcomsh/changelog/add-autotagger-trunk-rolling-releases#3 b/projects/plugins/wpcomsh/changelog/add-autotagger-trunk-rolling-releases#3 new file mode 100644 index 0000000000000..9aa70e3ec1f75 --- /dev/null +++ b/projects/plugins/wpcomsh/changelog/add-autotagger-trunk-rolling-releases#3 @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Updated composer.lock. + + diff --git a/projects/plugins/wpcomsh/changelog/try-no-version-bumps-in-trunk b/projects/plugins/wpcomsh/changelog/try-no-version-bumps-in-trunk new file mode 100644 index 0000000000000..91efe85c55e06 --- /dev/null +++ b/projects/plugins/wpcomsh/changelog/try-no-version-bumps-in-trunk @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Un-bump version numbers in trunk. The build will now update the version numbers as needed for mirrors. + + diff --git a/projects/plugins/wpcomsh/composer.json b/projects/plugins/wpcomsh/composer.json index 6f4dac134ddce..de066e3acb152 100644 --- a/projects/plugins/wpcomsh/composer.json +++ b/projects/plugins/wpcomsh/composer.json @@ -131,17 +131,19 @@ }, "extra": { "mirror-repo": "Automattic/wpcom-site-helper", - "autorelease": true, + "autorelease": { + "rolling-release": true, + "titlefmt": "wpcomsh %s" + }, "autotagger": true, "beta-plugin-slug": "wpcomsh", - "release-branch-prefix": [ - "wpcomsh", - "weekly" - ], - "installer-disable": true, "changelogger": { "versioning": "semver" }, + "installer-disable": true, + "release-branch-prefix": [ + "wpcomsh" + ], "version-constants": { "WPCOMSH_VERSION": "wpcomsh.php" } diff --git a/projects/plugins/wpcomsh/composer.lock b/projects/plugins/wpcomsh/composer.lock index 4f73c46e7ac83..ff2324e4856cf 100644 --- a/projects/plugins/wpcomsh/composer.lock +++ b/projects/plugins/wpcomsh/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "1287f0f4286e1e9052b7615dc69c9271", + "content-hash": "db2d649fe88d2b70941a9a4b77d82753", "packages": [ { "name": "automattic/at-pressable-podcasting", diff --git a/tools/changelogger-validate-all.sh b/tools/changelogger-validate-all.sh index 2cee36b2dbbfa..5a5064b02c8f3 100755 --- a/tools/changelogger-validate-all.sh +++ b/tools/changelogger-validate-all.sh @@ -91,14 +91,8 @@ function checkpkg { fi debug "Checking version numbers $SLUG" - local CHANGES_DIR="$(jq -r '.extra.changelogger["changes-dir"] // "changelog"' composer.json)" local PRERELEASE=$(alpha_tag composer.json 0) - local VER - if [[ -d "$CHANGES_DIR" && "$(ls -- "$CHANGES_DIR")" ]]; then - VER=$(changelogger version next --default-first-version --prerelease=$PRERELEASE) || { err "$VER"; EXIT=1; continue; } - else - VER=$(changelogger version current --default-first-version --prerelease=$PRERELEASE) || { err "$VER"; EXIT=1; continue; } - fi + local VER=$(changelogger version current --default-first-version --prerelease=$PRERELEASE) || { err "$VER"; EXIT=1; continue; } if ! $BASE/tools/project-version.sh "${ARGS2[@]}" $CHECK_OR_UPDATE "$VER" "$SLUG"; then return 1 fi diff --git a/tools/check-intra-monorepo-deps.sh b/tools/check-intra-monorepo-deps.sh index 208add6ce062b..e349b63e0d8cc 100755 --- a/tools/check-intra-monorepo-deps.sh +++ b/tools/check-intra-monorepo-deps.sh @@ -167,17 +167,7 @@ if $UPDATE; then ARGS+=( --filename-auto-suffix ) fi - local CHANGES_DIR="$(jq -r '.extra.changelogger["changes-dir"] // "changelog"' composer.json)" - if [[ -d "$CHANGES_DIR" && "$(ls -- "$CHANGES_DIR")" ]]; then - changelogger_add "${ARGS[@]}" - else - changelogger_add "${ARGS[@]}" - info "Updating version for $SLUG" - local PRERELEASE=$(alpha_tag composer.json 0) - local VER=$(changelogger version next --default-first-version --prerelease=$PRERELEASE) || { error "$VER"; EXIT=1; cd "$OLDDIR"; return; } - "$BASE/tools/project-version.sh" -v -u "$VER" "$SLUG" - get_packages "$SLUG" - fi + changelogger_add "${ARGS[@]}" cd "$OLDDIR" } fi diff --git a/tools/cli/commands/build.js b/tools/cli/commands/build.js index ed8e5a294417a..41d25232bf875 100644 --- a/tools/cli/commands/build.js +++ b/tools/cli/commands/build.js @@ -589,10 +589,81 @@ async function checkCollisions( basedir ) { async function buildProject( t ) { await t.setStatus( 'installing' ); - const composerJson = JSON.parse( + let composerJson = JSON.parse( await fs.readFile( `${ t.cwd }/composer.json`, { encoding: 'utf8' } ) ); + // Update the changelog, if applicable. + if ( + t.argv.forMirrors && + ( t.project === 'packages/changelogger' || + composerJson.require?.[ 'automattic/jetpack-changelogger' ] || + composerJson[ 'require-dev' ]?.[ 'automattic/jetpack-changelogger' ] ) + ) { + const changelogger = npath.resolve( 'projects/packages/changelogger/bin/changelogger' ); + const changesDir = npath.resolve( + t.cwd, + composerJson.extra?.changelogger?.[ 'changes-dir' ] || 'changelog' + ); + t.output( '\n=== Updating changelog ===\n\n' ); + if ( + await fs.readdir( changesDir ).then( + a => a.filter( f => ! f.startsWith( '.' ) ).length > 0, + () => false + ) + ) { + let prerelease = 'alpha'; + if ( composerJson.extra?.[ 'dev-releases' ] ) { + const m = ( + await t.execa( changelogger, [ 'version', 'current', '--default-first-version' ], { + cwd: t.cwd, + stdio: [ 'ignore', 'pipe', 'inherit' ], + } ) + ).stdout.match( /^.*-a\.(\d+)$/ ); + // eslint-disable-next-line no-bitwise + prerelease = 'a.' + ( m ? ( parseInt( m[ 1 ] ) & ~1 ) + 2 : 0 ); + } + await t.execa( + changelogger, + [ + 'write', + '--prologue=This is an alpha version! The changes listed here are not final.', + '--default-first-version', + `--prerelease=${ prerelease }`, + `--release-date=unreleased`, + `--no-interaction`, + `--yes`, + `-vvv`, + ], + { cwd: t.cwd, stdio: [ 'ignore', 'inherit', 'inherit' ], buffer: false } + ); + + t.output( '\n=== Updating version numbers ===\n\n' ); + const ver = ( + await t.execa( changelogger, [ 'version', 'current' ], { + cwd: t.cwd, + stdio: [ 'ignore', 'pipe', 'inherit' ], + } ) + ).stdout; + await t.execa( npath.resolve( 'tools/project-version.sh' ), [ '-v', '-u', ver, t.project ], { + stdio: [ 'ignore', 'inherit', 'inherit' ], + buffer: false, + } ); + await t.execa( + npath.resolve( 'tools/replace-next-version-tag.sh' ), + [ '-v', t.project, ver ], + { stdio: [ 'ignore', 'inherit', 'inherit' ], buffer: false } + ); + + // Reload composer.json after the above may have changed it. + composerJson = JSON.parse( + await fs.readFile( `${ t.cwd }/composer.json`, { encoding: 'utf8' } ) + ); + } else { + t.output( 'Not updating changelog, there are no change files\n' ); + } + } + // Determine the composer script to run. const scripts = t.argv.production ? [ 'build-production', 'build-development' ] @@ -707,67 +778,6 @@ async function buildProject( t ) { return; } - // Update the changelog, if applicable. - if ( - t.project === 'packages/changelogger' || - composerJson.require?.[ 'automattic/jetpack-changelogger' ] || - composerJson[ 'require-dev' ]?.[ 'automattic/jetpack-changelogger' ] - ) { - const changelogger = npath.resolve( 'projects/packages/changelogger/bin/changelogger' ); - const changesDir = npath.resolve( - t.cwd, - composerJson.extra?.changelogger?.[ 'changes-dir' ] || 'changelog' - ); - t.output( '\n=== Updating changelog ===\n\n' ); - if ( - await fs.readdir( changesDir ).then( - a => a.filter( f => ! f.startsWith( '.' ) ).length > 0, - () => false - ) - ) { - let prerelease = 'alpha'; - if ( composerJson.extra?.[ 'dev-releases' ] ) { - const m = ( - await t.execa( changelogger, [ 'version', 'current', '--default-first-version' ], { - cwd: t.cwd, - stdio: [ 'ignore', 'pipe', 'inherit' ], - } ) - ).stdout.match( /^.*-a\.(\d+)$/ ); - // eslint-disable-next-line no-bitwise - prerelease = 'a.' + ( m ? ( parseInt( m[ 1 ] ) & ~1 ) + 2 : 0 ); - } - await t.execa( - changelogger, - [ - 'write', - '--prologue=This is an alpha version! The changes listed here are not final.', - '--default-first-version', - `--prerelease=${ prerelease }`, - `--release-date=unreleased`, - `--no-interaction`, - `--yes`, - `-vvv`, - ], - { cwd: t.cwd, stdio: [ 'ignore', 'inherit', 'inherit' ], buffer: false } - ); - - t.output( '\n=== Updating $$next-version$$ ===\n\n' ); - const ver = ( - await t.execa( changelogger, [ 'version', 'current' ], { - cwd: t.cwd, - stdio: [ 'ignore', 'pipe', 'inherit' ], - } ) - ).stdout; - await t.execa( - npath.resolve( 'tools/replace-next-version-tag.sh' ), - [ '-v', t.project, ver ], - { stdio: [ 'ignore', 'inherit', 'inherit' ], buffer: false } - ); - } else { - t.output( 'Not updating changelog, there are no change files\n' ); - } - } - // Read mirror repo from composer.json. t.output( '\n=== Mirroring ===\n\n' ); const gitSlug = composerJson.extra?.[ 'mirror-repo' ]; diff --git a/tools/cli/commands/release.js b/tools/cli/commands/release.js index aa0b4a1e37e98..119b55ae6254a 100644 --- a/tools/cli/commands/release.js +++ b/tools/cli/commands/release.js @@ -50,6 +50,8 @@ export function releaseDefine( yargs ) { .option( 'init-next-cycle', { describe: 'For `version`, init the next release cycle', type: 'boolean', + hidden: true, + deprecated: 'No longer functional', } ); }, async argv => { @@ -165,10 +167,16 @@ export async function scriptRouter( argv ) { jetpack release ${ argv.project } readme \n`.replace( /^\t+/gm, '' ); break; case 'version': + if ( argv.initNextCycle ) { + console.error( + 'The --init-next-cycle option is no longer useful, since we no longer set alpha versions in trunk.' + ); + process.exit( 1 ); + } argv.version = await getReleaseVersion( argv ); argv = await promptForVersion( argv ); argv.script = 'tools/project-version.sh'; - argv.scriptArgs = [ argv.initNextCycle ? '-Cu' : '-u', argv.version, argv.project ]; + argv.scriptArgs = [ '-u', argv.version, argv.project ]; argv.next = `Finished! Next, you will likely want to check the following project files to make sure versions were updated correctly: - The main php file diff --git a/tools/cli/commands/watch.js b/tools/cli/commands/watch.js index 1578720012621..e62dd137dd30e 100644 --- a/tools/cli/commands/watch.js +++ b/tools/cli/commands/watch.js @@ -65,7 +65,7 @@ export async function watchCli( options ) { if ( options.project ) { const data = readComposerJson( options.project ); - data !== false ? await watch( options.project, data ) : false; + data !== false && ( await watch( options.project, data ) ); } else { console.error( chalk.red( 'You did not choose a project!' ) ); } @@ -107,10 +107,9 @@ function hasWatchStep( project, composerJson ) { } // There's no watch step defined. - output - ? console.warn( - chalk.yellow( 'This project does not have a watch step defined in composer.json.' ) - ) - : null; + output && + console.warn( + chalk.yellow( 'This project does not have a watch step defined in composer.json.' ) + ); return false; } diff --git a/tools/cli/helpers/json.js b/tools/cli/helpers/json.js index 7b0de6180adad..c8be7e2da5e79 100644 --- a/tools/cli/helpers/json.js +++ b/tools/cli/helpers/json.js @@ -18,7 +18,7 @@ function readJson( project, packageManager, output ) { try { data = fs.readFileSync( `projects/${ project }/${ file }`, 'utf8' ); } catch ( err ) { - output ? log( chalk.yellow( `This project does not have a ${ file } file.` ) ) : null; + output && log( chalk.yellow( `This project does not have a ${ file } file.` ) ); return undefined; } @@ -40,7 +40,7 @@ function writeJson( project, packageManager, json, pkgDir, output ) { try { fs.writeFileSync( pkgDir + '/' + file, createJSON( json ) ); } catch ( err ) { - output ? console.error( chalk.red( `Could not write the json file.` ), err ) : null; + output && console.error( chalk.red( `Could not write the json file.` ), err ); } } @@ -103,9 +103,7 @@ function parseJSON( data, output = false ) { try { return JSON.parse( data ); } catch ( parseError ) { - output - ? log( chalk.red( 'Could not parse JSON. Something is pretty wrong.' ), parseError ) - : null; + output && log( chalk.red( 'Could not parse JSON. Something is pretty wrong.' ), parseError ); return undefined; } } @@ -121,9 +119,8 @@ function createJSON( data, output = false ) { try { return JSON.stringify( data, null, 2 ); } catch ( parseError ) { - output - ? log( chalk.red( 'Could not stringify JSON. Something is pretty wrong.' ), parseError ) - : null; + output && + log( chalk.red( 'Could not stringify JSON. Something is pretty wrong.' ), parseError ); return undefined; } } diff --git a/tools/cli/helpers/prefix-stream.js b/tools/cli/helpers/prefix-stream.js index 381b9ced5e256..b4b49122e368a 100644 --- a/tools/cli/helpers/prefix-stream.js +++ b/tools/cli/helpers/prefix-stream.js @@ -20,7 +20,8 @@ export default class PrefixStream extends FilterStream { */ constructor( options = {} ) { const opts = { ...options }; - delete opts.prefix, opts.time; + delete opts.prefix; + delete opts.time; super( s => this.#addPrefix( s ), opts ); this.#prefix = options.prefix || ''; diff --git a/tools/includes/proceed_p.sh b/tools/includes/proceed_p.sh index 9cde6e0b89b2d..2613c81eaf4f9 100755 --- a/tools/includes/proceed_p.sh +++ b/tools/includes/proceed_p.sh @@ -35,7 +35,7 @@ function proceed_p { fi # Clear input before prompting - while read -r -t 0 OK; do read -r OK; done + while read -r -t 0.1 -n 10000 OK; do :; done local PROMPT [[ -n "$1" ]] && PROMPT="$1 " diff --git a/tools/jetpack-live-branches/jetpack-live-branches.user.js b/tools/jetpack-live-branches/jetpack-live-branches.user.js index 2874d22c6391f..e1268ddf81039 100644 --- a/tools/jetpack-live-branches/jetpack-live-branches.user.js +++ b/tools/jetpack-live-branches/jetpack-live-branches.user.js @@ -119,7 +119,7 @@ .then( body => { const plugins = []; - if ( body.hasOwnProperty( 'plugins' ) ) { + if ( Object.hasOwn( body, 'plugins' ) ) { const labels = new Set( $.map( $( '.js-issue-labels a.IssueLabel' ), e => $( e ).data( 'name' ) ) ); diff --git a/tools/js-tools/eslintrc/base.js b/tools/js-tools/eslintrc/base.js index 18fb9eae54bab..3b821a25d58c1 100644 --- a/tools/js-tools/eslintrc/base.js +++ b/tools/js-tools/eslintrc/base.js @@ -210,12 +210,11 @@ module.exports = { ], strict: [ 'error', 'never' ], + // We may want to keep these overrides. To decide later. + eqeqeq: [ 'error', 'always', { null: 'ignore' } ], + 'no-unused-expressions': [ 'error', { allowShortCircuit: true, allowTernary: true } ], // Temporarily override plugin:@wordpress/* so we can clean up failing stuff in separate PRs. - eqeqeq: [ 'error', 'allow-null' ], 'jsx-a11y/label-has-associated-control': [ 'error', { assert: 'either' } ], - 'no-prototype-builtins': 'off', - 'no-undef-init': 'off', - 'no-unused-expressions': 'off', 'object-shorthand': 'off', '@wordpress/no-base-control-with-label-without-id': 'off', '@wordpress/no-global-active-element': 'off', diff --git a/tools/project-version.sh b/tools/project-version.sh index b17b5999811f5..37a0deca6448c 100755 --- a/tools/project-version.sh +++ b/tools/project-version.sh @@ -5,7 +5,6 @@ set -eo pipefail BASE=$(cd $(dirname "${BASH_SOURCE[0]}")/.. && pwd) . "$BASE/tools/includes/check-osx-bash-version.sh" . "$BASE/tools/includes/chalk-lite.sh" -. "$BASE/tools/includes/changelogger.sh" . "$BASE/tools/includes/plugin-functions.sh" # Print help and exit. @@ -15,15 +14,13 @@ function usage { Check that the project's versions are updated to the specified version. - usage: $0 [-f] [-C] [-v] -u version + usage: $0 [-f] [-v] -u version Update the versions of the specified project. Specifying -f updates the referenced version in other packages that depend on the updated package (see tools/check-intra-monorepo-deps.sh -ua). - Specifying -C creates a changelog entry for the project's version bump. - The following version numbers are updated: - Version in the WordPress plugin header, if applicable. - Version in composer.json, if any. @@ -42,7 +39,6 @@ fi OP= VERBOSE=false FIX_INTRA_MONOREPO_DEPS=false -DO_CHANGELOG=false while getopts ":c:u:fCvsh" opt; do case ${opt} in c) @@ -58,7 +54,7 @@ while getopts ":c:u:fCvsh" opt; do OPING=Updating ;; C) - DO_CHANGELOG=true + die 'The -C option has been removed. Since we no longer set alpha versions in trunk, CI would just call for the version change to be reverted.' ;; f) FIX_INTRA_MONOREPO_DEPS=true @@ -244,14 +240,6 @@ while IFS=" " read -r C F; do sedver "$BASE/projects/$SLUG/$F" "$PAT" "$VERSION" "version constant $C" done < <(jq -r '.extra["version-constants"] // {} | to_entries | .[] | .key + " " + .value' "$FILE") -# Add change entry, if applicable - -if $DO_CHANGELOG; then - cd "$BASE/projects/$SLUG" - changelogger_add '' "Init $VERSION" --filename=init-release-cycle --filename-auto-suffix - cd "$BASE" -fi - # Update other dependencies if $FIX_INTRA_MONOREPO_DEPS; then diff --git a/tools/release-plugin.sh b/tools/release-plugin.sh index 93a97068a85d5..18167951e4184 100755 --- a/tools/release-plugin.sh +++ b/tools/release-plugin.sh @@ -342,15 +342,6 @@ yellow "Release branches created!" yellow "Creating a PR to merge the prerelease branch into trunk." git checkout prerelease -# If we're releasing the Jetpack plugin, ask if we want to start a new cycle. -if [[ -v PROJECTS["plugins/jetpack"] ]]; then - if proceed_p "Do you want to start a new cycle for Jetpack?" "" Y; then - pnpm jetpack release plugins/jetpack version -a --init-next-cycle - git add --all - git commit -am "Init new cycle" - fi -fi - # Handle any package changes merged into trunk while we were working. git fetch git merge origin/trunk