create-nativue 0.0.0-stage → 0.2.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 (40) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +9 -2
  3. package/index.mjs +107 -0
  4. package/package.json +27 -4
  5. package/template/android/app/build.gradle.kts +25 -0
  6. package/template/android/app/src/debug/AndroidManifest.xml +4 -0
  7. package/template/android/app/src/main/AndroidManifest.xml +26 -0
  8. package/template/android/app/src/main/java/MainActivity.kt +5 -0
  9. package/template/android/app/src/main/res/drawable-xxxhdpi/splash_logo.png +0 -0
  10. package/template/android/app/src/main/res/mipmap-anydpi/ic_launcher.xml +6 -0
  11. package/template/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png +0 -0
  12. package/template/android/app/src/main/res/values/colors.xml +4 -0
  13. package/template/android/app/src/main/res/values/strings.xml +3 -0
  14. package/template/android/app/src/main/res/values/styles.xml +10 -0
  15. package/template/android/build.gradle.kts +4 -0
  16. package/template/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  17. package/template/android/gradle/wrapper/gradle-wrapper.properties +9 -0
  18. package/template/android/gradle.properties +1 -0
  19. package/template/android/gradlew +248 -0
  20. package/template/android/gradlew.bat +112 -0
  21. package/template/android/settings.gradle.kts +19 -0
  22. package/template/gitignore +12 -0
  23. package/template/ios/App/App.swift +11 -0
  24. package/template/ios/App/Assets.xcassets/AppIcon.appiconset/Contents.json +1 -0
  25. package/template/ios/App/Assets.xcassets/AppIcon.appiconset/icon.png +0 -0
  26. package/template/ios/App/Assets.xcassets/Contents.json +1 -0
  27. package/template/ios/App/Assets.xcassets/LaunchBackground.colorset/Contents.json +4 -0
  28. package/template/ios/App/Assets.xcassets/LaunchLogo.imageset/Contents.json +1 -0
  29. package/template/ios/App/Assets.xcassets/LaunchLogo.imageset/logo@1x.png +0 -0
  30. package/template/ios/App/Assets.xcassets/LaunchLogo.imageset/logo@2x.png +0 -0
  31. package/template/ios/App/Assets.xcassets/LaunchLogo.imageset/logo@3x.png +0 -0
  32. package/template/ios/App.xcodeproj/project.pbxproj +250 -0
  33. package/template/ios/App.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +15 -0
  34. package/template/ios/Info.plist +33 -0
  35. package/template/package.json +19 -0
  36. package/template/src/app/_layout.vue +7 -0
  37. package/template/src/app/index.vue +40 -0
  38. package/template/src/assets/logo.png +0 -0
  39. package/template/src/env.d.ts +5 -0
  40. package/template/tsconfig.json +4 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 nativue contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,10 @@
