@bacons/apple-targets 3.0.7 → 4.0.1

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/build/target.js CHANGED
@@ -1,69 +1,298 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getAuxiliaryTargets = exports.getMainAppTarget = exports.isNativeTargetOfType = exports.getFrameworksForType = exports.needsEmbeddedSwift = exports.productTypeForType = exports.getTargetInfoPlistForType = exports.SHOULD_USE_APP_GROUPS_BY_DEFAULT = exports.KNOWN_EXTENSION_POINT_IDENTIFIERS = void 0;
4
- exports.KNOWN_EXTENSION_POINT_IDENTIFIERS = {
5
- "com.apple.message-payload-provider": "imessage",
6
- "com.apple.widgetkit-extension": "widget",
7
- "com.apple.usernotifications.content-extension": "notification-content",
8
- "com.apple.share-services": "share",
9
- "com.apple.usernotifications.service": "notification-service",
10
- "com.apple.spotlight.import": "spotlight",
11
- "com.apple.intents-service": "intent",
12
- "com.apple.intents-ui-service": "intent-ui",
13
- "com.apple.Safari.web-extension": "safari",
14
- "com.apple.background-asset-downloader-extension": "bg-download",
15
- "com.apple.matter.support.extension.device-setup": "matter",
16
- "com.apple.quicklook.thumbnail": "quicklook-thumbnail",
17
- "com.apple.location.push.service": "location-push",
18
- "com.apple.authentication-services-credential-provider-ui": "credentials-provider",
19
- "com.apple.authentication-services-account-authentication-modification-ui": "account-auth",
20
- "com.apple.services": "action",
21
- "com.apple.appintents-extension": "app-intent",
22
- "com.apple.deviceactivity.monitor-extension": "device-activity-monitor",
23
- // "com.apple.intents-service": "intents",
24
- "com.apple.networkextension.packet-tunnel": "network-packet-tunnel",
25
- "com.apple.networkextension.app-proxy": "network-app-proxy",
26
- "com.apple.networkextension.dns-proxy": "network-dns-proxy",
27
- "com.apple.networkextension.filter-data": "network-filter-data",
28
- "com.apple.keyboard-service": "keyboard",
29
- // "com.apple.intents-service": "intents",
30
- };
31
- // An exhaustive list of extension types that should sync app groups from the main target by default when
32
- // no app groups are specified.
33
- exports.SHOULD_USE_APP_GROUPS_BY_DEFAULT = {
34
- share: true,
35
- "bg-download": true,
36
- clip: true,
37
- widget: true,
38
- keyboard: true,
39
- "account-auth": false,
40
- "credentials-provider": false,
41
- "device-activity-monitor": false,
42
- "app-intent": false,
43
- "intent-ui": false,
44
- "location-push": false,
45
- "notification-content": false,
46
- "notification-service": false,
47
- "quicklook-thumbnail": false,
48
- action: false,
49
- imessage: false,
50
- intent: false,
51
- matter: false,
52
- safari: false,
53
- spotlight: false,
54
- watch: false,
55
- "network-packet-tunnel": false,
56
- "network-app-proxy": false,
57
- "network-dns-proxy": false,
58
- "network-filter-data": false,
3
+ exports.getAuxiliaryTargets = exports.getMainAppTarget = exports.isNativeTargetOfType = exports.getTargetInfoPlistForType = exports.getFrameworksForType = exports.needsEmbeddedSwift = exports.productTypeForType = exports.SHOULD_USE_APP_GROUPS_BY_DEFAULT = exports.KNOWN_EXTENSION_POINT_IDENTIFIERS = exports.TARGET_REGISTRY = void 0;
4
+ exports.TARGET_REGISTRY = {
5
+ widget: {
6
+ extensionPointIdentifier: "com.apple.widgetkit-extension",
7
+ frameworks: ["WidgetKit", "SwiftUI", "ActivityKit", "AppIntents"],
8
+ appGroupsByDefault: true,
9
+ displayName: "Widget",
10
+ description: "Home screen widget",
11
+ },
12
+ "notification-content": {
13
+ extensionPointIdentifier: "com.apple.usernotifications.content-extension",
14
+ frameworks: ["UserNotifications", "UserNotificationsUI"],
15
+ displayName: "Notification Content",
16
+ },
17
+ "notification-service": {
18
+ extensionPointIdentifier: "com.apple.usernotifications.service",
19
+ displayName: "Notification Service",
20
+ },
21
+ share: {
22
+ extensionPointIdentifier: "com.apple.share-services",
23
+ needsEmbeddedSwift: true,
24
+ appGroupsByDefault: true,
25
+ displayName: "Share Extension",
26
+ },
27
+ intent: {
28
+ extensionPointIdentifier: "com.apple.intents-service",
29
+ needsEmbeddedSwift: true,
30
+ frameworks: ["Intents"],
31
+ displayName: "Siri Intent",
32
+ },
33
+ "bg-download": {
34
+ extensionPointIdentifier: "com.apple.background-asset-downloader-extension",
35
+ needsEmbeddedSwift: true,
36
+ appGroupsByDefault: true,
37
+ displayName: "Background Download",
38
+ },
39
+ "intent-ui": {
40
+ extensionPointIdentifier: "com.apple.intents-ui-service",
41
+ needsEmbeddedSwift: true,
42
+ frameworks: ["IntentsUI"],
43
+ displayName: "Siri Intent UI",
44
+ },
45
+ spotlight: {
46
+ extensionPointIdentifier: "com.apple.spotlight.import",
47
+ needsEmbeddedSwift: true,
48
+ displayName: "Spotlight",
49
+ },
50
+ matter: {
51
+ extensionPointIdentifier: "com.apple.matter.support.extension.device-setup",
52
+ needsEmbeddedSwift: true,
53
+ displayName: "Matter",
54
+ },
55
+ "quicklook-thumbnail": {
56
+ extensionPointIdentifier: "com.apple.quicklook.thumbnail",
57
+ needsEmbeddedSwift: true,
58
+ frameworks: ["QuickLookThumbnailing"],
59
+ displayName: "Quicklook Thumbnail",
60
+ },
61
+ imessage: {
62
+ extensionPointIdentifier: "com.apple.message-payload-provider",
63
+ hasNoTemplate: true,
64
+ displayName: "iMessage",
65
+ },
66
+ clip: {
67
+ productType: "com.apple.product-type.application.on-demand-install-capable",
68
+ needsEmbeddedSwift: true,
69
+ appGroupsByDefault: true,
70
+ displayName: "App Clip",
71
+ description: "Instantly open your app without installing",
72
+ },
73
+ watch: {
74
+ productType: "com.apple.product-type.application",
75
+ needsEmbeddedSwift: true,
76
+ displayName: "Watch",
77
+ },
78
+ "watch-widget": {
79
+ // extensionPointIdentifier intentionally omitted to avoid collision
80
+ // with "widget" in KNOWN_EXTENSION_POINT_IDENTIFIERS. The Info.plist
81
+ // is handled explicitly in getTargetInfoPlistForType().
82
+ frameworks: ["WidgetKit", "SwiftUI"],
83
+ appGroupsByDefault: true,
84
+ displayName: "Watch Widget",
85
+ description: "Watch face complication using WidgetKit",
86
+ },
87
+ "location-push": {
88
+ extensionPointIdentifier: "com.apple.location.push.service",
89
+ displayName: "Location Push",
90
+ },
91
+ "credentials-provider": {
92
+ extensionPointIdentifier: "com.apple.authentication-services-credential-provider-ui",
93
+ displayName: "Credentials Provider",
94
+ },
95
+ "account-auth": {
96
+ extensionPointIdentifier: "com.apple.authentication-services-account-authentication-modification-ui",
97
+ displayName: "Account Auth",
98
+ },
99
+ action: {
100
+ extensionPointIdentifier: "com.apple.services",
101
+ displayName: "Action",
102
+ description: "Headless action that appears in share sheets",
103
+ },
104
+ safari: {
105
+ extensionPointIdentifier: "com.apple.Safari.web-extension",
106
+ displayName: "Safari Extension",
107
+ },
108
+ "app-intent": {
109
+ extensionPointIdentifier: "com.apple.appintents-extension",
110
+ productType: "com.apple.product-type.extensionkit-extension",
111
+ frameworks: ["AppIntents"],
112
+ displayName: "App Intent",
113
+ },
114
+ "device-activity-monitor": {
115
+ extensionPointIdentifier: "com.apple.deviceactivity.monitor-extension",
116
+ frameworks: ["DeviceActivity"],
117
+ displayName: "Device Activity Monitor",
118
+ },
119
+ "network-packet-tunnel": {
120
+ extensionPointIdentifier: "com.apple.networkextension.packet-tunnel",
121
+ needsEmbeddedSwift: true,
122
+ frameworks: ["NetworkExtension"],
123
+ displayName: "Network Extension: Packet Tunnel Provider",
124
+ },
125
+ "network-app-proxy": {
126
+ extensionPointIdentifier: "com.apple.networkextension.app-proxy",
127
+ needsEmbeddedSwift: true,
128
+ frameworks: ["NetworkExtension"],
129
+ displayName: "Network Extension: App Proxy",
130
+ },
131
+ "network-filter-data": {
132
+ extensionPointIdentifier: "com.apple.networkextension.filter-data",
133
+ needsEmbeddedSwift: true,
134
+ frameworks: ["NetworkExtension"],
135
+ displayName: "Network Extension: Filter Data",
136
+ },
137
+ "network-dns-proxy": {
138
+ extensionPointIdentifier: "com.apple.networkextension.dns-proxy",
139
+ needsEmbeddedSwift: true,
140
+ frameworks: ["NetworkExtension"],
141
+ displayName: "Network Extension: DNS Proxy",
142
+ },
143
+ keyboard: {
144
+ extensionPointIdentifier: "com.apple.keyboard-service",
145
+ needsEmbeddedSwift: true,
146
+ appGroupsByDefault: true,
147
+ displayName: "Keyboard Extension",
148
+ description: "Custom system keyboard",
149
+ },
150
+ "content-blocker": {
151
+ extensionPointIdentifier: "com.apple.Safari.content-blocker",
152
+ displayName: "Content Blocker",
153
+ description: "Safari content blocker extension",
154
+ },
155
+ "file-provider": {
156
+ extensionPointIdentifier: "com.apple.fileprovider-nonui",
157
+ frameworks: ["UniformTypeIdentifiers"],
158
+ appGroupsByDefault: true,
159
+ displayName: "File Provider",
160
+ },
161
+ "broadcast-upload": {
162
+ extensionPointIdentifier: "com.apple.broadcast-services-upload",
163
+ frameworks: ["ReplayKit"],
164
+ displayName: "Broadcast Upload",
165
+ },
166
+ "call-directory": {
167
+ extensionPointIdentifier: "com.apple.callkit.call-directory",
168
+ frameworks: ["CallKit"],
169
+ displayName: "Call Directory",
170
+ },
171
+ "message-filter": {
172
+ extensionPointIdentifier: "com.apple.identitylookup.message-filter",
173
+ frameworks: ["IdentityLookup"],
174
+ displayName: "Message Filter",
175
+ },
176
+ "file-provider-ui": {
177
+ extensionPointIdentifier: "com.apple.fileprovider-actionsui",
178
+ frameworks: ["FileProviderUI"],
179
+ displayName: "File Provider UI",
180
+ },
181
+ "broadcast-setup-ui": {
182
+ extensionPointIdentifier: "com.apple.broadcast-services-setupui",
183
+ frameworks: ["ReplayKit"],
184
+ displayName: "Broadcast Setup UI",
185
+ },
186
+ "classkit-context": {
187
+ extensionPointIdentifier: "com.apple.classkit.context-provider",
188
+ frameworks: ["ClassKit"],
189
+ displayName: "ClassKit Context Provider",
190
+ },
191
+ "unwanted-communication": {
192
+ extensionPointIdentifier: "com.apple.identitylookup.classification-ui",
193
+ frameworks: ["IdentityLookup", "IdentityLookupUI"],
194
+ displayName: "Unwanted Communication Reporting",
195
+ },
196
+ "photo-editing": {
197
+ extensionPointIdentifier: "com.apple.photo-editing",
198
+ frameworks: ["Photos", "PhotosUI"],
199
+ displayName: "Photo Editing",
200
+ },
201
+ "quicklook-preview": {
202
+ extensionPointIdentifier: "com.apple.quicklook.preview",
203
+ needsEmbeddedSwift: true,
204
+ frameworks: ["QuickLook"],
205
+ displayName: "Quick Look Preview",
206
+ },
207
+ "spotlight-delegate": {
208
+ extensionPointIdentifier: "com.apple.spotlight.index",
209
+ frameworks: ["CoreSpotlight"],
210
+ displayName: "CoreSpotlight Delegate",
211
+ },
212
+ "virtual-conference": {
213
+ extensionPointIdentifier: "com.apple.calendar.virtualconference",
214
+ displayName: "Virtual Conference Provider",
215
+ },
216
+ "shield-action": {
217
+ extensionPointIdentifier: "com.apple.ManagedSettings.shield-action-service",
218
+ frameworks: ["ManagedSettings"],
219
+ displayName: "Shield Action",
220
+ },
221
+ "shield-config": {
222
+ extensionPointIdentifier: "com.apple.ManagedSettingsUI.shield-configuration-service",
223
+ frameworks: ["ManagedSettings", "ManagedSettingsUI"],
224
+ displayName: "Shield Configuration",
225
+ },
226
+ "print-service": {
227
+ extensionPointIdentifier: "com.apple.printing.discovery",
228
+ displayName: "Print Service",
229
+ },
230
+ "smart-card": {
231
+ extensionPointIdentifier: "com.apple.ctk-tokens",
232
+ frameworks: ["CryptoTokenKit"],
233
+ displayName: "Smart Card",
234
+ description: "Persistent token / smart card extension",
235
+ },
236
+ "authentication-services": {
237
+ extensionPointIdentifier: "com.apple.AppSSO.idp-extension",
238
+ frameworks: ["AuthenticationServices"],
239
+ displayName: "Authentication Services",
240
+ description: "Single sign-on extension",
241
+ },
59
242
  };
243
+ // ---------------------------------------------------------------------------
244
+ // Derived maps — kept as exports for backward compatibility. All sourced
245
+ // from TARGET_REGISTRY so they never go out of sync.
246
+ // ---------------------------------------------------------------------------
247
+ /** Maps Apple extension point identifiers to ExtensionType values. */
248
+ exports.KNOWN_EXTENSION_POINT_IDENTIFIERS = Object.fromEntries(Object.entries(exports.TARGET_REGISTRY)
249
+ .filter(([, def]) => def.extensionPointIdentifier)
250
+ .map(([type, def]) => [def.extensionPointIdentifier, type]));
251
+ /** Whether app groups should sync from the main target by default. */
252
+ exports.SHOULD_USE_APP_GROUPS_BY_DEFAULT = Object.fromEntries(Object.keys(exports.TARGET_REGISTRY).map((type) => {
253
+ var _a;
254
+ return [
255
+ type,
256
+ (_a = getEntry(type).appGroupsByDefault) !== null && _a !== void 0 ? _a : false,
257
+ ];
258
+ }));
259
+ // ---------------------------------------------------------------------------
260
+ // Helper functions — signatures unchanged for backward compatibility.
261
+ // ---------------------------------------------------------------------------
262
+ function getEntry(type) {
263
+ return exports.TARGET_REGISTRY[type];
264
+ }
265
+ function productTypeForType(type) {
266
+ var _a;
267
+ return (_a = getEntry(type).productType) !== null && _a !== void 0 ? _a : "com.apple.product-type.app-extension";
268
+ }
269
+ exports.productTypeForType = productTypeForType;
270
+ function needsEmbeddedSwift(type) {
271
+ var _a;
272
+ return (_a = getEntry(type).needsEmbeddedSwift) !== null && _a !== void 0 ? _a : false;
273
+ }
274
+ exports.needsEmbeddedSwift = needsEmbeddedSwift;
275
+ function getFrameworksForType(type) {
276
+ var _a;
277
+ return [...((_a = getEntry(type).frameworks) !== null && _a !== void 0 ? _a : [])];
278
+ }
279
+ exports.getFrameworksForType = getFrameworksForType;
280
+ // ---------------------------------------------------------------------------
281
+ // Info.plist generation — stays as a switch because each type has a unique
282
+ // plist shape that can't be reasonably data-driven.
283
+ // ---------------------------------------------------------------------------
60
284
  // TODO: Maybe we can replace `NSExtensionPrincipalClass` with the `@main` annotation that newer extensions use?
61
285
  function getTargetInfoPlistForType(type) {
62
- // TODO: Use exhaustive switch to ensure external contributors don't forget to add this.
63
- const NSExtensionPointIdentifier = Object.keys(exports.KNOWN_EXTENSION_POINT_IDENTIFIERS).find((key) => exports.KNOWN_EXTENSION_POINT_IDENTIFIERS[key] === type);
286
+ const NSExtensionPointIdentifier = getEntry(type).extensionPointIdentifier;
64
287
  switch (type) {
65
288
  case "watch":
66
289
  return {};
290
+ case "watch-widget":
291
+ return {
292
+ NSExtension: {
293
+ NSExtensionPointIdentifier: "com.apple.widgetkit-extension",
294
+ },
295
+ };
67
296
  case "action":
68
297
  return {
69
298
  NSExtension: {
@@ -152,15 +381,20 @@ function getTargetInfoPlistForType(type) {
152
381
  },
153
382
  },
154
383
  };
384
+ case "content-blocker":
385
+ return {
386
+ NSExtension: {
387
+ NSExtensionPrincipalClass: "$(PRODUCT_MODULE_NAME).ContentBlockerRequestHandler",
388
+ NSExtensionPointIdentifier,
389
+ },
390
+ };
155
391
  case "notification-service":
156
392
  return {
157
393
  NSExtension: {
158
394
  NSExtensionAttributes: {
159
395
  NSExtensionActivationRule: "TRUEPREDICATE",
160
396
  },
161
- // TODO: Update `NotificationService` dynamically
162
397
  NSExtensionPrincipalClass: "$(PRODUCT_MODULE_NAME).NotificationService",
163
- // NSExtensionMainStoryboard: 'MainInterface',
164
398
  NSExtensionPointIdentifier,
165
399
  },
166
400
  };
@@ -182,9 +416,7 @@ function getTargetInfoPlistForType(type) {
182
416
  NSExtensionAttributes: {
183
417
  CSSupportedContentTypes: ["com.example.plain-text"],
184
418
  },
185
- // TODO: Update `ImportExtension` dynamically
186
419
  NSExtensionPrincipalClass: "$(PRODUCT_MODULE_NAME).ImportExtension",
187
- // NSExtensionMainStoryboard: 'MainInterface',
188
420
  NSExtensionPointIdentifier,
189
421
  },
190
422
  };
@@ -194,9 +426,7 @@ function getTargetInfoPlistForType(type) {
194
426
  NSExtensionAttributes: {
195
427
  NSExtensionActivationRule: "TRUEPREDICATE",
196
428
  },
197
- // TODO: Update `ShareViewController` dynamically
198
429
  NSExtensionPrincipalClass: "$(PRODUCT_MODULE_NAME).ShareViewController",
199
- // NSExtensionMainStoryboard: 'MainInterface',
200
430
  NSExtensionPointIdentifier,
201
431
  },
202
432
  };
@@ -206,7 +436,6 @@ function getTargetInfoPlistForType(type) {
206
436
  NSExtensionAttributes: {
207
437
  IntentsSupported: ["INSendMessageIntent"],
208
438
  },
209
- // TODO: Update `IntentViewController` dynamically
210
439
  NSExtensionPrincipalClass: "$(PRODUCT_MODULE_NAME).IntentViewController",
211
440
  NSExtensionPointIdentifier,
212
441
  },
@@ -222,7 +451,6 @@ function getTargetInfoPlistForType(type) {
222
451
  "INSetMessageAttributeIntent",
223
452
  ],
224
453
  },
