Skip to content

Commit 563bd94

Browse files
authored
Merge pull request #141 from envato/develop
Launch version 2 of plugin.
2 parents f15c1f4 + 5886fc0 commit 563bd94

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+6542
-2138
lines changed

.jscsrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"preset": "wordpress",
33
"requireCamelCaseOrUpperCaseIdentifiers": null,
44
"excludeFiles": [
5-
"**/vendor/**",
65
"**/*.min.js",
7-
"**/node_modules/**"
6+
"**/node_modules/**",
7+
"**/vendor/**"
88
]
99
}

.jshintrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

.jshintrc

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"boss": true,
3+
"curly": true,
4+
"eqeqeq": true,
5+
"eqnull": true,
6+
"es3": true,
7+
"expr": true,
8+
"immed": true,
9+
"noarg": true,
10+
"nonbsp": true,
11+
"onevar": true,
12+
"quotmark": "single",
13+
"trailing": true,
14+
"undef": true,
15+
"unused": true,
16+
17+
"browser": true,
18+
19+
"globals": {
20+
"_": false,
21+
"Backbone": false,
22+
"jQuery": false,
23+
"JSON": false,
24+
"wp": false
25+
}
26+
}

.travis.yml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,31 @@
11
sudo: false
2+
dist: precise
3+
4+
notifications:
5+
email:
6+
on_success: never
7+
on_failure: change
8+
9+
cache:
10+
directories:
11+
- node_modules
12+
- vendor
13+
- $HOME/phpunit-bin
14+
15+
language:
16+
- php
217

3-
language: php
4-
518
php:
619
- 5.4
7-
- 5.5
8-
- 5.6
9-
- 7.0
20+
- 7.2
1021

1122
env:
1223
- WP_VERSION=latest WP_MULTISITE=0
13-
- WP_VERSION=latest WP_MULTISITE=1
1424

1525
install:
1626
- export DEV_LIB_PATH=dev-lib
1727
- if [ ! -e "$DEV_LIB_PATH" ] && [ -L .travis.yml ]; then export DEV_LIB_PATH=$( dirname $( readlink .travis.yml ) ); fi
28+
- if [ ! -e "$DEV_LIB_PATH" ]; then git clone https://github.com/xwp/wp-dev-lib.git $DEV_LIB_PATH; fi
1829
- source $DEV_LIB_PATH/travis.install.sh
1930

2031
script:

Gruntfile.js

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,11 @@ module.exports = function( grunt ) {
181181
'!readme.md',
182182
'!sass/**',
183183
'!tests/**',
184-
'!vendor/**'
184+
'!bin/**',
185+
'!vendor/**',
186+
'!package-lock.json',
187+
'!phpcs.xml.dist',
188+
'!composer.lock'
185189
],
186190
dest: 'dist/<%= pkg.name %>',
187191
expand: true,
@@ -216,7 +220,7 @@ module.exports = function( grunt ) {
216220

217221
// VVV (Varying Vagrant Vagrants) Paths
218222
vvv: {
219-
'plugin': '/srv/www/wordpress-develop/src/wp-content/plugins/<%= pkg.name %>',
223+
'plugin': '/srv/www/envato-market/docroot/wp-content/plugins/<%= pkg.name %>',
220224
'coverage': '/srv/www/default/coverage/<%= pkg.name %>'
221225
},
222226

@@ -227,14 +231,23 @@ module.exports = function( grunt ) {
227231
stderr: true
228232
},
229233
readme: {
230-
command: 'cd ./dev-lib && ./generate-markdown-readme' // Genrate the readme.md
234+
command: 'cd ./dev-lib && ./generate-markdown-readme' // Generate the readme.md
231235
},
232236
phpunit: {
233237
command: 'vagrant ssh -c "cd <%= vvv.plugin %> && phpunit"'
234238
},
235239
phpunit_c: {
236240
command: 'vagrant ssh -c "cd <%= vvv.plugin %> && phpunit --coverage-html <%= vvv.coverage %>"'
237-
}
241+
},
242+
phpcs: {
243+
command: 'vagrant ssh -c "cd <%= vvv.plugin %> && phpcs"'
244+
},
245+
phpcbf: {
246+
command: 'vagrant ssh -c "cd <%= vvv.plugin %> && phpcbf"'
247+
},
248+
precommit: {
249+
command: 'vagrant ssh -c "cd <%= vvv.plugin %> && DEV_LIB_SKIP="xmllint" ./dev-lib/pre-commit"'
250+
}
238251
}
239252

240253
});
@@ -278,6 +291,18 @@ module.exports = function( grunt ) {
278291
'shell:phpunit_c'
279292
] );
280293

