Skip to content
Merged
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
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
cache-dependency-path: |
package-lock.json
client/package-lock.json
packages/react-native-inspector/package-lock.json
packages/nativescript-inspector/package-lock.json

- uses: dtolnay/rust-toolchain@stable
Expand All @@ -35,6 +36,9 @@ jobs:
- name: Install NativeScript inspector dependencies
run: npm ci --prefix packages/nativescript-inspector

- name: Install React Native inspector dependencies
run: npm ci --prefix packages/react-native-inspector

- name: Lint, build, and test
run: npm run ci

Expand Down
60 changes: 56 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
cache-dependency-path: |
package-lock.json
client/package-lock.json
packages/react-native-inspector/package-lock.json
packages/nativescript-inspector/package-lock.json

- uses: dtolnay/rust-toolchain@stable
Expand All @@ -42,7 +43,9 @@ jobs:

VERSION="${TAG_NAME#v}"
PACKAGE_VERSION="$(node -p "require('./package.json').version")"
REACT_NATIVE_INSPECTOR_VERSION="$(node -p "require('./packages/react-native-inspector/package.json').version")"
INSPECTOR_VERSION="$(node -p "require('./packages/nativescript-inspector/package.json').version")"
VSCODE_EXTENSION_VERSION="$(node -p "require('./packages/vscode-extension/package.json').version")"

if [ "${VERSION}" != "${PACKAGE_VERSION}" ]; then
echo "Tag ${TAG_NAME} does not match package version ${PACKAGE_VERSION}" >&2
Expand All @@ -54,6 +57,16 @@ jobs:
exit 1
fi

if [ "${VERSION}" != "${REACT_NATIVE_INSPECTOR_VERSION}" ]; then
echo "Tag ${TAG_NAME} does not match React Native inspector version ${REACT_NATIVE_INSPECTOR_VERSION}" >&2
exit 1
fi

if [ "${VERSION}" != "${VSCODE_EXTENSION_VERSION}" ]; then
echo "Tag ${TAG_NAME} does not match VS Code extension version ${VSCODE_EXTENSION_VERSION}" >&2
exit 1
fi

echo "tag=${TAG_NAME}" >> "${GITHUB_OUTPUT}"
echo "version=${VERSION}" >> "${GITHUB_OUTPUT}"

Expand All @@ -66,6 +79,9 @@ jobs:
- name: Install NativeScript inspector dependencies
run: npm ci --prefix packages/nativescript-inspector

- name: Install React Native inspector dependencies
run: npm ci --prefix packages/react-native-inspector

- name: Lint, build, and test
run: npm run ci

Expand Down Expand Up @@ -95,10 +111,15 @@ jobs:
test -x "${BUNDLE_DIR}/simdeck"
test -x "${BUNDLE_DIR}/simdeck-bin"
tar -tzf "${ARTIFACTS_DIR}/simdeck-${VERSION}.tgz" | grep -qx "package/build/simdeck-bin"
(
cd packages/react-native-inspector
npm pack --pack-destination "${ARTIFACTS_DIR}"
)
(
cd packages/nativescript-inspector
npm pack --pack-destination "${ARTIFACTS_DIR}"
)
cp build/vscode/simdeck-vscode.vsix "${ARTIFACTS_DIR}/simdeck-vscode-${VERSION}.vsix"

- name: Publish package to npm
env:
Expand All @@ -117,6 +138,23 @@ jobs:

npm publish "${RUNNER_TEMP}/release-assets/simdeck-${VERSION}.tgz"

- name: Publish React Native package to npm
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
VERSION: ${{ steps.meta.outputs.version }}
run: |
if npm view "react-native-simdeck@${VERSION}" version >/dev/null 2>&1; then
echo "react-native-simdeck@${VERSION} is already published on npm."
exit 0
fi

if [ -z "${NODE_AUTH_TOKEN}" ]; then
echo "NPM_TOKEN repository secret is required to publish react-native-simdeck@${VERSION}." >&2
exit 1
fi

npm publish "${RUNNER_TEMP}/release-assets/react-native-simdeck-${VERSION}.tgz"

- name: Publish NativeScript inspector to npm
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand All @@ -132,10 +170,24 @@ jobs:
exit 1
fi

(
cd packages/nativescript-inspector
npm publish --access public
)
npm publish "${RUNNER_TEMP}/release-assets/nativescript-simdeck-inspector-${VERSION}.tgz" --access public

- name: Publish VS Code extension
env:
VERSION: ${{ steps.meta.outputs.version }}
VSCE_PAT: ${{ secrets.VSCE_PAT }}
run: |
EXTENSION_ID="$(node -p "const pkg = require('./packages/vscode-extension/package.json'); `${pkg.publisher}.${pkg.name}`")"

if [ -z "${VSCE_PAT}" ]; then
echo "VSCE_PAT repository secret is required to publish ${EXTENSION_ID}." >&2
exit 1
fi

npx --no-install vsce publish \
--packagePath "${RUNNER_TEMP}/release-assets/simdeck-vscode-${VERSION}.vsix" \
--pat "${VSCE_PAT}" \
--skip-duplicate

- name: Upload GitHub release assets
env:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ locations with the React Native inspector package:

