vxrn 2.0.0-beta.59.1 → 2.0.0-beta.61.1

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.
@@ -2,15 +2,12 @@ import { execFileSync } from "node:child_process";
2
2
  import module from "node:module";
3
3
  import path from "node:path";
4
4
  import { pathToFileURL } from "node:url";
5
+ import { validateNativeApp } from "@vxrn/utils/nativeAppManifest";
5
6
  import FSExtra from "fs-extra";
6
7
  import sharp from "sharp";
7
8
 
8
9
  const nativeProjectPatches = module.createRequire(import.meta.url)("../../native-project-patches.cjs");
9
- const TARGET_NAME = /^[A-Za-z][A-Za-z0-9_]*$/;
10
- const SCHEME = /^[a-z][a-z0-9+.-]*$/i;
11
- const REVERSE_DNS = /^[A-Za-z][A-Za-z0-9-]*(\.[A-Za-z][A-Za-z0-9-]*)+$/;
12
- const DEPLOYMENT_TARGET = /^\d+\.\d+$/;
13
- const HEX_COLOR = /^#[\da-f]{6}$/i;
10
+ const validatePrebuildApp = validateNativeApp;
14
11
  const ANDROID_DENSITIES = {
15
12
  mdpi: 1,
16
13
  hdpi: 1.5,
@@ -48,42 +45,177 @@ function patchIosBundlePhase(project) {
48
45
  }
49
46
  return patchedProject;
50
47
  }
