vxrn 2.0.0-beta.58.1 → 2.0.0-beta.60.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.
- package/dist/exports/prebuildWithoutExpo.mjs +205 -1
- package/dist/exports/prebuildWithoutExpo.mjs.map +1 -1
- package/dist/exports/prebuildWithoutExpo.native.js +230 -7
- package/dist/exports/prebuildWithoutExpo.native.js.map +1 -1
- package/expo-plugin.cjs +82 -0
- package/native-project-patches.cjs +24 -4
- package/package.json +13 -11
- package/src/exports/expoPlugin.test.mjs +135 -0
- package/src/exports/prebuildWithoutExpo.test.ts +238 -1
- package/src/exports/prebuildWithoutExpo.ts +269 -0
- package/types/exports/prebuildWithoutExpo.d.ts +4 -0
- package/types/exports/prebuildWithoutExpo.d.ts.map +1 -1
|
@@ -8,6 +8,8 @@ import sharp from "sharp";
|
|
|
8
8
|
const nativeProjectPatches = module.createRequire(import.meta.url)("../../native-project-patches.cjs");
|
|
9
9
|
const TARGET_NAME = /^[A-Za-z][A-Za-z0-9_]*$/;
|
|
10
10
|
const SCHEME = /^[a-z][a-z0-9+.-]*$/i;
|
|
11
|
+
const VERSION = /^\d+\.\d+\.\d+/;
|
|
12
|
+
const BUILD_NUMBER = /^[A-Za-z0-9.]+$/;
|
|
11
13
|
const REVERSE_DNS = /^[A-Za-z][A-Za-z0-9-]*(\.[A-Za-z][A-Za-z0-9-]*)+$/;
|
|
12
14
|
const DEPLOYMENT_TARGET = /^\d+\.\d+$/;
|
|
13
15
|
const HEX_COLOR = /^#[\da-f]{6}$/i;
|
|
@@ -48,6 +50,175 @@ function patchIosBundlePhase(project) {
|
|
|
48
50
|
}
|
|
49
51
|
return patchedProject;
|
|
50
52
|
}
|
|
53
|
+
const SCENE_DELEGATE_FILE_REF_ID = "1A2B3C4D5E6F7A8B9C0D1E2F";
|
|
54
|
+
const SCENE_DELEGATE_BUILD_FILE_ID = "2B3C4D5E6F7A8B9C0D1E2F1A";
|
|
55
|
+
function renderSceneDelegateSwift(appName) {
|
|
56
|
+
return `import UIKit
|
|
57
|
+
import React
|
|
58
|
+
import React_RCTAppDelegate
|
|
59
|
+
import ReactAppDependencyProvider
|
|
60
|
+
|
|
61
|
+
// owns the window and the react native root. with a scene manifest the
|
|
62
|
+
// system creates this delegate per foreground scene instead of asking the
|
|
63
|
+
// app delegate for a window, which is what the xcode 27 sdk requires.
|
|
64
|
+
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
|
|
65
|
+
var window: UIWindow?
|
|
66
|
+
|
|
67
|
+
var reactNativeDelegate: ReactNativeDelegate?
|
|
68
|
+
var reactNativeFactory: RCTReactNativeFactory?
|
|
69
|
+
|
|
70
|
+
func scene(
|
|
71
|
+
_ scene: UIScene,
|
|
72
|
+
willConnectTo session: UISceneSession,
|
|
73
|
+
options connectionOptions: UIScene.ConnectionOptions
|
|
74
|
+
) {
|
|
75
|
+
guard let windowScene = scene as? UIWindowScene else { return }
|
|
76
|
+
let delegate = ReactNativeDelegate()
|
|
77
|
+
let factory = RCTReactNativeFactory(delegate: delegate)
|
|
78
|
+
delegate.dependencyProvider = RCTAppDependencyProvider()
|
|
79
|
+
|
|
80
|
+
reactNativeDelegate = delegate
|
|
81
|
+
reactNativeFactory = factory
|
|
82
|
+
|
|
83
|
+
let window = UIWindow(windowScene: windowScene)
|
|
84
|
+
self.window = window
|
|
85
|
+
|
|
86
|
+
// cold-start links arrive in connectionOptions under scenes, never in
|
|
87
|
+
// the app launchOptions, so they are translated into the launchOptions
|
|
88
|
+
// shape RCTLinkingManager.getInitialURL reads.
|
|
89
|
+
var launchOptions: [UIApplication.LaunchOptionsKey: Any] = [:]
|
|
90
|
+
if let url = connectionOptions.urlContexts.first?.url {
|
|
91
|
+
launchOptions[.url] = url
|
|
92
|
+
}
|
|
93
|
+
if let activity = connectionOptions.userActivities.first(where: {
|
|
94
|
+
$0.activityType == NSUserActivityTypeBrowsingWeb
|
|
95
|
+
}) {
|
|
96
|
+
launchOptions[.userActivityDictionary] = [
|
|
97
|
+
"UIApplicationLaunchOptionsUserActivityTypeKey": activity.activityType,
|
|
98
|
+
"UIApplicationLaunchOptionsUserActivityKey": activity,
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
factory.startReactNative(
|
|
103
|
+
withModuleName: "${appName}",
|
|
104
|
+
in: window,
|
|
105
|
+
launchOptions: launchOptions
|
|
106
|
+
)
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
|
|
110
|
+
guard let url = URLContexts.first?.url else { return }
|
|
111
|
+
RCTLinkingManager.application(UIApplication.shared, open: url, options: [:])
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
func scene(_ scene: UIScene, continue userActivity: NSUserActivity) {
|
|
115
|
+
RCTLinkingManager.application(
|
|
116
|
+
UIApplication.shared,
|
|
117
|
+
continue: userActivity,
|
|
118
|
+
restorationHandler: { _ in }
|
|
119
|
+
)
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
`;
|
|
123
|
+
}
|
|
124
|
+
function insertAfterLine(haystack, anchor, insertion) {
|
|
125
|
+
const anchorIndex = haystack.indexOf(anchor);
|
|
126
|
+
if (anchorIndex === -1) return haystack;
|
|
127
|
+
const lineEnd = haystack.indexOf("\n", anchorIndex);
|
|
128
|
+
if (lineEnd === -1) return `${haystack}
|
|
129
|
+
${insertion}`;
|
|
130
|
+
return `${haystack.slice(0, lineEnd + 1)}${insertion}
|
|
131
|
+
${haystack.slice(lineEnd + 1)}`;
|
|
132
|
+
}
|
|
133
|
+
function patchIosInfoPlistSceneManifest(rendered) {
|
|
134
|
+
const anchor = " <key>LSRequiresIPhoneOS</key>";
|
|
135
|
+
if (!rendered.includes(anchor)) {
|
|
136
|
+
throw new Error("[vxrn] prebuild template Info.plist lost its LSRequiresIPhoneOS anchor");
|
|
137
|
+
}
|
|
138
|
+
return rendered.replace(anchor, ` <key>UIApplicationSceneManifest</key>
|
|
139
|
+
<dict>
|
|
140
|
+
<key>UIApplicationSupportsMultipleScenes</key>
|
|
141
|
+
<false/>
|
|
142
|
+
<key>UISceneConfigurations</key>
|
|
143
|
+
<dict>
|
|
144
|
+
<key>UIWindowSceneSessionRoleApplication</key>
|
|
145
|
+
<array>
|
|
146
|
+
<dict>
|
|
147
|
+
<key>UISceneConfigurationName</key>
|
|
148
|
+
<string>Default Configuration</string>
|
|
149
|
+
<key>UISceneDelegateClassName</key>
|
|
150
|
+
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
|
|
151
|
+
</dict>
|
|
152
|
+
</array>
|
|
153
|
+
</dict>
|
|
154
|
+
</dict>
|
|
155
|
+
${anchor}`);
|
|
156
|
+
}
|
|
157
|
+
function patchIosAppDelegateSceneLifecycle(rendered, appName) {
|
|
158
|
+
const anchor = `@main
|
|
159
|
+
class AppDelegate: UIResponder, UIApplicationDelegate {
|
|
160
|
+
var window: UIWindow?
|
|
161
|
+
|
|
162
|
+
var reactNativeDelegate: ReactNativeDelegate?
|
|
163
|
+
var reactNativeFactory: RCTReactNativeFactory?
|
|
164
|
+
|
|
165
|
+
func application(
|
|
166
|
+
_ application: UIApplication,
|
|
167
|
+
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
|
|
168
|
+
) -> Bool {
|
|
169
|
+
let delegate = ReactNativeDelegate()
|
|
170
|
+
let factory = RCTReactNativeFactory(delegate: delegate)
|
|
171
|
+
delegate.dependencyProvider = RCTAppDependencyProvider()
|
|
172
|
+
|
|
173
|
+
reactNativeDelegate = delegate
|
|
174
|
+
reactNativeFactory = factory
|
|
175
|
+
|
|
176
|
+
window = UIWindow(frame: UIScreen.main.bounds)
|
|
177
|
+
|
|
178
|
+
factory.startReactNative(
|
|
179
|
+
withModuleName: "${appName}",
|
|
180
|
+
in: window,
|
|
181
|
+
launchOptions: launchOptions
|
|
182
|
+
)
|
|
183
|
+
|
|
184
|
+
return true
|
|
185
|
+
}
|
|
186
|
+
}`;
|
|
187
|
+
if (!rendered.includes(anchor)) {
|
|
188
|
+
throw new Error("[vxrn] prebuild template AppDelegate.swift changed shape: cannot move the RN root to the scene delegate");
|
|
189
|
+
}
|
|
190
|
+
return rendered.replace(anchor, `@main
|
|
191
|
+
class AppDelegate: UIResponder, UIApplicationDelegate {
|
|
192
|
+
func application(
|
|
193
|
+
_ application: UIApplication,
|
|
194
|
+
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
|
|
195
|
+
) -> Bool {
|
|
196
|
+
true
|
|
197
|
+
}
|
|
198
|
+
}`);
|
|
199
|
+
}
|
|
200
|
+
function patchIosPbxprojSceneDelegate(rendered, appName) {
|
|
201
|
+
const edits = [
|
|
202
|
+
["/* 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 */; };`],
|
|
203
|
+
["/* 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>"; };`],
|
|
204
|
+
["/* AppDelegate.swift */,", ` ${SCENE_DELEGATE_FILE_REF_ID} /* SceneDelegate.swift */,`],
|
|
205
|
+
["/* AppDelegate.swift in Sources */,", ` ${SCENE_DELEGATE_BUILD_FILE_ID} /* SceneDelegate.swift in Sources */,`]
|
|
206
|
+
];
|
|
207
|
+
let patched = rendered;
|
|
208
|
+
for (const [anchor, insertion] of edits) {
|
|
209
|
+
const next = insertAfterLine(patched, anchor, insertion);
|
|
210
|
+
if (next === patched) {
|
|
211
|
+
throw new Error(`[vxrn] prebuild template project.pbxproj lost its AppDelegate.swift anchor (${anchor})`);
|
|
212
|
+
}
|
|
213
|
+
patched = next;
|
|
214
|
+
}
|
|
215
|
+
return patched;
|
|
216
|
+
}
|
|
217
|
+
function generateSceneDelegate(args) {
|
|
218
|
+
const { dest, platform, app } = args;
|
|
219
|
+
if (platform !== "ios") return;
|
|
220
|
+
FSExtra.writeFileSync(path.join(dest, app.name, "SceneDelegate.swift"), renderSceneDelegateSwift(app.name));
|
|
221
|
+
}
|
|
51
222
|
function fail(message) {
|
|
52
223
|
throw new Error(`[vxrn] invalid native.app: ${message}`);
|
|
53
224
|
}
|
|
@@ -68,6 +239,9 @@ function validatePrebuildApp(app, platform) {
|
|
|
68
239
|
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
240
|
fail("splash requires source, a six-digit hex backgroundColor, and width from 1 to 288");
|
|
70
241
|
}
|
|
242
|
+
if (app.version !== void 0 && !VERSION.test(app.version)) {
|
|
243
|
+
fail(`version "${app.version}" must start with major.minor.patch`);
|
|
244
|
+
}
|
|
71
245
|
if (!platform || platform === "ios") {
|
|
72
246
|
if (!app.ios?.bundleId || !REVERSE_DNS.test(app.ios.bundleId)) {
|
|
73
247
|
fail(`ios.bundleId "${app.ios?.bundleId}" must be reverse-dns`);
|
|
@@ -75,6 +249,9 @@ function validatePrebuildApp(app, platform) {
|
|
|
75
249
|
if (app.ios.deploymentTarget !== void 0 && !DEPLOYMENT_TARGET.test(app.ios.deploymentTarget)) {
|
|
76
250
|
fail(`ios.deploymentTarget "${app.ios.deploymentTarget}" must look like "17.0"`);
|
|
77
251
|
}
|
|
252
|
+
if (app.ios.buildNumber !== void 0 && !BUILD_NUMBER.test(app.ios.buildNumber)) {
|
|
253
|
+
fail(`ios.buildNumber "${app.ios.buildNumber}" must contain only letters, digits, and dots`);
|
|
254
|
+
}
|
|
78
255
|
}
|
|
79
256
|
if (!platform || platform === "android") {
|
|
80
257
|
if (!app.android?.applicationId || !REVERSE_DNS.test(app.android.applicationId)) {
|
|
@@ -83,6 +260,9 @@ function validatePrebuildApp(app, platform) {
|
|
|
83
260
|
if (app.android.minSdk !== void 0 && (!Number.isInteger(app.android.minSdk) || app.android.minSdk < 21 || app.android.minSdk > 36)) {
|
|
84
261
|
fail(`android.minSdk "${app.android.minSdk}" must be an integer from 21 to 36`);
|
|
85
262
|
}
|
|
263
|
+
if (app.android.versionCode !== void 0 && (!Number.isInteger(app.android.versionCode) || app.android.versionCode < 1)) {
|
|
264
|
+
fail(`android.versionCode "${app.android.versionCode}" must be a positive integer`);
|
|
265
|
+
}
|
|
86
266
|
}
|
|
87
267
|
}
|
|
88
268
|
async function generateAppIcons(args) {
|
|
@@ -298,12 +478,24 @@ ${schemes.map((scheme) => ` <data android:scheme="${scheme}" />`).joi
|
|
|
298
478
|
if (platform === "ios" && relativePath.endsWith(".xcodeproj/project.pbxproj")) {
|
|
299
479
|
rendered = rendered.replace(/TARGETED_DEVICE_FAMILY = "1,2";/g, `TARGETED_DEVICE_FAMILY = "${app.ios?.tablet ? "1,2" : "1"}";`);
|
|
300
480
|
}
|
|
481
|
+
if (platform === "ios" && relativePath.endsWith(".xcodeproj/project.pbxproj")) {
|
|
482
|
+
if (app.version !== void 0) {
|
|
483
|
+
rendered = rendered.replace(/MARKETING_VERSION = [^;]+;/g, `MARKETING_VERSION = "${app.version}";`);
|
|
484
|
+
}
|
|
485
|
+
if (app.ios?.buildNumber !== void 0) {
|
|
486
|
+
rendered = rendered.replace(/CURRENT_PROJECT_VERSION = [^;]+;/g, `CURRENT_PROJECT_VERSION = ${app.ios.buildNumber};`);
|
|
487
|
+
}
|
|
488
|
+
}
|
|
301
489
|
if (platform === "ios" && relativePath.endsWith("/Info.plist")) {
|
|
302
490
|
if (app.ios?.usesNonExemptEncryption !== void 0) {
|
|
303
491
|
rendered = rendered.replace(" <key>LSRequiresIPhoneOS</key>", ` <key>ITSAppUsesNonExemptEncryption</key>
|
|
304
492
|
<${app.ios.usesNonExemptEncryption ? "true" : "false"}/>
|
|
305
493
|
<key>LSRequiresIPhoneOS</key>`);
|
|
306
494
|
}
|
|
495
|
+
rendered = patchIosInfoPlistSceneManifest(rendered);
|
|
496
|
+
}
|
|
497
|
+
if (platform === "ios" && relativePath.endsWith("/AppDelegate.swift")) {
|
|
498
|
+
rendered = patchIosAppDelegateSceneLifecycle(rendered, appName);
|
|
307
499
|
}
|
|
308
500
|
if (platform === "ios" && app.ios?.deploymentTarget) {
|
|
309
501
|
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 +513,7 @@ end`);
|
|
|
321
513
|
}
|
|
322
514
|
if (platform === "ios" && relativePath.endsWith(".xcodeproj/project.pbxproj")) {
|
|
323
515
|
rendered = patchIosBundlePhase(rendered);
|
|
516
|
+
rendered = patchIosPbxprojSceneDelegate(rendered, appName);
|
|
324
517
|
}
|
|
325
518
|
if (platform === "ios" && relativePath === "Podfile") {
|
|
326
519
|
if (app.ios?.ccache) rendered = `ENV['USE_CCACHE'] ||= '1'
|
|
@@ -344,6 +537,12 @@ use_frameworks! :linkage => :${app.ios.useFrameworks}`);
|
|
|
344
537
|
if (!rendered.includes("entryFile = file(\"../../package.json\")") || !rendered.includes("[vxrn/one] ensure patches are applied")) {
|
|
345
538
|
throw new Error("[vxrn] failed to apply required Android Gradle patches");
|
|
346
539
|
}
|
|
540
|
+
if (app.version !== void 0) {
|
|
541
|
+
rendered = rendered.replace(/versionName "[^"]*"/g, `versionName "${app.version}"`);
|
|
542
|
+
}
|
|
543
|
+
if (app.android?.versionCode !== void 0) {
|
|
544
|
+
rendered = rendered.replace(/versionCode \d+/g, `versionCode ${app.android.versionCode}`);
|
|
545
|
+
}
|
|
347
546
|
}
|
|
348
547
|
if (platform === "android" && relativePath === "settings.gradle") {
|
|
349
548
|
const hardcodedGradlePlugin = /includeBuild\((['"])\.\.\/node_modules\/@react-native\/gradle-plugin\1\)/g;
|
|
@@ -414,6 +613,11 @@ const generateForPlatform = async (root, platform, app, outDir = path.resolve(ro
|
|
|
414
613
|
platform,
|
|
415
614
|
app
|
|
416
615
|
});
|
|
616
|
+
generateSceneDelegate({
|
|
617
|
+
dest,
|
|
618
|
+
platform,
|
|
619
|
+
app
|
|
620
|
+
});
|
|
417
621
|
};
|
|
418
622
|
function applyAndroidDependencyPatches(args) {
|
|
419
623
|
const { root, app, inventory } = args;
|
|
@@ -459,5 +663,5 @@ const transformPath = (filePath) => {
|
|
|
459
663
|
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
664
|
};
|
|
461
665
|
|
|
462
|
-
export { applyAndroidDependencyPatches, generateForPlatform, getNativeDependencyInventory, installNativeDependencies, renderPrebuildFile, validatePrebuildApp };
|
|
666
|
+
export { applyAndroidDependencyPatches, generateForPlatform, getNativeDependencyInventory, installNativeDependencies, renderPrebuildFile, renderSceneDelegateSwift, validatePrebuildApp };
|
|
463
667
|
//# 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,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,CAAC,KAAK;EAClJ,IAAI,UAAU,SAAS,GAAG,UAAU,KAAK;GAAE;GAAM;GAAS;EAAU,CAAC;CACvE;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 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 VERSION = /^\\d+\\.\\d+\\.\\d+/;\nconst BUILD_NUMBER = /^[A-Za-z0-9.]+$/;\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}\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}\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 (app.version !== void 0 && !VERSION.test(app.version)) {\n fail(`version \"${app.version}\" must start with major.minor.patch`);\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 if (app.ios.buildNumber !== void 0 && !BUILD_NUMBER.test(app.ios.buildNumber)) {\n fail(\n `ios.buildNumber \"${app.ios.buildNumber}\" must contain only letters, digits, and dots`\n );\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 if (app.android.versionCode !== void 0 && (!Number.isInteger(app.android.versionCode) || app.android.versionCode < 1)) {\n fail(\n `android.versionCode \"${app.android.versionCode}\" must be a positive integer`\n );\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(\".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 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":";;;;;;;;AAMA,MAAM,uBAAuB,OAAO,cAAc,YAAY,GAAG,CAAC,CAChE,kCACF;AACA,MAAM,cAAc;AACpB,MAAM,SAAS;AACf,MAAM,UAAU;AAChB,MAAM,eAAe;AACrB,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,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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