```ts
import { AppRegistry } from "react-native";
import { startSimDeckReactNativeInspector } from "@simdeck/react-native-inspector";
import { startSimDeckReactNativeInspector } from "react-native-simdeck";
import App from "./App";

if (__DEV__) {
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ The client never depends on private APIs and never assumes anything not exposed
### `packages/` — companion packages

- **`packages/nativescript-inspector/`** ships `@nativescript/simdeck-inspector`, a TypeScript runtime that connects from a NativeScript app to the server's WebSocket inspector hub. See [NativeScript Runtime](/inspector/nativescript).
- **`packages/react-native-inspector/`** ships `@simdeck/react-native-inspector`, a React Native runtime that connects from an app to the server's WebSocket inspector hub and publishes React Fiber hierarchy data. See [React Native Runtime](/inspector/react-native).
- **`packages/react-native-inspector/`** ships `react-native-simdeck`, a React Native runtime that connects from an app to the server's WebSocket inspector hub and publishes React Fiber hierarchy data. See [React Native Runtime](/inspector/react-native).
- **`packages/inspector-agent/`** ships `SimDeckInspectorAgent`, a Swift Package you can link from a debug iOS app to expose its UIKit hierarchy. See [Swift In-App Agent](/inspector/swift).
- **`packages/vscode-extension/`** is the VS Code extension that opens the browser client inside a webview panel and auto-starts the server.
- **`packages/simdeck-test/`** ships `simdeck/test`, a small JS/TS wrapper around daemon startup and the REST control API. See [Testing](/guide/testing).
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ SimDeck ships as a single npm package (`simdeck`) that installs:
Optional companion packages:

- [`@nativescript/simdeck-inspector`](/inspector/nativescript) — a debug-only NativeScript inspector runtime.
- [`@simdeck/react-native-inspector`](/inspector/react-native) — a debug-only React Native inspector runtime.
- [`react-native-simdeck`](/inspector/react-native) — a debug-only React Native inspector runtime.
- [`packages/inspector-agent`](/inspector/swift) — a Swift Package you can link from your iOS app to expose its UIKit hierarchy.
- [`packages/vscode-extension`](/extensions/vscode) — opens the simulator inside a VS Code panel.

Expand Down
2 changes: 1 addition & 1 deletion docs/inspector/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ SimDeck blends three different ways to inspect what an iOS app is rendering:
| **Native AX** | Any simulator app via the Simulator accessibility stack. | Default fallback. |
| **Swift in-app agent** | Apps that link `SimDeckInspectorAgent` in DEBUG. | Best for native iOS apps you control. |
| **NativeScript runtime** | NativeScript apps that import `@nativescript/simdeck-inspector`. | Best for NativeScript apps — exposes the logical view tree, not just UIKit. |
| **React Native runtime** | React Native apps that import `@simdeck/react-native-inspector`. | Best for React Native apps — exposes components and Metro source locations. |
| **React Native runtime** | React Native apps that import `react-native-simdeck`. | Best for React Native apps — exposes components and Metro source locations. |

The HTTP API picks the most specific source available, falls back to the next one when something goes wrong, and tells the client which sources were available so the UI can offer a switch.

Expand Down
6 changes: 3 additions & 3 deletions docs/inspector/react-native.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# React Native Runtime Inspector

`@simdeck/react-native-inspector` is a debug-only React Native iOS package that publishes the React component tree to SimDeck. It uses the same [Inspector Protocol](/api/inspector-protocol) as the Swift and NativeScript inspectors, but connects outbound to the SimDeck server over WebSocket.
`react-native-simdeck` is a debug-only React Native iOS package that publishes the React component tree to SimDeck. It uses the same [Inspector Protocol](/api/inspector-protocol) as the Swift and NativeScript inspectors, but connects outbound to the SimDeck server over WebSocket.

The package source lives at `packages/react-native-inspector/` in this repo.

## Install

```sh
npm install @simdeck/react-native-inspector
npm install react-native-simdeck
cd ios && pod install
```

Expand All @@ -17,7 +17,7 @@ Call `startSimDeckReactNativeInspector(...)` before `AppRegistry.registerCompone

```ts
import { AppRegistry } from "react-native";
import { startSimDeckReactNativeInspector } from "@simdeck/react-native-inspector";
import { startSimDeckReactNativeInspector } from "react-native-simdeck";
import App from "./App";

if (__DEV__) {
Expand Down
6 changes: 3 additions & 3 deletions packages/react-native-inspector/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# React Native Inspector

`@simdeck/react-native-inspector` is a debug-only runtime inspector for React Native iOS apps. It connects to the SimDeck server over the same WebSocket inspector hub as the NativeScript runtime.
`react-native-simdeck` is a debug-only runtime inspector for React Native iOS apps. It connects to the SimDeck server over the same WebSocket inspector hub as the NativeScript runtime.

## Install

```sh
npm install @simdeck/react-native-inspector
npm install react-native-simdeck
cd ios && pod install
```

Expand All @@ -15,7 +15,7 @@ Install the inspector before `AppRegistry.registerComponent(...)` so it can capt

```ts
import { AppRegistry } from "react-native";
import { startSimDeckReactNativeInspector } from "@simdeck/react-native-inspector";
import { startSimDeckReactNativeInspector } from "react-native-simdeck";
import App from "./App";

if (__DEV__) {
Expand Down
Loading
Loading