Skip to content

Commit

Permalink
Update wordpress monorepo (#30375)
Browse files Browse the repository at this point in the history
* Update wordpress monorepo
* Remove `@types/wordpress__components`

  GB switched to including types in the package instead of using a
  `@types/` package.

  This also necessitated some code changes, since they're not publishing
  the component props (see WordPress/gutenberg#50157).

  Also of note is that their types for `ClipboardButton` are broken, in
  that they didn't declare that it also accepts all `Button`'s props.
  Since that component is deprecated anyway, we just replace use of it
  with the designated replacement.

---------

Co-authored-by: Renovate Bot <[email protected]>
Co-authored-by: Brad Jorsch <[email protected]>
  • Loading branch information
3 people authored May 2, 2023
1 parent b7a86b9 commit 4d165c0
Show file tree
Hide file tree
Showing 81 changed files with 1,492 additions and 1,440 deletions.
2,294 changes: 1,103 additions & 1,191 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

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

Updated package dependencies.
2 changes: 1 addition & 1 deletion projects/js-packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"license": "GPL-2.0-or-later",
"dependencies": {
"@automattic/jetpack-config": "workspace:*",
"@wordpress/url": "3.31.0"
"@wordpress/url": "3.33.0"
},
"devDependencies": {
"jest": "29.4.3",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Updated package dependencies.
4 changes: 2 additions & 2 deletions projects/js-packages/base-styles/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@automattic/jetpack-base-styles",
"version": "0.4.3",
"version": "0.4.4-alpha",
"description": "Jetpack components base styles",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/base-styles/#readme",
"bugs": {
Expand All @@ -20,7 +20,7 @@
"build-production-js": "echo 'Not implemented.'"
},
"devDependencies": {
"@wordpress/base-styles": "4.21.0"
"@wordpress/base-styles": "4.23.0"
},
"engines": {
"node": "^18.13.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Updated package dependencies.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import type { Popover } from '@wordpress/components';

export type ActionPopoverProps = Popover.Props & {
export type ActionPopoverProps = React.ComponentProps< typeof Popover > & {
anchor?: Element;
offset?: number;
} & {
Expand Down
6 changes: 2 additions & 4 deletions projects/js-packages/components/components/button/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ type JetpackButtonBaseProps = {
ref: React.ForwardedRef< unknown >;
};

type JetpackLinkProps = Omit< Button.AnchorProps, 'size' | 'variant' >;
type WPButtonProps = Omit< React.ComponentProps< typeof Button >, 'size' | 'variant' >;

type JetpackButtonProps = Omit< Button.ButtonProps, 'size' | 'variant' >;

export type ButtonProps = JetpackButtonBaseProps & ( JetpackLinkProps | JetpackButtonProps );
export type ButtonProps = JetpackButtonBaseProps & WPButtonProps;
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export type PricingCardProps = {
/**
* The CTA callback to be called on click.
*/
onCtaClick?: Button.ButtonProps[ 'onClick' ];
onCtaClick?: React.ComponentProps< typeof Button >[ 'onClick' ];
/**
* Optional informative text.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
import type { Button, DropdownMenu } from '@wordpress/components';

type AllowedDropdownMenuProps = Pick<
DropdownMenu.PropsWithControls,
React.ComponentProps< typeof DropdownMenu >,
'controls' | 'popoverProps' | 'toggleProps' | 'label'
>;

export type SplitButtonProps = Omit< Button.ButtonProps, 'controls' > &
export type SplitButtonProps = Omit< React.ComponentProps< typeof Button >, 'controls' > &
AllowedDropdownMenuProps &
// make `controls` prop required
Required< Pick< AllowedDropdownMenuProps, 'controls' > >;
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ClipboardButton } from '@wordpress/components';
import { Button } from '@wordpress/components';
import { useCopyToClipboard } from '@wordpress/compose';
import Col from '../../layout/col';
import Container from '../../layout/container';
import ThemeProvider, { typography, colors, borders, spacing } from '../index';
Expand Down Expand Up @@ -48,6 +49,14 @@ const noop = () => {
//
};

const ClipboardButton: React.FC< React.ComponentProps< typeof Button > > = ( {
text,
...buttonProps
} ) => {
const ref = useCopyToClipboard( text, noop );
return <Button { ...buttonProps } ref={ ref } />;
};

const Section = ( { title, data, children = null } ) => (
<div className={ styles.section }>
<h1 className={ styles.title }>{ title }</h1>
Expand Down Expand Up @@ -97,13 +106,7 @@ export const Typographies = args => (
<div className={ styles[ 'font-instance' ] } style={ { fontSize: typography[ key ] } }>
{ args?.[ 'Text Instance' ] || `${ key } (${ typography[ key ] } )` }

<ClipboardButton
variant="tertiary"
text={ key }
isSecondary
onCopy={ noop }
className={ styles[ 'copy-button' ] }
>
<ClipboardButton variant="tertiary" text={ key } className={ styles[ 'copy-button' ] }>
Copy
</ClipboardButton>
</div>
Expand All @@ -130,8 +133,6 @@ export const Colors = () => (
<ClipboardButton
variant="tertiary"
text={ key }
isSecondary
onCopy={ noop }
className={ styles[ 'copy-button' ] }
style={ { color: getContrast( colors[ key ] ) } }
>
Expand Down
15 changes: 7 additions & 8 deletions projects/js-packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
"license": "GPL-2.0-or-later",
"dependencies": {
"@automattic/format-currency": "1.0.1",
"@wordpress/browserslist-config": "5.13.0",
"@wordpress/components": "23.7.0",
"@wordpress/compose": "6.7.0",
"@wordpress/date": "4.30.0",
"@wordpress/element": "5.7.0",
"@wordpress/i18n": "4.30.0",
"@wordpress/icons": "9.21.0",
"@wordpress/browserslist-config": "5.15.0",
"@wordpress/components": "23.9.0",
"@wordpress/compose": "6.9.0",
"@wordpress/date": "4.32.0",
"@wordpress/element": "5.9.0",
"@wordpress/i18n": "4.32.0",
"@wordpress/icons": "9.23.0",
"classnames": "2.3.2",
"prop-types": "^15.7.2",
"qrcode.react": "3.1.0"
Expand All @@ -33,7 +33,6 @@
"@types/react-dom": "18.0.10",
"@types/react-test-renderer": "18.0.0",
"@types/testing-library__jest-dom": "5.14.1",
"@types/wordpress__components": "23.0.1",
"jest": "29.4.3",
"jest-environment-jsdom": "29.4.3",
"react": "18.2.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Updated package dependencies.
14 changes: 7 additions & 7 deletions projects/js-packages/connection/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
"@automattic/jetpack-api": "workspace:*",
"@automattic/jetpack-components": "workspace:*",
"@automattic/jetpack-config": "workspace:*",
"@wordpress/base-styles": "4.21.0",
"@wordpress/browserslist-config": "5.13.0",
"@wordpress/components": "23.7.0",
"@wordpress/data": "9.0.0",
"@wordpress/element": "5.7.0",
"@wordpress/i18n": "4.30.0",
"@wordpress/icons": "9.21.0",
"@wordpress/base-styles": "4.23.0",
"@wordpress/browserslist-config": "5.15.0",
"@wordpress/components": "23.9.0",
"@wordpress/data": "9.2.0",
"@wordpress/element": "5.9.0",
"@wordpress/i18n": "4.32.0",
"@wordpress/icons": "9.23.0",
"classnames": "2.3.2",
"debug": "4.3.4",
"prop-types": "^15.7.2"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Updated package dependencies.
2 changes: 1 addition & 1 deletion projects/js-packages/eslint-config-target-es/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"semver": "^7.3.5"
},
"devDependencies": {
"@wordpress/browserslist-config": "5.13.0",
"@wordpress/browserslist-config": "5.15.0",
"eslint": "8.39.0",
"eslint-plugin-es": "4.1.0",
"jest": "29.4.3"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Updated package dependencies.
6 changes: 3 additions & 3 deletions projects/js-packages/i18n-loader-webpack-plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@automattic/i18n-loader-webpack-plugin",
"version": "2.0.30",
"version": "2.0.31-alpha",
"description": "A Webpack plugin to load WordPress i18n when Webpack lazy-loads a bundle.",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/i18n-loader-webpack-plugin/#readme",
"bugs": {
Expand All @@ -20,8 +20,8 @@
"debug": "^4.3.2"
},
"devDependencies": {
"@wordpress/dependency-extraction-webpack-plugin": "4.13.0",
"@wordpress/i18n": "4.30.0",
"@wordpress/dependency-extraction-webpack-plugin": "4.15.0",
"@wordpress/i18n": "4.32.0",
"jest": "29.4.3",
"webpack": "5.76.0",
"webpack-cli": "4.9.1"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Updated package dependencies.
14 changes: 7 additions & 7 deletions projects/js-packages/idc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
"@automattic/jetpack-api": "workspace:*",
"@automattic/jetpack-base-styles": "workspace:*",
"@automattic/jetpack-components": "workspace:*",
"@wordpress/base-styles": "4.21.0",
"@wordpress/components": "23.7.0",
"@wordpress/compose": "6.7.0",
"@wordpress/data": "9.0.0",
"@wordpress/element": "5.7.0",
"@wordpress/i18n": "4.30.0",
"@wordpress/url": "3.31.0",
"@wordpress/base-styles": "4.23.0",
"@wordpress/components": "23.9.0",
"@wordpress/compose": "6.9.0",
"@wordpress/data": "9.2.0",
"@wordpress/element": "5.9.0",
"@wordpress/i18n": "4.32.0",
"@wordpress/url": "3.33.0",
"prop-types": "^15.7.2"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Updated package dependencies.
8 changes: 4 additions & 4 deletions projects/js-packages/licensing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
"@automattic/jetpack-analytics": "workspace:*",
"@automattic/jetpack-api": "workspace:*",
"@automattic/jetpack-components": "workspace:*",
"@wordpress/components": "23.7.0",
"@wordpress/element": "5.7.0",
"@wordpress/i18n": "4.30.0",
"@wordpress/icons": "9.21.0",
"@wordpress/components": "23.9.0",
"@wordpress/element": "5.9.0",
"@wordpress/i18n": "4.32.0",
"@wordpress/icons": "9.23.0",
"classnames": "2.3.2",
"prop-types": "15.7.2"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Updated package dependencies.
6 changes: 3 additions & 3 deletions projects/js-packages/partner-coupon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
"@testing-library/dom": "8.19.1",
"@testing-library/react": "13.4.0",
"@testing-library/user-event": "14.4.3",
"@wordpress/base-styles": "4.21.0",
"@wordpress/data": "9.0.0",
"@wordpress/base-styles": "4.23.0",
"@wordpress/data": "9.2.0",
"jest": "29.4.3",
"jest-environment-jsdom": "29.4.3",
"jest-extended": "2.0.0",
Expand All @@ -42,7 +42,7 @@
"dependencies": {
"@automattic/jetpack-components": "workspace:*",
"@automattic/jetpack-connection": "workspace:*",
"@wordpress/i18n": "4.30.0",
"@wordpress/i18n": "4.32.0",
"classnames": "2.3.2",
"prop-types": "15.7.2"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Updated package dependencies.
28 changes: 14 additions & 14 deletions projects/js-packages/publicize-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@
"@automattic/jetpack-connection": "workspace:*",
"@automattic/jetpack-shared-extension-utils": "workspace:*",
"@automattic/social-previews": "1.1.5",
"@wordpress/annotations": "2.30.0",
"@wordpress/api-fetch": "6.27.0",
"@wordpress/block-editor": "11.7.0",
"@wordpress/blocks": "12.7.0",
"@wordpress/components": "23.7.0",
"@wordpress/compose": "6.7.0",
"@wordpress/data": "9.0.0",
"@wordpress/editor": "13.7.0",
"@wordpress/element": "5.7.0",
"@wordpress/hooks": "3.30.0",
"@wordpress/i18n": "4.30.0",
"@wordpress/icons": "9.21.0",
"@wordpress/notices": "3.30.0",
"@wordpress/annotations": "2.32.0",
"@wordpress/api-fetch": "6.29.0",
"@wordpress/block-editor": "12.0.0",
"@wordpress/blocks": "12.9.0",
"@wordpress/components": "23.9.0",
"@wordpress/compose": "6.9.0",
"@wordpress/data": "9.2.0",
"@wordpress/editor": "13.9.0",
"@wordpress/element": "5.9.0",
"@wordpress/hooks": "3.32.0",
"@wordpress/i18n": "4.32.0",
"@wordpress/icons": "9.23.0",
"@wordpress/notices": "4.0.0",
"classnames": "2.3.2",
"lodash": "4.17.21",
"prop-types": "15.8.1",
Expand All @@ -55,7 +55,7 @@
"@testing-library/react": "13.4.0",
"@testing-library/user-event": "14.4.3",
"@types/react": "18.0.27",
"@wordpress/babel-plugin-import-jsx-pragma": "4.13.0",
"@wordpress/babel-plugin-import-jsx-pragma": "4.15.0",
"babel-jest": "29.4.3",
"jest": "29.4.3",
"jest-environment-jsdom": "29.4.3",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Updated package dependencies.
14 changes: 7 additions & 7 deletions projects/js-packages/shared-extension-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
"dependencies": {
"@automattic/jetpack-analytics": "workspace:*",
"@automattic/jetpack-connection": "workspace:*",
"@wordpress/api-fetch": "6.27.0",
"@wordpress/compose": "6.7.0",
"@wordpress/element": "5.7.0",
"@wordpress/i18n": "4.30.0",
"@wordpress/plugins": "5.7.0",
"@wordpress/url": "3.31.0",
"@wordpress/api-fetch": "6.29.0",
"@wordpress/compose": "6.9.0",
"@wordpress/element": "5.9.0",
"@wordpress/i18n": "4.32.0",
"@wordpress/plugins": "6.0.0",
"@wordpress/url": "3.33.0",
"lodash": "4.17.21"
},
"devDependencies": {
Expand All @@ -37,7 +37,7 @@
"react-dom": "18.2.0",
"jetpack-js-tools": "workspace:*",
"@automattic/jetpack-webpack-config": "workspace:*",
"@wordpress/babel-plugin-import-jsx-pragma": "4.13.0",
"@wordpress/babel-plugin-import-jsx-pragma": "4.15.0",
"@testing-library/dom": "8.19.1",
"@testing-library/react": "13.4.0",
"@testing-library/user-event": "14.4.3",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Updated package dependencies.
Loading

0 comments on commit 4d165c0

Please sign in to comment.