Skip to content

Commit

Permalink
Merge changes published in the Gutenberg plugin "release/15.8" branch
Browse files Browse the repository at this point in the history
  • Loading branch information
gutenbergplugin committed May 10, 2023
1 parent 6df0c62 commit b50133e
Show file tree
Hide file tree
Showing 655 changed files with 17,644 additions and 11,245 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ const restrictedImports = [
'lowerCase',
'map',
'mapKeys',
'mapValues',
'maxBy',
'memoize',
'merge',
Expand Down
4 changes: 2 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Documentation
/docs @ajitbohra @ryanwelcher @juanmaguitar @fabiankaegy
/docs @ajitbohra @ryanwelcher @juanmaguitar @fabiankaegy @ndiego

# Schemas
/schemas/json @ajlende
Expand Down Expand Up @@ -57,7 +57,7 @@
# Tooling
/bin @ntwb @nerrad @ajitbohra
/bin/api-docs @ntwb @nerrad @ajitbohra
/docs/tool @ajitbohra
/docs/tool @ajitbohra @ndiego
/packages/babel-plugin-import-jsx-pragma @ntwb @nerrad @ajitbohra
/packages/babel-plugin-makepot @ntwb @nerrad @ajitbohra
/packages/babel-preset-default @gziolo @ntwb @nerrad @ajitbohra
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/check-components-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ jobs:
exit 1
fi
pr_link_pattern="\(\[#${PR_NUMBER}\]\(https://github\.com/WordPress/gutenberg/pull/${PR_NUMBER}\)\)"
pr_link_grep_pattern="(\[#${PR_NUMBER}\](https://github\.com/WordPress/gutenberg/pull/${PR_NUMBER}))"
pr_link_pattern="\[#${PR_NUMBER}\]\(https://github\.com/WordPress/gutenberg/pull/${PR_NUMBER}\)"
pr_link_grep_pattern="\[#${PR_NUMBER}\](https://github\.com/WordPress/gutenberg/pull/${PR_NUMBER})"
unreleased_section=$(sed -n '/^## Unreleased$/,/^## /p' "${changelog_path}")
Expand Down
8 changes: 6 additions & 2 deletions bin/packages/build-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,13 @@ async function buildCSS( file ) {
'animations',
'z-index',
]
// Editor styles should be excluded from the default CSS vars output.
// Editor and component styles should be excluded from the default CSS vars output.
.concat(
file.includes( 'common.scss' ) || ! file.includes( 'block-library' )
file.includes( 'common.scss' ) ||
! (
file.includes( 'block-library' ) ||
file.includes( 'components' )
)
? [ 'default-custom-properties' ]
: []
)
Expand Down
26 changes: 12 additions & 14 deletions bin/plugin/commands/changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ const UNKNOWN_FEATURE_FALLBACK_NAME = 'Uncategorized';
* @type {Record<string,string>}
*/
const LABEL_TYPE_MAPPING = {
'[Feature] Navigation Screen': 'Experiments',
'[Package] Dependency Extraction Webpack Plugin': 'Tools',
'[Type] Developer Documentation': 'Documentation',
'[Package] Jest Puppeteer aXe': 'Tools',
'[Package] E2E Tests': 'Tools',
'[Package] E2E Test Utils': 'Tools',
Expand All @@ -74,16 +73,17 @@ const LABEL_TYPE_MAPPING = {
'[Package] Scripts': 'Tools',
'[Type] Build Tooling': 'Tools',
'Automated Testing': 'Tools',
'[Package] Dependency Extraction Webpack Plugin': 'Tools',
'[Type] Code Quality': 'Code Quality',
'[Type] Performance': 'Performance',
'[Type] Security': 'Security',
'[Feature] Navigation Screen': 'Experiments',
'[Type] Experimental': 'Experiments',
'[Type] Bug': 'Bug Fixes',
'[Type] Regression': 'Bug Fixes',
'[Type] Feature': 'Features',
'[Type] Enhancement': 'Enhancements',
'[Type] New API': 'New APIs',
'[Type] Performance': 'Performance',
'[Type] Developer Documentation': 'Documentation',
'[Type] Code Quality': 'Code Quality',
'[Type] Security': 'Security',
'[Type] Feature': 'Features',
};

/**
Expand Down Expand Up @@ -303,12 +303,6 @@ function getIssueType( issue ) {
...getTypesByTitle( issue.title ),
];

// Force all tasks identified as Documentation tasks
// to appear under the main "Documentation" section.
if ( candidates.includes( 'Documentation' ) ) {
return 'Documentation';
}

return candidates.length ? candidates.sort( sortType )[ 0 ] : 'Various';
}

Expand Down Expand Up @@ -377,7 +371,7 @@ function getIssueFeature( issue ) {
*/
function sortType( a, b ) {
const [ aIndex, bIndex ] = [ a, b ].map( ( title ) => {
return Object.keys( LABEL_TYPE_MAPPING ).indexOf( title );
return Object.values( LABEL_TYPE_MAPPING ).indexOf( title );
} );

return aIndex - bIndex;
Expand Down Expand Up @@ -925,6 +919,10 @@ function getContributorProps( pullRequests ) {
getContributorPropsMarkdownList,
] )( pullRequests );

if ( ! contributorsList ) {
return '';
}

return (
'## First time contributors' +
'\n\n' +
Expand Down
21 changes: 18 additions & 3 deletions bin/plugin/commands/performance.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
*/
const fs = require( 'fs' );
const path = require( 'path' );
const { mapValues } = require( 'lodash' );
const SimpleGit = require( 'simple-git' );

/**
Expand Down Expand Up @@ -475,10 +474,26 @@ async function runPerformanceTests( branches, options ) {
( r ) => r[ branch ][ dataPoint ]
);
} );
const medians = mapValues( resultsByDataPoint, median );
// @ts-ignore
const medians = Object.fromEntries(
Object.entries( resultsByDataPoint ).map(
( [ dataPoint, dataPointResults ] ) => [
dataPoint,
median( dataPointResults ),
]
)
);

// Format results as times.
results[ testSuite ][ branch ] = mapValues( medians, formatTime );
// @ts-ignore
results[ testSuite ][ branch ] = Object.fromEntries(
Object.entries( medians ).map(
( [ dataPoint, dataPointMedian ] ) => [
dataPoint,
formatTime( dataPointMedian ),
]
)
);
}
}

Expand Down
33 changes: 17 additions & 16 deletions bin/plugin/commands/test/__snapshots__/changelog.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,8 @@ exports[`getChangelog verify that the changelog is properly formatted 1`] = `
### Enhancements
- Scripts: Use cssnano to minimize CSS files with build. ([33750](https://github.com/WordPress/gutenberg/pull/33750))
- Scripts: Webpack configuration update to minimize CSS. ([33676](https://github.com/WordPress/gutenberg/pull/33676))
#### Components
- Add new ColorPicker. ([33714](https://github.com/WordPress/gutenberg/pull/33714))
- Promote \`ItemGroup\`. ([33701](https://github.com/WordPress/gutenberg/pull/33701))
- Update snackbar to use framer motion instead of react spring. ([33717](https://github.com/WordPress/gutenberg/pull/33717))
- Use updated range styles. ([33824](https://github.com/WordPress/gutenberg/pull/33824))
Expand Down Expand Up @@ -39,7 +35,6 @@ exports[`getChangelog verify that the changelog is properly formatted 1`] = `
### Bug Fixes
- Correct \`function_exists()\` check typo introduced in #33331. ([33513](https://github.com/WordPress/gutenberg/pull/33513))
- ESLint Plugin: Include .jsx extenstion when linting import statements. ([33746](https://github.com/WordPress/gutenberg/pull/33746))
- Fix block appender position in classic themes. ([33895](https://github.com/WordPress/gutenberg/pull/33895))
- Fix misspelling of "queries" in filter documentation. ([33799](https://github.com/WordPress/gutenberg/pull/33799))
- Fix positioning discrepancy with draggable chip. ([33893](https://github.com/WordPress/gutenberg/pull/33893))
Expand Down Expand Up @@ -81,12 +76,6 @@ exports[`getChangelog verify that the changelog is properly formatted 1`] = `
#### Meta Boxes
- Fix Safari 13 metaboxes from overlapping the content. ([33817](https://github.com/WordPress/gutenberg/pull/33817))
#### Build Tooling
- Readable JS assets Plugin: Fix webpack 5 support. ([33785](https://github.com/WordPress/gutenberg/pull/33785))
#### Navigation Screen
- Fix regressed menu selection dropdown placeholder value for Nav Editor menu locations UI. ([33748](https://github.com/WordPress/gutenberg/pull/33748))
#### Accessibility
- Fix some JAWS bugs. ([33627](https://github.com/WordPress/gutenberg/pull/33627))
Expand Down Expand Up @@ -116,6 +105,15 @@ exports[`getChangelog verify that the changelog is properly formatted 1`] = `
- Refactor the HierarchicalTermSelector so that it does not cause unnecessary loading of terms. ([33418](https://github.com/WordPress/gutenberg/pull/33418))
### Experiments
#### Navigation Screen
- Fix regressed menu selection dropdown placeholder value for Nav Editor menu locations UI. ([33748](https://github.com/WordPress/gutenberg/pull/33748))
#### Components
- Promote \`ItemGroup\`. ([33701](https://github.com/WordPress/gutenberg/pull/33701))
### Documentation
- Add documentation to disable remote calls for block patterns. ([33930](https://github.com/WordPress/gutenberg/pull/33930))
Expand All @@ -133,8 +131,6 @@ exports[`getChangelog verify that the changelog is properly formatted 1`] = `
### Code Quality
- Scripts: Fix typo in format change message. ([33945](https://github.com/WordPress/gutenberg/pull/33945))
#### Components
- Components utils: \`rtl()\` return type, \`rtl.watch()\` utility. ([33882](https://github.com/WordPress/gutenberg/pull/33882))
- InputControl to TypeScript. ([33696](https://github.com/WordPress/gutenberg/pull/33696))
Expand All @@ -157,17 +153,22 @@ exports[`getChangelog verify that the changelog is properly formatted 1`] = `
### Tools
- ESLint Plugin: Include .jsx extenstion when linting import statements. ([33746](https://github.com/WordPress/gutenberg/pull/33746))
- GitHub Templates: Fix spacing in bug report template. ([33761](https://github.com/WordPress/gutenberg/pull/33761))
- GitHub Templates: Format bug report template. ([33786](https://github.com/WordPress/gutenberg/pull/33786))
- Scripts: Fix typo in format change message. ([33945](https://github.com/WordPress/gutenberg/pull/33945))
- Scripts: Use cssnano to minimize CSS files with build. ([33750](https://github.com/WordPress/gutenberg/pull/33750))
- Scripts: Webpack configuration update to minimize CSS. ([33676](https://github.com/WordPress/gutenberg/pull/33676))
- Update bug issue template to use forms. ([33713](https://github.com/WordPress/gutenberg/pull/33713))
#### Build Tooling
- Readable JS assets Plugin: Fix webpack 5 support. ([33785](https://github.com/WordPress/gutenberg/pull/33785))
- Scripts: Update webpack to v5 (try 2). ([33818](https://github.com/WordPress/gutenberg/pull/33818))
#### Testing
- Add search performance measure and make other measures more stable. ([33848](https://github.com/WordPress/gutenberg/pull/33848))
- E2E: Block Hierarchy Navigation wait for the column to be highlighted. ([33721](https://github.com/WordPress/gutenberg/pull/33721))
#### Build Tooling
- Scripts: Update webpack to v5 (try 2). ([33818](https://github.com/WordPress/gutenberg/pull/33818))
### Various
Expand Down
16 changes: 16 additions & 0 deletions bin/plugin/commands/test/changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,17 @@ describe( 'getIssueType', () => {

expect( result ).toBe( 'Enhancements' );
} );

it( 'prioritizes meta categories', () => {
const result = getIssueType( {
labels: [
{ name: '[Type] Bug' },
{ name: '[Type] Build Tooling' },
],
} );

expect( result ).toBe( 'Tools' );
} );
} );

describe( 'getIssueFeature', () => {
Expand Down Expand Up @@ -474,6 +485,11 @@ describe( 'getContributorProps', () => {
// npm run other:changelog -- --milestone="Gutenberg 11.3"
expect( getContributorProps( pullRequests ) ).toMatchSnapshot();
} );
test( 'do not include first time contributors section if there are not any', () => {
expect(
getContributorProps( pullRequests.slice( 0, 4 ) )
).toMatchInlineSnapshot( `""` );
} );
} );

describe( 'getContributorList', () => {
Expand Down

1 comment on commit b50133e

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in b50133e.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4938943377
📝 Reported issues:

Please sign in to comment.