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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-nativue",
3
- "version": "0.1.0",
3
+ "version": "0.3.0",
4
4
  "description": "Creates a Nativue app: npm create nativue@latest my-app",
5
5
  "keywords": [
6
6
  "vue",
@@ -1,10 +1,15 @@
1
1
  <resources xmlns:tools="http://schemas.android.com/tools">
2
- <!-- Dark status and navigation bar icons over the app's light screens. The splash screen (Android
3
- 12+) matches the iOS launch screen: the logo, 120dp, on white. -->
4
- <style name="AppTheme" parent="@android:style/Theme.Material.Light.NoActionBar">
5
- <item name="android:windowLightStatusBar">true</item>
6
- <item name="android:windowLightNavigationBar">true</item>
7
- <item name="android:windowSplashScreenBackground" tools:targetApi="31">@android:color/white</item>
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>
@@ -0,0 +1,5 @@
1
+ <resources>
2
+ <style name="AppTheme.Base" parent="@android:style/Theme.Material.NoActionBar" />
3
+ <bool name="light_system_bars">false</bool>
4
+ <color name="splash_background">#0B1220</color>
5
+ </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
- import Nativue
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
- {"colors":[
2
- {"color":{"color-space":"srgb","components":{"red":"1.000","green":"1.000","blue":"1.000","alpha":"1.000"}},"idiom":"universal"},
3
- {"appearances":[{"appearance":"luminosity","value":"dark"}],"color":{"color-space":"srgb","components":{"red":"0.000","green":"0.000","blue":"0.000","alpha":"1.000"}},"idiom":"universal"}
4
- ],"info":{"author":"xcode","version":1}}
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
- {"images":[{"filename":"logo@1x.png","idiom":"universal","scale":"1x"},{"filename":"logo@2x.png","idiom":"universal","scale":"2x"},{"filename":"logo@3x.png","idiom":"universal","scale":"3x"}],"info":{"author":"xcode","version":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 /* Nativue in Frameworks */ = {isa = PBXBuildFile; productRef = AA0000000000000000000012 /* Nativue */; };
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 /* Nativue in Frameworks */,
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 /* Nativue */,
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 "../../../packages/core" */,
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 "../../../packages/core" */ = {
236
+ AA0000000000000000000011 /* XCLocalSwiftPackageReference "NativuePlugins" */ = {
235
237
  isa = XCLocalSwiftPackageReference;
236
- relativePath = "../node_modules/@nativue/core";
238
+ relativePath = NativuePlugins;
237
239
  };
238
240
  /* End XCLocalSwiftPackageReference section */
239
241
 
240
242
  /* Begin XCSwiftPackageProductDependency section */
241
- AA0000000000000000000012 /* Nativue */ = {
243
+ AA0000000000000000000012 /* NativuePlugins */ = {
242
244
  isa = XCSwiftPackageProductDependency;
243
- productName = Nativue;
245
+ productName = NativuePlugins;
244
246
  };
245
247
  /* End XCSwiftPackageProductDependency section */
246
248
  };
@@ -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
+ )
@@ -0,0 +1,4 @@
1
+ // Generated by nativue from the app's packages (packages/core/cli/link.mjs): rewritten on every build.
2
+ @_exported import Nativue
3
+
4
+ public let nativuePlugins: [NativuePlugin] = []
@@ -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
- const styles = StyleSheet.create({
8
- screen: {
9
- flex: 1,
10
- justifyContent: 'center',
11
- alignItems: 'center',
12
- gap: 16,
13
- padding: 32,
14
- backgroundColor: '#ffffff',
15
- },
16
- logo: { width: 96, height: 96, marginBottom: 8 },
17
- title: { fontSize: 28, fontWeight: '800', color: '#0b1220' },
18
- hint: { fontSize: 16, textAlign: 'center', color: '#64748b' },
19
- button: {
20
- marginTop: 16,
21
- paddingHorizontal: 24,
22
- paddingVertical: 14,
23
- borderRadius: 14,
24
- backgroundColor: '#0e9f84',
25
- },
26
- buttonPressed: { opacity: 0.85 },
27
- buttonText: { fontSize: 17, fontWeight: '600', color: '#ffffff' },
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 :source="logo" resize-mode="contain" :style="styles.logo" />
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++">
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "extends": "@nativue/core/tsconfig.base.json",
3
- "include": ["src"]
3
+ "include": ["src", "nativue.config.ts"]
4
4
  }