Skip to content

Commit

Permalink
Merge changes published in the Gutenberg plugin "release/14.8" branch
Browse files Browse the repository at this point in the history
  • Loading branch information
gutenbergplugin committed Dec 14, 2022
1 parent 7ac04f4 commit b0e6e34
Show file tree
Hide file tree
Showing 943 changed files with 28,392 additions and 18,800 deletions.
310 changes: 178 additions & 132 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,160 @@ const typedFiles = glob( 'packages/*/package.json' )
.filter( ( fileName ) => require( join( __dirname, fileName ) ).types )
.map( ( fileName ) => fileName.replace( 'package.json', '**/*.js' ) );

const restrictedImports = [
{
name: 'framer-motion',
message:
'Please use the Framer Motion API through `@wordpress/components` instead.',
},
{
name: 'lodash',
importNames: [
'camelCase',
'capitalize',
'castArray',
'chunk',
'clamp',
'cloneDeep',
'compact',
'concat',
'countBy',
'debounce',
'deburr',
'defaults',
'defaultTo',
'delay',
'difference',
'differenceWith',
'dropRight',
'each',
'escape',
'escapeRegExp',
'every',
'extend',
'filter',
'findIndex',
'findKey',
'findLast',
'first',
'flatMap',
'flatten',
'flattenDeep',
'flow',
'flowRight',
'forEach',
'fromPairs',
'has',
'identity',
'includes',
'invoke',
'isArray',
'isBoolean',
'isEqual',
'isFinite',
'isFunction',
'isMatch',
'isNil',
'isNumber',
'isObject',
'isObjectLike',
'isPlainObject',
'isString',
'isUndefined',
'keyBy',
'keys',
'last',
'lowerCase',
'mapKeys',
'maxBy',
'memoize',
'negate',
'noop',
'nth',
'omitBy',
'once',
'orderby',
'overEvery',
'partial',
'partialRight',
'pick',
'random',
'reduce',
'reject',
'repeat',
'reverse',
'size',
'snakeCase',
'some',
'sortBy',
'startCase',
'startsWith',
'stubFalse',
'stubTrue',
'sum',
'sumBy',
'take',
'throttle',
'times',
'toString',
'trim',
'truncate',
'unionBy',
'uniq',
'uniqBy',
'uniqueId',
'uniqWith',
'upperFirst',
'values',
'without',
'words',
'xor',
'zip',
],
message:
'This Lodash method is not recommended. Please use native functionality instead. If using `memoize`, please use `memize` instead.',
},
{
name: 'reakit',
message:
'Please use Reakit API through `@wordpress/components` instead.',
},
{
name: 'redux',
importNames: [ 'combineReducers' ],
message: 'Please use `combineReducers` from `@wordpress/data` instead.',
},
{
name: 'puppeteer-testing-library',
message: '`puppeteer-testing-library` is still experimental.',
},
{
name: '@emotion/css',
message:
'Please use `@emotion/react` and `@emotion/styled` in order to maintain iframe support. As a replacement for the `cx` function, please use the `useCx` hook defined in `@wordpress/components` instead.',
},
{
name: '@wordpress/edit-post',
message:
"edit-post is a WordPress top level package that shouldn't be imported into other packages",
},
{
name: '@wordpress/edit-site',
message:
"edit-site is a WordPress top level package that shouldn't be imported into other packages",
},
{
name: '@wordpress/edit-widgets',
message:
"edit-widgets is a WordPress top level package that shouldn't be imported into other packages",
},
{
name: '@wordpress/edit-navigation',
message:
"edit-navigation is a WordPress top level package that shouldn't be imported into other packages",
},
];

