@teardown/cli 1.2.38 → 2.0.41

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 (182) hide show
  1. package/bin/teardown.js +11 -1
  2. package/package.json +77 -57
  3. package/src/cli/commands/init.ts +254 -0
  4. package/src/cli/commands/plugins.ts +93 -0
  5. package/src/cli/commands/prebuild.ts +168 -0
  6. package/src/cli/commands/run.ts +727 -0
  7. package/src/cli/commands/start.ts +87 -0
  8. package/src/cli/commands/validate.ts +62 -0
  9. package/src/cli/index.ts +59 -0
  10. package/src/config/index.ts +45 -0
  11. package/src/config/loader.ts +366 -0
  12. package/src/config/schema.ts +235 -0
  13. package/src/config/types.ts +322 -0
  14. package/src/index.ts +177 -0
  15. package/src/pipeline/cache.ts +179 -0
  16. package/src/pipeline/index.ts +10 -0
  17. package/src/pipeline/stages.ts +692 -0
  18. package/src/plugins/base.ts +370 -0
  19. package/src/plugins/capabilities/biometrics.ts +64 -0
  20. package/src/plugins/capabilities/bluetooth.ts +86 -0
  21. package/src/plugins/capabilities/calendar.ts +57 -0
  22. package/src/plugins/capabilities/camera.ts +77 -0
  23. package/src/plugins/capabilities/contacts.ts +57 -0
  24. package/src/plugins/capabilities/deep-linking.ts +124 -0
  25. package/src/plugins/capabilities/firebase.ts +138 -0
  26. package/src/plugins/capabilities/index.ts +96 -0
  27. package/src/plugins/capabilities/location.ts +87 -0
  28. package/src/plugins/capabilities/photo-library.ts +80 -0
  29. package/src/plugins/capabilities/push-notifications.ts +98 -0
  30. package/src/plugins/capabilities/sign-in-with-apple.ts +53 -0
  31. package/src/plugins/context.ts +220 -0
  32. package/src/plugins/index.ts +26 -0
  33. package/src/plugins/resolver.ts +321 -0
  34. package/src/templates/generator.ts +507 -0
  35. package/src/templates/index.ts +9 -0
  36. package/src/templates/paths.ts +25 -0
  37. package/src/transformers/android/gradle.ts +400 -0
  38. package/src/transformers/android/index.ts +19 -0
  39. package/src/transformers/android/manifest.ts +506 -0
  40. package/src/transformers/index.ts +39 -0
  41. package/src/transformers/ios/entitlements.ts +283 -0
  42. package/src/transformers/ios/index.ts +10 -0
  43. package/src/transformers/ios/pbxproj.ts +267 -0
  44. package/src/transformers/ios/plist.ts +198 -0
  45. package/src/utils/fs.ts +429 -0
  46. package/src/utils/index.ts +21 -0
  47. package/src/utils/logger.ts +203 -0
  48. package/templates/.gitignore +63 -0
  49. package/templates/Gemfile +3 -0
  50. package/templates/android/app/build.gradle.kts +97 -0
  51. package/templates/android/app/proguard-rules.pro +10 -0
  52. package/templates/android/app/src/main/AndroidManifest.xml +26 -0
  53. package/templates/android/app/src/main/java/com/appname/MainActivity.kt +22 -0
  54. package/templates/android/app/src/main/java/com/appname/MainApplication.kt +44 -0
  55. package/templates/android/app/src/main/res/values/strings.xml +3 -0
  56. package/templates/android/app/src/main/res/values/styles.xml +7 -0
  57. package/templates/android/build.gradle.kts +44 -0
  58. package/templates/android/gradle.properties +39 -0
  59. package/templates/android/settings.gradle.kts +12 -0
  60. package/templates/babel.config.js +15 -0
  61. package/templates/index.js +7 -0
  62. package/templates/ios/.xcode.env +11 -0
  63. package/templates/ios/AppName/AppDelegate.swift +25 -0
  64. package/templates/ios/AppName/AppName-Bridging-Header.h +4 -0
  65. package/templates/ios/AppName/AppName.entitlements +6 -0
  66. package/templates/ios/AppName/Images.xcassets/AppIcon.appiconset/Contents.json +35 -0
  67. package/templates/ios/AppName/Images.xcassets/Contents.json +6 -0
  68. package/templates/ios/AppName/Info.plist +49 -0
  69. package/templates/ios/AppName/LaunchScreen.storyboard +38 -0
  70. package/templates/ios/AppName.xcodeproj/project.pbxproj +402 -0
  71. package/templates/ios/AppName.xcodeproj/xcshareddata/xcschemes/AppName.xcscheme +78 -0
  72. package/templates/ios/Podfile +35 -0
  73. package/templates/metro.config.js +41 -0
  74. package/templates/package.json +57 -0
  75. package/templates/react-native.config.js +8 -0
  76. package/templates/src/app/index.tsx +34 -0
  77. package/templates/src/assets/fonts/.gitkeep +1 -0
  78. package/templates/src/assets/images/.gitkeep +1 -0
  79. package/templates/src/components/ui/accordion.tsx +114 -0
  80. package/templates/src/components/ui/avatar.tsx +75 -0
  81. package/templates/src/components/ui/button.tsx +93 -0
  82. package/templates/src/components/ui/card.tsx +120 -0
  83. package/templates/src/components/ui/checkbox.tsx +133 -0
  84. package/templates/src/components/ui/chip.tsx +95 -0
  85. package/templates/src/components/ui/dialog.tsx +134 -0
  86. package/templates/src/components/ui/divider.tsx +67 -0
  87. package/templates/src/components/ui/error-view.tsx +82 -0
  88. package/templates/src/components/ui/form-field.tsx +101 -0
  89. package/templates/src/components/ui/index.ts +100 -0
  90. package/templates/src/components/ui/popover.tsx +92 -0
  91. package/templates/src/components/ui/pressable-feedback.tsx +88 -0
  92. package/templates/src/components/ui/radio-group.tsx +153 -0
  93. package/templates/src/components/ui/scroll-shadow.tsx +108 -0
  94. package/templates/src/components/ui/select.tsx +165 -0
  95. package/templates/src/components/ui/skeleton-group.tsx +97 -0
  96. package/templates/src/components/ui/skeleton.tsx +87 -0
  97. package/templates/src/components/ui/spinner.tsx +87 -0
  98. package/templates/src/components/ui/surface.tsx +95 -0
  99. package/templates/src/components/ui/switch.tsx +124 -0
  100. package/templates/src/components/ui/tabs.tsx +154 -0
  101. package/templates/src/components/ui/text-field.tsx +106 -0
  102. package/templates/src/components/ui/toast.tsx +129 -0
  103. package/templates/src/contexts/.gitkeep +2 -0
  104. package/templates/src/core/clients/api/api.client.ts +113 -0
  105. package/templates/src/core/clients/api/index.ts +1 -0
  106. package/templates/src/core/clients/storage/index.ts +1 -0
  107. package/templates/src/core/clients/storage/storage.client.ts +121 -0
  108. package/templates/src/core/constants/index.ts +19 -0
  109. package/templates/src/core/core.ts +40 -0
  110. package/templates/src/core/index.ts +10 -0
  111. package/templates/src/global.css +87 -0
  112. package/templates/src/hooks/index.ts +6 -0
  113. package/templates/src/hooks/use-debounce.ts +23 -0
  114. package/templates/src/hooks/use-mounted.ts +21 -0
  115. package/templates/src/index.ts +28 -0
  116. package/templates/src/lib/index.ts +5 -0
  117. package/templates/src/lib/utils.ts +115 -0
  118. package/templates/src/modules/.gitkeep +6 -0
  119. package/templates/src/navigation/index.ts +8 -0
  120. package/templates/src/navigation/navigation-provider.tsx +36 -0
  121. package/templates/src/navigation/router.tsx +137 -0
  122. package/templates/src/providers/app.provider.tsx +29 -0
  123. package/templates/src/providers/index.ts +5 -0
  124. package/templates/src/routes/(tabs)/_layout.tsx +42 -0
  125. package/templates/src/routes/(tabs)/explore.tsx +161 -0
  126. package/templates/src/routes/(tabs)/home.tsx +138 -0
  127. package/templates/src/routes/(tabs)/profile.tsx +151 -0
  128. package/templates/src/routes/_layout.tsx +18 -0
  129. package/templates/src/routes/settings.tsx +194 -0
  130. package/templates/src/screens/auth/index.ts +6 -0
  131. package/templates/src/screens/auth/login.tsx +165 -0
  132. package/templates/src/screens/auth/register.tsx +203 -0
  133. package/templates/src/screens/home.tsx +204 -0
  134. package/templates/src/screens/index.ts +17 -0
  135. package/templates/src/screens/profile.tsx +210 -0
  136. package/templates/src/screens/settings.tsx +216 -0
  137. package/templates/src/screens/welcome.tsx +101 -0
  138. package/templates/src/styles/index.ts +103 -0
  139. package/templates/src/types/common.ts +71 -0
  140. package/templates/src/types/index.ts +5 -0
  141. package/templates/tsconfig.json +14 -0
  142. package/README.md +0 -15
  143. package/assets/favicon.ico +0 -0
  144. package/dist/commands/dev/dev.js +0 -55
  145. package/dist/commands/init/init-teardown.js +0 -26
  146. package/dist/index.js +0 -20
  147. package/dist/modules/dev/dev-menu/keyboard-handler.js +0 -138
  148. package/dist/modules/dev/dev-menu/open-debugger-keyboard-handler.js +0 -105
  149. package/dist/modules/dev/dev-server/cdp/cdp.adapter.js +0 -12
  150. package/dist/modules/dev/dev-server/cdp/index.js +0 -18
  151. package/dist/modules/dev/dev-server/cdp/types.js +0 -2
  152. package/dist/modules/dev/dev-server/dev-server-checker.js +0 -72
  153. package/dist/modules/dev/dev-server/dev-server.js +0 -269
  154. package/dist/modules/dev/dev-server/inspector/device.event-reporter.js +0 -165
  155. package/dist/modules/dev/dev-server/inspector/device.js +0 -577
  156. package/dist/modules/dev/dev-server/inspector/inspector.js +0 -204
  157. package/dist/modules/dev/dev-server/inspector/types.js +0 -2
  158. package/dist/modules/dev/dev-server/inspector/wss/servers/debugger-connection.server.js +0 -61
  159. package/dist/modules/dev/dev-server/inspector/wss/servers/device-connection.server.js +0 -64
  160. package/dist/modules/dev/dev-server/plugins/devtools.plugin.js +0 -50
  161. package/dist/modules/dev/dev-server/plugins/favicon.plugin.js +0 -19
  162. package/dist/modules/dev/dev-server/plugins/multipart.plugin.js +0 -62
  163. package/dist/modules/dev/dev-server/plugins/systrace.plugin.js +0 -28
  164. package/dist/modules/dev/dev-server/plugins/types.js +0 -2
  165. package/dist/modules/dev/dev-server/plugins/wss/index.js +0 -19
  166. package/dist/modules/dev/dev-server/plugins/wss/servers/web-socket-api.server.js +0 -66
  167. package/dist/modules/dev/dev-server/plugins/wss/servers/web-socket-debugger.server.js +0 -128
  168. package/dist/modules/dev/dev-server/plugins/wss/servers/web-socket-dev-client.server.js +0 -75
  169. package/dist/modules/dev/dev-server/plugins/wss/servers/web-socket-events.server.js +0 -198
  170. package/dist/modules/dev/dev-server/plugins/wss/servers/web-socket-hmr.server.js +0 -120
  171. package/dist/modules/dev/dev-server/plugins/wss/servers/web-socket-message.server.js +0 -357
  172. package/dist/modules/dev/dev-server/plugins/wss/types.js +0 -2
  173. package/dist/modules/dev/dev-server/plugins/wss/web-socket-router.js +0 -57
  174. package/dist/modules/dev/dev-server/plugins/wss/web-socket-server-adapter.js +0 -26
  175. package/dist/modules/dev/dev-server/plugins/wss/web-socket-server.js +0 -46
  176. package/dist/modules/dev/dev-server/plugins/wss/wss.plugin.js +0 -55
  177. package/dist/modules/dev/dev-server/sybmolicate/sybmolicate.plugin.js +0 -36
  178. package/dist/modules/dev/dev-server/sybmolicate/types.js +0 -2
  179. package/dist/modules/dev/terminal/base.terminal.reporter.js +0 -78
  180. package/dist/modules/dev/terminal/terminal.reporter.js +0 -76
  181. package/dist/modules/dev/types.js +0 -2
  182. package/dist/modules/dev/utils/log.js +0 -73
