Skip to content

Commit

Permalink
Merge branch 'master' into fix/editorconfig-json
Browse files Browse the repository at this point in the history
  • Loading branch information
ntwb committed Jul 10, 2017
2 parents a7234bd + c29f11f commit 9c12e12
Show file tree
Hide file tree
Showing 670 changed files with 14,562 additions and 16,751 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
build
coverage
docs
vendor
14 changes: 9 additions & 5 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@
"extends": [
"wordpress",
"plugin:react/recommended",
"plugin:jsx-a11y/recommended"
],
"plugin:jsx-a11y/recommended",
"plugin:jest/recommended"
],
"env": {
"browser": false,
"es6": true,
"node": true,
"mocha": true
},
"mocha": true,
"jest/globals": true
},
"parserOptions": {
"sourceType": "module",
"ecmaFeatures": {
Expand All @@ -26,7 +28,8 @@
},
"plugins": [
"react",
"jsx-a11y"
"jsx-a11y",
"jest"
],
"settings": {
"react": {
Expand All @@ -46,6 +49,7 @@
"eol-last": "error",
"func-call-spacing": "error",
"indent": [ "error", "tab", { "SwitchCase": 1 } ],
"jest/valid-expect": "off",
"jsx-quotes": "error",
"key-spacing": "error",
"keyword-spacing": "error",
Expand Down
41 changes: 41 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!--
BEFORE POSTING YOUR ISSUE:
- These comments won't show up when you submit the issue.
- Try to add as much detail as possible. Be specific!
- Please add the version of Gutenberg you are using in the description
- If you're requesting a new feature, explain why you'd like it to be added.
- Search this repository for the issue and whether it has been fixed or reported already.
- Ensure you are using the latest code before logging bugs.
- Disable all plugins to ensure it's not a plugin conflict issue.
-->

## Issue Overview
<!-- This is a brief overview of the issue. --->

## Steps to Reproduce (for bugs)
<!-- Provide a link to a live example, or an unambiguous set of steps to -->
<!-- reproduce this bug. Include code to reproduce, if relevant -->
1.
2.
3.
4.
<!-- Provide what browser you are using and any other specfics to your setup -->

## Expected Behavior
<!-- If you're describing a bug, tell us what should happen -->
<!-- If you're suggesting a change/improvement, tell us how it should work -->

## Current Behavior
<!-- If describing a bug, tell us what happens instead of the expected behavior -->
<!-- If suggesting a change/improvement, explain the difference from current behavior -->

## Possible Solution
<!-- Not obligatory, but suggest a fix/reason for the bug, -->
<!-- or ideas how to implement the addition or change -->

## Related Issues and/or PRs
<!-- List related issues or PRs against other branches: -->

## Todos
- [ ] Tests
- [ ] Documentation
14 changes: 9 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
node_modules
# Directories/files that may be generated by this project
build
gutenberg.pot
.vscode
coverage
node_modules
storybook-static
gutenberg.zip

# Directories/files that may appear in your environment
.DS_Store
*.log
phpcs.xml
yarn.lock
gutenberg.zip
storybook-static
10 changes: 10 additions & 0 deletions .storybook/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,18 @@ import './style.scss';

function loadStories() {
window.wp = { ...window.wp, element };
require( './stories/intro' );
require( './stories/contributing' );
require( './stories/coding-guidelines' );
require( './stories/design' );
require( '../i18n/story' );
require( '../element/story' );
require( '../blocks/story' );
require( '../editor/story' );
require( '../components/story' );
require( '../components/button/story' );
require( '../components/higher-order/story' );
require( '../components/higher-order/with-instance-id/story' );
}

setOptions( {
Expand Down
15 changes: 15 additions & 0 deletions .storybook/stories/coding-guidelines.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* External dependencies
*/
import ReactMarkdown from 'react-markdown';
import { storiesOf } from '@storybook/react';
import { withKnobs } from '@storybook/addon-knobs';

/**
* Internal dependencies
*/
import readme from '../../docs/coding-guidelines.md';

storiesOf( 'Gutenberg', module )
.addDecorator( withKnobs )
.add( 'Coding Guidelines', () => <ReactMarkdown source={ readme } /> );
15 changes: 15 additions & 0 deletions .storybook/stories/contributing.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* External dependencies
*/
import ReactMarkdown from 'react-markdown';
import { storiesOf } from '@storybook/react';
import { withKnobs } from '@storybook/addon-knobs';

/**
* Internal dependencies
*/
import readme from '../../CONTRIBUTING.md';

storiesOf( 'Gutenberg', module )
.addDecorator( withKnobs )
.add( 'Contributing', () => <ReactMarkdown source={ readme } /> );
15 changes: 15 additions & 0 deletions .storybook/stories/design.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* External dependencies
*/
import ReactMarkdown from 'react-markdown';
import { storiesOf } from '@storybook/react';
import { withKnobs } from '@storybook/addon-knobs';

/**
* Internal dependencies
*/
import readme from '../../docs/design.md';

storiesOf( 'Gutenberg', module )
.addDecorator( withKnobs )
.add( 'Design', () => <ReactMarkdown source={ readme } /> );
15 changes: 15 additions & 0 deletions .storybook/stories/intro.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* External dependencies
*/
import ReactMarkdown from 'react-markdown';
import { storiesOf } from '@storybook/react';
import { withKnobs } from '@storybook/addon-knobs';

/**
* Internal dependencies
*/
import readme from '../../README.md';

storiesOf( 'Gutenberg', module )
.addDecorator( withKnobs )
.add( 'Intro', () => <ReactMarkdown source={ readme } /> );
14 changes: 14 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,22 @@ before_script:
script:
- |
if [[ ! -z "$WP_VERSION" ]] ; then
# Run the build because otherwise there will be a bunch of warnings about
# failed `stat` calls from `filemtime()`.
npm install || exit 1
npm run build || exit 1
# Make sure phpegjs parser is up to date
node bin/create-php-parser.js || exit 1
if ! git diff --quiet --exit-code lib/parser.php; then
echo 'ERROR: The PEG parser has been updated, but the generated PHP version'
echo ' (lib/parser.php) has not. Run `bin/create-php-parser.js` and'
echo ' commit the resulting changes to resolve this.'
sleep .2 # Otherwise Travis doesn't want to print the whole message
exit 1
fi
# Check parser syntax
php lib/parser.php || exit 1
# Run PHPUnit tests
phpunit || exit 1
WP_MULTISITE=1 phpunit || exit 1
fi
Expand Down
40 changes: 36 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,19 @@

## Installing & Building the Plugin

Gutenberg is a node based project, built primarily in JavaScript. Be sure to have <a href="https://nodejs.org/en/">Node installed first</a>. If you already have node installed, make sure it's version 6.10.3 or higher for this plugin to work correctly. You can check your node version by typing `node -v` in the Terminal prompt.
Gutenberg is a Node-based project, built primarily in JavaScript. Be sure to have <a href="https://nodejs.org/en/">Node installed first</a>. If you already have Node installed, make sure it's version 6.10.3 or higher for this plugin to work correctly. You can check your Node version by typing `node -v` in the Terminal prompt.

To test the plugin, or to contribute to it, you can clone this repository and build the plugin files using Node.
To test the plugin, or to contribute to it, you can clone this repository and build the plugin files using Node. How you do that depends on whether you're developing locally or uploading the plugin to a remote host.

To do that, open a terminal (or if on Windows, a command prompt) and navigate to the repository you cloned. Now type `npm install` to get the dependencies all set up. Once that finishes, you can type `npm run build`. You can now upload the entire repository to your `wp-content/plugins` directory on your webserver and activate the plugin from the WordPress admin. You'll get a separate WordPress menu item called Gutenberg.
### On A Remote Server

Open a terminal (or if on Windows, a command prompt) and navigate to the repository you cloned. Now type `npm install` to get the dependencies all set up. Once that finishes, you can type `npm run build`. You can now upload the entire repository to your `wp-content/plugins` directory on your webserver and activate the plugin from the WordPress admin. You'll get a separate WordPress menu item called Gutenberg.

You can also type `npm run package-plugin` which will run the two commands above and create a zip file automatically for you which you can use to install Gutenberg through the WordPress admin.

If you have a local WordPress environment, you can clone this repository into your `wp-content/plugins` directory directly. Then you can type `npm run dev` in your terminal or command prompt to keep the plugin building in the background as you work on it.
### On a Local WordPress Environment

If you have a local WordPress environment, you can clone this repository right into your `wp-content/plugins` directory. `npm install` will get the dependencies set up. Then you can type `npm run dev` in your terminal or command prompt to keep the plugin building in the background as you work on it.

Some good options for a local WordPress development environment include <a href="https://varyingvagrantvagrants.org/">VVV</a> and <a href="https://www.mamp.info/">Mamp</a>.

Expand All @@ -28,6 +32,34 @@ For example, `add/gallery-block` means you're working on adding a new gallery bl

You can pick among all the <a href="https://github.com/WordPress/gutenberg/issues">tickets</a>, or some of the ones labelled <a href="https://github.com/WordPress/gutenberg/labels/Good%20First%20Task">Good First Task</a>.

## Testing

Gutenberg contains both PHP and JavaScript code, and encourages testing and code style linting for both.

### JavaScript Testing

Tests for JavaScript use [Jest](http://facebook.github.io/jest//) as the test runner. If needed, you can also use [Sinon](http://sinonjs.org/) for mocking and [Enzyme](https://github.com/airbnb/enzyme) for React component testing.

Assuming you've followed the instructions above to install Node and project dependencies, tests can be run from the command-line with NPM:

```
npm test
```

To run unit tests only, use `npm run test-unit` instead.

Code style in JavaScript is enforced using [ESLint](http://eslint.org/). The above `npm test` will execute both unit tests and code linting. Code linting can be verified independently by running `npm run lint`.

### PHP Testing

Tests for PHP use [PHPUnit](https://phpunit.de/) as the testing framework. Before starting, you should install PHPUnit and have a copy of [WordPress Develop](https://github.com/WordPress/wordpress-develop) available and setup a [`wp-tests-config.php`](https://make.wordpress.org/core/handbook/testing/automated-testing/phpunit/#setup) file. If the Gutenberg plugin is installed in the context of a WordPress Develop site, you can run `phpunit` directly from the command-line. Otherwise, you will need to specify the path to WordPress Develop's test directory as an environment variable:

```
WP_TESTS_DIR=/path/to/wordpress-develop/tests/phpunit phpunit
```

Code style in PHP is enforced using [PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer). It is recommended that you install PHP_CodeSniffer and the [WordPress Coding Standards for PHP_CodeSniffer](https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards#installation) ruleset using [Composer](https://getcomposer.org/). With Composer installed, run `composer install` from the project directory to install dependencies, then `composer run-script lint` to verify PHP code standards.

## How Designers Can Contribute

If you'd like to contribute to the design or front-end, feel free to contribute to tickets labelled <a href="https://github.com/WordPress/gutenberg/issues?q=is%3Aissue+is%3Aopen+label%3ADesign">Design</a>. We could use your thoughtful replies, mockups, animatics, sketches, doodles. Proposed changes are best done as minimal and specific iterations on the work that precedes it so we can compare. If you use <a href="https://www.sketchapp.com/">Sketch</a>, you can grab <a href="https://cloudup.com/cMPXM8Va2cy">the source file for the mockups</a> (updated April 6th).
72 changes: 72 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Contributors

Gutenberg is built by many contributors and volunteers. Thanks to all of them for their work!

This list is manually curated to include valuable contributions by volunteers that do not include code, such as user testing, providing feedback, or mockups. Please edit this list to include new contributors as they come in. There is no particular order to this list. If you or someone else were omitted from this list, we assure you that was not intentional. Please let us know and we'll add you.

| GitHub Username | WordPress.org Username|
| --------------- | --------------------- |
| @youknowriad | |
| @aduth | |
| @jasmussen | |
| @iseulde | |
| @mtias | |
| @nylen | |
| @EphoxJames | |
| @mkaz | |
| @notnownikki | |
| @BE-Webdesign | |
| @njpanderson | |
| @mimo84 | |
| @intronic | |
| @westonruter | |
| @mcsf | |
| @dmsnell | |
| @afercia | |
| @paulwilde | |
| @mitogh | |
| @codebykat | |
| @ahmadawais | @mrahmadawais |
| @kopepasah | |
| @circlecube | |
| @adamsilverstein | |
| @timmyc | |
| @ephox-mogran | |
| @nb | |
| @JDGrimes | |
| @Soean | |
| @mapk | |
| @sirjonathan | |
| @j-falk | |
| @ryelle | |
| @ntwb | @netweb |
| @lamosty | |
| @willybahuaud | |
| @maurobringolf | |
| @aaronjorbin | |
| @spocke | |
| @androb | |
| @annaephox | |
| @Afraithe | |
| @georgeh | |
| @m | |
| @melchoyce | |
| @pento | |
| @karmatosed | |
| @nitrajka | |
| @sirreal | |
| @inhil | |
| @georgeolaru | |
| @martinlugton | |
| @joyously | |
| @rileybrook | |
| @azaozz | |
| @folletto | |
| @ianstewart | |
| @johnpixle | |
| @mrwweb | |
| @diegoliv | |
| @lukecav | |
| @shaunandrews | |
| @hugobaeta | |
| @mizejewski | |
Loading

0 comments on commit 9c12e12

Please sign in to comment.