Skip to content

Commit 74b2222

Browse files
Merge pull request #7 from jawa-the-hutt/master
implement dart-sass support
2 parents b9e0097 + cbf9ca2 commit 74b2222

18 files changed

+65
-178
lines changed

generator/index.js

+3
Original file line numberDiff line numberDiff line change
@@ -868,6 +868,9 @@ const renderDirectoryStructure = (module.exports.renderDirectoryStructure = asyn
868868
case 'sass':
869869
if (rawPath.slice(-5) == '.scss' || rawPath.slice(-5) == '.sass') files.push(rawPath);
870870
break;
871+
case 'dart-sass':
872+
if (rawPath.slice(-5) == '.scss' || rawPath.slice(-5) == '.sass') files.push(rawPath);
873+
break;
871874
case 'less':
872875
if (rawPath.slice(-5) == '.less') files.push(rawPath);
873876
break;

generator/templates/nvw/src/App.vue

+4-18
Original file line numberDiff line numberDiff line change
@@ -128,16 +128,9 @@
128128
<%_ } _%>
129129
<!-- Add "scoped" attribute to limit CSS to this component only -->
130130
<%_ if (rootOptions.cssPreprocessor) { _%>
131-
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss') { _%>
132-
<%# -------------------- IS Using scss OR sass -------------------- -%>
133-
<%- rootOptions.cssPreprocessor
134-
? `<style web lang="${
135-
rootOptions.cssPreprocessor === 'sass'
136-
? 'scss'
137-
: rootOptions.cssPreprocessor
138-
}"` + `>`
139-
: ``
140-
%>
131+
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss' || rootOptions.cssPreprocessor == 'dart-sass' ) { _%>
132+
<%# -------------------- IS Using sass, scss OR dart-sass -------------------- -%>
133+
<style web lang="scss">
141134
@import '~styles/style-one';
142135

143136
.w-page {
@@ -150,14 +143,7 @@
150143
}
151144

152145
</style>
153-
<%- rootOptions.cssPreprocessor
154-
? `<style native lang="${
155-
rootOptions.cssPreprocessor === 'sass'
156-
? 'scss'
157-
: rootOptions.cssPreprocessor
158-
}"` + `>`
159-
: ``
160-
%>
146+
<style native lang="scss">
161147
@import '~styles/style-one';
162148
</style>
163149
<%_ } else if (rootOptions.cssPreprocessor == 'stylus') { _%>

generator/templates/nvw/src/components/HelloWorld.android.vue

+3-10
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,9 @@
3131
<%_ } _%>
3232
<!-- Add "scoped" attribute to limit CSS to this component only -->
3333
<%_ if (rootOptions.cssPreprocessor) { _%>
34-
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss') { _%>
35-
<%# -------------------- IS Using scss OR sass -------------------- -%>
36-
<%- rootOptions.cssPreprocessor
37-
? `<style scoped lang="${
38-
rootOptions.cssPreprocessor === 'sass'
39-
? 'scss'
40-
: rootOptions.cssPreprocessor
41-
}"` + `>`
42-
: ``
43-
%>
34+
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss' || rootOptions.cssPreprocessor == 'dart-sass' ) { _%>
35+
<%# -------------------- IS Using sass, scss OR dart-sass -------------------- -%>
36+
<style scoped lang="scss">
4437
.message {
4538
color: #42b983;
4639
}

generator/templates/nvw/src/components/HelloWorld.ios.vue

+3-10
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,9 @@
3131
<%_ } _%>
3232
<!-- Add "scoped" attribute to limit CSS to this component only -->
3333
<%_ if (rootOptions.cssPreprocessor) { _%>
34-
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss') { _%>
35-
<%# -------------------- IS Using scss OR sass -------------------- -%>
36-
<%- rootOptions.cssPreprocessor
37-
? `<style scoped lang="${
38-
rootOptions.cssPreprocessor === 'sass'
39-
? 'scss'
40-
: rootOptions.cssPreprocessor
41-
}"` + `>`
42-
: ``
43-
%>
34+
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss' || rootOptions.cssPreprocessor == 'dart-sass' ) { _%>
35+
<%# -------------------- IS Using sass, scss OR dart-sass -------------------- -%>
36+
<style scoped lang="scss">
4437
.message {
4538
color: #42b983;
4639
}

generator/templates/nvw/src/components/HelloWorld.native.vue

+3-10
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,9 @@
3131
<%_ } _%>
3232
<!-- Add "scoped" attribute to limit CSS to this component only -->
3333
<%_ if (rootOptions.cssPreprocessor) { _%>
34-
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss') { _%>
35-
<%# -------------------- IS Using scss OR sass -------------------- -%>
36-
<%- rootOptions.cssPreprocessor
37-
? `<style scoped lang="${
38-
rootOptions.cssPreprocessor === 'sass'
39-
? 'scss'
40-
: rootOptions.cssPreprocessor
41-
}"` + `>`
42-
: ``
43-
%>
34+
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss' || rootOptions.cssPreprocessor == 'dart-sass' ) { _%>
35+
<%# -------------------- IS Using sass, scss OR dart-sass -------------------- -%>
36+
<style scoped lang="scss">
4437
.message {
4538
color: #42b983;
4639
}

generator/templates/nvw/src/components/HelloWorld.vue

+3-10
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,9 @@
3232
<%_ } _%>
3333
<!-- Add "scoped" attribute to limit CSS to this component only -->
3434
<%_ if (rootOptions.cssPreprocessor) { _%>
35-
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss') { _%>
36-
<%# -------------------- IS Using scss OR sass -------------------- -%>
37-
<%- rootOptions.cssPreprocessor
38-
? `<style scoped lang="${
39-
rootOptions.cssPreprocessor === 'sass'
40-
? 'scss'
41-
: rootOptions.cssPreprocessor
42-
}"` + `>`
43-
: ``
44-
%>
35+
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss' || rootOptions.cssPreprocessor == 'dart-sass' ) { _%>
36+
<%# -------------------- IS Using sass, scss OR dart-sass -------------------- -%>
37+
<style scoped lang="scss">
4538
.message {
4639
color: #42b983;
4740
display: block;

generator/templates/nvw/src/views/About.vue

+3-10
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,9 @@
4141
<%_ } _%>
4242
<!-- Add "scoped" attribute to limit CSS to this component only -->
4343
<%_ if (rootOptions.cssPreprocessor) { _%>
44-
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss') { _%>
45-
<%# -------------------- IS Using scss OR sass -------------------- -%>
46-
<%- rootOptions.cssPreprocessor
47-
? `<style scoped lang="${
48-
rootOptions.cssPreprocessor === 'sass'
49-
? 'scss'
50-
: rootOptions.cssPreprocessor
51-
}"` + `>`
52-
: ``
53-
%>
44+
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss' || rootOptions.cssPreprocessor == 'dart-sass' ) { _%>
45+
<%# -------------------- IS Using sass, scss OR dart-sass -------------------- -%>
46+
<style scoped lang="scss">
5447
@import '~styles/style-two';
5548
@import '~styles/style-one';
5649

generator/templates/nvw/src/views/Home.vue

+3-10
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,9 @@
6161
<%_ } _%>
6262
<!-- Add "scoped" attribute to limit CSS to this component only -->
6363
<%_ if (rootOptions.cssPreprocessor) { _%>
64-
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss') { _%>
65-
<%# -------------------- IS Using scss OR sass -------------------- -%>
66-
<%- rootOptions.cssPreprocessor
67-
? `<style scoped lang="${
68-
rootOptions.cssPreprocessor === 'sass'
69-
? 'scss'
70-
: rootOptions.cssPreprocessor
71-
}"` + `>`
72-
: ``
73-
%>
64+
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss' || rootOptions.cssPreprocessor == 'dart-sass' ) { _%>
65+
<%# -------------------- IS Using sass, scss OR dart-sass -------------------- -%>
66+
<style scoped lang="scss">
7467
@import '~styles/style-one';
7568
@import '~styles/style-two';
7669

generator/templates/simple/src/App.vue

+13-19
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@
130130
}
131131

132132
public goToAboutPage() {
133-
VUE_APP_MODE == 'web' ? this.$router.push('about') : Vue.prototype.$navigateTo(About);
133+
VUE_APP_MODE === 'web' ? this.$router.push('about') : Vue.prototype.$navigateTo(About);
134134
}
135135
<%_ } _%>
136136
}
@@ -140,16 +140,18 @@
140140

