diff --git a/.gitignore b/.gitignore index 4d0235a..3aaec90 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ /docs/* /spec/ /*.gem +/guide/ diff --git a/.ruby-version b/.ruby-version index aedc15b..ec1cf33 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.5.3 +2.6.3 diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ff1f0c..f4dff50 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,3 +13,4 @@ - Vue on Rails application template using `rails new app -m https://vueonrails.com/vue -d postgresql` - Support Babel 7 - Support webpack 4 & Webpacker 4 +- Support pre-processor like pug diff --git a/README.md b/README.md index f50f403..62c9619 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,24 @@ -# Welcome to Vue on Rails 💎 +![vue on rails](https://vueonrails.com/assets/img/vueonrails.png) -> Vue for your favorite Rails projects +> Vue for your favorite Rails products -The Vue on Rails gem makes it easy to build Vue components on your Rails application. +The Vue on Rails gem makes it easy to build Vue components on your Rails products. -It uses Rails 5.x, Vue 2.x, Webpacker 3.x, Ruby 2.x, Node 11.x, Yarn 1.12.x. +It uses Rails 5.x, Vue 2.x, Webpacker 4.x, Ruby 2.x, Node 11.x, Yarn 1.12.x. -- 💎 Compatible with Rails 6/5/4 and Webpacker -- 🌎 Internationalization for component parts - 🖖 Vue UI ready -- 🔨 Component generators and scaffolds -- 📦 Out of the box configuration -- ✂️ Specific-page Vue +- 🐶 Support pug - 🤡 Jest test ready +- ✂️ Specific-page Vue +- 👷🏻️ Asset pipeline helpers - 🎯 Simple state management +- 📦 Out of the box configuration +- 🔨 Component generators and scaffolds +- ❄️ Server Side Rendering using Hypernova - 🗃 Easily migrate to Vuex state management -- 👷🏻️ Asset pipeline helpers -- 🏎 Kickstart with our Vue on Rails application template at https://vueonrails.com/vue +- 🌎 Internationalization for component parts +- 💎 Compatible with Rails 6/5/4 and Webpacker +- 🏎 Kickstart with our application template at https://vueonrails.com/vue It ships out-of-the-box configuration, component generators and other solutions to make life easy for both Vue and Rails. diff --git a/app/helpers/syntax_helper.rb b/app/helpers/syntax_helper.rb index 3fba8de..18ba7ff 100644 --- a/app/helpers/syntax_helper.rb +++ b/app/helpers/syntax_helper.rb @@ -25,4 +25,9 @@ def vue_component(identifier, variable=nil) }; nil end end + + #server side rendering via hypernova + def render_vue_component(id, data = {}) + render_react_component(id, data) + end end diff --git a/lib/generators/options/pug.rb b/lib/generators/options/pug.rb new file mode 100644 index 0000000..910a57b --- /dev/null +++ b/lib/generators/options/pug.rb @@ -0,0 +1,14 @@ +pugtemplate = <<-eos + +eos + +if options[:seperate] == true + gsub_file Rails.root.join("#{PARTS_PATH}/#{name}/#{name}.vue").to_s, + /