expo-targets 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +2 -0
- package/README.md +244 -0
- package/android/build.gradle +22 -0
- package/android/src/main/java/expo/modules/targets/ExpoTargetsLogger.kt +98 -0
- package/android/src/main/java/expo/modules/targets/ExpoTargetsReceiver.kt +136 -0
- package/android/src/main/java/expo/modules/targets/ExpoTargetsRemoteViewsProvider.kt +72 -0
- package/android/src/main/java/expo/modules/targets/ExpoTargetsWidgetProvider.kt +47 -0
- package/android/src/main/java/expo/modules/targets/ExpoTargetsWidgetSync.kt +78 -0
- package/android/src/main/java/expo/modules/targets/ExpoTargetsWidgetUpdateReceiver.kt +30 -0
- package/android/src/main/java/expo/modules/targets/extension/ExpoTargetsExtensionModule.kt +27 -0
- package/android/src/main/java/expo/modules/targets/messages/ExpoTargetsMessagesModule.kt +40 -0
- package/android/src/main/java/expo/modules/targets/storage/ExpoTargetsStorageModule.kt +119 -0
- package/app.plugin.js +1 -0
- package/build/metro/src/index.d.ts +2 -0
- package/build/metro/src/index.d.ts.map +1 -0
- package/build/metro/src/index.js +6 -0
- package/build/metro/src/index.js.map +1 -0
- package/build/metro/src/withTargetsMetro.d.ts +6 -0
- package/build/metro/src/withTargetsMetro.d.ts.map +1 -0
- package/build/metro/src/withTargetsMetro.js +171 -0
- package/build/metro/src/withTargetsMetro.js.map +1 -0
- package/build/plugin/src/android/config-plugins/withAndroidColors.d.ts +7 -0
- package/build/plugin/src/android/config-plugins/withAndroidColors.d.ts.map +1 -0
- package/build/plugin/src/android/config-plugins/withAndroidColors.js +56 -0
- package/build/plugin/src/android/config-plugins/withAndroidColors.js.map +1 -0
- package/build/plugin/src/android/config-plugins/withAndroidManifest.d.ts +7 -0
- package/build/plugin/src/android/config-plugins/withAndroidManifest.d.ts.map +1 -0
- package/build/plugin/src/android/config-plugins/withAndroidManifest.js +70 -0
- package/build/plugin/src/android/config-plugins/withAndroidManifest.js.map +1 -0
- package/build/plugin/src/android/config-plugins/withAndroidModule.d.ts +7 -0
- package/build/plugin/src/android/config-plugins/withAndroidModule.d.ts.map +1 -0
- package/build/plugin/src/android/config-plugins/withAndroidModule.js +41 -0
- package/build/plugin/src/android/config-plugins/withAndroidModule.js.map +1 -0
- package/build/plugin/src/android/config-plugins/withAndroidResources.d.ts +7 -0
- package/build/plugin/src/android/config-plugins/withAndroidResources.d.ts.map +1 -0
- package/build/plugin/src/android/config-plugins/withAndroidResources.js +75 -0
- package/build/plugin/src/android/config-plugins/withAndroidResources.js.map +1 -0
- package/build/plugin/src/android/config-plugins/withAndroidTarget.d.ts +28 -0
- package/build/plugin/src/android/config-plugins/withAndroidTarget.d.ts.map +1 -0
- package/build/plugin/src/android/config-plugins/withAndroidTarget.js +28 -0
- package/build/plugin/src/android/config-plugins/withAndroidTarget.js.map +1 -0
- package/build/plugin/src/android/config-plugins/withGradleModule.d.ts +7 -0
- package/build/plugin/src/android/config-plugins/withGradleModule.d.ts.map +1 -0
- package/build/plugin/src/android/config-plugins/withGradleModule.js +86 -0
- package/build/plugin/src/android/config-plugins/withGradleModule.js.map +1 -0
- package/build/plugin/src/android/config-plugins/withGradleSettings.d.ts +7 -0
- package/build/plugin/src/android/config-plugins/withGradleSettings.d.ts.map +1 -0
- package/build/plugin/src/android/config-plugins/withGradleSettings.js +23 -0
- package/build/plugin/src/android/config-plugins/withGradleSettings.js.map +1 -0
- package/build/plugin/src/android/withAndroidAppBuildGradle.d.ts +7 -0
- package/build/plugin/src/android/withAndroidAppBuildGradle.d.ts.map +1 -0
- package/build/plugin/src/android/withAndroidAppBuildGradle.js +31 -0
- package/build/plugin/src/android/withAndroidAppBuildGradle.js.map +1 -0
- package/build/plugin/src/android/withAndroidKotlinGradleProperty.d.ts +3 -0
- package/build/plugin/src/android/withAndroidKotlinGradleProperty.d.ts.map +1 -0
- package/build/plugin/src/android/withAndroidKotlinGradleProperty.js +24 -0
- package/build/plugin/src/android/withAndroidKotlinGradleProperty.js.map +1 -0
- package/build/plugin/src/android/withAndroidProjectKotlinVersion.d.ts +3 -0
- package/build/plugin/src/android/withAndroidProjectKotlinVersion.d.ts.map +1 -0
- package/build/plugin/src/android/withAndroidProjectKotlinVersion.js +27 -0
- package/build/plugin/src/android/withAndroidProjectKotlinVersion.js.map +1 -0
- package/build/plugin/src/android/withAndroidTarget.d.ts +10 -0
- package/build/plugin/src/android/withAndroidTarget.d.ts.map +1 -0
- package/build/plugin/src/android/withAndroidTarget.js +22 -0
- package/build/plugin/src/android/withAndroidTarget.js.map +1 -0
- package/build/plugin/src/android/withAndroidWidget.d.ts +13 -0
- package/build/plugin/src/android/withAndroidWidget.d.ts.map +1 -0
- package/build/plugin/src/android/withAndroidWidget.js +564 -0
- package/build/plugin/src/android/withAndroidWidget.js.map +1 -0
- package/build/plugin/src/config.d.ts +141 -0
- package/build/plugin/src/config.d.ts.map +1 -0
- package/build/plugin/src/config.js +54 -0
- package/build/plugin/src/config.js.map +1 -0
- package/build/plugin/src/index.d.ts +9 -0
- package/build/plugin/src/index.d.ts.map +1 -0
- package/build/plugin/src/index.js +11 -0
- package/build/plugin/src/index.js.map +1 -0
- package/build/plugin/src/ios/config-plugins/withEntitlements.d.ts +11 -0
- package/build/plugin/src/ios/config-plugins/withEntitlements.d.ts.map +1 -0
- package/build/plugin/src/ios/config-plugins/withEntitlements.js +49 -0
- package/build/plugin/src/ios/config-plugins/withEntitlements.js.map +1 -0
- package/build/plugin/src/ios/config-plugins/withIOSTarget.d.ts +17 -0
- package/build/plugin/src/ios/config-plugins/withIOSTarget.d.ts.map +1 -0
- package/build/plugin/src/ios/config-plugins/withIOSTarget.js +152 -0
- package/build/plugin/src/ios/config-plugins/withIOSTarget.js.map +1 -0
- package/build/plugin/src/ios/config-plugins/withIosColorset.d.ts +8 -0
- package/build/plugin/src/ios/config-plugins/withIosColorset.d.ts.map +1 -0
- package/build/plugin/src/ios/config-plugins/withIosColorset.js +25 -0
- package/build/plugin/src/ios/config-plugins/withIosColorset.js.map +1 -0
- package/build/plugin/src/ios/config-plugins/withIosStickerPack.d.ts +8 -0
- package/build/plugin/src/ios/config-plugins/withIosStickerPack.d.ts.map +1 -0
- package/build/plugin/src/ios/config-plugins/withIosStickerPack.js +52 -0
- package/build/plugin/src/ios/config-plugins/withIosStickerPack.js.map +1 -0
- package/build/plugin/src/ios/config-plugins/withPodfile.d.ts +12 -0
- package/build/plugin/src/ios/config-plugins/withPodfile.d.ts.map +1 -0
- package/build/plugin/src/ios/config-plugins/withPodfile.js +162 -0
- package/build/plugin/src/ios/config-plugins/withPodfile.js.map +1 -0
- package/build/plugin/src/ios/config-plugins/withXcodeChanges.d.ts +15 -0
- package/build/plugin/src/ios/config-plugins/withXcodeChanges.d.ts.map +1 -0
- package/build/plugin/src/ios/config-plugins/withXcodeChanges.js +646 -0
- package/build/plugin/src/ios/config-plugins/withXcodeChanges.js.map +1 -0
- package/build/plugin/src/ios/target.d.ts +41 -0
- package/build/plugin/src/ios/target.d.ts.map +1 -0
- package/build/plugin/src/ios/target.js +574 -0
- package/build/plugin/src/ios/target.js.map +1 -0
- package/build/plugin/src/ios/utils/asset.d.ts +60 -0
- package/build/plugin/src/ios/utils/asset.d.ts.map +1 -0
- package/build/plugin/src/ios/utils/asset.js +375 -0
- package/build/plugin/src/ios/utils/asset.js.map +1 -0
- package/build/plugin/src/ios/utils/file.d.ts +33 -0
- package/build/plugin/src/ios/utils/file.d.ts.map +1 -0
- package/build/plugin/src/ios/utils/file.js +88 -0
- package/build/plugin/src/ios/utils/file.js.map +1 -0
- package/build/plugin/src/ios/utils/index.d.ts +12 -0
- package/build/plugin/src/ios/utils/index.d.ts.map +1 -0
- package/build/plugin/src/ios/utils/index.js +38 -0
- package/build/plugin/src/ios/utils/index.js.map +1 -0
- package/build/plugin/src/ios/utils/paths.d.ts +128 -0
- package/build/plugin/src/ios/utils/paths.d.ts.map +1 -0
- package/build/plugin/src/ios/utils/paths.js +141 -0
- package/build/plugin/src/ios/utils/paths.js.map +1 -0
- package/build/plugin/src/ios/utils/plist.d.ts +29 -0
- package/build/plugin/src/ios/utils/plist.d.ts.map +1 -0
- package/build/plugin/src/ios/utils/plist.js +114 -0
- package/build/plugin/src/ios/utils/plist.js.map +1 -0
- package/build/plugin/src/ios/utils/podfile.d.ts +82 -0
- package/build/plugin/src/ios/utils/podfile.d.ts.map +1 -0
- package/build/plugin/src/ios/utils/podfile.js +408 -0
- package/build/plugin/src/ios/utils/podfile.js.map +1 -0
- package/build/plugin/src/ios/utils/reactNativeSwift.d.ts +11 -0
- package/build/plugin/src/ios/utils/reactNativeSwift.d.ts.map +1 -0
- package/build/plugin/src/ios/utils/reactNativeSwift.js +263 -0
- package/build/plugin/src/ios/utils/reactNativeSwift.js.map +1 -0
- package/build/plugin/src/ios/utils/xcode.d.ts +185 -0
- package/build/plugin/src/ios/utils/xcode.d.ts.map +1 -0
- package/build/plugin/src/ios/utils/xcode.js +706 -0
- package/build/plugin/src/ios/utils/xcode.js.map +1 -0
- package/build/plugin/src/logger.d.ts +10 -0
- package/build/plugin/src/logger.d.ts.map +1 -0
- package/build/plugin/src/logger.js +62 -0
- package/build/plugin/src/logger.js.map +1 -0
- package/build/plugin/src/parseTargetConfig.d.ts +3 -0
- package/build/plugin/src/parseTargetConfig.d.ts.map +1 -0
- package/build/plugin/src/parseTargetConfig.js +113 -0
- package/build/plugin/src/parseTargetConfig.js.map +1 -0
- package/build/plugin/src/withTargetsDir.d.ts +6 -0
- package/build/plugin/src/withTargetsDir.d.ts.map +1 -0
- package/build/plugin/src/withTargetsDir.js +90 -0
- package/build/plugin/src/withTargetsDir.js.map +1 -0
- package/build/src/Target.d.ts +43 -0
- package/build/src/Target.d.ts.map +1 -0
- package/build/src/Target.js +128 -0
- package/build/src/Target.js.map +1 -0
- package/build/src/index.d.ts +9 -0
- package/build/src/index.d.ts.map +1 -0
- package/build/src/index.js +27 -0
- package/build/src/index.js.map +1 -0
- package/build/src/modules/extension/index.d.ts +18 -0
- package/build/src/modules/extension/index.d.ts.map +1 -0
- package/build/src/modules/extension/index.js +44 -0
- package/build/src/modules/extension/index.js.map +1 -0
- package/build/src/modules/messages/index.d.ts +40 -0
- package/build/src/modules/messages/index.d.ts.map +1 -0
- package/build/src/modules/messages/index.js +94 -0
- package/build/src/modules/messages/index.js.map +1 -0
- package/build/src/modules/storage/index.d.ts +16 -0
- package/build/src/modules/storage/index.d.ts.map +1 -0
- package/build/src/modules/storage/index.js +122 -0
- package/build/src/modules/storage/index.js.map +1 -0
- package/expo-module.config.json +17 -0
- package/ios/ExpoTargetsExtension.podspec +23 -0
- package/ios/ExpoTargetsExtensionModule.swift +181 -0
- package/ios/ExpoTargetsMessages.podspec +23 -0
- package/ios/ExpoTargetsMessagesModule.swift +267 -0
- package/ios/ExpoTargetsStorage.podspec +23 -0
- package/ios/ExpoTargetsStorageModule.swift +91 -0
- package/ios/Tests/.swiftlint.yml +52 -0
- package/ios/Tests/Helpers/MockExtensionContext.swift +58 -0
- package/ios/Tests/Helpers/MockUserDefaults.swift +70 -0
- package/ios/Tests/Helpers/MockWidgetCenter.swift +71 -0
- package/ios/Tests/Helpers/TestHelpers.swift +90 -0
- package/ios/Tests/Integration/TargetIntegrationTests.swift +478 -0
- package/ios/Tests/Main/AllTests.swift +80 -0
- package/ios/Tests/Package.swift +66 -0
- package/ios/Tests/Performance/StoragePerformanceTests.swift +461 -0
- package/ios/Tests/Unit/Extension/ExpoTargetsExtensionModuleTests.swift +501 -0
- package/ios/Tests/Unit/Storage/ExpoTargetsStorageModuleTests.swift +578 -0
- package/ios/Tests/Unit/Template/ShareExtensionTemplateTests.swift +421 -0
- package/ios/Tests/XCTestPlan.xctestplan +87 -0
- package/metro/src/index.ts +1 -0
- package/metro/src/withTargetsMetro.ts +247 -0
- package/metro/tsconfig.build.json +9 -0
- package/package.json +74 -0
- package/plugin/src/android/withAndroidAppBuildGradle.ts +34 -0
- package/plugin/src/android/withAndroidTarget.ts +26 -0
- package/plugin/src/android/withAndroidWidget.ts +778 -0
- package/plugin/src/config.ts +255 -0
- package/plugin/src/index.ts +19 -0
- package/plugin/src/ios/config-plugins/withEntitlements.ts +69 -0
- package/plugin/src/ios/config-plugins/withIOSTarget.ts +179 -0
- package/plugin/src/ios/config-plugins/withIosColorset.ts +29 -0
- package/plugin/src/ios/config-plugins/withIosStickerPack.ts +65 -0
- package/plugin/src/ios/config-plugins/withPodfile.ts +238 -0
- package/plugin/src/ios/config-plugins/withXcodeChanges.ts +891 -0
- package/plugin/src/ios/target.ts +668 -0
- package/plugin/src/ios/templates/MessagesViewController.swift +120 -0
- package/plugin/src/ios/templates/ReactNativeViewController.swift +240 -0
- package/plugin/src/ios/templates/action-extension-data.swift +106 -0
- package/plugin/src/ios/templates/clip-extension-data.swift +28 -0
- package/plugin/src/ios/templates/messages-extension-data.swift +28 -0
- package/plugin/src/ios/templates/share-extension-data.swift +113 -0
- package/plugin/src/ios/utils/asset.ts +490 -0
- package/plugin/src/ios/utils/file.ts +80 -0
- package/plugin/src/ios/utils/index.ts +12 -0
- package/plugin/src/ios/utils/paths.ts +253 -0
- package/plugin/src/ios/utils/plist.ts +101 -0
- package/plugin/src/ios/utils/podfile.ts +534 -0
- package/plugin/src/ios/utils/reactNativeSwift.ts +283 -0
- package/plugin/src/ios/utils/xcode.ts +989 -0
- package/plugin/src/logger.ts +63 -0
- package/plugin/src/parseTargetConfig.ts +115 -0
- package/plugin/src/types/normalize-colors.d.ts +3 -0
- package/plugin/src/withTargetsDir.ts +120 -0
- package/plugin/tsconfig.build.json +9 -0
- package/plugin/tsconfig.json +9 -0
- package/src/Target.ts +239 -0
- package/src/index.ts +52 -0
- package/src/modules/extension/index.ts +54 -0
- package/src/modules/messages/index.ts +124 -0
- package/src/modules/storage/index.ts +126 -0
- package/tsconfig.json +8 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Centralized utilities for iOS plugin operations.
|
|
4
|
+
* Re-exports all utility modules for convenient access.
|
|
5
|
+
*/
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
+
}) : function(o, v) {
|
|
20
|
+
o["default"] = v;
|
|
21
|
+
});
|
|
22
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
23
|
+
if (mod && mod.__esModule) return mod;
|
|
24
|
+
var result = {};
|
|
25
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
26
|
+
__setModuleDefault(result, mod);
|
|
27
|
+
return result;
|
|
28
|
+
};
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
exports.ReactNativeSwift = exports.Asset = exports.Podfile = exports.Plist = exports.File = exports.Paths = exports.Xcode = void 0;
|
|
31
|
+
exports.Xcode = __importStar(require("./xcode"));
|
|
32
|
+
exports.Paths = __importStar(require("./paths"));
|
|
33
|
+
exports.File = __importStar(require("./file"));
|
|
34
|
+
exports.Plist = __importStar(require("./plist"));
|
|
35
|
+
exports.Podfile = __importStar(require("./podfile"));
|
|
36
|
+
exports.Asset = __importStar(require("./asset"));
|
|
37
|
+
exports.ReactNativeSwift = __importStar(require("./reactNativeSwift"));
|
|
38
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../plugin/src/ios/utils/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,iDAAiC;AACjC,iDAAiC;AACjC,+CAA+B;AAC/B,iDAAiC;AACjC,qDAAqC;AACrC,iDAAiC;AACjC,uEAAuD"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Path utilities for working with target directories and files.
|
|
3
|
+
* Centralizes path resolution logic used across iOS plugins.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Sanitize target name for use in Xcode (removes non-alphanumeric characters).
|
|
7
|
+
* Appends "Target" suffix to avoid conflicts with main app name.
|
|
8
|
+
*/
|
|
9
|
+
export declare function sanitizeTargetName(name: string): string;
|
|
10
|
+
/**
|
|
11
|
+
* Get the target directory path (where user places their target code).
|
|
12
|
+
*/
|
|
13
|
+
export declare function getTargetDirectory({ projectRoot, targetDirectory, }: {
|
|
14
|
+
projectRoot: string;
|
|
15
|
+
targetDirectory: string;
|
|
16
|
+
}): string;
|
|
17
|
+
/**
|
|
18
|
+
* Get the target group path in Xcode project (where target files live).
|
|
19
|
+
* Adds 'Target' suffix to prevent case-insensitivity collisions with main app on macOS.
|
|
20
|
+
*
|
|
21
|
+
* On case-insensitive filesystems (macOS default), directory names that differ only by case
|
|
22
|
+
* collide. For example, "shareextension" (main app) and "ShareExtension" (target) would resolve
|
|
23
|
+
* to the same directory. Adding "Target" suffix ensures uniqueness.
|
|
24
|
+
*/
|
|
25
|
+
export declare function getTargetGroupPath({ platformProjectRoot, targetName, }: {
|
|
26
|
+
platformProjectRoot: string;
|
|
27
|
+
targetName: string;
|
|
28
|
+
}): string;
|
|
29
|
+
/**
|
|
30
|
+
* Get path to generated entitlements file in Xcode project.
|
|
31
|
+
*/
|
|
32
|
+
export declare function getGeneratedEntitlementsPath({ platformProjectRoot, targetName, }: {
|
|
33
|
+
platformProjectRoot: string;
|
|
34
|
+
targetName: string;
|
|
35
|
+
}): string;
|
|
36
|
+
/**
|
|
37
|
+
* Get path to Info.plist in Xcode project.
|
|
38
|
+
*/
|
|
39
|
+
export declare function getInfoPlistPath({ platformProjectRoot, targetName, }: {
|
|
40
|
+
platformProjectRoot: string;
|
|
41
|
+
targetName: string;
|
|
42
|
+
}): string;
|
|
43
|
+
/**
|
|
44
|
+
* Get path to Assets.xcassets in Xcode project.
|
|
45
|
+
* For sticker targets, returns Stickers.xcassets instead.
|
|
46
|
+
*/
|
|
47
|
+
export declare function getAssetsXcassetsPath({ platformProjectRoot, targetName, isStickers, }: {
|
|
48
|
+
platformProjectRoot: string;
|
|
49
|
+
targetName: string;
|
|
50
|
+
isStickers?: boolean;
|
|
51
|
+
}): string;
|
|
52
|
+
/**
|
|
53
|
+
* Get path to a specific colorset in Xcode project.
|
|
54
|
+
*/
|
|
55
|
+
export declare function getColorsetPath({ platformProjectRoot, targetName, colorName, }: {
|
|
56
|
+
platformProjectRoot: string;
|
|
57
|
+
targetName: string;
|
|
58
|
+
colorName: string;
|
|
59
|
+
}): string;
|
|
60
|
+
/**
|
|
61
|
+
* Get path to a specific sticker pack in Xcode project.
|
|
62
|
+
*/
|
|
63
|
+
export declare function getStickerPackPath({ platformProjectRoot, targetName, stickerPackName, }: {
|
|
64
|
+
platformProjectRoot: string;
|
|
65
|
+
targetName: string;
|
|
66
|
+
stickerPackName: string;
|
|
67
|
+
}): string;
|
|
68
|
+
/**
|
|
69
|
+
* ============================================================================
|
|
70
|
+
* NEW: Reference-in-Place Path Utilities
|
|
71
|
+
* ============================================================================
|
|
72
|
+
* The following functions return paths within targets/ directory where files
|
|
73
|
+
* are referenced in place rather than copied to ios/. Generated files (Info.plist,
|
|
74
|
+
* Assets.xcassets, entitlements) go in targets/TARGETNAME/ios/build/, while user Swift
|
|
75
|
+
* files remain in targets/TARGETNAME/ios/.
|
|
76
|
+
*/
|
|
77
|
+
/**
|
|
78
|
+
* Get build output directory in targets/ folder.
|
|
79
|
+
* This is where generated files (Info.plist, Assets, entitlements) are placed.
|
|
80
|
+
*/
|
|
81
|
+
export declare function getTargetBuildPath({ projectRoot, targetDirectory, }: {
|
|
82
|
+
projectRoot: string;
|
|
83
|
+
targetDirectory: string;
|
|
84
|
+
}): string;
|
|
85
|
+
/**
|
|
86
|
+
* Get path to Info.plist in targets/TARGETNAME/ios/build/.
|
|
87
|
+
* New approach: Info.plist generated in targets/, referenced from Xcode.
|
|
88
|
+
*/
|
|
89
|
+
export declare function getTargetInfoPlistPath({ projectRoot, targetDirectory, }: {
|
|
90
|
+
projectRoot: string;
|
|
91
|
+
targetDirectory: string;
|
|
92
|
+
}): string;
|
|
93
|
+
/**
|
|
94
|
+
* Get path to entitlements file in targets/TARGETNAME/ios/build/.
|
|
95
|
+
* New approach: Entitlements generated in targets/, referenced from Xcode.
|
|
96
|
+
*/
|
|
97
|
+
export declare function getTargetEntitlementsPath({ projectRoot, targetDirectory, }: {
|
|
98
|
+
projectRoot: string;
|
|
99
|
+
targetDirectory: string;
|
|
100
|
+
}): string;
|
|
101
|
+
/**
|
|
102
|
+
* Get path to Assets.xcassets in targets/TARGETNAME/ios/build/.
|
|
103
|
+
* New approach: Assets generated/copied to targets/, referenced from Xcode.
|
|
104
|
+
* For sticker targets, returns Stickers.xcassets instead.
|
|
105
|
+
*/
|
|
106
|
+
export declare function getTargetAssetsPath({ projectRoot, targetDirectory, isStickers, }: {
|
|
107
|
+
projectRoot: string;
|
|
108
|
+
targetDirectory: string;
|
|
109
|
+
isStickers?: boolean;
|
|
110
|
+
}): string;
|
|
111
|
+
/**
|
|
112
|
+
* Get path to a specific colorset in targets/TARGETNAME/ios/build/Assets.xcassets/.
|
|
113
|
+
*/
|
|
114
|
+
export declare function getTargetColorsetPath({ projectRoot, targetDirectory, colorName, }: {
|
|
115
|
+
projectRoot: string;
|
|
116
|
+
targetDirectory: string;
|
|
117
|
+
colorName: string;
|
|
118
|
+
}): string;
|
|
119
|
+
/**
|
|
120
|
+
* Get path to user's Swift source files in targets/TARGETNAME/ios/.
|
|
121
|
+
* These are referenced in place, not copied.
|
|
122
|
+
*/
|
|
123
|
+
export declare function getTargetSourcePath({ projectRoot, targetDirectory, fileName, }: {
|
|
124
|
+
projectRoot: string;
|
|
125
|
+
targetDirectory: string;
|
|
126
|
+
fileName: string;
|
|
127
|
+
}): string;
|
|
128
|
+
//# sourceMappingURL=paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../../../plugin/src/ios/utils/paths.ts"],"names":[],"mappings":"AAEA;;;GAGG;AAEH;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,WAAW,EACX,eAAe,GAChB,EAAE;IACD,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;CACzB,GAAG,MAAM,CAET;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,mBAAmB,EACnB,UAAU,GACX,EAAE;IACD,mBAAmB,EAAE,MAAM,CAAC;IAC5B,UAAU,EAAE,MAAM,CAAC;CACpB,GAAG,MAAM,CAKT;AAED;;GAEG;AACH,wBAAgB,4BAA4B,CAAC,EAC3C,mBAAmB,EACnB,UAAU,GACX,EAAE;IACD,mBAAmB,EAAE,MAAM,CAAC;IAC5B,UAAU,EAAE,MAAM,CAAC;CACpB,GAAG,MAAM,CAKT;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,mBAAmB,EACnB,UAAU,GACX,EAAE;IACD,mBAAmB,EAAE,MAAM,CAAC;IAC5B,UAAU,EAAE,MAAM,CAAC;CACpB,GAAG,MAAM,CAKT;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,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EAAE,OAAO,CAAC;CACtB,GAAG,MAAM,CAMT;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,WAAW,EACX,eAAe,EACf,SAAS,GACV,EAAE;IACD,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;CACnB,GAAG,MAAM,CAKT;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,WAAW,EACX,eAAe,EACf,QAAQ,GACT,EAAE;IACD,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,MAAM,CAET"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getTargetSourcePath = exports.getTargetColorsetPath = exports.getTargetAssetsPath = exports.getTargetEntitlementsPath = exports.getTargetInfoPlistPath = exports.getTargetBuildPath = exports.getStickerPackPath = exports.getColorsetPath = exports.getAssetsXcassetsPath = exports.getInfoPlistPath = exports.getGeneratedEntitlementsPath = exports.getTargetGroupPath = exports.getTargetDirectory = exports.sanitizeTargetName = void 0;
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
/**
|
|
9
|
+
* Path utilities for working with target directories and files.
|
|
10
|
+
* Centralizes path resolution logic used across iOS plugins.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Sanitize target name for use in Xcode (removes non-alphanumeric characters).
|
|
14
|
+
* Appends "Target" suffix to avoid conflicts with main app name.
|
|
15
|
+
*/
|
|
16
|
+
function sanitizeTargetName(name) {
|
|
17
|
+
return name.replace(/[^a-zA-Z0-9]/g, '') + 'Target';
|
|
18
|
+
}
|
|
19
|
+
exports.sanitizeTargetName = sanitizeTargetName;
|
|
20
|
+
/**
|
|
21
|
+
* Get the target directory path (where user places their target code).
|
|
22
|
+
*/
|
|
23
|
+
function getTargetDirectory({ projectRoot, targetDirectory, }) {
|
|
24
|
+
return path_1.default.join(projectRoot, targetDirectory, 'ios');
|
|
25
|
+
}
|
|
26
|
+
exports.getTargetDirectory = getTargetDirectory;
|
|
27
|
+
/**
|
|
28
|
+
* Get the target group path in Xcode project (where target files live).
|
|
29
|
+
* Adds 'Target' suffix to prevent case-insensitivity collisions with main app on macOS.
|
|
30
|
+
*
|
|
31
|
+
* On case-insensitive filesystems (macOS default), directory names that differ only by case
|
|
32
|
+
* collide. For example, "shareextension" (main app) and "ShareExtension" (target) would resolve
|
|
33
|
+
* to the same directory. Adding "Target" suffix ensures uniqueness.
|
|
34
|
+
*/
|
|
35
|
+
function getTargetGroupPath({ platformProjectRoot, targetName, }) {
|
|
36
|
+
const dirName = sanitizeTargetName(targetName);
|
|
37
|
+
// Note: sanitizeTargetName already includes 'Target' suffix to prevent collision
|
|
38
|
+
// with main app on case-insensitive filesystems (e.g., "ShareExtension" -> "ShareExtensionTarget")
|
|
39
|
+
return path_1.default.join(platformProjectRoot, dirName);
|
|
40
|
+
}
|
|
41
|
+
exports.getTargetGroupPath = getTargetGroupPath;
|
|
42
|
+
/**
|
|
43
|
+
* Get path to generated entitlements file in Xcode project.
|
|
44
|
+
*/
|
|
45
|
+
function getGeneratedEntitlementsPath({ platformProjectRoot, targetName, }) {
|
|
46
|
+
return path_1.default.join(getTargetGroupPath({ platformProjectRoot, targetName }), 'generated.entitlements');
|
|
47
|
+
}
|
|
48
|
+
exports.getGeneratedEntitlementsPath = getGeneratedEntitlementsPath;
|
|
49
|
+
/**
|
|
50
|
+
* Get path to Info.plist in Xcode project.
|
|
51
|
+
*/
|
|
52
|
+
function getInfoPlistPath({ platformProjectRoot, targetName, }) {
|
|
53
|
+
return path_1.default.join(getTargetGroupPath({ platformProjectRoot, targetName }), 'Info.plist');
|
|
54
|
+
}
|
|
55
|
+
exports.getInfoPlistPath = getInfoPlistPath;
|
|
56
|
+
/**
|
|
57
|
+
* Get path to Assets.xcassets in Xcode project.
|
|
58
|
+
* For sticker targets, returns Stickers.xcassets instead.
|
|
59
|
+
*/
|
|
60
|
+
function getAssetsXcassetsPath({ platformProjectRoot, targetName, isStickers, }) {
|
|
61
|
+
const assetsFolderName = isStickers ? 'Stickers.xcassets' : 'Assets.xcassets';
|
|
62
|
+
return path_1.default.join(getTargetGroupPath({ platformProjectRoot, targetName }), assetsFolderName);
|
|
63
|
+
}
|
|
64
|
+
exports.getAssetsXcassetsPath = getAssetsXcassetsPath;
|
|
65
|
+
/**
|
|
66
|
+
* Get path to a specific colorset in Xcode project.
|
|
67
|
+
*/
|
|
68
|
+
function getColorsetPath({ platformProjectRoot, targetName, colorName, }) {
|
|
69
|
+
return path_1.default.join(getAssetsXcassetsPath({ platformProjectRoot, targetName }), `${colorName}.colorset`);
|
|
70
|
+
}
|
|
71
|
+
exports.getColorsetPath = getColorsetPath;
|
|
72
|
+
/**
|
|
73
|
+
* Get path to a specific sticker pack in Xcode project.
|
|
74
|
+
*/
|
|
75
|
+
function getStickerPackPath({ platformProjectRoot, targetName, stickerPackName, }) {
|
|
76
|
+
return path_1.default.join(getAssetsXcassetsPath({
|
|
77
|
+
platformProjectRoot,
|
|
78
|
+
targetName,
|
|
79
|
+
isStickers: true,
|
|
80
|
+
}), `${stickerPackName}.stickerpack`);
|
|
81
|
+
}
|
|
82
|
+
exports.getStickerPackPath = getStickerPackPath;
|
|
83
|
+
/**
|
|
84
|
+
* ============================================================================
|
|
85
|
+
* NEW: Reference-in-Place Path Utilities
|
|
86
|
+
* ============================================================================
|
|
87
|
+
* The following functions return paths within targets/ directory where files
|
|
88
|
+
* are referenced in place rather than copied to ios/. Generated files (Info.plist,
|
|
89
|
+
* Assets.xcassets, entitlements) go in targets/TARGETNAME/ios/build/, while user Swift
|
|
90
|
+
* files remain in targets/TARGETNAME/ios/.
|
|
91
|
+
*/
|
|
92
|
+
/**
|
|
93
|
+
* Get build output directory in targets/ folder.
|
|
94
|
+
* This is where generated files (Info.plist, Assets, entitlements) are placed.
|
|
95
|
+
*/
|
|
96
|
+
function getTargetBuildPath({ projectRoot, targetDirectory, }) {
|
|
97
|
+
return path_1.default.join(projectRoot, targetDirectory, 'ios', 'build');
|
|
98
|
+
}
|
|
99
|
+
exports.getTargetBuildPath = getTargetBuildPath;
|
|
100
|
+
/**
|
|
101
|
+
* Get path to Info.plist in targets/TARGETNAME/ios/build/.
|
|
102
|
+
* New approach: Info.plist generated in targets/, referenced from Xcode.
|
|
103
|
+
*/
|
|
104
|
+
function getTargetInfoPlistPath({ projectRoot, targetDirectory, }) {
|
|
105
|
+
return path_1.default.join(getTargetBuildPath({ projectRoot, targetDirectory }), 'Info.plist');
|
|
106
|
+
}
|
|
107
|
+
exports.getTargetInfoPlistPath = getTargetInfoPlistPath;
|
|
108
|
+
/**
|
|
109
|
+
* Get path to entitlements file in targets/TARGETNAME/ios/build/.
|
|
110
|
+
* New approach: Entitlements generated in targets/, referenced from Xcode.
|
|
111
|
+
*/
|
|
112
|
+
function getTargetEntitlementsPath({ projectRoot, targetDirectory, }) {
|
|
113
|
+
return path_1.default.join(getTargetBuildPath({ projectRoot, targetDirectory }), 'generated.entitlements');
|
|
114
|
+
}
|
|
115
|
+
exports.getTargetEntitlementsPath = getTargetEntitlementsPath;
|
|
116
|
+
/**
|
|
117
|
+
* Get path to Assets.xcassets in targets/TARGETNAME/ios/build/.
|
|
118
|
+
* New approach: Assets generated/copied to targets/, referenced from Xcode.
|
|
119
|
+
* For sticker targets, returns Stickers.xcassets instead.
|
|
120
|
+
*/
|
|
121
|
+
function getTargetAssetsPath({ projectRoot, targetDirectory, isStickers, }) {
|
|
122
|
+
const assetsFolderName = isStickers ? 'Stickers.xcassets' : 'Assets.xcassets';
|
|
123
|
+
return path_1.default.join(getTargetBuildPath({ projectRoot, targetDirectory }), assetsFolderName);
|
|
124
|
+
}
|
|
125
|
+
exports.getTargetAssetsPath = getTargetAssetsPath;
|
|
126
|
+
/**
|
|
127
|
+
* Get path to a specific colorset in targets/TARGETNAME/ios/build/Assets.xcassets/.
|
|
128
|
+
*/
|
|
129
|
+
function getTargetColorsetPath({ projectRoot, targetDirectory, colorName, }) {
|
|
130
|
+
return path_1.default.join(getTargetAssetsPath({ projectRoot, targetDirectory }), `${colorName}.colorset`);
|
|
131
|
+
}
|
|
132
|
+
exports.getTargetColorsetPath = getTargetColorsetPath;
|
|
133
|
+
/**
|
|
134
|
+
* Get path to user's Swift source files in targets/TARGETNAME/ios/.
|
|
135
|
+
* These are referenced in place, not copied.
|
|
136
|
+
*/
|
|
137
|
+
function getTargetSourcePath({ projectRoot, targetDirectory, fileName, }) {
|
|
138
|
+
return path_1.default.join(projectRoot, targetDirectory, 'ios', fileName);
|
|
139
|
+
}
|
|
140
|
+
exports.getTargetSourcePath = getTargetSourcePath;
|
|
141
|
+
//# sourceMappingURL=paths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../../../../plugin/src/ios/utils/paths.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB;;;GAGG;AAEH;;;GAGG;AACH,SAAgB,kBAAkB,CAAC,IAAY;IAC7C,OAAO,IAAI,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC,GAAG,QAAQ,CAAC;AACtD,CAAC;AAFD,gDAEC;AAED;;GAEG;AACH,SAAgB,kBAAkB,CAAC,EACjC,WAAW,EACX,eAAe,GAIhB;IACC,OAAO,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,eAAe,EAAE,KAAK,CAAC,CAAC;AACxD,CAAC;AARD,gDAQC;AAED;;;;;;;GAOG;AACH,SAAgB,kBAAkB,CAAC,EACjC,mBAAmB,EACnB,UAAU,GAIX;IACC,MAAM,OAAO,GAAG,kBAAkB,CAAC,UAAU,CAAC,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;AACJ,CAAC;AAbD,sDAaC;AAED;;;GAGG;AACH,SAAgB,mBAAmB,CAAC,EAClC,WAAW,EACX,eAAe,EACf,QAAQ,GAKT;IACC,OAAO,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,eAAe,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;AAClE,CAAC;AAVD,kDAUC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ExtensionType } from '../../config';
|
|
2
|
+
/**
|
|
3
|
+
* Plist file manipulation utilities.
|
|
4
|
+
* Provides high-level helpers for working with plist files.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Write a plist file from an object.
|
|
8
|
+
*/
|
|
9
|
+
export declare function writePlist(filePath: string, data: Record<string, any>): void;
|
|
10
|
+
/**
|
|
11
|
+
* Read a plist file into an object.
|
|
12
|
+
*/
|
|
13
|
+
export declare function readPlist(filePath: string): Record<string, any>;
|
|
14
|
+
/**
|
|
15
|
+
* Merge entitlements with App Clip specific requirements.
|
|
16
|
+
*/
|
|
17
|
+
export declare function mergeAppClipEntitlements(entitlements: Record<string, any>, mainBundleIdentifier: string): Record<string, any>;
|
|
18
|
+
/**
|
|
19
|
+
* Sync App Groups from main app to target entitlements.
|
|
20
|
+
*/
|
|
21
|
+
export declare function syncAppGroups({ targetEntitlements, mainAppGroups, }: {
|
|
22
|
+
targetEntitlements: Record<string, any>;
|
|
23
|
+
mainAppGroups: string[] | undefined;
|
|
24
|
+
}): Record<string, any>;
|
|
25
|
+
/**
|
|
26
|
+
* Check if a target type should use App Groups by default.
|
|
27
|
+
*/
|
|
28
|
+
export declare function shouldUseAppGroups(type: ExtensionType): boolean;
|
|
29
|
+
//# sourceMappingURL=plist.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plist.d.ts","sourceRoot":"","sources":["../../../../../plugin/src/ios/utils/plist.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD;;;GAGG;AAEH;;GAEG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAG5E;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAM/D;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACjC,oBAAoB,EAAE,MAAM,GAC3B,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAQrB;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,EAC5B,kBAAkB,EAClB,aAAa,GACd,EAAE;IACD,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACxC,aAAa,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;CACrC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAetB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CA0B/D"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.shouldUseAppGroups = exports.syncAppGroups = exports.mergeAppClipEntitlements = exports.readPlist = exports.writePlist = void 0;
|
|
30
|
+
const plist_1 = __importDefault(require("@expo/plist"));
|
|
31
|
+
const FileUtils = __importStar(require("./file"));
|
|
32
|
+
/**
|
|
33
|
+
* Plist file manipulation utilities.
|
|
34
|
+
* Provides high-level helpers for working with plist files.
|
|
35
|
+
*/
|
|
36
|
+
/**
|
|
37
|
+
* Write a plist file from an object.
|
|
38
|
+
*/
|
|
39
|
+
function writePlist(filePath, data) {
|
|
40
|
+
const plistContent = plist_1.default.build(data);
|
|
41
|
+
FileUtils.writeFileSafe(filePath, plistContent);
|
|
42
|
+
}
|
|
43
|
+
exports.writePlist = writePlist;
|
|
44
|
+
/**
|
|
45
|
+
* Read a plist file into an object.
|
|
46
|
+
*/
|
|
47
|
+
function readPlist(filePath) {
|
|
48
|
+
const content = FileUtils.readFileIfExists(filePath);
|
|
49
|
+
if (!content) {
|
|
50
|
+
throw new Error(`Plist file not found: ${filePath}`);
|
|
51
|
+
}
|
|
52
|
+
return plist_1.default.parse(content);
|
|
53
|
+
}
|
|
54
|
+
exports.readPlist = readPlist;
|
|
55
|
+
/**
|
|
56
|
+
* Merge entitlements with App Clip specific requirements.
|
|
57
|
+
*/
|
|
58
|
+
function mergeAppClipEntitlements(entitlements, mainBundleIdentifier) {
|
|
59
|
+
return {
|
|
60
|
+
...entitlements,
|
|
61
|
+
'com.apple.developer.parent-application-identifiers': [
|
|
62
|
+
`$(AppIdentifierPrefix)${mainBundleIdentifier}`,
|
|
63
|
+
],
|
|
64
|
+
'com.apple.developer.on-demand-install-capable': true,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
exports.mergeAppClipEntitlements = mergeAppClipEntitlements;
|
|
68
|
+
/**
|
|
69
|
+
* Sync App Groups from main app to target entitlements.
|
|
70
|
+
*/
|
|
71
|
+
function syncAppGroups({ targetEntitlements, mainAppGroups, }) {
|
|
72
|
+
const APP_GROUP_KEY = 'com.apple.security.application-groups';
|
|
73
|
+
if (!targetEntitlements[APP_GROUP_KEY] &&
|
|
74
|
+
Array.isArray(mainAppGroups) &&
|
|
75
|
+
mainAppGroups.length > 0) {
|
|
76
|
+
return {
|
|
77
|
+
...targetEntitlements,
|
|
78
|
+
[APP_GROUP_KEY]: mainAppGroups,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
return targetEntitlements;
|
|
82
|
+
}
|
|
83
|
+
exports.syncAppGroups = syncAppGroups;
|
|
84
|
+
/**
|
|
85
|
+
* Check if a target type should use App Groups by default.
|
|
86
|
+
*/
|
|
87
|
+
function shouldUseAppGroups(type) {
|
|
88
|
+
const SHOULD_USE_APP_GROUPS_BY_DEFAULT = {
|
|
89
|
+
widget: true,
|
|
90
|
+
clip: true,
|
|
91
|
+
share: true,
|
|
92
|
+
'bg-download': true,
|
|
93
|
+
stickers: false,
|
|
94
|
+
messages: true,
|
|
95
|
+
action: false,
|
|
96
|
+
safari: false,
|
|
97
|
+
'notification-content': false,
|
|
98
|
+
'notification-service': false,
|
|
99
|
+
intent: false,
|
|
100
|
+
'intent-ui': false,
|
|
101
|
+
spotlight: false,
|
|
102
|
+
'quicklook-thumbnail': false,
|
|
103
|
+
'location-push': false,
|
|
104
|
+
'credentials-provider': false,
|
|
105
|
+
'account-auth': false,
|
|
106
|
+
'app-intent': false,
|
|
107
|
+
'device-activity-monitor': false,
|
|
108
|
+
matter: false,
|
|
109
|
+
watch: false,
|
|
110
|
+
};
|
|
111
|
+
return SHOULD_USE_APP_GROUPS_BY_DEFAULT[type];
|
|
112
|
+
}
|
|
113
|
+
exports.shouldUseAppGroups = shouldUseAppGroups;
|
|
114
|
+
//# sourceMappingURL=plist.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plist.js","sourceRoot":"","sources":["../../../../../plugin/src/ios/utils/plist.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wDAAgC;AAEhC,kDAAoC;AAGpC;;;GAGG;AAEH;;GAEG;AACH,SAAgB,UAAU,CAAC,QAAgB,EAAE,IAAyB;IACpE,MAAM,YAAY,GAAG,eAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACvC,SAAS,CAAC,aAAa,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;AAClD,CAAC;AAHD,gCAGC;AAED;;GAEG;AACH,SAAgB,SAAS,CAAC,QAAgB;IACxC,MAAM,OAAO,GAAG,SAAS,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACrD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,yBAAyB,QAAQ,EAAE,CAAC,CAAC;IACvD,CAAC;IACD,OAAO,eAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AAC9B,CAAC;AAND,8BAMC;AAED;;GAEG;AACH,SAAgB,wBAAwB,CACtC,YAAiC,EACjC,oBAA4B;IAE5B,OAAO;QACL,GAAG,YAAY;QACf,oDAAoD,EAAE;YACpD,yBAAyB,oBAAoB,EAAE;SAChD;QACD,+CAA+C,EAAE,IAAI;KACtD,C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
|
6
|
+
* Generate a Podfile target block for a React Native extension.
|
|
7
|
+
* Extension targets only inherit search paths, with no explicit pod dependencies.
|
|
8
|
+
* This avoids linking incompatible modules like Expo that contain UIApplication APIs.
|
|
9
|
+
*
|
|
10
|
+
* Note: ExpoTargetsMessages is accessed via the main app's autolinking through shared
|
|
11
|
+
* registry defined in generated code, so no direct pod dependency is needed.
|
|
12
|
+
*/
|
|
13
|
+
export declare function generateReactNativeTargetBlock({ targetName, deploymentTarget, extensionType, }: {
|
|
14
|
+
targetName: string;
|
|
15
|
+
deploymentTarget: string;
|
|
16
|
+
extensionType: string;
|
|
17
|
+
}): string;
|
|
18
|
+
/**
|
|
19
|
+
* Check if main app target uses frameworks.
|
|
20
|
+
* Returns true if use_frameworks! is found in the main target block.
|
|
21
|
+
*/
|
|
22
|
+
export declare function mainTargetUsesFrameworks(podfileContent: string, mainTargetName: string): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Generate a Podfile target block for a standalone (non-RN) extension.
|
|
25
|
+
* Standalone targets use native code only (Swift/Obj-C), no React Native or Expo modules.
|
|
26
|
+
* Must match main app's use_frameworks! setting for CocoaPods integration.
|
|
27
|
+
*/
|
|
28
|
+
export declare function generateStandaloneTargetBlock({ targetName, deploymentTarget, useFrameworks, }: {
|
|
29
|
+
targetName: string;
|
|
30
|
+
deploymentTarget: string;
|
|
31
|
+
useFrameworks?: boolean;
|
|
32
|
+
}): string;
|
|
33
|
+
/**
|
|
34
|
+
* Insert a target block into a Podfile.
|
|
35
|
+
* React Native targets are nested inside main app to inherit dependencies.
|
|
36
|
+
* Standalone targets are inserted as siblings to avoid Expo module autolinking.
|
|
37
|
+
*/
|
|
38
|
+
export declare function insertTargetBlock(podfileContent: string, targetBlock: string, standalone?: boolean, logger?: {
|
|
39
|
+
log: (message: string) => void;
|
|
40
|
+
}): string;
|
|
41
|
+
/**
|
|
42
|
+
* Check if a Podfile already contains a target block.
|
|
43
|
+
*/
|
|
44
|
+
export declare function hasTargetBlock(podfileContent: string, targetName: string): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Remove an existing target block from a Podfile.
|
|
47
|
+
* Finds the target declaration and removes it along with its entire do/end block.
|
|
48
|
+
*/
|
|
49
|
+
export declare function removeTargetBlock(podfileContent: string, targetName: string): string;
|
|
50
|
+
/**
|
|
51
|
+
* Ensure main app target has use_frameworks! to match extension requirements.
|
|
52
|
+
* CocoaPods requires host app and extensions to have matching use_frameworks! settings.
|
|
53
|
+
*/
|
|
54
|
+
export declare function ensureMainTargetUsesFrameworks(podfileContent: string, mainTargetName: string): string;
|
|
55
|
+
/**
|
|
56
|
+
* Update the Podfile platform line to match the highest deployment target.
|
|
57
|
+
* This ensures consistency between the main app platform and extension targets.
|
|
58
|
+
*
|
|
59
|
+
* Fixes deployment target mismatch where Podfile defaults to 15.1 but extension
|
|
60
|
+
* targets require a higher version (e.g., 17.0), causing linker errors.
|
|
61
|
+
*/
|
|
62
|
+
export declare function updatePodfilePlatform(podfileContent: string, deploymentTarget: string): string;
|
|
63
|
+
/**
|
|
64
|
+
* Inject deployment target fixes into the main app's existing post_install hook.
|
|
65
|
+
* This ensures extension targets maintain their correct deployment targets even after
|
|
66
|
+
* react_native_post_install runs, which might override them.
|
|
67
|
+
*
|
|
68
|
+
* Fixes both the Pods Xcode project targets AND the xcconfig files that extensions reference.
|
|
69
|
+
*/
|
|
70
|
+
export declare function ensureExtensionDeploymentTargets(podfileContent: string, extensions: {
|
|
71
|
+
targetName: string;
|
|
72
|
+
deploymentTarget: string;
|
|
73
|
+
}[]): string;
|
|
74
|
+
/**
|
|
75
|
+
* Ensure React Native extension targets have proper framework search paths.
|
|
76
|
+
* Uses START/END markers for reliable, idempotent injection.
|
|
77
|
+
*/
|
|
78
|
+
export declare function ensureReactNativeExtensionFrameworkPaths(podfileContent: string, extensions: {
|
|
79
|
+
targetName: string;
|
|
80
|
+
deploymentTarget: string;
|
|
81
|
+
}[], mainTargetName: string): string;
|
|
82
|
+
//# sourceMappingURL=podfile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"podfile.d.ts","sourceRoot":"","sources":["../../../../../plugin/src/ios/utils/podfile.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;GAOG;AACH,wBAAgB,8BAA8B,CAAC,EAC7C,UAAU,EACV,gBAAgB,EAChB,aAAa,GACd,EAAE;IACD,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;CACvB,GAAG,MAAM,CAOT;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,cAAc,EAAE,MAAM,EACtB,cAAc,EAAE,MAAM,GACrB,OAAO,CAaT;AAED;;;;GAIG;AACH,wBAAgB,6BAA6B,CAAC,EAC5C,UAAU,EACV,gBAAgB,EAChB,aAAa,GACd,EAAE;IACD,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,GAAG,MAAM,CAST;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,MAAM,EACnB,UAAU,GAAE,OAAe,EAC3B,MAAM,CAAC,EAAE;IAAE,GAAG,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CAAE,GAC1C,MAAM,CA8DR;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC5B,cAAc,EAAE,MAAM,EACtB,UAAU,EAAE,MAAM,GACjB,OAAO,CAET;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,cAAc,EAAE,MAAM,EACtB,UAAU,EAAE,MAAM,GACjB,MAAM,CA0DR;AAED;;;GAGG;AACH,wBAAgB,8BAA8B,CAC5C,cAAc,EAAE,MAAM,EACtB,cAAc,EAAE,MAAM,GACrB,MAAM,CA6BR;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC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