Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/trunk' into update/jsdoc-comment…
Browse files Browse the repository at this point in the history
…s-for-wp-coding-standards
  • Loading branch information
anomiex committed Jul 25, 2024
2 parents 1222990 + bf0b6a7 commit 3bd5025
Show file tree
Hide file tree
Showing 174 changed files with 1,634 additions and 1,152 deletions.
33 changes: 33 additions & 0 deletions .github/files/select-wordpress-tag.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

## Environment used by this script:
#
# Required:
# - WP_BRANCH: Version of WordPress to check out.
#
# Other:
# - GITHUB_ENV: File written to to set environment variables for later steps.

set -eo pipefail

case "$WP_BRANCH" in
trunk)
WORDPRESS_TAG=trunk
;;
latest)
WORDPRESS_TAG=$(php ./tools/get-wp-version.php)
;;
previous)
# We hard-code the version here because there's a time near WP releases where
# we've dropped the old 'previous' but WP hasn't actually released the new 'latest'
WORDPRESS_TAG=6.5
;;
*)
echo "Unrecognized value for WP_BRANCH: $WP_BRANCH" >&2
exit 1
;;
esac

if [[ -n "$GITHUB_ENV" ]]; then
echo "WORDPRESS_TAG=$WORDPRESS_TAG" >> "$GITHUB_ENV"
fi
19 changes: 1 addition & 18 deletions .github/files/setup-wordpress-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,7 @@ mysql -e "CREATE DATABASE wordpress_tests;"
echo "::endgroup::"

echo "::group::Preparing WordPress from \"$WP_BRANCH\" branch";
case "$WP_BRANCH" in
trunk)
WORDPRESS_TAG=trunk
;;
latest)
WORDPRESS_TAG=$(php ./tools/get-wp-version.php)
;;
previous)
# We hard-code the version here because there's a time near WP releases where
# we've dropped the old 'previous' but WP hasn't actually released the new 'latest'
WORDPRESS_TAG=6.5
;;
*)
echo "Unrecognized value for WP_BRANCH: $WP_BRANCH" >&2
exit 1
;;
esac
source .github/files/select-wordpress-tag.sh
git clone --depth=1 --branch "$WORDPRESS_TAG" git://develop.git.wordpress.org/ "/tmp/wordpress-$WP_BRANCH"
# We need a built version of WordPress to test against, so download that into the src directory instead of what's in wordpress-develop.
rm -rf "/tmp/wordpress-$WP_BRANCH/src"
Expand All @@ -56,7 +40,6 @@ echo "::endgroup::"
if [[ -n "$GITHUB_ENV" ]]; then
echo "WORDPRESS_DEVELOP_DIR=/tmp/wordpress-$WP_BRANCH" >> "$GITHUB_ENV"
echo "WORDPRESS_DIR=/tmp/wordpress-$WP_BRANCH/src" >> "$GITHUB_ENV"
echo "WORDPRESS_TAG=$WORDPRESS_TAG" >> "$GITHUB_ENV"
fi

# Don't symlink, it breaks when copied later.
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ jobs:
echo "projects=${CHANGED}" >> "$GITHUB_OUTPUT"
echo "any-plugins=${ANY_PLUGINS}" >> "$GITHUB_OUTPUT"
- name: Select WordPress version
if: steps.changed.outputs.any-plugins != 'true' && matrix.wp != 'none'
run: .github/files/select-wordpress-tag.sh

- name: Setup WordPress environment for plugin tests
env:
API_TOKEN_GITHUB: ${{ secrets.GITHUB_TOKEN }}
Expand Down
20 changes: 10 additions & 10 deletions .phan/stubs/wpcom-stubs.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* `bin/teamcity-builds/jetpack-stubs/stub-defs.php` and regenerate the stubs
* by triggering the Jetpack Staging → Update WPCOM Stubs job in TeamCity.
*
* Stubs automatically generated from WordPress.com commit e4bff119a0ef34bd626cc234b0f63e0ad9de74a6.
* Stubs automatically generated from WordPress.com commit 2a880921ff80b3bf99b4f9e4a98d41471543ff2b.
*/

