Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template 04 Controls ESNext #10

Closed
wants to merge 89 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
8ec8167
creating our first template for editable esnext block
jessynd May 2, 2020
5f34460
Merge branch 'master' of github.com:js-advancers/gutenberg
May 3, 2020
49ba149
Merge branch 'brezo-mike-jess' of github.com:js-advancers/gutenberg
May 3, 2020
e8d7e84
Update: Make global styles shape consistent with local styles shape. …
jorgefilipecosta May 29, 2020
8aeda88
Fix: Customizer complementary area should not include the block areas…
jorgefilipecosta May 29, 2020
78587c9
Fixed typo in the wp_register_script function (#22755)
aharish May 30, 2020
016a61d
@wordpress/env: Make JSDoc conform to coding guidelines (#20522)
noisysocks Jun 1, 2020
ccb3ed6
Extract inserter state into reusable hooks (#22710)
youknowriad Jun 1, 2020
fc943af
Scripts: Add support for postcss.config.js (#22735)
ocean90 Jun 1, 2020
7e855e3
Env: Fix undefined `Source` type lint/type error (#22785)
sirreal Jun 1, 2020
52e423d
Align navigator widgets (icon, options) to top (#22790)
adamziel Jun 1, 2020
281464a
RNMobile: merge 1.29.0 release to master (#22768)
mchowning Jun 1, 2020
9b6fee5
[block-editor] fix readme syntax (#22809)
ljharb Jun 1, 2020
8f892e6
E2E Tests: Specify icon for block context test blocks (#22811)
aduth Jun 1, 2020
87fdc2c
Add Rich image editing capabilities to Gutenberg (#21024)
ajlende Jun 2, 2020
7518908
Fix JSDoc for __experimentalAddAnnotation (#22794)
ocean90 Jun 2, 2020
bf6ca54
Add icons for image tools, other, and update list icons (#22593)
jasmussen Jun 2, 2020
2116931
REST API: Update default values for fields in the block type schema (…
gziolo Jun 2, 2020
016a531
Dependency Extraction Webpack Plugin: Add types (#22498)
sirreal Jun 2, 2020
d09cbf9
[Navigation screen] Retain block IDs on save (#22739)
adamziel Jun 2, 2020
b79352e
[RNMobile] Fix displaying blocks with HTML anchor (#22604)
ceyhun Jun 2, 2020
89e3431
Blocks: Update default block categories (#19279)
aduth Jun 2, 2020
4ad2ed4
Enhancement: added ability to filter latest posts by author and to di…
pstonier Jun 2, 2020
9c4d9a5
Remove Andrew's codeowner notifications
aduth Jun 2, 2020
77fb18e
Trigger additional widget setup actions (#22807)
jorgefilipecosta Jun 2, 2020
ab878d5
Separate concerns in useNavigationBlocks (#22825)
adamziel Jun 2, 2020
df4bf4a
Take block data for Global Styles from block.json (#22698)
nosolosw Jun 3, 2020
eab88a7
Disable the navigator toolbar button on the experimental navigation s…
adamziel Jun 3, 2020
5eafc79
Update: Remove static defaults from complementary areas active area (…
jorgefilipecosta Jun 3, 2020
9a6e19b
Use Panel for navigation structure on small screens only (#22828)
adamziel Jun 3, 2020
c71126d
adds default text for appender (#22293)
draganescu Jun 3, 2020
ecbcae6
Cover: Add Padding Styles (#21492)
Jun 3, 2020
ee2905e
Block Navigator: Use default block appender (#22590)
noisysocks Jun 3, 2020
6e38764
Block Directory: Add list of installed blocks to pre-publish sidebar …
ryelle Jun 3, 2020
34aca74
[RNMobile] Support Theme Colors and Gradients (#22197)
chipsnyder Jun 3, 2020
6fd5b93
Add new package `@wordpress/lazy-import` for lazily installed package…
aduth Jun 3, 2020
655475a
Edit Site: Refactor business logic into store. (#22844)
epiqueras Jun 3, 2020
94f665e
wp-env: correct multisite support (#22613)
noahtallen Jun 4, 2020
338e253
Blocks: Skip null values returned from the server during registration…
gziolo Jun 4, 2020
ac64aca
Create Block: Integrate CSS import in JS with esnext template (#22727)
gziolo Jun 4, 2020
15a8f21
Add data-handle to all script tags in the admin. (#22721)
spacedmonkey Jun 4, 2020
aaccb9f
Rename BlockBreadcrumb to BlockSelectionButton (#22882)
talldan Jun 4, 2020
d6668b5
Compose: Bump react-resize-aware dependency to 3.0.1 (#22868)
aduth Jun 4, 2020
bee8d1a
Warn about open issues in milestone before starting release (#22764)
aduth Jun 4, 2020
8efd443
Meta Box Tutorial: Default to ESNext (#22748)
mkaz Jun 4, 2020
19fb4ae
Add transforms between the core widgets that have equivalent blocks (…
jorgefilipecosta Jun 4, 2020
b2ec648
Blocks: Avoid separate host matching constant for embeds (#13755)
aduth Jun 4, 2020
2f1a8e7
Image Block: add caption field to placeholder (#22295)
ellatrix Jun 4, 2020
ea9c463
Scripts: Split webpack loader rules for CSS and Sass files (#22786)
ocean90 Jun 4, 2020
a34d51b
CopyHandler: Fix unintended Copy override when copying from input or …
mcsf Jun 4, 2020
2320c04
ESLint Plugin/Scripts: Update ESLint and related deps to 7.1.0 (#22771)
ocean90 Jun 4, 2020
fc28252
Use Card instead of Panel for the block editor (#22827)
adamziel Jun 4, 2020
41e1051
Implement roving tabindex on the Image block (#22696)
diegohaz Jun 4, 2020
6bdb6fc
Fix: Legacy Widgets: Widgets with special chars on classname did not …
jorgefilipecosta Jun 4, 2020
394a21b
Refactor ImageSizeControl to functional components. (#22899)
torounit Jun 4, 2020
a623758
Fix font size picker reset button (#22896)
Soean Jun 4, 2020
32af450
Env: Remove unused options.hasTests param from JSDoc (#22911)
ocean90 Jun 4, 2020
d7ef8f1
Format library: Remove unused options.text param from JSDoc for creat…
ocean90 Jun 5, 2020
1490989
LinkControl - avoid showing "Recently updated" when there are no rece…
getdave Jun 5, 2020
8b949bf
Add link color picking in global styles (#22722)
jorgefilipecosta Jun 5, 2020
07b35e1
Fix items to have default cursor style (#22926)
getdave Jun 5, 2020
d4e2d90
add key to category select box. (#22904)
torounit Jun 5, 2020
e724276
Refactor BlockCompare block to use React hooks (#22909)
truchot Jun 5, 2020
5340282
Fix Custom select control component dropdown arrow spacing (#22925)
getdave Jun 5, 2020
6a90f56
Docs: Extend details about features integration with `theme.json` (#2…
gziolo Jun 5, 2020
23ef20f
Adds a heading to the block inserters tips (#22863) (#22898)
gaambo Jun 5, 2020
6622dd1
Add semantic headings to block inserter groups #22859 (#22903)
gaambo Jun 5, 2020
3e52a4d
Refactor FormFileUpload to use React hooks (#22894)
youknowriad Jun 5, 2020
1d0eecb
useSelect for block-title . (#22910)
torounit Jun 5, 2020
bf67748
Refactor AudioEdit block to use React hooks (#22901)
truchot Jun 5, 2020
15d2edd
Polish ImageSizeControl. (#22917)
ZebulanStanphill Jun 5, 2020
1f790bc
Clean up block padding rules for group block children (#22746)
kjellr Jun 5, 2020
68f62ad
revert - add selectionStart and selectionEnd to transientEdits (#22933)
dratwas Jun 5, 2020
7390563
Remove ifBlockEditSelected internal higher-order component (#22905)
aduth Jun 5, 2020
4bfcda9
Use React hooks for TabPanel component (#22906)
pkvillanueva Jun 5, 2020
0ab323a
Edit Site: Avoid dirtying un-customized templates on first load. (#22…
epiqueras Jun 5, 2020
5262790
Site Title Block: Add alignment and tag level support (#22843)
apeatling Jun 5, 2020
1969888
Remove jorgefilipecosta codeowner notifications
jorgefilipecosta Jun 5, 2020
a698810
initial improvement of reusable blocks documentation (#21843)
skorasaurus Jun 5, 2020
495ff0e
Try: removing the multi-block type check to make __experimentalConver…
gwwar Jun 5, 2020
bb93ee1
Allow unsupported blocks to be edited on mobile
etoledom Jun 5, 2020
e599435
Update triage to include release instructions (#22335)
annezazu Jun 5, 2020
a925928
Add mechanism to render complementary areas on edit site (#21430)
jorgefilipecosta Jun 5, 2020
710373b
Update block fixture README to use shorter friendlier version of comm…
talldan Jun 5, 2020
64c06cd
Make ToolbarButton API consistent (#22961)
diegohaz Jun 6, 2020
898dfaa
Merge branch 'master' of github.com:WordPress/gutenberg
Jun 6, 2020
10fdce9
Template-04-controls-esnext - initial folder structure and commit
Jun 6, 2020
52d40da
Template-04-controls-esnext - remove initial folder setup, duplicate …
Jun 6, 2020
94e469d
Template-04-controls-esnext - updated template to match https://githu…
Jun 6, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ module.exports = {
'Avoid truthy checks on length property rendering, as zero length is rendered verbatim.',
},
],
// Temporarily converted to warning until all errors are resolved.
// See https://github.com/WordPress/gutenberg/pull/22771 for the eslint-plugin-jsdoc update.
'jsdoc/check-param-names': 'warn',
'jsdoc/require-param': 'warn',
},
overrides: [
{
Expand Down
48 changes: 24 additions & 24 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@
/packages/core-data @youknowriad @nerrad
/packages/data @youknowriad @nerrad @coderkevin
/packages/redux-routine @youknowriad @nerrad
/packages/data-controls @nerrad @aduth
/packages/data-controls @nerrad

# Blocks
/packages/block-library @Soean @ajitbohra @jorgefilipecosta @talldan
/packages/block-library @Soean @ajitbohra @talldan
/packages/block-library/src/gallery @mkevins @pinarol
/packages/block-library/src/social-links @mkaz
/packages/block-library/src/social-link @mkaz

# Editor
/packages/annotations @atimmer @ellatrix
/packages/autop @aduth
/packages/autop
/packages/block-editor @youknowriad @ellatrix
/packages/block-serialization-spec-parser @dmsnell
/packages/block-serialization-default-parser @dmsnell
/packages/blocks @youknowriad @ellatrix @aduth
/packages/blocks @youknowriad @ellatrix
/packages/edit-post
/packages/editor
/packages/list-reusable-blocks @youknowriad
Expand Down Expand Up @@ -63,35 +63,35 @@
/packages/postcss-themes @youknowriad @ntwb @nerrad @ajitbohra
/packages/scripts @gziolo @ntwb @nerrad @ajitbohra
/packages/dependency-extraction-webpack-plugin @gziolo
/packages/prettier-config @ntwb @gziolo @aduth
/packages/prettier-config @ntwb @gziolo

# UI Components
/packages/components @youknowriad @ajitbohra @jaymanpandya @jorgefilipecosta @chrisvanpatten
/packages/compose @youknowriad @ajitbohra @jaymanpandya @jorgefilipecosta
/packages/element @youknowriad @ajitbohra @jaymanpandya @jorgefilipecosta
/packages/notices @ajitbohra @jaymanpandya @jorgefilipecosta
/packages/nux @ajitbohra @jaymanpandya @jorgefilipecosta
/packages/viewport @ajitbohra @jaymanpandya @jorgefilipecosta
/packages/components @youknowriad @ajitbohra @jaymanpandya @chrisvanpatten
/packages/compose @youknowriad @ajitbohra @jaymanpandya
/packages/element @youknowriad @ajitbohra @jaymanpandya
/packages/notices @ajitbohra @jaymanpandya
/packages/nux @ajitbohra @jaymanpandya
/packages/viewport @ajitbohra @jaymanpandya
/packages/base-styles
/packages/icons
/packages/primitives

# Utilities
/packages/a11y @youknowriad @aduth
/packages/blob @aduth
/packages/a11y @youknowriad
/packages/blob
/packages/date
/packages/deprecated @youknowriad @aduth
/packages/deprecated @youknowriad
/packages/dom @ellatrix
/packages/dom-ready @aduth
/packages/dom-ready
/packages/escape-html
/packages/html-entities
/packages/i18n @swissspidy
/packages/is-shallow-equal @aduth
/packages/is-shallow-equal
/packages/keycodes @talldan @ellatrix
/packages/priority-queue @youknowriad @aduth
/packages/token-list @aduth
/packages/url @talldan @aduth
/packages/wordcount @aduth
/packages/priority-queue @youknowriad
/packages/token-list
/packages/url @talldan
/packages/wordcount
/packages/warning
/packages/keyboard-shortcuts

Expand All @@ -100,13 +100,13 @@
/packages/plugins @gziolo @adamsilverstein

# Rich Text
/packages/format-library @ellatrix @jorgefilipecosta @daniloercoli @sergioestevao @etoledom
/packages/rich-text @ellatrix @jorgefilipecosta @daniloercoli @sergioestevao @etoledom
/packages/block-editor/src/components/rich-text @ellatrix @jorgefilipecosta @daniloercoli @sergioestevao @etoledom
/packages/format-library @ellatrix @daniloercoli @sergioestevao @etoledom
/packages/rich-text @ellatrix @daniloercoli @sergioestevao @etoledom
/packages/block-editor/src/components/rich-text @ellatrix @daniloercoli @sergioestevao @etoledom

# Project Management
/.github @youknowriad @mapk @karmatosed
/packages/project-management-automation @aduth
/packages/project-management-automation

# wp-env
/packages/env @epiqueras @noahtallen
Expand Down
8 changes: 3 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ install:
- npm run build
- |
if [[ "$INSTALL_WORDPRESS" = "true" ]]; then
echo '{ "config": { "SCRIPT_DEBUG": false, "WP_PHP_BINARY": "php" } }' > .wp-env.override.json
echo '{ "config": { "SCRIPT_DEBUG": false, "WP_PHP_BINARY": "php", "WP_TESTS_EMAIL": "[email protected]", "WP_TESTS_TITLE": "Test Blog" } }' > .wp-env.override.json
chmod -R 767 ./ # TODO: Possibly integrate in wp-env
npm run wp-env start
fi
- |
Expand Down Expand Up @@ -128,15 +129,12 @@ jobs:
- npm run test-unit:native -- --ci --maxWorkers=2 --cacheDirectory="$HOME/.jest-cache"

- name: PHP unit tests
env: WP_ENV_TESTS_PORT=8887 WP_ENV_PORT=8886 # TODO: Remove tests port when scripts/env is replaced with wp-env.
script:
- chmod -R 767 ./build
- npm run test-php && npm run test-unit-php-multisite

- name: PHP unit tests (PHP 5.6)
env: LOCAL_PHP=5.6-fpm WP_ENV_TESTS_PORT=8887 WP_ENV_PORT=8886 # TODO: Remove tests port when scripts/env is replaced with wp-env.
env: LOCAL_PHP=5.6-fpm
script:
- chmod -R 767 ./build
- npm run test-php && npm run test-unit-php-multisite

- name: E2E tests (Admin) (1/4)
Expand Down
108 changes: 24 additions & 84 deletions bin/plugin/commands/changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,17 @@
*/
const { groupBy, escapeRegExp, uniq } = require( 'lodash' );
const Octokit = require( '@octokit/rest' );
const { sprintf } = require( 'sprintf-js' );
const semver = require( 'semver' );

/**
* Internal dependencies
*/
const { getNextMajorVersion } = require( '../lib/version' );
const {
getMilestoneByTitle,
getIssuesByMilestone,
} = require( '../lib/milestone' );
const { log, formats } = require( '../lib/logger' );
const config = require( '../config' );
// @ts-ignore
Expand Down Expand Up @@ -98,22 +104,6 @@ const REWORD_TERMS = {
docs: 'documentation',
};

/**
* Given a SemVer-formatted version string, returns an assumed milestone title
* associated with that version.
*
* @see https://semver.org/
*
* @param {string} version Version string.
*
* @return {string} Milestone title.
*/
function getMilestone( version ) {
const [ major, minor ] = version.split( '.' );

return `Gutenberg ${ major }.${ minor }`;
}

/**
* Returns type candidates based on given issue label names.
*
Expand Down Expand Up @@ -346,72 +336,6 @@ function getEntry( issue ) {
: `- ${ title } ([${ issue.number }](${ issue.html_url }))`;
}

/**
* Returns a promise resolving to a milestone by a given title, if exists.
*
* @param {GitHub} octokit Initialized Octokit REST client.
* @param {string} owner Repository owner.
* @param {string} repo Repository name.
* @param {string} title Milestone title.
*
* @return {Promise<OktokitIssuesListMilestonesForRepoResponseItem|void>} Promise resolving to milestone, if exists.
*/
async function getMilestoneByTitle( octokit, owner, repo, title ) {
const options = octokit.issues.listMilestonesForRepo.endpoint.merge( {
owner,
repo,
} );

/**
* @type {AsyncIterableIterator<import('@octokit/rest').Response<import('@octokit/rest').IssuesListMilestonesForRepoResponse>>}
*/
const responses = octokit.paginate.iterator( options );

for await ( const response of responses ) {
const milestones = response.data;
for ( const milestone of milestones ) {
if ( milestone.title === title ) {
return milestone;
}
}
}
}

/**
* Returns a promise resolving to pull requests by a given milestone ID.
*
* @param {GitHub} octokit Initialized Octokit REST client.
* @param {string} owner Repository owner.
* @param {string} repo Repository name.
* @param {number} milestone Milestone ID.
*
* @return {Promise<IssuesListForRepoResponseItem[]>} Promise resolving to pull
* requests for the given
* milestone.
*/
async function getPullRequestsByMilestone( octokit, owner, repo, milestone ) {
const options = octokit.issues.listForRepo.endpoint.merge( {
owner,
repo,
milestone,
state: 'closed',
} );

/**
* @type {AsyncIterableIterator<import('@octokit/rest').Response<import('@octokit/rest').IssuesListForRepoResponse>>}
*/
const responses = octokit.paginate.iterator( options );

const pulls = [];

for await ( const response of responses ) {
const issues = response.data;
pulls.push( ...issues.filter( ( issue ) => issue.pull_request ) );
}

return pulls;
}

/**
* Returns a promise resolving to an array of pull requests associated with the
* changelog settings object.
Expand All @@ -438,7 +362,14 @@ async function fetchAllPullRequests( octokit, settings ) {
}

const { number } = milestone;
return getPullRequestsByMilestone( octokit, owner, repo, number );
const issues = await getIssuesByMilestone(
octokit,
owner,
repo,
number,
'closed'
);
return issues.filter( ( issue ) => issue.pull_request );
}

/**
Expand Down Expand Up @@ -516,7 +447,16 @@ async function getReleaseChangelog( options ) {
token: options.token,
milestone:
options.milestone === undefined
? getMilestone( getNextMajorVersion( manifest.version ) )
? // Disable reason: valid-sprintf applies to `@wordpress/i18n` where
// strings are expected to need to be extracted, and thus variables are
// not allowed. This string will not need to be extracted.
// eslint-disable-next-line @wordpress/valid-sprintf
sprintf( config.versionMilestoneFormat, {
...config,
...semver.parse(
getNextMajorVersion( manifest.version )
),
} )
: options.milestone,
} );
}
Expand Down
57 changes: 57 additions & 0 deletions bin/plugin/commands/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const inquirer = require( 'inquirer' );
const fs = require( 'fs' );
const semver = require( 'semver' );
const Octokit = require( '@octokit/rest' );
const { sprintf } = require( 'sprintf-js' );

/**
* Internal dependencies
Expand All @@ -19,6 +20,10 @@ const {
const git = require( '../lib/git' );
const svn = require( '../lib/svn' );
const { getNextMajorVersion } = require( '../lib/version' );
const {
getIssuesByMilestone,
getMilestoneByTitle,
} = require( '../lib/milestone' );
const config = require( '../config' );
const {
runGitRepositoryCloneStep,
Expand Down Expand Up @@ -624,6 +629,50 @@ async function updateThePluginStableVersion(
);
}

/**
* Checks whether the milestone associated with the release has open issues or
* pull requests. Returns a promise resolving to true if there are no open issue
* or pull requests, or false otherwise.
*
* @param {string} version Release version.
*
* @return {Promise<boolean>} Promise resolving to boolean indicating whether
* the milestone is clear of open issues.
*/
async function isMilestoneClear( version ) {
const { githubRepositoryOwner: owner, githubRepositoryName: name } = config;
const octokit = new Octokit();
const milestone = await getMilestoneByTitle(
octokit,
owner,
name,
// Disable reason: valid-sprintf applies to `@wordpress/i18n` where
// strings are expected to need to be extracted, and thus variables are
// not allowed. This string will not need to be extracted.
// eslint-disable-next-line @wordpress/valid-sprintf
sprintf( config.versionMilestoneFormat, {
...config,
...semver.parse( version ),
} )
);

if ( ! milestone ) {
// If milestone can't be found, it's not especially actionable to warn
// that the milestone isn't clear. `true` is the sensible fallback.
return true;
}

const issues = await getIssuesByMilestone(
new Octokit(),
owner,
name,
milestone.number,
'open'
);

return issues.length === 0;
}

/**
* Release a new version.
*
Expand Down Expand Up @@ -661,6 +710,14 @@ async function releasePlugin( isRC = true ) {
abortMessage
);

if ( ! ( await isMilestoneClear( version ) ) ) {
await askForConfirmation(
'There are still open issues in the milestone. Are you sure you want to proceed?',
false,
abortMessage
);
}

// Bumping the version and commit.
const commitHash = await runBumpPluginVersionUpdateChangelogAndCommitStep(
gitWorkingDirectory,
Expand Down
5 changes: 5 additions & 0 deletions bin/plugin/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ const gitRepoOwner = 'WordPress';
* @property {string} slug Slug.
* @property {string} name Name.
* @property {string} team Github Team Name.
* @property {string} versionMilestoneFormat printf template for milestone
* version name. Expected to be called
* with a merged object of the config
* and semver-parsed version parts.
* @property {string} githubRepositoryOwner Github Repository Owner.
* @property {string} githubRepositoryName Github Repository Name.
* @property {string} pluginEntryPoint Plugin Entry Point File.
Expand All @@ -22,6 +26,7 @@ const config = {
slug: 'gutenberg',
name: 'Gutenberg',
team: 'Gutenberg Core',
versionMilestoneFormat: '%(name)s %(major)s.%(minor)s',
githubRepositoryOwner: gitRepoOwner,
githubRepositoryName: 'gutenberg',
pluginEntryPoint: 'gutenberg.php',
Expand Down
Loading