vuejs 1.0.38 → 1.0.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/README.md +66 -40
- data/app/controllers/vue_controller.rb +2 -0
- data/app/helpers/syntax_helper.rb +0 -4
- data/app/views/vue/index.html.erb +5 -0
- data/config/routes.rb +5 -0
- data/lib/generators/generator_templates/index.js +6 -3
- data/lib/generators/generator_templates/pack.js +4 -5
- data/lib/generators/generator_templates/single.vue +3 -0
- data/lib/generators/vue/vue_generator.rb +24 -6
- data/lib/vuejs.rb +1 -24
- data/lib/vuejs/version.rb +1 -1
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 29c3b8f0bee58fa7d32cd10676329f9647eb58d0d859a7a20632a156034b7f3f
|
4
|
+
data.tar.gz: 3b86ca6b277de4d9e1a05fc132260f9eb193e026e352ed1471e8478f2f356b39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0646e8e8f47a1fe33dfb4061c704752e7d04488233a1898c2daa5721b68c63c3aad6332b44c43686e1e37a1c0e5ef4e823cd54d69fed29b78cda300e207eced
|
7
|
+
data.tar.gz: c08fdd45a5efa313f03506136dab64916c2674ae9b03ec94336340ef281bc7fb53e072b13ab80525ec65f3d9365cf6564a50dfff97ca5fa86489c683e449f180
|
data/README.md
CHANGED
@@ -1,24 +1,6 @@
|
|
1
1
|
# Vuejs Gem
|
2
2
|
|
3
|
-
>
|
4
|
-
|
5
|
-
TODO: update this to support webpacker. Or make plans to create [webpacker-vue](https://github.com/ytbryan/webpacker-vue)
|
6
|
-
|
7
|
-
The rubygem `vuejs` ships with the following goodies:
|
8
|
-
|
9
|
-
- `vue` (v2.1.10)
|
10
|
-
- `vuex` (v2.1.1)
|
11
|
-
- `vue-router` (v2.1.3)
|
12
|
-
- `vue-validator2` (v2.1.7) + `vue-validator3` (v3.0.0-alpha.2)
|
13
|
-
- `axios` (v0.15.3)
|
14
|
-
|
15
|
-
It also ships with the following legacy goodies
|
16
|
-
|
17
|
-
- `vue` (v1.0.28)
|
18
|
-
- `vuex` (v1.0.1)
|
19
|
-
- `vue-router` (v0.7.13)
|
20
|
-
- `vue-resource` (v1.2.0)
|
21
|
-
- `vue-validator` (v1.4.4)
|
3
|
+
> Vue for your favourite Ruby on Rails projects
|
22
4
|
|
23
5
|
# Requirement
|
24
6
|
|
@@ -27,7 +9,7 @@ It also ships with the following legacy goodies
|
|
27
9
|
Add this line to your application's Gemfile:
|
28
10
|
|
29
11
|
```ruby
|
30
|
-
|
12
|
+
gem 'vuejs'
|
31
13
|
```
|
32
14
|
|
33
15
|
And then execute:
|
@@ -38,15 +20,72 @@ Or install it yourself as:
|
|
38
20
|
|
39
21
|
$ gem install vuejs
|
40
22
|
|
23
|
+
# Webpacker
|
24
|
+
|
25
|
+
## Vue component generator
|
26
|
+
|
27
|
+
```
|
28
|
+
rails generate vue <NAME>
|
29
|
+
```
|
30
|
+
|
31
|
+
Note: `vuejs` gem creates vue components with seperation of concern by default.
|
32
|
+
|
33
|
+
To generate a single-file component, please use `--single` option. eg. `rails g vue component_name --single`
|
41
34
|
|
42
|
-
## Vue
|
35
|
+
## Vue component destroyer
|
43
36
|
|
44
|
-
|
37
|
+
```
|
38
|
+
rails destroy vue <NAME>
|
39
|
+
```
|
40
|
+
|
41
|
+
## Vue viewer
|
42
|
+
|
43
|
+
Vue viewer allows you to browse your vue component easily. Simply type in http://localhost:3000/vue/<name>
|
44
|
+
|
45
|
+
At routes.rb
|
46
|
+
|
47
|
+
```
|
48
|
+
mount Vuejs::engine, to: 'vue'
|
49
|
+
```
|
50
|
+
|
51
|
+
## Vuex support - coming soon
|
52
|
+
|
53
|
+
```
|
54
|
+
rails g vue <NAME> --vuex
|
55
|
+
```
|
45
56
|
|
57
|
+
This will add vuex using yarn. And generate a vue component with vuex support
|
58
|
+
|
59
|
+
## Add webpacker helpers - coming soon
|
60
|
+
|
61
|
+
```
|
62
|
+
rails g vue <NAME> --helpers
|
63
|
+
```
|
64
|
+
|
65
|
+
---
|
66
|
+
|
67
|
+
# Asset Pipeline
|
68
|
+
|
69
|
+
The ruby gem `vuejs` ships with the following goodies for assets pipeline:
|
70
|
+
|
71
|
+
* `vue` (v2.1.10)
|
72
|
+
* `vuex` (v2.1.1)
|
73
|
+
* `vue-router` (v2.1.3)
|
74
|
+
* `vue-validator2` (v2.1.7) + `vue-validator3` (v3.0.0-alpha.2)
|
75
|
+
* `axios` (v0.15.3)
|
76
|
+
|
77
|
+
It also ships with the following legacy goodies
|
78
|
+
|
79
|
+
* `vue` (v1.0.28)
|
80
|
+
* `vuex` (v1.0.1)
|
81
|
+
* `vue-router` (v0.7.13)
|
82
|
+
* `vue-resource` (v1.2.0)
|
83
|
+
* `vue-validator` (v1.4.4)
|
46
84
|
|
47
85
|
## Usage
|
48
86
|
|
49
87
|
For 2.x Vue & vue-router or Vue-validator
|
88
|
+
|
50
89
|
```
|
51
90
|
//= require vue2
|
52
91
|
//= require vue-router2
|
@@ -55,23 +94,22 @@ For 2.x Vue & vue-router or Vue-validator
|
|
55
94
|
//= require axios
|
56
95
|
```
|
57
96
|
|
58
|
-
# Some Solution
|
97
|
+
# Some Solution for assets pipeline
|
59
98
|
|
60
99
|
### Sprockets::FileNotFound: couldn't find file 'vue-validator'
|
61
100
|
|
62
101
|
```
|
63
102
|
Sprockets::FileNotFound: couldn't find file 'vue-validator' with type 'application/javascript'
|
64
103
|
```
|
104
|
+
|
65
105
|
vue-validator has been changed to vue-validator2
|
66
106
|
and vue-validator3. Use `//= require vue-validator2` or `//= require vue-validator3` instead.
|
67
107
|
|
68
|
-
|
69
108
|
### Sprockets::FileNotFound: couldn't find file 'vuex'
|
70
109
|
|
71
110
|
vuex has been updated to vuex2. Therefore use `//= require vuex2` to resolve the error `Sprockets::FileNotFound: couldn't find file 'vuex'`.
|
72
111
|
|
73
|
-
|
74
|
-
### You are running Vue in development mode.
|
112
|
+
### You are running Vue in development mode.
|
75
113
|
|
76
114
|
```
|
77
115
|
You are running Vue in development mode.
|
@@ -81,7 +119,6 @@ vuex has been updated to vuex2. Therefore use `//= require vuex2` to resolve the
|
|
81
119
|
|
82
120
|
Try to use `//= require vue2.min` to remove the warning statement from console.
|
83
121
|
|
84
|
-
|
85
122
|
For 1.x
|
86
123
|
|
87
124
|
```
|
@@ -96,25 +133,14 @@ For 1.x
|
|
96
133
|
//= require_tree .
|
97
134
|
```
|
98
135
|
|
99
|
-
##
|
100
|
-
|
101
|
-
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
102
|
-
|
103
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
104
|
-
|
105
|
-
## Contributing
|
136
|
+
## Contributing and License
|
106
137
|
|
107
138
|
Bug reports and pull requests are welcome on GitHub at https://github.com/ytbryan/vuejs. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
108
|
-
|
109
|
-
|
110
|
-
## License
|
111
|
-
|
112
139
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
113
140
|
|
114
|
-
|
115
141
|
## Book
|
116
142
|
|
117
|
-
Richard LaFranchi and I are writing a book on Vue on rails. If you are interested to be one of the early reviewers of our drafts, please email me.
|
143
|
+
Richard LaFranchi and I are writing a book on Vue on rails. If you are interested to be one of the early reviewers of our drafts, please email me.
|
118
144
|
|
119
145
|
## Contact
|
120
146
|
|
@@ -7,10 +7,6 @@ module SyntaxHelper
|
|
7
7
|
"<p>#{Vuejs::VERSION}</p>".html_safe
|
8
8
|
end
|
9
9
|
|
10
|
-
# def vue_version
|
11
|
-
# "<p>#{Vue.version}</p>".html_safe
|
12
|
-
# end
|
13
|
-
|
14
10
|
def vue_component(*name, **options)
|
15
11
|
javascript_pack_tag(*name, **options) + ( stylesheet_pack_tag(*name, **options) if options[:stylesheet] != false )
|
16
12
|
end
|
data/config/routes.rb
ADDED
@@ -1,8 +1,8 @@
|
|
1
1
|
import Vue from 'vue'
|
2
|
-
<% if options[:single]
|
3
|
-
import App from '../parts/<%= name %>/<%= name %>.vue'
|
4
|
-
<% else %>
|
2
|
+
<% if options[:single] %>
|
5
3
|
import App from '../parts/<%= name %>.vue'
|
4
|
+
<% else %>
|
5
|
+
import App from '../parts/<%= name %>/<%= name %>.vue'
|
6
6
|
<% end %>
|
7
7
|
|
8
8
|
document.addEventListener('DOMContentLoaded', () => {
|
@@ -10,6 +10,5 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
10
10
|
const app = new Vue({
|
11
11
|
render: h => h(App)
|
12
12
|
}).$mount('hello')
|
13
|
-
|
14
13
|
//console.log(app)
|
15
|
-
})
|
14
|
+
})
|
@@ -1,20 +1,38 @@
|
|
1
1
|
class VueGenerator < Rails::Generators::NamedBase
|
2
|
-
PACKS_PATH = "app/javascript/packs"
|
3
|
-
PARTS_PATH = "app/javascript/parts"
|
4
|
-
|
5
2
|
source_root File.expand_path('../../generator_templates', __FILE__)
|
3
|
+
|
6
4
|
argument :name, :type => :string, :default => :index
|
7
5
|
class_option :single, type: :boolean, default: false
|
6
|
+
class_option :vuex, type: :boolean, default: false
|
7
|
+
# class_option :helpers, type: :boolean, default: false
|
8
|
+
|
9
|
+
PACKS_PATH = "app/javascript/packs"
|
10
|
+
PARTS_PATH = "app/javascript/parts"
|
8
11
|
|
9
12
|
def vue
|
10
|
-
if options[:single]
|
11
|
-
|
13
|
+
if options[:single]
|
14
|
+
create_single_file_component_using(name)
|
12
15
|
else
|
13
|
-
|
16
|
+
create_component_with_seperate_concern_using(name)
|
14
17
|
end
|
18
|
+
|
19
|
+
# options[:vuex] ? add_vuex_to_component(name) : nil
|
20
|
+
# options[:helpers] ? add_helpers_to_component(name) : nil
|
15
21
|
end
|
16
22
|
|
17
23
|
private
|
24
|
+
def add_helpers_to_component name
|
25
|
+
puts "adding helpers"
|
26
|
+
end
|
27
|
+
|
28
|
+
def add_vuex_to_component name
|
29
|
+
puts "adding vuex"
|
30
|
+
# yarn add vuex
|
31
|
+
# import vuex from 'vuex'
|
32
|
+
# Vue.use(vuex)
|
33
|
+
# Generate a vuex.html.erb
|
34
|
+
end
|
35
|
+
|
18
36
|
def create_component_with_seperate_concern_using name
|
19
37
|
template "pack.js", "#{PACKS_PATH}/#{name}.js"
|
20
38
|
template "index.vue", "#{PARTS_PATH}/#{name}/#{name}.vue"
|
data/lib/vuejs.rb
CHANGED
@@ -3,34 +3,11 @@ require "thor"
|
|
3
3
|
|
4
4
|
module Vuejs
|
5
5
|
class Engine < ::Rails::Engine
|
6
|
+
engine_name 'vuejs'
|
6
7
|
end
|
7
8
|
|
8
9
|
class Base < Thor
|
9
10
|
check_unknown_options!
|
10
11
|
package_name 'vuejs'
|
11
|
-
|
12
|
-
# desc :info, ""
|
13
|
-
# def info
|
14
|
-
# puts "version: "
|
15
|
-
# end
|
16
|
-
|
17
|
-
# def move
|
18
|
-
# cp node_modules/vue/dist/vue.min.js app/assets/javascripts/
|
19
|
-
# end
|
20
12
|
end
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
# class Base < Thor
|
27
|
-
# check_unknown_options!
|
28
|
-
# package_name 'vuejs'
|
29
|
-
# default_task :info
|
30
|
-
#
|
31
|
-
# desc :info
|
32
|
-
# def info
|
33
|
-
# puts "version: "
|
34
|
-
# end
|
35
|
-
# end
|
36
13
|
end
|
data/lib/vuejs/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vuejs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.39
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bryan Lim
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-04-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -48,7 +48,10 @@ extra_rdoc_files: []
|
|
48
48
|
files:
|
49
49
|
- LICENSE
|
50
50
|
- README.md
|
51
|
+
- app/controllers/vue_controller.rb
|
51
52
|
- app/helpers/syntax_helper.rb
|
53
|
+
- app/views/vue/index.html.erb
|
54
|
+
- config/routes.rb
|
52
55
|
- lib/generators/generator_templates/index.css
|
53
56
|
- lib/generators/generator_templates/index.js
|
54
57
|
- lib/generators/generator_templates/index.vue
|
@@ -95,7 +98,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
95
98
|
version: '0'
|
96
99
|
requirements: []
|
97
100
|
rubyforge_project:
|
98
|
-
rubygems_version: 2.6
|
101
|
+
rubygems_version: 2.7.6
|
99
102
|
signing_key:
|
100
103
|
specification_version: 4
|
101
104
|
summary: Latest Vue.js + vue-router + vue-resource + vue-validator + vuex for Rails
|