@bacons/apple-targets 3.0.6 → 3.0.7

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/README.md CHANGED
@@ -1,11 +1,11 @@
1
- # Apple Targets plugin
1
+ # Apple Targets
2
2
 
3
3
  > [!WARNING]
4
- > This is highly experimental and not part of any official Expo workflow.
4
+ > This is an experimental Config Plugin not part of any official Expo workflow. Automated testing of targets is seemingly impossible meaning unexpected regressions can occur between versions.
5
5
 
6
- <img width="1061" alt="Screenshot 2023-06-10 at 1 59 26 PM" src="https://github.com/EvanBacon/expo-apple-targets/assets/9664363/4cd8399d-53aa-401a-9caa-3a1432a0640c">
6
+ An experimental Expo Config Plugin that generates native Apple Targets like Widgets or App Clips, and links them outside the `/ios` directory. You can open Xcode and develop the targets inside the virtual `expo:targets` folder and the changes will be saved outside of the `ios` directory. This pattern enables building things that fall outside of the scope of React Native while still obtaining all the benefits of [Continuous Native Generation](https://docs.expo.dev/workflow/continuous-native-generation/).
7
7
 
8
- An experimental Expo Config Plugin that generates native Apple Targets like Widgets or App Clips, and links them outside the `/ios` directory. You can open Xcode and develop the targets inside the virtual `expo:targets` folder and the changes will be saved outside of the `ios` directory. This pattern enables building things that fall outside of the scope of React Native while still obtaining all the benefits of Continuous Native Generation.
8
+ <img width="1728" height="963" alt="targets" src="https://github.com/user-attachments/assets/aedaafa0-1ef0-403c-a797-9f4c82cdb9f1" />
9
9
 
10
10
  ## 🚀 How to use
11
11
 
@@ -20,18 +20,18 @@ const withXcodeChanges = (config, props) => {
20
20
  });
21
21
  };
22
22
  exports.withXcodeChanges = withXcodeChanges;
23
- function getMainMarketingVersion(project) {
24
- const mainTarget = (0, target_1.getMainAppTarget)(project);
25
- const config = mainTarget.getDefaultConfiguration();
26
- const info = config.getInfoPlist();
27
- const version = info.CFBundleShortVersionString;
28
- // console.log('getMainMarketingVersion', mainTarget.getDisplayName(), version)
29
- if (!version || version === "$(MARKETING_VERSION)") {
30
- // console.log('getMainMarketingVersion.fallback', config.props.buildSettings.MARKETING_VERSION)
31
- return config.props.buildSettings.MARKETING_VERSION;
32
- }
33
- return version;
34
- }
23
+ // function getMainMarketingVersion(project: XcodeProject) {
24
+ // const mainTarget = getMainAppTarget(project);
25
+ // const config = mainTarget.getDefaultConfiguration();
26
+ // const info = config.getInfoPlist();
27
+ // const version = info.CFBundleShortVersionString;
28
+ // // console.log('getMainMarketingVersion', mainTarget.getDisplayName(), version)
29
+ // if (!version || version === "$(MARKETING_VERSION)") {
30
+ // // console.log('getMainMarketingVersion.fallback', config.props.buildSettings.MARKETING_VERSION)
31
+ // return config.props.buildSettings.MARKETING_VERSION;
32
+ // }
33
+ // return version;
34
+ // }
35
35
  async function applyXcodeChanges(config, project, props) {
36
36
  var _a, _b;
37
37
  var _c;
@@ -109,7 +109,11 @@ async function applyXcodeChanges(config, project, props) {
109
109
  // CODE_SIGN_ENTITLEMENTS = MattermostShare/MattermostShare.entitlements;
110
110
  }
111
111
  function syncMarketingVersions() {
112
- const mainVersion = getMainMarketingVersion(project);
112
+ var _a;
113
+ // In Expo managed projects, the version will always be overwritten.
114
+ // Because the overwrite happens after this script runs, we just set it to the config value.
115
+ const mainVersion = ((_a = config.ios) === null || _a === void 0 ? void 0 : _a.version) || config.version || '1.0.0';
116
+ // const mainVersion = getMainMarketingVersion(project);
113
117
  project.rootObject.props.targets.forEach((target) => {
114
118
  if (xcode_1.PBXNativeTarget.is(target)) {
115
119
  target.setBuildSetting("MARKETING_VERSION", mainVersion);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bacons/apple-targets",
3
- "version": "3.0.6",
3
+ "version": "3.0.7",
4
4
  "description": "Generate Apple Targets with Expo Prebuild",
5
5
  "main": "build/ExtensionStorage.js",
6
6
  "types": "build/ExtensionStorage.d.ts",