Skip to content

Commit 0eb61b4

Browse files
EvanBaconclaude
andauthored
feat(targets): add quicklook-preview, spotlight-delegate, virtual-conference, shield-action, shield-config (#165)
Add five new Apple extension target types with full registry entries, Info.plist generation, build settings, Swift templates, e2e fixtures, and updated documentation. Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 5f91dbb commit 0eb61b4

16 files changed

Lines changed: 256 additions & 5 deletions

File tree

packages/apple-targets/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,11 @@ Ideally, this would be generated automatically based on a fully qualified Xcode
318318
| classkit-context | ClassKit Context Provider Extension|
319319
| unwanted-communication | Unwanted Communication Reporting |
320320
| photo-editing | Photo Editing Extension |
321+
| quicklook-preview | Quick Look Preview Extension |
322+
| spotlight-delegate | CoreSpotlight Delegate Extension |
323+
| virtual-conference | Virtual Conference Provider |
324+
| shield-action | Shield Action Extension |
325+
| shield-config | Shield Configuration Extension |
321326

322327

323328
<!-- | imessage | iMessage Extension | -->
@@ -329,13 +334,8 @@ The following iOS extension types exist in Xcode but aren't supported yet. Contr
329334
| Extension Point Identifier | Xcode Template Name |
330335
| --- | --- |
331336
| `com.apple.printing.discovery` | Print Service Extension |
332-
| `com.apple.quicklook.preview` | Quick Look Preview Extension |
333-
| `com.apple.spotlight.index` | CoreSpotlight Delegate Extension |
334337
| `com.apple.ctk-tokens` | Smart Card / Persistent Token Extension |
335-
| `com.apple.calendar.virtualconference` | Virtual Conference Provider Extension |
336338
| `com.apple.AppSSO.idp-extension` | Authentication Services Extension |
337-
| `com.apple.ManagedSettings.shield-action-service` | Shield Action Extension |
338-
| `com.apple.ManagedSettingsUI.shield-configuration-service` | Shield Configuration Extension |
339339
| `com.apple.tv-top-shelf` | TV Top Shelf Extension (tvOS) |
340340
| `com.apple.FinderSync` | Finder Sync Extension (macOS) |
341341
| `com.apple.email.extension` | Mail Extension (macOS) |

packages/apple-targets/e2e/__tests__/build.test.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,23 @@ const TARGET_REGISTRY: TargetEntry[] = [
126126
target: "unwantedcommunication",
127127
},
128128
{ type: "photo-editing", dir: "photo-editing", target: "photoediting" },
129+
{
130+
type: "quicklook-preview",
131+
dir: "quicklook-preview",
132+
target: "quicklookpreview",
133+
},
134+
{
135+
type: "spotlight-delegate",
136+
dir: "spotlight-delegate",
137+
target: "spotlightdelegate",
138+
},
139+
{
140+
type: "virtual-conference",
141+
dir: "virtual-conference",
142+
target: "virtualconference",
143+
},
144+
{ type: "shield-action", dir: "shield-action", target: "shieldaction" },
145+
{ type: "shield-config", dir: "shield-config", target: "shieldconfig" },
129146
];
130147

131148
// Derived from the central TARGET_REGISTRY — no need to maintain by hand.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ "type": "quicklook-preview" }
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ "type": "shield-action" }
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ "type": "shield-config" }
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ "type": "spotlight-delegate" }
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ "type": "virtual-conference" }

packages/apple-targets/src/configuration-list.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -813,6 +813,11 @@ function getConfigurationListBuildSettingsForType(
813813
case "classkit-context":
814814
case "unwanted-communication":
815815
case "photo-editing":
816+
case "quicklook-preview":
817+
case "spotlight-delegate":
818+
case "virtual-conference":
819+
case "shield-action":
820+
case "shield-config":
816821
return createNotificationContentConfigurationList(props);
817822
default:
818823
const exhaustiveCheck: never = props.type;

packages/apple-targets/src/target.ts

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,32 @@ export const TARGET_REGISTRY = {
216216
frameworks: ["Photos", "PhotosUI"],
217217
displayName: "Photo Editing",
218218
},
219+
"quicklook-preview": {
220+
extensionPointIdentifier: "com.apple.quicklook.preview",
221+
needsEmbeddedSwift: true,
222+
frameworks: ["QuickLook"],
223+
displayName: "Quick Look Preview",
224+
},
225+
"spotlight-delegate": {
226+
extensionPointIdentifier: "com.apple.spotlight.index",
227+
frameworks: ["CoreSpotlight"],
228+
displayName: "CoreSpotlight Delegate",
229+
},
230+
"virtual-conference": {
231+
extensionPointIdentifier: "com.apple.calendar.virtualconference",
232+
displayName: "Virtual Conference Provider",
233+
},
234+
"shield-action": {
235+
extensionPointIdentifier: "com.apple.ManagedSettings.shield-action-service",
236+
frameworks: ["ManagedSettings"],
237+
displayName: "Shield Action",
238+
},
239+
"shield-config": {
240+
extensionPointIdentifier:
241+
"com.apple.ManagedSettingsUI.shield-configuration-service",
242+
frameworks: ["ManagedSettings", "ManagedSettingsUI"],
243+
displayName: "Shield Configuration",
244+
},
219245
} as const satisfies Record<string, TargetDefinition>;
220246