namespace {
Expand Down Expand Up @@ -1172,15 +1172,6 @@ public function get_errors()
{
}
}
class WP_Enqueue_Dynamic_Script
{
/**
* @param string $handle
*/
public static function enqueue_script($handle)
{
}
}
/**
* @param int|null $blog_id
* @return int|string|false
Expand Down Expand Up @@ -1274,6 +1265,15 @@ public function maybe_prepopulate_option()
{
}
}
class WP_Enqueue_Dynamic_Script
{
/**
* @param string $handle
*/
public static function enqueue_script($handle)
{
}
}
class WPCOM_REST_API_V2_Endpoint_Jetpack_Auth extends \WP_REST_Controller
{
/**
Expand Down
4 changes: 2 additions & 2 deletions docs/monorepo.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ We use `composer.json` to hold metadata about projects. Much of our generic tool
* `.extra.autotagger`: Set truthy to enable automatic release-version tagging in the mirror repo. See [Mirror repositories > Autotagger](#autotagger) for details.
* `.extra.changelogger`: Configuration object for [Changelogger](#jetpack-changelogger). See [its documentation](https://github.com/Automattic/jetpack-changelogger#configuration) for details.
* `.extra.changelogger-default-type`: Certain of our tools automatically create Changelogger change entries. This is the value to use for `--type` when doing so. Default type is `changed`.
* `.extra.dependencies.build`: This optional array specifies the "slugs" of any within-monorepo build dependencies that can't otherwise be inferred. The "slug" consists of the two levels of directory under `projects/`, e.g. `plugins/jetpack` or `packages/lazy-images`.
* `.extra.dependencies.test`: This optional array specifies the "slugs" of any within-monorepo testing dependencies that can't otherwise be inferred. The "slug" consists of the two levels of directory under `projects/`, e.g. `plugins/jetpack` or `packages/lazy-images`. See [Testing](#testing) for details.
* `.extra.dependencies.build`: This optional array specifies the "slugs" of any within-monorepo build dependencies that can't otherwise be inferred. The "slug" consists of the two levels of directory under `projects/`, e.g. `plugins/jetpack` or `packages/changelogger`.
* `.extra.dependencies.test`: This optional array specifies the "slugs" of any within-monorepo testing dependencies that can't otherwise be inferred. The "slug" consists of the two levels of directory under `projects/`, e.g. `plugins/jetpack` or `packages/changelogger`. See [Testing](#testing) for details.
* `.extra.dependencies.test-only`: This optional array specifies the "slugs" of any within-monorepo dependencies that are only used for testing and/or static analysis and should be ignored otherwise when analyzing intra-monorepo dependencies.
* `.extra.dev-releases`: Indicate that the plugin will have developer alpha releases. Instead of the mirror repositories showing "VER-alpha", they'll start at "VER-a.0" and you can use the `-a` flag to the release tooling to release "VER-a.1".
* `.extra.mirror-repo`: This specifies the name of the GitHub mirror repo, i.e. the "Automattic/jetpack-_something_" in "<span>https://</span>github.com/Automattic/jetpack-_something_".
Expand Down
37 changes: 26 additions & 11 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

AI Logo Generator: make the initial prompt update when the site name and description are fully laoded from store.
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ Site description: ${ description }`;
throw error;
}
},
[ setFirstLogoPromptFetchError, increaseAiAssistantRequestsCount ]
[ setFirstLogoPromptFetchError, increaseAiAssistantRequestsCount, name, description ]
);

const enhancePrompt = async function ( { prompt }: { prompt: string } ): Promise< string > {
Expand Down
8 changes: 8 additions & 0 deletions projects/js-packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

### This is a list detailing changes for the Jetpack RNA Components package releases.

## [0.55.1] - 2024-07-25
### Added
- Added `className` prop to `Alert` component [#38450]

### Changed
- React compatibility: Ensuring createRoot is not called more than once. [#38495]

## [0.55.0] - 2024-07-22
### Removed
- Remove compatibility with WordPress 6.4. [#38386]
Expand Down Expand Up @@ -1091,6 +1098,7 @@
### Changed
- Update node version requirement to 14.16.1

[0.55.1]: https://github.com/Automattic/jetpack-components/compare/0.55.0...0.55.1
[0.55.0]: https://github.com/Automattic/jetpack-components/compare/0.54.4...0.55.0
[0.54.4]: https://github.com/Automattic/jetpack-components/compare/0.54.3...0.54.4
[0.54.3]: https://github.com/Automattic/jetpack-components/compare/0.54.2...0.54.3
Expand Down
21 changes: 15 additions & 6 deletions projects/js-packages/components/components/alert/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ type AlertProps = {

/** Children to be rendered inside the alert. */
children: React.ReactNode;

/** Wrapper class name */
className?: string;
};

