@nativescript/template-blank-solid 8.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/.editorconfig +19 -0
  2. package/App_Resources/Android/app.gradle +25 -0
  3. package/App_Resources/Android/before-plugins.gradle +15 -0
  4. package/App_Resources/Android/src/main/AndroidManifest.xml +42 -0
  5. package/App_Resources/Android/src/main/res/drawable/ic_launcher_foreground.xml +15 -0
  6. package/App_Resources/Android/src/main/res/drawable-hdpi/background.png +0 -0
  7. package/App_Resources/Android/src/main/res/drawable-hdpi/logo.png +0 -0
  8. package/App_Resources/Android/src/main/res/drawable-ldpi/background.png +0 -0
  9. package/App_Resources/Android/src/main/res/drawable-ldpi/logo.png +0 -0
  10. package/App_Resources/Android/src/main/res/drawable-mdpi/background.png +0 -0
  11. package/App_Resources/Android/src/main/res/drawable-mdpi/logo.png +0 -0
  12. package/App_Resources/Android/src/main/res/drawable-nodpi/splash_screen.xml +8 -0
  13. package/App_Resources/Android/src/main/res/drawable-xhdpi/background.png +0 -0
  14. package/App_Resources/Android/src/main/res/drawable-xhdpi/logo.png +0 -0
  15. package/App_Resources/Android/src/main/res/drawable-xxhdpi/background.png +0 -0
  16. package/App_Resources/Android/src/main/res/drawable-xxhdpi/logo.png +0 -0
  17. package/App_Resources/Android/src/main/res/drawable-xxxhdpi/background.png +0 -0
  18. package/App_Resources/Android/src/main/res/drawable-xxxhdpi/logo.png +0 -0
  19. package/App_Resources/Android/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +5 -0
  20. package/App_Resources/Android/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  21. package/App_Resources/Android/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  22. package/App_Resources/Android/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  23. package/App_Resources/Android/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  24. package/App_Resources/Android/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  25. package/App_Resources/Android/src/main/res/values/colors.xml +14 -0
  26. package/App_Resources/Android/src/main/res/values/ic_launcher_background.xml +4 -0
  27. package/App_Resources/Android/src/main/res/values/styles.xml +42 -0
  28. package/App_Resources/Android/src/main/res/values-v21/colors.xml +5 -0
  29. package/App_Resources/Android/src/main/res/values-v21/styles.xml +34 -0
  30. package/App_Resources/Android/src/main/res/values-v29/styles.xml +18 -0
  31. package/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json +14 -0
  32. package/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-1024.png +0 -0
  33. package/App_Resources/iOS/Assets.xcassets/Contents.json +6 -0
  34. package/App_Resources/iOS/Info.plist +47 -0
  35. package/App_Resources/iOS/LaunchScreen.storyboard +30 -0
  36. package/App_Resources/iOS/build.xcconfig +6 -0
  37. package/README.md +34 -0
  38. package/hooks/after-createProject/after-createProject.js +65 -0
  39. package/package.json +60 -0
  40. package/src/app.css +8 -0
  41. package/src/app.js +11 -0
  42. package/src/app.jsx +34 -0
  43. package/src/component.jsx +13 -0
  44. package/tailwind.config.js +14 -0
  45. package/tools/dot.gitignore +28 -0
  46. package/tools/vscode.extensions.json +3 -0
  47. package/webpack.config.js +7 -0