221247
export type ExtensionType = keyof typeof TARGET_REGISTRY;
@@ -596,6 +622,49 @@ export function getTargetInfoPlistForType(type: ExtensionType) {
596622
},
597623
},
598624
};
625+
case "quicklook-preview":
626+
return {
627+
NSExtension: {
628+
NSExtensionAttributes: {
629+
QLSupportedContentTypes: [],
630+
},
631+
NSExtensionPrincipalClass:
632+
"$(PRODUCT_MODULE_NAME).PreviewViewController",
633+
NSExtensionPointIdentifier,
634+
},
635+
};
636+
case "spotlight-delegate":
637+
return {
638+
NSExtension: {
639+
NSExtensionPointIdentifier,
640+
NSExtensionPrincipalClass:
641+
"$(PRODUCT_MODULE_NAME).IndexRequestHandler",
642+
},
643+
};
644+
case "virtual-conference":
645+
return {
646+
NSExtension: {
647+
NSExtensionPointIdentifier,
648+
NSExtensionPrincipalClass:
649+
"$(PRODUCT_MODULE_NAME).VirtualConferenceProvider",
650+
},
651+
};
652+
case "shield-action":
653+
return {
654+
NSExtension: {
655+
NSExtensionPointIdentifier,
656+
NSExtensionPrincipalClass:
657+
"$(PRODUCT_MODULE_NAME).ShieldActionExtension",
658+
},
659+
};
660+
case "shield-config":
661+
return {
662+
NSExtension: {
663+
NSExtensionPointIdentifier,
664+
NSExtensionPrincipalClass:
665+
"$(PRODUCT_MODULE_NAME).ShieldConfigurationExtension",
666+
},
667+
};
599668
default:
600669
// Default: used for widget and bg-download
601670
return {

packages/create-target/src/__tests__/__snapshots__/createAsync.test.ts.snap

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,14 @@ module.exports = config => ({
163163
});"
164164
`;
165165

166+
exports[`getTemplateConfig should return a valid template for quicklook-preview 1`] = `
167+
"/** @type {import('@bacons/apple-targets/app.plugin').ConfigFunction} */
168+
module.exports = config => ({
169+
type: \\"quicklook-preview\\",
170+
entitlements: { /* Add entitlements */ },
171+
});"
172+
`;
173+
166174
exports[`getTemplateConfig should return a valid template for quicklook-thumbnail 1`] = `
167175
"/** @type {import('@bacons/apple-targets/app.plugin').ConfigFunction} */
168176
module.exports = config => ({
@@ -190,6 +198,22 @@ module.exports = config => ({
190198
});"
191199
`;
192200

201+
exports[`getTemplateConfig should return a valid template for shield-action 1`] = `
202+
"/** @type {import('@bacons/apple-targets/app.plugin').ConfigFunction} */
203+
module.exports = config => ({
204+
type: \\"shield-action\\",
205+
entitlements: {\\"com.apple.developer.family-controls\\":true},
206+
});"
207+
`;
208+
209+
exports[`getTemplateConfig should return a valid template for shield-config 1`] = `
210+
"/** @type {import('@bacons/apple-targets/app.plugin').ConfigFunction} */
211+
module.exports = config => ({
212+
type: \\"shield-config\\",
213+
entitlements: {\\"com.apple.developer.family-controls\\":true},
214+
});"
215+
`;
216+
193217
exports[`getTemplateConfig should return a valid template for spotlight 1`] = `
194218
"/** @type {import('@bacons/apple-targets/app.plugin').ConfigFunction} */
195219
module.exports = config => ({
@@ -198,6 +222,14 @@ module.exports = config => ({
198222
});"
199223
`;
200224

225+
exports[`getTemplateConfig should return a valid template for spotlight-delegate 1`] = `
226+
"/** @type {import('@bacons/apple-targets/app.plugin').ConfigFunction} */
227+
module.exports = config => ({
228+
type: \\"spotlight-delegate\\",
229+
entitlements: { /* Add entitlements */ },
230+
});"
231+
`;
232+
201233
exports[`getTemplateConfig should return a valid template for unwanted-communication 1`] = `
202234
"/** @type {import('@bacons/apple-targets/app.plugin').ConfigFunction} */
203235
module.exports = config => ({
@@ -206,6 +238,14 @@ module.exports = config => ({
206238
});"
207239
`;
208240

241+
exports[`getTemplateConfig should return a valid template for virtual-conference 1`] = `
242+
"/** @type {import('@bacons/apple-targets/app.plugin').ConfigFunction} */
243+
module.exports = config => ({
244+
type: \\"virtual-conference\\",
245+
entitlements: { /* Add entitlements */ },
246+
});"
247+
`;
248+
209249
exports[`getTemplateConfig should return a valid template for watch 1`] = `
210250
"/** @type {import('@bacons/apple-targets/app.plugin').ConfigFunction} */
211251
module.exports = config => ({

0 commit comments

Comments
 (0)