141141
<!-- Add "scoped" attribute to limit CSS to this component only -->
142142
<%_ if (rootOptions.cssPreprocessor) { _%>
143-
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss') { _%>
144-
<%# -------------------- IS Using scss OR sass -------------------- -%>
145-
<%- rootOptions.cssPreprocessor
146-
? `<style web lang="${
147-
rootOptions.cssPreprocessor === 'sass'
148-
? 'scss'
149-
: rootOptions.cssPreprocessor
150-
}"` + `>`
151-
: ``
152-
%>
143+
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss' || rootOptions.cssPreprocessor == 'dart-sass' ) { _%>
144+
<%# -------------------- IS Using sass, scss OR dart-sass -------------------- -%>
145+
<style web lang="scss">
146+
@import '~styles/style-one';
147+
148+
.w-page {
149+
height: 100%;
150+
width: 100%;
151+
}
152+
153+
</style>
154+
<style native lang="scss">
153155
@import '~styles/style-one';
154156

155157
.w-page {
@@ -158,14 +160,6 @@
158160
}
159161

160162
</style>
161-
<%- rootOptions.cssPreprocessor
162-
? `<style native lang="${
163-
rootOptions.cssPreprocessor === 'sass'
164-
? 'scss'
165-
: rootOptions.cssPreprocessor
166-
}"` + `>`
167-
: ``
168-
%>
169163
@import '~styles/style-one';
170164
</style>
171165
<%_ } else if (rootOptions.cssPreprocessor == 'stylus') { _%>

generator/templates/simple/src/components/HelloWorld.android.vue

+3-10
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,9 @@
3131
<%_ } _%>
3232
<!-- Add "scoped" attribute to limit CSS to this component only -->
3333
<%_ if (rootOptions.cssPreprocessor) { _%>
34-
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss') { _%>
35-
<%# -------------------- IS Using scss OR sass -------------------- -%>
36-
<%- rootOptions.cssPreprocessor
37-
? `<style scoped lang="${
38-
rootOptions.cssPreprocessor === 'sass'
39-
? 'scss'
40-
: rootOptions.cssPreprocessor
41-
}"` + `>`
42-
: ``
43-
%>
34+
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss' || rootOptions.cssPreprocessor == 'dart-sass' ) { _%>
35+
<%# -------------------- IS Using sass, scss OR dart-sass -------------------- -%>
36+
<style scoped lang="scss">
4437
.message {
4538
color: #42b983;
4639
}

generator/templates/simple/src/components/HelloWorld.ios.vue

+3-10
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,9 @@
3131
<%_ } _%>
3232
<!-- Add "scoped" attribute to limit CSS to this component only -->
3333
<%_ if (rootOptions.cssPreprocessor) { _%>
34-
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss') { _%>
35-
<%# -------------------- IS Using scss OR sass -------------------- -%>
36-
<%- rootOptions.cssPreprocessor
37-
? `<style scoped lang="${
38-
rootOptions.cssPreprocessor === 'sass'
39-
? 'scss'
40-
: rootOptions.cssPreprocessor
41-
}"` + `>`
42-
: ``
43-
%>
34+
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss' || rootOptions.cssPreprocessor == 'dart-sass' ) { _%>
35+
<%# -------------------- IS Using sass, scss OR dart-sass -------------------- -%>
36+
<style scoped lang="scss">
4437
.message {
4538
color: #42b983;
4639
}

generator/templates/simple/src/components/HelloWorld.native.vue

+3-10
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,9 @@
3131
<%_ } _%>
3232
<!-- Add "scoped" attribute to limit CSS to this component only -->
3333
<%_ if (rootOptions.cssPreprocessor) { _%>
34-
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss') { _%>
35-
<%# -------------------- IS Using scss OR sass -------------------- -%>
36-
<%- rootOptions.cssPreprocessor
37-
? `<style scoped lang="${
38-
rootOptions.cssPreprocessor === 'sass'
39-
? 'scss'
40-
: rootOptions.cssPreprocessor
41-
}"` + `>`
42-
: ``
43-
%>
34+
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss' || rootOptions.cssPreprocessor == 'dart-sass' ) { _%>
35+
<%# -------------------- IS Using sass, scss OR dart-sass -------------------- -%>
36+
<style scoped lang="scss">
4437
.message {
4538
color: #42b983;
4639
}

generator/templates/simple/src/components/HelloWorld.vue

+3-10
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,9 @@
2929
<%_ } _%>
3030
<!-- Add "scoped" attribute to limit CSS to this component only -->
3131
<%_ if (rootOptions.cssPreprocessor) { _%>
32-
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss') { _%>
33-
<%# -------------------- IS Using scss OR sass -------------------- -%>
34-
<%- rootOptions.cssPreprocessor
35-
? `<style scoped lang="${
36-
rootOptions.cssPreprocessor === 'sass'
37-
? 'scss'
38-
: rootOptions.cssPreprocessor
39-
}"` + `>`
40-
: ``
41-
%>
32+
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss' || rootOptions.cssPreprocessor == 'dart-sass' ) { _%>
33+
<%# -------------------- IS Using sass, scss OR dart-sass -------------------- -%>
34+
<style scoped lang="scss">
4235
.message {
4336
color: #42b983;
4437
display: block;

generator/templates/simple/src/views/About.vue

+3-10
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,9 @@
5252
<%_ } _%>
5353
<!-- Add "scoped" attribute to limit CSS to this component only -->
5454
<%_ if (rootOptions.cssPreprocessor) { _%>
55-
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss') { _%>
56-
<%# -------------------- IS Using scss OR sass -------------------- -%>
57-
<%- rootOptions.cssPreprocessor
58-
? `<style scoped lang="${
59-
rootOptions.cssPreprocessor === 'sass'
60-
? 'scss'
61-
: rootOptions.cssPreprocessor
62-
}"` + `>`
63-
: ``
64-
%>
55+
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss' || rootOptions.cssPreprocessor == 'dart-sass' ) { _%>
56+
<%# -------------------- IS Using sass, scss OR dart-sass -------------------- -%>
57+
<style scoped lang="scss">
6558
@import '~styles/style-two';
6659
@import '~styles/style-one';
6760
</style>

generator/templates/simple/src/views/Home.vue

+3-10
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,9 @@
6464
<%_ } _%>
6565
<!-- Add "scoped" attribute to limit CSS to this component only -->
6666
<%_ if (rootOptions.cssPreprocessor) { _%>
67-
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss') { _%>
68-
<%# -------------------- IS Using scss OR sass -------------------- -%>
69-
<%- rootOptions.cssPreprocessor
70-
? `<style scoped lang="${
71-
rootOptions.cssPreprocessor === 'sass'
72-
? 'scss'
73-
: rootOptions.cssPreprocessor
74-
}"` + `>`
75-
: ``
76-
%>
67+
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss' || rootOptions.cssPreprocessor == 'dart-sass' ) { _%>
68+
<%# -------------------- IS Using sass, scss OR dart-sass -------------------- -%>
69+
<style scoped lang="scss">
7770
@import '~styles/style-one';
7871
@import '~styles/style-two';
7972

generator/templates/vue-sfc-template.vue

+4-18
Original file line numberDiff line numberDiff line change
@@ -34,25 +34,11 @@
3434
<%_ } _%>
3535
<!-- Add "scoped" attribute to limit CSS to this component only -->
3636
<%_ if (rootOptions.cssPreprocessor) { _%>
37-
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss') { _%>
38-
<%# -------------------- IS Using scss OR sass -------------------- -%>
39-
<%- rootOptions.cssPreprocessor
40-
? `<style web lang="${
41-
rootOptions.cssPreprocessor === 'sass'
42-
? 'scss'
43-
: rootOptions.cssPreprocessor
44-
}"` + `>`
45-
: ``
46-
%>
37+
<%_ if (rootOptions.cssPreprocessor == 'sass' || rootOptions.cssPreprocessor == 'scss' || rootOptions.cssPreprocessor == 'dart-sass') { _%>
38+
<%# -------------------- IS Using sass, scss OR dart-sass -------------------- -%>
39+
<style web lang="scss">
4740
</style>
48-
<%- rootOptions.cssPreprocessor
49-
? `<style native lang="${
50-
rootOptions.cssPreprocessor === 'sass'
51-
? 'scss'
52-
: rootOptions.cssPreprocessor
53-
}"` + `>`
54-
: ``
55-
%>
41+
<style native lang="scss">
5642
</style>
5743
<%_ } else if (rootOptions.cssPreprocessor == 'stylus') { _%>
5844
<%# -------------------- IS Using stylus -------------------- -%>

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
{
22
"name": "vue-cli-plugin-nativescript-vue",
3-
"version": "0.0.11",
3+
"version": "0.0.12",
44
"description": "A vue cli 3.x plugin for NativeScript-Vue",
55
"main": "index.js",
66
"files": [
77
"index.js",
88
"lib",
99
"generator",
1010
"LICENSE",
11-
"prompts.js"
11+
"prompts.js",
12+
"ui.js",
13+
"logo.png"
1214
],
1315
"scripts": {
1416
"test": "echo \"Error: no test specified\" && exit 1"

0 commit comments

Comments
 (0)