@bacons/apple-targets 4.0.2 → 4.0.4
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 +1 -4
- package/build/config-plugin.js +7 -1
- package/build/target.js +7 -0
- package/build/with-widget.js +1 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
# Apple Targets
|
|
2
2
|
|
|
3
|
-
|
|
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
|
-
|
|
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/).
|
|
3
|
+
An 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
4
|
|
|
8
5
|
<img width="1728" height="963" alt="targets" src="https://github.com/user-attachments/assets/aedaafa0-1ef0-403c-a797-9f4c82cdb9f1" />
|
|
9
6
|
|
package/build/config-plugin.js
CHANGED
|
@@ -12,10 +12,16 @@ const with_widget_1 = __importDefault(require("./with-widget"));
|
|
|
12
12
|
const with_bacons_xcode_1 = require("./with-bacons-xcode");
|
|
13
13
|
const util_1 = require("./util");
|
|
14
14
|
const withTargetsDir = (config, _props) => {
|
|
15
|
-
var _a;
|
|
15
|
+
var _a, _b;
|
|
16
16
|
let { appleTeamId = (_a = config === null || config === void 0 ? void 0 : config.ios) === null || _a === void 0 ? void 0 : _a.appleTeamId } = _props || {};
|
|
17
17
|
const { root = "./targets", match = "*" } = _props || {};
|
|
18
18
|
const projectRoot = config._internal.projectRoot;
|
|
19
|
+
if (!((_b = config.ios) === null || _b === void 0 ? void 0 : _b.bundleIdentifier)) {
|
|
20
|
+
const fallbackBundleId = `com.example.${config.slug}`;
|
|
21
|
+
(0, util_1.warnOnce)((0, chalk_1.default) `{yellow [bacons/apple-targets]} Expo config is missing {cyan ios.bundleIdentifier} property. Using fallback: {cyan ${fallbackBundleId}}. Add it to your app.json or app.config.js for production builds.`);
|
|
22
|
+
config.ios = config.ios || {};
|
|
23
|
+
config.ios.bundleIdentifier = fallbackBundleId;
|
|
24
|
+
}
|
|
19
25
|
if (!appleTeamId) {
|
|
20
26
|
(0, util_1.warnOnce)((0, chalk_1.default) `{yellow [bacons/apple-targets]} Expo config is missing required {cyan ios.appleTeamId} property. Find this in Xcode and add to the Expo Config to correct. iOS builds may fail until this is corrected.`);
|
|
21
27
|
}
|
package/build/target.js
CHANGED
|
@@ -621,6 +621,13 @@ function getTargetInfoPlistForType(type) {
|
|
|
621
621
|
NSExtensionPrincipalClass: "$(PRODUCT_MODULE_NAME).ShieldConfigurationExtension",
|
|
622
622
|
},
|
|
623
623
|
};
|
|
624
|
+
case "device-activity-monitor":
|
|
625
|
+
return {
|
|
626
|
+
NSExtension: {
|
|
627
|
+
NSExtensionPointIdentifier,
|
|
628
|
+
NSExtensionPrincipalClass: "$(PRODUCT_MODULE_NAME).DeviceActivityMonitorExtension",
|
|
629
|
+
},
|
|
630
|
+
};
|
|
624
631
|
case "print-service":
|
|
625
632
|
return {
|
|
626
633
|
NSExtension: {
|
package/build/with-widget.js
CHANGED
|
@@ -19,9 +19,8 @@ const util_1 = require("./util");
|
|
|
19
19
|
const DEFAULT_DEPLOYMENT_TARGET = "18.0";
|
|
20
20
|
const DEFAULT_WATCHOS_DEPLOYMENT_TARGET = "11.0";
|
|
21
21
|
const withWidget = (config, props) => {
|
|
22
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
23
|
-
util_1.LOG_QUEUE.add(() => (0, util_1.warnOnce)((0, chalk_1.default) `\nUsing experimental Config Plugin {bold @bacons/apple-targets} that is subject to breaking changes.`));
|
|
24
22
|
// TODO: Magically based on the top-level folders in the `ios-widgets/` folder
|
|
23
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
25
24
|
if (props.icon && !/https?:\/\//.test(props.icon)) {
|
|
26
25
|
props.icon = path_1.default.join(props.directory, props.icon);
|
|
27
26
|
}
|