Skip to content

Commit

Permalink
Merge pull request #141 from envato/develop
Browse files Browse the repository at this point in the history
Launch version 2 of plugin.
  • Loading branch information
dtbaker authored Mar 12, 2018
2 parents f15c1f4 + 5886fc0 commit 563bd94
Show file tree
Hide file tree
Showing 50 changed files with 6,542 additions and 2,138 deletions.
4 changes: 2 additions & 2 deletions .jscsrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"preset": "wordpress",
"requireCamelCaseOrUpperCaseIdentifiers": null,
"excludeFiles": [
"**/vendor/**",
"**/*.min.js",
"**/node_modules/**"
"**/node_modules/**",
"**/vendor/**"
]
}
1 change: 0 additions & 1 deletion .jshintrc

This file was deleted.

26 changes: 26 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"boss": true,
"curly": true,
"eqeqeq": true,
"eqnull": true,
"es3": true,
"expr": true,
"immed": true,
"noarg": true,
"nonbsp": true,
"onevar": true,
"quotmark": "single",
"trailing": true,
"undef": true,
"unused": true,

"browser": true,

"globals": {
"_": false,
"Backbone": false,
"jQuery": false,
"JSON": false,
"wp": false
}
}
23 changes: 17 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,31 @@
sudo: false
dist: precise

notifications:
email:
on_success: never
on_failure: change

cache:
directories:
- node_modules
- vendor
- $HOME/phpunit-bin

language:
- php

language: php

php:
- 5.4
- 5.5
- 5.6
- 7.0
- 7.2

env:
- WP_VERSION=latest WP_MULTISITE=0
- WP_VERSION=latest WP_MULTISITE=1

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

script:
Expand Down
33 changes: 29 additions & 4 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,11 @@ module.exports = function( grunt ) {
'!readme.md',
'!sass/**',
'!tests/**',
'!vendor/**'
'!bin/**',
'!vendor/**',
'!package-lock.json',
'!phpcs.xml.dist',
'!composer.lock'
],
dest: 'dist/<%= pkg.name %>',
expand: true,
Expand Down Expand Up @@ -216,7 +220,7 @@ module.exports = function( grunt ) {

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

Expand All @@ -227,14 +231,23 @@ module.exports = function( grunt ) {
stderr: true
},
readme: {
command: 'cd ./dev-lib && ./generate-markdown-readme' // Genrate the readme.md
command: 'cd ./dev-lib && ./generate-markdown-readme' // Generate the readme.md
},
phpunit: {
command: 'vagrant ssh -c "cd <%= vvv.plugin %> && phpunit"'
},
phpunit_c: {
command: 'vagrant ssh -c "cd <%= vvv.plugin %> && phpunit --coverage-html <%= vvv.coverage %>"'
}
},
phpcs: {
command: 'vagrant ssh -c "cd <%= vvv.plugin %> && phpcs"'
},
phpcbf: {
command: 'vagrant ssh -c "cd <%= vvv.plugin %> && phpcbf"'
},
precommit: {
command: 'vagrant ssh -c "cd <%= vvv.plugin %> && DEV_LIB_SKIP="xmllint" ./dev-lib/pre-commit"'
}
}

});
Expand Down Expand Up @@ -278,6 +291,18 @@ module.exports = function( grunt ) {
'shell:phpunit_c'
] );

grunt.registerTask( 'phpcs', [
'shell:phpcs'
] );

grunt.registerTask( 'phpcbf', [
'shell:phpcbf'
] );

grunt.registerTask( 'precommit', [
'shell:precommit'
] );

grunt.registerTask( 'dev', [
'default',
'makepot',
Expand Down
26 changes: 20 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
{
"require": {
"php": ">=5.2.7"
},
"require-dev": {
"satooshi/php-coveralls": "dev-master"
}
"name": "envato/wp-envato-market",
"description": "WordPress Theme & Plugin management for the Envato Market.",
"type": "wordpress-plugin",
"dist": {
"url": "[email protected]:envato/wp-envato-market.git",
"type": "git"
},
"license": "GPL",
"authors": [
{
"name": "Envato",
"homepage": "https://envato.com"
}
],
"require": {
"php": ">=5.4.0"
},
"require-dev": {
"satooshi/php-coveralls": "^1.0"
}
}
61 changes: 43 additions & 18 deletions contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ We're really excited that you are interested in contributing to the Envato Marke

## Issue Reporting Guidelines

- 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).
- Try to search for your issue, it may have already been answered or even fixed in the `wip` (Work in Progress) branch.
- The issue list of this repo is **exclusively** for bug reports and feature requests.
- Try to search for your issue, it may have already been answered or even fixed in the `develop` branch.
- 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.
- 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.
- 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.

## Pull Request Guidelines

- Checkout a topic branch from `wip` and merge back against `wip`.
- Checkout a topic branch from `develop` and merge back against `develop`.
- 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.
- **DO NOT** check-in the `dist` directory in your commits.
- Follow the [WordPress Coding Standards](https://make.wordpress.org/core/handbook/coding-standards/).
Expand All @@ -26,25 +26,50 @@ We're really excited that you are interested in contributing to the Envato Marke

## Development Setup

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`.
#### Install VaryingVagrantVagrants

To clone the WordPress Core
- Install Vagrant/VirtualBox/Plugins by following [these instructions](https://varyingvagrantvagrants.org/docs/en-US/installation/software-requirements/) then:
- `git clone -b master git://github.com/Varying-Vagrant-Vagrants/VVV.git ~/vagrant-local/`
- `cd ~/vagrant-local/`
- `vagrant up` (can take 30-60mins first time)
- Test you can access `http://src.wordpress-develop.test/` from your browser.
- 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.

``` bash
$ git clone git://develop.git.wordpress.org/trunk/
```
#### Setup a new WordPress site for local development.

To clone this repository
``` bash
$ git clone --recursive [email protected]:envato/wp-envato-market.git envato-market
```
- `cd ~/vagrant-local/`
- `cp vvv-config.yml vvv-custom.yml`
- edit `vvv-custom.yml` and add a new entry under `sites:` like this:
```
envato-market:
repo: https://github.com/dtbaker/vvv.envato-market.test.git
hosts:
- vvv.envato-market.test
```
- `vagrant reload --provision`
- Confirm you can access the new site here: `http://vvv.envato-market.test/`
- Confirm you can login here: `http://vvv.envato-market.test/wp-admin/` (default login is dev/dev)
- Confirm the WordPress plugin is activated.

To install packages
#### Confirm grunt works:

``` bash
# npm install -g grunt-cli
$ npm install
```
- `cd ~/vagrant-local/www/envato-market/docroot/wp-content/plugins/envato-market/`
- `grunt`
- Note: If you receive any 'node rebuild' error, try running `npm rebuild`

#### Confirm tests run via VVV

- `cd ~/vagrant-local/www/envato-market/docroot/wp-content/plugins/envato-market/`
- `grunt phpunit`

#### Make changes:

- Make changes to the github repository at `~/vagrant-local/www/envato-market/docroot/wp-content/plugins/envato-market/`
- Test changes via `http://vvv.envato-market.test`
- Commit changes to a new branch and make a pull request against the `develop` branch.


## Grunt tasks:

To lint:

Expand Down Expand Up @@ -78,7 +103,7 @@ $ grunt makepot

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

### PHPUnit Testing
## PHPUnit Testing

Run tests:

Expand Down
2 changes: 1 addition & 1 deletion css/envato-market-rtl.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion css/envato-market.css

Large diffs are not rendered by default.

Loading

0 comments on commit 563bd94

Please sign in to comment.