51
- function fail(message) {
52
- throw new Error(`[vxrn] invalid native.app: ${message}`);
48
+ function escapeXml(value) {
49
+ return value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
53
50
  }
54
- function validatePrebuildApp(app, platform) {
55
- if (!app || typeof app !== "object") fail("manifest must be an object");
56
- if (!app.name || !TARGET_NAME.test(app.name)) {
57
- fail(`name "${app?.name}" must start with a letter and contain only letters, digits, and underscore`);
58
- }
59
- const schemes = app.scheme === void 0 ? [] : Array.isArray(app.scheme) ? app.scheme : [app.scheme];
60
- for (const scheme of schemes) {
61
- if (typeof scheme !== "string" || !SCHEME.test(scheme)) {
62
- fail(`scheme "${scheme}" must be a valid uri scheme`);
63
- }
64
- }
65
- if (app.icon !== void 0 && (!app.icon.source || !HEX_COLOR.test(app.icon.backgroundColor))) {
66
- fail("icon requires source and a six-digit hex backgroundColor");
67
- }
68
- if (app.splash !== void 0 && (!app.splash.source || !HEX_COLOR.test(app.splash.backgroundColor) || app.splash.width !== void 0 && (!Number.isFinite(app.splash.width) || app.splash.width < 1 || app.splash.width > 288))) {
69
- fail("splash requires source, a six-digit hex backgroundColor, and width from 1 to 288");
51
+ const SCENE_DELEGATE_FILE_REF_ID = "1A2B3C4D5E6F7A8B9C0D1E2F";
52
+ const SCENE_DELEGATE_BUILD_FILE_ID = "2B3C4D5E6F7A8B9C0D1E2F1A";
53
+ function renderSceneDelegateSwift(appName) {
54
+ return `import UIKit
55
+ import React
56
+ import React_RCTAppDelegate
57
+ import ReactAppDependencyProvider
58
+
59
+ // owns the window and the react native root. with a scene manifest the
60
+ // system creates this delegate per foreground scene instead of asking the
61
+ // app delegate for a window, which is what the xcode 27 sdk requires.
62
+ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
63
+ var window: UIWindow?
64
+
65
+ var reactNativeDelegate: ReactNativeDelegate?
66
+ var reactNativeFactory: RCTReactNativeFactory?
67
+
68
+ func scene(
69
+ _ scene: UIScene,
70
+ willConnectTo session: UISceneSession,
71
+ options connectionOptions: UIScene.ConnectionOptions
72
+ ) {
73
+ guard let windowScene = scene as? UIWindowScene else { return }
74
+ let delegate = ReactNativeDelegate()
75
+ let factory = RCTReactNativeFactory(delegate: delegate)
76
+ delegate.dependencyProvider = RCTAppDependencyProvider()
77
+
78
+ reactNativeDelegate = delegate
79
+ reactNativeFactory = factory
80
+
81
+ let window = UIWindow(windowScene: windowScene)
82
+ self.window = window
83
+
84
+ // cold-start links arrive in connectionOptions under scenes, never in
85
+ // the app launchOptions, so they are translated into the launchOptions
86
+ // shape RCTLinkingManager.getInitialURL reads.
87
+ var launchOptions: [UIApplication.LaunchOptionsKey: Any] = [:]
88
+ if let url = connectionOptions.urlContexts.first?.url {
89
+ launchOptions[.url] = url
90
+ }
91
+ if let activity = connectionOptions.userActivities.first(where: {
92
+ $0.activityType == NSUserActivityTypeBrowsingWeb
93
+ }) {
94
+ launchOptions[.userActivityDictionary] = [
95
+ "UIApplicationLaunchOptionsUserActivityTypeKey": activity.activityType,
96
+ "UIApplicationLaunchOptionsUserActivityKey": activity,
97
+ ]
98
+ }
99
+
100
+ factory.startReactNative(
101
+ withModuleName: "${appName}",
102
+ in: window,
103
+ launchOptions: launchOptions
104
+ )
105
+ }
106
+
107
+ func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
108
+ guard let url = URLContexts.first?.url else { return }
109
+ RCTLinkingManager.application(UIApplication.shared, open: url, options: [:])
110
+ }
111
+
112
+ func scene(_ scene: UIScene, continue userActivity: NSUserActivity) {
113
+ RCTLinkingManager.application(
114
+ UIApplication.shared,
115
+ continue: userActivity,
116
+ restorationHandler: { _ in }
117
+ )
118
+ }
119
+ }
120
+ `;
121
+ }
122
+ function insertAfterLine(haystack, anchor, insertion) {
123
+ const anchorIndex = haystack.indexOf(anchor);
124
+ if (anchorIndex === -1) return haystack;
125
+ const lineEnd = haystack.indexOf("\n", anchorIndex);
126
+ if (lineEnd === -1) return `${haystack}
127
+ ${insertion}`;
128
+ return `${haystack.slice(0, lineEnd + 1)}${insertion}
129
+ ${haystack.slice(lineEnd + 1)}`;
130
+ }
131
+ function patchIosInfoPlistSceneManifest(rendered) {
132
+ const anchor = " <key>LSRequiresIPhoneOS</key>";
133
+ if (!rendered.includes(anchor)) {
134
+ throw new Error("[vxrn] prebuild template Info.plist lost its LSRequiresIPhoneOS anchor");
70
135
  }
71
- if (!platform || platform === "ios") {
72
- if (!app.ios?.bundleId || !REVERSE_DNS.test(app.ios.bundleId)) {
73
- fail(`ios.bundleId "${app.ios?.bundleId}" must be reverse-dns`);
74
- }
75
- if (app.ios.deploymentTarget !== void 0 && !DEPLOYMENT_TARGET.test(app.ios.deploymentTarget)) {
76
- fail(`ios.deploymentTarget "${app.ios.deploymentTarget}" must look like "17.0"`);
77
- }
136
+ return rendered.replace(anchor, ` <key>UIApplicationSceneManifest</key>
137
+ <dict>
138
+ <key>UIApplicationSupportsMultipleScenes</key>
139
+ <false/>
140
+ <key>UISceneConfigurations</key>
141
+ <dict>
142
+ <key>UIWindowSceneSessionRoleApplication</key>
143
+ <array>
144
+ <dict>
145
+ <key>UISceneConfigurationName</key>
146
+ <string>Default Configuration</string>
147
+ <key>UISceneDelegateClassName</key>
148
+ <string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
149
+ </dict>
150
+ </array>
151
+ </dict>
152
+ </dict>
153
+ ${anchor}`);
154
+ }
155
+ function patchIosAppDelegateSceneLifecycle(rendered, appName) {
156
+ const anchor = `@main
157
+ class AppDelegate: UIResponder, UIApplicationDelegate {
158
+ var window: UIWindow?
159
+
160
+ var reactNativeDelegate: ReactNativeDelegate?
161
+ var reactNativeFactory: RCTReactNativeFactory?
162
+
163
+ func application(
164
+ _ application: UIApplication,
165
+ didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
166
+ ) -> Bool {
167
+ let delegate = ReactNativeDelegate()
168
+ let factory = RCTReactNativeFactory(delegate: delegate)
169
+ delegate.dependencyProvider = RCTAppDependencyProvider()
170
+
171
+ reactNativeDelegate = delegate
172
+ reactNativeFactory = factory
173
+
174
+ window = UIWindow(frame: UIScreen.main.bounds)
175
+
176
+ factory.startReactNative(
177
+ withModuleName: "${appName}",
178
+ in: window,
179
+ launchOptions: launchOptions
180
+ )
181
+
182
+ return true
183
+ }
184
+ }`;
185
+ if (!rendered.includes(anchor)) {
186
+ throw new Error("[vxrn] prebuild template AppDelegate.swift changed shape: cannot move the RN root to the scene delegate");
78
187
  }
79
- if (!platform || platform === "android") {
80
- if (!app.android?.applicationId || !REVERSE_DNS.test(app.android.applicationId)) {
81
- fail(`android.applicationId "${app.android?.applicationId}" must be reverse-dns`);
82
- }
83
- if (app.android.minSdk !== void 0 && (!Number.isInteger(app.android.minSdk) || app.android.minSdk < 21 || app.android.minSdk > 36)) {
84
- fail(`android.minSdk "${app.android.minSdk}" must be an integer from 21 to 36`);
188
+ return rendered.replace(anchor, `@main
189
+ class AppDelegate: UIResponder, UIApplicationDelegate {
190
+ func application(
191
+ _ application: UIApplication,
192
+ didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
193
+ ) -> Bool {
194
+ true
195
+ }
196
+ }`);
197
+ }
198
+ function patchIosPbxprojSceneDelegate(rendered, appName) {
199
+ const edits = [
200
+ ["/* AppDelegate.swift in Sources */ = {isa = PBXBuildFile;", ` ${SCENE_DELEGATE_BUILD_FILE_ID} /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = ${SCENE_DELEGATE_FILE_REF_ID} /* SceneDelegate.swift */; };`],
201
+ ["/* AppDelegate.swift */ = {isa = PBXFileReference;", ` ${SCENE_DELEGATE_FILE_REF_ID} /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = SceneDelegate.swift; path = ${appName}/SceneDelegate.swift; sourceTree = "<group>"; };`],
202
+ ["/* AppDelegate.swift */,", ` ${SCENE_DELEGATE_FILE_REF_ID} /* SceneDelegate.swift */,`],
203
+ ["/* AppDelegate.swift in Sources */,", ` ${SCENE_DELEGATE_BUILD_FILE_ID} /* SceneDelegate.swift in Sources */,`]
204
+ ];
205
+ let patched = rendered;
206
+ for (const [anchor, insertion] of edits) {
207
+ const next = insertAfterLine(patched, anchor, insertion);
208
+ if (next === patched) {
209
+ throw new Error(`[vxrn] prebuild template project.pbxproj lost its AppDelegate.swift anchor (${anchor})`);
85
210
  }
211
+ patched = next;
86
212
  }
213
+ return patched;
214
+ }
215
+ function generateSceneDelegate(args) {
216
+ const { dest, platform, app } = args;
217
+ if (platform !== "ios") return;
218
+ FSExtra.writeFileSync(path.join(dest, app.name, "SceneDelegate.swift"), renderSceneDelegateSwift(app.name));
87
219
  }
88
220
  async function generateAppIcons(args) {
89
221
  const { root, dest, platform, app } = args;
@@ -285,6 +417,14 @@ ${schemes.map((scheme) => ` <string>${scheme}</string>`).join("\n")}
285
417
  </dict>
286
418
  </array>
287
419
  <key>LSRequiresIPhoneOS</key>`);
420
+ }
421
+ if (platform === "android" && relativePath === "app/src/main/AndroidManifest.xml" && app.imagePicker?.camera !== void 0) {
422
+ const anchor = "<uses-permission android:name=\"android.permission.INTERNET\" />";
423
+ if (!rendered.includes(anchor)) {
424
+ throw new Error("[vxrn] cannot stamp the camera permission: expected the INTERNET permission in app/src/main/AndroidManifest.xml");
425
+ }
426
+ rendered = rendered.replace(anchor, `${anchor}
427
+ <uses-permission android:name="android.permission.CAMERA" />`);
288
428
  }
289
429
  if (platform === "android" && relativePath === "app/src/main/AndroidManifest.xml" && schemes.length) {
290
430
  rendered = rendered.replace(" </activity>", ` <intent-filter>
@@ -298,12 +438,33 @@ ${schemes.map((scheme) => ` <data android:scheme="${scheme}" />`).joi
298
438
  if (platform === "ios" && relativePath.endsWith(".xcodeproj/project.pbxproj")) {
299
439
  rendered = rendered.replace(/TARGETED_DEVICE_FAMILY = "1,2";/g, `TARGETED_DEVICE_FAMILY = "${app.ios?.tablet ? "1,2" : "1"}";`);
300
440
  }
441
+ if (platform === "ios" && relativePath.endsWith(".xcodeproj/project.pbxproj")) {
442
+ if (app.version !== void 0) {
443
+ rendered = rendered.replace(/MARKETING_VERSION = [^;]+;/g, `MARKETING_VERSION = "${app.version}";`);
444
+ }
445
+ if (app.ios?.buildNumber !== void 0) {
446
+ rendered = rendered.replace(/CURRENT_PROJECT_VERSION = [^;]+;/g, `CURRENT_PROJECT_VERSION = ${app.ios.buildNumber};`);
447
+ }
448
+ }
301
449
  if (platform === "ios" && relativePath.endsWith("/Info.plist")) {
302
450
  if (app.ios?.usesNonExemptEncryption !== void 0) {
303
451
  rendered = rendered.replace(" <key>LSRequiresIPhoneOS</key>", ` <key>ITSAppUsesNonExemptEncryption</key>
304
452
  <${app.ios.usesNonExemptEncryption ? "true" : "false"}/>
305
453
  <key>LSRequiresIPhoneOS</key>`);
306
454
  }
455
+ if (app.imagePicker?.camera !== void 0) {
456
+ const anchor = " <key>LSRequiresIPhoneOS</key>";
457
+ if (!rendered.includes(anchor)) {
458
+ throw new Error("[vxrn] cannot stamp NSCameraUsageDescription: expected LSRequiresIPhoneOS in Info.plist");
459
+ }
460
+ rendered = rendered.replace(anchor, ` <key>NSCameraUsageDescription</key>
461
+ <string>${escapeXml(app.imagePicker.camera)}</string>
462
+ ${anchor}`);
463
+ }
464
+ rendered = patchIosInfoPlistSceneManifest(rendered);
465
+ }
466
+ if (platform === "ios" && relativePath.endsWith("/AppDelegate.swift")) {
467
+ rendered = patchIosAppDelegateSceneLifecycle(rendered, appName);
307
468
  }
308
469
  if (platform === "ios" && app.ios?.deploymentTarget) {
309
470
  rendered = rendered.replace("platform :ios, min_ios_version_supported", `platform :ios, '${app.ios.deploymentTarget}'`).replace(/IPHONEOS_DEPLOYMENT_TARGET = \d+(?:\.\d+)?;/g, `IPHONEOS_DEPLOYMENT_TARGET = ${app.ios.deploymentTarget};`);
@@ -321,6 +482,7 @@ end`);
321
482
  }
322
483
  if (platform === "ios" && relativePath.endsWith(".xcodeproj/project.pbxproj")) {
323
484
  rendered = patchIosBundlePhase(rendered);
485
+ rendered = patchIosPbxprojSceneDelegate(rendered, appName);
324
486
  }
325
487
  if (platform === "ios" && relativePath === "Podfile") {
326
488
  if (app.ios?.ccache) rendered = `ENV['USE_CCACHE'] ||= '1'
@@ -344,6 +506,12 @@ use_frameworks! :linkage => :${app.ios.useFrameworks}`);
344
506
  if (!rendered.includes("entryFile = file(\"../../package.json\")") || !rendered.includes("[vxrn/one] ensure patches are applied")) {
345
507
  throw new Error("[vxrn] failed to apply required Android Gradle patches");
346
508
  }
509
+ if (app.version !== void 0) {
510
+ rendered = rendered.replace(/versionName "[^"]*"/g, `versionName "${app.version}"`);
511
+ }
512
+ if (app.android?.versionCode !== void 0) {
513
+ rendered = rendered.replace(/versionCode \d+/g, `versionCode ${app.android.versionCode}`);
514
+ }
347
515
  }
348
516
  if (platform === "android" && relativePath === "settings.gradle") {
349
517
  const hardcodedGradlePlugin = /includeBuild\((['"])\.\.\/node_modules\/@react-native\/gradle-plugin\1\)/g;
@@ -414,6 +582,11 @@ const generateForPlatform = async (root, platform, app, outDir = path.resolve(ro
414
582
  platform,
415
583
  app
416
584
  });
585
+ generateSceneDelegate({
586
+ dest,
587
+ platform,
588
+ app
589
+ });
417
590
  };
418
591
  function applyAndroidDependencyPatches(args) {
419
592
  const { root, app, inventory } = args;
@@ -459,5 +632,5 @@ const transformPath = (filePath) => {
459
632
  return filePath.replace("_BUCK", "BUCK").replace("_gitignore", ".gitignore").replace("_gitattributes", ".gitattributes").replace("_babelrc", ".babelrc").replace("_editorconfig", ".editorconfig").replace("_eslintrc.js", ".eslintrc.js").replace("_flowconfig", ".flowconfig").replace("_buckconfig", ".buckconfig").replace("_prettierrc.js", ".prettierrc.js").replace("_bundle", ".bundle").replace("_ruby-version", ".ruby-version").replace("_node-version", ".node-version").replace("_watchmanconfig", ".watchmanconfig").replace("_xcode.env", ".xcode.env");
460
633
  };
461
634
 
462
- export { applyAndroidDependencyPatches, generateForPlatform, getNativeDependencyInventory, installNativeDependencies, renderPrebuildFile, validatePrebuildApp };
635
+ export { applyAndroidDependencyPatches, generateForPlatform, getNativeDependencyInventory, installNativeDependencies, renderPrebuildFile, renderSceneDelegateSwift, validatePrebuildApp };
463
636
  //# sourceMappingURL=prebuildWithoutExpo.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"prebuildWithoutExpo.js","names":[],"sources":["exports/prebuildWithoutExpo.js"],"sourcesContent":["import { execFileSync } from \"node:child_process\";\nimport module from \"node:module\";\nimport path from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport FSExtra from \"fs-extra\";\nimport sharp from \"sharp\";\nconst nativeProjectPatches = module.createRequire(import.meta.url)(\n \"../../native-project-patches.cjs\"\n);\nconst TARGET_NAME = /^[A-Za-z][A-Za-z0-9_]*$/;\nconst SCHEME = /^[a-z][a-z0-9+.-]*$/i;\nconst REVERSE_DNS = /^[A-Za-z][A-Za-z0-9-]*(\\.[A-Za-z][A-Za-z0-9-]*)+$/;\nconst DEPLOYMENT_TARGET = /^\\d+\\.\\d+$/;\nconst HEX_COLOR = /^#[\\da-f]{6}$/i;\nconst ANDROID_DENSITIES = {\n mdpi: 1,\n hdpi: 1.5,\n xhdpi: 2,\n xxhdpi: 3,\n xxxhdpi: 4\n};\nconst IOS_BUNDLE_PLACEHOLDER = \"org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)\";\nconst ANDROID_PACKAGE_PLACEHOLDER = \"com.helloworld\";\nconst ANDROID_PACKAGE_PATH = \"com/helloworld\";\nfunction patchIosBundlePhase(project) {\n let patchedBundlePhases = 0;\n const patchedProject = project.replace(\n /shellScript = (\"(?:\\\\.|[^\"\\\\])*\");/g,\n (assignment, serializedScript) => {\n let script;\n try {\n script = JSON.parse(serializedScript);\n } catch {\n return assignment;\n }\n if (typeof script !== \"string\" || !script.includes(\"react-native-xcode.sh\")) {\n return assignment;\n }\n let patched = script;\n patched = nativeProjectPatches.addSetCliPathToBundleReactNativeShellScript(patched);\n patched = nativeProjectPatches.addPodHermescToBundleReactNativeShellScript(patched);\n patched = nativeProjectPatches.addDepsPatchToBundleReactNativeShellScript(patched);\n if (!patched.includes(\"[vxrn/one] React Native now defaults CLI_PATH\") || !patched.includes(\"[vxrn/one] use the hermes-engine pod\") || !patched.includes(\"[vxrn/one] ensure patches are applied\")) {\n throw new Error(\"[vxrn] failed to apply required iOS bundle phase patches\");\n }\n patchedBundlePhases++;\n return `shellScript = ${JSON.stringify(patched)};`;\n }\n );\n if (patchedBundlePhases !== 1) {\n throw new Error(\n `[vxrn] expected one iOS React Native bundle phase, found ${patchedBundlePhases}`\n );\n }\n return patchedProject;\n}\nfunction fail(message) {\n throw new Error(`[vxrn] invalid native.app: ${message}`);\n}\nfunction validatePrebuildApp(app, platform) {\n if (!app || typeof app !== \"object\") fail(\"manifest must be an object\");\n if (!app.name || !TARGET_NAME.test(app.name)) {\n fail(\n `name \"${app?.name}\" must start with a letter and contain only letters, digits, and underscore`\n );\n }\n const schemes = app.scheme === void 0 ? [] : Array.isArray(app.scheme) ? app.scheme : [app.scheme];\n for (const scheme of schemes) {\n if (typeof scheme !== \"string\" || !SCHEME.test(scheme)) {\n fail(`scheme \"${scheme}\" must be a valid uri scheme`);\n }\n }\n if (app.icon !== void 0 && (!app.icon.source || !HEX_COLOR.test(app.icon.backgroundColor))) {\n fail(\"icon requires source and a six-digit hex backgroundColor\");\n }\n if (app.splash !== void 0 && (!app.splash.source || !HEX_COLOR.test(app.splash.backgroundColor) || app.splash.width !== void 0 && (!Number.isFinite(app.splash.width) || app.splash.width < 1 || app.splash.width > 288))) {\n fail(\n \"splash requires source, a six-digit hex backgroundColor, and width from 1 to 288\"\n );\n }\n if (!platform || platform === \"ios\") {\n if (!app.ios?.bundleId || !REVERSE_DNS.test(app.ios.bundleId)) {\n fail(`ios.bundleId \"${app.ios?.bundleId}\" must be reverse-dns`);\n }\n if (app.ios.deploymentTarget !== void 0 && !DEPLOYMENT_TARGET.test(app.ios.deploymentTarget)) {\n fail(`ios.deploymentTarget \"${app.ios.deploymentTarget}\" must look like \"17.0\"`);\n }\n }\n if (!platform || platform === \"android\") {\n if (!app.android?.applicationId || !REVERSE_DNS.test(app.android.applicationId)) {\n fail(`android.applicationId \"${app.android?.applicationId}\" must be reverse-dns`);\n }\n if (app.android.minSdk !== void 0 && (!Number.isInteger(app.android.minSdk) || app.android.minSdk < 21 || app.android.minSdk > 36)) {\n fail(`android.minSdk \"${app.android.minSdk}\" must be an integer from 21 to 36`);\n }\n }\n}\nasync function generateAppIcons(args) {\n const { root, dest, platform, app } = args;\n if (!app.icon) return;\n const source = path.resolve(root, app.icon.source);\n if (!FSExtra.existsSync(source)) {\n throw new Error(`[vxrn] native.app.icon source does not exist: ${source}`);\n }\n const metadata = await sharp(source).metadata();\n if (metadata.width === void 0 || metadata.height === void 0 || metadata.width !== metadata.height || metadata.width < 1024) {\n throw new Error(\n \"[vxrn] native.app.icon source must be a square image at least 1024px wide\"\n );\n }\n if (platform === \"ios\") {\n const iconDir = path.join(dest, app.name, \"Images.xcassets\", \"AppIcon.appiconset\");\n const contentsPath = path.join(iconDir, \"Contents.json\");\n const contents = JSON.parse(FSExtra.readFileSync(contentsPath, \"utf8\"));\n for (const image of contents.images) {\n const points = Number.parseFloat(image.size.split(\"x\")[0]);\n const scale = Number.parseInt(image.scale, 10);\n const pixels = points * scale;\n const filename = image.idiom === \"ios-marketing\" ? \"icon-1024.png\" : `icon-${points}@${image.scale}.png`;\n image.filename = filename;\n await sharp(source).rotate().resize(pixels, pixels, { fit: \"cover\" }).flatten({ background: app.icon.backgroundColor }).png().toFile(path.join(iconDir, filename));\n }\n FSExtra.writeFileSync(contentsPath, `${JSON.stringify(contents, null, 2)}\n`);\n return;\n }\n for (const [density, multiplier] of Object.entries(ANDROID_DENSITIES)) {\n const pixels = 48 * multiplier;\n const iconDir = path.join(dest, \"app\", \"src\", \"main\", \"res\", `mipmap-${density}`);\n for (const filename of [\"ic_launcher.png\", \"ic_launcher_round.png\"]) {\n await sharp(source).rotate().resize(pixels, pixels, { fit: \"cover\" }).flatten({ background: app.icon.backgroundColor }).png().toFile(path.join(iconDir, filename));\n }\n }\n}\nasync function generateSplashScreen(args) {\n const { root, dest, platform, app } = args;\n if (!app.splash) return;\n const source = path.resolve(root, app.splash.source);\n if (!FSExtra.existsSync(source)) {\n throw new Error(`[vxrn] native.app.splash source does not exist: ${source}`);\n }\n const { data: artwork, info: metadata } = await sharp(source).rotate().trim({ background: app.splash.backgroundColor }).png().toBuffer({ resolveWithObject: true });\n if (!metadata.width || !metadata.height) {\n throw new Error(\"[vxrn] native.app.splash source must be an image\");\n }\n const artworkWidth = app.splash.width ?? 200;\n const artworkHeight = Number(\n (artworkWidth * (metadata.height / metadata.width)).toFixed(3)\n );\n if (platform === \"ios\") {\n const appDir = path.join(dest, app.name);\n const splashDir = path.join(appDir, \"Images.xcassets\", \"Splash.imageset\");\n FSExtra.mkdirSync(splashDir, { recursive: true });\n await sharp(artwork).toFile(path.join(splashDir, \"splash.png\"));\n FSExtra.writeFileSync(\n path.join(splashDir, \"Contents.json\"),\n `${JSON.stringify(\n {\n images: [{ filename: \"splash.png\", idiom: \"universal\", scale: \"1x\" }],\n info: { author: \"xcode\", version: 1 }\n },\n null,\n 2\n )}\n`\n );\n const red = Number.parseInt(app.splash.backgroundColor.slice(1, 3), 16) / 255;\n const green = Number.parseInt(app.splash.backgroundColor.slice(3, 5), 16) / 255;\n const blue = Number.parseInt(app.splash.backgroundColor.slice(5, 7), 16) / 255;\n FSExtra.writeFileSync(\n path.join(appDir, \"LaunchScreen.storyboard\"),\n `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB\" version=\"3.0\" toolsVersion=\"15702\" targetRuntime=\"iOS.CocoaTouch\" propertyAccessControl=\"none\" useAutolayout=\"YES\" launchScreen=\"YES\" useTraitCollections=\"YES\" useSafeAreas=\"YES\" colorMatched=\"YES\" initialViewController=\"launch-controller\">\n <device id=\"retina6_12\" orientation=\"portrait\" appearance=\"light\"/>\n <dependencies>\n <deployment identifier=\"iOS\"/>\n <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"15704\"/>\n <capability name=\"documents saved in the Xcode 8 format\" minToolsVersion=\"8.0\"/>\n </dependencies>\n <scenes>\n <scene sceneID=\"launch-scene\">\n <objects>\n <viewController id=\"launch-controller\" sceneMemberID=\"viewController\">\n <view key=\"view\" contentMode=\"scaleToFill\" id=\"launch-view\">\n <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"390\" height=\"844\"/>\n <subviews>\n <imageView userInteractionEnabled=\"NO\" contentMode=\"scaleAspectFit\" image=\"Splash\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"splash-image\"/>\n </subviews>\n <color key=\"backgroundColor\" red=\"${red}\" green=\"${green}\" blue=\"${blue}\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"sRGB\"/>\n <constraints>\n <constraint firstItem=\"splash-image\" firstAttribute=\"centerX\" secondItem=\"launch-view\" secondAttribute=\"centerX\" id=\"splash-center-x\"/>\n <constraint firstItem=\"splash-image\" firstAttribute=\"centerY\" secondItem=\"launch-view\" secondAttribute=\"centerY\" id=\"splash-center-y\"/>\n <constraint firstItem=\"splash-image\" firstAttribute=\"width\" constant=\"${artworkWidth}\" id=\"splash-width\"/>\n <constraint firstItem=\"splash-image\" firstAttribute=\"height\" constant=\"${artworkHeight}\" id=\"splash-height\"/>\n </constraints>\n </view>\n </viewController>\n <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"launch-responder\" sceneMemberID=\"firstResponder\"/>\n </objects>\n </scene>\n </scenes>\n <resources>\n <image name=\"Splash\" width=\"${metadata.width}\" height=\"${metadata.height}\"/>\n </resources>\n</document>\n`\n );\n return;\n }\n const mainRes = path.join(dest, \"app\", \"src\", \"main\", \"res\");\n const drawable = path.join(mainRes, \"drawable\");\n for (const [density, multiplier] of Object.entries(ANDROID_DENSITIES)) {\n const canvasSize = 288 * multiplier;\n const imageSize = Math.round(artworkWidth * multiplier);\n const contained = await sharp(artwork).resize(imageSize, imageSize, {\n fit: \"contain\",\n background: { r: 0, g: 0, b: 0, alpha: 0 }\n }).png().toBuffer();\n const drawableDensity = path.join(mainRes, `drawable-${density}`);\n FSExtra.mkdirSync(drawableDensity, { recursive: true });\n await sharp({\n create: {\n width: canvasSize,\n height: canvasSize,\n channels: 4,\n background: { r: 0, g: 0, b: 0, alpha: 0 }\n }\n }).composite([\n {\n input: contained,\n left: Math.round((canvasSize - imageSize) / 2),\n top: Math.round((canvasSize - imageSize) / 2)\n }\n ]).png().toFile(path.join(drawableDensity, \"splash.png\"));\n }\n FSExtra.writeFileSync(\n path.join(drawable, \"launch_screen.xml\"),\n `<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<layer-list xmlns:android=\"http://schemas.android.com/apk/res/android\">\n <item android:drawable=\"@color/splash_background\" />\n <item>\n <bitmap android:gravity=\"center\" android:src=\"@drawable/splash\" />\n </item>\n</layer-list>\n`\n );\n FSExtra.writeFileSync(\n path.join(mainRes, \"values\", \"colors.xml\"),\n `<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <color name=\"splash_background\">${app.splash.backgroundColor}</color>\n</resources>\n`\n );\n const stylesPath = path.join(mainRes, \"values\", \"styles.xml\");\n const styles = FSExtra.readFileSync(stylesPath, \"utf8\").replace(\n \" <!-- Customize your theme here. -->\",\n ' <item name=\"android:windowBackground\">@drawable/launch_screen</item>'\n );\n FSExtra.writeFileSync(stylesPath, styles);\n const stylesV31 = path.join(mainRes, \"values-v31\");\n FSExtra.mkdirSync(stylesV31, { recursive: true });\n FSExtra.writeFileSync(\n path.join(stylesV31, \"styles.xml\"),\n `<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <style name=\"AppTheme\">\n <item name=\"android:windowSplashScreenBackground\">@color/splash_background</item>\n <item name=\"android:windowSplashScreenAnimatedIcon\">@drawable/splash</item>\n </style>\n</resources>\n`\n );\n}\nfunction renderPrebuildFile(args) {\n const { relativePath, content, platform, app } = args;\n const appName = app.name;\n const schemes = app.scheme === void 0 ? [] : Array.isArray(app.scheme) ? app.scheme : [app.scheme];\n let destRelativePath = transformPath(relativePath);\n if (platform === \"android\" && app.android) {\n const packagePath = app.android.applicationId.split(\".\").join(\"/\");\n destRelativePath = destRelativePath.split(ANDROID_PACKAGE_PATH).join(packagePath);\n }\n destRelativePath = destRelativePath.replace(/HelloWorld/g, appName).replace(/helloworld/g, appName.toLowerCase());\n let rendered = content;\n if (rendered !== null) {\n const replacements = [];\n if (platform === \"ios\" && app.ios) {\n replacements.push([IOS_BUNDLE_PLACEHOLDER, app.ios.bundleId]);\n }\n if (platform === \"android\" && app.android) {\n replacements.push([ANDROID_PACKAGE_PLACEHOLDER, app.android.applicationId]);\n }\n replacements.push(\n [\"Hello App Display Name\", app.displayName || appName],\n [\"HelloWorld\", appName],\n [\"helloworld\", appName.toLowerCase()]\n );\n for (const [find, value] of replacements) {\n rendered = rendered.split(find).join(value);\n }\n if (platform === \"ios\" && relativePath.endsWith(\"/Info.plist\") && schemes.length) {\n rendered = rendered.replace(\n \"\t<key>LSRequiresIPhoneOS</key>\",\n `\t<key>CFBundleURLTypes</key>\n\t<array>\n\t\t<dict>\n\t\t\t<key>CFBundleTypeRole</key>\n\t\t\t<string>Editor</string>\n\t\t\t<key>CFBundleURLSchemes</key>\n\t\t\t<array>\n${schemes.map((scheme) => `\t\t\t\t<string>${scheme}</string>`).join(\"\\n\")}\n\t\t\t</array>\n\t\t</dict>\n\t</array>\n\t<key>LSRequiresIPhoneOS</key>`\n );\n }\n if (platform === \"android\" && relativePath === \"app/src/main/AndroidManifest.xml\" && schemes.length) {\n rendered = rendered.replace(\n \" </activity>\",\n ` <intent-filter>\n <action android:name=\"android.intent.action.VIEW\" />\n <category android:name=\"android.intent.category.DEFAULT\" />\n <category android:name=\"android.intent.category.BROWSABLE\" />\n${schemes.map((scheme) => ` <data android:scheme=\"${scheme}\" />`).join(\"\\n\")}\n </intent-filter>\n </activity>`\n );\n }\n if (platform === \"ios\" && relativePath.endsWith(\".xcodeproj/project.pbxproj\")) {\n rendered = rendered.replace(\n /TARGETED_DEVICE_FAMILY = \"1,2\";/g,\n `TARGETED_DEVICE_FAMILY = \"${app.ios?.tablet ? \"1,2\" : \"1\"}\";`\n );\n }\n if (platform === \"ios\" && relativePath.endsWith(\"/Info.plist\")) {\n if (app.ios?.usesNonExemptEncryption !== void 0) {\n rendered = rendered.replace(\n \"\t<key>LSRequiresIPhoneOS</key>\",\n `\t<key>ITSAppUsesNonExemptEncryption</key>\n\t<${app.ios.usesNonExemptEncryption ? \"true\" : \"false\"}/>\n\t<key>LSRequiresIPhoneOS</key>`\n );\n }\n }\n if (platform === \"ios\" && app.ios?.deploymentTarget) {\n rendered = rendered.replace(\n \"platform :ios, min_ios_version_supported\",\n `platform :ios, '${app.ios.deploymentTarget}'`\n ).replace(\n /IPHONEOS_DEPLOYMENT_TARGET = \\d+(?:\\.\\d+)?;/g,\n `IPHONEOS_DEPLOYMENT_TARGET = ${app.ios.deploymentTarget};`\n );\n if (relativePath === \"Podfile\") {\n rendered = rendered.replace(\n \" )\\n end\\nend\",\n ` )\n\n installer.pods_project.targets.each do |target|\n target.build_configurations.each do |config|\n config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '${app.ios.deploymentTarget}'\n end\n end\n end\nend`\n );\n }\n }\n if (platform === \"ios\" && relativePath.endsWith(\".xcodeproj/project.pbxproj\")) {\n rendered = patchIosBundlePhase(rendered);\n }\n if (platform === \"ios\" && relativePath === \"Podfile\") {\n if (app.ios?.ccache) rendered = `ENV['USE_CCACHE'] ||= '1'\n${rendered}`;\n if (app.ios?.useFrameworks) {\n rendered = rendered.replace(\n /^(platform :ios, .+)$/m,\n `$1\nuse_frameworks! :linkage => :${app.ios.useFrameworks}`\n );\n }\n if (app.ios?.screensGamma) {\n rendered = nativeProjectPatches.injectReactNativeScreensGammaIntoPodfile(rendered);\n }\n rendered = nativeProjectPatches.injectFmtCxx17FixIntoPodfile(rendered);\n rendered = nativeProjectPatches.injectHermesMinificationPatchIntoPodfile(rendered);\n if (!rendered.includes(\"[vxrn/one] fmt c++17 fix\") || !rendered.includes(\"[vxrn/one] minify iOS Hermes Release bundle input\")) {\n throw new Error(\"[vxrn] failed to apply required iOS Podfile patches\");\n }\n }\n if (platform === \"android\" && relativePath === \"app/build.gradle\") {\n rendered = nativeProjectPatches.replaceAppBuildGradleReactBlock(rendered);\n rendered = nativeProjectPatches.addDepsPatchToAppBuildGradle(rendered);\n if (!rendered.includes('entryFile = file(\"../../package.json\")') || !rendered.includes(\"[vxrn/one] ensure patches are applied\")) {\n throw new Error(\"[vxrn] failed to apply required Android Gradle patches\");\n }\n }\n if (platform === \"android\" && relativePath === \"settings.gradle\") {\n const hardcodedGradlePlugin = /includeBuild\\((['\"])\\.\\.\\/node_modules\\/@react-native\\/gradle-plugin\\1\\)/g;\n if ([...rendered.matchAll(hardcodedGradlePlugin)].length !== 2) {\n throw new Error(\"[vxrn] expected two React Native Gradle plugin paths\");\n }\n rendered = rendered.replace(\n hardcodedGradlePlugin,\n `includeBuild(new File([\"node\", \"--print\", \"require('module').createRequire(require.resolve('react-native/package.json')).resolve('@react-native/gradle-plugin/package.json')\"].execute(null, settingsDir).text.trim()).parentFile.canonicalPath)`\n );\n }\n if (platform === \"android\" && app.android?.minSdk !== void 0) {\n rendered = rendered.replace(\n /minSdkVersion = \\d+/g,\n `minSdkVersion = ${app.android.minSdk}`\n );\n }\n }\n return { destRelativePath, content: rendered };\n}\nconst generateForPlatform = async (root, platform, app, outDir = path.resolve(root, platform)) => {\n validatePrebuildApp(app, platform);\n const dest = outDir;\n const require2 = module.createRequire(root + \"/\");\n const importPath = require2.resolve(\"@react-native-community/cli/build/tools/walk.js\", {\n paths: [root]\n });\n const src = path.join(\n path.dirname(\n require2.resolve(\"@react-native-community/template/template/package.json\", {\n paths: [root]\n })\n ),\n platform\n );\n const walkModule = await import(pathToFileURL(importPath).href);\n const walkFn = walkModule?.default?.default ?? walkModule?.default ?? walkModule;\n if (typeof walkFn !== \"function\") {\n throw new Error(\"[vxrn] could not resolve the community template walker\");\n }\n const files = [...walkFn(src)].sort();\n FSExtra.removeSync(dest);\n for (const absoluteSrc of files) {\n const relativeFilePath = path.relative(src, absoluteSrc);\n const stat = FSExtra.lstatSync(absoluteSrc);\n if (stat.isDirectory()) continue;\n const extension = path.extname(absoluteSrc);\n const raw = [\".png\", \".jar\", \".keystore\"].includes(extension) ? null : FSExtra.readFileSync(absoluteSrc, \"utf8\");\n const { destRelativePath, content } = renderPrebuildFile({\n relativePath: relativeFilePath,\n content: raw,\n platform,\n app\n });\n const destPath = path.resolve(dest, destRelativePath);\n FSExtra.mkdirSync(path.dirname(destPath), { recursive: true });\n console.info(\"copying\", '\"' + absoluteSrc + '\"', \"to\", '\"' + destPath + '\"');\n if (content === null) {\n FSExtra.copyFileSync(absoluteSrc, destPath);\n continue;\n }\n FSExtra.writeFileSync(destPath, content, {\n encoding: \"utf8\",\n mode: stat.mode\n });\n }\n await generateAppIcons({ root, dest, platform, app });\n await generateSplashScreen({ root, dest, platform, app });\n};\nfunction applyAndroidDependencyPatches(args) {\n const { root, app, inventory } = args;\n if (!app.android || !inventory.some(\n (dependency) => dependency.name === \"react-native-screens\" && dependency.platforms.includes(\"android\")\n )) {\n return;\n }\n const activityPath = path.join(\n root,\n \"android\",\n \"app\",\n \"src\",\n \"main\",\n \"java\",\n ...app.android.applicationId.split(\".\"),\n \"MainActivity.kt\"\n );\n const rendered = nativeProjectPatches.addReactNativeScreensFix(\n FSExtra.readFileSync(activityPath, \"utf8\")\n );\n if (!rendered.includes(\"RNScreensFragmentFactory\")) {\n throw new Error(\"[vxrn] failed to apply the react-native-screens activity patch\");\n }\n FSExtra.writeFileSync(activityPath, rendered);\n}\nasync function getNativeDependencyInventory(root) {\n const require2 = module.createRequire(root + \"/\");\n const cliConfigPath = require2.resolve(\"@react-native-community/cli-config\", {\n paths: [root]\n });\n const cliConfig = await import(pathToFileURL(cliConfigPath).href);\n const config = await cliConfig.loadConfigAsync({ projectRoot: root });\n const inventory = [];\n for (const name of Object.keys(config.dependencies).sort()) {\n const dependency = config.dependencies[name];\n const depRoot = dependency.root;\n let version = \"unknown\";\n try {\n version = JSON.parse(FSExtra.readFileSync(path.join(depRoot, \"package.json\"), \"utf8\")).version ?? \"unknown\";\n } catch {\n }\n const platforms = Object.entries(dependency.platforms).filter(([, platformConfig]) => platformConfig !== null).map(([platform]) => platform).sort();\n if (platforms.length > 0) inventory.push({ name, version, platforms });\n }\n return inventory;\n}\nfunction installNativeDependencies(args) {\n const { root, platform } = args;\n if (!platform || platform === \"ios\") {\n execFileSync(\"pod\", [\"install\", `--project-directory=${path.join(root, \"ios\")}`], {\n stdio: \"inherit\"\n });\n }\n}\nconst transformPath = (filePath) => {\n return filePath.replace(\"_BUCK\", \"BUCK\").replace(\"_gitignore\", \".gitignore\").replace(\"_gitattributes\", \".gitattributes\").replace(\"_babelrc\", \".babelrc\").replace(\"_editorconfig\", \".editorconfig\").replace(\"_eslintrc.js\", \".eslintrc.js\").replace(\"_flowconfig\", \".flowconfig\").replace(\"_buckconfig\", \".buckconfig\").replace(\"_prettierrc.js\", \".prettierrc.js\").replace(\"_bundle\", \".bundle\").replace(\"_ruby-version\", \".ruby-version\").replace(\"_node-version\", \".node-version\").replace(\"_watchmanconfig\", \".watchmanconfig\").replace(\"_xcode.env\", \".xcode.env\");\n};\nexport {\n applyAndroidDependencyPatches,\n generateForPlatform,\n getNativeDependencyInventory,\n installNativeDependencies,\n renderPrebuildFile,\n validatePrebuildApp\n};\n//# sourceMappingURL=prebuildWithoutExpo.js.map\n"],"mappings":";;;;;;;;AAMA,MAAM,uBAAuB,OAAO,cAAc,YAAY,GAAG,CAAC,CAChE,kCACF;AACA,MAAM,cAAc;AACpB,MAAM,SAAS;AACf,MAAM,cAAc;AACpB,MAAM,oBAAoB;AAC1B,MAAM,YAAY;AAClB,MAAM,oBAAoB;CACxB,MAAM;CACN,MAAM;CACN,OAAO;CACP,QAAQ;CACR,SAAS;AACX;AACA,MAAM,yBAAyB;AAC/B,MAAM,8BAA8B;AACpC,MAAM,uBAAuB;AAC7B,SAAS,oBAAoB,SAAS;CACpC,IAAI,sBAAsB;CAC1B,MAAM,iBAAiB,QAAQ,QAC7B,wCACC,YAAY,qBAAqB;EAChC,IAAI;EACJ,IAAI;GACF,SAAS,KAAK,MAAM,gBAAgB;EACtC,QAAQ;GACN,OAAO;EACT;EACA,IAAI,OAAO,WAAW,YAAY,CAAC,OAAO,SAAS,uBAAuB,GAAG;GAC3E,OAAO;EACT;EACA,IAAI,UAAU;EACd,UAAU,qBAAqB,4CAA4C,OAAO;EAClF,U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E;CACA,OAAO;AACT;AACA,SAAS,0BAA0B,MAAM;CACvC,MAAM,EAAE,MAAM,aAAa;CAC3B,IAAI,CAAC,YAAY,aAAa,OAAO;EACnC,aAAa,OAAO,CAAC,WAAW,uBAAuB,KAAK,KAAK,MAAM,KAAK,GAAG,GAAG,EAChF,OAAO,UACT,CAAC;CACH;AACF;AACA,MAAM,iBAAiB,aAAa;CAClC,OAAO,SAAS,QAAQ,SAAS,MAAM,CAAC,CAAC,QAAQ,cAAc,YAAY,CAAC,CAAC,QAAQ,kBAAkB,gBAAgB,CAAC,CAAC,QAAQ,YAAY,UAAU,CAAC,CAAC,QAAQ,iBAAiB,eAAe,CAAC,CAAC,QAAQ,gBAAgB,cAAc,CAAC,CAAC,QAAQ,eAAe,aAAa,CAAC,CAAC,QAAQ,eAAe,aAAa,CAAC,CAAC,QAAQ,kBAAkB,gBAAgB,CAAC,CAAC,QAAQ,WAAW,SAAS,CAAC,CAAC,QAAQ,iBAAiB,eAAe,CAAC,CAAC,QAAQ,iBAAiB,eAAe,CAAC,CAAC,QAAQ,mBAAmB,iBAAiB,CAAC,CAAC,QAAQ,cAAc,YAAY;AACviB"}
1
+ {"version":3,"file":"prebuildWithoutExpo.js","names":[],"sources":["exports/prebuildWithoutExpo.js"],"sourcesContent":["import { execFileSync } from \"node:child_process\";\nimport module from \"node:module\";\nimport path from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport { validateNativeApp } from \"@vxrn/utils/nativeAppManifest\";\nimport FSExtra from \"fs-extra\";\nimport sharp from \"sharp\";\nconst nativeProjectPatches = module.createRequire(import.meta.url)(\n \"../../native-project-patches.cjs\"\n);\nconst validatePrebuildApp = validateNativeApp;\nconst ANDROID_DENSITIES = {\n mdpi: 1,\n hdpi: 1.5,\n xhdpi: 2,\n xxhdpi: 3,\n xxxhdpi: 4\n};\nconst IOS_BUNDLE_PLACEHOLDER = \"org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)\";\nconst ANDROID_PACKAGE_PLACEHOLDER = \"com.helloworld\";\nconst ANDROID_PACKAGE_PATH = \"com/helloworld\";\nfunction patchIosBundlePhase(project) {\n let patchedBundlePhases = 0;\n const patchedProject = project.replace(\n /shellScript = (\"(?:\\\\.|[^\"\\\\])*\");/g,\n (assignment, serializedScript) => {\n let script;\n try {\n script = JSON.parse(serializedScript);\n } catch {\n return assignment;\n }\n if (typeof script !== \"string\" || !script.includes(\"react-native-xcode.sh\")) {\n return assignment;\n }\n let patched = script;\n patched = nativeProjectPatches.addSetCliPathToBundleReactNativeShellScript(patched);\n patched = nativeProjectPatches.addPodHermescToBundleReactNativeShellScript(patched);\n patched = nativeProjectPatches.addDepsPatchToBundleReactNativeShellScript(patched);\n if (!patched.includes(\"[vxrn/one] React Native now defaults CLI_PATH\") || !patched.includes(\"[vxrn/one] use the hermes-engine pod\") || !patched.includes(\"[vxrn/one] ensure patches are applied\")) {\n throw new Error(\"[vxrn] failed to apply required iOS bundle phase patches\");\n }\n patchedBundlePhases++;\n return `shellScript = ${JSON.stringify(patched)};`;\n }\n );\n if (patchedBundlePhases !== 1) {\n throw new Error(\n `[vxrn] expected one iOS React Native bundle phase, found ${patchedBundlePhases}`\n );\n }\n return patchedProject;\n}\nfunction escapeXml(value) {\n return value.replace(/&/g, \"&amp;\").replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\");\n}\nconst SCENE_DELEGATE_FILE_REF_ID = \"1A2B3C4D5E6F7A8B9C0D1E2F\";\nconst SCENE_DELEGATE_BUILD_FILE_ID = \"2B3C4D5E6F7A8B9C0D1E2F1A\";\nfunction renderSceneDelegateSwift(appName) {\n return `import UIKit\nimport React\nimport React_RCTAppDelegate\nimport ReactAppDependencyProvider\n\n// owns the window and the react native root. with a scene manifest the\n// system creates this delegate per foreground scene instead of asking the\n// app delegate for a window, which is what the xcode 27 sdk requires.\nclass SceneDelegate: UIResponder, UIWindowSceneDelegate {\n var window: UIWindow?\n\n var reactNativeDelegate: ReactNativeDelegate?\n var reactNativeFactory: RCTReactNativeFactory?\n\n func scene(\n _ scene: UIScene,\n willConnectTo session: UISceneSession,\n options connectionOptions: UIScene.ConnectionOptions\n ) {\n guard let windowScene = scene as? UIWindowScene else { return }\n let delegate = ReactNativeDelegate()\n let factory = RCTReactNativeFactory(delegate: delegate)\n delegate.dependencyProvider = RCTAppDependencyProvider()\n\n reactNativeDelegate = delegate\n reactNativeFactory = factory\n\n let window = UIWindow(windowScene: windowScene)\n self.window = window\n\n // cold-start links arrive in connectionOptions under scenes, never in\n // the app launchOptions, so they are translated into the launchOptions\n // shape RCTLinkingManager.getInitialURL reads.\n var launchOptions: [UIApplication.LaunchOptionsKey: Any] = [:]\n if let url = connectionOptions.urlContexts.first?.url {\n launchOptions[.url] = url\n }\n if let activity = connectionOptions.userActivities.first(where: {\n $0.activityType == NSUserActivityTypeBrowsingWeb\n }) {\n launchOptions[.userActivityDictionary] = [\n \"UIApplicationLaunchOptionsUserActivityTypeKey\": activity.activityType,\n \"UIApplicationLaunchOptionsUserActivityKey\": activity,\n ]\n }\n\n factory.startReactNative(\n withModuleName: \"${appName}\",\n in: window,\n launchOptions: launchOptions\n )\n }\n\n func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {\n guard let url = URLContexts.first?.url else { return }\n RCTLinkingManager.application(UIApplication.shared, open: url, options: [:])\n }\n\n func scene(_ scene: UIScene, continue userActivity: NSUserActivity) {\n RCTLinkingManager.application(\n UIApplication.shared,\n continue: userActivity,\n restorationHandler: { _ in }\n )\n }\n}\n`;\n}\nfunction insertAfterLine(haystack, anchor, insertion) {\n const anchorIndex = haystack.indexOf(anchor);\n if (anchorIndex === -1) return haystack;\n const lineEnd = haystack.indexOf(\"\\n\", anchorIndex);\n if (lineEnd === -1) return `${haystack}\n${insertion}`;\n return `${haystack.slice(0, lineEnd + 1)}${insertion}\n${haystack.slice(lineEnd + 1)}`;\n}\nfunction patchIosInfoPlistSceneManifest(rendered) {\n const anchor = \"\t<key>LSRequiresIPhoneOS</key>\";\n if (!rendered.includes(anchor)) {\n throw new Error(\"[vxrn] prebuild template Info.plist lost its LSRequiresIPhoneOS anchor\");\n }\n return rendered.replace(\n anchor,\n `\t<key>UIApplicationSceneManifest</key>\n\t<dict>\n\t\t<key>UIApplicationSupportsMultipleScenes</key>\n\t\t<false/>\n\t\t<key>UISceneConfigurations</key>\n\t\t<dict>\n\t\t\t<key>UIWindowSceneSessionRoleApplication</key>\n\t\t\t<array>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>UISceneConfigurationName</key>\n\t\t\t\t\t<string>Default Configuration</string>\n\t\t\t\t\t<key>UISceneDelegateClassName</key>\n\t\t\t\t\t<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>\n\t\t\t\t</dict>\n\t\t\t</array>\n\t\t</dict>\n\t</dict>\n${anchor}`\n );\n}\nfunction patchIosAppDelegateSceneLifecycle(rendered, appName) {\n const anchor = `@main\nclass AppDelegate: UIResponder, UIApplicationDelegate {\n var window: UIWindow?\n\n var reactNativeDelegate: ReactNativeDelegate?\n var reactNativeFactory: RCTReactNativeFactory?\n\n func application(\n _ application: UIApplication,\n didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil\n ) -> Bool {\n let delegate = ReactNativeDelegate()\n let factory = RCTReactNativeFactory(delegate: delegate)\n delegate.dependencyProvider = RCTAppDependencyProvider()\n\n reactNativeDelegate = delegate\n reactNativeFactory = factory\n\n window = UIWindow(frame: UIScreen.main.bounds)\n\n factory.startReactNative(\n withModuleName: \"${appName}\",\n in: window,\n launchOptions: launchOptions\n )\n\n return true\n }\n}`;\n if (!rendered.includes(anchor)) {\n throw new Error(\n \"[vxrn] prebuild template AppDelegate.swift changed shape: cannot move the RN root to the scene delegate\"\n );\n }\n return rendered.replace(\n anchor,\n `@main\nclass AppDelegate: UIResponder, UIApplicationDelegate {\n func application(\n _ application: UIApplication,\n didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil\n ) -> Bool {\n true\n }\n}`\n );\n}\nfunction patchIosPbxprojSceneDelegate(rendered, appName) {\n const edits = [\n [\n \"/* AppDelegate.swift in Sources */ = {isa = PBXBuildFile;\",\n `\t\t${SCENE_DELEGATE_BUILD_FILE_ID} /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = ${SCENE_DELEGATE_FILE_REF_ID} /* SceneDelegate.swift */; };`\n ],\n [\n \"/* AppDelegate.swift */ = {isa = PBXFileReference;\",\n `\t\t${SCENE_DELEGATE_FILE_REF_ID} /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = SceneDelegate.swift; path = ${appName}/SceneDelegate.swift; sourceTree = \"<group>\"; };`\n ],\n [\n \"/* AppDelegate.swift */,\",\n `\t\t\t\t${SCENE_DELEGATE_FILE_REF_ID} /* SceneDelegate.swift */,`\n ],\n [\n \"/* AppDelegate.swift in Sources */,\",\n `\t\t\t\t${SCENE_DELEGATE_BUILD_FILE_ID} /* SceneDelegate.swift in Sources */,`\n ]\n ];\n let patched = rendered;\n for (const [anchor, insertion] of edits) {\n const next = insertAfterLine(patched, anchor, insertion);\n if (next === patched) {\n throw new Error(\n `[vxrn] prebuild template project.pbxproj lost its AppDelegate.swift anchor (${anchor})`\n );\n }\n patched = next;\n }\n return patched;\n}\nfunction generateSceneDelegate(args) {\n const { dest, platform, app } = args;\n if (platform !== \"ios\") return;\n FSExtra.writeFileSync(\n path.join(dest, app.name, \"SceneDelegate.swift\"),\n renderSceneDelegateSwift(app.name)\n );\n}\nasync function generateAppIcons(args) {\n const { root, dest, platform, app } = args;\n if (!app.icon) return;\n const source = path.resolve(root, app.icon.source);\n if (!FSExtra.existsSync(source)) {\n throw new Error(`[vxrn] native.app.icon source does not exist: ${source}`);\n }\n const metadata = await sharp(source).metadata();\n if (metadata.width === void 0 || metadata.height === void 0 || metadata.width !== metadata.height || metadata.width < 1024) {\n throw new Error(\n \"[vxrn] native.app.icon source must be a square image at least 1024px wide\"\n );\n }\n if (platform === \"ios\") {\n const iconDir = path.join(dest, app.name, \"Images.xcassets\", \"AppIcon.appiconset\");\n const contentsPath = path.join(iconDir, \"Contents.json\");\n const contents = JSON.parse(FSExtra.readFileSync(contentsPath, \"utf8\"));\n for (const image of contents.images) {\n const points = Number.parseFloat(image.size.split(\"x\")[0]);\n const scale = Number.parseInt(image.scale, 10);\n const pixels = points * scale;\n const filename = image.idiom === \"ios-marketing\" ? \"icon-1024.png\" : `icon-${points}@${image.scale}.png`;\n image.filename = filename;\n await sharp(source).rotate().resize(pixels, pixels, { fit: \"cover\" }).flatten({ background: app.icon.backgroundColor }).png().toFile(path.join(iconDir, filename));\n }\n FSExtra.writeFileSync(contentsPath, `${JSON.stringify(contents, null, 2)}\n`);\n return;\n }\n for (const [density, multiplier] of Object.entries(ANDROID_DENSITIES)) {\n const pixels = 48 * multiplier;\n const iconDir = path.join(dest, \"app\", \"src\", \"main\", \"res\", `mipmap-${density}`);\n for (const filename of [\"ic_launcher.png\", \"ic_launcher_round.png\"]) {\n await sharp(source).rotate().resize(pixels, pixels, { fit: \"cover\" }).flatten({ background: app.icon.backgroundColor }).png().toFile(path.join(iconDir, filename));\n }\n }\n}\nasync function generateSplashScreen(args) {\n const { root, dest, platform, app } = args;\n if (!app.splash) return;\n const source = path.resolve(root, app.splash.source);\n if (!FSExtra.existsSync(source)) {\n throw new Error(`[vxrn] native.app.splash source does not exist: ${source}`);\n }\n const { data: artwork, info: metadata } = await sharp(source).rotate().trim({ background: app.splash.backgroundColor }).png().toBuffer({ resolveWithObject: true });\n if (!metadata.width || !metadata.height) {\n throw new Error(\"[vxrn] native.app.splash source must be an image\");\n }\n const artworkWidth = app.splash.width ?? 200;\n const artworkHeight = Number(\n (artworkWidth * (metadata.height / metadata.width)).toFixed(3)\n );\n if (platform === \"ios\") {\n const appDir = path.join(dest, app.name);\n const splashDir = path.join(appDir, \"Images.xcassets\", \"Splash.imageset\");\n FSExtra.mkdirSync(splashDir, { recursive: true });\n await sharp(artwork).toFile(path.join(splashDir, \"splash.png\"));\n FSExtra.writeFileSync(\n path.join(splashDir, \"Contents.json\"),\n `${JSON.stringify(\n {\n images: [{ filename: \"splash.png\", idiom: \"universal\", scale: \"1x\" }],\n info: { author: \"xcode\", version: 1 }\n },\n null,\n 2\n )}\n`\n );\n const red = Number.parseInt(app.splash.backgroundColor.slice(1, 3), 16) / 255;\n const green = Number.parseInt(app.splash.backgroundColor.slice(3, 5), 16) / 255;\n const blue = Number.parseInt(app.splash.backgroundColor.slice(5, 7), 16) / 255;\n FSExtra.writeFileSync(\n path.join(appDir, \"LaunchScreen.storyboard\"),\n `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB\" version=\"3.0\" toolsVersion=\"15702\" targetRuntime=\"iOS.CocoaTouch\" propertyAccessControl=\"none\" useAutolayout=\"YES\" launchScreen=\"YES\" useTraitCollections=\"YES\" useSafeAreas=\"YES\" colorMatched=\"YES\" initialViewController=\"launch-controller\">\n <device id=\"retina6_12\" orientation=\"portrait\" appearance=\"light\"/>\n <dependencies>\n <deployment identifier=\"iOS\"/>\n <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"15704\"/>\n <capability name=\"documents saved in the Xcode 8 format\" minToolsVersion=\"8.0\"/>\n </dependencies>\n <scenes>\n <scene sceneID=\"launch-scene\">\n <objects>\n <viewController id=\"launch-controller\" sceneMemberID=\"viewController\">\n <view key=\"view\" contentMode=\"scaleToFill\" id=\"launch-view\">\n <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"390\" height=\"844\"/>\n <subviews>\n <imageView userInteractionEnabled=\"NO\" contentMode=\"scaleAspectFit\" image=\"Splash\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"splash-image\"/>\n </subviews>\n <color key=\"backgroundColor\" red=\"${red}\" green=\"${green}\" blue=\"${blue}\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"sRGB\"/>\n <constraints>\n <constraint firstItem=\"splash-image\" firstAttribute=\"centerX\" secondItem=\"launch-view\" secondAttribute=\"centerX\" id=\"splash-center-x\"/>\n <constraint firstItem=\"splash-image\" firstAttribute=\"centerY\" secondItem=\"launch-view\" secondAttribute=\"centerY\" id=\"splash-center-y\"/>\n <constraint firstItem=\"splash-image\" firstAttribute=\"width\" constant=\"${artworkWidth}\" id=\"splash-width\"/>\n <constraint firstItem=\"splash-image\" firstAttribute=\"height\" constant=\"${artworkHeight}\" id=\"splash-height\"/>\n </constraints>\n </view>\n </viewController>\n <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"launch-responder\" sceneMemberID=\"firstResponder\"/>\n </objects>\n </scene>\n </scenes>\n <resources>\n <image name=\"Splash\" width=\"${metadata.width}\" height=\"${metadata.height}\"/>\n </resources>\n</document>\n`\n );\n return;\n }\n const mainRes = path.join(dest, \"app\", \"src\", \"main\", \"res\");\n const drawable = path.join(mainRes, \"drawable\");\n for (const [density, multiplier] of Object.entries(ANDROID_DENSITIES)) {\n const canvasSize = 288 * multiplier;\n const imageSize = Math.round(artworkWidth * multiplier);\n const contained = await sharp(artwork).resize(imageSize, imageSize, {\n fit: \"contain\",\n background: { r: 0, g: 0, b: 0, alpha: 0 }\n }).png().toBuffer();\n const drawableDensity = path.join(mainRes, `drawable-${density}`);\n FSExtra.mkdirSync(drawableDensity, { recursive: true });\n await sharp({\n create: {\n width: canvasSize,\n height: canvasSize,\n channels: 4,\n background: { r: 0, g: 0, b: 0, alpha: 0 }\n }\n }).composite([\n {\n input: contained,\n left: Math.round((canvasSize - imageSize) / 2),\n top: Math.round((canvasSize - imageSize) / 2)\n }\n ]).png().toFile(path.join(drawableDensity, \"splash.png\"));\n }\n FSExtra.writeFileSync(\n path.join(drawable, \"launch_screen.xml\"),\n `<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<layer-list xmlns:android=\"http://schemas.android.com/apk/res/android\">\n <item android:drawable=\"@color/splash_background\" />\n <item>\n <bitmap android:gravity=\"center\" android:src=\"@drawable/splash\" />\n </item>\n</layer-list>\n`\n );\n FSExtra.writeFileSync(\n path.join(mainRes, \"values\", \"colors.xml\"),\n `<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <color name=\"splash_background\">${app.splash.backgroundColor}</color>\n</resources>\n`\n );\n const stylesPath = path.join(mainRes, \"values\", \"styles.xml\");\n const styles = FSExtra.readFileSync(stylesPath, \"utf8\").replace(\n \" <!-- Customize your theme here. -->\",\n ' <item name=\"android:windowBackground\">@drawable/launch_screen</item>'\n );\n FSExtra.writeFileSync(stylesPath, styles);\n const stylesV31 = path.join(mainRes, \"values-v31\");\n FSExtra.mkdirSync(stylesV31, { recursive: true });\n FSExtra.writeFileSync(\n path.join(stylesV31, \"styles.xml\"),\n `<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <style name=\"AppTheme\">\n <item name=\"android:windowSplashScreenBackground\">@color/splash_background</item>\n <item name=\"android:windowSplashScreenAnimatedIcon\">@drawable/splash</item>\n </style>\n</resources>\n`\n );\n}\nfunction renderPrebuildFile(args) {\n const { relativePath, content, platform, app } = args;\n const appName = app.name;\n const schemes = app.scheme === void 0 ? [] : Array.isArray(app.scheme) ? app.scheme : [app.scheme];\n let destRelativePath = transformPath(relativePath);\n if (platform === \"android\" && app.android) {\n const packagePath = app.android.applicationId.split(\".\").join(\"/\");\n destRelativePath = destRelativePath.split(ANDROID_PACKAGE_PATH).join(packagePath);\n }\n destRelativePath = destRelativePath.replace(/HelloWorld/g, appName).replace(/helloworld/g, appName.toLowerCase());\n let rendered = content;\n if (rendered !== null) {\n const replacements = [];\n if (platform === \"ios\" && app.ios) {\n replacements.push([IOS_BUNDLE_PLACEHOLDER, app.ios.bundleId]);\n }\n if (platform === \"android\" && app.android) {\n replacements.push([ANDROID_PACKAGE_PLACEHOLDER, app.android.applicationId]);\n }\n replacements.push(\n [\"Hello App Display Name\", app.displayName || appName],\n [\"HelloWorld\", appName],\n [\"helloworld\", appName.toLowerCase()]\n );\n for (const [find, value] of replacements) {\n rendered = rendered.split(find).join(value);\n }\n if (platform === \"ios\" && relativePath.endsWith(\"/Info.plist\") && schemes.length) {\n rendered = rendered.replace(\n \"\t<key>LSRequiresIPhoneOS</key>\",\n `\t<key>CFBundleURLTypes</key>\n\t<array>\n\t\t<dict>\n\t\t\t<key>CFBundleTypeRole</key>\n\t\t\t<string>Editor</string>\n\t\t\t<key>CFBundleURLSchemes</key>\n\t\t\t<array>\n${schemes.map((scheme) => `\t\t\t\t<string>${scheme}</string>`).join(\"\\n\")}\n\t\t\t</array>\n\t\t</dict>\n\t</array>\n\t<key>LSRequiresIPhoneOS</key>`\n );\n }\n if (platform === \"android\" && relativePath === \"app/src/main/AndroidManifest.xml\" && app.imagePicker?.camera !== void 0) {\n const anchor = '<uses-permission android:name=\"android.permission.INTERNET\" />';\n if (!rendered.includes(anchor)) {\n throw new Error(\n \"[vxrn] cannot stamp the camera permission: expected the INTERNET permission in app/src/main/AndroidManifest.xml\"\n );\n }\n rendered = rendered.replace(\n anchor,\n `${anchor}\n <uses-permission android:name=\"android.permission.CAMERA\" />`\n );\n }\n if (platform === \"android\" && relativePath === \"app/src/main/AndroidManifest.xml\" && schemes.length) {\n rendered = rendered.replace(\n \" </activity>\",\n ` <intent-filter>\n <action android:name=\"android.intent.action.VIEW\" />\n <category android:name=\"android.intent.category.DEFAULT\" />\n <category android:name=\"android.intent.category.BROWSABLE\" />\n${schemes.map((scheme) => ` <data android:scheme=\"${scheme}\" />`).join(\"\\n\")}\n </intent-filter>\n </activity>`\n );\n }\n if (platform === \"ios\" && relativePath.endsWith(\".xcodeproj/project.pbxproj\")) {\n rendered = rendered.replace(\n /TARGETED_DEVICE_FAMILY = \"1,2\";/g,\n `TARGETED_DEVICE_FAMILY = \"${app.ios?.tablet ? \"1,2\" : \"1\"}\";`\n );\n }\n if (platform === \"ios\" && relativePath.endsWith(\".xcodeproj/project.pbxproj\")) {\n if (app.version !== void 0) {\n rendered = rendered.replace(\n /MARKETING_VERSION = [^;]+;/g,\n `MARKETING_VERSION = \"${app.version}\";`\n );\n }\n if (app.ios?.buildNumber !== void 0) {\n rendered = rendered.replace(\n /CURRENT_PROJECT_VERSION = [^;]+;/g,\n `CURRENT_PROJECT_VERSION = ${app.ios.buildNumber};`\n );\n }\n }\n if (platform === \"ios\" && relativePath.endsWith(\"/Info.plist\")) {\n if (app.ios?.usesNonExemptEncryption !== void 0) {\n rendered = rendered.replace(\n \"\t<key>LSRequiresIPhoneOS</key>\",\n `\t<key>ITSAppUsesNonExemptEncryption</key>\n\t<${app.ios.usesNonExemptEncryption ? \"true\" : \"false\"}/>\n\t<key>LSRequiresIPhoneOS</key>`\n );\n }\n if (app.imagePicker?.camera !== void 0) {\n const anchor = \"\t<key>LSRequiresIPhoneOS</key>\";\n if (!rendered.includes(anchor)) {\n throw new Error(\n \"[vxrn] cannot stamp NSCameraUsageDescription: expected LSRequiresIPhoneOS in Info.plist\"\n );\n }\n rendered = rendered.replace(\n anchor,\n `\t<key>NSCameraUsageDescription</key>\n\t<string>${escapeXml(app.imagePicker.camera)}</string>\n${anchor}`\n );\n }\n rendered = patchIosInfoPlistSceneManifest(rendered);\n }\n if (platform === \"ios\" && relativePath.endsWith(\"/AppDelegate.swift\")) {\n rendered = patchIosAppDelegateSceneLifecycle(rendered, appName);\n }\n if (platform === \"ios\" && app.ios?.deploymentTarget) {\n rendered = rendered.replace(\n \"platform :ios, min_ios_version_supported\",\n `platform :ios, '${app.ios.deploymentTarget}'`\n ).replace(\n /IPHONEOS_DEPLOYMENT_TARGET = \\d+(?:\\.\\d+)?;/g,\n `IPHONEOS_DEPLOYMENT_TARGET = ${app.ios.deploymentTarget};`\n );\n if (relativePath === \"Podfile\") {\n rendered = rendered.replace(\n \" )\\n end\\nend\",\n ` )\n\n installer.pods_project.targets.each do |target|\n target.build_configurations.each do |config|\n config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '${app.ios.deploymentTarget}'\n end\n end\n end\nend`\n );\n }\n }\n if (platform === \"ios\" && relativePath.endsWith(\".xcodeproj/project.pbxproj\")) {\n rendered = patchIosBundlePhase(rendered);\n rendered = patchIosPbxprojSceneDelegate(rendered, appName);\n }\n if (platform === \"ios\" && relativePath === \"Podfile\") {\n if (app.ios?.ccache) rendered = `ENV['USE_CCACHE'] ||= '1'\n${rendered}`;\n if (app.ios?.useFrameworks) {\n rendered = rendered.replace(\n /^(platform :ios, .+)$/m,\n `$1\nuse_frameworks! :linkage => :${app.ios.useFrameworks}`\n );\n }\n if (app.ios?.screensGamma) {\n rendered = nativeProjectPatches.injectReactNativeScreensGammaIntoPodfile(rendered);\n }\n rendered = nativeProjectPatches.injectFmtCxx17FixIntoPodfile(rendered);\n rendered = nativeProjectPatches.injectHermesMinificationPatchIntoPodfile(rendered);\n if (!rendered.includes(\"[vxrn/one] fmt c++17 fix\") || !rendered.includes(\"[vxrn/one] minify iOS Hermes Release bundle input\")) {\n throw new Error(\"[vxrn] failed to apply required iOS Podfile patches\");\n }\n }\n if (platform === \"android\" && relativePath === \"app/build.gradle\") {\n rendered = nativeProjectPatches.replaceAppBuildGradleReactBlock(rendered);\n rendered = nativeProjectPatches.addDepsPatchToAppBuildGradle(rendered);\n if (!rendered.includes('entryFile = file(\"../../package.json\")') || !rendered.includes(\"[vxrn/one] ensure patches are applied\")) {\n throw new Error(\"[vxrn] failed to apply required Android Gradle patches\");\n }\n if (app.version !== void 0) {\n rendered = rendered.replace(\n /versionName \"[^\"]*\"/g,\n `versionName \"${app.version}\"`\n );\n }\n if (app.android?.versionCode !== void 0) {\n rendered = rendered.replace(\n /versionCode \\d+/g,\n `versionCode ${app.android.versionCode}`\n );\n }\n }\n if (platform === \"android\" && relativePath === \"settings.gradle\") {\n const hardcodedGradlePlugin = /includeBuild\\((['\"])\\.\\.\\/node_modules\\/@react-native\\/gradle-plugin\\1\\)/g;\n if ([...rendered.matchAll(hardcodedGradlePlugin)].length !== 2) {\n throw new Error(\"[vxrn] expected two React Native Gradle plugin paths\");\n }\n rendered = rendered.replace(\n hardcodedGradlePlugin,\n `includeBuild(new File([\"node\", \"--print\", \"require('module').createRequire(require.resolve('react-native/package.json')).resolve('@react-native/gradle-plugin/package.json')\"].execute(null, settingsDir).text.trim()).parentFile.canonicalPath)`\n );\n }\n if (platform === \"android\" && app.android?.minSdk !== void 0) {\n rendered = rendered.replace(\n /minSdkVersion = \\d+/g,\n `minSdkVersion = ${app.android.minSdk}`\n );\n }\n }\n return { destRelativePath, content: rendered };\n}\nconst generateForPlatform = async (root, platform, app, outDir = path.resolve(root, platform)) => {\n validatePrebuildApp(app, platform);\n const dest = outDir;\n const require2 = module.createRequire(root + \"/\");\n const importPath = require2.resolve(\"@react-native-community/cli/build/tools/walk.js\", {\n paths: [root]\n });\n const src = path.join(\n path.dirname(\n require2.resolve(\"@react-native-community/template/template/package.json\", {\n paths: [root]\n })\n ),\n platform\n );\n const walkModule = await import(pathToFileURL(importPath).href);\n const walkFn = walkModule?.default?.default ?? walkModule?.default ?? walkModule;\n if (typeof walkFn !== \"function\") {\n throw new Error(\"[vxrn] could not resolve the community template walker\");\n }\n const files = [...walkFn(src)].sort();\n FSExtra.removeSync(dest);\n for (const absoluteSrc of files) {\n const relativeFilePath = path.relative(src, absoluteSrc);\n const stat = FSExtra.lstatSync(absoluteSrc);\n if (stat.isDirectory()) continue;\n const extension = path.extname(absoluteSrc);\n const raw = [\".png\", \".jar\", \".keystore\"].includes(extension) ? null : FSExtra.readFileSync(absoluteSrc, \"utf8\");\n const { destRelativePath, content } = renderPrebuildFile({\n relativePath: relativeFilePath,\n content: raw,\n platform,\n app\n });\n const destPath = path.resolve(dest, destRelativePath);\n FSExtra.mkdirSync(path.dirname(destPath), { recursive: true });\n console.info(\"copying\", '\"' + absoluteSrc + '\"', \"to\", '\"' + destPath + '\"');\n if (content === null) {\n FSExtra.copyFileSync(absoluteSrc, destPath);\n continue;\n }\n FSExtra.writeFileSync(destPath, content, {\n encoding: \"utf8\",\n mode: stat.mode\n });\n }\n await generateAppIcons({ root, dest, platform, app });\n await generateSplashScreen({ root, dest, platform, app });\n generateSceneDelegate({ dest, platform, app });\n};\nfunction applyAndroidDependencyPatches(args) {\n const { root, app, inventory } = args;\n if (!app.android || !inventory.some(\n (dependency) => dependency.name === \"react-native-screens\" && dependency.platforms.includes(\"android\")\n )) {\n return;\n }\n const activityPath = path.join(\n root,\n \"android\",\n \"app\",\n \"src\",\n \"main\",\n \"java\",\n ...app.android.applicationId.split(\".\"),\n \"MainActivity.kt\"\n );\n const rendered = nativeProjectPatches.addReactNativeScreensFix(\n FSExtra.readFileSync(activityPath, \"utf8\")\n );\n if (!rendered.includes(\"RNScreensFragmentFactory\")) {\n throw new Error(\"[vxrn] failed to apply the react-native-screens activity patch\");\n }\n FSExtra.writeFileSync(activityPath, rendered);\n}\nasync function getNativeDependencyInventory(root) {\n const require2 = module.createRequire(root + \"/\");\n const cliConfigPath = require2.resolve(\"@react-native-community/cli-config\", {\n paths: [root]\n });\n const cliConfig = await import(pathToFileURL(cliConfigPath).href);\n const config = await cliConfig.loadConfigAsync({ projectRoot: root });\n const inventory = [];\n for (const name of Object.keys(config.dependencies).sort()) {\n const dependency = config.dependencies[name];\n const depRoot = dependency.root;\n let version = \"unknown\";\n try {\n version = JSON.parse(FSExtra.readFileSync(path.join(depRoot, \"package.json\"), \"utf8\")).version ?? \"unknown\";\n } catch {\n }\n const platforms = Object.entries(dependency.platforms).filter(([, platformConfig]) => platformConfig !== null).map(([platform]) => platform).sort();\n if (platforms.length > 0) inventory.push({ name, version, platforms });\n }\n return inventory;\n}\nfunction installNativeDependencies(args) {\n const { root, platform } = args;\n if (!platform || platform === \"ios\") {\n execFileSync(\"pod\", [\"install\", `--project-directory=${path.join(root, \"ios\")}`], {\n stdio: \"inherit\"\n });\n }\n}\nconst transformPath = (filePath) => {\n return filePath.replace(\"_BUCK\", \"BUCK\").replace(\"_gitignore\", \".gitignore\").replace(\"_gitattributes\", \".gitattributes\").replace(\"_babelrc\", \".babelrc\").replace(\"_editorconfig\", \".editorconfig\").replace(\"_eslintrc.js\", \".eslintrc.js\").replace(\"_flowconfig\", \".flowconfig\").replace(\"_buckconfig\", \".buckconfig\").replace(\"_prettierrc.js\", \".prettierrc.js\").replace(\"_bundle\", \".bundle\").replace(\"_ruby-version\", \".ruby-version\").replace(\"_node-version\", \".node-version\").replace(\"_watchmanconfig\", \".watchmanconfig\").replace(\"_xcode.env\", \".xcode.env\");\n};\nexport {\n applyAndroidDependencyPatches,\n generateForPlatform,\n getNativeDependencyInventory,\n installNativeDependencies,\n renderPrebuildFile,\n renderSceneDelegateSwift,\n validatePrebuildApp\n};\n//# sourceMappingURL=prebuildWithoutExpo.js.map\n"],"mappings":";;;;;;;;;AAOA,MAAM,uBAAuB,OAAO,cAAc,YAAY,GAAG,CAAC,CAChE,kCACF;AACA,MAAM,sBAAsB;AAC5B,MAAM,oBAAoB;CACxB,MAAM;CACN,MAAM;CACN,OAAO;CACP,QAAQ;CACR,SAAS;AACX;AACA,MAAM,yBAAyB;AAC/B,MAAM,8BAA8B;AACpC,MAAM,uBAAuB;AAC7B,SAAS,oBAAoB,SAAS;CACpC,IAAI,sBAAsB;CAC1B,MAAM,iBAAiB,QAAQ,QAC7B,wCACC,YAAY,qBAAqB;EAChC,IAAI;EACJ,IAAI;GACF,SAAS,KAAK,MAAM,gBAAgB;EACtC,QAAQ;GACN,OAAO;EACT;EACA,IAAI,OAAO,WAAW,YAAY,CAAC,OAAO,SAAS,uBAAuB,GAAG;GAC3E,OAAO;EACT;EACA,IAAI,UAAU;EACd,UAAU,qBAAqB,4CAA4C,OAAO;EAClF,UAAU,qBAAqB,4CAA4C,OAAO;EAClF,UAAU,qBAAqB,2CAA2C,OAAO;EACjF,IAAI,CAAC,QAAQ,SAAS,+CAA+C,KAAK,CAAC,QAAQ,SAAS,sCAAsC,KAAK,CAAC,QAAQ,SAAS,uCAAuC,GAAG;GACjM,MAAM,IAAI,MAAM,0DAA0D;EAC5E;EACA;EACA,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