- Changing JS versions
- Local JS app development
- Local WordPress plugin development
- Automated deployments
This repo exists to help with local development for the Simplechart JS app and the WordPress Simplechart plugin.
The Simplechart Dev Mode plugin (plugins/simplechart-dev-mode
) is the important thing in this repo. When it's activated, you'll find this option in your user settings.
Note that the WordPress toolbar indicates which version of the JS source is active.
First get the local Node environment running:
$ git clone [email protected]:alleyinteractive/simplechart.git
$ cd simplechart
$ npm install
$ npm run watch
Then in your local WordPress site:
- Go to
/wp-admin/profile.php
- Select
localhost:8080
under Simplechart Dev Mode - Go to
/wp-admin/post-new.php?post_type=simplechart
- The chart editor app should open from
http://localhost:8080/static/app.js
The WordPress Simplechart plugin is set up as a Git submodule. So any changes you make in plugins/wordpress-simplechart
are tracked by [email protected]:alleyinteractive/wordpress-simplechart.git
; the simplechart-dev-site
repository only tracks a reference to the Git history of the submodule repo.
Here's how to make changes to the plugin and then update this repository:
# Start by updating the local submodule (installing first if needed)
$ git submodule update --init
$ cd plugins/wordpress-simplechart
$ git remote -v
# Should tell you [email protected]:alleyinteractive/wordpress-simplechart.git
# checkout branches, commit changes, pull request, etc
$ cd ..
$ git remote -v
# Should tell you [email protected]:alleyinteractive/simplechart-dev-site.git
$ git status
# On branch XXXXXXXX
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: wordpress-simplechart (new commits)
#
#no changes added to commit (use "git add" and/or "git commit -a")
$ git commit -am "udpate wordpress-simplechart plugin"
# push to github...
Note: You can do local JS app development and WordPress plugin development at the same time
The master
branch of this repo is automatically deployed from GitHub to http://dev-simplechart.alleydev.com/, except for:
plugins/wordpress-simplechart
(develop
branch of alleyinteractive/wordpress-simplechart)plugins/simplechart-dev-mode/js
(develop
branch of alleyinteractive/simplechart)