A WXT module that automatically converts Safari extensions to Xcode projects and configures related settings after the build is complete.

Are you tired of manually converting your Safari extensions to Xcode projects? Look no further! This innovative WXT module simplifies the process, saving you time and effort. With just a few clicks, you can generate an Xcode project for your extension, ready for development and deployment on Apple's Safari browser.

The magic happens when you run wxt build -b safari. The module uses WXT's powerful build:done hook to automate the conversion process. Here's what it does:

Automatic Conversion

When building for Safari, this module runs xcrun safari-web-extension-converter to convert your extension to an Xcode project. This ensures a seamless transition from development to deployment.

Configuring Your Project

The module updates Xcode project configuration settings, including the version number, app category, development team, and more. You can customize these settings in your WXT configuration file.

Updating Info.plist Files

This module also updates all Info.plist files, adding essential metadata like CFBundleVersion to ensure a professional-looking build.

Key Features

  • Automatically converts Safari extensions to Xcode projects
  • Configures Xcode project settings (version number, app category, development team)
  • Updates Info.plist files with essential metadata
  • Requires macOS and Xcode Command Line Tools
  • Supports building for Safari browser only (wxt build -b safari)

Configuration Options

You can customize your project configuration by providing the following options:

| Option | Type | Required | Description |

|---|---|---|---|

| projectName | string | ❌ | Safari project name. Defaults to manifest.name if not provided |

| appCategory | string | ✅ | App category, e.g., 'public.app-category.productivity' |

| bundleIdentifier | string | ✅ | Bundle identifier, e.g., 'com.example.app' |

| developmentTeam | string | ❌ | Apple Developer Team ID, e.g., 'ABC1234567'. If not provided, must be set manually in Xcode |

Getting Started

To use this module, simply add it to your WXT configuration file:

`javascript

import { defineConfig } from 'wxt'

export default defineConfig({

modules: ['@wxt-dev/module-react', 'wxt-module-safari-xcode'],

safariXcode: {

projectName: 'My Awesome Extension',

appCategory: 'public.app-category.productivity',

bundleIdentifier: 'com.mycompany.awesome-extension',

developmentTeam: 'ABC1234567',

},

manifest: {

name: 'My Awesome Extension',

version: '0.1.0',

},

})

`

The generated Xcode project will be located at .output//.xcodeproj.