Swift JSExport extensions for macOS system frameworks

Overview

framework-bridge

Swift JSExport extensions for macOS system frameworks.

Progress

Foundation
155/259 classes
AppKit
232/269 classes

Usage

Swift

import JavaScriptCore
import FrameworkBridge
let context = JSContext()!
context.bridgeClass("NSSound")

Javascript

NSSound({ named: "Chirp" }).play();

Tests

Test compilation of JSExport classes:

./test/compilation/compilation.sh

Test runtime registration of classes:

./test/registration/registration.sh

Tools

gen-headers

Generates swift headers for AppKit classes. This data is used by ast-builder

node index.js ../../metadata/frameworks.json ../../tmp/headers

ast-builder

Parses swift headers into an ast and store is json.

swift run ast-builder ../../metadata/frameworks.json ../../tmp/headers ../../tmp/ast

attribute-list-builder

Parses swift headers into a list of attributes (i.e. unavailable, renamed, etc).

This data is used by macos-metadata-builder to build the swift jsexport classes (specifically to hide unavailable or obsoleted decls).

This also generates aliases.json and structs.json.

node index.js ../../metadata/frameworks.json ../../tmp/ast ../../tmp/attributes

macos-metadata-generator

Generates swift jsexport classes; uses data generated from the above tools.

See README in macos-metadata-generator repo for more details.

Dev

  • Edit metadata/frameworks.json if you are adding a new framework
  • Run gen-header, ast-builder and attribute-list-builder to populate tmp/ folders
  • Run macos-metadata-generator to populate swift/ folder
  • Add classes to classesToTest.js and registration test app
You might also like...
Swift sample app for running privileged operations on macOS using a helper tool
Swift sample app for running privileged operations on macOS using a helper tool

SwiftAuthorizationSample demonstrates how to run privileged operations on macOS using a helper tool managed by launchd. This sample was created with t

A sample app demonstrates how to use Atlantis on Swift Playground (iOS/macOS)
A sample app demonstrates how to use Atlantis on Swift Playground (iOS/macOS)

Atlantis with Swift Playground A sample app demonstrates how to use Atlantis on

An IPFS client/api Swift Package, with the ability to add and pin any data on iOS/iPadOS/macOS

An IPFS client/api Swift Package, with the ability to add and pin any data on iOS/iPadOS/macOS. Originally bundled with GraniteUI, pulled out for independant use by any party.

XCSnippetsApp - macOS application to explore code snippets from the Swift and iOS community, view and edit the snippets before adding them conveniently to Xcode
XCSnippetsApp - macOS application to explore code snippets from the Swift and iOS community, view and edit the snippets before adding them conveniently to Xcode

XCSnippetsApp macOS application to explore code snippets from the Swift and iOS community, view and edit the snippets before adding them conveniently

AuroraEditor is a IDE built by the community, for the community, and written in Swift for the best native performance and feel for macOS.
AuroraEditor is a IDE built by the community, for the community, and written in Swift for the best native performance and feel for macOS.

AuroraEditor AuroraEditor is a IDE built by the community, for the community, and written in Swift for the best native performance and feel for macOS.

A macOS application for accessing the output of the SimpleAnalytics package on the desktop.
A macOS application for accessing the output of the SimpleAnalytics package on the desktop.

The SimpleAnalytics package allows you to collect data user interaction analytic data in iOS and macOS applications. This SimpleAnalytics Reader app project allows you to more easily make sense of that collected data by displaying it on your Mac.

LinearMouse - A minimal app to get rid of mouse acceleration on macOS

LinearMouse A minimal app to get rid of mouse acceleration on macOS. Features Reverse the direction of scrolling. Linear scrolling (disable scrolling

PlayCover is a project that allows you to sideload iOS apps on macOS( currently arm, Intel support will be tested.

PlayCover is a project that allows you to sideload iOS apps on macOS( currently arm, Intel support will be tested.

macOS PropertyList Editor

PropertyListEditor About ... License Project is released under the terms of the MIT License. Repository Infos Owner: Jean-David Gadina - XS-L

Owner
John Susek
John Susek
A longstanding annoying bug in our beloved operating system macOS

Houston There is a longstanding annoying bug in our beloved operating system macOS. If you open an application while Mission Control is active, the ap

Christoffer Winterkvist 6 Dec 5, 2022
A macOS menu bar app that enables system-wide navigation functionality for side buttons on third-party mice.

SaneSideButtons macOS mostly ignores the M4/M5 mouse buttons, commonly used for navigation. Third-party apps can bind them to ⌘+[ and ⌘+], but this on

Jan Hülsmann 121 Dec 23, 2022
A very simplistic state machine system for Swift while mainly used with Raylib on Swift

A very simplistic state machine system for Swift while mainly used with Raylib on Swift

Conifer Coniferoslav 2 Dec 12, 2022
Snapify is an opensource tweak to make the messages app behave like Snapchat's sending system

Snapify A simple tweak to remove the send button in messages, replaced by keyboard key What is Snapify? Snapify is an opensource tweak to make the mes

Hallie 4 Oct 29, 2021
A repository to experiment around the use and generation of tokens for the JLL/T Design System

Basic Style Dictionary This example code is bare-bones to show you what this framework can do. If you have the style-dictionary module installed globa

null 0 Dec 7, 2021
LIDAR Wearable Navigational System for the Visually Impaired - 👁️

A Novel Implementation of LiDAR Mesh Classification and Image Classifiers In Assistive Technology for the Visually Impaired. Background Information 25

Hrishikesh Bagalkote 0 Dec 23, 2022
Ulangi is a language flashcards app with spaced repetition system and more.

Ulangi Open-source language learning tools Introduction Ulangi makes it easy for you to manage and create flash cards to learn languages. It comes wit

Ulangi 384 Jan 3, 2023
Gett's Design System code generator. Use Zeplin Styleguides as your R&D's Single Source of Truth.

Prism is a Design System code generator developed by the team at Gett ?? . Synchronizing design teams with engineering teams is a huge challenge. As t

Gett 346 Dec 31, 2022
A ARM macOS Virtual Machine, using macOS 12's new Virtualization framework.

macOS Virtual Machine A ARM macOS Virtual Machine, using macOS 12's new Virtualization framework. I copied KhaosT's code from here, all I did is chang

Ming Chang 127 Nov 30, 2022
A Swift wrapper around the CoreSymbolication private framework on macOS.

CoreSymbolication provides a very powerful system for looking up and extracting symbolic information from mach-o executables, dyld shared caches, and dSYMs.

Stacksift 7 Nov 21, 2022