create-nativue 0.1.0 → 0.3.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.
- package/package.json +1 -1
- package/template/android/app/src/main/res/drawable-night-xxxhdpi/splash_logo.png +0 -0
- package/template/android/app/src/main/res/values/styles.xml +11 -6
- package/template/android/app/src/main/res/values-night/styles.xml +5 -0
- package/template/android/settings.gradle.kts +2 -0
- package/template/ios/App/App.swift +3 -2
- package/template/ios/App/Assets.xcassets/LaunchBackground.colorset/Contents.json +38 -4
- package/template/ios/App/Assets.xcassets/LaunchLogo.imageset/Contents.json +11 -1
- package/template/ios/App/Assets.xcassets/LaunchLogo.imageset/logo-dark@1x.png +0 -0
- package/template/ios/App/Assets.xcassets/LaunchLogo.imageset/logo-dark@2x.png +0 -0
- package/template/ios/App/Assets.xcassets/LaunchLogo.imageset/logo-dark@3x.png +0 -0
- package/template/ios/App.xcodeproj/project.pbxproj +10 -8
- package/template/ios/Info.plist +0 -2
- package/template/ios/NativuePlugins/Package.swift +13 -0
- package/template/ios/NativuePlugins/Sources/NativuePlugins/Plugins.swift +4 -0
- package/template/src/app/index.vue +40 -23
- package/template/src/assets/logo-dark.png +0 -0
- package/template/tsconfig.json +1 -1
package/package.json
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
<resources xmlns:tools="http://schemas.android.com/tools">
|
|
2
|
-
<!--
|
|
3
|
-
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
<!-- Light or dark with the system: values-night/styles.xml has the dark ones. -->
|
|
3
|
+
<style name="AppTheme.Base" parent="@android:style/Theme.Material.Light.NoActionBar" />
|
|
4
|
+
<bool name="light_system_bars">true</bool>
|
|
5
|
+
<color name="splash_background">#FFFFFF</color>
|
|
6
|
+
|
|
7
|
+
<!-- Status and navigation bar icons that contrast with the screens. The splash screen (Android
|
|
8
|
+
12+) matches the iOS launch screen: the logo, 120dp, on white, or on ink in dark mode. -->
|
|
9
|
+
<style name="AppTheme" parent="AppTheme.Base">
|
|
10
|
+
<item name="android:windowLightStatusBar">@bool/light_system_bars</item>
|
|
11
|
+
<item name="android:windowLightNavigationBar">@bool/light_system_bars</item>
|
|
12
|
+
<item name="android:windowSplashScreenBackground" tools:targetApi="31">@color/splash_background</item>
|
|
8
13
|
<item name="android:windowSplashScreenAnimatedIcon" tools:targetApi="31">@drawable/splash_logo</item>
|
|
9
14
|
</style>
|
|
10
15
|
</resources>
|
|
@@ -17,3 +17,5 @@ rootProject.name = "__DISPLAY_NAME__"
|
|
|
17
17
|
include(":app")
|
|
18
18
|
include(":nativue")
|
|
19
19
|
project(":nativue").projectDir = file("../node_modules/@nativue/core/android")
|
|
20
|
+
// The Android side of the app's packages (see the file)
|
|
21
|
+
apply(from = "../node_modules/@nativue/core/android/nativue.settings.gradle.kts")
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import SwiftUI
|
|
2
|
-
|
|
2
|
+
// NativuePlugins: nativue and the native side of the app's packages (generated by the nativue CLI)
|
|
3
|
+
import NativuePlugins
|
|
3
4
|
|
|
4
5
|
@main
|
|
5
6
|
struct MainApp: App {
|
|
6
7
|
var body: some Scene {
|
|
7
8
|
WindowGroup {
|
|
8
|
-
NativueView()
|
|
9
|
+
NativueView(plugins: nativuePlugins)
|
|
9
10
|
}
|
|
10
11
|
}
|
|
11
12
|
}
|
|
@@ -1,4 +1,38 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
{
|
|
2
|
+
"colors": [
|
|
3
|
+
{
|
|
4
|
+
"color": {
|
|
5
|
+
"color-space": "srgb",
|
|
6
|
+
"components": {
|
|
7
|
+
"red": "1.000",
|
|
8
|
+
"green": "1.000",
|
|
9
|
+
"blue": "1.000",
|
|
10
|
+
"alpha": "1.000"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"idiom": "universal"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"appearances": [
|
|
17
|
+
{
|
|
18
|
+
"appearance": "luminosity",
|
|
19
|
+
"value": "dark"
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"color": {
|
|
23
|
+
"color-space": "srgb",
|
|
24
|
+
"components": {
|
|
25
|
+
"red": "0.043",
|
|
26
|
+
"green": "0.071",
|
|
27
|
+
"blue": "0.125",
|
|
28
|
+
"alpha": "1.000"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"idiom": "universal"
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"info": {
|
|
35
|
+
"author": "xcode",
|
|
36
|
+
"version": 1
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -1 +1,11 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"images" : [
|
|
3
|
+
{ "filename" : "logo@1x.png", "idiom" : "universal", "scale" : "1x" },
|
|
4
|
+
{ "appearances" : [ { "appearance" : "luminosity", "value" : "dark" } ], "filename" : "logo-dark@1x.png", "idiom" : "universal", "scale" : "1x" },
|
|
5
|
+
{ "filename" : "logo@2x.png", "idiom" : "universal", "scale" : "2x" },
|
|
6
|
+
{ "appearances" : [ { "appearance" : "luminosity", "value" : "dark" } ], "filename" : "logo-dark@2x.png", "idiom" : "universal", "scale" : "2x" },
|
|
7
|
+
{ "filename" : "logo@3x.png", "idiom" : "universal", "scale" : "3x" },
|
|
8
|
+
{ "appearances" : [ { "appearance" : "luminosity", "value" : "dark" } ], "filename" : "logo-dark@3x.png", "idiom" : "universal", "scale" : "3x" }
|
|
9
|
+
],
|
|
10
|
+
"info" : { "author" : "xcode", "version" : 1 }
|
|
11
|
+
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
objects = {
|
|
8
8
|
|
|
9
9
|
/* Begin PBXBuildFile section */
|
|
10
|
-
AA0000000000000000000010 /*
|
|
10
|
+
AA0000000000000000000010 /* NativuePlugins in Frameworks */ = {isa = PBXBuildFile; productRef = AA0000000000000000000012 /* NativuePlugins */; };
|
|
11
11
|
/* End PBXBuildFile section */
|
|
12
12
|
|
|
13
13
|
/* Begin PBXFileReference section */
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
isa = PBXFrameworksBuildPhase;
|
|
28
28
|
buildActionMask = 2147483647;
|
|
29
29
|
files = (
|
|
30
|
-
AA0000000000000000000010 /*
|
|
30
|
+
AA0000000000000000000010 /* NativuePlugins in Frameworks */,
|
|
31
31
|
);
|
|
32
32
|
runOnlyForDeploymentPostprocessing = 0;
|
|
33
33
|
};
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
);
|
|
72
72
|
name = App;
|
|
73
73
|
packageProductDependencies = (
|
|
74
|
-
AA0000000000000000000012 /*
|
|
74
|
+
AA0000000000000000000012 /* NativuePlugins */,
|
|
75
75
|
);
|
|
76
76
|
productName = App;
|
|
77
77
|
productReference = AA0000000000000000000001 /* App.app */;
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
mainGroup = AA0000000000000000000004;
|
|
98
98
|
minimizedProjectReferenceProxies = 1;
|
|
99
99
|
packageReferences = (
|
|
100
|
-
AA0000000000000000000011 /* XCLocalSwiftPackageReference "
|
|
100
|
+
AA0000000000000000000011 /* XCLocalSwiftPackageReference "NativuePlugins" */,
|
|
101
101
|
);
|
|
102
102
|
preferredProjectObjectVersion = 77;
|
|
103
103
|
productRefGroup = AA0000000000000000000005 /* Products */;
|
|
@@ -183,6 +183,7 @@
|
|
|
183
183
|
CURRENT_PROJECT_VERSION = 1;
|
|
184
184
|
GENERATE_INFOPLIST_FILE = YES;
|
|
185
185
|
INFOPLIST_FILE = Info.plist;
|
|
186
|
+
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
|
186
187
|
INFOPLIST_KEY_CFBundleDisplayName = "__DISPLAY_NAME__";
|
|
187
188
|
MARKETING_VERSION = 0.1;
|
|
188
189
|
PRODUCT_BUNDLE_IDENTIFIER = __BUNDLE_ID__;
|
|
@@ -199,6 +200,7 @@
|
|
|
199
200
|
CURRENT_PROJECT_VERSION = 1;
|
|
200
201
|
GENERATE_INFOPLIST_FILE = YES;
|
|
201
202
|
INFOPLIST_FILE = Info.plist;
|
|
203
|
+
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
|
202
204
|
INFOPLIST_KEY_CFBundleDisplayName = "__DISPLAY_NAME__";
|
|
203
205
|
MARKETING_VERSION = 0.1;
|
|
204
206
|
PRODUCT_BUNDLE_IDENTIFIER = __BUNDLE_ID__;
|
|
@@ -231,16 +233,16 @@
|
|
|
231
233
|
/* End XCConfigurationList section */
|
|
232
234
|
|
|
233
235
|
/* Begin XCLocalSwiftPackageReference section */
|
|
234
|
-
AA0000000000000000000011 /* XCLocalSwiftPackageReference "
|
|
236
|
+
AA0000000000000000000011 /* XCLocalSwiftPackageReference "NativuePlugins" */ = {
|
|
235
237
|
isa = XCLocalSwiftPackageReference;
|
|
236
|
-
relativePath =
|
|
238
|
+
relativePath = NativuePlugins;
|
|
237
239
|
};
|
|
238
240
|
/* End XCLocalSwiftPackageReference section */
|
|
239
241
|
|
|
240
242
|
/* Begin XCSwiftPackageProductDependency section */
|
|
241
|
-
AA0000000000000000000012 /*
|
|
243
|
+
AA0000000000000000000012 /* NativuePlugins */ = {
|
|
242
244
|
isa = XCSwiftPackageProductDependency;
|
|
243
|
-
productName =
|
|
245
|
+
productName = NativuePlugins;
|
|
244
246
|
};
|
|
245
247
|
/* End XCSwiftPackageProductDependency section */
|
|
246
248
|
};
|
package/template/ios/Info.plist
CHANGED
|
@@ -20,8 +20,6 @@
|
|
|
20
20
|
</dict>
|
|
21
21
|
<key>NSLocalNetworkUsageDescription</key>
|
|
22
22
|
<string>Connects to the Nativue dev server on your Mac for hot reload.</string>
|
|
23
|
-
<key>UIUserInterfaceStyle</key>
|
|
24
|
-
<string>Light</string>
|
|
25
23
|
<key>UILaunchScreen</key>
|
|
26
24
|
<dict>
|
|
27
25
|
<key>UIColorName</key>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// swift-tools-version: 5.9
|
|
2
|
+
// Generated by nativue from the app's packages (packages/core/cli/link.mjs): rewritten on every build.
|
|
3
|
+
import PackageDescription
|
|
4
|
+
|
|
5
|
+
let package = Package(
|
|
6
|
+
name: "NativuePlugins",
|
|
7
|
+
platforms: [.iOS(.v17)],
|
|
8
|
+
products: [.library(name: "NativuePlugins", targets: ["NativuePlugins"])],
|
|
9
|
+
dependencies: [.package(path: "../../node_modules/@nativue/core")],
|
|
10
|
+
targets: [
|
|
11
|
+
.target(name: "NativuePlugins", dependencies: [.product(name: "Nativue", package: "core")], path: "Sources/NativuePlugins"),
|
|
12
|
+
]
|
|
13
|
+
)
|
|
@@ -1,36 +1,53 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { ref, StyleSheet } from 'vue'
|
|
2
|
+
import { computed, ref, StyleSheet, useColorScheme } from 'vue'
|
|
3
3
|
import logo from '@/assets/logo.png'
|
|
4
|
+
import logoDark from '@/assets/logo-dark.png'
|
|
5
|
+
|
|
6
|
+
// Light or dark with the system.
|
|
7
|
+
const COLORS = {
|
|
8
|
+
light: { background: '#ffffff', title: '#0b1220', hint: '#64748b' },
|
|
9
|
+
dark: { background: '#0b1220', title: '#f1f5f9', hint: '#94a3b8' },
|
|
10
|
+
}
|
|
4
11
|
|
|
5
12
|
const count = ref(0)
|
|
13
|
+
const colorScheme = useColorScheme()
|
|
14
|
+
|
|
15
|
+
// A computed, so the styles are made again when colorScheme changes.
|
|
16
|
+
const styles = computed(() => {
|
|
17
|
+
const colors = COLORS[colorScheme.value]
|
|
6
18
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
19
|
+
return StyleSheet.create({
|
|
20
|
+
screen: {
|
|
21
|
+
flex: 1,
|
|
22
|
+
justifyContent: 'center',
|
|
23
|
+
alignItems: 'center',
|
|
24
|
+
gap: 16,
|
|
25
|
+
padding: 32,
|
|
26
|
+
backgroundColor: colors.background,
|
|
27
|
+
},
|
|
28
|
+
logo: { width: 96, height: 96, marginBottom: 8 },
|
|
29
|
+
title: { fontSize: 28, fontWeight: '800', color: colors.title },
|
|
30
|
+
hint: { fontSize: 16, textAlign: 'center', color: colors.hint },
|
|
31
|
+
button: {
|
|
32
|
+
marginTop: 16,
|
|
33
|
+
paddingHorizontal: 24,
|
|
34
|
+
paddingVertical: 14,
|
|
35
|
+
borderRadius: 14,
|
|
36
|
+
backgroundColor: '#0e9f84',
|
|
37
|
+
},
|
|
38
|
+
buttonPressed: { opacity: 0.85 },
|
|
39
|
+
buttonText: { fontSize: 17, fontWeight: '600', color: '#ffffff' },
|
|
40
|
+
})
|
|
28
41
|
})
|
|
29
42
|
</script>
|
|
30
43
|
|
|
31
44
|
<template>
|
|
32
45
|
<View :style="styles.screen">
|
|
33
|
-
<Image
|
|
46
|
+
<Image
|
|
47
|
+
:source="colorScheme === 'dark' ? logoDark : logo"
|
|
48
|
+
resize-mode="contain"
|
|
49
|
+
:style="styles.logo"
|
|
50
|
+
/>
|
|
34
51
|
<Text :style="styles.title">Welcome to Nativue</Text>
|
|
35
52
|
<Text :style="styles.hint">Edit src/app/index.vue and save to see it here.</Text>
|
|
36
53
|
<Pressable :style="styles.button" :pressed-style="styles.buttonPressed" @press="count++">
|
|
Binary file
|
package/template/tsconfig.json
CHANGED