@bacons/apple-targets 3.0.4 → 3.0.6

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.
Files changed (30) hide show
  1. package/README.md +10 -3
  2. package/build/colorset/{withIosColorset.js → with-ios-colorset.js} +2 -2
  3. package/build/config-plugin.js +9 -10
  4. package/build/config.d.ts +2 -2
  5. package/build/{withXcodeChanges.d.ts → configuration-list.d.ts} +4 -2
  6. package/build/configuration-list.js +656 -0
  7. package/build/target.d.ts +473 -2
  8. package/build/target.js +281 -239
  9. package/build/util.d.ts +18 -0
  10. package/build/util.js +48 -0
  11. package/build/{withXcparse.js → with-bacons-xcode.js} +5 -2
  12. package/build/{withEasCredentials.js → with-eas-credentials.js} +2 -2
  13. package/build/{withWidget.js → with-widget.js} +25 -65
  14. package/build/with-xcode-changes.d.ts +3 -0
  15. package/build/with-xcode-changes.js +397 -0
  16. package/package.json +7 -2
  17. package/build/template/XCBuildConfiguration.json +0 -759
  18. package/build/withXcodeChanges.js +0 -1034
  19. /package/build/colorset/{customColorFromCSS.d.ts → custom-color-from-css.d.ts} +0 -0
  20. /package/build/colorset/{customColorFromCSS.js → custom-color-from-css.js} +0 -0
  21. /package/build/colorset/{withIosColorset.d.ts → with-ios-colorset.d.ts} +0 -0
  22. /package/build/icon/{withImageAsset.d.ts → with-image-asset.d.ts} +0 -0
  23. /package/build/icon/{withImageAsset.js → with-image-asset.js} +0 -0
  24. /package/build/icon/{withIosIcon.d.ts → with-ios-icon.d.ts} +0 -0
  25. /package/build/icon/{withIosIcon.js → with-ios-icon.js} +0 -0
  26. /package/build/{withXcparse.d.ts → with-bacons-xcode.d.ts} +0 -0
  27. /package/build/{withEasCredentials.d.ts → with-eas-credentials.d.ts} +0 -0
  28. /package/build/{withPodTargetExtension.d.ts → with-pod-target-extension.d.ts} +0 -0
  29. /package/build/{withPodTargetExtension.js → with-pod-target-extension.js} +0 -0
  30. /package/build/{withWidget.d.ts → with-widget.d.ts} +0 -0
