Coder Social home page Coder Social logo

themejuice / tj Goto Github PK

View Code? Open in Web Editor NEW
84.0 5.0 9.0 19.99 MB

Create local WordPress dev sites, manage existing sites, and deploy them, all from the command line.

Home Page: http://cli.themejuice.it/

License: GNU General Public License v2.0

Ruby 100.00%
wordpress-development vagrant capistrano php wordpress wordpress-deployment cli

tj's Issues

Vagrant installation/setup steps

I am not very familiar with using Vagrant do you actually need to add a default vm to it first before running theme-juice?

I keep getting the following error:

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'base' could not be found. Attempting to find and install...
default: Box Provider: virtualbox
default: Box Version: >= 0
==> default: Box file was not detected as metadata. Adding it directly...
==> default: Adding box 'base' (v0) for provider: virtualbox
default: Downloading: base
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.

Couldn't open file /Users/username/base

I tried to resolve by:

  1. cd to vagrant install directory and run: vagrant init hashicorp/precise32
  2. run: vagrant up
  3. then setup/create theme-juice project

Even though this is done do I still need to provision? https://docs.vagrantup.com/v2/getting-started/provisioning.html

Vagrant seems setup up but as far as I can see does not see the Customfile as the project is not synced nor is the network up?

Also theme-juice-cli seemed to create everything fine with no error I have the complete log if you want to see it?

I am very interested in getting this all worked out and having the steps very clear as I am developing a new workflow for our team members!

What am I missing here?

Update site name Regexp to print invalid chars

Right now, the error message isn't helpful. When an invalid character is given, let's pass it into the error message. ๐Ÿ‘ The 'only ASCII chars` line is also ambiguous., since we're really only allowing letters, numbers and dashes, which should be stated there instead of 'only ASCII'.

Rename config file

Rename tj-config.yml to just tj.yml, with the option to make it a hidden file, too. No other config files use the word 'config' in the filename, so we should probably ditch it for consistency.

Keep state with .tj file

Not sure if this is even needed, but would make setting up a previous projects development environment simpler. But then again, it only takes a few seconds to input these settings on a tj setup.

site_name: site
dev_url: site.dev
db_host: database host
db_name: database name
db_user: database user
db_pass: database pass

Create local site tj-config file for theme install instructions

Maybe something like a YAML file. This would be used for starter theme developers to execute scripts that are relative to that theme. Example, if somebody wanted to use Grunt as a watcher over Guard.

watch: grunt
server: cap
vendor: composer
install:
    - composer install
    - gulp dist

Default Slack settings do not get loaded

Default settings for Slack via it's load:defaults task do not get loaded. Including them inside of the invoke process overwrites previous config settings. I imagine this is an issue with any plugin that uses the load:defaults task, since we're never explicitly invoking it like Capistrano normally would.

Drop Windows support

Currently not worth it to maintain support for WIndows when simple things like shell menus and unicode fonts cause the whole app to fail. ๐Ÿ‘Ž maybe in the future.

Create a GUI dashboard

Not sure if we can run commands from it, but it would be awesome to be able to use the dashboard as a GUI. As long as tj is installed on the VM, I don't see why this wouldn't be possible. Running the commands inside of the VM would also kill off any issues with Windows and Ruby versions.

Use config file to house all theme-specific settings

So, as it is right now, setting up a deployment is rather confusing, since there's a lot of options that need to be changed, and a lot more options that don't need to be changed. Using ERB (or similar) to write into the config/ dir via a new tj config command would be great.

Example, running tj config deploy would allow you to add your deployment configuration (server info, stage, slack tokens, app name, git repo, etc.), all while never actually having to edit the files yourself. The only issue is that deployment is starter theme dependent, so creating a deployment script that could vary is the tough part. The questions could be pulled directly from the ERB files, but that might get messy.

Food for thought.

Add option to use vagrant-hostsupdater instead of landrush

Would just be a simple conditional depending on which one is installed (favoring Landrush if both).

if defined? VagrantPlugins::Landrush
  config.landrush.host '#{@project.url}', '#{@env.vm_ip}'
elsif defined? VagrantPlugins::HostsUpdater
  config.hostsupdater.aliases << '#{@project.url}'
end

Add UTF-8 encoding

Need to use literal Unicode character source code, such as โ†’ as \u2198. Windows seriously doesn't like these things... so at least adding that and the encoding line below allows it to be installed.

#! ... shebang
# encoding: UTF-8

Add flag to force path to VVV installation