225
- // TODO: Update `IntentHandler` dynamically
226
454
  NSExtensionPrincipalClass: "$(PRODUCT_MODULE_NAME).IntentHandler",
227
455
  NSExtensionPointIdentifier,
228
456
  },
@@ -244,9 +472,7 @@ function getTargetInfoPlistForType(type) {
244
472
  case "safari":
245
473
  return {
246
474
  NSExtension: {
247
- // TODO: Update `SafariWebExtensionHandler` dynamically
248
475
  NSExtensionPrincipalClass: "$(PRODUCT_MODULE_NAME).SafariWebExtensionHandler",
249
- // NSExtensionMainStoryboard: 'MainInterface',
250
476
  NSExtensionPointIdentifier,
251
477
  },
252
478
  };
@@ -257,9 +483,7 @@ function getTargetInfoPlistForType(type) {
257
483
  UNNotificationExtensionCategory: "myNotificationCategory",
258
484
  UNNotificationExtensionInitialContentSizeRatio: 1,
259
485
  },
260
- // TODO: Update `NotificationViewController` dynamically
261
486
  NSExtensionPrincipalClass: "$(PRODUCT_MODULE_NAME).NotificationViewController",
262
- // NSExtensionMainStoryboard: 'MainInterface',
263
487
  NSExtensionPointIdentifier,
264
488
  },
