Skip to content

Commit

Permalink
Merge changes published in the Gutenberg plugin "release/12.8" branch
Browse files Browse the repository at this point in the history
  • Loading branch information
gziolo committed Mar 11, 2022
1 parent bc1ccad commit d81082d
Show file tree
Hide file tree
Showing 947 changed files with 14,735 additions and 6,610 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ module.exports = {
{
files: [ 'packages/react-native-*/**/*.js' ],
settings: {
'import/ignore': [ 'react-native' ], // Workaround for https://github.com/facebook/react-native/issues/28549
'import/ignore': [ 'react-native' ], // Workaround for https://github.com/facebook/react-native/issues/28549.
},
},
{
Expand Down
37 changes: 18 additions & 19 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# Data
/packages/api-fetch @nerrad @mmtr
/packages/core-data @nerrad
/packages/data @nerrad @coderkevin
/packages/data @nerrad
/packages/redux-routine @nerrad
/packages/data-controls @nerrad

Expand Down Expand Up @@ -83,12 +83,12 @@
/packages/stylelint-config @ntwb

# UI Components
/packages/components @ajitbohra @jaymanpandya
/packages/compose @ajitbohra @jaymanpandya
/packages/element @ajitbohra @jaymanpandya
/packages/notices @ajitbohra @jaymanpandya
/packages/nux @ajitbohra @jaymanpandya
/packages/viewport @ajitbohra @jaymanpandya
/packages/components @ajitbohra
/packages/compose @ajitbohra
/packages/element @ajitbohra
/packages/notices @ajitbohra
/packages/nux @ajitbohra
/packages/viewport @ajitbohra
/packages/base-styles
/packages/icons
/packages/primitives
Expand Down Expand Up @@ -130,13 +130,12 @@

# PHP
/lib @timothybjacobs @spacedmonkey
/lib/global-styles.php @timothybjabocs @spacedmonkey @oandregal
/lib/global-styles.php @timothybjacobs @spacedmonkey @oandregal
/lib/class-wp-rest-block-editor-settings-controller.php @timothybjacobs @spacedmonkey @geriux @antonis
/lib/compat/wordpress-5.9/theme.json @timothybjabocs @spacedmonkey @oandregal
/lib/compat/wordpress-5.9/theme-i18n.json @timothybjabocs @spacedmonkey @oandregal
/lib/compat/wordpress-5.9/class-wp-theme-json-gutenberg.php @timothybjabocs @spacedmonkey @oandregal
/lib/compat/wordpress-5.9/class-wp-theme-json-resolver-gutenberg.php @timothybjabocs @spacedmonkey @oandregal
/lib/full-site-editing @janw-me
/lib/compat/wordpress-5.9/theme.json @timothybjacobs @spacedmonkey @oandregal
/lib/compat/wordpress-5.9/theme-i18n.json @timothybjacobs @spacedmonkey @oandregal
/lib/compat/wordpress-5.9/class-wp-theme-json-gutenberg.php @timothybjacobs @spacedmonkey @oandregal
/lib/compat/wordpress-5.9/class-wp-theme-json-resolver-gutenberg.php @timothybjacobs @spacedmonkey @oandregal
/phpunit/class-wp-theme-json-test.php @oandregal

# Web App
Expand All @@ -148,9 +147,9 @@
/packages/components/src/mobile/global-styles-context @geriux @antonis

# Native (Unowned)
*.native.js @ghost
*.android.js @ghost
*.ios.js @ghost
*.native.scss @ghost
*.android.scss @ghost
*.ios.scss @ghost
*.native.js
*.android.js
*.ios.js
*.native.scss
*.android.scss
*.ios.scss
31 changes: 10 additions & 21 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,19 @@
<!-- Learn the overall process and best practices for pull requests at https://github.com/WordPress/gutenberg/blob/HEAD/docs/contributors/repository-management.md#pull-requests. -->
<!-- Thanks for contributing to Gutenberg! Please follow the Gutenberg Contributing Guidelines:
https://github.com/WordPress/gutenberg/blob/trunk/CONTRIBUTING.md -->

<!-- Gutenberg's license is in the process of updating to be dual-licensed under the GPL and MPL. As part of that transition, all new contributions are dual-licensed. For more information, see: https://github.com/WordPress/gutenberg/blob/trunk/LICENSE.md -->
## What?
<!-- In a few words, what is the PR actually doing? -->

## Description
<!-- Please describe what you have changed or added -->
## Why?
<!-- Why is this PR necessary? What problem is it solving? Reference any existing previous issue(s) or PR(s), but please add a short summary here, too -->

## How?
<!-- How is your PR addressing the issue at hand? What are the implementation details? -->

## Testing Instructions
<!-- Please include step by step instructions on how to test this PR. -->
<!-- 1. Open a Post or Page. -->
<!-- 2. Insert a Heading Block. -->
<!-- 3. etc. -->

## Screenshots <!-- if applicable -->

## Types of changes
<!-- What types of changes does your code introduce? -->
<!-- Bug fix (non-breaking change which fixes an issue) -->
<!-- New feature (non-breaking change which adds functionality) -->
<!-- Breaking change (fix or feature that would cause existing functionality to not work as expected) -->

## Checklist:
- [ ] My code is tested.
- [ ] My code follows the WordPress code style. <!-- Check code: `npm run lint`, Guidelines: https://developer.wordpress.org/coding-standards/wordpress-coding-standards/javascript/ -->
- [ ] My code follows the accessibility standards. <!-- Guidelines: https://developer.wordpress.org/coding-standards/wordpress-coding-standards/accessibility/ -->
- [ ] I've tested my changes with keyboard and screen readers. <!-- Instructions: https://github.com/WordPress/gutenberg/blob/HEAD/docs/contributors/accessibility-testing.md -->
- [ ] My code has proper inline documentation. <!-- Guidelines: https://developer.wordpress.org/coding-standards/inline-documentation-standards/javascript/ -->
- [ ] I've included developer documentation if appropriate. <!-- Handbook: https://developer.wordpress.org/block-editor/ -->
- [ ] I've updated all React Native files affected by any refactorings/renamings in this PR (please manually search all `*.native.js` files for terms that need renaming or removal). <!-- React Native mobile Gutenberg guidelines: https://github.com/WordPress/gutenberg/blob/HEAD/docs/contributors/code/native-mobile.md -->
- [ ] I've updated related schemas if appropriate. <!-- Reference: https://github.com/WordPress/gutenberg/tree/trunk/schemas -->
## Screenshots or screencast <!-- if applicable -->
39 changes: 39 additions & 0 deletions .github/workflows/upload-release-to-plugin-repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,45 @@ jobs:
name: changelog ${{ matrix.label }}
path: ./changelog.txt

npm-publish:
name: Publish WordPress packages to npm
runs-on: ubuntu-latest
needs: update-changelog
if: ${{ github.event.release.prerelease && endsWith( github.event.release.tag_name, '-rc.1' ) && github.event.release.assets[0] }}
steps:
- name: Checkout (for CLI)
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
with:
path: main
ref: trunk

- name: Checkout (for publishing)
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
with:
path: publish
ref: trunk
token: ${{ secrets.GUTENBERG_TOKEN }}

- name: Configure git user name and email (for publishing)
run: |
cd publish
git config user.name "Gutenberg Repository Automation"
git config user.email gutenberg@wordpress.org
- name: Setup Node
uses: actions/setup-node@38d90ce44d5275ad62cc48384b3d8a58c500bb5f # v2.2.2
with:
node-version: 14
registry-url: 'https://registry.npmjs.org'

- name: Publish packages to npm ("next" dist-tag)
run: |
cd main
npm ci
./bin/plugin/cli.js npm-next --semver minor --ci --repository-path ../publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

upload:
name: Upload Gutenberg Plugin
runs-on: ubuntu-latest
Expand Down
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ To learn all about contributing to the Gutenberg project, see the [Contributor G

- As with all WordPress projects, we want to ensure a welcoming environment for everyone. With that in mind, all contributors are expected to follow our [Code of Conduct](/CODE_OF_CONDUCT.md).

- Contributors should review the [overall process and best practices for pull requests](https://github.com/WordPress/gutenberg/blob/trunk/docs/contributors/repository-management.md#pull-requests), adhering to WordPress' [JavaScript coding standards](https://developer.wordpress.org/coding-standards/wordpress-coding-standards/javascript/) and [accessibility coding standards](https://developer.wordpress.org/coding-standards/wordpress-coding-standards/accessibility/).

- Accessibility should be top of mind and thoroughly tested by following the [accessibility testing instructions](https://github.com/WordPress/gutenberg/blob/HEAD/docs/contributors/accessibility-testing.md).

- Verify that any changes in your PR that affect function/class/variable names are mirrored in the corresponding `.native.js` versions of the files to avoid introducing breaking changes in the [React Native Mobile Editor](https://github.com/WordPress/gutenberg/tree/trunk/docs/contributors/code/react-native).

- You maintain copyright over any contribution you make. By submitting a pull request you agree to release that code under [Gutenberg's License](/LICENSE.md).

## Reporting Security Issues
Expand Down
6 changes: 4 additions & 2 deletions bin/api-docs/gen-block-lib-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,10 @@ function readBlockJSON( filename ) {
const blockjson = require( filename );

const sourcefile = getSourceFromFile( filename );
const supportsAugmented = augmentSupports( blockjson.supports );
const supportsList = processObjWithInnerKeys( supportsAugmented );
const supportsList =
blockjson.supports !== undefined
? processObjWithInnerKeys( augmentSupports( blockjson.supports ) )
: [];
const attributes = getTruthyKeys( blockjson.attributes );

return `
Expand Down
1 change: 0 additions & 1 deletion bin/packages/build-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ async function buildCSS( file ) {
const builtSass = await renderSass( {
file,
includePaths: [ path.join( PACKAGES_DIR, 'base-styles' ) ],
//
data: ''.concat( '@use "sass:math";', importLists, contents ),
} );

Expand Down
4 changes: 2 additions & 2 deletions bin/packages/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,10 @@ function createStyleEntryTransform() {
entries.forEach( ( entry ) => this.push( entry ) );

// Find other stylesheets that need to be rebuilt because
// they import the styles that are being transformed
// they import the styles that are being transformed.
const styleEntries = findStyleEntriesThatImportFile( file );

// Rebuild stylesheets that import the styles being transformed
// Rebuild stylesheets that import the styles being transformed.
if ( styleEntries.length ) {
styleEntries.forEach( ( entry ) => stream.push( entry ) );
}
Expand Down
10 changes: 5 additions & 5 deletions bin/packages/get-babel-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ module.exports = ( environment = '', file ) => {
};
switch ( environment ) {
case 'main':
// to be merged as a presetEnv option
// To be merged as a presetEnv option.
callerOpts.caller.modules = 'commonjs';
break;
case 'module':
// to be merged as a presetEnv option
// To be merged as a presetEnv option.
callerOpts.caller.modules = false;
// to be merged as a pluginTransformRuntime option
// To be merged as a pluginTransformRuntime option.
callerOpts.caller.useESModules = true;
break;
default:
// preventing measure, this shouldn't happen ever
// Preventing measure, this shouldn't happen ever.
delete callerOpts.caller;
}

// Sourcemaps options
// Sourcemaps options.
const sourceMapsOpts = {
sourceMaps: true,
sourceFileName: file,
Expand Down
2 changes: 1 addition & 1 deletion bin/packages/lint-staged-typecheck.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const tscPath = path.join( repoRoot, 'node_modules', '.bin', 'tsc' );
// lint-staged passes full paths to staged changes
const changedFiles = process.argv.slice( 2 );

// Transform changed files to package directories containing tsconfig.json
// Transform changed files to package directories containing tsconfig.json.
const changedPackages = _.uniq(
changedFiles.map( ( fullPath ) => {
const relativePath = path.relative( repoRoot, fullPath );
Expand Down
18 changes: 17 additions & 1 deletion bin/plugin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,19 @@ const {
const { getReleaseChangelog } = require( './commands/changelog' );
const { runPerformanceTests } = require( './commands/performance' );

const semverOption = [ '--semver <semver>', 'Semantic Versioning', 'patch' ];
const ciOption = [ '-c, --ci', 'Run in CI (non interactive)' ];
const repositoryPathOption = [
'--repository-path <repository-path>',
'Relative path to the git repository.',
];

program
.command( 'publish-npm-packages-latest' )
.alias( 'npm-latest' )
.option( ...semverOption )
.option( ...ciOption )
.option( ...repositoryPathOption )
.description(
'Publishes packages to npm (latest dist-tag, production version)'
)
Expand All @@ -38,6 +48,9 @@ program
program
.command( 'publish-npm-packages-bugfix-latest' )
.alias( 'npm-bugfix' )
.option( ...semverOption )
.option( ...ciOption )
.option( ...repositoryPathOption )
.description(
'Publishes bugfixes for packages to npm (latest dist-tag, production version)'
)
Expand All @@ -46,6 +59,9 @@ program
program
.command( 'publish-npm-packages-next' )
.alias( 'npm-next' )
.option( ...semverOption )
.option( ...ciOption )
.option( ...repositoryPathOption )
.description(
'Publishes packages to npm (next dist-tag, prerelease version)'
)
Expand All @@ -66,7 +82,7 @@ program
program
.command( 'performance-tests [branches...]' )
.alias( 'perf' )
.option( '-c, --ci', 'Run in CI (non interactive)' )
.option( ...ciOption )
.option(
'--tests-branch <branch>',
"Use this branch's performance test files"
Expand Down
6 changes: 3 additions & 3 deletions bin/plugin/commands/changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ function getIssueFeature( issue ) {
return rankedFeatures[ 0 ];
}

// 2. `[Feature]` labels
// 2. `[Feature]` labels.
const featureSpecificLabel = getFeatureSpecificLabels( labels );

if ( featureSpecificLabel ) {
Expand Down Expand Up @@ -756,7 +756,7 @@ function getChangelog( pullRequests ) {
function sortFeatureGroups( featureGroups ) {
return Object.keys( featureGroups ).sort(
( featureAName, featureBName ) => {
// Sort "uncategorized" items to *always* be at the top of the section
// Sort "uncategorized" items to *always* be at the top of the section.
if ( featureAName === UNKNOWN_FEATURE_FALLBACK_NAME ) {
return -1;
} else if ( featureBName === UNKNOWN_FEATURE_FALLBACK_NAME ) {
Expand Down Expand Up @@ -864,7 +864,7 @@ function getContributorProps( pullRequests ) {
return (
'## First time contributors' +
'\n\n' +
'The following PRs were merged by first time contrbutors:' +
'The following PRs were merged by first time contributors:' +
'\n\n' +
contributorsList
);
Expand Down
15 changes: 9 additions & 6 deletions bin/plugin/commands/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const config = require( '../config' );
* @return {Promise<string>} Repository local path.
*/
async function runGitRepositoryCloneStep( abortMessage ) {
// Cloning the repository
// Cloning the repository.
let gitWorkingDirectoryPath;
await runStep( 'Cloning the Git repository', abortMessage, async () => {
log( '>> Cloning the Git repository' );
Expand Down Expand Up @@ -58,14 +58,17 @@ async function runCleanLocalFoldersStep( folders, abortMessage ) {
}

/**
* Finds the name of the current release branch based on the version in
* Finds the name of the current plugin release branch based on the version in
* the package.json file.
*
* @param {string} packageJsonPath Path to the package.json file.
* @param {string} gitWorkingDirectoryPath Path to the project's working directory.
*
* @return {string} Name of the release branch.
* @return {string} Name of the plugin release branch.
*/
function findReleaseBranchName( packageJsonPath ) {
async function findPluginReleaseBranchName( gitWorkingDirectoryPath ) {
await git.checkoutRemoteBranch( gitWorkingDirectoryPath, 'trunk' );

const packageJsonPath = gitWorkingDirectoryPath + '/package.json';
const mainPackageJson = readJSONFile( packageJsonPath );
const mainParsedVersion = semver.parse( mainPackageJson.version );

Expand Down Expand Up @@ -137,7 +140,7 @@ function calculateVersionBumpFromChangelog(

module.exports = {
calculateVersionBumpFromChangelog,
findReleaseBranchName,
findPluginReleaseBranchName,
runGitRepositoryCloneStep,
runCleanLocalFoldersStep,
};

0 comments on commit d81082d

Please sign in to comment.