Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions .github/workflows/open-vsx.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Publish Open VSX

on:
workflow_dispatch:
inputs:
tag:
description: Existing XBridge GitHub release tag (for example, v1.4.2)
required: true
type: string

permissions:
contents: read

jobs:
publish:
name: Publish release VSIX to Open VSX
runs-on: ubuntu-latest
env:
RELEASE_TAG: ${{ inputs.tag }}

steps:
- name: Set up Node.js
uses: actions/setup-node@v5
with:
node-version: 22

- name: Check configuration and release tag
env:
OVSX_PAT: ${{ secrets.OVSX_PAT }}
run: |
if [ -z "$OVSX_PAT" ]; then
echo "::error::Add an Open VSX access token as the OVSX_PAT repository secret."
exit 1
fi
if [[ ! "$RELEASE_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "::error::Use an existing XBridge release tag such as v1.4.2."
exit 1
fi

- name: Download and verify the GitHub release VSIX
env:
GH_TOKEN: ${{ github.token }}
run: |
VERSION="${RELEASE_TAG#v}"
PACKAGE="builds/xbridge-${VERSION}.vsix"
mkdir -p builds
gh release download "$RELEASE_TAG" --repo "$GITHUB_REPOSITORY" --pattern "xbridge-${VERSION}.vsix" --dir builds
test -s "$PACKAGE"
IDENTITY=$(unzip -p "$PACKAGE" extension/package.json | node -e 'let data = ""; process.stdin.on("data", chunk => data += chunk).on("end", () => { const manifest = JSON.parse(data); console.log(`${manifest.publisher}.${manifest.name}@${manifest.version}`); })')
if [ "$IDENTITY" != "chaiwithcode.xbridge@$VERSION" ]; then
echo "::error::The release VSIX identity does not match chaiwithcode.xbridge@$VERSION."
exit 1
fi

- name: Create the namespace if needed
env:
OVSX_PAT: ${{ secrets.OVSX_PAT }}
run: |
HTTP_STATUS=$(curl --silent --show-error --output /dev/null --write-out '%{http_code}' https://open-vsx.org/api/chaiwithcode)
case "$HTTP_STATUS" in
200) echo "The chaiwithcode namespace already exists." ;;
404) npx --yes ovsx@1.1.1 create-namespace chaiwithcode ;;
*) echo "::error::Open VSX namespace lookup returned HTTP $HTTP_STATUS."; exit 1 ;;
esac

- name: Publish to Open VSX
env:
OVSX_PAT: ${{ secrets.OVSX_PAT }}
run: |
VERSION="${RELEASE_TAG#v}"
npx --yes ovsx@1.1.1 publish "builds/xbridge-${VERSION}.vsix" --skip-duplicate
echo "[Check the Open VSX listing](https://open-vsx.org/extension/chaiwithcode/xbridge)" >> "$GITHUB_STEP_SUMMARY"
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@ jobs:

- name: Publish to Open VSX
if: env.OVSX_PAT != ''
run: npx ovsx publish builds/*.vsix --skip-duplicate
run: npx --yes ovsx@1.1.1 publish builds/*.vsix --skip-duplicate
env:
OVSX_PAT: ${{ secrets.OVSX_PAT }}
2 changes: 2 additions & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ esbuild.js
Makefile
**/*.tsbuildinfo
node_modules/**
builds/**
examples/**
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 1.4.2

- Replaced retired Visual Studio Marketplace metadata badges with supported release and install badges.
- Added a direct Marketplace installation link and extension identifier to the README.
- Excluded local build outputs from published VSIX packages.

## 1.4.1

- Replaced the generic crossed-tools artwork with a distinctive connected-X brand mark.
Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ git switch -c feature/my-feature

Open the pull request against `develop`. When preparing a release, create `release/<version>` from `develop`, complete final verification, and open a pull request into `main`. After release, merge `main` back into `develop` so both branches contain the release commit and tag.

Maintainers preparing the second registry listing can follow the [Open VSX publishing guide](docs/open-vsx.md).

---

## Submitting Pull Requests
Expand Down
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

<p align="center">
<a href="https://github.com/chaiwithcode/Xbridge/actions"><img src="https://github.com/chaiwithcode/Xbridge/actions/workflows/ci.yml/badge.svg" alt="CI Status" /></a>
<a href="https://marketplace.visualstudio.com/items?itemName=chaiwithcode.xbridge"><img src="https://img.shields.io/visual-studio-marketplace/v/chaiwithcode.xbridge?color=0A84FF&label=Marketplace" alt="Marketplace Version" /></a>
<a href="https://marketplace.visualstudio.com/items?itemName=chaiwithcode.xbridge"><img src="https://img.shields.io/visual-studio-marketplace/i/chaiwithcode.xbridge?color=34C759&label=Installs" alt="Installs" /></a>
<a href="https://marketplace.visualstudio.com/items?itemName=chaiwithcode.xbridge"><img src="https://img.shields.io/github/v/release/chaiwithcode/Xbridge?display_name=tag&label=Marketplace&color=0A84FF" alt="Marketplace Version" /></a>
<a href="https://marketplace.visualstudio.com/items?itemName=chaiwithcode.xbridge"><img src="https://img.shields.io/badge/Install-VS%20Code-34C759?logo=visualstudiocode&logoColor=white" alt="Install XBridge from the Visual Studio Marketplace" /></a>
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License" /></a>
</p>

Expand All @@ -17,6 +17,8 @@
</p>

<p align="center">
<a href="#installation">Installation</a> •
<a href="#see-xbridge-in-action">Demo</a> •
<a href="#features">Features</a> •
<a href="#ai-agent-tools">AI Tools</a> •
<a href="#physical-device-support">Physical Devices</a> •
Expand All @@ -27,6 +29,22 @@

---

## Installation

Install [XBridge from the Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=chaiwithcode.xbridge), or open the Extensions view in VS Code and search for `chaiwithcode.xbridge`.

---

## See XBridge in action

![XBridge feature tour showing project controls, passing tests, and an app running in Simulator](docs/images/feature-tour.gif)

The tour uses the included [XBridgeDemo Xcode project](examples/XBridgeDemo). View the full-resolution captures: [project and destination controls](docs/images/overview.png), [XCTest and Swift Testing in Test Explorer](docs/images/tests.png), [build and run](docs/images/build-and-run.png), and [the iPhone app](docs/images/demo-app.png).

[Explore every XBridge command and AI tool](docs/capabilities.md).

---

## Why XBridge?

- Run the core Xcode workflow from the editor where you write Swift.
Expand Down
80 changes: 80 additions & 0 deletions docs/capabilities.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# XBridge capabilities

XBridge puts the everyday Xcode workflow in VS Code. These are the commands and tools available in version 1.4.2. Open the Command Palette and type `XBridge:` to find a command; the most common actions also appear in the XBridge sidebar and status bar.

## Project and workflow

| Command | What it does |
|:---|:---|
| `XBridge: Select Xcode Project or Workspace` | Choose an `.xcodeproj`, `.xcworkspace`, or Swift package when more than one is available. |
| `XBridge: Select Scheme` | Choose the Xcode scheme. |
| `XBridge: Select Build Configuration` | Switch between configurations such as Debug and Release. |
| `XBridge: Select Scheme, Configuration or Destination` | Open one picker for the active build target. |
| `XBridge: Refresh Schemes` | Reload schemes and targets from Xcode. |
| `XBridge: Open in Xcode` | Open the active project or workspace in Xcode. |
| `XBridge: Getting Started` | Open the guided VS Code walkthrough. |

## Build, run, test, and packages

| Command | What it does |
|:---|:---|
| `XBridge: Build` | Compile the active scheme. |
| `XBridge: Build & Run` | Build, install, and launch the app on the selected destination. |
| `XBridge: Stop` | Cancel the active operation or stop the running app. |
| `XBridge: Stop Running App` | Terminate the launched app without shutting down the simulator. |
| `XBridge: Clean Build Folder` | Remove the active project's DerivedData build products. |
| `XBridge: Run Tests` | Run the selected test plan or target with `xcodebuild`. |
| `XBridge: Select Test Plan` | Choose an Xcode test plan, if the scheme has one. |
| `XBridge: Select Test Target` | Limit a run to one test target. |
| `XBridge: Resolve Package Dependencies` | Resolve Swift Package Manager dependencies through Xcode. |

The native VS Code Test Explorer discovers XCTest methods and Swift Testing `@Test` methods, shows per-test results, and lets you run individual tests. Build errors and test failures appear in Problems and at their source locations.

## Results and logs

| Command | What it does |
|:---|:---|
| `XBridge: Show Build Output` | Open the `XBridge Build` output channel. |
| `XBridge: Show Build Issues` | Browse errors and warnings and jump to the source line. |
| `XBridge: Show App Console` | Open the launched app's console output. |

The status bar also shows the selected scheme and destination, build activity, and error and warning counts.

## Simulators and devices

| Command | What it does |
|:---|:---|
| `XBridge: Select Destination (Simulator/Device)` | Choose a simulator or connected physical device. |
| `XBridge: Set as Destination` | Use the selected device from the Destinations tree. |
| `XBridge: Boot Simulator` | Start a simulator. |
| `XBridge: Shutdown Simulator` | Shut down a simulator. |
| `XBridge: Open Simulator.app` | Bring Apple's Simulator app forward. |
| `XBridge: Refresh Simulators` | Reload the local simulator list. |
| `XBridge: Refresh Devices & Simulators` | Reload simulator and connected-device discovery. |
| `XBridge: Erase Simulator Content` | Reset a simulator's content and settings. |
| `XBridge: Copy Simulator UDID` | Copy the simulator identifier. |
| `XBridge: Open URL or Deep Link…` | Open a URL in a simulator. |
| `XBridge: Take Screenshot` | Save a PNG from a booted simulator. |
| `XBridge: Start / Stop Screen Recording` | Save a simulator recording as video. |
| `XBridge: Toggle Light / Dark Appearance` | Change the simulator appearance. |
| `XBridge: Open App Data Container` | Open the installed app's container in Finder. |
| `XBridge: Uninstall App from Simulator` | Remove the installed app. |

Connected iPhones and iPads appear in Destinations through Apple's `devicectl`. Physical-device builds require working code signing and Developer Mode.

## AI agent tools

Compatible VS Code AI agents can call these eight tools directly:

| Tool | Capability |
|:---|:---|
| `xbridge_build` | Build and return compiler diagnostics. |
| `xbridge_test` | Run tests and return failures. |
| `xbridge_run` | Build and launch an app. |
| `xbridge_listSchemes` | List schemes, configurations, and targets. |
| `xbridge_listSimulators` | List available simulators and status. |
| `xbridge_bootSimulator` | Boot a simulator. |
| `xbridge_readDiagnostics` | Read the last build or test diagnostics. |
| `xbridge_clean` | Clean the Xcode build folder. |

See the [main README](../README.md#settings) for the eleven configurable settings and [XBridgeDemo](../examples/XBridgeDemo) for a project you can try locally.
Binary file added docs/images/build-and-run.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/demo-app.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/feature-tour.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/overview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/tests.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions docs/open-vsx.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Publishing XBridge to Open VSX

Open VSX is a separate registry from the Visual Studio Marketplace. XBridge's extension ID is `chaiwithcode.xbridge` in both registries, but the Marketplace publisher account and token do not authorize Open VSX publishing.

## One-time publisher setup

1. Follow the [Open VSX publisher guide](https://github.com/eclipse-openvsx/openvsx/wiki/Publishing-Extensions): sign in to [open-vsx.org](https://open-vsx.org/) with the GitHub account that owns XBridge, connect the matching Eclipse account, and accept the Open VSX Publisher Agreement.
2. Generate an Open VSX access token in your Open VSX account settings. Add it to this repository's GitHub Actions secrets as `OVSX_PAT`. Do not put the token in the repository, a command argument, or an issue.
3. Merge the `Publish Open VSX` workflow into the repository's default branch. In GitHub Actions, run **Publish Open VSX** with an existing GitHub release tag such as `v1.4.2`. The workflow downloads that release's VSIX, verifies its publisher, name, and version, creates the `chaiwithcode` namespace if necessary, and uploads the exact release artifact. Re-running it skips a duplicate version.
4. Inspect the [XBridge Open VSX listing](https://open-vsx.org/extension/chaiwithcode/xbridge), including the icon, description, README, license, and version. If you want the verified-publisher shield, [claim ownership of the namespace](https://github.com/eclipse-openvsx/openvsx/wiki/Namespace-Access); creating the namespace alone does not grant that status.

The existing `v1.4.2` GitHub release contains `xbridge-1.4.2.vsix`. Its SHA-256 is `aa68331c49396d0014bae908e4348b0995f995b1d9c67e159d5a5f03add700cc`. Use that release artifact for a first `v1.4.2` submission. A new package built from `develop` includes README screenshots that are not yet on the default branch, so those links would remain unavailable until a later release merges the assets into `main`.

## Future releases

The tag-triggered [release workflow](../.github/workflows/release.yml) builds one VSIX for the GitHub release, the Visual Studio Marketplace, and Open VSX. When `OVSX_PAT` is configured, its Open VSX step publishes the same VSIX after a `v*` tag is pushed. Each registry accepts a given extension version only once; use a new version for updated contents.

The [Open VSX CLI](https://github.com/eclipse-openvsx/openvsx/blob/main/cli/README.md) also supports publishing an already packaged VSIX locally with `OVSX_PAT` set in the environment:

```sh
npx --yes ovsx@1.1.1 publish path/to/xbridge-version.vsix --skip-duplicate
```

The manual GitHub workflow is preferred for a release because it uses the exact VSIX already attached to that release. After publication, verify the version through the listing or the [registry API](https://open-vsx.org/api/chaiwithcode/xbridge).
4 changes: 4 additions & 0 deletions examples/XBridgeDemo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.build/
.vscode/
*.xcuserstate
xcuserdata/
9 changes: 9 additions & 0 deletions examples/XBridgeDemo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# XBridge Demo

A small, buildable SwiftUI app used to demonstrate XBridge in VS Code. It includes one XCTest and one Swift Testing test so both appear in Test Explorer.

1. Open this folder in VS Code on a Mac with Xcode installed.
2. Select the `XBridgeDemo` scheme and an iOS Simulator in the XBridge sidebar.
3. Use **Build & Run** to launch the app, or open Test Explorer and run both tests.

The app has no external packages or signing requirement for Simulator. Xcode build products and local VS Code settings are ignored by Git.
Loading
Loading