From 951d0141041f478610fdf57c6d8e3c55b0b4ec94 Mon Sep 17 00:00:00 2001 From: Martin Guillon Date: Thu, 25 Sep 2025 09:12:52 +0200 Subject: [PATCH 1/2] chore: svelte update and remove @nativescript/theme --- packages/template-blank-svelte/app/app.css | 4 +-- packages/template-blank-svelte/package.json | 20 +++++++------- .../template-blank-svelte/svelte.config.js | 26 +++++++++++++++++-- 3 files changed, 35 insertions(+), 15 deletions(-) diff --git a/packages/template-blank-svelte/app/app.css b/packages/template-blank-svelte/app/app.css index 51a9df5f..681b8e88 100644 --- a/packages/template-blank-svelte/app/app.css +++ b/packages/template-blank-svelte/app/app.css @@ -1,6 +1,4 @@ -@import '@nativescript/theme/css/core.css'; -@import '@nativescript/theme/css/default.css'; - + .fab { font-family: 'Font Awesome 5 Brands', 'fa-brands-400'; font-weight: 400; diff --git a/packages/template-blank-svelte/package.json b/packages/template-blank-svelte/package.json index 7acf819f..7ddea1d4 100644 --- a/packages/template-blank-svelte/package.json +++ b/packages/template-blank-svelte/package.json @@ -42,17 +42,17 @@ "url": "https://github.com/NativeScript/NativeScript/issues" }, "dependencies": { - "@nativescript/core": "~8.9.0", - "@nativescript/theme": "^3.1.0", - "@nativescript-community/svelte-native": "~1.0.29" + "@nativescript-community/svelte-native": "~1.0.29", + "@nativescript/core": "8.9.7" }, "devDependencies": { - "@nativescript/types": "~8.9.0", - "@nativescript/webpack": "~5.0.0", - "svelte": "~4.2.2", - "svelte-loader": "^3.1.9", - "svelte-native-preprocessor": "^1.0.0", - "svelte-preprocess": "^5.0.4", - "typescript": "~5.7.0" + "@nativescript-community/svelte-native-preprocessor": "^1.0.1", + "@nativescript/ios": "8.9.1", + "@nativescript/types": "~8.9.1", + "@nativescript/webpack": "~5.0.24", + "svelte": "~4.2.20", + "svelte-loader": "^3.2.4", + "svelte-preprocess": "^6.0.3", + "typescript": "~5.9.2" } } diff --git a/packages/template-blank-svelte/svelte.config.js b/packages/template-blank-svelte/svelte.config.js index f6f3764c..240e0f3e 100644 --- a/packages/template-blank-svelte/svelte.config.js +++ b/packages/template-blank-svelte/svelte.config.js @@ -1,9 +1,31 @@ const sveltePreprocess = require('svelte-preprocess') -const svelteNativePreprocessor = require('svelte-native-preprocessor') +const svelteNativePreprocessor = require('@nativescript-community/svelte-native-preprocessor') +// this can be called either through svelte-loader where we want either __ANDROID__ or __IOS__ to be defined but not both +// or through svelte-check where we want both so everything is checked +const webpack_env = process.env['NATIVESCRIPT_WEBPACK_ENV'] + ? JSON.parse(process.env['NATIVESCRIPT_WEBPACK_ENV']) + : { + android: true, + ios: true + }; module.exports = { compilerOptions: { namespace: "foreign" }, - preprocess: [ sveltePreprocess(), svelteNativePreprocessor() ] + preprocess: [ sveltePreprocess({ + replace: [ + [/__ANDROID__/g, !!webpack_env.android], + [/__IOS__/g, !!webpack_env.ios] + ], + typescript: { + compilerOptions: { + verbatimModuleSyntax: true, + target: 'es2020' + } + } + }), + // if you want bind:text="{email}" to be transformed to text="{email}" on:textChanged="{e => email = e.value}" + // enable svelteNativePreprocessor. Keep in mind that it is pretty slow + /* svelteNativePreprocessor() */ ] } \ No newline at end of file From 4b075c9aac0512bc5ed35fb218c902459db77dbf Mon Sep 17 00:00:00 2001 From: farfromrefug Date: Thu, 25 Sep 2025 10:38:43 +0200 Subject: [PATCH 2/2] chore: updated svelte in vision template --- .../template-blank-svelte-vision/package.json | 18 ++++++------- .../svelte.config.js | 26 +++++++++++++++++-- packages/template-blank-svelte/package.json | 1 - 3 files changed, 33 insertions(+), 12 deletions(-) diff --git a/packages/template-blank-svelte-vision/package.json b/packages/template-blank-svelte-vision/package.json index 0cae8f15..83bc74b0 100644 --- a/packages/template-blank-svelte-vision/package.json +++ b/packages/template-blank-svelte-vision/package.json @@ -39,16 +39,16 @@ "url": "https://github.com/NativeScript/NativeScript/issues" }, "dependencies": { - "@nativescript/core": "~8.9.0", - "@nativescript-community/svelte-native": "~1.0.29" + "@nativescript-community/svelte-native": "~1.0.29", + "@nativescript/core": "~8.9.9" }, "devDependencies": { - "@nativescript/types": "~8.9.0", - "@nativescript/webpack": "~5.0.0", - "svelte": "~4.2.2", - "svelte-loader": "^3.2.0", - "svelte-native-preprocessor": "^1.0.0", - "svelte-preprocess": "^5.1.3", - "typescript": "~5.7.0" + "@nativescript-community/svelte-native-preprocessor": "^1.0.1", + "@nativescript/types": "~8.9.1", + "@nativescript/webpack": "~5.0.24", + "svelte": "~4.2.20", + "svelte-loader": "^3.2.4", + "svelte-preprocess": "^6.0.3", + "typescript": "~5.9.2" } } diff --git a/packages/template-blank-svelte-vision/svelte.config.js b/packages/template-blank-svelte-vision/svelte.config.js index f6f3764c..240e0f3e 100644 --- a/packages/template-blank-svelte-vision/svelte.config.js +++ b/packages/template-blank-svelte-vision/svelte.config.js @@ -1,9 +1,31 @@ const sveltePreprocess = require('svelte-preprocess') -const svelteNativePreprocessor = require('svelte-native-preprocessor') +const svelteNativePreprocessor = require('@nativescript-community/svelte-native-preprocessor') +// this can be called either through svelte-loader where we want either __ANDROID__ or __IOS__ to be defined but not both +// or through svelte-check where we want both so everything is checked +const webpack_env = process.env['NATIVESCRIPT_WEBPACK_ENV'] + ? JSON.parse(process.env['NATIVESCRIPT_WEBPACK_ENV']) + : { + android: true, + ios: true + }; module.exports = { compilerOptions: { namespace: "foreign" }, - preprocess: [ sveltePreprocess(), svelteNativePreprocessor() ] + preprocess: [ sveltePreprocess({ + replace: [ + [/__ANDROID__/g, !!webpack_env.android], + [/__IOS__/g, !!webpack_env.ios] + ], + typescript: { + compilerOptions: { + verbatimModuleSyntax: true, + target: 'es2020' + } + } + }), + // if you want bind:text="{email}" to be transformed to text="{email}" on:textChanged="{e => email = e.value}" + // enable svelteNativePreprocessor. Keep in mind that it is pretty slow + /* svelteNativePreprocessor() */ ] } \ No newline at end of file diff --git a/packages/template-blank-svelte/package.json b/packages/template-blank-svelte/package.json index 7ddea1d4..13f61219 100644 --- a/packages/template-blank-svelte/package.json +++ b/packages/template-blank-svelte/package.json @@ -47,7 +47,6 @@ }, "devDependencies": { "@nativescript-community/svelte-native-preprocessor": "^1.0.1", - "@nativescript/ios": "8.9.1", "@nativescript/types": "~8.9.1", "@nativescript/webpack": "~5.0.24", "svelte": "~4.2.20",