294+
grunt.registerTask( 'phpcs', [
295+
'shell:phpcs'
296+
] );
297+
298+
grunt.registerTask( 'phpcbf', [
299+
'shell:phpcbf'
300+
] );
301+
302+
grunt.registerTask( 'precommit', [
303+
'shell:precommit'
304+
] );
305+
281306
grunt.registerTask( 'dev', [
282307
'default',
283308
'makepot',

composer.json

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,22 @@
11
{
2-
"require": {
3-
"php": ">=5.2.7"
4-
},
5-
"require-dev": {
6-
"satooshi/php-coveralls": "dev-master"
7-
}
2+
"name": "envato/wp-envato-market",
3+
"description": "WordPress Theme & Plugin management for the Envato Market.",
4+
"type": "wordpress-plugin",
5+
"dist": {
6+
"url": "[email protected]:envato/wp-envato-market.git",
7+
"type": "git"
8+
},
9+
"license": "GPL",
10+
"authors": [
11+
{
12+
"name": "Envato",
13+
"homepage": "https://envato.com"
14+
}
15+
],
16+
"require": {
17+
"php": ">=5.4.0"
18+
},
19+
"require-dev": {
20+
"satooshi/php-coveralls": "^1.0"
21+
}
822
}

contributing.md

Lines changed: 43 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ We're really excited that you are interested in contributing to the Envato Marke
44

55
## Issue Reporting Guidelines
66

7-
- The issue list of this repo is **exclusively** for bug reports and feature requests. For simple questions, please use [Gitter](https://gitter.im/envato/wp-envato-market).
8-
- Try to search for your issue, it may have already been answered or even fixed in the `wip` (Work in Progress) branch.
7+
- The issue list of this repo is **exclusively** for bug reports and feature requests.
8+
- Try to search for your issue, it may have already been answered or even fixed in the `develop` branch.
99
- Check if the issue is reproducible with the latest stable version. If you are using a pre-release, please indicate the specific version you are using.
1010
- It is **required** that you clearly describe the steps necessary to reproduce the issue you are running into. Issues without clear reproducible steps will be closed immediately.
1111
- If your issue is resolved but still open, don't hesitate to close it. In case you found a solution by yourself, it could be helpful to explain how you fixed it.
1212

1313
## Pull Request Guidelines
1414

15-
- Checkout a topic branch from `wip` and merge back against `wip`.
15+
- Checkout a topic branch from `develop` and merge back against `develop`.
1616
- If you are not familiar with branching please read [_A successful Git branching model_](http://nvie.com/posts/a-successful-git-branching-model/) before you go any further.
1717
- **DO NOT** check-in the `dist` directory in your commits.
1818
- Follow the [WordPress Coding Standards](https://make.wordpress.org/core/handbook/coding-standards/).
@@ -26,25 +26,50 @@ We're really excited that you are interested in contributing to the Envato Marke
2626

2727
## Development Setup
2828

29-
You will need [Node.js](http://nodejs.org), [Grunt](http://gruntjs.com), & [PHPUnit](https://phpunit.de/getting-started.html) installed on your system. To run the unit tests you must be developing within the WordPress Core. The simplest method to get a testing environment up is by using [Varying Vagrant Vagrants](https://github.com/Varying-Vagrant-Vagrants/VVV). However, if you are using MAMP then the following command will clone `trunk`.
29+
#### Install VaryingVagrantVagrants
3030

31-
To clone the WordPress Core
31+
- Install Vagrant/VirtualBox/Plugins by following [these instructions](https://varyingvagrantvagrants.org/docs/en-US/installation/software-requirements/) then:
32+
- `git clone -b master git://github.com/Varying-Vagrant-Vagrants/VVV.git ~/vagrant-local/`
33+
- `cd ~/vagrant-local/`
34+
- `vagrant up` (can take 30-60mins first time)
35+
- Test you can access `http://src.wordpress-develop.test/` from your browser.
36+
- Note: If you see `phpcs not found` or composer errors during setup it means you need a Github token, try running a manual provision to get prompted for a Github token: `vagrant ssh` then once connected run `sudo /vagrant/provision/provision.sh` and follow the prompts.
3237

33-
``` bash
34-
$ git clone git://develop.git.wordpress.org/trunk/
35-
```
38+
#### Setup a new WordPress site for local development.
3639

37-
To clone this repository
38-
``` bash
39-
$ git clone --recursive [email protected]:envato/wp-envato-market.git envato-market
40-
```
40+
- `cd ~/vagrant-local/`
41+
- `cp vvv-config.yml vvv-custom.yml`
42+
- edit `vvv-custom.yml` and add a new entry under `sites:` like this:
43+
```
44+
envato-market:
45+
repo: https://github.com/dtbaker/vvv.envato-market.test.git
46+
hosts:
47+
- vvv.envato-market.test
48+
```
49+
- `vagrant reload --provision`
50+
- Confirm you can access the new site here: `http://vvv.envato-market.test/`
51+
- Confirm you can login here: `http://vvv.envato-market.test/wp-admin/` (default login is dev/dev)
52+
- Confirm the WordPress plugin is activated.
4153
42-
To install packages
54+
#### Confirm grunt works:
4355
44-
``` bash
45-
# npm install -g grunt-cli
46-
$ npm install
47-
```
56+
- `cd ~/vagrant-local/www/envato-market/docroot/wp-content/plugins/envato-market/`
57+
- `grunt`
58+
- Note: If you receive any 'node rebuild' error, try running `npm rebuild`
59+
60+
#### Confirm tests run via VVV
61+
62+
- `cd ~/vagrant-local/www/envato-market/docroot/wp-content/plugins/envato-market/`
63+
- `grunt phpunit`
64+
65+
#### Make changes:
66+
67+
- Make changes to the github repository at `~/vagrant-local/www/envato-market/docroot/wp-content/plugins/envato-market/`
68+
- Test changes via `http://vvv.envato-market.test`
69+
- Commit changes to a new branch and make a pull request against the `develop` branch.
70+
71+
72+
## Grunt tasks:
4873
4974
To lint:
5075
@@ -78,7 +103,7 @@ $ grunt makepot
78103

79104
The default task (simply running `grunt`) will do the following: `jshint -> css -> uglify`.
80105

81-
### PHPUnit Testing
106+
## PHPUnit Testing
82107

83108
Run tests:
84109

css/envato-market-rtl.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

css/envato-market.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)