Skip to content

Commit 8cc9a90

Browse files
authored
feat: Svelte update (#242)
* chore: svelte update and remove @nativescript/theme * chore: updated svelte in vision template
1 parent bc694e6 commit 8cc9a90

File tree

5 files changed

+67
-26
lines changed

5 files changed

+67
-26
lines changed

packages/template-blank-svelte-vision/package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,16 @@
3939
"url": "https://github.com/NativeScript/NativeScript/issues"
4040
},
4141
"dependencies": {
42-
"@nativescript/core": "~8.9.0",
43-
"@nativescript-community/svelte-native": "~1.0.29"
42+
"@nativescript-community/svelte-native": "~1.0.29",
43+
"@nativescript/core": "~8.9.9"
4444
},
4545
"devDependencies": {
46-
"@nativescript/types": "~8.9.0",
47-
"@nativescript/webpack": "~5.0.0",
48-
"svelte": "~4.2.2",
49-
"svelte-loader": "^3.2.0",
50-
"svelte-native-preprocessor": "^1.0.0",
51-
"svelte-preprocess": "^5.1.3",
52-
"typescript": "~5.7.0"
46+
"@nativescript-community/svelte-native-preprocessor": "^1.0.1",
47+
"@nativescript/types": "~8.9.1",
48+
"@nativescript/webpack": "~5.0.24",
49+
"svelte": "~4.2.20",
50+
"svelte-loader": "^3.2.4",
51+
"svelte-preprocess": "^6.0.3",
52+
"typescript": "~5.9.2"
5353
}
5454
}
Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,31 @@
11
const sveltePreprocess = require('svelte-preprocess')
2-
const svelteNativePreprocessor = require('svelte-native-preprocessor')
2+
const svelteNativePreprocessor = require('@nativescript-community/svelte-native-preprocessor')
33

4+
// this can be called either through svelte-loader where we want either __ANDROID__ or __IOS__ to be defined but not both
5+
// or through svelte-check where we want both so everything is checked
6+
const webpack_env = process.env['NATIVESCRIPT_WEBPACK_ENV']
7+
? JSON.parse(process.env['NATIVESCRIPT_WEBPACK_ENV'])
8+
: {
9+
android: true,
10+
ios: true
11+
};
412
module.exports = {
513
compilerOptions: {
614
namespace: "foreign"
715
},
8-
preprocess: [ sveltePreprocess(), svelteNativePreprocessor() ]
16+
preprocess: [ sveltePreprocess({
17+
replace: [
18+
[/__ANDROID__/g, !!webpack_env.android],
19+
[/__IOS__/g, !!webpack_env.ios]
20+
],
21+
typescript: {
22+
compilerOptions: {
23+
verbatimModuleSyntax: true,
24+
target: 'es2020'
25+
}
26+
}
27+
}),
28+
// if you want bind:text="{email}" to be transformed to text="{email}" on:textChanged="{e => email = e.value}"
29+
// enable svelteNativePreprocessor. Keep in mind that it is pretty slow
30+
/* svelteNativePreprocessor() */ ]
931
}

packages/template-blank-svelte/app/app.css

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
@import '@nativescript/theme/css/core.css';
2-
@import '@nativescript/theme/css/default.css';
3-
1+

42
.fab {
53
font-family: 'Font Awesome 5 Brands', 'fa-brands-400';
64
font-weight: 400;

packages/template-blank-svelte/package.json

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,16 @@
4242
"url": "https://github.com/NativeScript/NativeScript/issues"
4343
},
4444
"dependencies": {
45-
"@nativescript/core": "~8.9.0",
46-
"@nativescript/theme": "^3.1.0",
47-
"@nativescript-community/svelte-native": "~1.0.29"
45+
"@nativescript-community/svelte-native": "~1.0.29",
46+
"@nativescript/core": "8.9.7"
4847
},
4948
"devDependencies": {
50-
"@nativescript/types": "~8.9.0",
51-
"@nativescript/webpack": "~5.0.0",
52-
"svelte": "~4.2.2",
53-
"svelte-loader": "^3.1.9",
54-
"svelte-native-preprocessor": "^1.0.0",
55-
"svelte-preprocess": "^5.0.4",
56-
"typescript": "~5.7.0"
49+
"@nativescript-community/svelte-native-preprocessor": "^1.0.1",
50+
"@nativescript/types": "~8.9.1",
51+
"@nativescript/webpack": "~5.0.24",
52+
"svelte": "~4.2.20",
53+
"svelte-loader": "^3.2.4",
54+
"svelte-preprocess": "^6.0.3",
55+
"typescript": "~5.9.2"
5756
}
5857
}
Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,31 @@
11
const sveltePreprocess = require('svelte-preprocess')
2-
const svelteNativePreprocessor = require('svelte-native-preprocessor')
2+
const svelteNativePreprocessor = require('@nativescript-community/svelte-native-preprocessor')
33

4+
// this can be called either through svelte-loader where we want either __ANDROID__ or __IOS__ to be defined but not both
5+
// or through svelte-check where we want both so everything is checked
6+
const webpack_env = process.env['NATIVESCRIPT_WEBPACK_ENV']
7+
? JSON.parse(process.env['NATIVESCRIPT_WEBPACK_ENV'])
8+
: {
9+
android: true,
10+
ios: true
11+
};
412
module.exports = {
513
compilerOptions: {
614
namespace: "foreign"
715
},
8-
preprocess: [ sveltePreprocess(), svelteNativePreprocessor() ]
16+
preprocess: [ sveltePreprocess({
17+
replace: [
18+
[/__ANDROID__/g, !!webpack_env.android],
19+
[/__IOS__/g, !!webpack_env.ios]
20+
],
21+
typescript: {
22+
compilerOptions: {
23+
verbatimModuleSyntax: true,
24+
target: 'es2020'
25+
}
26+
}
27+
}),
28+
// if you want bind:text="{email}" to be transformed to text="{email}" on:textChanged="{e => email = e.value}"
29+
// enable svelteNativePreprocessor. Keep in mind that it is pretty slow
30+
/* svelteNativePreprocessor() */ ]
931
}

0 commit comments

Comments
 (0)