const getIconByLevel = ( level: AlertProps[ 'level' ] ) => {
Expand All @@ -32,14 +35,20 @@ const getIconByLevel = ( level: AlertProps[ 'level' ] ) => {
/**
* Alert component
*
* @param {object} props - The component properties.
* @param {string} props.level - The alert level: error, warning, info, success.
* @param {boolean} props.showIcon - Whether to show the alert icon.
* @param {React.Component} props.children - The alert content.
* @param {object} props - The component properties.
* @param {string} props.level - The alert level: error, warning, info, success.
* @param {boolean} props.showIcon - Whether to show the alert icon.
* @param {string} props.className - The wrapper class name.
* @param {React.Component} props.children - The alert content.
* @return {React.ReactElement} The `Alert` component.
*/
const Alert: React.FC< AlertProps > = ( { level = 'warning', children, showIcon = true } ) => {
const classes = clsx( styles.container, styles[ `is-${ level }` ] );
const Alert: React.FC< AlertProps > = ( {
level = 'warning',
children,
showIcon = true,
className,
} ) => {
const classes = clsx( styles.container, styles[ `is-${ level }` ], className );

return (
<div className={ classes }>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ export function tooltipsPlugin( periods ) {
*/
function init( u: uPlot, _opts: object ) {
container.classList.add( 'jb-score-tooltips-container' );

reactDom = ReactDOM.createRoot( reactRoot );
if ( ! reactDom ) {
reactDom = ReactDOM.createRoot( reactRoot );
}
reactRoot.style.position = 'absolute';
reactRoot.style.bottom = -20 + 'px';
reactRoot.style.translate = '-50% calc( 100% - 20px )';
Expand Down
2 changes: 1 addition & 1 deletion projects/js-packages/components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@automattic/jetpack-components",
"version": "0.55.1-alpha",
"version": "0.55.2-alpha",
"description": "Jetpack Components Package",
"author": "Automattic",
"license": "GPL-2.0-or-later",
Expand Down
4 changes: 4 additions & 0 deletions projects/js-packages/idc/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

### This is a list detailing changes for the Jetpack RNA IDC package releases.

## 0.11.5 - 2024-07-23
### Fixed
- Updated package dependencies. [#38464]

## 0.11.4 - 2024-07-22
### Changed
- Update dependencies.
Expand Down
4 changes: 0 additions & 4 deletions projects/js-packages/idc/changelog/prerelease

This file was deleted.

2 changes: 1 addition & 1 deletion projects/js-packages/idc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@automattic/jetpack-idc",
"version": "0.11.5-alpha",
"version": "0.11.6-alpha",
"description": "Jetpack Connection Component",
"author": "Automattic",
"license": "GPL-2.0-or-later",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: added

Added mentioning of Manual Sharing
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Fixed broken connection notices to make them more helpful
Loading

0 comments on commit 3bd5025

Please sign in to comment.