vueonrails 1.0.0.beta2 → 1.0.0.beta3
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 +4 -4
- data/app/helpers/syntax_helper.rb +0 -2
- data/lib/generators/vue/vue_generator.rb +0 -1
- data/lib/installs/setup.rb +13 -0
- data/lib/installs/test.rb +13 -1
- data/lib/vueonrails/version.rb +2 -1
- metadata +1 -4
- data/lib/generators/options/pug.rb +0 -14
- data/lib/installs/loaders/pug.js +0 -15
- data/lib/installs/pug.rb +0 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4308786754408c51f8a1e1299c0dffbd7d7f23d42e693815c56474d6a5b2de86
|
4
|
+
data.tar.gz: 1915f256ee3faddc68ab55ebaee0f958e74338b403f5e6f314a39c4746dcf03a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d79f39ad995fba55953daaeef8cdfc387064a548a77cc99511952782ccff674f6700a66209ffa30ef26047d1dbfd21468e572e596e590e6c4ad364ca257260f
|
7
|
+
data.tar.gz: 00df4fbf3c519c7e1420e1c74d9b5241630daa15302ff667cd1a0dd3b3776aaef837e9db27ff4e92950f1fa8803e3f43c4e8be8decc48d631a25b28ae0067641
|
@@ -19,7 +19,6 @@ class VueGenerator < Rails::Generators::NamedBase
|
|
19
19
|
table: {type: :boolean, default: false},
|
20
20
|
modal: {type: :boolean, default: false},
|
21
21
|
click: {type: :boolean, default: false},
|
22
|
-
pug: {type: :boolean, default: false}
|
23
22
|
}.freeze
|
24
23
|
|
25
24
|
class_option :ssr, type: :string, default: nil
|
data/lib/installs/setup.rb
CHANGED
@@ -83,6 +83,19 @@ eos
|
|
83
83
|
insert_into_file Rails.root.join("package.json").to_s,
|
84
84
|
scripts, after: "\"private\": true,\n"
|
85
85
|
|
86
|
+
babelrc = <<-eos
|
87
|
+
"env": {
|
88
|
+
"test": {
|
89
|
+
"presets": [
|
90
|
+
["env", { "targets": { "node": "current" }}]
|
91
|
+
]
|
92
|
+
}
|
93
|
+
},
|
94
|
+
eos
|
95
|
+
|
96
|
+
insert_into_file Rails.root.join(".babelrc").to_s,
|
97
|
+
babelrc, before: " \"presets\": ["
|
98
|
+
|
86
99
|
# Insert locale.js as a default i18n and add second locale cn.yml
|
87
100
|
copy_file "#{__dir__}/../generators/templates/i18n/index.js", Rails.root.join("app/javascript/locales/locale.js").to_s
|
88
101
|
copy_file "#{__dir__}/../generators/templates/i18n/cn.yml", Rails.root.join("config/locales/cn.yml").to_s
|
data/lib/installs/test.rb
CHANGED
@@ -28,4 +28,16 @@ insert_into_file Rails.root.join("package.json").to_s,
|
|
28
28
|
"#{scripts}",
|
29
29
|
after: "\"private\": true,\n"
|
30
30
|
|
31
|
-
|
31
|
+
babelrc = <<-eos
|
32
|
+
"test": {
|
33
|
+
"presets": [
|
34
|
+
["env", { "targets": { "node": "current" }}]
|
35
|
+
]
|
36
|
+
},
|
37
|
+
eos
|
38
|
+
|
39
|
+
insert_into_file Rails.root.join(".babelrc").to_s,
|
40
|
+
"#{babelrc}",
|
41
|
+
before: " \"presets\": ["
|
42
|
+
|
43
|
+
run "yarn add jest-serializer-vue vue-jest babel-jest --no-progress --silent"
|
data/lib/vueonrails/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vueonrails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.beta3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bryan Lim
|
@@ -57,7 +57,6 @@ files:
|
|
57
57
|
- lib/generators/options/list.rb
|
58
58
|
- lib/generators/options/modal.rb
|
59
59
|
- lib/generators/options/parent.rb
|
60
|
-
- lib/generators/options/pug.rb
|
61
60
|
- lib/generators/options/seperate.rb
|
62
61
|
- lib/generators/options/single.rb
|
63
62
|
- lib/generators/options/ssr.rb
|
@@ -83,8 +82,6 @@ files:
|
|
83
82
|
- lib/installs/Procfile
|
84
83
|
- lib/installs/config/alias.js
|
85
84
|
- lib/installs/i18n.rb
|
86
|
-
- lib/installs/loaders/pug.js
|
87
|
-
- lib/installs/pug.rb
|
88
85
|
- lib/installs/setup.rb
|
89
86
|
- lib/installs/spv.rb
|
90
87
|
- lib/installs/ssr.rb
|
@@ -1,14 +0,0 @@
|
|
1
|
-
pugtemplate = <<-eos
|
2
|
-
<template lang="pug">
|
3
|
-
##{name}
|
4
|
-
p {{ message }}
|
5
|
-
</template>
|
6
|
-
eos
|
7
|
-
|
8
|
-
if options[:seperate] == true
|
9
|
-
gsub_file Rails.root.join("#{PARTS_PATH}/#{name}/#{name}.vue").to_s,
|
10
|
-
/<template>[^\]]*<\/template>/, pugtemplate
|
11
|
-
else
|
12
|
-
gsub_file Rails.root.join("#{PARTS_PATH}/#{name}.vue").to_s,
|
13
|
-
/<template>[^\]]*<\/template>/, pugtemplate
|
14
|
-
end
|
data/lib/installs/loaders/pug.js
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
// Generated by Vue on Rails https://github.com/vueonrails/vueonrails
|
2
|
-
// This is required to support Pug in Vue on Rails.
|
3
|
-
|
4
|
-
module.exports = {
|
5
|
-
test: /\.pug$/,
|
6
|
-
oneOf: [
|
7
|
-
{
|
8
|
-
resourceQuery: /^\?vue/,
|
9
|
-
use: ['pug-plain-loader']
|
10
|
-
},
|
11
|
-
{
|
12
|
-
use: ['raw-loader', 'pug-plain-loader']
|
13
|
-
}
|
14
|
-
]
|
15
|
-
}
|
data/lib/installs/pug.rb
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
# install pug dependencies
|
2
|
-
run "yarn add pug pug-plain-loader"
|
3
|
-
|
4
|
-
# add the pug loader
|
5
|
-
copy_file "#{__dir__}/loaders/pug.js", Rails.root.join("config/webpack/loaders/pug.js").to_s
|
6
|
-
|
7
|
-
# insert pug into the environment.js
|
8
|
-
insert_into_file Rails.root.join("config/webpack/environment.js").to_s,
|
9
|
-
"const pug = require('./loaders/pug')\n", after: "require('@rails/webpacker')\n"
|
10
|
-
|
11
|
-
insert_into_file Rails.root.join("config/webpack/environment.js").to_s,
|
12
|
-
"environment.loaders.prepend('pug', pug)\n", before: "module.exports = environment"
|