Skip to content

Commit

Permalink
Fix name conversion
Browse files Browse the repository at this point in the history
It is erroneously converted when `vue` is included in the class name.
  • Loading branch information
nosix committed Sep 22, 2017
1 parent 32c9678 commit eefac2f
Show file tree
Hide file tree
Showing 20 changed files with 19 additions and 19 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ class GreetingComponentVue : ComponentVue<GreetingComponent> {
}

@Suppress("unused")
val options = translate(GreetingComponentVue()) // required, used by vuekt-js2vue
val options = translate(GreetingComponentVue()) // required, used by bundling
```

CSS library: [null-dev/Aza-Kotlin-CSS-JS](https://github.com/null-dev/Aza-Kotlin-CSS-JS)
Expand Down Expand Up @@ -233,10 +233,10 @@ module.exports = require('greeting-component_main.js').options
<img src="https://docs.google.com/drawings/d/e/2PACX-1vQIrWUsJ0aY3VlbUkyvkIdA6Z4yikCmfxxPr_nYKUKZsbmiG0WV8qR_tEY4SFgA8LMwZoKh2QMuU90Z/pub?w=960&amp;h=720">

- `greeting-component_main.js` and `greeting-component.vue` are named from `GreetingComponentVue`
- `Vue` of prefix/suffix is removed
- Camel case is converted to kebab case
- `Vue` is removed
- You can change the name by overriding ComponentVue::name property
- default is `this::class.js.name.replace("([A-Z])".toRegex(), "-$1").toLowerCase().replace("vue", "").trim('-')`
- default is `this::class.js.name.replace("^Vue|Vue$".toRegex(), "").replace("([A-Z])".toRegex(), "-$1").toLowerCase().trim('-')`
- vuekt-js2vue finds `*-component_main.js`
- You can change the pattern by setting targetPattern in build.gradle

Expand Down
Binary file modified release/org/musyozoku/vuekt-js2vue/0.1.0/vuekt-js2vue-0.1.0.jar
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
15151079c19936d4c11978506dce4757
cc7fb015d9a12b0638296485dc191fab
Original file line number Diff line number Diff line change
@@ -1 +1 @@
e6169220a747beb82ec5997606bf7a33efaad565
63dba51d657994a11c0f310fd69635f4d36bb376
2 changes: 1 addition & 1 deletion release/org/musyozoku/vuekt-js2vue/maven-metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
<versions>
<version>0.1.0</version>
</versions>
<lastUpdated>20170920155749</lastUpdated>
<lastUpdated>20170922051112</lastUpdated>
</versioning>
</metadata>
2 changes: 1 addition & 1 deletion release/org/musyozoku/vuekt-js2vue/maven-metadata.xml.md5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
e2cbeb9405ca1bae2388e2469726d381
a21297fd7d14509f474f88c8b600792b
2 changes: 1 addition & 1 deletion release/org/musyozoku/vuekt-js2vue/maven-metadata.xml.sha1
Original file line number Diff line number Diff line change
@@ -1 +1 @@
69e3f3020952b65147cbc1b7ef9f648a44194cfd
7b0c0707f8c52d37c775c872fe3f012e33e3ff46
Binary file modified release/org/musyozoku/vuekt-plugin/0.1.0/vuekt-plugin-0.1.0.jar
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7b9c6e3f18212910f2c77c46c121341c
c7d9fc9c2a82b7f95a89bbd662fb5f7b
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0dca54a467692f960066288d3a35f56697ac7f0b
cf99ca7c4f926d476fcc7166dcbfd2b1a27b25f9
2 changes: 1 addition & 1 deletion release/org/musyozoku/vuekt-plugin/maven-metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
<versions>
<version>0.1.0</version>
</versions>
<lastUpdated>20170920155741</lastUpdated>
<lastUpdated>20170922051105</lastUpdated>
</versioning>
</metadata>
2 changes: 1 addition & 1 deletion release/org/musyozoku/vuekt-plugin/maven-metadata.xml.md5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d1f449f4772db98341c18449ed17749c
3964d50f7449005ab18c80dc5e0cbed4
2 changes: 1 addition & 1 deletion release/org/musyozoku/vuekt-plugin/maven-metadata.xml.sha1
Original file line number Diff line number Diff line change
@@ -1 +1 @@
64ae3e14d9ead41b97b2a5a5672903d0d66abc18
df488c1a3e98760c780e84b955cc10d263723502
Binary file modified release/org/musyozoku/vuekt/0.1.0/vuekt-0.1.0.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion release/org/musyozoku/vuekt/0.1.0/vuekt-0.1.0.jar.md5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1ce7e6ff62a28a42b547c08a9dc7346e
d08c494cf3bd9fde6241fcbbc269422a
2 changes: 1 addition & 1 deletion release/org/musyozoku/vuekt/0.1.0/vuekt-0.1.0.jar.sha1
Original file line number Diff line number Diff line change
@@ -1 +1 @@
49d23d93fb3208c5b28b3d78f288aecb85c18df2
000c5900fab5b5f98dc327814826de83f32bad1e
2 changes: 1 addition & 1 deletion release/org/musyozoku/vuekt/maven-metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
<versions>
<version>0.1.0</version>
</versions>
<lastUpdated>20170920155746</lastUpdated>
<lastUpdated>20170922051110</lastUpdated>
</versioning>
</metadata>
2 changes: 1 addition & 1 deletion release/org/musyozoku/vuekt/maven-metadata.xml.md5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ff386e71ae2014d24c104ea2547136c2
48f7357adecbf41c68400fd82cfec5bd
2 changes: 1 addition & 1 deletion release/org/musyozoku/vuekt/maven-metadata.xml.sha1
Original file line number Diff line number Diff line change
@@ -1 +1 @@
56ca9b826ca793d5cd633330e7d36005f58be4b6
d16328108bf7694c6b37947c962cbd237b1649f6
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ interface ComponentVue<V : Vue> {
* Default: if class name is `FooBarComponentVue`, then base name is `foo-bar-component`.
*/
val name: String get() = this::class.js.name
.replace("([A-Z])".toRegex(), "-$1").toLowerCase().replace("vue", "").trim('-')
.replace("^Vue|Vue$".toRegex(), "").replace("([A-Z])".toRegex(), "-$1").toLowerCase().trim('-')

/**
* Output vue file name.
Expand Down

0 comments on commit eefac2f

Please sign in to comment.