1
- # Temporary Holding Version
1
+ # create-nativue
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Creates a [nativue](https://github.com/nativue/nativue) app, with its iOS and Android projects:
4
+
5
+ ```sh
6
+ npm create nativue@latest my-app # add -- --bundle-id com.company.myapp to set it now
7
+ cd my-app
8
+ npm install
9
+ npm run ios # or npm run android
10
+ ```
package/index.mjs ADDED
@@ -0,0 +1,107 @@
1
+ #!/usr/bin/env node
2
+ // npm create nativue@latest my-app [-- --bundle-id com.company.myapp]
3
+ // Copies template/ into a new folder and fills in the app's names.
4
+ import { cpSync, existsSync, readdirSync, readFileSync, renameSync, writeFileSync } from 'node:fs'
5
+ import { basename, join, relative, resolve } from 'node:path'
6
+ import { createInterface } from 'node:readline/promises'
7
+ import { fileURLToPath } from 'node:url'
8
+ import { parseArgs } from 'node:util'
9
+
10
+ const TEMPLATE_DIRECTORY = fileURLToPath(new URL('./template', import.meta.url))
11
+ const TEXT_FILE = /(\.(json|vue|ts|plist|pbxproj|resolved|swift|kt|kts|xml)|gitignore)$/
12
+ const BUNDLE_ID = /^[a-zA-Z][a-zA-Z0-9-]*(\.[a-zA-Z][a-zA-Z0-9-]*)+$/
13
+ const { version } = JSON.parse(readFileSync(new URL('./package.json', import.meta.url), 'utf8'))
14
+
15
+ async function askProjectName() {
16
+ const prompt = createInterface({ input: process.stdin, output: process.stdout })
17
+ const answer = await prompt.question('Project name: (my-app) ')
18
+ prompt.close()
19
+
20
+ return answer.trim() || 'my-app'
21
+ }
22
+
23
+ // "My.Cool_App" -> "my-cool_app"
24
+ function slugify(name) {
25
+ return name
26
+ .toLowerCase()
27
+ .replace(/[^a-z0-9_]+/g, '-')
28
+ .replace(/^[-_]+|[-_]+$/g, '')
29
+ }
30
+
31
+ // "my-cool_app" -> "My Cool App"
32
+ function displayNameOf(slug) {
33
+ return slug
34
+ .split(/[-_]+/)
35
+ .map((word) => word[0].toUpperCase() + word.slice(1))
36
+ .join(' ')
37
+ }
38
+
39
+ function filesIn(directory) {
40
+ return readdirSync(directory, { recursive: true, withFileTypes: true })
41
+ .filter((entry) => entry.isFile())
42
+ .map((entry) => join(entry.parentPath, entry.name))
43
+ }
44
+
45
+ function fail(message) {
46
+ console.error(message)
47
+ process.exit(1)
48
+ }
49
+
50
+ function fillPlaceholders(directory, values) {
51
+ for (const file of filesIn(directory).filter((path) => TEXT_FILE.test(path))) {
52
+ const source = readFileSync(file, 'utf8')
53
+ const filled = Object.entries(values).reduce(
54
+ (text, [placeholder, value]) => text.replaceAll(placeholder, value),
55
+ source,
56
+ )
57
+ if (filled !== source) writeFileSync(file, filled)
58
+ }
59
+ }
60
+
61
+ const { values: options, positionals } = parseArgs({
62
+ allowPositionals: true,
63
+ options: { 'bundle-id': { type: 'string' } },
64
+ })
65
+
66
+ const projectName = positionals[0] ?? (await askProjectName())
67
+ if (/\s/.test(projectName)) {
68
+ fail(`"${projectName}" has spaces: use dashes or underscores instead, e.g. my-app or my_app`)
69
+ }
70
+
71
+ const projectDirectory = resolve(projectName)
72
+ const projectPath = relative(process.cwd(), projectDirectory) || '.'
73
+ const slug = slugify(basename(projectDirectory))
74
+ // Bundle ids and URL schemes allow neither dashes nor underscores here.
75
+ const urlScheme = slug.replace(/[-_]/g, '')
76
+ const bundleId = options['bundle-id'] ?? `com.example.${urlScheme}`
77
+
78
+ if (!slug) fail('The project name needs at least one letter or digit.')
79
+ if (!BUNDLE_ID.test(bundleId)) fail(`"${bundleId}" is not a valid bundle id, e.g. com.company.app`)
80
+ if (existsSync(projectDirectory) && readdirSync(projectDirectory).length > 0) {
81
+ fail(`${projectDirectory} already exists and isn't empty.`)
82
+ }
83
+
84
+ cpSync(TEMPLATE_DIRECTORY, projectDirectory, { recursive: true })
85
+ // npm drops .gitignore files from published packages, so the template ships it without the dot.
86
+ renameSync(join(projectDirectory, 'gitignore'), join(projectDirectory, '.gitignore'))
87
+ fillPlaceholders(projectDirectory, {
88
+ __PACKAGE_NAME__: slug,
89
+ __DISPLAY_NAME__: displayNameOf(slug),
90
+ __BUNDLE_ID__: bundleId,
91
+ __URL_SCHEME__: urlScheme,
92
+ __NATIVUE_VERSION__: `^${version}`,
93
+ })
94
+
95
+ console.log(`
96
+ Created ${displayNameOf(slug)} in ${projectPath}
97
+
98
+ cd ${projectPath}
99
+ npm install
100
+ npm run ios or npm run android: opens the app on a simulator or emulator, then
101
+ keeps running, rebuilding and reloading the app on save
102
+
103
+ On your phone: open ios/App.xcodeproj in Xcode, or the android folder in Android Studio, and
104
+ press Run, with npm run dev running
105
+
106
+ Bundle id: ${bundleId} (set it with --bundle-id, or later in Xcode and android/app/build.gradle.kts)
107
+ `)
package/package.json CHANGED
@@ -1,6 +1,29 @@
1
1
  {
2
2
  "name": "create-nativue",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.2.0",
4
+ "description": "Creates a Nativue app: npm create nativue@latest my-app",
5
+ "keywords": [
6
+ "vue",
7
+ "native",
8
+ "ios",
9
+ "android",
10
+ "create",
11
+ "nativue"
12
+ ],
13
+ "license": "MIT",
14
+ "homepage": "https://github.com/nativue/nativue#readme",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/nativue/nativue.git",
18
+ "directory": "packages/create-nativue"
19
+ },
20
+ "bugs": "https://github.com/nativue/nativue/issues",
21
+ "type": "module",
22
+ "bin": {
23
+ "create-nativue": "index.mjs"
24
+ },
25
+ "files": [
26
+ "index.mjs",
27
+ "template"
28
+ ]
29
+ }
@@ -0,0 +1,25 @@
1
+ plugins {
2
+ id("com.android.application")
3
+ }
4
+
5
+ android {
6
+ namespace = "__BUNDLE_ID__"
7
+ compileSdk = 36
8
+
9
+ defaultConfig {
10
+ applicationId = "__BUNDLE_ID__"
11
+ minSdk = 30
12
+ targetSdk = 36
13
+ versionCode = 1
14
+ versionName = "1.0"
15
+ }
16
+
17
+ compileOptions {
18
+ sourceCompatibility = JavaVersion.VERSION_17
19
+ targetCompatibility = JavaVersion.VERSION_17
20
+ }
21
+ }
22
+
23
+ dependencies {
24
+ implementation(project(":nativue"))
25
+ }
@@ -0,0 +1,4 @@
1
+ <!-- Debug builds load the bundle from the dev server over plain http. -->
2
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android">
3
+ <application android:usesCleartextTraffic="true" />
4
+ </manifest>
@@ -0,0 +1,26 @@
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android">
2
+
3
+ <application
4
+ android:icon="@mipmap/ic_launcher"
5
+ android:label="@string/app_name"
6
+ android:theme="@style/AppTheme">
7
+
8
+ <activity
9
+ android:name=".MainActivity"
10
+ android:configChanges="orientation|screenSize|screenLayout|keyboard|keyboardHidden|uiMode|density"
11
+ android:exported="true"
12
+ android:launchMode="singleTask"
13
+ android:windowSoftInputMode="adjustResize">
14
+ <intent-filter>
15
+ <action android:name="android.intent.action.MAIN" />
16
+ <category android:name="android.intent.category.LAUNCHER" />
17
+ </intent-filter>
18
+ <intent-filter>
19
+ <action android:name="android.intent.action.VIEW" />
20
+ <category android:name="android.intent.category.DEFAULT" />
21
+ <category android:name="android.intent.category.BROWSABLE" />
22
+ <data android:scheme="__URL_SCHEME__" />
23
+ </intent-filter>
24
+ </activity>
25
+ </application>
26
+ </manifest>
@@ -0,0 +1,5 @@
1
+ package __BUNDLE_ID__
2
+
3
+ import dev.nativue.NativueActivity
4
+
5
+ class MainActivity : NativueActivity()
@@ -0,0 +1,6 @@
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="@mipmap/ic_launcher_foreground" />
5
+ <monochrome android:drawable="@mipmap/ic_launcher_foreground" />
6
+ </adaptive-icon>
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <resources>
3
+ <color name="ic_launcher_background">#0B1220</color>
4
+ </resources>
@@ -0,0 +1,3 @@
1
+ <resources>
2
+ <string name="app_name">__DISPLAY_NAME__</string>
3
+ </resources>
@@ -0,0 +1,10 @@
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>
8
+ <item name="android:windowSplashScreenAnimatedIcon" tools:targetApi="31">@drawable/splash_logo</item>
9
+ </style>
10
+ </resources>
@@ -0,0 +1,4 @@
1
+ plugins {
2
+ id("com.android.application") version "9.5.1" apply false
3
+ id("com.android.library") version "9.5.1" apply false
4
+ }
@@ -0,0 +1,9 @@
1
+ distributionBase=GRADLE_USER_HOME
2
+ distributionPath=wrapper/dists
3
+ distributionUrl=https\://services.gradle.org/distributions/gradle-9.9.1-bin.zip
4
+ networkTimeout=10000
5
+ retries=0
6
+ retryBackOffMs=500
7
+ validateDistributionUrl=true
8
+ zipStoreBase=GRADLE_USER_HOME
9
+ zipStorePath=wrapper/dists
@@ -0,0 +1 @@
1
+ org.gradle.jvmargs=-Xmx4g -Dfile.encoding=UTF-8
@@ -0,0 +1,248 @@
1
+ #!/bin/sh
2
+
3
+ #
4
+ # Copyright © 2015 the original authors.
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # https://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+ # SPDX-License-Identifier: Apache-2.0
19
+ #
20
+
21
+ ##############################################################################
22
+ #
23
+ # gradlew start up script for POSIX generated by Gradle.
24
+ #
25
+ # Important for running:
26
+ #
27
+ # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
28
+ # noncompliant, but you have some other compliant shell such as ksh or
29
+ # bash, then to run this script, type that shell name before the whole
30
+ # command line, like:
31
+ #
32
+ # ksh gradlew
33
+ #
34
+ # Busybox and similar reduced shells will NOT work, because this script
35
+ # requires all of these POSIX shell features:
36
+ # * functions;
37
+ # * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
38
+ # «${var#prefix}», «${var%suffix}», and «$( cmd )»;
39
+ # * compound commands having a testable exit status, especially «case»;
40
+ # * various built-in commands including «command», «set», and «ulimit».
41
+ #
42
+ # Important for patching:
43
+ #
44
+ # (2) This script targets any POSIX shell, so it avoids extensions provided
45
+ # by Bash, Ksh, etc; in particular arrays are avoided.
46
+ #
47
+ # The "traditional" practice of packing multiple parameters into a
48
+ # space-separated string is a well documented source of bugs and security
49
+ # problems, so this is (mostly) avoided, by progressively accumulating
50
+ # options in "$@", and eventually passing that to Java.
51
+ #
52
+ # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
53
+ # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
54
+ # see the in-line comments for details.
55
+ #
56
+ # There are tweaks for specific operating systems such as AIX, CygWin,
57
+ # Darwin, MinGW, and NonStop.
58
+ #
59
+ # (3) This script is generated from the Groovy template
60
+ # https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
61
+ # within the Gradle project.
62
+ #
63
+ # You can find Gradle at https://github.com/gradle/gradle/.
64
+ #
65
+ ##############################################################################
66
+
67
+ # Attempt to set APP_HOME
68
+
69
+ # Resolve links: $0 may be a link
70
+ app_path=$0
71
+
72
+ # Need this for daisy-chained symlinks.
73
+ while
74
+ APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
75
+ [ -h "$app_path" ]
76
+ do
77
+ ls=$( ls -ld "$app_path" )
78
+ link=${ls#*' -> '}
79
+ case $link in #(
80
+ /*) app_path=$link ;; #(
81
+ *) app_path=$APP_HOME$link ;;
82
+ esac
83
+ done
84
+
85
+ # This is normally unused
86
+ # shellcheck disable=SC2034
87
+ APP_BASE_NAME=${0##*/}
88
+ # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
89
+ APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
90
+
91
+ # Use the maximum available, or set MAX_FD != -1 to use that value.
92
+ MAX_FD=maximum
93
+
94
+ warn () {
95
+ echo "$*"
96
+ } >&2
97
+
98
+ die () {
99
+ echo
100
+ echo "$*"
101
+ echo
102
+ exit 1
103
+ } >&2
104
+
105
+ # OS specific support (must be 'true' or 'false').
106
+ cygwin=false
107
+ msys=false
108
+ darwin=false
109
+ nonstop=false
110
+ case "$( uname )" in #(
111
+ CYGWIN* ) cygwin=true ;; #(
112
+ Darwin* ) darwin=true ;; #(
113
+ MSYS* | MINGW* ) msys=true ;; #(
114
+ NONSTOP* ) nonstop=true ;;
115
+ esac
116
+
117
+
118
+
119
+ # Determine the Java command to use to start the JVM.
120
+ if [ -n "$JAVA_HOME" ] ; then
121
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
122
+ # IBM's JDK on AIX uses strange locations for the executables
123
+ JAVACMD=$JAVA_HOME/jre/sh/java
124
+ else
125
+ JAVACMD=$JAVA_HOME/bin/java
126
+ fi
127
+ if [ ! -x "$JAVACMD" ] ; then
128
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
129
+
130
+ Please set the JAVA_HOME variable in your environment to match the
131
+ location of your Java installation."
132
+ fi
133
+ else
134
+ JAVACMD=java
135
+ if ! command -v java >/dev/null 2>&1
136
+ then
137
+ die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
138
+
139
+ Please set the JAVA_HOME variable in your environment to match the
140
+ location of your Java installation."
141
+ fi
142
+ fi
143
+
144
+ # Increase the maximum file descriptors if we can.
145
+ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
146
+ case $MAX_FD in #(
147
+ max*)
148
+ # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
149
+ # shellcheck disable=SC2039,SC3045
150
+ MAX_FD=$( ulimit -H -n ) ||
151
+ warn "Could not query maximum file descriptor limit"
152
+ esac
153
+ case $MAX_FD in #(
154
+ '' | soft) :;; #(
155
+ *)
156
+ # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
157
+ # shellcheck disable=SC2039,SC3045
158
+ ulimit -n "$MAX_FD" ||
159
+ warn "Could not set maximum file descriptor limit to $MAX_FD"
160
+ esac
161
+ fi
162
+
163
+ # Collect all arguments for the java command, stacking in reverse order:
164
+ # * args from the command line
165
+ # * the main class name
166
+ # * -classpath
167
+ # * -D...appname settings
168
+ # * --module-path (only if needed)
169
+ # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
170
+
171
+ # For Cygwin or MSYS, switch paths to Windows format before running java
172
+ if "$cygwin" || "$msys" ; then
173
+ APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
174
+
175
+ JAVACMD=$( cygpath --unix "$JAVACMD" )
176
+
177
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
178
+ for arg do
179
+ if
180
+ case $arg in #(
181
+ -*) false ;; # don't mess with options #(
182
+ /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
183
+ [ -e "$t" ] ;; #(
184
+ *) false ;;
185
+ esac
186
+ then
187
+ arg=$( cygpath --path --ignore --mixed "$arg" )
188
+ fi
189
+ # Roll the args list around exactly as many times as the number of
190
+ # args, so each arg winds up back in the position where it started, but
191
+ # possibly modified.
192
+ #
193
+ # NB: a `for` loop captures its iteration list before it begins, so
194
+ # changing the positional parameters here affects neither the number of
195
+ # iterations, nor the values presented in `arg`.
196
+ shift # remove old arg
197
+ set -- "$@" "$arg" # push replacement arg
198
+ done
199
+ fi
200
+
201
+
202
+ # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
203
+ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
204
+
205
+ # Collect all arguments for the java command:
206
+ # * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
207
+ # and any embedded shellness will be escaped.
208
+ # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
209
+ # treated as '${Hostname}' itself on the command line.
210
+
211
+ set -- \
212
+ "-Dorg.gradle.appname=$APP_BASE_NAME" \
213
+ -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
214
+ "$@"
215
+
216
+ # Stop when "xargs" is not available.
217
+ if ! command -v xargs >/dev/null 2>&1
218
+ then
219
+ die "xargs is not available"
220
+ fi
221
+
222
+ # Use "xargs" to parse quoted args.
223
+ #
224
+ # With -n1 it outputs one arg per line, with the quotes and backslashes removed.
225
+ #
226
+ # In Bash we could simply go:
227
+ #
228
+ # readarray ARGS < <( xargs -n1 <<<"$var" ) &&
229
+ # set -- "${ARGS[@]}" "$@"
230
+ #
231
+ # but POSIX shell has neither arrays nor command substitution, so instead we
232
+ # post-process each arg (as a line of input to sed) to backslash-escape any
233
+ # character that might be a shell metacharacter, then use eval to reverse
234
+ # that process (while maintaining the separation between arguments), and wrap
235
+ # the whole thing up as a single "set" statement.
236
+ #
237
+ # This will of course break if any of these variables contains a newline or
238
+ # an unmatched quote.
239
+ #
240
+
241
+ eval "set -- $(
242
+ printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
243
+ xargs -n1 |
244
+ sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
245
+ tr '\n' ' '
246
+ )" '"$@"'
247
+
248
+ exec "$JAVACMD" "$@"
@@ -0,0 +1,112 @@
1
+ @rem
2
+ @rem Copyright 2015 the original author or authors.
3
+ @rem
4
+ @rem Licensed under the Apache License, Version 2.0 (the "License");
5
+ @rem you may not use this file except in compliance with the License.
6
+ @rem You may obtain a copy of the License at
7
+ @rem
8
+ @rem https://www.apache.org/licenses/LICENSE-2.0
9
+ @rem
10
+ @rem Unless required by applicable law or agreed to in writing, software
11
+ @rem distributed under the License is distributed on an "AS IS" BASIS,
12
+ @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ @rem See the License for the specific language governing permissions and
14
+ @rem limitations under the License.
15
+ @rem
16
+ @rem SPDX-License-Identifier: Apache-2.0
17
+ @rem
18
+
19
+ @if "%DEBUG%"=="" @echo off
20
+ @rem ##########################################################################
21
+ @rem
22
+ @rem gradlew startup script for Windows
23
+ @rem
24
+ @rem ##########################################################################
25
+
26
+ @rem Set local scope for the variables, and ensure extensions are enabled
27
+ setlocal EnableExtensions
28
+
29
+ @rem Catch executions from older scripts and ensure they exit cleanly.
30
+ @rem This can be removed once we can be reasonably confident that few people
31
+ @rem will be migrating directly to this new wrapper.
32
+ goto afterSafetyNet
33
+ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
34
+ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
35
+ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
36
+ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
37
+ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
38
+ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
39
+ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
40
+ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
41
+ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
42
+ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
43
+ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
44
+ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
45
+ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
46
+ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
47
+ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
48
+ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
49
+ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
50
+ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
51
+ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
52
+ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
53
+ goto exitWithErrorLevel
54
+ :afterSafetyNet
55
+
56
+ set DIRNAME=%~dp0
57
+ if "%DIRNAME%"=="" set DIRNAME=.
58
+ @rem This is normally unused
59
+ set APP_BASE_NAME=%~n0
60
+ set APP_HOME=%DIRNAME%
61
+
62
+ @rem Resolve any "." and ".." in APP_HOME to make it shorter.
63
+ for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
64
+
65
+ @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
66
+ set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
67
+
68
+ @rem Find java.exe
69
+ if defined JAVA_HOME goto findJavaFromJavaHome
70
+
71
+ set JAVA_EXE=java.exe
72
+ %JAVA_EXE% -version >NUL 2>&1
73
+ if %ERRORLEVEL% equ 0 goto execute
74
+
75
+ 1>&2 echo.
76
+ 1>&2 echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
77
+ 1>&2 echo.
78
+ 1>&2 echo Please set the JAVA_HOME variable in your environment to match the
79
+ 1>&2 echo location of your Java installation.
80
+
81
+ "%COMSPEC%" /c exit 1
82
+ goto exitWithErrorLevel
83
+
84
+ :findJavaFromJavaHome
85
+ set JAVA_HOME=%JAVA_HOME:"=%
86
+ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
87
+
88
+ if exist "%JAVA_EXE%" goto execute
89
+
90
+ 1>&2 echo.
91
+ 1>&2 echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
92
+ 1>&2 echo.
93
+ 1>&2 echo Please set the JAVA_HOME variable in your environment to match the
94
+ 1>&2 echo location of your Java installation.
95
+
96
+ "%COMSPEC%" /c exit 1
97
+ goto exitWithErrorLevel
98
+
99
+ :execute
100
+ @rem Setup the command line
101
+
102
+
103
+
104
+ @rem Execute gradlew
105
+ @rem endlocal doesn't take effect until after the line is parsed and variables are expanded
106
+ @rem which allows us to clear the local environment before executing the java command
107
+ endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel & goto exitWithErrorLevel
108
+
109
+ @rem This label must not be changed. We rely on old scripts being able to jump to this point.
110
+ :exitWithErrorLevel
111
+ @rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts
112
+ "%COMSPEC%" /c exit %ERRORLEVEL%
@@ -0,0 +1,19 @@
1
+ pluginManagement {
2
+ repositories {
3
+ google()
4
+ mavenCentral()
5
+ gradlePluginPortal()
6
+ }
7
+ }
8
+
9
+ dependencyResolutionManagement {
10
+ repositories {
11
+ google()
12
+ mavenCentral()
13
+ }
14
+ }
15
+
16
+ rootProject.name = "__DISPLAY_NAME__"
17
+ include(":app")
18
+ include(":nativue")
19
+ project(":nativue").projectDir = file("../node_modules/@nativue/core/android")
@@ -0,0 +1,12 @@
1
+ node_modules
2
+ ios/build
3
+ ios/App/main.bundle.js
4
+ .DS_Store
5
+ xcuserdata/
6
+ *.xcuserstate
7
+ android/.gradle
8
+ android/.kotlin
9
+ android/build
10
+ android/app/build
11
+ android/app/src/main/assets/main.bundle.js
12
+ android/local.properties
@@ -0,0 +1,11 @@
1
+ import SwiftUI
2
+ import Nativue
3
+
4
+ @main
5
+ struct MainApp: App {
6
+ var body: some Scene {
7
+ WindowGroup {
8
+ NativueView()
9
+ }
10
+ }
11
+ }
@@ -0,0 +1 @@
1
+ {"images":[{"filename":"icon.png","idiom":"universal","platform":"ios","size":"1024x1024"}],"info":{"author":"xcode","version":1}}
@@ -0,0 +1 @@
1
+ {"info":{"author":"xcode","version":1}}
@@ -0,0 +1,4 @@
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}}
@@ -0,0 +1 @@
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}}
@@ -0,0 +1,250 @@
1
+ // !$*UTF8*$!
2
+ {
3
+ archiveVersion = 1;
4
+ classes = {
5
+ };
6
+ objectVersion = 77;
7
+ objects = {
8
+
9
+ /* Begin PBXBuildFile section */
10
+ AA0000000000000000000010 /* Nativue in Frameworks */ = {isa = PBXBuildFile; productRef = AA0000000000000000000012 /* Nativue */; };
11
+ /* End PBXBuildFile section */
12
+
13
+ /* Begin PBXFileReference section */
14
+ AA0000000000000000000001 /* App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = App.app; sourceTree = BUILT_PRODUCTS_DIR; };
15
+ /* End PBXFileReference section */
16
+
17
+ /* Begin PBXFileSystemSynchronizedRootGroup section */
18
+ AA0000000000000000000002 /* App */ = {
19
+ isa = PBXFileSystemSynchronizedRootGroup;
20
+ path = App;
21
+ sourceTree = "<group>";
22
+ };
23
+ /* End PBXFileSystemSynchronizedRootGroup section */
24
+
25
+ /* Begin PBXFrameworksBuildPhase section */
26
+ AA0000000000000000000003 /* Frameworks */ = {
27
+ isa = PBXFrameworksBuildPhase;
28
+ buildActionMask = 2147483647;
29
+ files = (
30
+ AA0000000000000000000010 /* Nativue in Frameworks */,
31
+ );
32
+ runOnlyForDeploymentPostprocessing = 0;
33
+ };
34
+ /* End PBXFrameworksBuildPhase section */
35
+
36
+ /* Begin PBXGroup section */
37
+ AA0000000000000000000004 = {
38
+ isa = PBXGroup;
39
+ children = (
40
+ AA0000000000000000000002 /* App */,
41
+ AA0000000000000000000005 /* Products */,
42
+ );
43
+ sourceTree = "<group>";
44
+ };
45
+ AA0000000000000000000005 /* Products */ = {
46
+ isa = PBXGroup;
47
+ children = (
48
+ AA0000000000000000000001 /* App.app */,
49
+ );
50
+ name = Products;
51
+ sourceTree = "<group>";
52
+ };
53
+ /* End PBXGroup section */
54
+
55
+ /* Begin PBXNativeTarget section */
56
+ AA0000000000000000000006 /* App */ = {
57
+ isa = PBXNativeTarget;
58
+ buildConfigurationList = AA000000000000000000000A /* Build configuration list for PBXNativeTarget "App" */;
59
+ buildPhases = (
60
+ AA0000000000000000000007 /* Sources */,
61
+ AA0000000000000000000003 /* Frameworks */,
62
+ AA0000000000000000000008 /* Resources */,
63
+ AA0000000000000000000020 /* Write Dev Server Host */,
64
+ );
65
+ buildRules = (
66
+ );
67
+ dependencies = (
68
+ );
69
+ fileSystemSynchronizedGroups = (
70
+ AA0000000000000000000002 /* App */,
71
+ );
72
+ name = App;
73
+ packageProductDependencies = (
74
+ AA0000000000000000000012 /* Nativue */,
75
+ );
76
+ productName = App;
77
+ productReference = AA0000000000000000000001 /* App.app */;
78
+ productType = "com.apple.product-type.application";
79
+ };
80
+ /* End PBXNativeTarget section */
81
+
82
+ /* Begin PBXProject section */
83
+ AA0000000000000000000009 /* Project object */ = {
84
+ isa = PBXProject;
85
+ attributes = {
86
+ BuildIndependentTargetsInParallel = 1;
87
+ LastSwiftUpdateCheck = 1600;
88
+ LastUpgradeCheck = 1600;
89
+ };
90
+ buildConfigurationList = AA000000000000000000000B /* Build configuration list for PBXProject "App" */;
91
+ developmentRegion = en;
92
+ hasScannedForEncodings = 0;
93
+ knownRegions = (
94
+ en,
95
+ Base,
96
+ );
97
+ mainGroup = AA0000000000000000000004;
98
+ minimizedProjectReferenceProxies = 1;
99
+ packageReferences = (
100
+ AA0000000000000000000011 /* XCLocalSwiftPackageReference "../../../packages/core" */,
101
+ );
102
+ preferredProjectObjectVersion = 77;
103
+ productRefGroup = AA0000000000000000000005 /* Products */;
104
+ projectDirPath = "";
105
+ projectRoot = "";
106
+ targets = (
107
+ AA0000000000000000000006 /* App */,
108
+ );
109
+ };
110
+ /* End PBXProject section */
111
+
112
+ /* Begin PBXResourcesBuildPhase section */
113
+ AA0000000000000000000008 /* Resources */ = {
114
+ isa = PBXResourcesBuildPhase;
115
+ buildActionMask = 2147483647;
116
+ files = (
117
+ );
118
+ runOnlyForDeploymentPostprocessing = 0;
119
+ };
120
+ /* End PBXResourcesBuildPhase section */
121
+
122
+ /* Begin PBXShellScriptBuildPhase section */
123
+ AA0000000000000000000020 /* Write Dev Server Host */ = {
124
+ isa = PBXShellScriptBuildPhase;
125
+ alwaysOutOfDate = 1;
126
+ buildActionMask = 2147483647;
127
+ files = (
128
+ );
129
+ inputPaths = (
130
+ );
131
+ name = "Write Dev Server Host";
132
+ outputPaths = (
133
+ "$(TARGET_BUILD_DIR)/$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/dev-server-host.txt",
134
+ );
135
+ runOnlyForDeploymentPostprocessing = 0;
136
+ shellPath = /bin/sh;
137
+ shellScript = "# Lets a physical device reach the dev server on this Mac.\n[ \"$CONFIGURATION\" = \"Debug\" ] || exit 0\necho \"$(scutil --get LocalHostName).local\" > \"$TARGET_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH/dev-server-host.txt\"\n";
138
+ };
139
+ /* End PBXShellScriptBuildPhase section */
140
+
141
+ /* Begin PBXSourcesBuildPhase section */
142
+ AA0000000000000000000007 /* Sources */ = {
143
+ isa = PBXSourcesBuildPhase;
144
+ buildActionMask = 2147483647;
145
+ files = (
146
+ );
147
+ runOnlyForDeploymentPostprocessing = 0;
148
+ };
149
+ /* End PBXSourcesBuildPhase section */
150
+
151
+ /* Begin XCBuildConfiguration section */
152
+ AA000000000000000000000C /* Debug */ = {
153
+ isa = XCBuildConfiguration;
154
+ buildSettings = {
155
+ ALWAYS_SEARCH_USER_PATHS = NO;
156
+ ENABLE_TESTABILITY = YES;
157
+ IPHONEOS_DEPLOYMENT_TARGET = 17.0;
158
+ ONLY_ACTIVE_ARCH = YES;
159
+ SDKROOT = iphoneos;
160
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
161
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
162
+ SWIFT_VERSION = 5.0;
163
+ };
164
+ name = Debug;
165
+ };
166
+ AA000000000000000000000D /* Release */ = {
167
+ isa = XCBuildConfiguration;
168
+ buildSettings = {
169
+ ALWAYS_SEARCH_USER_PATHS = NO;
170
+ IPHONEOS_DEPLOYMENT_TARGET = 17.0;
171
+ SDKROOT = iphoneos;
172
+ SWIFT_COMPILATION_MODE = wholemodule;
173
+ SWIFT_VERSION = 5.0;
174
+ VALIDATE_PRODUCT = YES;
175
+ };
176
+ name = Release;
177
+ };
178
+ AA000000000000000000000E /* Debug */ = {
179
+ isa = XCBuildConfiguration;
180
+ buildSettings = {
181
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
182
+ CODE_SIGN_STYLE = Automatic;
183
+ CURRENT_PROJECT_VERSION = 1;
184
+ GENERATE_INFOPLIST_FILE = YES;
185
+ INFOPLIST_FILE = Info.plist;
186
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
187
+ INFOPLIST_KEY_CFBundleDisplayName = "__DISPLAY_NAME__";
188
+ MARKETING_VERSION = 0.1;
189
+ PRODUCT_BUNDLE_IDENTIFIER = __BUNDLE_ID__;
190
+ PRODUCT_NAME = "$(TARGET_NAME)";
191
+ TARGETED_DEVICE_FAMILY = "1,2";
192
+ };
193
+ name = Debug;
194
+ };
195
+ AA000000000000000000000F /* Release */ = {
196
+ isa = XCBuildConfiguration;
197
+ buildSettings = {
198
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
199
+ CODE_SIGN_STYLE = Automatic;
200
+ CURRENT_PROJECT_VERSION = 1;
201
+ GENERATE_INFOPLIST_FILE = YES;
202
+ INFOPLIST_FILE = Info.plist;
203
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
204
+ INFOPLIST_KEY_CFBundleDisplayName = "__DISPLAY_NAME__";
205
+ MARKETING_VERSION = 0.1;
206
+ PRODUCT_BUNDLE_IDENTIFIER = __BUNDLE_ID__;
207
+ PRODUCT_NAME = "$(TARGET_NAME)";
208
+ TARGETED_DEVICE_FAMILY = "1,2";
209
+ };
210
+ name = Release;
211
+ };
212
+ /* End XCBuildConfiguration section */
213
+
214
+ /* Begin XCConfigurationList section */
215
+ AA000000000000000000000A /* Build configuration list for PBXNativeTarget "App" */ = {
216
+ isa = XCConfigurationList;
217
+ buildConfigurations = (
218
+ AA000000000000000000000E /* Debug */,
219
+ AA000000000000000000000F /* Release */,
220
+ );
221
+ defaultConfigurationIsVisible = 0;
222
+ defaultConfigurationName = Release;
223
+ };
224
+ AA000000000000000000000B /* Build configuration list for PBXProject "App" */ = {
225
+ isa = XCConfigurationList;
226
+ buildConfigurations = (
227
+ AA000000000000000000000C /* Debug */,
228
+ AA000000000000000000000D /* Release */,
229
+ );
230
+ defaultConfigurationIsVisible = 0;
231
+ defaultConfigurationName = Release;
232
+ };
233
+ /* End XCConfigurationList section */
234
+
235
+ /* Begin XCLocalSwiftPackageReference section */
236
+ AA0000000000000000000011 /* XCLocalSwiftPackageReference "../../../packages/core" */ = {
237
+ isa = XCLocalSwiftPackageReference;
238
+ relativePath = "../node_modules/@nativue/core";
239
+ };
240
+ /* End XCLocalSwiftPackageReference section */
241
+
242
+ /* Begin XCSwiftPackageProductDependency section */
243
+ AA0000000000000000000012 /* Nativue */ = {
244
+ isa = XCSwiftPackageProductDependency;
245
+ productName = Nativue;
246
+ };
247
+ /* End XCSwiftPackageProductDependency section */
248
+ };
249
+ rootObject = AA0000000000000000000009 /* Project object */;
250
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "originHash" : "d0f6a42ac8472d8c896bc69aa5954a686b40bbe674bd470a18066363cfb6c067",
3
+ "pins" : [
4
+ {
5
+ "identity" : "yoga",
6
+ "kind" : "remoteSourceControl",
7
+ "location" : "https://github.com/facebook/yoga.git",
8
+ "state" : {
9
+ "revision" : "8e31207cf5d5e6bd9ec06b55a5a5b2d492dde2d9",
10
+ "version" : "3.2.2"
11
+ }
12
+ }
13
+ ],
14
+ "version" : 3
15
+ }
@@ -0,0 +1,33 @@
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>CFBundleURLTypes</key>
6
+ <array>
7
+ <dict>
8
+ <key>CFBundleURLName</key>
9
+ <string>__BUNDLE_ID__</string>
10
+ <key>CFBundleURLSchemes</key>
11
+ <array>
12
+ <string>__URL_SCHEME__</string>
13
+ </array>
14
+ </dict>
15
+ </array>
16
+ <key>NSAppTransportSecurity</key>
17
+ <dict>
18
+ <key>NSAllowsLocalNetworking</key>
19
+ <true/>
20
+ </dict>
21
+ <key>NSLocalNetworkUsageDescription</key>
22
+ <string>Connects to the Nativue dev server on your Mac for hot reload.</string>
23
+ <key>UIUserInterfaceStyle</key>
24
+ <string>Light</string>
25
+ <key>UILaunchScreen</key>
26
+ <dict>
27
+ <key>UIColorName</key>
28
+ <string>LaunchBackground</string>
29
+ <key>UIImageName</key>
30
+ <string>LaunchLogo</string>
31
+ </dict>
32
+ </dict>
33
+ </plist>
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "__PACKAGE_NAME__",
3
+ "private": true,
4
+ "type": "module",
5
+ "scripts": {
6
+ "dev": "nativue dev",
7
+ "ios": "nativue run ios",
8
+ "android": "nativue run android",
9
+ "build": "nativue build --production",
10
+ "typecheck": "vue-tsc"
11
+ },
12
+ "dependencies": {
13
+ "@nativue/core": "__NATIVUE_VERSION__"
14
+ },
15
+ "devDependencies": {
16
+ "typescript": "^5.9.3",
17
+ "vue-tsc": "^3.3.14"
18
+ }
19
+ }
@@ -0,0 +1,7 @@
1
+ <script setup lang="ts">
2
+ import { Stack } from '@nativue/core/router'
3
+ </script>
4
+
5
+ <template>
6
+ <Stack :screen-options="{ headerShown: false }" />
7
+ </template>
@@ -0,0 +1,40 @@
1
+ <script setup lang="ts">
2
+ import { ref, StyleSheet } from 'vue'
3
+ import logo from '@/assets/logo.png'
4
+
5
+ const count = ref(0)
6
+
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' },
28
+ })
29
+ </script>
30
+
31
+ <template>
32
+ <View :style="styles.screen">
33
+ <Image :source="logo" resize-mode="contain" :style="styles.logo" />
34
+ <Text :style="styles.title">Welcome to Nativue</Text>
35
+ <Text :style="styles.hint">Edit src/app/index.vue and save to see it here.</Text>
36
+ <Pressable :style="styles.button" :pressed-style="styles.buttonPressed" @press="count++">
37
+ <Text :style="styles.buttonText">Tapped {{ count }} times</Text>
38
+ </Pressable>
39
+ </View>
40
+ </template>
Binary file
@@ -0,0 +1,5 @@
1
+ // Asset imports (import logo from './assets/logo.png').
2
+ declare module '*.png' {
3
+ const source: string
4
+ export default source
5
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "extends": "@nativue/core/tsconfig.base.json",
3
+ "include": ["src"]
4
+ }