Skip to content

Commit 932c7ba

Browse files
Upgrade project to {N} 5.1 (#14)
Upgrade project to {N} 5.1 Fix style tags for projects not using a css preprocessor
1 parent 5002763 commit 932c7ba

30 files changed

+529
-132
lines changed

generator/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ module.exports = async (api, options, rootOptions) => {
7878
nativescript: {
7979
id: 'org.nativescript.application',
8080
'tns-ios': {
81-
version: '4.2.0'
81+
version: '5.1.0'
8282
},
8383
'tns-android': {
84-
version: '4.2.0'
84+
version: '5.1.0'
8585
}
8686
},
8787
scripts: {
@@ -99,7 +99,7 @@ module.exports = async (api, options, rootOptions) => {
9999
},
100100
dependencies: {
101101
'nativescript-vue': '^2.0.2',
102-
'tns-core-modules': '^4.2.1'
102+
'tns-core-modules': '^5.1.0'
103103
},
104104
devDependencies: {
105105
'cross-env': '^5.2.0',

generator/templates/simple/with-nvw/src/App.android.vue

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,23 +52,33 @@
5252
</script>
5353
<%_ } _%>
5454
<!-- Add "scoped" attribute to limit CSS to this component only -->
55-
<%_ if (rootOptions.cssPreprocessor !== 'stylus') { _%>
56-
<%# -------------------- IS Using scss OR sass -------------------- -%>
55+
<%_ if (rootOptions.cssPreprocessor) { _%>
56+
<%_ if (rootOptions.cssPreprocessor !== 'stylus') { _%>
57+
<%# -------------------- IS Using scss OR sass -------------------- -%>
5758
<%- rootOptions.cssPreprocessor
58-
? `<style scoped lang="${
59-
rootOptions.cssPreprocessor === 'sass'
60-
? 'scss'
61-
: rootOptions.cssPreprocessor
62-
}"` + `>`
63-
: ``
59+
? `<style scoped lang="${
60+
rootOptions.cssPreprocessor === 'sass'
61+
? 'scss'
62+
: rootOptions.cssPreprocessor
63+
}"` + `>`
64+
: ``
6465
%>
6566
@import 'styles/style-two';
6667
@import 'styles/style-three';
6768
</style>
68-
<%_ } else { _%>
69-
<%# -------------------- IS Using stylus -------------------- -%>
69+
<%_ } else { _%>
70+
<%# -------------------- IS Using stylus -------------------- -%>
7071
<style lang="stylus">
7172
ActionBar
7273
color #42b983
7374
</style>
75+
<%_ } _%>
76+
<%_ } else { _%>
77+
<%# -------------------- IS Using standard CSS -------------------- -%>
78+
<style>
79+
ActionBar {
80+
color: #42b983;
81+
background-color: #000
82+
}
83+
</style>
7484
<%_ } _%>

generator/templates/simple/with-nvw/src/App.ios.vue

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,23 +52,33 @@
5252
</script>
5353
<%_ } _%>
5454
<!-- Add "scoped" attribute to limit CSS to this component only -->
55-
<%_ if (rootOptions.cssPreprocessor !== 'stylus') { _%>
56-
<%# -------------------- IS Using scss OR sass -------------------- -%>
55+
<%_ if (rootOptions.cssPreprocessor) { _%>
56+
<%_ if (rootOptions.cssPreprocessor !== 'stylus') { _%>
57+
<%# -------------------- IS Using scss OR sass -------------------- -%>
5758
<%- rootOptions.cssPreprocessor
58-
? `<style scoped lang="${
59-
rootOptions.cssPreprocessor === 'sass'
60-
? 'scss'
61-
: rootOptions.cssPreprocessor
62-
}"` + `>`
63-
: ``
59+
? `<style scoped lang="${
60+
rootOptions.cssPreprocessor === 'sass'
61+
? 'scss'
62+
: rootOptions.cssPreprocessor
63+
}"` + `>`
64+
: ``
6465
%>
6566
@import 'styles/style-two';
6667
@import 'styles/style-three';
6768
</style>
68-
<%_ } else { _%>
69-
<%# -------------------- IS Using stylus -------------------- -%>
69+
<%_ } else { _%>
70+
<%# -------------------- IS Using stylus -------------------- -%>
7071
<style lang="stylus">
7172
ActionBar
7273
color #42b983
7374
</style>
75+
<%_ } _%>
76+
<%_ } else { _%>
77+
<%# -------------------- IS Using standard CSS -------------------- -%>
78+
<style>
79+
ActionBar {
80+
color: #42b983;
81+
background-color: #000
82+
}
83+
</style>
7484
<%_ } _%>

generator/templates/simple/with-nvw/src/App.native.vue

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@
5252
</script>
5353
<%_ } _%>
5454
<!-- Add "scoped" attribute to limit CSS to this component only -->
55-
<%_ if (rootOptions.cssPreprocessor !== 'stylus') { _%>
56-
<%# -------------------- IS Using scss OR sass -------------------- -%>
55+
<%_ if (rootOptions.cssPreprocessor) { _%>
56+
<%_ if (rootOptions.cssPreprocessor !== 'stylus') { _%>
57+
<%# -------------------- IS Using scss OR sass -------------------- -%>
5758
<%- rootOptions.cssPreprocessor
5859
? `<style scoped lang="${
5960
rootOptions.cssPreprocessor === 'sass'
@@ -65,10 +66,19 @@
6566
@import 'styles/style-two';
6667
@import 'styles/style-three';
6768
</style>
68-
<%_ } else { _%>
69-
<%# -------------------- IS Using stylus -------------------- -%>
69+
<%_ } else { _%>
70+
<%# -------------------- IS Using stylus -------------------- -%>
7071
<style lang="stylus">
7172
ActionBar
7273
color #42b983
7374
</style>
75+
<%_ } _%>
76+
<%_ } else { _%>
77+
<%# -------------------- IS Using standard CSS -------------------- -%>
78+
<style>
79+
ActionBar {
80+
color: #42b983;
81+
background-color: #000
82+
}
83+
</style>
7484
<%_ } _%>

generator/templates/simple/with-nvw/src/App.vue

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,9 @@
119119
<%# -------------------- don't do anything -------------------- -%>
120120
<%_ } _%>
121121
<!-- Add "scoped" attribute to limit CSS to this component only -->
122-
<%_ if (rootOptions.cssPreprocessor !== 'stylus') { _%>
123-
<%# -------------------- IS Using scss OR sass -------------------- -%>
122+
<%_ if (rootOptions.cssPreprocessor) { _%>
123+
<%_ if (rootOptions.cssPreprocessor !== 'stylus') { _%>
124+
<%# -------------------- IS Using scss OR sass -------------------- -%>
124125
<%- rootOptions.cssPreprocessor
125126
? `<style scoped lang="${
126127
rootOptions.cssPreprocessor === 'sass'
@@ -131,10 +132,18 @@
131132
%>
132133
@import 'styles/style-one';
133134
</style>
134-
<%_ } else { _%>
135-
<%# -------------------- IS Using stylus -------------------- -%>
135+
<%_ } else { _%>
136+
<%# -------------------- IS Using stylus -------------------- -%>
136137
<style scoped lang="stylus">
137138
.nvw-action-bar
138139
color #42b983
139140
</style>
141+
<%_ } _%>
142+
<%_ } else { _%>
143+
<%# -------------------- IS Using standard CSS -------------------- -%>
144+
<style>
145+
.nvw-action-bar {
146+
color: #42b983;
147+
}
148+
</style>
140149
<%_ } _%>

generator/templates/simple/with-nvw/src/components/HelloWorld.android.vue

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@
3030
</script>
3131
<%_ } _%>
3232
<!-- Add "scoped" attribute to limit CSS to this component only -->
33-
<%_ if (rootOptions.cssPreprocessor !== 'stylus') { _%>
34-
<%# -------------------- IS Using scss OR sass -------------------- -%>
33+
<%_ if (rootOptions.cssPreprocessor) { _%>
34+
<%_ if (rootOptions.cssPreprocessor !== 'stylus') { _%>
35+
<%# -------------------- IS Using scss OR sass -------------------- -%>
3536
<%- rootOptions.cssPreprocessor
3637
? `<style scoped lang="${
3738
rootOptions.cssPreprocessor === 'sass'
@@ -50,8 +51,8 @@
5051
margin-top: 20px;
5152
}
5253
</style>
53-
<%_ } else { _%>
54-
<%# -------------------- IS Using stylus -------------------- -%>
54+
<%_ } else { _%>
55+
<%# -------------------- IS Using stylus -------------------- -%>
5556
<style scoped lang="stylus">
5657
.message
5758
color #42b983
@@ -61,4 +62,18 @@
6162
width 20%
6263
margin-top 20px
6364
</style>
65+
<%_ } _%>
66+
<%_ } else { _%>
67+
<%# -------------------- IS Using standard CSS -------------------- -%>
68+
<style scoped>
69+
.message {
70+
color: #42b983;
71+
}
72+
73+
Image {
74+
height: 20%;
75+
width: 20%;
76+
margin-top: 20px;
77+
}
78+
</style>
6479
<%_ } _%>

generator/templates/simple/with-nvw/src/components/HelloWorld.ios.vue

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@
3030
</script>
3131
<%_ } _%>
3232
<!-- Add "scoped" attribute to limit CSS to this component only -->
33-
<%_ if (rootOptions.cssPreprocessor !== 'stylus') { _%>
34-
<%# -------------------- IS Using scss OR sass -------------------- -%>
33+
<%_ if (rootOptions.cssPreprocessor) { _%>
34+
<%_ if (rootOptions.cssPreprocessor !== 'stylus') { _%>
35+
<%# -------------------- IS Using scss OR sass -------------------- -%>
3536
<%- rootOptions.cssPreprocessor
3637
? `<style scoped lang="${
3738
rootOptions.cssPreprocessor === 'sass'
@@ -50,8 +51,8 @@
5051
margin-top: 20px;
5152
}
5253
</style>
53-
<%_ } else { _%>
54-
<%# -------------------- IS Using stylus -------------------- -%>
54+
<%_ } else { _%>
55+
<%# -------------------- IS Using stylus -------------------- -%>
5556
<style scoped lang="stylus">
5657
.message
5758
color #42b983
@@ -61,4 +62,18 @@
6162
width 20%
6263
margin-top 20px
6364
</style>
65+
<%_ } _%>
66+
<%_ } else { _%>
67+
<%# -------------------- IS Using standard CSS -------------------- -%>
68+
<style scoped>
69+
.message {
70+
color: #42b983;
71+
}
72+
73+
Image {
74+
height: 20%;
75+
width: 20%;
76+
margin-top: 20px;
77+
}
78+
</style>
6479
<%_ } _%>

generator/templates/simple/with-nvw/src/components/HelloWorld.native.vue

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@
3030
</script>
3131
<%_ } _%>
3232
<!-- Add "scoped" attribute to limit CSS to this component only -->
33-
<%_ if (rootOptions.cssPreprocessor !== 'stylus') { _%>
34-
<%# -------------------- IS Using scss OR sass -------------------- -%>
33+
<%_ if (rootOptions.cssPreprocessor) { _%>
34+
<%_ if (rootOptions.cssPreprocessor !== 'stylus') { _%>
35+
<%# -------------------- IS Using scss OR sass -------------------- -%>
3536
<%- rootOptions.cssPreprocessor
3637
? `<style scoped lang="${
3738
rootOptions.cssPreprocessor === 'sass'
@@ -50,8 +51,8 @@
5051
margin-top: 20px;
5152
}
5253
</style>
53-
<%_ } else { _%>
54-
<%# -------------------- IS Using stylus -------------------- -%>
54+
<%_ } else { _%>
55+
<%# -------------------- IS Using stylus -------------------- -%>
5556
<style scoped lang="stylus">
5657
.message
5758
color #42b983
@@ -61,4 +62,18 @@
6162
width 20%
6263
margin-top 20px
6364
</style>
65+
<%_ } _%>
66+
<%_ } else { _%>
67+
<%# -------------------- IS Using standard CSS -------------------- -%>
68+
<style scoped>
69+
.message {
70+
color: #42b983;
71+
}
72+
73+
Image {
74+
height: 20%;
75+
width: 20%;
76+
margin-top: 20px;
77+
}
78+
</style>
6479
<%_ } _%>

generator/templates/simple/with-nvw/src/components/HelloWorld.vue

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@
4343
</script>
4444
<%_ } _%>
4545
<!-- Add "scoped" attribute to limit CSS to this component only -->
46-
<%_ if (rootOptions.cssPreprocessor !== 'stylus') { _%>
47-
<%# -------------------- IS Using scss OR sass -------------------- -%>
46+
<%_ if (rootOptions.cssPreprocessor) { _%>
47+
<%_ if (rootOptions.cssPreprocessor !== 'stylus') { _%>
48+
<%# -------------------- IS Using scss OR sass -------------------- -%>
4849
<%- rootOptions.cssPreprocessor
4950
? `<style scoped lang="${
5051
rootOptions.cssPreprocessor === 'sass'
@@ -67,8 +68,8 @@
6768
margin-top: 4em;
6869
}
6970
</style>
70-
<%_ } else { _%>
71-
<%# -------------------- IS Using stylus -------------------- -%>
71+
<%_ } else { _%>
72+
<%# -------------------- IS Using stylus -------------------- -%>
7273
<style scoped lang="stylus">
7374
.message
7475
color #42b983
@@ -83,4 +84,22 @@
8384
margin auto
8485
margin-top 4em
8586
</style>
87+
<%_ } _%>
88+
<%_ } else { _%>
89+
<%# -------------------- IS Using standard CSS -------------------- -%>
90+
<style scoped>
91+
.message {
92+
color: #42b983;
93+
display: block;
94+
margin: auto;
95+
margin-top: 4em;
96+
text-align: center;
97+
}
98+
img {
99+
height: 75px;
100+
display: block;
101+
margin: auto;
102+
margin-top: 4em;
103+
}
104+
</style>
86105
<%_ } _%>
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
.w-navbar,
21
.nvw-action-bar {
32
color: #42b983;
43
}

0 commit comments

Comments
 (0)