package/.editorconfig ADDED
@@ -0,0 +1,19 @@
1
+ root = true
2
+
3
+ [*]
4
+ end_of_line = lf
5
+ insert_final_newline = true
6
+ trim_trailing_whitespace = true
7
+ charset = utf-8
8
+
9
+ [*.json]
10
+ indent_style = space
11
+ indent_size = 2
12
+
13
+ [*.js]
14
+ indent_style = space
15
+ indent_size = 2
16
+
17
+ [*.ts]
18
+ indent_style = space
19
+ indent_size = 2
@@ -0,0 +1,25 @@
1
+ // You can add your native dependencies here
2
+ dependencies {
3
+ // implementation 'androidx.multidex:multidex:2.0.1'
4
+ }
5
+
6
+ android {
7
+ compileSdkVersion 34
8
+ buildToolsVersion "34"
9
+ // ndkVersion ""
10
+
11
+ defaultConfig {
12
+ minSdkVersion 23
13
+ targetSdkVersion 34
14
+
15
+ // Version Information
16
+ versionCode 1
17
+ versionName "1.0.0"
18
+
19
+ generatedDensities = []
20
+ }
21
+
22
+ aaptOptions {
23
+ additionalParameters "--no-version-vectors"
24
+ }
25
+ }
@@ -0,0 +1,15 @@
1
+ // this configurations is loaded before building plugins, as well as before building
2
+ // the app - this is where you can apply global settings and overrides
3
+
4
+ project.ext {
5
+ // androidXAppCompat = "1.4.1"
6
+ // androidXExifInterface = "1.3.3"
7
+ // androidXFragment = "1.4.1"
8
+ // androidXMaterial = "1.5.0"
9
+ // androidXMultidex = "2.0.1"
10
+ // androidXTransition = "1.4.1"
11
+ // androidXViewPager = "1.0.0"
12
+
13
+ // useKotlin = true
14
+ // kotlinVersion = "1.6.0"
15
+ }
@@ -0,0 +1,42 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
+ package="__PACKAGE__">
4
+
5
+ <supports-screens
6
+ android:smallScreens="true"
7
+ android:normalScreens="true"
8
+ android:largeScreens="true"
9
+ android:xlargeScreens="true"/>
10
+
11
+ <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
12
+ <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
13
+ <uses-permission android:name="android.permission.INTERNET"/>
14
+ <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
15
+
16
+ <application
17
+ android:name="com.tns.NativeScriptApplication"
18
+ android:allowBackup="true"
19
+ android:icon="@mipmap/ic_launcher"
20
+ android:label="@string/app_name"
21
+ android:theme="@style/AppTheme"
22
+ android:hardwareAccelerated="true">
23
+
24
+ <activity
25
+ android:name="com.tns.NativeScriptActivity"
26
+ android:label="@string/title_activity_kimera"
27
+ android:configChanges="keyboard|keyboardHidden|orientation|screenSize|smallestScreenSize|screenLayout|locale|uiMode"
28
+ android:theme="@style/LaunchScreenTheme"
29
+ android:hardwareAccelerated="true"
30
+ android:launchMode="singleTask"
31
+ android:exported="true">
32
+
33
+ <meta-data android:name="SET_THEME_ON_LAUNCH" android:resource="@style/AppTheme" />
34
+
35
+ <intent-filter>
36
+ <action android:name="android.intent.action.MAIN" />
37
+ <category android:name="android.intent.category.LAUNCHER" />
38
+ </intent-filter>
39
+ </activity>
40
+ <activity android:name="com.tns.ErrorReportActivity"/>
41
+ </application>
42
+ </manifest>
@@ -0,0 +1,15 @@
1
+ <vector xmlns:android="http://schemas.android.com/apk/res/android"
2
+ android:width="108dp"
3
+ android:height="108dp"
4
+ android:viewportWidth="108"
5
+ android:viewportHeight="108">
6
+ <group android:scaleX="0.07382812"
7
+ android:scaleY="0.07382812"
8
+ android:translateX="16.2"
9
+ android:translateY="16.2">
10
+ <path
11
+ android:pathData="M843,511.86L843,512.96C843,513.22 842.8,513.43 842.55,513.46C809.18,516.58 783.07,543.69 783.07,577.86L783.07,714.8C783.07,724.37 781.06,733.6 777.43,742.03C767.08,766.1 743.59,783.6 716.27,783.6L647.07,783.6L646.59,783L377.41,445.68L377.41,783.6L307.73,783.6C270.84,783.6 240.93,753.7 240.93,716.8L240.93,577.86C240.93,543.69 214.82,516.58 181.45,513.46C181.2,513.43 181,513.22 181,512.96L181,511.86C181,511.61 181.19,511.4 181.45,511.37C214.69,508.14 240.67,480.35 240.67,446.26L240.67,307.2C240.67,297.91 242.57,289.05 246,281.01C256.18,257.14 279.87,240.39 307.47,240.39L377.13,240.39L377.41,240.74L646.59,578.07L646.59,240.39L716.53,240.39C753.42,240.39 783.33,270.3 783.33,307.2L783.33,446.26C783.33,480.35 809.31,508.14 842.55,511.37C842.81,511.4 843,511.61 843,511.86"
12
+ android:fillColor="#65ADF1"
13
+ android:fillType="nonZero"/>
14
+ </group>
15
+ </vector>
@@ -0,0 +1,8 @@
1
+ <layer-list xmlns:android="http://schemas.android.com/apk/res/android" android:gravity="fill">
2
+ <item>
3
+ <bitmap android:gravity="fill" android:src="@drawable/background" />
4
+ </item>
5
+ <item>
6
+ <bitmap android:gravity="center" android:src="@drawable/logo" />
7
+ </item>
8
+ </layer-list>
@@ -0,0 +1,5 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
3
+ <background android:drawable="@color/ic_launcher_background"/>
4
+ <foreground android:drawable="@drawable/ic_launcher_foreground"/>
5
+ </adaptive-icon>
@@ -0,0 +1,14 @@
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <resources>
3
+ <!-- The default color of the ActionBar -->
4
+ <color name="ns_primary">#F5F5F5</color>
5
+
6
+ <!-- (API21+) The color of the status bar and contextual app bars; this is normally a dark version of colorPrimary. -->
7
+ <color name="ns_primaryDark">#757575</color>
8
+
9
+ <!-- The color of UI controls such as check boxes, radio buttons, and edit text boxes. -->
10
+ <color name="ns_accent">#65ADF1</color>
11
+
12
+ <!-- this is unused in the default themes, so we might want to remove it? -->
13
+ <!-- <color name="ns_blue">#272734</color> -->
14
+ </resources>
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <resources>
3
+ <color name="ic_launcher_background">#FFFFFF</color>
4
+ </resources>
@@ -0,0 +1,42 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <resources xmlns:android="http://schemas.android.com/apk/res/android">
3
+
4
+ <!-- theme to use FOR launch screen-->
5
+ <style name="LaunchScreenThemeBase" parent="Theme.AppCompat.Light.NoActionBar">
6
+ <item name="toolbarStyle">@style/NativeScriptToolbarStyle</item>
7
+
8
+ <item name="colorPrimary">@color/ns_primary</item>
9
+ <item name="colorPrimaryDark">@color/ns_primaryDark</item>
10
+ <item name="colorAccent">@color/ns_accent</item>
11
+
12
+ <item name="android:windowBackground">@drawable/splash_screen</item>
13
+
14
+ <item name="android:windowActionBarOverlay">true</item>
15
+ <item name="android:windowTranslucentStatus">true</item>
16
+ </style>
17
+
18
+ <style name="LaunchScreenTheme" parent="LaunchScreenThemeBase">
19
+ </style>
20
+
21
+ <!-- theme to use AFTER launch screen is loaded-->
22
+ <style name="AppThemeBase" parent="Theme.AppCompat.Light.NoActionBar">
23
+ <item name="toolbarStyle">@style/NativeScriptToolbarStyle</item>
24
+
25
+ <item name="colorPrimary">@color/ns_primary</item>
26
+ <item name="colorPrimaryDark">@color/ns_primaryDark</item>
27
+ <item name="colorAccent">@color/ns_accent</item>
28
+ </style>
29
+
30
+ <style name="AppTheme" parent="AppThemeBase">
31
+ </style>
32
+
33
+ <!-- theme for action-bar -->
34
+ <style name="NativeScriptToolbarStyleBase" parent="Widget.AppCompat.Toolbar">
35
+ <item name="android:background">@color/ns_primary</item>
36
+ <item name="theme">@style/ThemeOverlay.AppCompat.ActionBar</item>
37
+ <item name="popupTheme">@style/ThemeOverlay.AppCompat</item>
38
+ </style>
39
+
40
+ <style name="NativeScriptToolbarStyle" parent="NativeScriptToolbarStyleBase">
41
+ </style>
42
+ </resources>
@@ -0,0 +1,5 @@
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <resources>
3
+ <!-- You can override base colors from values/colors.xml here, for example: -->
4
+ <!-- <color name="ns_accent">#65ADF1</color> -->
5
+ </resources>
@@ -0,0 +1,34 @@
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <resources xmlns:android="http://schemas.android.com/apk/res/android">
3
+
4
+ <!-- Application theme -->
5
+ <style name="AppThemeBase21" parent="AppThemeBase">
6
+ <!-- Uncomment this to make the app show underneat the status bar -->
7
+ <!-- <item name="android:windowTranslucentStatus">true</item> -->
8
+
9
+ <item name="android:datePickerStyle">@style/SpinnerDatePicker</item>
10
+ <item name="android:timePickerStyle">@style/SpinnerTimePicker</item>
11
+ </style>
12
+
13
+ <style name="AppTheme" parent="AppThemeBase21">
14
+ </style>
15
+
16
+ <!-- Default style for DatePicker - in spinner mode -->
17
+ <style name="SpinnerDatePicker" parent="android:Widget.Material.Light.DatePicker">
18
+ <!-- set the default mode for the date picker (supported values: spinner, calendar) -->
19
+ <item name="android:datePickerMode">spinner</item>
20
+ </style>
21
+
22
+ <!-- Default style for TimePicker - in spinner mode -->
23
+ <style name="SpinnerTimePicker" parent="android:Widget.Material.Light.TimePicker">
24
+ <!-- set the default mode for the time picker (supported values: spinner, clock) -->
25
+ <item name="android:timePickerMode">spinner</item>
26
+ </style>
27
+
28
+ <style name="NativeScriptToolbarStyle" parent="NativeScriptToolbarStyleBase">
29
+ <item name="android:elevation">4dp</item>
30
+
31
+ <!-- Add padding to the ActionBar - useful when android:windowTranslucentStatus is set to true -->
32
+ <!-- <item name="android:paddingTop">24dp</item> -->
33
+ </style>
34
+ </resources>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <resources xmlns:android="http://schemas.android.com/apk/res/android">
3
+
4
+ <!-- Application theme -->
5
+ <style name="AppThemeBase29" parent="AppThemeBase21">
6
+
7
+ <!--
8
+ Disable forced dark mode on newer devices.
9
+ Enabling this will make your app appear in dark-mode,
10
+ but the way the app is converted may lead to visual issues
11
+ -->
12
+ <item name="android:forceDarkAllowed">false</item>
13
+ </style>
14
+
15
+ <style name="AppTheme" parent="AppThemeBase29">
16
+ </style>
17
+
18
+ </resources>
@@ -0,0 +1,14 @@
1
+ {
2
+ "images" : [
3
+ {
4
+ "filename" : "icon-1024.png",
5
+ "idiom" : "universal",
6
+ "platform" : "ios",
7
+ "size" : "1024x1024"
8
+ }
9
+ ],
10
+ "info" : {
11
+ "author" : "xcode",
12
+ "version" : 1
13
+ }
14
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "info" : {
3
+ "version" : 1,
4
+ "author" : "xcode"
5
+ }
6
+ }
@@ -0,0 +1,47 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>CFBundleDevelopmentRegion</key>
6
+ <string>en</string>
7
+ <key>CFBundleDisplayName</key>
8
+ <string>${PRODUCT_NAME}</string>
9
+ <key>CFBundleExecutable</key>
10
+ <string>${EXECUTABLE_NAME}</string>
11
+ <key>CFBundleInfoDictionaryVersion</key>
12
+ <string>6.0</string>
13
+ <key>CFBundleName</key>
14
+ <string>${PRODUCT_NAME}</string>
15
+ <key>CFBundlePackageType</key>
16
+ <string>APPL</string>
17
+ <key>CFBundleShortVersionString</key>
18
+ <string>1.0</string>
19
+ <key>CFBundleSignature</key>
20
+ <string>????</string>
21
+ <key>CFBundleVersion</key>
22
+ <string>1.0</string>
23
+ <key>LSRequiresIPhoneOS</key>
24
+ <true/>
25
+ <key>UILaunchStoryboardName</key>
26
+ <string>LaunchScreen</string>
27
+ <key>UIRequiresFullScreen</key>
28
+ <true/>
29
+ <key>UIRequiredDeviceCapabilities</key>
30
+ <array>
31
+ <string>armv7</string>
32
+ </array>
33
+ <key>UISupportedInterfaceOrientations</key>
34
+ <array>
35
+ <string>UIInterfaceOrientationPortrait</string>
36
+ <string>UIInterfaceOrientationLandscapeLeft</string>
37
+ <string>UIInterfaceOrientationLandscapeRight</string>
38
+ </array>
39
+ <key>UISupportedInterfaceOrientations~ipad</key>
40
+ <array>
41
+ <string>UIInterfaceOrientationPortrait</string>
42
+ <string>UIInterfaceOrientationPortraitUpsideDown</string>
43
+ <string>UIInterfaceOrientationLandscapeLeft</string>
44
+ <string>UIInterfaceOrientationLandscapeRight</string>
45
+ </array>
46
+ </dict>
47
+ </plist>
@@ -0,0 +1,30 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="20037" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
3
+ <device id="retina5_9" orientation="portrait" appearance="light"/>
4
+ <dependencies>
5
+ <deployment identifier="iOS"/>
6
+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="20020"/>
7
+ <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
8
+ </dependencies>
9
+ <scenes>
10
+ <!--View Controller-->
11
+ <scene sceneID="EHf-IW-A2E">
12
+ <objects>
13
+ <viewController id="01J-lp-oVM" sceneMemberID="viewController">
14
+ <layoutGuides>
15
+ <viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
16
+ <viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
17
+ </layoutGuides>
18
+ <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
19
+ <rect key="frame" x="0.0" y="0.0" width="375" height="812"/>
20
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
21
+
22
+ <color key="backgroundColor" red="1.0" green="1.0" blue="1.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
23
+ </view>
24
+ </viewController>
25
+ <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
26
+ </objects>
27
+ <point key="canvasLocation" x="509.60000000000002" y="237.93103448275863"/>
28
+ </scene>
29
+ </scenes>
30
+ </document>
@@ -0,0 +1,6 @@
1
+ // You can add custom settings here
2
+ // for example you can uncomment the following line to force distribution code signing
3
+ // CODE_SIGN_IDENTITY = iPhone Distribution
4
+ // To build for device with XCode you need to specify your development team.
5
+ // DEVELOPMENT_TEAM = YOUR_TEAM_ID;
6
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
package/README.md ADDED
@@ -0,0 +1,34 @@
1
+ # NativeScript with Solid Blank Template
2
+ App templates help you jump start your native cross-platform apps with built-in UI elements and best practices. Save time writing boilerplate code over and over again when you create new apps.
3
+
4
+ ## Quick Start
5
+ Execute the following command to create an app from this template:
6
+
7
+ ```
8
+ ns create my-blank-solid --template @nativescript/template-blank-solid
9
+ ```
10
+
11
+ > Note: This command will create a new NativeScript app that uses the latest version of this template published to [npm](https://www.npmjs.com/package/@nativescript/template-blank-solid).
12
+
13
+ If you want to create a new app that uses the source of the template from the `main` branch, you can execute the following:
14
+
15
+ ```
16
+ # clone nativescript-app-templates monorepo locally
17
+ git clone git@github.com:NativeScript/nativescript-app-templates.git
18
+
19
+ # create app template from local source (all templates are in the 'packages' subfolder of the monorepo)
20
+ ns create my-blank-solid --template nativescript-app-templates/packages/template-blank-solid
21
+ ```
22
+
23
+ **NB:** Please, have in mind that the main branch may refer to dependencies that are not on NPM yet!
24
+
25
+ ## Get Help
26
+ The NativeScript framework has a vibrant community that can help when you run into problems.
27
+
28
+ Try [joining the NativeScript community Discord](https://nativescript.org/discord). The Discord channel is a great place to get help troubleshooting problems, as well as connect with other NativeScript developers.
29
+
30
+ If you have found an issue with this template, please report the problem in the [NativeScript repository](https://github.com/NativeScript/NativeScript/issues).
31
+
32
+ ## Contributing
33
+
34
+ We love PRs, and accept them gladly. Feel free to propose changes and new ideas. We will review and discuss, so that they can be accepted and better integrated.
@@ -0,0 +1,65 @@
1
+ const fs = require('fs')
2
+ const path = require('path')
3
+ const { execSync } = require('child_process')
4
+
5
+ module.exports = function (hookArgs) {
6
+ const appRootFolder = hookArgs.projectDir
7
+ const toolsDir = path.join(appRootFolder, 'tools')
8
+ const vscodeDir = path.join(appRootFolder, '.vscode')
9
+ const srcGitignore = path.join(toolsDir, 'dot.gitignore')
10
+ const destGitignore = path.join(appRootFolder, '.gitignore')
11
+ const srcVscodeExtensions = path.join(toolsDir, 'vscode.extensions.json')
12
+ const destVscodeExtensions = path.join(vscodeDir, 'extensions.json')
13
+
14
+ try {
15
+ fs.mkdirSync(vscodeDir)
16
+ fs.copyFileSync(srcVscodeExtensions, destVscodeExtensions)
17
+ fs.copyFileSync(srcGitignore, destGitignore)
18
+ initWebpackConfig(appRootFolder)
19
+ } catch (error) {
20
+ console.log(error)
21
+ }
22
+ try {
23
+ deleteFolderSync(toolsDir)
24
+
25
+ const readme = path.join(appRootFolder, 'README.md')
26
+ fs.unlinkSync(readme)
27
+
28
+ deleteFolderSync(__dirname)
29
+ } catch (error) {
30
+ console.log(error)
31
+ }
32
+
33
+ function deleteFolderSync(folderPath) {
34
+ if (fs.statSync(folderPath).isDirectory()) {
35
+ fs.readdirSync(folderPath).forEach((file) => {
36
+ const content = path.join(folderPath, file)
37
+ const contentDirs = fs.statSync(content).isDirectory()
38
+
39
+ if (contentDirs) {
40
+ deleteFolderSync(content)
41
+ } else {
42
+ fs.unlinkSync(content)
43
+ }
44
+ })
45
+
46
+ fs.rmdirSync(folderPath)
47
+ }
48
+ }
49
+
50
+ function initWebpackConfig(appRootFolder) {
51
+ const binPath = path.resolve(
52
+ require
53
+ .resolve('@nativescript/webpack/package.json', {
54
+ paths: [appRootFolder],
55
+ })
56
+ .replace('package.json', 'dist/bin/index.js')
57
+ )
58
+
59
+ // init webpack config
60
+ execSync(`node "${binPath}" init`, {
61
+ cwd: appRootFolder,
62
+ stdio: 'inherit',
63
+ })
64
+ }
65
+ }
package/package.json ADDED
@@ -0,0 +1,60 @@
1
+ {
2
+ "name": "@nativescript/template-blank-solid",
3
+ "main": "src/app.js",
4
+ "version": "8.7.0",
5
+ "description": "Nativescript Starter with Solid",
6
+ "author": "NativeScript Team <oss@nativescript.org>",
7
+ "license": "Apache-2.0",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/NativeScript/nativescript-app-templates"
11
+ },
12
+ "homepage": "https://github.com/NativeScript/nativescript-app-templates",
13
+ "bugs": {
14
+ "url": "https://github.com/NativeScript/NativeScript/issues"
15
+ },
16
+ "publishConfig": {
17
+ "access": "public"
18
+ },
19
+ "files": [
20
+ "src",
21
+ "App_Resources",
22
+ "hooks",
23
+ "tools",
24
+ "!tools/assets",
25
+ "patches",
26
+ "types",
27
+ ".editorconfig",
28
+ ".npmrc",
29
+ "tailwind.config.js",
30
+ "tsconfig.json",
31
+ "webpack.config.js"
32
+ ],
33
+ "keywords": [
34
+ "nativescript",
35
+ "mobile",
36
+ "{N}",
37
+ "solid",
38
+ "solidjs"
39
+ ],
40
+ "scripts": {},
41
+ "dependencies": {
42
+ "@nativescript-community/solid-js": "^0.0.6",
43
+ "@nativescript/core": "~8.7.0",
44
+ "dominative": "^0.1.3",
45
+ "solid-js": "^1.8.16",
46
+ "undom-ng": "^1.1.2"
47
+ },
48
+ "devDependencies": {
49
+ "@babel/core": "^7.24.4",
50
+ "@babel/preset-env": "^7.24.4",
51
+ "@babel/preset-typescript": "^7.24.1",
52
+ "@nativescript/tailwind": "~2.1.0",
53
+ "@nativescript/webpack": "~5.0.0",
54
+ "babel": "^6.23.0",
55
+ "babel-loader": "^9.1.3",
56
+ "babel-preset-solid": "^1.8.8",
57
+ "solid-refresh": "^0.7.5",
58
+ "tailwindcss": "~3.4.3"
59
+ }
60
+ }
package/src/app.css ADDED
@@ -0,0 +1,8 @@
1
+ @tailwind base;
2
+ @tailwind components;
3
+ @tailwind utilities;
4
+
5
+ .h-center {
6
+ /* {N} specific css */
7
+ horizontal-align: center;
8
+ }
package/src/app.js ADDED
@@ -0,0 +1,11 @@
1
+ import { Application } from '@nativescript/core';
2
+ import { render } from '@nativescript-community/solid-js';
3
+
4
+ import { App } from './app.jsx';
5
+
6
+ document.body.actionBarHidden = false;
7
+ render(App, document.body);
8
+
9
+ const create = () => document;
10
+
11
+ Application.run({ create });
package/src/app.jsx ADDED
@@ -0,0 +1,34 @@
1
+ import { createSignal } from 'solid-js';
2
+ import { Component } from './component.jsx';
3
+
4
+ document.body.actionBarHidden = false;
5
+
6
+ const App = () => {
7
+ const [count, setCount] = createSignal(0);
8
+ const increment = () => {
9
+ setCount((c) => c + 1);
10
+ };
11
+ return (
12
+ <>
13
+ <actionbar title="Hello, SolidJS!"></actionbar>
14
+ <stacklayout>
15
+ <label class="text-center text-2xl my-4">
16
+ You have tapped {count()} time{count() === 1 ? '' : 's'}
17
+ </label>
18
+ {
19
+ // use 'on:___' instead of 'on___' for event handlers
20
+ // See https://github.com/SudoMaker/dominative-solid#event-handling for detail
21
+ }
22
+ <button
23
+ class="rounded-full bg-blue-500 text-white text-xl p-2 w-[300]"
24
+ on:tap={increment}
25
+ >
26
+ Tap me!
27
+ </button>
28
+ <Component count={count} />
29
+ </stacklayout>
30
+ </>
31
+ );
32
+ };
33
+
34
+ export { App };
@@ -0,0 +1,13 @@
1
+ export const Component = (props) => {
2
+ const { count } = props;
3
+ return (
4
+ <label
5
+ text={`${count()} tap${count() === 1 ? '' : 's'}`}
6
+ on:tap={() => {
7
+ alert(`You have tapped ${count()} time${count() === 1 ? '' : 's'}`);
8
+ }}
9
+ class="text-center text-2xl my-6 text-green-500"
10
+ />
11
+ );
12
+ };
13
+
@@ -0,0 +1,14 @@
1
+ /** @type {import('tailwindcss').Config} */
2
+ module.exports = {
3
+ content: ['./src/**/*.{css,xml,html,vue,svelte,ts,tsx,jsx}'],
4
+ // use the .ns-dark class to control dark mode (applied by NativeScript) - since 'media' (default) is not supported.
5
+ darkMode: ['class', '.ns-dark'],
6
+ theme: {
7
+ extend: {},
8
+ },
9
+ plugins: [],
10
+ corePlugins: {
11
+ preflight: false, // disables browser-specific resets
12
+ },
13
+ };
14
+
@@ -0,0 +1,28 @@
1
+ # NativeScript
2
+ hooks/
3
+ node_modules/
4
+ platforms/
5
+
6
+ # Logs
7
+ logs
8
+ *.log
9
+ npm-debug.log*
10
+ yarn-debug.log*
11
+ yarn-error.log*
12
+
13
+ # General
14
+ .DS_Store
15
+ .AppleDouble
16
+ .LSOverride
17
+ .idea
18
+ .cloud
19
+ .project
20
+ tmp/
21
+ typings/
22
+
23
+ # Visual Studio Code
24
+ .vscode/*
25
+ !.vscode/settings.json
26
+ !.vscode/tasks.json
27
+ !.vscode/launch.json
28
+ !.vscode/extensions.json
@@ -0,0 +1,3 @@
1
+ {
2
+ "recommendations": ["nativescript.nativescript"]
3
+ }
@@ -0,0 +1,7 @@
1
+ const webpack = require('@nativescript/webpack');
2
+
3
+ module.exports = (env) => {
4
+ webpack.init(env);
5
+
6
+ return webpack.resolveConfig();
7
+ };