@@ -0,0 +1,203 @@
1
+ import chalk from "chalk";
2
+
3
+ /**
4
+ * Log level enumeration
5
+ */
6
+ export type LogLevel = "debug" | "info" | "warn" | "error" | "silent";
7
+
8
+ /**
9
+ * Log level priority (higher = more important)
10
+ */
11
+ const LOG_LEVEL_PRIORITY: Record<LogLevel, number> = {
12
+ debug: 0,
13
+ info: 1,
14
+ warn: 2,
15
+ error: 3,
16
+ silent: 4,
17
+ };
18
+
19
+ /**
20
+ * Logger configuration
21
+ */
22
+ export interface LoggerConfig {
23
+ level: LogLevel;
24
+ prefix?: string;
25
+ timestamps?: boolean;
26
+ colors?: boolean;
27
+ }
28
+
29
+ /**
30
+ * Logger interface
31
+ */
32
+ export interface Logger {
33
+ debug(message: string, ...args: unknown[]): void;
34
+ info(message: string, ...args: unknown[]): void;
35
+ warn(message: string, ...args: unknown[]): void;
36
+ error(message: string, ...args: unknown[]): void;
37
+ success(message: string, ...args: unknown[]): void;
38
+ setLevel(level: LogLevel): void;
39
+ getLevel(): LogLevel;
40
+ child(prefix: string): Logger;
41
+ }
42
+
43
+ /**
44
+ * Create a logger instance
45
+ */
46
+ export function createLogger(config: Partial<LoggerConfig> = {}): Logger {
47
+ let currentLevel: LogLevel = config.level ?? "info";
48
+ const prefix = config.prefix ?? "";
49
+ const timestamps = config.timestamps ?? false;
50
+ const colors = config.colors ?? true;
51
+
52
+ const shouldLog = (level: LogLevel): boolean => {
53
+ return LOG_LEVEL_PRIORITY[level] >= LOG_LEVEL_PRIORITY[currentLevel];
54
+ };
55
+
56
+ const formatPrefix = (): string => {
57
+ const parts: string[] = [];
58
+
59
+ if (timestamps) {
60
+ parts.push(new Date().toISOString());
61
+ }
62
+
63
+ if (prefix) {
64
+ parts.push(prefix);
65
+ }
66
+
67
+ return parts.length > 0 ? `[${parts.join(" ")}] ` : "";
68
+ };
69
+
70
+ const formatMessage = (level: LogLevel, message: string): string => {
71
+ const formattedPrefix = formatPrefix();
72
+
73
+ if (!colors) {
74
+ return `${formattedPrefix}${message}`;
75
+ }
76
+
77
+ switch (level) {
78
+ case "debug":
79
+ return `${chalk.gray(formattedPrefix)}${chalk.gray(message)}`;
80
+ case "info":
81
+ return `${chalk.blue(formattedPrefix)}${message}`;
82
+ case "warn":
83
+ return `${chalk.yellow(formattedPrefix)}${chalk.yellow(message)}`;
84
+ case "error":
85
+ return `${chalk.red(formattedPrefix)}${chalk.red(message)}`;
86
+ default:
87
+ return `${formattedPrefix}${message}`;
88
+ }
89
+ };
90
+
91
+ return {
92
+ debug(message: string, ...args: unknown[]) {
93
+ if (shouldLog("debug")) {
94
+ console.log(formatMessage("debug", message), ...args);
95
+ }
96
+ },
97
+
98
+ info(message: string, ...args: unknown[]) {
99
+ if (shouldLog("info")) {
100
+ console.log(formatMessage("info", message), ...args);
101
+ }
102
+ },
103
+
104
+ warn(message: string, ...args: unknown[]) {
105
+ if (shouldLog("warn")) {
106
+ console.warn(formatMessage("warn", message), ...args);
107
+ }
108
+ },
109
+
110
+ error(message: string, ...args: unknown[]) {
111
+ if (shouldLog("error")) {
112
+ console.error(formatMessage("error", message), ...args);
113
+ }
114
+ },
115
+
116
+ success(message: string, ...args: unknown[]) {
117
+ if (shouldLog("info")) {
118
+ const formattedPrefix = formatPrefix();
119
+ if (colors) {
120
+ console.log(`${chalk.green(formattedPrefix)}${chalk.green(message)}`, ...args);
121
+ } else {
122
+ console.log(`${formattedPrefix}${message}`, ...args);
123
+ }
124
+ }
125
+ },
126
+
127
+ setLevel(level: LogLevel) {
128
+ currentLevel = level;
129
+ },
130
+
131
+ getLevel() {
132
+ return currentLevel;
133
+ },
134
+
135
+ child(childPrefix: string): Logger {
136
+ const newPrefix = prefix ? `${prefix}:${childPrefix}` : childPrefix;
137
+ return createLogger({
138
+ level: currentLevel,
139
+ prefix: newPrefix,
140
+ timestamps,
141
+ colors,
142
+ });
143
+ },
144
+ };
145
+ }
146
+
147
+ /**
148
+ * Default logger instance
149
+ */
150
+ export const defaultLogger = createLogger();
151
+
152
+ /**
153
+ * Format a list of items for display
154
+ */
155
+ export function formatList(items: string[], bullet = "•"): string {
156
+ return items.map((item) => ` ${bullet} ${item}`).join("\n");
157
+ }
158
+
159
+ /**
160
+ * Format a key-value object for display
161
+ */
162
+ export function formatKeyValue(obj: Record<string, unknown>, indent = 0): string {
163
+ const spaces = " ".repeat(indent);
164
+ return Object.entries(obj)
165
+ .map(([key, value]) => {
166
+ if (typeof value === "object" && value !== null) {
167
+ return `${spaces}${key}:\n${formatKeyValue(value as Record<string, unknown>, indent + 2)}`;
168
+ }
169
+ return `${spaces}${key}: ${value}`;
170
+ })
171
+ .join("\n");
172
+ }
173
+
174
+ /**
175
+ * Format bytes to human readable
176
+ */
177
+ export function formatBytes(bytes: number): string {
178
+ const units = ["B", "KB", "MB", "GB"];
179
+ let unitIndex = 0;
180
+ let size = bytes;
181
+
182
+ while (size >= 1024 && unitIndex < units.length - 1) {
183
+ size /= 1024;
184
+ unitIndex++;
185
+ }
186
+
187
+ return `${size.toFixed(unitIndex === 0 ? 0 : 1)} ${units[unitIndex]}`;
188
+ }
189
+
190
+ /**
191
+ * Format duration in milliseconds to human readable
192
+ */
193
+ export function formatDuration(ms: number): string {
194
+ if (ms < 1000) {
195
+ return `${ms}ms`;
196
+ }
197
+ if (ms < 60000) {
198
+ return `${(ms / 1000).toFixed(1)}s`;
199
+ }
200
+ const minutes = Math.floor(ms / 60000);
201
+ const seconds = ((ms % 60000) / 1000).toFixed(0);
202
+ return `${minutes}m ${seconds}s`;
203
+ }
@@ -0,0 +1,63 @@
1
+ # Native project folders (generated by teardown prebuild)
2
+ ios/
3
+ android/
4
+
5
+ # Generated navigation types (generated by @teardown/navigation-metro)
6
+ .teardown/
7
+
8
+ # Dependencies
9
+ node_modules/
10
+
11
+ # Metro bundler
12
+ .metro-health-check*
13
+
14
+ # React Native
15
+ *.bundle
16
+
17
+ # Build outputs
18
+ *.jsbundle
19
+ *.jsbundle.map
20
+
21
+ # Xcode
22
+ *.xcworkspace
23
+ *.xcuserstate
24
+ xcuserdata/
25
+ DerivedData/
26
+ *.ipa
27
+
28
+ # Android
29
+ *.apk
30
+ *.aab
31
+ .gradle/
32
+ local.properties
33
+
34
+ # Environment files
35
+ .env
36
+ .env.*
37
+ !.env.example
38
+
39
+ # IDE
40
+ .idea/
41
+ .vscode/
42
+ *.swp
43
+ *.swo
44
+ *~
45
+
46
+ # OS files
47
+ .DS_Store
48
+ Thumbs.db
49
+
50
+ # Debug logs
51
+ npm-debug.log*
52
+ yarn-debug.log*
53
+ yarn-error.log*
54
+
55
+ # Testing
56
+ coverage/
57
+
58
+ # TypeScript
59
+ *.tsbuildinfo
60
+
61
+ # Temporary files
62
+ tmp/
63
+ temp/
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'cocoapods', '~> 1.15'
@@ -0,0 +1,97 @@
1
+ plugins {
2
+ id("com.android.application")
3
+ id("org.jetbrains.kotlin.android")
4
+ id("com.facebook.react")
5
+ }
6
+
7
+ /**
8
+ * This is the configuration block to customize your React Native Android app.
9
+ * By default you don't need to apply any configuration, just uncomment the lines you need.
10
+ */
11
+ react {
12
+ /* Folders */
13
+ // The root of your project, i.e. where "package.json" lives. Default is '../..'
14
+ // root = file("../../")
15
+ // The folder where the react-native NPM package is. Default is ../../node_modules/react-native
16
+ // reactNativeDir = file("../../node_modules/react-native")
17
+ // The folder where the react-native Codegen package is. Default is ../../node_modules/@react-native/codegen
18
+ // codegenDir = file("../../node_modules/@react-native/codegen")
19
+ // The cli.js file which is the React Native CLI entrypoint. Default is ../../node_modules/react-native/cli.js
20
+ // cliFile = file("../../node_modules/react-native/cli.js")
21
+
22
+ /* Variants */
23
+ // The list of variants to that are debuggable. For those we're going to
24
+ // skip the bundling of the JS bundle and the assets. By default is just 'debug'.
25
+ // If you add flavors like lite, entity, etc. you'll have to list your debuggableVariants.
26
+ // debuggableVariants = ["liteDebug", "entityDebug"]
27
+
28
+ /* Bundling */
29
+ // A list of files to use as the entry point for the bundler. Default is 'index.js'.
30
+ // entryFile = file("../../index.js")
31
+
32
+ // Set this to true to automatically invoke bundleReleaseJsAndAssets
33
+ // before each release build variant.
34
+ // autolinkLibrariesWithApp()
35
+ }
36
+
37
+ /**
38
+ * Set this to true to Run Proguard on Release builds to minify the Java bytecode.
39
+ */
40
+ val enableProguardInReleaseBuilds = false
41
+
42
+ /**
43
+ * The preferred build flavor of JavaScriptCore (JSC).
44
+ *
45
+ * For example, to use the international variant, you can use:
46
+ * `val jscFlavor = "org.webkit:android-jsc-intl:+"`
47
+ *
48
+ * The international variant includes ICU i18n library and necessary data
49
+ * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
50
+ * give correct results when using with locales other than en-US. Note that
51
+ * this variant is about 6MiB larger per architecture than default.
52
+ */
53
+ val jscFlavor = "org.webkit:android-jsc:+"
54
+
55
+ android {
56
+ namespace = "<%= packageName %>"
57
+ compileSdk = rootProject.ext.get("compileSdkVersion") as Int
58
+
59
+ defaultConfig {
60
+ applicationId = "<%= packageName %>"
61
+ minSdk = rootProject.ext.get("minSdkVersion") as Int
62
+ targetSdk = rootProject.ext.get("targetSdkVersion") as Int
63
+ versionCode = <%= versionCode %>
64
+ versionName = "<%= versionName %>"
65
+ }
66
+ signingConfigs {
67
+ getByName("debug") {
68
+ storeFile = file("debug.keystore")
69
+ storePassword = "android"
70
+ keyAlias = "androiddebugkey"
71
+ keyPassword = "android"
72
+ }
73
+ }
74
+ buildTypes {
75
+ debug {
76
+ signingConfig = signingConfigs.getByName("debug")
77
+ }
78
+ release {
79
+ // Caution! In production, you need to generate your own keystore file.
80
+ // see https://reactnative.dev/docs/signed-apk-android.
81
+ signingConfig = signingConfigs.getByName("debug")
82
+ isMinifyEnabled = enableProguardInReleaseBuilds
83
+ proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
84
+ }
85
+ }
86
+ }
87
+
88
+ dependencies {
89
+ // The version of react-native is set by the React Native Gradle Plugin
90
+ implementation("com.facebook.react:react-android")
91
+
92
+ if (project.hasProperty("hermesEnabled") && project.property("hermesEnabled") == "true") {
93
+ implementation("com.facebook.react:hermes-android")
94
+ } else {
95
+ implementation(jscFlavor)
96
+ }
97
+ }
@@ -0,0 +1,10 @@
1
+ # Add project specific ProGuard rules here.
2
+ # By default, the flags in this file are appended to flags specified
3
+ # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
4
+ # You can edit the include path and order by changing the proguardFiles
5
+ # directive in build.gradle.
6
+ #
7
+ # For more details, see
8
+ # http://developer.android.com/guide/developing/tools/proguard.html
9
+
10
+ # Add any project specific keep options here:
@@ -0,0 +1,26 @@
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android">
2
+
3
+ <uses-permission android:name="android.permission.INTERNET" />
4
+
5
+ <application
6
+ android:name=".MainApplication"
7
+ android:label="@string/app_name"
8
+ android:icon="@mipmap/ic_launcher"
9
+ android:roundIcon="@mipmap/ic_launcher_round"
10
+ android:allowBackup="false"
11
+ android:theme="@style/AppTheme"
12
+ android:supportsRtl="true">
13
+ <activity
14
+ android:name=".MainActivity"
15
+ android:label="@string/app_name"
16
+ android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
17
+ android:launchMode="singleTask"
18
+ android:windowSoftInputMode="adjustResize"
19
+ android:exported="true">
20
+ <intent-filter>
21
+ <action android:name="android.intent.action.MAIN" />
22
+ <category android:name="android.intent.category.LAUNCHER" />
23
+ </intent-filter>
24
+ </activity>
25
+ </application>
26
+ </manifest>
@@ -0,0 +1,22 @@
1
+ package <%= packageName %>
2
+
3
+ import com.facebook.react.ReactActivity
4
+ import com.facebook.react.ReactActivityDelegate
5
+ import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
6
+ import com.facebook.react.defaults.DefaultReactActivityDelegate
7
+
8
+ class MainActivity : ReactActivity() {
9
+
10
+ /**
11
+ * Returns the name of the main component registered from JavaScript. This is used to schedule
12
+ * rendering of the component.
13
+ */
14
+ override fun getMainComponentName(): String = "<%= appName %>"
15
+
16
+ /**
17
+ * Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]
18
+ * which allows you to enable New Architecture with a single boolean flags [fabricEnabled]
19
+ */
20
+ override fun createReactActivityDelegate(): ReactActivityDelegate =
21
+ DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled)
22
+ }
@@ -0,0 +1,44 @@
1
+ package <%= packageName %>
2
+
3
+ import android.app.Application
4
+ import com.facebook.react.PackageList
5
+ import com.facebook.react.ReactApplication
6
+ import com.facebook.react.ReactHost
7
+ import com.facebook.react.ReactNativeHost
8
+ import com.facebook.react.ReactPackage
9
+ import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
10
+ import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
11
+ import com.facebook.react.defaults.DefaultReactNativeHost
12
+ import com.facebook.react.soloader.OpenSourceMergedSoMapping
13
+ import com.facebook.soloader.SoLoader
14
+
15
+ class MainApplication : Application(), ReactApplication {
16
+
17
+ override val reactNativeHost: ReactNativeHost =
18
+ object : DefaultReactNativeHost(this) {
19
+ override fun getPackages(): List<ReactPackage> =
20
+ PackageList(this).packages.apply {
21
+ // Packages that cannot be autolinked yet can be added manually here, for example:
22
+ // add(MyReactNativePackage())
23
+ }
24
+
25
+ override fun getJSMainModuleName(): String = "index"
26
+
27
+ override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG
28
+
29
+ override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
30
+ override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED
31
+ }
32
+
33
+ override val reactHost: ReactHost
34
+ get() = getDefaultReactHost(applicationContext, reactNativeHost)
35
+
36
+ override fun onCreate() {
37
+ super.onCreate()
38
+ SoLoader.init(this, OpenSourceMergedSoMapping)
39
+ if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
40
+ // If you opted-in for the New Architecture, we load the native entry point for this app.
41
+ load()
42
+ }
43
+ }
44
+ }
@@ -0,0 +1,3 @@
1
+ <resources>
2
+ <string name="app_name"><%= appName %></string>
3
+ </resources>
@@ -0,0 +1,7 @@
1
+ <resources>
2
+ <!-- Base application theme. -->
3
+ <style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
4
+ <!-- Customize your theme here. -->
5
+ <item name="android:editTextBackground">@drawable/rn_edit_text_material</item>
6
+ </style>
7
+ </resources>
@@ -0,0 +1,44 @@
1
+ buildscript {
2
+ ext {
3
+ buildToolsVersion = "35.0.0"
4
+ minSdkVersion = 24
5
+ compileSdkVersion = 35
6
+ targetSdkVersion = 35
7
+ ndkVersion = "27.1.12297006"
8
+ kotlinVersion = "2.0.21"
9
+ }
10
+ repositories {
11
+ google()
12
+ mavenCentral()
13
+ }
14
+ dependencies {
15
+ classpath("com.android.tools.build:gradle")
16
+ classpath("com.facebook.react:react-native-gradle-plugin")
17
+ classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
18
+ }
19
+ }
20
+
21
+ allprojects {
22
+ repositories {
23
+ maven {
24
+ // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
25
+ url = uri("$rootDir/../node_modules/react-native/android")
26
+ }
27
+ maven {
28
+ // Android JSC is installed from npm
29
+ url = uri("$rootDir/../node_modules/jsc-android/dist")
30
+ }
31
+ mavenCentral {
32
+ // We don't want to fetch react-native from Maven Central as there are
33
+ // temporary older versions pushed on Maven Central.
34
+ content {
35
+ excludeGroup("com.facebook.react")
36
+ }
37
+ }
38
+ google()
39
+ }
40
+ }
41
+
42
+ plugins {
43
+ id("com.facebook.react.rootproject")
44
+ }
@@ -0,0 +1,39 @@
1
+ # Project-wide Gradle settings.
2
+
3
+ # IDE (e.g. Android Studio) users:
4
+ # Gradle settings configured through the IDE *will override*
5
+ # any settings specified in this file.
6
+
7
+ # For more details on how to configure your build environment visit
8
+ # http://www.gradle.org/docs/current/userguide/build_environment.html
9
+
10
+ # Specifies the JVM arguments used for the daemon process.
11
+ # The setting is particularly useful for tweaking memory settings.
12
+ # Default value: -Xmx512m -XX:MaxMetaspaceSize=256m
13
+ org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
14
+
15
+ # When configured, Gradle will run in incubating parallel mode.
16
+ # This option should only be used with decoupled projects. More details, visit
17
+ # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18
+ # org.gradle.parallel=true
19
+
20
+ # AndroidX package structure to make it clearer which packages are bundled with the
21
+ # Android operating system, and which are packaged with your app"s APK
22
+ # https://developer.android.com/topic/libraries/support-library/androidx-rn
23
+ android.useAndroidX=true
24
+
25
+ # Use this property to specify which architecture you want to build.
26
+ # You can also override it from the CLI using
27
+ # ./gradlew <task> -PreactNativeArchitectures=x86_64
28
+ reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
29
+
30
+ # Use this property to enable support to the new architecture.
31
+ # This will allow you to use TurboModules and the Fabric render in
32
+ # your application. You should enable this flag either if you want
33
+ # to write custom TurboModules/Fabric components OR use libraries that
34
+ # are providing them.
35
+ newArchEnabled=true
36
+
37
+ # Use this property to enable or disable the Hermes JS engine.
38
+ # If set to false, you will be using JSC instead.
39
+ hermesEnabled=true
@@ -0,0 +1,12 @@
1
+ pluginManagement {
2
+ includeBuild("../node_modules/@react-native/gradle-plugin")
3
+ }
4
+
5
+ plugins {
6
+ id("com.facebook.react.settings")
7
+ }
8
+
9
+ extensions.configure<com.facebook.react.ReactSettingsExtension> { autolinkLibrariesFromCommand() }
10
+
11
+ rootProject.name = "<%= appName %>"
12
+ include(":app")
@@ -0,0 +1,15 @@
1
+ module.exports = {
2
+ presets: ["module:@react-native/babel-preset"],
3
+ plugins: [
4
+ [
5
+ "module-resolver",
6
+ {
7
+ root: ["./src"],
8
+ extensions: [".ios.js", ".android.js", ".js", ".ts", ".tsx", ".json"],
9
+ alias: {
10
+ "@": "./src",
11
+ },
12
+ },
13
+ ],
14
+ ],
15
+ };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * React Native Entry Point
3
+ *
4
+ * @format
5
+ */
6
+
7
+ import "./src";
@@ -0,0 +1,11 @@
1
+ # This `.xcode.env` file is versioned and is used to source the environment
2
+ # used when running script phases inside Xcode.
3
+ # To customize your local environment, you can create an `.xcode.env.local`
4
+ # file that is not versioned.
5
+
6
+ # NODE_BINARY variable contains the PATH to the node executable.
7
+ #
8
+ # Customize the NODE_BINARY variable here.
9
+ # For example, to use nvm with brew, add the following line
10
+ # . "$(brew --prefix nvm)/nvm.sh" --no-use
11
+ export NODE_BINARY=$(command -v node)
@@ -0,0 +1,25 @@
1
+ import UIKit
2
+ import React
3
+ import React_RCTAppDelegate
4
+
5
+ @main
6
+ class AppDelegate: RCTAppDelegate {
7
+ override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
8
+ self.moduleName = "<%= appName %>"
9
+ self.initialProps = [:]
10
+
11
+ return super.application(application, didFinishLaunchingWithOptions: launchOptions)
12
+ }
13
+
14
+ override func sourceURL(for bridge: RCTBridge) -> URL? {
15
+ return self.bundleURL()
16
+ }
17
+
18
+ override func bundleURL() -> URL? {
19
+ #if DEBUG
20
+ return RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index")
21
+ #else
22
+ return Bundle.main.url(forResource: "main", withExtension: "jsbundle")
23
+ #endif
24
+ }
25
+ }
@@ -0,0 +1,4 @@
1
+ //
2
+ // Use this file to import your target's public headers that you would like to expose to Swift.
3
+ //
4
+
@@ -0,0 +1,6 @@
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
+ </dict>
6
+ </plist>