module.exports = {
root: true,
extends: [
Expand Down Expand Up @@ -70,137 +224,7 @@ module.exports = {
'no-restricted-imports': [
'error',
{
paths: [
{
name: 'framer-motion',
message:
'Please use the Framer Motion API through `@wordpress/components` instead.',
},
{
name: 'lodash',
importNames: [
'camelCase',
'capitalize',
'castArray',
'chunk',
'clamp',
'cloneDeep',
'compact',
'concat',
'countBy',
'debounce',
'deburr',
'defaults',
'defaultTo',
'delay',
'difference',
'differenceWith',
'dropRight',
'each',
'escape',
'escapeRegExp',
'every',
'extend',
'findIndex',
'findKey',
'findLast',
'first',
'flatMap',
'flatten',
'flattenDeep',
'flow',
'flowRight',
'forEach',
'fromPairs',
'has',
'identity',
'includes',
'invoke',
'isArray',
'isBoolean',
'isFinite',
'isFunction',
'isMatch',
'isNil',
'isNumber',
'isObject',
'isObjectLike',
'isPlainObject',
'isString',
'isUndefined',
'keyBy',
'keys',
'last',
'lowerCase',
'mapKeys',
'maxBy',
'memoize',
'negate',
'noop',
'nth',
'omitBy',
'once',
'overEvery',
'partial',
'partialRight',
'random',
'reduce',
'reject',
'repeat',
'reverse',
'size',
'snakeCase',
'some',
'sortBy',
'startCase',
'startsWith',
'stubFalse',
'stubTrue',
'sum',
'sumBy',
'take',
'throttle',
'times',
'toString',
'trim',
'truncate',
'unionBy',
'uniq',
'uniqBy',
'uniqueId',
'uniqWith',
'upperFirst',
'values',
'without',
'words',
'xor',
'zip',
],
message:
'This Lodash method is not recommended. Please use native functionality instead. If using `memoize`, please use `memize` instead.',
},
{
name: 'reakit',
message:
'Please use Reakit API through `@wordpress/components` instead.',
},
{
name: 'redux',
importNames: [ 'combineReducers' ],
message:
'Please use `combineReducers` from `@wordpress/data` instead.',
},
{
name: 'puppeteer-testing-library',
message:
'`puppeteer-testing-library` is still experimental.',
},
{
name: '@emotion/css',
message:
'Please use `@emotion/react` and `@emotion/styled` in order to maintain iframe support. As a replacement for the `cx` function, please use the `useCx` hook defined in `@wordpress/components` instead.',
},
],
paths: restrictedImports,
},
],
'@typescript-eslint/no-restricted-imports': [
Expand Down Expand Up @@ -347,7 +371,6 @@ module.exports = {
'plugin:testing-library/react',
],
rules: {
'testing-library/no-container': 'off',
'testing-library/no-node-access': 'off',
},
},
Expand Down Expand Up @@ -418,5 +441,28 @@ module.exports = {
plugins: [ 'ssr-friendly' ],
extends: [ 'plugin:ssr-friendly/recommended' ],
},
{
files: [ 'packages/block-editor/**' ],
rules: {
'no-restricted-imports': [
'error',
{
paths: [
...restrictedImports,
{
name: '@wordpress/api-fetch',
message:
"block-editor is a generic package that doesn't depend on a server or WordPress backend. To provide WordPress integration, consider passing settings to the BlockEditorProvider components.",
},
{
name: '@wordpress/core-data',
message:
"block-editor is a generic package that doesn't depend on a server or WordPress backend. To provide WordPress integration, consider passing settings to the BlockEditorProvider components.",
},
],
},
],
},
},
],
};
3 changes: 3 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,7 @@ https://github.com/WordPress/gutenberg/blob/trunk/CONTRIBUTING.md -->
<!-- 2. Insert a Heading Block. -->
<!-- 3. etc. -->

### Testing Instructions for Keyboard
<!-- How can you test the changes by using the keyboard only? Please note, this is required for PRs that change the user interface (UI). This ensures the PR can be tested for any possible accessibility regressions. -->

## Screenshots or screencast <!-- if applicable -->
10 changes: 10 additions & 0 deletions .github/workflows/gradle-wrapper-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: 'Validate Gradle Wrapper'
on: [push, pull_request]

jobs:
validation:
name: 'Validation'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: gradle/wrapper-validation-action@v1
2 changes: 1 addition & 1 deletion .github/workflows/performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
WP_VERSION=$(awk -F ': ' '/^Tested up to/{print $2}' readme.txt)
IFS=. read -ra WP_VERSION_ARRAY <<< "$WP_VERSION"
WP_MAJOR="${WP_VERSION_ARRAY[0]}.${WP_VERSION_ARRAY[1]}"
./bin/plugin/cli.js perf $GITHUB_SHA debd225d007f4e441ceec80fbd6fa96653f94737 --tests-branch $GITHUB_SHA --wp-version "$WP_MAJOR"
./bin/plugin/cli.js perf $GITHUB_SHA debd225d007f4e441ceec80fbd6fa96653f94737 --tests-branch $GITHUB_SHA --wp-version "$WP_MAJOR"
- uses: actions/github-script@d556feaca394842dc55e4734bf3bb9f685482fa0 # v6.3.3
if: github.event_name == 'push'
Expand Down
Loading

0 comments on commit b0e6e34

Please sign in to comment.