265
489
  };
@@ -291,6 +515,133 @@ function getTargetInfoPlistForType(type) {
291
515
  NSExtensionPrincipalClass: "$(PRODUCT_MODULE_NAME).FilterDataProvider",
292
516
  },
293
517
  };
518
+ case "file-provider":
519
+ return {
520
+ NSExtension: {
521
+ NSExtensionPointIdentifier,
522
+ NSExtensionPrincipalClass: "$(PRODUCT_MODULE_NAME).FileProviderExtension",
523
+ NSExtensionFileProviderSupportsEnumeration: true,
524
+ },
525
+ };
526
+ case "broadcast-upload":
527
+ return {
528
+ NSExtension: {
529
+ NSExtensionPointIdentifier,
530
+ NSExtensionPrincipalClass: "$(PRODUCT_MODULE_NAME).SampleHandler",
531
+ RPBroadcastProcessMode: "RPBroadcastProcessModeSampleBuffer",
532
+ },
533
+ };
534
+ case "call-directory":
535
+ return {
536
+ NSExtension: {
537
+ NSExtensionPointIdentifier,
538
+ NSExtensionPrincipalClass: "$(PRODUCT_MODULE_NAME).CallDirectoryHandler",
539
+ },
540
+ };
541
+ case "message-filter":
542
+ return {
543
+ NSExtension: {
544
+ NSExtensionPointIdentifier,
545
+ NSExtensionPrincipalClass: "$(PRODUCT_MODULE_NAME).MessageFilterExtension",
546
+ },
547
+ };
548
+ case "file-provider-ui":
549
+ return {
550
+ NSExtension: {
551
+ NSExtensionPointIdentifier,
552
+ NSExtensionPrincipalClass: "$(PRODUCT_MODULE_NAME).FileProviderUIController",
553
+ },
554
+ };
555
+ case "broadcast-setup-ui":
556
+ return {
557
+ NSExtension: {
558
+ NSExtensionPointIdentifier,
559
+ NSExtensionPrincipalClass: "$(PRODUCT_MODULE_NAME).BroadcastSetupViewController",
560
+ },
561
+ };
562
+ case "classkit-context":
563
+ return {
564
+ NSExtension: {
565
+ NSExtensionPointIdentifier,
566
+ NSExtensionPrincipalClass: "$(PRODUCT_MODULE_NAME).ContextProvider",
567
+ },
568
+ };
569
+ case "unwanted-communication":
570
+ return {
571
+ NSExtension: {
572
+ NSExtensionPointIdentifier,
573
+ NSExtensionPrincipalClass: "$(PRODUCT_MODULE_NAME).ClassificationViewController",
574
+ },
575
+ };
576
+ case "photo-editing":
577
+ return {
578
+ NSExtension: {
579
+ NSExtensionPointIdentifier,
580
+ NSExtensionPrincipalClass: "$(PRODUCT_MODULE_NAME).PhotoEditingViewController",
581
+ NSExtensionAttributes: {
582
+ PHSupportedMediaTypes: ["Image"],
583
+ },
584
+ },
585
+ };
586
+ case "quicklook-preview":
587
+ return {
588
+ NSExtension: {
589
+ NSExtensionAttributes: {
590
+ QLSupportedContentTypes: [],
591
+ },
592
+ NSExtensionPrincipalClass: "$(PRODUCT_MODULE_NAME).PreviewViewController",
593
+ NSExtensionPointIdentifier,
594
+ },
595
+ };
596
+ case "spotlight-delegate":
597
+ return {
598
+ NSExtension: {
599
+ NSExtensionPointIdentifier,
600
+ NSExtensionPrincipalClass: "$(PRODUCT_MODULE_NAME).IndexRequestHandler",
601
+ },
602
+ };
603
+ case "virtual-conference":
604
+ return {
605
+ NSExtension: {
606
+ NSExtensionPointIdentifier,
607
+ NSExtensionPrincipalClass: "$(PRODUCT_MODULE_NAME).VirtualConferenceProvider",
608
+ },
609
+ };
610
+ case "shield-action":
611
+ return {
612
+ NSExtension: {
613
+ NSExtensionPointIdentifier,
614
+ NSExtensionPrincipalClass: "$(PRODUCT_MODULE_NAME).ShieldActionExtension",
615
+ },
616
+ };
617
+ case "shield-config":
618
+ return {
619
+ NSExtension: {
620
+ NSExtensionPointIdentifier,
621
+ NSExtensionPrincipalClass: "$(PRODUCT_MODULE_NAME).ShieldConfigurationExtension",
622
+ },
623
+ };
624
+ case "print-service":
625
+ return {
626
+ NSExtension: {
627
+ NSExtensionPointIdentifier,
628
+ NSExtensionPrincipalClass: "$(PRODUCT_MODULE_NAME).PrintServiceExtension",
629
+ },
630
+ };
631
+ case "smart-card":
632
+ return {
633
+ NSExtension: {
634
+ NSExtensionPointIdentifier,
635
+ NSExtensionPrincipalClass: "$(PRODUCT_MODULE_NAME).TokenExtension",
636
+ },
637
+ };
638
+ case "authentication-services":
639
+ return {
640
+ NSExtension: {
641
+ NSExtensionPointIdentifier,
642
+ NSExtensionPrincipalClass: "$(PRODUCT_MODULE_NAME).AuthenticationExtension",
643
+ },
644
+ };
294
645
  default:
