vue_cli-rails 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -0
- data/.rspec +0 -0
- data/.travis.yml +0 -0
- data/Gemfile +0 -0
- data/Gemfile.lock +0 -0
- data/LICENSE +0 -0
- data/README.md +0 -0
- data/Rakefile +0 -0
- data/lib/source/app/assets/vue/components/layouts/App.vue +0 -0
- data/lib/source/app/assets/vue/components/layouts/index.js +0 -0
- data/lib/source/app/assets/vue/components/views/Bar.vue +0 -0
- data/lib/source/app/assets/vue/components/views/Foo.vue +0 -0
- data/lib/source/app/assets/vue/views/bar.js +0 -0
- data/lib/source/app/assets/vue/views/foo.js +0 -0
- data/lib/source/app/controllers/vue_controller.rb +0 -0
- data/lib/source/app/views/layouts/vue.html.erb +0 -0
- data/lib/source/app/views/vue/bar.html.erb +0 -0
- data/lib/source/app/views/vue/foo.html.erb +0 -0
- data/lib/source/vue.config.js +0 -0
- data/lib/source/vue.rails.js +0 -0
- data/lib/source/vue.yml +0 -0
- data/lib/tasks/vue.rake +15 -1
- data/lib/views/layouts/vue.erb +0 -0
- data/lib/vue_cli/rails.rb +0 -0
- data/lib/vue_cli/rails/configuration.rb +0 -0
- data/lib/vue_cli/rails/dev_server_proxy.rb +0 -0
- data/lib/vue_cli/rails/engine.rb +0 -0
- data/lib/vue_cli/rails/helper.rb +1 -1
- data/lib/vue_cli/rails/node_env.rb +8 -4
- data/lib/vue_cli/rails/version.rb +1 -1
- data/vue_cli-rails.gemspec +0 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 229220b60eb603bb590ec48c196daf668f226d2e
|
4
|
+
data.tar.gz: efbf67738dd8b19dcc324333db7a7c874af4dfb7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89a63db2149ee2708663ba361ad5501f6109f30b78a3e5e0411a1e1ba1b41de406eb65eb6a51e1a6ec38bfc3cb79b08c419bfabcdd104aef0998362cb2f2b200
|
7
|
+
data.tar.gz: dbd023aee57fcadb5ec46433dba84dbe451dda18acb72f60c6279159fc8267c27afe0815d330a72e3347e205407a2a99420a4fbfa30261d03c27ed9f90d4f573
|
data/.gitignore
CHANGED
File without changes
|
data/.rspec
CHANGED
File without changes
|
data/.travis.yml
CHANGED
File without changes
|
data/Gemfile
CHANGED
File without changes
|
data/Gemfile.lock
CHANGED
File without changes
|
data/LICENSE
CHANGED
File without changes
|
data/README.md
CHANGED
File without changes
|
data/Rakefile
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/source/vue.config.js
CHANGED
File without changes
|
data/lib/source/vue.rails.js
CHANGED
File without changes
|
data/lib/source/vue.yml
CHANGED
File without changes
|
data/lib/tasks/vue.rake
CHANGED
@@ -36,6 +36,12 @@ namespace :vue do
|
|
36
36
|
end
|
37
37
|
puts "Using package manager: #{pm.package_manager}"
|
38
38
|
|
39
|
+
# install vue-cli
|
40
|
+
unless pm.vue?
|
41
|
+
puts "@vue/cli haven't been installed"
|
42
|
+
pm.global_add('@vue/cli')
|
43
|
+
end
|
44
|
+
|
39
45
|
src_dir = Pathname.new(__FILE__).dirname.join('..', 'source')
|
40
46
|
root = ::Rails.root
|
41
47
|
FileUtils.chdir root
|
@@ -62,7 +68,7 @@ namespace :vue do
|
|
62
68
|
if src.exist? && src.directory?
|
63
69
|
puts 'Detected `src` folder (should be generated by vue-cli)'
|
64
70
|
input = get_input.call(' Do you want to delete src folder?')
|
65
|
-
FileUtils.rm_rf
|
71
|
+
FileUtils.rm_rf src if input == 'y'
|
66
72
|
end
|
67
73
|
|
68
74
|
# 5. copy sample codes
|
@@ -109,6 +115,8 @@ namespace :vue do
|
|
109
115
|
end
|
110
116
|
end
|
111
117
|
throw(StandardError, '') if pkgs.empty?
|
118
|
+
|
119
|
+
pm = VueCli::Rails::Configuration.instance.node_env
|
112
120
|
pm.add "-D #{pkgs.join(' ')}"
|
113
121
|
end
|
114
122
|
|
@@ -117,4 +125,10 @@ namespace :vue do
|
|
117
125
|
config = VueCli::Rails::Configuration.new
|
118
126
|
puts config.to_json
|
119
127
|
end
|
128
|
+
|
129
|
+
desc 'Bundle assets for production'
|
130
|
+
task :compile => :environment do
|
131
|
+
pm = VueCli::Rails::Configuration.instance.node_env
|
132
|
+
pm.exec('vue-cli-service build', env: { 'RAILS_ENV' => 'production' })
|
133
|
+
end
|
120
134
|
end
|
data/lib/views/layouts/vue.erb
CHANGED
File without changes
|
data/lib/vue_cli/rails.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
data/lib/vue_cli/rails/engine.rb
CHANGED
File without changes
|
data/lib/vue_cli/rails/helper.rb
CHANGED
@@ -5,7 +5,7 @@ module VueCli
|
|
5
5
|
@config ||= VueCli::Rails::Configuration.instance
|
6
6
|
|
7
7
|
entry = (@config.manifest_data['entrypoints'] || {})[name]
|
8
|
-
return
|
8
|
+
return raise(VueCli::Rails::Error, "Not found vue entry point: #{name}") if entry.blank?
|
9
9
|
|
10
10
|
assets = []
|
11
11
|
(entry['css'] || []).each do |css|
|
@@ -28,7 +28,7 @@ module VueCli
|
|
28
28
|
@pm
|
29
29
|
end
|
30
30
|
|
31
|
-
def exec(command, args = nil, extra = nil)
|
31
|
+
def exec(command, args = nil, extra = nil, env: {})
|
32
32
|
cmd = COMMAND_LINE[command.to_sym] || {}
|
33
33
|
if @pm == :yarn && cmd[:yarn]
|
34
34
|
cmd = cmd[:yarn]
|
@@ -43,14 +43,18 @@ module VueCli
|
|
43
43
|
cmd = "#{cmd} #{args}" if args.present?
|
44
44
|
cmd = "#{cmd} #{@pm == :yarn ? '-- ' : ''}#{extra}" if extra.present?
|
45
45
|
puts "run: #{cmd}"
|
46
|
-
system(cmd)
|
46
|
+
system(env, cmd)
|
47
47
|
end
|
48
48
|
|
49
49
|
COMMAND_LINE = {
|
50
50
|
add: {
|
51
51
|
yarn: 'yarn add',
|
52
52
|
npm: 'npm i -S',
|
53
|
-
}
|
53
|
+
},
|
54
|
+
global_add: {
|
55
|
+
yarn: 'yarn global add',
|
56
|
+
npm: 'npm i -g'
|
57
|
+
},
|
54
58
|
}.freeze
|
55
59
|
|
56
60
|
def method_missing(cmd, *args)
|
@@ -62,7 +66,7 @@ module VueCli
|
|
62
66
|
def get_version_of(bin)
|
63
67
|
return @versions[bin] if @versions.key?(bin)
|
64
68
|
|
65
|
-
r = `#{bin} --version`.strip.presence
|
69
|
+
r = `#{bin} --version`.strip.presence rescue nil
|
66
70
|
@versions[bin] = r && r.start_with?('v') ? r[1..-1] : r
|
67
71
|
@versions[bin]
|
68
72
|
end
|
data/vue_cli-rails.gemspec
CHANGED
File without changes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vue_cli-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Chen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-02-
|
11
|
+
date: 2019-02-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|