package/README.md CHANGED
@@ -56,7 +56,10 @@ module.exports = {
56
56
  type: "widget",
57
57
 
58
58
  // Name of the target/product. Defaults to the directory name.
59
- name: "My Widget",
59
+ name: "my_widget",
60
+
61
+ // Optional override for CFBundleDisplayName. Defaults to `name` if not provided.
62
+ displayName: "My Widget",
60
63
 
61
64
  // Generates colorset files for the target.
62
65
  colors: {
@@ -230,7 +233,7 @@ These show up in the share sheet. The icon should be transparent as it will be m
230
233
  /** @type {import('@bacons/apple-targets/app.plugin').Config} */
231
234
  module.exports = {
232
235
  type: "action",
233
- name: "Inspect Element",
236
+ displayName: "Inspect Element",
234
237
  icon: "./assets/icon.png",
235
238
  colors: {
236
239
  TouchBarBezel: "#DB739C",
@@ -301,7 +304,11 @@ Ideally, this would be generated automatically based on a fully qualified Xcode
301
304
  | location-push | Location Push Service Extension |
302
305
  | credentials-provider | Credentials Provider Extension |
303
306
  | account-auth | Account Authentication Extension |
304
- | device-activity-monitor | Device Activity Monitor Extension |
307
+ | network-packet-tunnel | Packet Tunnel Network Extension |
308
+ | network-app-proxy | App Proxy Network Extension |
309
+ | network-dns-proxy | DNS Proxy Network Extension |
310
+ | network-filter-data | Filter Data Network Extension |
311
+
305
312
 
306
313
  <!-- | imessage | iMessage Extension | -->
307
314
 
@@ -7,7 +7,7 @@ exports.setColorAsync = exports.withIosColorset = void 0;
7
7
  const config_plugins_1 = require("expo/config-plugins");
8
8
  const node_fs_1 = __importDefault(require("node:fs"));
9
9
  const node_path_1 = __importDefault(require("node:path"));
10
- const customColorFromCSS_1 = require("./customColorFromCSS");
10
+ const custom_color_from_css_1 = require("./custom-color-from-css");
11
11
  const withIosColorset = (config, { cwd, color, darkColor, name }) => {
12
12
  return (0, config_plugins_1.withDangerousMod)(config, [
13
13
  "ios",
@@ -25,7 +25,7 @@ const DARK_APPEARANCE = {
25
25
  function createColor(color) {
26
26
  return {
27
27
  "color-space": "display-p3",
28
- components: (0, customColorFromCSS_1.customColorFromCSS)(color),
28
+ components: (0, custom_color_from_css_1.customColorFromCSS)(color),
29
29
  };
30
30
  }
31
31
  async function setColorAsync({ color, darkColor }, colorsetFilePath) {
@@ -7,18 +7,17 @@ exports.withTargetsDir = void 0;
7
7
  const glob_1 = require("glob");
8
8
  const path_1 = __importDefault(require("path"));
9
9
  const chalk_1 = __importDefault(require("chalk"));
10
- const withPodTargetExtension_1 = require("./withPodTargetExtension");
11
- const withWidget_1 = __importDefault(require("./withWidget"));
12
- const withXcparse_1 = require("./withXcparse");
13
- let hasWarned = false;
10
+ const with_pod_target_extension_1 = require("./with-pod-target-extension");
11
+ const with_widget_1 = __importDefault(require("./with-widget"));
12
+ const with_bacons_xcode_1 = require("./with-bacons-xcode");
13
+ const util_1 = require("./util");
14
14
  const withTargetsDir = (config, _props) => {
15
15
  var _a;
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 (!appleTeamId && !hasWarned) {
20
- hasWarned = true;
21
- console.warn((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.`);
19
+ if (!appleTeamId) {
20
+ (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.`);
22
21
  }
23
22
  const targets = (0, glob_1.globSync)(`${root}/${match}/expo-target.config.@(json|js)`, {
24
23
  // const targets = globSync(`./targets/action/expo-target.config.@(json|js)`, {
@@ -41,15 +40,15 @@ const withTargetsDir = (config, _props) => {
41
40
  if (!evaluatedTargetConfigObject.type) {
42
41
  throw new Error(`Expected target config to have a 'type' property denoting the type of target it is, e.g. 'widget'`);
43
42
  }
44
- config = (0, withWidget_1.default)(config, {
43
+ config = (0, with_widget_1.default)(config, {
45
44
  appleTeamId,
46
45
  ...evaluatedTargetConfigObject,
47
46
  directory: path_1.default.relative(projectRoot, path_1.default.dirname(configPath)),
48
47
  configPath,
49
48
  });
50
49
  });
51
- (0, withPodTargetExtension_1.withPodTargetExtension)(config);
52
- (0, withXcparse_1.withXcodeProjectBetaBaseMod)(config);
50
+ (0, with_pod_target_extension_1.withPodTargetExtension)(config);
51
+ (0, with_bacons_xcode_1.withXcodeProjectBetaBaseMod)(config);
53
52
  return config;
54
53
  };
55
54
  exports.withTargetsDir = withTargetsDir;
package/build/config.d.ts CHANGED
@@ -69,6 +69,8 @@ export type Config = {
69
69
  type: ExtensionType;
70
70
  /** Name of the target. Will default to a sanitized version of the directory name. */
71
71
  name?: string;
72
+ /** Optional custom name for `CFBundleDisplayName`. */
73
+ displayName?: string;
72
74
  /**
73
75
  * Bundle identifier for the target. Will default to a sanitized version of the root project + name.
74
76
  * If the specified bundle identifier is prefixed with a dot (.), the bundle identifier will be appended to the main app's bundle identifier.
@@ -76,8 +78,6 @@ export type Config = {
76
78
  bundleIdentifier?: string;
77
79
  /**
78
80
  * A local file path or URL to an image asset.
79
- * @example "./assets/icon.png"
80
- * @example "https://example.com/icon.png"
81
81
  */
82
82
  icon?: string;
83
83
  /**
@@ -1,7 +1,9 @@
1
- import { ConfigPlugin } from "@expo/config-plugins";
1
+ import { XCConfigurationList, XcodeProject } from "@bacons/xcode";
2
2
  import { ExtensionType } from "./target";
3
3
  export type XcodeSettings = {
4
4
  name: string;
5
+ /** Optional custom value for CFBundleDisplayName */
6
+ displayName?: string;
5
7
  /** Name used for internal purposes. This has more strict rules and should be generated. */
6
8
  productName: string;
7
9
  /** Directory relative to the project root, (i.e. outside of the `ios` directory) where the widget code should live. */
@@ -22,4 +24,4 @@ export type XcodeSettings = {
22
24
  deviceFamilies?: DeviceFamily[];
23
25
  };
24
26
  export type DeviceFamily = "phone" | "tablet";
25
- export declare const withXcodeChanges: ConfigPlugin<XcodeSettings>;
27
+ export declare function createConfigurationListForType(project: XcodeProject, props: XcodeSettings): XCConfigurationList;