295
646
  // Default: used for widget and bg-download
296
647
  return {
@@ -301,77 +652,11 @@ function getTargetInfoPlistForType(type) {
301
652
  }
302
653
  }
303
654
  exports.getTargetInfoPlistForType = getTargetInfoPlistForType;
304
- function productTypeForType(type) {
305
- switch (type) {
306
- case "clip":
307
- return "com.apple.product-type.application.on-demand-install-capable";
308
- case "watch":
309
- return "com.apple.product-type.application";
310
- case "app-intent":
311
- return "com.apple.product-type.extensionkit-extension";
312
- default:
313
- return "com.apple.product-type.app-extension";
314
- }
315
- }
316
- exports.productTypeForType = productTypeForType;
317
- function needsEmbeddedSwift(type) {
318
- return [
319
- "watch",
320
- "spotlight",
321
- "share",
322
- "intent",
323
- "intent-ui",
324
- "bg-download",
325
- "quicklook-thumbnail",
326
- "matter",
327
- "clip",
328
- "network-packet-tunnel",
329
- "network-app-proxy",
330
- "network-dns-proxy",
331
- "network-filter-data",
332
- "keyboard",
333
- ].includes(type);
334
- }
335
- exports.needsEmbeddedSwift = needsEmbeddedSwift;
336
- function getFrameworksForType(type) {
337
- switch (type) {
338
- case "widget":
339
- return [
340
- // CD07060B2A2EBE2E009C1192 /* WidgetKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WidgetKit.framework; path = System/Library/Frameworks/WidgetKit.framework; sourceTree = SDKROOT; };
341
- "WidgetKit",
342
- // CD07060D2A2EBE2E009C1192 /* SwiftUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftUI.framework; path = System/Library/Frameworks/SwiftUI.framework; sourceTree = SDKROOT; };
343
- "SwiftUI",
344
- "ActivityKit",
345
- "AppIntents",
346
- ];
347
- case "intent":
348
- return ["Intents"];
349
- case "intent-ui":
350
- return ["IntentsUI"];
351
- case "quicklook-thumbnail":
352
- return ["QuickLookThumbnailing"];
353
- case "notification-content":
354
- return ["UserNotifications", "UserNotificationsUI"];
355
- case "app-intent":
356
- return ["AppIntents"];
357
- case "device-activity-monitor":
358
- return ["DeviceActivity"];
359
- case "action":
360
- return [
361
- // "UniformTypeIdentifiers"
362
- ];
363
- case "network-packet-tunnel":
364
- case "network-app-proxy":
365
- case "network-dns-proxy":
366
- case "network-filter-data":
367
- return ["NetworkExtension"];
368
- default:
369
- return [];
370
- }
371
- }
372
- exports.getFrameworksForType = getFrameworksForType;
655
+ // ---------------------------------------------------------------------------
656
+ // Target detection & utilities
657
+ // ---------------------------------------------------------------------------
373
658
  function isNativeTargetOfType(target, type) {
374
- var _a;
659
+ var _a, _b;
375
660
  if (type === "watch" &&
376
661
  target.props.productType === "com.apple.product-type.application") {
377
662
  return ("WATCHOS_DEPLOYMENT_TARGET" in
@@ -382,12 +667,28 @@ function isNativeTargetOfType(target, type) {
382
667
  "com.apple.product-type.application.on-demand-install-capable") {
383
668
  return true;
384
669
  }
670
+ const hasWatchOS = "WATCHOS_DEPLOYMENT_TARGET" in
671
+ target.getDefaultConfiguration().props.buildSettings;
672
+ if (type === "watch-widget" &&
673
+ target.props.productType === "com.apple.product-type.app-extension") {
674
+ if (!hasWatchOS)
675
+ return false;
676
+ const infoPlist = target.getDefaultConfiguration().getInfoPlist();
677
+ return (((_a = infoPlist.NSExtension) === null || _a === void 0 ? void 0 : _a.NSExtensionPointIdentifier) ===
678
+ "com.apple.widgetkit-extension");
679
+ }
680
+ // For iOS widget type, exclude watchOS targets that share the same extension point ID
681
+ if (type === "widget" &&
682
+ target.props.productType === "com.apple.product-type.app-extension" &&
683
+ hasWatchOS) {
684
+ return false;
685
+ }
385
686
  if (target.props.productType !== "com.apple.product-type.app-extension") {
386
687
  return false;
387
688
  }
388
689
  // Could be a Today Extension, Share Extension, etc.
389
690
  const infoPlist = target.getDefaultConfiguration().getInfoPlist();
390
- if (!((_a = infoPlist.NSExtension) === null || _a === void 0 ? void 0 : _a.NSExtensionPointIdentifier)) {
691
+ if (!((_b = infoPlist.NSExtension) === null || _b === void 0 ? void 0 : _b.NSExtensionPointIdentifier)) {
391
692
  console.error("No NSExtensionPointIdentifier found in extension Info.plist for target: " +
392
693
  target.getDisplayName());
393
694
  return false;