Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/trunk' into update/node-20
Browse files Browse the repository at this point in the history
  • Loading branch information
anomiex committed Nov 13, 2023
2 parents fe07b86 + 14e49bc commit 1c308f7
Show file tree
Hide file tree
Showing 223 changed files with 2,964 additions and 1,187 deletions.
35 changes: 0 additions & 35 deletions .github/files/e2e-tests/e2e-matrix.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,6 @@ const projects = [
suite: '',
buildGroup: 'jetpack-sync',
},
{
project: 'Jetpack blocks',
path: 'projects/plugins/jetpack/tests/e2e',
testArgs: [ 'specs/blocks', '--retries=1' ],
targets: [ 'plugins/jetpack' ],
suite: '',
buildGroup: 'jetpack-core',
},
{
project: 'Jetpack Boost - Base',
path: 'projects/plugins/boost/tests/e2e',
Expand Down Expand Up @@ -125,33 +117,6 @@ switch ( process.env.GITHUB_EVENT_NAME ) {
const refName = process.env.REF_NAME;
const refType = process.env.REF_TYPE;

if ( repoName === 'jetpack-production' ) {
projects.push( {
project: 'Blocks with latest Gutenberg',
path: 'projects/plugins/jetpack/tests/e2e',
testArgs: [ 'blocks', '--retries=1' ],
suite: 'gutenberg',
} );

if ( refType === 'tag' || refName === 'trunk' ) {
projects.push( {
project: 'Jetpack on Atomic',
path: 'projects/plugins/jetpack/tests/e2e',
testArgs: [ 'blocks', '--retries=1' ],
suite: 'atomic',
} );
}

if ( refName === 'trunk' ) {
projects.push( {
project: 'Jetpack on VIP',
path: 'projects/plugins/jetpack/tests/e2e',
testArgs: [ 'blocks', '--retries=1' ],
suite: 'vip',
} );
}
}

for ( const project of projects ) {
const packageJson = JSON.parse(
fs.readFileSync( `${ project.path }/package.json`, 'utf8' )
Expand Down
34 changes: 34 additions & 0 deletions pnpm-lock.yaml

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

6 changes: 6 additions & 0 deletions projects/js-packages/ai-client/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.1.15] - 2023-11-13
### Changed
- Prevented dispatching the `done` event for JETPACK_AI_ERROR. [#34051]
- Ensured the unclear prompt error is dispatched only once per request. [#34025]

## [0.1.14] - 2023-11-03

## [0.1.13] - 2023-10-23
Expand Down Expand Up @@ -153,6 +158,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Updated package dependencies. [#31659]
- Updated package dependencies. [#31785]

[0.1.15]: https://github.com/Automattic/jetpack-ai-client/compare/v0.1.14...v0.1.15
[0.1.14]: https://github.com/Automattic/jetpack-ai-client/compare/v0.1.13...v0.1.14
[0.1.13]: https://github.com/Automattic/jetpack-ai-client/compare/v0.1.12...v0.1.13
[0.1.12]: https://github.com/Automattic/jetpack-ai-client/compare/v0.1.11...v0.1.12
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion projects/js-packages/ai-client/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": false,
"name": "@automattic/jetpack-ai-client",
"version": "0.1.15-alpha",
"version": "0.1.16-alpha",
"description": "A JS client for consuming Jetpack AI services",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/ai-client/#readme",
"bugs": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,14 @@ export default class SuggestionsEventSource extends EventTarget {

processEvent( e: EventSourceMessage ) {
if ( e.data === '[DONE]' ) {
/*
* Check if the unclear prompt event was already dispatched,
* to ensure that it is dispatched only once per request.
*/
if ( this.errorUnclearPromptTriggered ) {
return;
}

if ( this.fullMessage.length ) {
// Dispatch an event with the full content
this.dispatchEvent( new CustomEvent( 'done', { detail: this.fullMessage } ) );
Expand Down
5 changes: 5 additions & 0 deletions projects/js-packages/components/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 Components package releases.

## [0.45.0] - 2023-11-13
### Fixed
- Fixed React warnings in Boost Score Graph. [#34014]

## [0.44.4] - 2023-11-03
### Changed
- Updated package dependencies. [#33904]
Expand Down Expand Up @@ -872,6 +876,7 @@
### Changed
- Update node version requirement to 14.16.1

[0.45.0]: https://github.com/Automattic/jetpack-components/compare/0.44.4...0.45.0
[0.44.4]: https://github.com/Automattic/jetpack-components/compare/0.44.3...0.44.4
[0.44.3]: https://github.com/Automattic/jetpack-components/compare/0.44.2...0.44.3
[0.44.2]: https://github.com/Automattic/jetpack-components/compare/0.44.1...0.44.2
Expand Down

This file was deleted.

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.45.0-alpha",
"version": "0.45.1-alpha",
"description": "Jetpack Components Package",
"author": "Automattic",
"license": "GPL-2.0-or-later",
Expand Down
5 changes: 5 additions & 0 deletions projects/js-packages/connection/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 Connection Component releases.

## [0.30.6] - 2023-11-13
### Changed
- Updated dependencies.

## [0.30.5] - 2023-10-23
### Added
- Added getCalypsoOrigin() helper function. [#33257]
Expand Down Expand Up @@ -652,6 +656,7 @@
- `Main` and `ConnectUser` components added.
- `JetpackRestApiClient` API client added.

[0.30.6]: https://github.com/Automattic/jetpack-connection-js/compare/v0.30.5...v0.30.6
[0.30.5]: https://github.com/Automattic/jetpack-connection-js/compare/v0.30.4...v0.30.5
[0.30.4]: https://github.com/Automattic/jetpack-connection-js/compare/v0.30.3...v0.30.4
[0.30.3]: https://github.com/Automattic/jetpack-connection-js/compare/v0.30.2...v0.30.3
Expand Down
2 changes: 1 addition & 1 deletion projects/js-packages/connection/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@automattic/jetpack-connection",
"version": "0.30.6-alpha",
"version": "0.30.7-alpha",
"description": "Jetpack Connection Component",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/connection/#readme",
"bugs": {
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.10.51 - 2023-11-13
### Changed
- Updated dependencies.

## 0.10.50 - 2023-10-19
### Changed
- Updated package dependencies. [#33687]
Expand Down
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.10.51-alpha",
"version": "0.10.52-alpha",
"description": "Jetpack Connection Component",
"author": "Automattic",
"license": "GPL-2.0-or-later",
Expand Down
4 changes: 4 additions & 0 deletions projects/js-packages/licensing/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 0.11.11 - 2023-11-13
### Changed
- Updated dependencies.

## 0.11.10 - 2023-10-19
### Changed
- Updated package dependencies. [#33687]
Expand Down
2 changes: 1 addition & 1 deletion projects/js-packages/licensing/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@automattic/jetpack-licensing",
"version": "0.11.11-alpha",
"version": "0.11.12-alpha",
"description": "Jetpack licensing flow",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/licensing/#readme",
"bugs": {
Expand Down
4 changes: 4 additions & 0 deletions projects/js-packages/partner-coupon/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 0.2.59 - 2023-11-13
### Changed
- Updated dependencies.

## 0.2.58 - 2023-10-23
### Changed
- Updated package dependencies. [#33646] [#33687]
Expand Down
2 changes: 1 addition & 1 deletion projects/js-packages/partner-coupon/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@automattic/jetpack-partner-coupon",
"version": "0.2.59-alpha",
"version": "0.2.60-alpha",
"description": "This package aims to add components to make it easier to redeem partner coupons",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/partner-coupon/#readme",
"bugs": {
Expand Down
5 changes: 5 additions & 0 deletions projects/js-packages/publicize-components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.41.4] - 2023-11-13
### Changed
- Updated dependencies.

## [0.41.3] - 2023-11-08
### Fixed
- Social: Fixed an issue where initial state of the Jetpack Social toggle is not in sync. [#33969]
Expand Down Expand Up @@ -495,6 +499,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Updated package dependencies. [#24470]

[0.41.4]: https://github.com/Automattic/jetpack-publicize-components/compare/v0.41.3...v0.41.4
[0.41.3]: https://github.com/Automattic/jetpack-publicize-components/compare/v0.41.2...v0.41.3
[0.41.2]: https://github.com/Automattic/jetpack-publicize-components/compare/v0.41.1...v0.41.2
[0.41.1]: https://github.com/Automattic/jetpack-publicize-components/compare/v0.41.0...v0.41.1
Expand Down
2 changes: 1 addition & 1 deletion projects/js-packages/publicize-components/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@automattic/jetpack-publicize-components",
"version": "0.41.4-alpha",
"version": "0.41.5-alpha",
"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": {
Expand Down
5 changes: 5 additions & 0 deletions projects/js-packages/shared-extension-utils/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.13.0] - 2023-11-13
### Added
- Added a Redux store for Jetpack modules data. [#33397]

## [0.12.6] - 2023-11-08
### Fixed
- Mobile: Fix a regression preventing correct block registration on mobile. [#33890]
Expand Down Expand Up @@ -280,6 +284,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Core: prepare utility for release

[0.13.0]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/0.12.6...0.13.0
[0.12.6]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/0.12.5...0.12.6
[0.12.5]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/0.12.4...0.12.5
[0.12.4]: https://github.com/Automattic/jetpack-shared-extension-utils/compare/0.12.3...0.12.4
Expand Down
58 changes: 58 additions & 0 deletions projects/js-packages/shared-extension-utils/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,64 @@ of the Jetpack plugin, so that plugins can share it. To begin with, we moving
the code used by the Publicize editor extension, but the goal is to bring over
all the shared code.

## Fetching modules data from the store
The package relies on [controls](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-data/#controls)
and [resolvers](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-data/#resolvers)
to pull modules data from the API, and put it into the package's Redux store.

### Basic Usage

In order to have all modules related data synced within different packages, let's use this Redux store as a source of truth, for both, getting and updating the data.


Use [`withSelect`](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-data/#withselect), `withDispatch` higher-order component to pull the data or [`useSelect`](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-data/#useselect) hook to pull the data from the store to pull directly in component. Example:


```jsx
// Imports.
import { withSelect, withDispatch } from '@wordpress/data';
import { JETPACK_MODULES_STORE_ID } from '@automattic/jetpack-shared-extension-utils';

const SampleComponent = props => {
const { isModuleActive, isLoadingModules, isChangingStatus, updateJetpackModuleStatus } = props;

if ( isModuleActive ) {
return <div>Module is active</div>;
}

if ( isLoadingModules ) {
return <div>Loading modules...</div>;
}

if ( !isModuleActive ) {
return <button onClick={ () => updateJetpackModuleStatus( 'contact-form', true ) }>
Activate module
</button>;
}

return <div>Active contact form module</div>;
}

// We wrap `SampleComponent` into the composition of `withSelect` and `withDispatch` HOCs,
// which will pull the data from the store and pass as a parameter into the component.
// Jetpack modules will be pulled after first selection `isModuleActive`.
export default compose( [
withSelect( ( select, props ) => {
const { isModuleActive, areModulesLoading, areModulesUpdating } = select( 'jetpack-modules' );
return {
isModuleActive: isModuleActive( 'contact-form' ),
isLoadingModules: areModulesLoading(),
isChangingStatus: areModulesUpdating(),
};
} ),
withDispatch( dispatch => {
const { updateJetpackModuleStatus } = dispatch( 'jetpack-modules' );
return { updateJetpackModuleStatus };
} ),
] )( ( SampleComponent ) );
```


## How to install shared-extension-utils

### Installation From Git Repo
Expand Down
2 changes: 2 additions & 0 deletions projects/js-packages/shared-extension-utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ export { default as useAnalytics } from './src/hooks/use-analytics';
export { default as useModuleStatus } from './src/hooks/use-module-status';
export { default as JetpackEditorPanelLogo } from './src/components/jetpack-editor-panel-logo';
export { getBlockIconComponent, getBlockIconProp } from './src/get-block-icon-from-metadata';

export * from './src/modules-state';
Loading

0 comments on commit 1c308f7

Please sign in to comment.