theme-juice 0.7.13 → 0.7.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +43 -14
- data/lib/theme-juice/cli.rb +14 -14
- data/lib/theme-juice/commands/create.rb +1 -1
- data/lib/theme-juice/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ed570de1bcd5ee6386340c1e7fbfcf78e3f925f
|
4
|
+
data.tar.gz: ea4347cfbae407def5d4e3e08dcfaf36e0b2df50
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9fdf9dcd399513e6fcab32b505831207c9f346bc90c74385706890e141b49e61ffd8ca3b8fa2004e52087a9debf4659183646e8300b6db5174e31de0fad5dd6c
|
7
|
+
data.tar.gz: 9659e9842b6f24ef06947590ac048a9eb2a731f928e0a4b01b7248f73ba6325acad8ad3a0e72056d8bee10b9587812d22c71df02d0b882fc64e012178879f084
|
data/README.md
CHANGED
@@ -5,13 +5,39 @@
|
|
5
5
|
[![Code Climate](https://img.shields.io/codeclimate/coverage/github/ezekg/theme-juice-cli.svg?style=flat-square)]()
|
6
6
|
[![GitHub license](https://img.shields.io/github/license/ezekg/theme-juice-cli.svg?style=flat-square)](https://github.com/ezekg/theme-juice-cli/blob/master/LICENSE)
|
7
7
|
|
8
|
-
What is it?
|
8
|
+
## What is it?
|
9
|
+
Theme Juice is a WordPress development command line utility that allows you to scaffold out entire Vagrant development environments in seconds (using [VVV](https://github.com/Varying-Vagrant-Vagrants/VVV) as the VM), manage dependencies and build tools, and even handle deployments.
|
10
|
+
|
11
|
+
### But Why?
|
12
|
+
This project sprung out of an annoyance for the current workflow associated with WordPress and development in general. Things like:
|
13
|
+
* Local development. It's insanely hard (and intimidating!) for non-ops/CS engineers.
|
14
|
+
* WAMP/LAMP sucks.
|
15
|
+
* The local env setup process is monotonous. It's the same thing _over and over again_, aside from a couple variables here and there.
|
16
|
+
* It seems as though every few months a new build tool comes out, so you end up with projects created within the range of just a year or 2 having _completely_ different build tools. Does this project use Grunt? Guard? Oh, I see, it's using Gulp! No thanks.
|
17
|
+
* Dependency management for WordPress is terrible.
|
18
|
+
* A decent Git workflow for WordPress is even more terrible. Bloated repositories, out of date plugins, out of date core. It's a nightmare.
|
19
|
+
* Given all of that, projects are hard to maintain, especially across multiple environments. It's hard to onboard new team members. It just sucks.
|
20
|
+
|
21
|
+
In order to remedy most of those, I created a little Rake script that automated things like scaffolding out a new development site and also aliasing a few of the build tools that I used. A couple months later, I extracted that out to a little gem so that it didn't have to sit inside of a `Rakefile` (mainly because it utilized the oh-so-efficient copy-and-paste update method).
|
22
|
+
|
23
|
+
After using it for a few more months, adding features here and there, I realized how much it had changed my workflow. I was spending less time fighting the tools I wanted to use, and more time on our projects doing what I love (coding!). It sped up our workflow and made coding more enjoyable. The project really started to evolve into a true command line utility from there.
|
24
|
+
|
25
|
+
Another month or so down the line, I wanted to move `tj` out of alpha and really give it the attention and structure it deserved. So I spent a few more months doing a complete rewrite, learning a ton along the way. I bought a few books like [Design Patterns in Ruby](http://designpatternsinruby.com/) and gradually built up my Ruby skills. One thing I really wanted to focus on was _convention over configuration_, because most people don't care about the details; they want a local development site _that just works_.
|
26
|
+
|
27
|
+
Fast forward to now, and `tj` has become a staple for our WordPress development. It really has changed the way we do things. Enjoy.
|
9
28
|
|
10
29
|
## Installation
|
11
30
|
* First, install [Vagrant](https://www.vagrantup.com/) and [VirtualBox](https://www.virtualbox.org/) for local development.
|
12
|
-
* Then, install
|
31
|
+
* Then, install these command line tools (most starter themes will use a combination of these):
|
32
|
+
* [Composer](https://getcomposer.org/)
|
33
|
+
* [NPM](https://www.npmjs.com/) ([Here's a good guide on properly installing NPM to not need `sudo`](http://www.johnpapa.net/how-to-use-npm-global-without-sudo-on-osx/))
|
34
|
+
* [Grunt-CLI](http://gruntjs.com/)
|
35
|
+
* [Gulp-CLI](http://gulpjs.com/)
|
36
|
+
* [Bower](http://bower.io/)
|
37
|
+
* [WP-CLI](http://wp-cli.org/)
|
38
|
+
* Make sure they're executable without `sudo`
|
13
39
|
* Finally, install with: `gem install theme-juice`
|
14
|
-
That
|
40
|
+
* That's it!
|
15
41
|
|
16
42
|
## Windows users
|
17
43
|
Since Windows doesn't support UTF-8 characters inside of the terminal, and is picky about colors, you'll have to run `tj` with a couple flags. What has worked for me on my Windows machine at home is to run all commands through [git-scm](http://git-scm.com/downloads) with the `--boring --no-landrush` flags.
|
@@ -28,12 +54,16 @@ In addition to that, `tj` uses the [OS gem](https://github.com/rdp/os) to sniff
|
|
28
54
|
## Config
|
29
55
|
Because everybody likes to use different tools, you can create a `Juicefile` or `tj.yaml` config (with an optional preceding `.`) that will house all of your theme-specific commands. This allows you to use a streamlined set of commands that will act as aliases to your per-project configuration, as well as starter-theme specific information, such as deployment configuration, etc. For right now, we'll just stick to the `commands` section.
|
30
56
|
|
31
|
-
If you're into [Grunt](https://github.com/gruntjs/grunt), then use it. Prefer [Guard](https://github.com/guard/guard)? Go right ahead. This is obviously relative to the starter theme you use, since you can't exactly use Grunt with a project that doesn't support it.
|
57
|
+
If you're into [Grunt](https://github.com/gruntjs/grunt), then use it. Prefer [Gulp](https://github.com/gulpjs/gulp)? What about [Guard](https://github.com/guard/guard)? Go right ahead. It's compeletely up to you and your team. This is obviously relative to the starter theme you use, since you can't exactly use Grunt with a project that doesn't support it.
|
58
|
+
|
59
|
+
Below is the config that comes baked into [our starter theme](https://github.com/ezekg/theme-juice-starter):
|
32
60
|
|
33
61
|
```yml
|
34
62
|
commands:
|
35
63
|
install:
|
36
64
|
- composer install
|
65
|
+
- npm install
|
66
|
+
- bower install
|
37
67
|
- grunt build
|
38
68
|
watch:
|
39
69
|
- grunt %args%
|
@@ -94,7 +124,7 @@ _Use `ENV` variables to set global flags. For example, by running `export TJ_VM_
|
|
94
124
|
### Creating a new development project:
|
95
125
|
Use this to create a new project. It will automagically set up your VM, including a local development site at `http://<url>.dev` with WordPress installed and a fresh WP database. It will sync up your local site installation with the Vagrant VM, so you can organize your projects however you want. This task will also install VVV into your `vm-path` directory if it has not already been installed.
|
96
126
|
```bash
|
97
|
-
tj create # Aliases: mk
|
127
|
+
tj create # Aliases: mk new
|
98
128
|
```
|
99
129
|
|
100
130
|
#### Option flags:
|
@@ -116,7 +146,7 @@ tj create # Aliases: mk make new add
|
|
116
146
|
### Setting up an existing project:
|
117
147
|
Use this to setup an existing local project within the development environment. You will go through the setup process to create the necessary files for the VM, including `vvv-hosts`, `vvv-nginx.conf`, DNS settings, and a fresh database (unless one already exists by the name chosen). This is essentially an alias for `create`, but with a few options being skipped.
|
118
148
|
```bash
|
119
|
-
tj setup # Aliases: up
|
149
|
+
tj setup # Aliases: up init
|
120
150
|
```
|
121
151
|
|
122
152
|
#### Option flags:
|
@@ -136,7 +166,7 @@ tj setup # Aliases: up prep init
|
|
136
166
|
### Deleting a project from the VM:
|
137
167
|
Use this to remove a project from your development environment. This will only remove files that were generated by `tj`. including the database setup, development url, and shared directories. _It will not touch your local folders that were synced to the VM._
|
138
168
|
```bash
|
139
|
-
tj delete # Aliases: rm remove trash
|
169
|
+
tj delete # Aliases: rm remove trash
|
140
170
|
```
|
141
171
|
|
142
172
|
#### Option flags:
|
@@ -148,9 +178,8 @@ tj delete # Aliases: rm remove trash teardown
|
|
148
178
|
| `[--vm-restart]` | Bool | Restart VM after deletion |
|
149
179
|
|
150
180
|
### Managing deployment and migration (coming soon):
|
151
|
-
Use this to easily manage your deployment and migration with [Capistrano](https://github.com/capistrano/capistrano) or whatever command is in your config. This is just a wrapper for your chosen command.
|
152
181
|
```bash
|
153
|
-
tj deploy # Aliases:
|
182
|
+
tj deploy # Aliases: server remote
|
154
183
|
```
|
155
184
|
|
156
185
|
### Listing all `tj` projects in the VM:
|
@@ -168,19 +197,19 @@ tj vm # Aliases: vagrant vvv
|
|
168
197
|
### Running installation for project:
|
169
198
|
Uses `install` command within your config.
|
170
199
|
```bash
|
171
|
-
tj install
|
200
|
+
tj install # Aliases: build
|
172
201
|
```
|
173
202
|
|
174
203
|
### Watching and compiling assets:
|
175
204
|
Use this to watch and compile assets with your preferred build tool, whether that be [Grunt](https://github.com/gruntjs/grunt), [Gulp](https://github.com/gulpjs/gulp), [Guard](https://github.com/guard/guard), or whatever. This is simply a wrapper for whatever command is in your config file.
|
176
205
|
```bash
|
177
|
-
tj watch # Aliases:
|
206
|
+
tj watch # Aliases: dev
|
178
207
|
```
|
179
208
|
|
180
209
|
### Managing vendor dependencies:
|
181
210
|
Use this to easily manage your dependencies with [Composer](https://github.com/composer/composer), or whatever command you set within your config.
|
182
211
|
```bash
|
183
|
-
tj vendor # Aliases:
|
212
|
+
tj vendor # Aliases: deps
|
184
213
|
```
|
185
214
|
|
186
215
|
### Locally executing WP-CLI inside your VM:
|
@@ -199,7 +228,7 @@ tj backup # Aliases: bk
|
|
199
228
|
### Distributing a package of your project:
|
200
229
|
Uses `dist` command within your config.
|
201
230
|
```bash
|
202
|
-
tj dist # Aliases:
|
231
|
+
tj dist # Aliases: zip package pkg
|
203
232
|
```
|
204
233
|
|
205
234
|
### Running your test suite:
|
@@ -209,7 +238,7 @@ tj test # Aliases: tests spec specs
|
|
209
238
|
```
|
210
239
|
|
211
240
|
## Can I add my starter theme, ________?
|
212
|
-
Yes! Just update the `THEMES` constant inside [commands/create.rb](https://github.com/ezekg/theme-juice-cli/blob/master/lib/theme-juice/commands/create.rb#L7-L11) and make a pull request. I'll verify that
|
241
|
+
Yes! Just update the `THEMES` constant inside [commands/create.rb](https://github.com/ezekg/theme-juice-cli/blob/master/lib/theme-juice/commands/create.rb#L7-L11) and make a pull request. I'll verify that the theme includes a `Juicefile` (not required, but preferred to automate build steps), and that everything looks solid. Until then (or if your theme is private), just run `tj create --theme https://your.repo/link/goes.here` to clone your theme.
|
213
242
|
|
214
243
|
## Contributing
|
215
244
|
1. First, create a _well documented_ [issue](https://github.com/ezekg/theme-juice-cli/issues) for your proposed feature/bug fix.
|
data/lib/theme-juice/cli.rb
CHANGED
@@ -36,20 +36,20 @@ module ThemeJuice
|
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
|
-
map %w[--version -v]
|
40
|
-
map %w[mk
|
41
|
-
map %w[up
|
42
|
-
map %w[rm remove trash
|
43
|
-
map %w[ls projects apps sites]
|
44
|
-
map %w[build]
|
45
|
-
map %w[
|
46
|
-
map %w[
|
47
|
-
map %w[
|
48
|
-
map %w[wordpress]
|
49
|
-
map %w[bk]
|
50
|
-
map %w[tests spec specs]
|
51
|
-
map %w[
|
52
|
-
map %w[vagrant vvv]
|
39
|
+
map %w[--version -v] => :version
|
40
|
+
map %w[mk new] => :create
|
41
|
+
map %w[up init] => :setup
|
42
|
+
map %w[rm remove trash] => :delete
|
43
|
+
map %w[ls projects apps sites] => :list
|
44
|
+
map %w[build] => :install
|
45
|
+
map %w[dev] => :watch
|
46
|
+
map %w[deps] => :vendor
|
47
|
+
map %w[zip package pkg] => :dist
|
48
|
+
map %w[wordpress] => :wp
|
49
|
+
map %w[bk] => :backup
|
50
|
+
map %w[tests spec specs] => :test
|
51
|
+
map %w[server remote] => :deploy
|
52
|
+
map %w[vagrant vvv] => :vm
|
53
53
|
|
54
54
|
class_option :vm_path, :type => :string, :default => nil, :desc => "Force path to VM"
|
55
55
|
class_option :vm_ip, :type => :string, :default => nil, :desc => "Force IP address for VM"
|
@@ -132,7 +132,7 @@ module ThemeJuice
|
|
132
132
|
choice = @io.choose "Which starter theme would you like to use?", :blue, THEMES.keys
|
133
133
|
|
134
134
|
case choice
|
135
|
-
when "theme-juice/
|
135
|
+
when "theme-juice/trellis"
|
136
136
|
@io.success "Awesome choice!"
|
137
137
|
when "other"
|
138
138
|
THEMES[choice] = @io.prompt "What is the repository URL for the starter theme that you would like to clone?"
|
data/lib/theme-juice/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: theme-juice
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ezekiel Gabrielse
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -161,7 +161,7 @@ files:
|
|
161
161
|
- lib/theme-juice/version.rb
|
162
162
|
homepage: https://themejuice.it
|
163
163
|
licenses:
|
164
|
-
-
|
164
|
+
- MIT
|
165
165
|
metadata: {}
|
166
166
|
post_install_message:
|
167
167
|
rdoc_options: []
|