Thor has class_option that we could take advantage of. This would be for both Windows users (who can't utilize ~/), and users who install VVV in anything other than ~/vagrant.

Capture ctrl+c interrupt

# Hit ctrl+c to exit
Signal.trap('INT') do
  warn '  cancelled by user (INT)'
  exit 1
end

# Or...
trap "SIGINT" do
  puts "Exiting"
  exit 130
end

Add update command

To update all Vagrant plugins, and VVV itself (git pull). This would of course be after doing a gem update theme-juice, to get the newest stuff. This could also update tj within VVV (if we go that route).

fatal: destination path '.' already exists and is not an empty directory.

If you try and install to an existing empty directory by typing full path:

โ€ข Where do you want to setup the project? : (/Users//) /Users//Sites/
theme-juice will fail:
โ€ฆ Cloning theme
fatal: destination path '.' already exists and is not an empty directory.

I think it should at least be more clear to actually cd ~// then run theme-juice and only specify the folder name to create if it exists then maybe ask what to do eg: run anway?

This had me stumped at first.

Installing new gemspec

Below is the error received when building latest gemspec file:

$ gem build theme-juice-cli.gemspec 
Invalid gemspec in [theme-juice-cli.gemspec]: cannot load such file -- highline/import
ERROR:  Error loading gemspec. Aborting.

More info:

$ gem build theme-juice-cli.gemspec --debug
NOTE:  Debugging mode prints all exceptions even when rescued
Exception `LoadError' at /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:54 - cannot load such file -- thor
Exception `LoadError' at /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:54 - cannot load such file -- highline/import
Exception `LoadError' at /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:133 - cannot load such file -- highline/import
Exception `LoadError' at /Library/Ruby/Site/2.0.0/rubygems/specification.rb:1045 - cannot load such file -- highline/import
Invalid gemspec in [theme-juice-cli.gemspec]: cannot load such file -- highline/import
ERROR:  Error loading gemspec. Aborting.

Have you received this error?

Allow custom commands to be defined in the Juicefile

The config command definitions could be simplified and be modified in such a way that would allow custom commands to be defined within the Juicefile. This could be used to manage sites other than WordPress using their specific CLI tools e.g. Mage, Ember, etc.

# ...

desc "install", "Run theme installation"
def install(*args)
  @config.command :install, args
end

desc "watch [ARGS]", "Manage development build tools"
def watch(*args)
  @config.command :watch, args
end

desc "assets [ARGS]", "Manage front-end dependencies"
def assets(*args)
  @config.command :assets, args
end

desc "vendor [ARGS]", "Manage back-end dependencies"
def vendor(*args)
  @config.command :vendor, args
end

desc "dist [ARGS]", "Package project for distribution"
def dist(*args)
  @config.command :dist, args
end

desc "wp [ARGS]", "Manage WordPress installation"
def wp(*args)
  @config.command :wp, args
end

desc "backup [ARGS]", "Backup project"
def backup(*args)
  @config.command :backup, args
end

desc "test [ARGS]", "Manage and run project tests"
def test(*args)
  @config.command :test, args
end

# ...

If Thor allows, all of that could be simplified into a simple loop using the @config.config.commands hash, defining the config command methods at runtime.

Clean up spec output

Stupid ๐Ÿ‘Ž capturing $stdout but it's still getting through when running Git/Vagrant commands.

Fork VVV and create more customizable VM

I'd like to fork VVV and make adjustments that would ease development using tj, such as being able to select and modify PHP and mySQL versions. I'd also like to get rid of all of the default WordPress installations, as they're never used and they cause the provisioning to take way too long.

I've already forked the VM and have begun using the fork, so I'll create a develop branch and start work when time allows. I'd also like to create a unique GUI dashboard to create sites, as mentioned in #25.

  • Streamlined Linux box
  • Remove default WP installs from VVV
  • WP-CLI, Composer, PHP, MySQL, Apache
  • Ability to change dependency versions e.g. PHP, MySQL, etc. (https://github.com/phpbrew/phpbrew)
  • Useful VM dashboard where you can manage (and create?) projects (creating desktop app)

If possible, this should be done in a backwards compatible way; where users can git pull the up to date VM without breaking existing development projects. I'm marking this as a breaking change just in case.

Keep state and global settings within a system-wide .tj-config file

All of the current issues on Windows are actually a result of using the ~/ path. If global state was kept in a .tj-config file, we could have VVV installed into custom locations, so using the home path wouldn't be necessary, since it's assumed VVV is always and will always be installed into ~/vagrant.

Don't require Ronn for Travis tests

One of it's dependencies require Ruby ~> 2.0. Would probably be a good idea to only require test-related gems for Travis to avoid stuff like this in the future.

Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Using bundler 1.7.6
Installing docile 1.1.5
Installing rake 10.4.2
Installing simplecov-html 0.10.0
Installing diff-lcs 1.2.5
Installing fakefs 0.6.7
Installing i18n 0.7.0
Installing json 1.8.2
Gem::InstallError: mustache requires Ruby version ~> 2.0.
Installing hpricot 0.8.6
An error occurred while installing mustache (1.0.1), and Bundler cannot
continue.
Make sure that `gem install mustache -v '1.0.1'` succeeds before bundling.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.