Skip to content

Commit

Permalink
Merge changes published in the Gutenberg plugin "release/14.0" branch
Browse files Browse the repository at this point in the history
  • Loading branch information
gutenbergplugin committed Aug 24, 2022
1 parent b5b9cf3 commit 4bc7458
Show file tree
Hide file tree
Showing 786 changed files with 16,719 additions and 13,724 deletions.
13 changes: 13 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,18 @@ module.exports = {
{
name: 'lodash',
importNames: [
'camelCase',
'capitalize',
'chunk',
'clamp',
'compact',
'concat',
'countBy',
'deburr',
'defaults',
'defaultTo',
'delay',
'difference',
'differenceWith',
'dropRight',
'each',
Expand Down Expand Up @@ -115,6 +119,7 @@ module.exports = {
'keyBy',
'keys',
'lowerCase',
'mapKeys',
'maxBy',
'memoize',
'negate',
Expand All @@ -129,18 +134,26 @@ module.exports = {
'reverse',
'size',
'snakeCase',
'sortBy',
'startCase',
'startsWith',
'stubFalse',
'stubTrue',
'sum',
'sumBy',
'take',
'times',
'toString',
'trim',
'truncate',
'uniq',
'uniqBy',
'uniqueId',
'uniqWith',
'upperFirst',
'values',
'words',
'xor',
'zip',
],
message:
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/create-block.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ jobs:
matrix:
node: [14]
os: [macos-latest, ubuntu-latest, windows-latest]
include:
- node: 12
os: ubuntu-latest

steps:
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/performance.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Performances Tests
name: Performance Tests

on:
pull_request:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/stale-issue-mark-stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
- uses: actions/stale@996798eb71ef485dc4c7b4d3285842d714040c4a # v3.0.17
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: "Hi,\nThis issue has gone 30 days without any activity. This means it is time for a check-in to make sure it is still relevant. If you are still experiencing this issue with the latest versions, you can help the project by responding to confirm the problem and by providing any updated reproduction steps.\nThanks for helping out."
days-before-stale: 30
days-before-close: -1
only-labels: 'Needs Testing'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: ['12', '14']
node: ['14']

steps:
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ coverage
yarn.lock
/artifacts
/perf-envs
/composer.lock

.cache
*.tsbuildinfo
Expand Down
3 changes: 3 additions & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
build
build-style
node_modules
packages/stylelint-config/test
41 changes: 24 additions & 17 deletions bin/plugin/commands/changelog.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
/**
* External dependencies
*/
const {
groupBy,
escapeRegExp,
uniq,
flow,
sortBy,
uniqBy,
} = require( 'lodash' );
const { groupBy, escapeRegExp, flow } = require( 'lodash' );
const Octokit = require( '@octokit/rest' );
const { sprintf } = require( 'sprintf-js' );
const semver = require( 'semver' );
Expand Down Expand Up @@ -201,13 +194,15 @@ const REWORD_TERMS = {
* @return {string[]} Type candidates.
*/
function getTypesByLabels( labels ) {
return uniq(
labels
.filter( ( label ) =>
Object.keys( LABEL_TYPE_MAPPING ).includes( label )
)
.map( ( label ) => LABEL_TYPE_MAPPING[ label ] )
);
return [
...new Set(
labels
.filter( ( label ) =>
Object.keys( LABEL_TYPE_MAPPING ).includes( label )
)
.map( ( label ) => LABEL_TYPE_MAPPING[ label ] )
),
];
}

/**
Expand Down Expand Up @@ -828,7 +823,9 @@ function getContributorPropsMarkdownList( ftcPRs ) {
* @return {IssuesListForRepoResponseItem[]} The sorted list of pull requests.
*/
function sortByUsername( items ) {
return sortBy( items, ( item ) => item.user.login.toLowerCase() );
return [ ...items ].sort( ( a, b ) =>
a.user.login.toLowerCase().localeCompare( b.user.login.toLowerCase() )
);
}

/**
Expand All @@ -838,7 +835,17 @@ function sortByUsername( items ) {
* @return {IssuesListForRepoResponseItem[]} The list of pull requests unique per user.
*/
function getUniqueByUsername( items ) {
return uniqBy( items, ( item ) => item.user.login );
/**
* @type {IssuesListForRepoResponseItem[]} List of pull requests.
*/
const EMPTY_PR_LIST = [];

return items.reduce( ( acc, item ) => {
if ( ! acc.some( ( i ) => i.user.login === item.user.login ) ) {
acc.push( item );
}
return acc;
}, EMPTY_PR_LIST );
}

/**
Expand Down
847 changes: 847 additions & 0 deletions changelog.txt

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"phpcompatibility/php-compatibility": "^9.3",
"wp-coding-standards/wpcs": "^2.2",
"sirbrillig/phpcs-variable-analysis": "^2.8",
"phpunit/phpunit": "^6.5",
"spatie/phpunit-watcher": "^1.23",
"yoast/phpunit-polyfills": "^1.0"
},
Expand Down
Loading

0 comments on commit 4bc7458

Please sign in to comment.