vxrn 2.13.8 → 2.13.10
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/cli.mjs +3 -2
- package/dist/cli.mjs.map +1 -1
- package/dist/cli.native.js +5 -2
- package/dist/cli.native.js.map +1 -1
- package/dist/config/getBaseViteConfigOnly.mjs +3 -3
- package/dist/config/getBaseViteConfigOnly.mjs.map +1 -1
- package/dist/config/getBaseViteConfigOnly.native.js +3 -3
- package/dist/config/getBaseViteConfigOnly.native.js.map +1 -1
- package/dist/config/getOptionsFilled.mjs +24 -2
- package/dist/config/getOptionsFilled.mjs.map +1 -1
- package/dist/config/getOptionsFilled.native.js +25 -2
- package/dist/config/getOptionsFilled.native.js.map +1 -1
- package/dist/config/getServerOptionsFilled.mjs +119 -1
- package/dist/config/getServerOptionsFilled.mjs.map +1 -1
- package/dist/config/getServerOptionsFilled.native.js +137 -1
- package/dist/config/getServerOptionsFilled.native.js.map +1 -1
- package/dist/exports/build.mjs +5 -5
- package/dist/exports/build.mjs.map +1 -1
- package/dist/exports/build.native.js +5 -5
- package/dist/exports/build.native.js.map +1 -1
- package/dist/exports/dev.mjs +4 -6
- package/dist/exports/dev.mjs.map +1 -1
- package/dist/exports/dev.native.js +6 -6
- package/dist/exports/dev.native.js.map +1 -1
- package/dist/exports/prebuild.mjs +4 -4
- package/dist/exports/prebuild.mjs.map +1 -1
- package/dist/exports/prebuild.native.js +4 -4
- package/dist/exports/prebuild.native.js.map +1 -1
- package/dist/exports/prebuildWithoutExpo.mjs +95 -88
- package/dist/exports/prebuildWithoutExpo.mjs.map +1 -1
- package/dist/exports/prebuildWithoutExpo.native.js +95 -88
- package/dist/exports/prebuildWithoutExpo.native.js.map +1 -1
- package/dist/plugins/autoDepOptimizePlugin.mjs +3 -3
- package/dist/plugins/autoDepOptimizePlugin.mjs.map +1 -1
- package/dist/plugins/autoDepOptimizePlugin.native.js +3 -3
- package/dist/plugins/autoDepOptimizePlugin.native.js.map +1 -1
- package/dist/plugins/reactNativeDevAssetPlugin.mjs +4 -4
- package/dist/plugins/reactNativeDevAssetPlugin.mjs.map +1 -1
- package/dist/plugins/reactNativeDevAssetPlugin.native.js +4 -4
- package/dist/plugins/reactNativeDevAssetPlugin.native.js.map +1 -1
- package/dist/rn-commands/bundle/buildBundle.mjs +18 -5
- package/dist/rn-commands/bundle/buildBundle.mjs.map +1 -1
- package/dist/rn-commands/bundle/buildBundle.native.js +18 -5
- package/dist/rn-commands/bundle/buildBundle.native.js.map +1 -1
- package/dist/user-interface/index.mjs +1 -1
- package/dist/user-interface/index.mjs.map +1 -1
- package/dist/user-interface/index.native.js +1 -1
- package/dist/user-interface/index.native.js.map +1 -1
- package/dist/utils/env-editor.mjs +198 -0
- package/dist/utils/env-editor.mjs.map +1 -0
- package/dist/utils/env-editor.native.js +266 -0
- package/dist/utils/env-editor.native.js.map +1 -0
- package/dist/utils/fs.mjs +48 -0
- package/dist/utils/fs.mjs.map +1 -0
- package/dist/utils/fs.native.js +48 -0
- package/dist/utils/fs.native.js.map +1 -0
- package/dist/utils/getVitePath.mjs +2 -2
- package/dist/utils/getVitePath.mjs.map +1 -1
- package/dist/utils/getVitePath.native.js +2 -2
- package/dist/utils/getVitePath.native.js.map +1 -1
- package/dist/utils/patches.mjs +38 -29
- package/dist/utils/patches.mjs.map +1 -1
- package/dist/utils/patches.native.js +38 -29
- package/dist/utils/patches.native.js.map +1 -1
- package/dist/utils/scanDepsToOptimize.mjs +12 -11
- package/dist/utils/scanDepsToOptimize.mjs.map +1 -1
- package/dist/utils/scanDepsToOptimize.native.js +12 -11
- package/dist/utils/scanDepsToOptimize.native.js.map +1 -1
- package/dist/utils/state.mjs +5 -5
- package/dist/utils/state.mjs.map +1 -1
- package/dist/utils/state.native.js +5 -5
- package/dist/utils/state.native.js.map +1 -1
- package/dist/utils/utils.mjs +4 -3
- package/dist/utils/utils.mjs.map +1 -1
- package/dist/utils/utils.native.js +4 -3
- package/dist/utils/utils.native.js.map +1 -1
- package/package.json +12 -18
- package/src/cli.ts +5 -4
- package/src/config/getBaseViteConfigOnly.ts +3 -3
- package/src/config/getOptionsFilled.ts +35 -2
- package/src/config/getServerOptionsFilled.test.ts +37 -0
- package/src/config/getServerOptionsFilled.ts +57 -1
- package/src/exports/build.ts +5 -5
- package/src/exports/clean.test.ts +1 -1
- package/src/exports/dev.ts +5 -6
- package/src/exports/prebuild.ts +4 -4
- package/src/exports/prebuildWithoutExpo.ts +102 -89
- package/src/plugins/autoDepOptimizePlugin.ts +3 -3
- package/src/plugins/reactNativeDevAssetPlugin.ts +4 -4
- package/src/rn-commands/bundle/buildBundle.ts +15 -5
- package/src/user-interface/index.ts +1 -1
- package/src/utils/env-editor.LICENSE +9 -0
- package/src/utils/env-editor.ts +214 -0
- package/src/utils/fs.ts +59 -0
- package/src/utils/getVitePath.ts +2 -2
- package/src/utils/patches.test.ts +36 -36
- package/src/utils/patches.ts +39 -27
- package/src/utils/scanDepsToOptimize.test.ts +2 -2
- package/src/utils/scanDepsToOptimize.ts +6 -5
- package/src/utils/state.ts +5 -7
- package/src/utils/utils.ts +5 -5
- package/types/config/getOptionsFilled.d.ts +9 -2
- package/types/config/getOptionsFilled.d.ts.map +1 -1
- package/types/config/getServerOptionsFilled.d.ts.map +1 -1
- package/types/exports/build.d.ts +1 -1
- package/types/exports/dev.d.ts.map +1 -1
- package/types/exports/prebuildWithoutExpo.d.ts.map +1 -1
- package/types/rn-commands/bundle/buildBundle.d.ts.map +1 -1
- package/types/user-interface/index.d.ts.map +1 -1
- package/types/utils/env-editor.d.ts +9 -0
- package/types/utils/env-editor.d.ts.map +1 -0
- package/types/utils/fs.d.ts +9 -0
- package/types/utils/fs.d.ts.map +1 -0
- package/types/utils/patches.d.ts.map +1 -1
- package/types/utils/scanDepsToOptimize.d.ts.map +1 -1
- package/types/utils/state.d.ts.map +1 -1
- package/types/utils/utils.d.ts +2 -2
- package/types/utils/utils.d.ts.map +1 -1
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { execFileSync } from "child_process";
|
|
2
2
|
import { createHash } from "crypto";
|
|
3
|
+
import { copyFileSync, existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, realpathSync, rmSync, statSync, symlinkSync, writeFileSync } from "fs";
|
|
3
4
|
import module from "module";
|
|
4
5
|
import path from "path";
|
|
5
6
|
import { pathToFileURL } from "url";
|
|
6
7
|
import { androidAppPermissions, androidIconSuffix, appIconPreviewResources, iosUsageDescriptions, validateNativeApp } from "@vxrn/utils/nativeAppManifest";
|
|
7
|
-
import FSExtra from "fs-extra";
|
|
8
8
|
import sharp from "sharp";
|
|
9
|
+
import { readJSONSync } from "../utils/fs.native.js";
|
|
9
10
|
import { swiftPackageDirectories } from "../utils/swiftPackageId.native.js";
|
|
10
11
|
|
|
11
12
|
var requireVxrn = module.createRequire(import.meta.url);
|
|
@@ -187,7 +188,7 @@ ${imports.join("\n")}
|
|
|
187
188
|
`;
|
|
188
189
|
}
|
|
189
190
|
function generateOneBridgingHeader(dest, app) {
|
|
190
|
-
|
|
191
|
+
writeFileSync(path.join(dest, app.name, ONE_BRIDGING_HEADER_NAME), renderOneBridgingHeader(app));
|
|
191
192
|
}
|
|
192
193
|
function patchIosPbxprojOneBridgingHeader(project, appName) {
|
|
193
194
|
var anchor = `INFOPLIST_FILE = ${appName}/Info.plist;`;
|
|
@@ -380,11 +381,11 @@ function copyAppResources(param) {
|
|
|
380
381
|
for (var _iterator = copies[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
381
382
|
var [file, target] = _step.value;
|
|
382
383
|
var source = path.resolve(root, file);
|
|
383
|
-
if (!
|
|
384
|
+
if (!existsSync(source)) {
|
|
384
385
|
throw new Error(`[vxrn] native.app names ${file}, which does not exist`);
|
|
385
386
|
}
|
|
386
|
-
|
|
387
|
-
|
|
387
|
+
mkdirSync(path.dirname(target), { recursive: true });
|
|
388
|
+
copyFileSync(source, target);
|
|
388
389
|
}
|
|
389
390
|
} catch (err) {
|
|
390
391
|
_didIteratorError = true;
|
|
@@ -651,16 +652,16 @@ function generateSceneDelegate(args) {
|
|
|
651
652
|
var _app_ios;
|
|
652
653
|
var { dest, platform, app } = args;
|
|
653
654
|
if (platform !== "ios") return;
|
|
654
|
-
|
|
655
|
+
writeFileSync(path.join(dest, app.name, "SceneDelegate.swift"), renderSceneDelegateSwift(app.name));
|
|
655
656
|
var entitlements = appEntitlements(app);
|
|
656
657
|
if (Object.keys(entitlements).length && !((_app_ios = app.ios) === null || _app_ios === void 0 ? void 0 : _app_ios.widgets)) {
|
|
657
|
-
|
|
658
|
+
writeFileSync(path.join(dest, app.name, `${app.name}.entitlements`), renderEntitlements(entitlements));
|
|
658
659
|
}
|
|
659
660
|
}
|
|
660
661
|
function generateIosAppIntents(dest, platform, app) {
|
|
661
662
|
var _app_ios;
|
|
662
663
|
if (platform !== "ios" || !((_app_ios = app.ios) === null || _app_ios === void 0 ? void 0 : _app_ios.appIntents)) return;
|
|
663
|
-
|
|
664
|
+
writeFileSync(path.join(dest, app.name, "OneAppIntents.swift"), renderIosAppIntentsSwift(app.ios.appIntents.actions));
|
|
664
665
|
}
|
|
665
666
|
function generateIosWidgets(dest, app) {
|
|
666
667
|
var _app_ios, _app_ios1;
|
|
@@ -668,14 +669,14 @@ function generateIosWidgets(dest, app) {
|
|
|
668
669
|
if (!widgets) return;
|
|
669
670
|
var appDir = path.join(dest, app.name);
|
|
670
671
|
var extensionDir = path.join(dest, "OneWidgets");
|
|
671
|
-
|
|
672
|
+
mkdirSync(extensionDir, { recursive: true });
|
|
672
673
|
var entitlements = `<?xml version="1.0" encoding="UTF-8"?>
|
|
673
674
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
674
675
|
<plist version="1.0"><dict><key>com.apple.security.application-groups</key><array><string>${escapeXml(widgets.appGroup)}</string></array></dict></plist>
|
|
675
676
|
`;
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
677
|
+
writeFileSync(path.join(appDir, "OneAppWidgets.entitlements"), renderEntitlements(appEntitlements(app)));
|
|
678
|
+
writeFileSync(path.join(extensionDir, "OneWidgets.entitlements"), entitlements);
|
|
679
|
+
writeFileSync(path.join(extensionDir, "WidgetInfo.plist"), `<?xml version="1.0" encoding="UTF-8"?>
|
|
679
680
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
680
681
|
<plist version="1.0"><dict>
|
|
681
682
|
<key>CFBundleDevelopmentRegion</key><string>$(DEVELOPMENT_LANGUAGE)</string>
|
|
@@ -690,7 +691,7 @@ function generateIosWidgets(dest, app) {
|
|
|
690
691
|
<key>NSExtension</key><dict><key>NSExtensionPointIdentifier</key><string>com.apple.widgetkit-extension</string></dict>
|
|
691
692
|
</dict></plist>
|
|
692
693
|
`);
|
|
693
|
-
|
|
694
|
+
writeFileSync(path.join(appDir, "OneWidgetContract.swift"), `import Foundation
|
|
694
695
|
import ActivityKit
|
|
695
696
|
|
|
696
697
|
enum OneWidgetContract {
|
|
@@ -715,7 +716,7 @@ enum OneWidgetContract {
|
|
|
715
716
|
}
|
|
716
717
|
}
|
|
717
718
|
`);
|
|
718
|
-
|
|
719
|
+
writeFileSync(path.join(extensionDir, "OneWidget.swift"), `import SwiftUI
|
|
719
720
|
import WidgetKit
|
|
720
721
|
import ActivityKit
|
|
721
722
|
|
|
@@ -1003,7 +1004,7 @@ struct OneWidgetsBundle: WidgetBundle {
|
|
|
1003
1004
|
}
|
|
1004
1005
|
}
|
|
1005
1006
|
`);
|
|
1006
|
-
|
|
1007
|
+
writeFileSync(path.join(appDir, "OneWidgetsBridge.m"), `#import <React/RCTBridgeModule.h>
|
|
1007
1008
|
#import <React/RCTEventEmitter.h>
|
|
1008
1009
|
|
|
1009
1010
|
@interface RCT_EXTERN_MODULE(OneWidgetsBridge, RCTEventEmitter)
|
|
@@ -1017,7 +1018,7 @@ RCT_EXTERN_METHOD(end:(NSString *)identifier resolver:(RCTPromiseResolveBlock)re
|
|
|
1017
1018
|
RCT_EXTERN_METHOD(pushToken:(NSString *)identifier resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject)
|
|
1018
1019
|
@end
|
|
1019
1020
|
`);
|
|
1020
|
-
|
|
1021
|
+
writeFileSync(path.join(appDir, "OneWidgetsBridge.swift"), `import Foundation
|
|
1021
1022
|
import React
|
|
1022
1023
|
import WidgetKit
|
|
1023
1024
|
import ActivityKit
|
|
@@ -1193,7 +1194,7 @@ async function writeAppearanceIcon(args) {
|
|
|
1193
1194
|
var variantSource = function variantSource2(variant) {
|
|
1194
1195
|
if (!(variant === null || variant === void 0 ? void 0 : variant.source)) return source;
|
|
1195
1196
|
var resolved = path.resolve(root, variant.source);
|
|
1196
|
-
if (!
|
|
1197
|
+
if (!existsSync(resolved)) {
|
|
1197
1198
|
throw new Error(`[vxrn] native.app icon appearance source does not exist: ${resolved}`);
|
|
1198
1199
|
}
|
|
1199
1200
|
return resolved;
|
|
@@ -1229,7 +1230,7 @@ async function writeAppearanceIcon(args) {
|
|
|
1229
1230
|
await render("icon-1024-tinted.png", variantSource(icon.tinted), (_icon_tinted_backgroundColor = icon.tinted.backgroundColor) !== null && _icon_tinted_backgroundColor !== void 0 ? _icon_tinted_backgroundColor : "#000000", true);
|
|
1230
1231
|
images.push(entry("icon-1024-tinted.png", "tinted"));
|
|
1231
1232
|
}
|
|
1232
|
-
|
|
1233
|
+
writeFileSync(path.join(iconDir, "Contents.json"), `${JSON.stringify({
|
|
1233
1234
|
images,
|
|
1234
1235
|
info: {
|
|
1235
1236
|
author: "xcode",
|
|
@@ -1245,7 +1246,7 @@ async function generateAppIcons(args) {
|
|
|
1245
1246
|
if (platform === "ios") {
|
|
1246
1247
|
var _app_alternateIcons1;
|
|
1247
1248
|
var assetsDir = path.join(dest, app.name, "Images.xcassets");
|
|
1248
|
-
var template = JSON.parse(
|
|
1249
|
+
var template = JSON.parse(readFileSync(path.join(assetsDir, "AppIcon.appiconset", "Contents.json"), "utf8"));
|
|
1249
1250
|
var icons = [["AppIcon", app.icon], ...Object.entries((_app_alternateIcons1 = app.alternateIcons) !== null && _app_alternateIcons1 !== void 0 ? _app_alternateIcons1 : {})];
|
|
1250
1251
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
1251
1252
|
try {
|
|
@@ -1253,7 +1254,7 @@ async function generateAppIcons(args) {
|
|
|
1253
1254
|
var [name, icon] = _step.value;
|
|
1254
1255
|
var _app_ios;
|
|
1255
1256
|
var source = path.resolve(root, icon.source);
|
|
1256
|
-
if (!
|
|
1257
|
+
if (!existsSync(source)) {
|
|
1257
1258
|
throw new Error(`[vxrn] native.app icon source does not exist: ${source}`);
|
|
1258
1259
|
}
|
|
1259
1260
|
var metadata = await sharp(source).metadata();
|
|
@@ -1261,7 +1262,7 @@ async function generateAppIcons(args) {
|
|
|
1261
1262
|
throw new Error(`[vxrn] native.app icon source must be a square image at least 1024px wide: ${source}`);
|
|
1262
1263
|
}
|
|
1263
1264
|
var iconDir = path.join(assetsDir, `${name}.appiconset`);
|
|
1264
|
-
|
|
1265
|
+
mkdirSync(iconDir, { recursive: true });
|
|
1265
1266
|
if (icon.dark || icon.tinted) {
|
|
1266
1267
|
await writeAppearanceIcon({
|
|
1267
1268
|
root,
|
|
@@ -1342,7 +1343,7 @@ async function generateAppIcons(args) {
|
|
|
1342
1343
|
}
|
|
1343
1344
|
}
|
|
1344
1345
|
}
|
|
1345
|
-
|
|
1346
|
+
writeFileSync(path.join(iconDir, "Contents.json"), `${JSON.stringify(contents, null, 2)}
|
|
1346
1347
|
`);
|
|
1347
1348
|
}
|
|
1348
1349
|
} catch (err) {
|
|
@@ -1362,7 +1363,7 @@ async function generateAppIcons(args) {
|
|
|
1362
1363
|
return;
|
|
1363
1364
|
}
|
|
1364
1365
|
var source1 = path.resolve(root, app.icon.source);
|
|
1365
|
-
if (!
|
|
1366
|
+
if (!existsSync(source1)) {
|
|
1366
1367
|
throw new Error(`[vxrn] native.app.icon source does not exist: ${source1}`);
|
|
1367
1368
|
}
|
|
1368
1369
|
var metadata1 = await sharp(source1).metadata();
|
|
@@ -1376,7 +1377,7 @@ async function generateAppIcons(args) {
|
|
|
1376
1377
|
], ...await Promise.all(Object.entries((_app_alternateIcons = app.alternateIcons) !== null && _app_alternateIcons !== void 0 ? _app_alternateIcons : {}).map(async function(param) {
|
|
1377
1378
|
var [name2, icon2] = param;
|
|
1378
1379
|
var alternateSource = path.resolve(root, icon2.source);
|
|
1379
|
-
if (!
|
|
1380
|
+
if (!existsSync(alternateSource)) {
|
|
1380
1381
|
throw new Error(`[vxrn] native.app icon source does not exist: ${alternateSource}`);
|
|
1381
1382
|
}
|
|
1382
1383
|
var alternate = await sharp(alternateSource).metadata();
|
|
@@ -1484,8 +1485,8 @@ function generateAndroidIconForwarder(dest, app) {
|
|
|
1484
1485
|
if (!app.alternateIcons || !app.android) return;
|
|
1485
1486
|
var packageName = app.android.applicationId;
|
|
1486
1487
|
var file = path.join(dest, "app", "src", "main", "java", ...packageName.split("."), "AppIconLauncherActivity.kt");
|
|
1487
|
-
|
|
1488
|
-
|
|
1488
|
+
mkdirSync(path.dirname(file), { recursive: true });
|
|
1489
|
+
writeFileSync(file, `package ${packageName}
|
|
1489
1490
|
|
|
1490
1491
|
import android.app.Activity
|
|
1491
1492
|
import android.content.Intent
|
|
@@ -1517,12 +1518,12 @@ async function generateAppIconPreviews(args) {
|
|
|
1517
1518
|
var resources = appIconPreviewResources(name);
|
|
1518
1519
|
if (platform === "android") {
|
|
1519
1520
|
var dir = path.join(dest, "app", "src", "main", "res", "drawable-nodpi");
|
|
1520
|
-
|
|
1521
|
+
mkdirSync(dir, { recursive: true });
|
|
1521
1522
|
await preview(3).toFile(path.join(dir, `${resources.android}.png`));
|
|
1522
1523
|
return "continue";
|
|
1523
1524
|
}
|
|
1524
1525
|
var dir1 = path.join(dest, app.name, "Images.xcassets", `${resources.ios}.imageset`);
|
|
1525
|
-
|
|
1526
|
+
mkdirSync(dir1, { recursive: true });
|
|
1526
1527
|
var images = [];
|
|
1527
1528
|
for (var _i = 0, _iter = [
|
|
1528
1529
|
1,
|
|
@@ -1538,7 +1539,7 @@ async function generateAppIconPreviews(args) {
|
|
|
1538
1539
|
scale: `${scale}x`
|
|
1539
1540
|
});
|
|
1540
1541
|
}
|
|
1541
|
-
|
|
1542
|
+
writeFileSync(path.join(dir1, "Contents.json"), `${JSON.stringify({
|
|
1542
1543
|
images,
|
|
1543
1544
|
info: {
|
|
1544
1545
|
author: "xcode",
|
|
@@ -1580,7 +1581,7 @@ async function generateAdaptiveIcon(args) {
|
|
|
1580
1581
|
var [layer, file] = _step.value;
|
|
1581
1582
|
if (!file) continue;
|
|
1582
1583
|
var source = path.resolve(root, file);
|
|
1583
|
-
if (!
|
|
1584
|
+
if (!existsSync(source)) {
|
|
1584
1585
|
throw new Error(`[vxrn] native.app.android.adaptiveIcon.${layer} does not exist: ${source}`);
|
|
1585
1586
|
}
|
|
1586
1587
|
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;
|
|
@@ -1621,7 +1622,7 @@ async function generateAdaptiveIcon(args) {
|
|
|
1621
1622
|
}
|
|
1622
1623
|
if (!adaptiveIcon.background) {
|
|
1623
1624
|
var _adaptiveIcon_backgroundColor;
|
|
1624
|
-
|
|
1625
|
+
writeFileSync(path.join(res, "values", "ic_launcher_background.xml"), `<?xml version="1.0" encoding="utf-8"?>
|
|
1625
1626
|
<resources>
|
|
1626
1627
|
<color name="ic_launcher_background">${(_adaptiveIcon_backgroundColor = adaptiveIcon.backgroundColor) !== null && _adaptiveIcon_backgroundColor !== void 0 ? _adaptiveIcon_backgroundColor : "#FFFFFF"}</color>
|
|
1627
1628
|
</resources>
|
|
@@ -1634,10 +1635,10 @@ async function generateAdaptiveIcon(args) {
|
|
|
1634
1635
|
${adaptiveIcon.monochrome ? " <monochrome android:drawable=\"@mipmap/ic_launcher_monochrome\"/>\n" : ""}</adaptive-icon>
|
|
1635
1636
|
`;
|
|
1636
1637
|
var anydpi = path.join(res, "mipmap-anydpi-v26");
|
|
1637
|
-
|
|
1638
|
+
mkdirSync(anydpi, { recursive: true });
|
|
1638
1639
|
for (var _i = 0, _iter = ["ic_launcher.xml", "ic_launcher_round.xml"]; _i < _iter.length; _i++) {
|
|
1639
1640
|
var filename = _iter[_i];
|
|
1640
|
-
|
|
1641
|
+
writeFileSync(path.join(anydpi, filename), adaptiveXml);
|
|
1641
1642
|
}
|
|
1642
1643
|
}
|
|
1643
1644
|
var IOS_DARK_APPEARANCE = [{
|
|
@@ -1684,8 +1685,8 @@ function generateAccentColor(args) {
|
|
|
1684
1685
|
var accent = (_args_app_ios = args.app.ios) === null || _args_app_ios === void 0 ? void 0 : _args_app_ios.accentColor;
|
|
1685
1686
|
if (!accent) return;
|
|
1686
1687
|
var colorDir = path.join(args.dest, args.app.name, "Images.xcassets", "AccentColor.colorset");
|
|
1687
|
-
|
|
1688
|
-
|
|
1688
|
+
mkdirSync(colorDir, { recursive: true });
|
|
1689
|
+
writeFileSync(path.join(colorDir, "Contents.json"), xcodeColorSet(accent.light, accent.dark));
|
|
1689
1690
|
}
|
|
1690
1691
|
async function generateSplashScreen(args) {
|
|
1691
1692
|
var _app_splash_width;
|
|
@@ -1696,7 +1697,7 @@ async function generateSplashScreen(args) {
|
|
|
1696
1697
|
var _ref;
|
|
1697
1698
|
var _app_splash;
|
|
1698
1699
|
var source = path.resolve(root, sourcePath);
|
|
1699
|
-
if (!
|
|
1700
|
+
if (!existsSync(source)) {
|
|
1700
1701
|
throw new Error(`[vxrn] native.app.splash source does not exist: ${source}`);
|
|
1701
1702
|
}
|
|
1702
1703
|
var { width: sourceWidth, format } = await sharp(source).metadata();
|
|
@@ -1715,7 +1716,7 @@ async function generateSplashScreen(args) {
|
|
|
1715
1716
|
var artworkHeight = Number((artworkWidth * (metadata.height / metadata.width)).toFixed(3));
|
|
1716
1717
|
var readBackground = function readBackground2(sourcePath) {
|
|
1717
1718
|
var source = path.resolve(root, sourcePath);
|
|
1718
|
-
if (!
|
|
1719
|
+
if (!existsSync(source)) {
|
|
1719
1720
|
throw new Error(`[vxrn] native.app.splash backgroundImage does not exist: ${source}`);
|
|
1720
1721
|
}
|
|
1721
1722
|
return sharp(source).rotate().png().toBuffer({ resolveWithObject: true });
|
|
@@ -1725,7 +1726,7 @@ async function generateSplashScreen(args) {
|
|
|
1725
1726
|
var assets = path.join(appDir, "Images.xcassets");
|
|
1726
1727
|
var writeImageSet = async function writeImageSet2(name, light, dark2, pointWidth) {
|
|
1727
1728
|
var dir = path.join(assets, `${name}.imageset`);
|
|
1728
|
-
|
|
1729
|
+
mkdirSync(dir, { recursive: true });
|
|
1729
1730
|
var scales = pointWidth === void 0 ? [1] : [
|
|
1730
1731
|
1,
|
|
1731
1732
|
2,
|
|
@@ -1772,7 +1773,7 @@ async function generateSplashScreen(args) {
|
|
|
1772
1773
|
}
|
|
1773
1774
|
}
|
|
1774
1775
|
}
|
|
1775
|
-
|
|
1776
|
+
writeFileSync(path.join(dir, "Contents.json"), `${JSON.stringify({
|
|
1776
1777
|
images,
|
|
1777
1778
|
info: {
|
|
1778
1779
|
author: "xcode",
|
|
@@ -1788,10 +1789,10 @@ async function generateSplashScreen(args) {
|
|
|
1788
1789
|
await writeImageSet("SplashBackgroundImage", background.data, darkBackground, void 0);
|
|
1789
1790
|
}
|
|
1790
1791
|
var colorDir = path.join(assets, "SplashBackground.colorset");
|
|
1791
|
-
|
|
1792
|
-
|
|
1792
|
+
mkdirSync(colorDir, { recursive: true });
|
|
1793
|
+
writeFileSync(path.join(colorDir, "Contents.json"), xcodeColorSet(app.splash.backgroundColor, dark === null || dark === void 0 ? void 0 : dark.backgroundColor));
|
|
1793
1794
|
var { red, green, blue } = srgb(app.splash.backgroundColor);
|
|
1794
|
-
|
|
1795
|
+
writeFileSync(path.join(appDir, "LaunchScreen.storyboard"), `<?xml version="1.0" encoding="UTF-8"?>
|
|
1795
1796
|
<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">
|
|
1796
1797
|
<device id="retina6_12" orientation="portrait" appearance="light"/>
|
|
1797
1798
|
<dependencies>
|
|
@@ -1864,7 +1865,7 @@ ${cover ? ` <constraint firstItem="splash-image" firstAttribute="le
|
|
|
1864
1865
|
}
|
|
1865
1866
|
}).png().toBuffer();
|
|
1866
1867
|
var drawableDensity = path.join(mainRes, `${drawablePrefix}-${density}`);
|
|
1867
|
-
|
|
1868
|
+
mkdirSync(drawableDensity, { recursive: true });
|
|
1868
1869
|
await sharp({ create: {
|
|
1869
1870
|
width: canvasSize,
|
|
1870
1871
|
height: canvasSize,
|
|
@@ -1914,15 +1915,15 @@ ${cover ? ` <constraint firstItem="splash-image" firstAttribute="le
|
|
|
1914
1915
|
var darkBackground1 = (dark === null || dark === void 0 ? void 0 : dark.backgroundImage) ? (await readBackground(dark.backgroundImage)).data : void 0;
|
|
1915
1916
|
if (background1) {
|
|
1916
1917
|
var nodpi = path.join(mainRes, "drawable-nodpi");
|
|
1917
|
-
|
|
1918
|
-
|
|
1918
|
+
mkdirSync(nodpi, { recursive: true });
|
|
1919
|
+
writeFileSync(path.join(nodpi, "splash_background.png"), background1.data);
|
|
1919
1920
|
if (darkBackground1) {
|
|
1920
1921
|
var nightNodpi = path.join(mainRes, "drawable-night-nodpi");
|
|
1921
|
-
|
|
1922
|
-
|
|
1922
|
+
mkdirSync(nightNodpi, { recursive: true });
|
|
1923
|
+
writeFileSync(path.join(nightNodpi, "splash_background.png"), darkBackground1);
|
|
1923
1924
|
}
|
|
1924
1925
|
}
|
|
1925
|
-
|
|
1926
|
+
writeFileSync(path.join(drawable, "launch_screen.xml"), `<?xml version="1.0" encoding="utf-8"?>
|
|
1926
1927
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
|
1927
1928
|
<item android:drawable="@color/splash_background" />
|
|
1928
1929
|
${background1 ? ` <item>
|
|
@@ -1933,28 +1934,28 @@ ${background1 ? ` <item>
|
|
|
1933
1934
|
</item>
|
|
1934
1935
|
</layer-list>
|
|
1935
1936
|
`);
|
|
1936
|
-
|
|
1937
|
+
writeFileSync(path.join(mainRes, "values", "colors.xml"), `<?xml version="1.0" encoding="utf-8"?>
|
|
1937
1938
|
<resources>
|
|
1938
1939
|
<color name="splash_background">${app.splash.backgroundColor}</color>
|
|
1939
1940
|
</resources>
|
|
1940
1941
|
`);
|
|
1941
1942
|
if (dark) {
|
|
1942
|
-
|
|
1943
|
-
|
|
1943
|
+
mkdirSync(path.join(mainRes, "values-night"), { recursive: true });
|
|
1944
|
+
writeFileSync(path.join(mainRes, "values-night", "colors.xml"), `<?xml version="1.0" encoding="utf-8"?>
|
|
1944
1945
|
<resources>
|
|
1945
1946
|
<color name="splash_background">${dark.backgroundColor}</color>
|
|
1946
1947
|
</resources>
|
|
1947
1948
|
`);
|
|
1948
1949
|
}
|
|
1949
1950
|
var stylesPath = path.join(mainRes, "values", "styles.xml");
|
|
1950
|
-
var styles =
|
|
1951
|
-
|
|
1951
|
+
var styles = readFileSync(stylesPath, "utf8").replace(" <!-- Customize your theme here. -->", " <item name=\"android:windowBackground\">@drawable/launch_screen</item>");
|
|
1952
|
+
writeFileSync(stylesPath, styles);
|
|
1952
1953
|
var stylesV31 = path.join(mainRes, "values-v31");
|
|
1953
|
-
|
|
1954
|
+
mkdirSync(stylesV31, { recursive: true });
|
|
1954
1955
|
if (!styles.includes("</style>")) {
|
|
1955
1956
|
throw new Error("[vxrn] prebuild template styles.xml lost its AppTheme </style> anchor");
|
|
1956
1957
|
}
|
|
1957
|
-
|
|
1958
|
+
writeFileSync(path.join(stylesV31, "styles.xml"), styles.replace("</style>", ` <item name="android:windowSplashScreenBackground">@color/splash_background</item>
|
|
1958
1959
|
<item name="android:windowSplashScreenAnimatedIcon">@drawable/splash</item>
|
|
1959
1960
|
</style>`));
|
|
1960
1961
|
}
|
|
@@ -2617,20 +2618,23 @@ var generateForPlatform = async function generateForPlatform2(root, platform, ap
|
|
|
2617
2618
|
}
|
|
2618
2619
|
var files = [...walkFn(src)].sort();
|
|
2619
2620
|
var nitroWebImage = platform === "ios" && nativeProjectPatches.hasNitroWebImage(root);
|
|
2620
|
-
|
|
2621
|
+
rmSync(dest, {
|
|
2622
|
+
recursive: true,
|
|
2623
|
+
force: true
|
|
2624
|
+
});
|
|
2621
2625
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
2622
2626
|
try {
|
|
2623
2627
|
for (var _iterator = files[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
2624
2628
|
var absoluteSrc = _step.value;
|
|
2625
2629
|
var relativeFilePath = path.relative(src, absoluteSrc);
|
|
2626
|
-
var stat =
|
|
2630
|
+
var stat = lstatSync(absoluteSrc);
|
|
2627
2631
|
if (stat.isDirectory()) continue;
|
|
2628
2632
|
var extension = path.extname(absoluteSrc);
|
|
2629
2633
|
var raw = [
|
|
2630
2634
|
".png",
|
|
2631
2635
|
".jar",
|
|
2632
2636
|
".keystore"
|
|
2633
|
-
].includes(extension) ? null :
|
|
2637
|
+
].includes(extension) ? null : readFileSync(absoluteSrc, "utf8");
|
|
2634
2638
|
var { destRelativePath, content } = renderPrebuildFile({
|
|
2635
2639
|
relativePath: relativeFilePath,
|
|
2636
2640
|
content: raw,
|
|
@@ -2639,13 +2643,13 @@ var generateForPlatform = async function generateForPlatform2(root, platform, ap
|
|
|
2639
2643
|
nitroWebImage
|
|
2640
2644
|
});
|
|
2641
2645
|
var destPath = path.resolve(dest, destRelativePath);
|
|
2642
|
-
|
|
2646
|
+
mkdirSync(path.dirname(destPath), { recursive: true });
|
|
2643
2647
|
console.info("copying", "\"" + absoluteSrc + "\"", "to", "\"" + destPath + "\"");
|
|
2644
2648
|
if (content === null) {
|
|
2645
|
-
|
|
2649
|
+
copyFileSync(absoluteSrc, destPath);
|
|
2646
2650
|
continue;
|
|
2647
2651
|
}
|
|
2648
|
-
|
|
2652
|
+
writeFileSync(destPath, content, {
|
|
2649
2653
|
encoding: "utf8",
|
|
2650
2654
|
mode: stat.mode
|
|
2651
2655
|
});
|
|
@@ -2723,12 +2727,12 @@ var KOTLIN_IMPORT_ARTIFACTS = [{
|
|
|
2723
2727
|
}];
|
|
2724
2728
|
function kotlinSourceImports(dir) {
|
|
2725
2729
|
var imports = /* @__PURE__ */ new Set();
|
|
2726
|
-
if (!
|
|
2730
|
+
if (!existsSync(dir)) return imports;
|
|
2727
2731
|
var visit = function visit1(entry) {
|
|
2728
|
-
if (
|
|
2732
|
+
if (statSync(entry).isDirectory()) {
|
|
2729
2733
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
2730
2734
|
try {
|
|
2731
|
-
for (var _iterator =
|
|
2735
|
+
for (var _iterator = readdirSync(entry)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
2732
2736
|
var child = _step.value;
|
|
2733
2737
|
visit(path.join(entry, child));
|
|
2734
2738
|
}
|
|
@@ -2751,7 +2755,7 @@ function kotlinSourceImports(dir) {
|
|
|
2751
2755
|
if (!entry.endsWith(".kt")) return;
|
|
2752
2756
|
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;
|
|
2753
2757
|
try {
|
|
2754
|
-
for (var _iterator1 =
|
|
2758
|
+
for (var _iterator1 = readFileSync(entry, "utf8").split("\n")[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
|
|
2755
2759
|
var line = _step1.value;
|
|
2756
2760
|
var match = /^\s*import\s+([A-Za-z0-9_.]+)/.exec(line);
|
|
2757
2761
|
if (match) imports.add(match[1]);
|
|
@@ -2776,18 +2780,18 @@ function kotlinSourceImports(dir) {
|
|
|
2776
2780
|
}
|
|
2777
2781
|
function enableAppComposeIntegration(dest) {
|
|
2778
2782
|
var rootBuildGradlePath = path.join(dest, "build.gradle");
|
|
2779
|
-
if (
|
|
2780
|
-
var content =
|
|
2783
|
+
if (existsSync(rootBuildGradlePath)) {
|
|
2784
|
+
var content = readFileSync(rootBuildGradlePath, "utf8");
|
|
2781
2785
|
var composePluginClasspath = " classpath(\"org.jetbrains.kotlin.plugin.compose:org.jetbrains.kotlin.plugin.compose.gradle.plugin:$kotlinVersion\")";
|
|
2782
2786
|
if (!content.includes("org.jetbrains.kotlin.plugin.compose")) {
|
|
2783
2787
|
var anchor = content.includes("classpath(\"org.jetbrains.kotlin:kotlin-gradle-plugin\")") ? "classpath(\"org.jetbrains.kotlin:kotlin-gradle-plugin\")" : "classpath \"org.jetbrains.kotlin:kotlin-gradle-plugin\"";
|
|
2784
2788
|
content = insertAfterLine(content, anchor, composePluginClasspath);
|
|
2785
|
-
|
|
2789
|
+
writeFileSync(rootBuildGradlePath, content, "utf8");
|
|
2786
2790
|
}
|
|
2787
2791
|
}
|
|
2788
2792
|
var appBuildGradlePath = path.join(dest, "app/build.gradle");
|
|
2789
|
-
if (
|
|
2790
|
-
var content1 =
|
|
2793
|
+
if (existsSync(appBuildGradlePath)) {
|
|
2794
|
+
var content1 = readFileSync(appBuildGradlePath, "utf8");
|
|
2791
2795
|
if (!content1.includes("org.jetbrains.kotlin.plugin.compose")) {
|
|
2792
2796
|
var pluginAnchor = content1.includes("apply plugin: \"org.jetbrains.kotlin.android\"") ? "apply plugin: \"org.jetbrains.kotlin.android\"" : "apply plugin: 'org.jetbrains.kotlin.android'";
|
|
2793
2797
|
content1 = insertAfterLine(content1, pluginAnchor, "apply plugin: \"org.jetbrains.kotlin.plugin.compose\"");
|
|
@@ -2836,7 +2840,7 @@ function enableAppComposeIntegration(dest) {
|
|
|
2836
2840
|
}
|
|
2837
2841
|
}
|
|
2838
2842
|
}
|
|
2839
|
-
|
|
2843
|
+
writeFileSync(appBuildGradlePath, content1, "utf8");
|
|
2840
2844
|
}
|
|
2841
2845
|
}
|
|
2842
2846
|
async function generateKotlinSources(param) {
|
|
@@ -2856,7 +2860,7 @@ async function generateKotlinSources(param) {
|
|
|
2856
2860
|
"evidence"
|
|
2857
2861
|
]);
|
|
2858
2862
|
var sources = [];
|
|
2859
|
-
var manifest =
|
|
2863
|
+
var manifest = existsSync(path.join(root, "package.json")) ? readJSONSync(path.join(root, "package.json")) : {};
|
|
2860
2864
|
var workspacePatterns = Array.isArray(manifest.workspaces) ? manifest.workspaces : (_ref = (_manifest_workspaces = manifest.workspaces) === null || _manifest_workspaces === void 0 ? void 0 : _manifest_workspaces.packages) !== null && _ref !== void 0 ? _ref : [];
|
|
2861
2865
|
var { default: glob } = await import("fast-glob");
|
|
2862
2866
|
var workspaceRoots = new Set(glob.sync(workspacePatterns, {
|
|
@@ -2872,10 +2876,10 @@ async function generateKotlinSources(param) {
|
|
|
2872
2876
|
return path.resolve(directory);
|
|
2873
2877
|
}));
|
|
2874
2878
|
var collect = function collect1(dir) {
|
|
2875
|
-
if (dir !== root &&
|
|
2879
|
+
if (dir !== root && existsSync(path.join(dir, "package.json")) && !workspaceRoots.has(dir)) return;
|
|
2876
2880
|
var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;
|
|
2877
2881
|
try {
|
|
2878
|
-
for (var _iterator2 =
|
|
2882
|
+
for (var _iterator2 = readdirSync(dir, { withFileTypes: true })[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
|
|
2879
2883
|
var entry = _step2.value;
|
|
2880
2884
|
if (entry.name.startsWith(".") || skip.has(entry.name)) continue;
|
|
2881
2885
|
var source2 = path.join(dir, entry.name);
|
|
@@ -2899,7 +2903,10 @@ async function generateKotlinSources(param) {
|
|
|
2899
2903
|
};
|
|
2900
2904
|
collect(root);
|
|
2901
2905
|
var output = path.join(dest, "app/src/main/java/one/source");
|
|
2902
|
-
|
|
2906
|
+
rmSync(output, {
|
|
2907
|
+
recursive: true,
|
|
2908
|
+
force: true
|
|
2909
|
+
});
|
|
2903
2910
|
if (sources.length === 0) return;
|
|
2904
2911
|
var { kotlinSourceId, renderKotlinSourceGlue, writeNativeSourceDeclaration } = await import("../utils/nativeSourceContract.native.js");
|
|
2905
2912
|
var hasViews = false;
|
|
@@ -2909,12 +2916,12 @@ async function generateKotlinSources(param) {
|
|
|
2909
2916
|
var source = _step.value;
|
|
2910
2917
|
var id = kotlinSourceId(root, source);
|
|
2911
2918
|
var target = path.join(output, id);
|
|
2912
|
-
|
|
2913
|
-
|
|
2919
|
+
mkdirSync(target, { recursive: true });
|
|
2920
|
+
copyFileSync(source, path.join(target, path.basename(source)));
|
|
2914
2921
|
var contract = writeNativeSourceDeclaration(source);
|
|
2915
2922
|
if (contract.views.length > 0) hasViews = true;
|
|
2916
2923
|
if (contract.modules.length > 0 || contract.views.length > 0) {
|
|
2917
|
-
|
|
2924
|
+
writeFileSync(path.join(target, `OneNativeSource_${id}.kt`), renderKotlinSourceGlue(id, contract).source);
|
|
2918
2925
|
}
|
|
2919
2926
|
}
|
|
2920
2927
|
} catch (err) {
|
|
@@ -2953,12 +2960,12 @@ async function generateSwiftPackages(param) {
|
|
|
2953
2960
|
var _loop = function() {
|
|
2954
2961
|
var [id, packageDir] = _step.value;
|
|
2955
2962
|
var podDir = path.join(dest, "OneSwiftPackages", id);
|
|
2956
|
-
var manifest = swiftPodManifest(path.join(packageDir, "Package.swift"),
|
|
2963
|
+
var manifest = swiftPodManifest(path.join(packageDir, "Package.swift"), readFileSync(path.join(packageDir, "Package.swift"), "utf8"));
|
|
2957
2964
|
var sources = [];
|
|
2958
2965
|
var collect = function collect1(dir) {
|
|
2959
2966
|
var _iteratorNormalCompletion3 = true, _didIteratorError3 = false, _iteratorError3 = void 0;
|
|
2960
2967
|
try {
|
|
2961
|
-
for (var _iterator3 =
|
|
2968
|
+
for (var _iterator3 = readdirSync(dir, { withFileTypes: true })[Symbol.iterator](), _step2; !(_iteratorNormalCompletion3 = (_step2 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
|
|
2962
2969
|
var entry = _step2.value;
|
|
2963
2970
|
if (entry.name.startsWith(".") || skip.has(entry.name)) continue;
|
|
2964
2971
|
var full = path.join(dir, entry.name);
|
|
@@ -2996,8 +3003,8 @@ async function generateSwiftPackages(param) {
|
|
|
2996
3003
|
for (var _iterator2 = sources[Symbol.iterator](), _step1; !(_iteratorNormalCompletion2 = (_step1 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
|
|
2997
3004
|
var source = _step1.value;
|
|
2998
3005
|
var link = path.join(podDir, "Sources", path.relative(packageDir, source));
|
|
2999
|
-
|
|
3000
|
-
|
|
3006
|
+
mkdirSync(path.dirname(link), { recursive: true });
|
|
3007
|
+
symlinkSync(realpathSync(source), link);
|
|
3001
3008
|
}
|
|
3002
3009
|
} catch (err) {
|
|
3003
3010
|
_didIteratorError2 = true;
|
|
@@ -3014,9 +3021,9 @@ async function generateSwiftPackages(param) {
|
|
|
3014
3021
|
}
|
|
3015
3022
|
}
|
|
3016
3023
|
if (artifacts.glue) {
|
|
3017
|
-
|
|
3024
|
+
writeFileSync(path.join(podDir, "Sources", "OneNativeSource.generated.swift"), artifacts.glue);
|
|
3018
3025
|
}
|
|
3019
|
-
|
|
3026
|
+
writeFileSync(path.join(podDir, `${id}.podspec`), `Pod::Spec.new do |s|
|
|
3020
3027
|
s.name = '${id}'
|
|
3021
3028
|
s.version = '0.0.0'
|
|
3022
3029
|
s.summary = 'swift package ${path.relative(root, packageDir) || "."}'
|
|
@@ -3032,7 +3039,7 @@ async function generateSwiftPackages(param) {
|
|
|
3032
3039
|
}
|
|
3033
3040
|
end
|
|
3034
3041
|
`);
|
|
3035
|
-
|
|
3042
|
+
writeFileSync(path.join(podDir, "Register.m"), hasView ? `#import <Foundation/Foundation.h>
|
|
3036
3043
|
|
|
3037
3044
|
extern int ${id}_main(int argc, char **argv);
|
|
3038
3045
|
extern void OneSwiftRegisterPackage(const char *name, int (*entry)(int, char **));
|
|
@@ -3071,11 +3078,11 @@ function applyAndroidDependencyPatches(args) {
|
|
|
3071
3078
|
return;
|
|
3072
3079
|
}
|
|
3073
3080
|
var activityPath = path.join(root, "android", "app", "src", "main", "java", ...app.android.applicationId.split("."), "MainActivity.kt");
|
|
3074
|
-
var rendered = nativeProjectPatches.holdLaunchScreenInMainActivity(nativeProjectPatches.addReactNativeScreensFix(
|
|
3081
|
+
var rendered = nativeProjectPatches.holdLaunchScreenInMainActivity(nativeProjectPatches.addReactNativeScreensFix(readFileSync(activityPath, "utf8")));
|
|
3075
3082
|
if (!rendered.includes("RNScreensFragmentFactory")) {
|
|
3076
3083
|
throw new Error("[vxrn] failed to apply the react-native-screens activity patch");
|
|
3077
3084
|
}
|
|
3078
|
-
|
|
3085
|
+
writeFileSync(activityPath, rendered);
|
|
3079
3086
|
}
|
|
3080
3087
|
async function getNativeDependencyInventory(root) {
|
|
3081
3088
|
var cliConfigPath = requireVxrn.resolve("@react-native-community/cli-config");
|
|
@@ -3091,7 +3098,7 @@ async function getNativeDependencyInventory(root) {
|
|
|
3091
3098
|
var version = "unknown";
|
|
3092
3099
|
try {
|
|
3093
3100
|
var _JSON_parse_version;
|
|
3094
|
-
version = (_JSON_parse_version = JSON.parse(
|
|
3101
|
+
version = (_JSON_parse_version = JSON.parse(readFileSync(path.join(depRoot, "package.json"), "utf8")).version) !== null && _JSON_parse_version !== void 0 ? _JSON_parse_version : "unknown";
|
|
3095
3102
|
} catch (unused) {}
|
|
3096
3103
|
var platforms = Object.entries(dependency.platforms).filter(function(param) {
|
|
3097
3104
|
var [, platformConfig] = param;
|