Skip to content

Commit 4927709

Browse files
authored
Add release publishing for npm packages and VS Code extension (#3)
1 parent 299381e commit 4927709

10 files changed

Lines changed: 2791 additions & 15 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
cache-dependency-path: |
2121
package-lock.json
2222
client/package-lock.json
23+
packages/react-native-inspector/package-lock.json
2324
packages/nativescript-inspector/package-lock.json
2425
2526
- uses: dtolnay/rust-toolchain@stable
@@ -35,6 +36,9 @@ jobs:
3536
- name: Install NativeScript inspector dependencies
3637
run: npm ci --prefix packages/nativescript-inspector
3738

39+
- name: Install React Native inspector dependencies
40+
run: npm ci --prefix packages/react-native-inspector
41+
3842
- name: Lint, build, and test
3943
run: npm run ci
4044

.github/workflows/release.yml

Lines changed: 56 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
cache-dependency-path: |
2626
package-lock.json
2727
client/package-lock.json
28+
packages/react-native-inspector/package-lock.json
2829
packages/nativescript-inspector/package-lock.json
2930
3031
- uses: dtolnay/rust-toolchain@stable
@@ -42,7 +43,9 @@ jobs:
4243
4344
VERSION="${TAG_NAME#v}"
4445
PACKAGE_VERSION="$(node -p "require('./package.json').version")"
46+
REACT_NATIVE_INSPECTOR_VERSION="$(node -p "require('./packages/react-native-inspector/package.json').version")"
4547
INSPECTOR_VERSION="$(node -p "require('./packages/nativescript-inspector/package.json').version")"
48+
VSCODE_EXTENSION_VERSION="$(node -p "require('./packages/vscode-extension/package.json').version")"
4649
4750
if [ "${VERSION}" != "${PACKAGE_VERSION}" ]; then
4851
echo "Tag ${TAG_NAME} does not match package version ${PACKAGE_VERSION}" >&2
@@ -54,6 +57,16 @@ jobs:
5457
exit 1
5558
fi
5659
60+
if [ "${VERSION}" != "${REACT_NATIVE_INSPECTOR_VERSION}" ]; then
61+
echo "Tag ${TAG_NAME} does not match React Native inspector version ${REACT_NATIVE_INSPECTOR_VERSION}" >&2
62+
exit 1
63+
fi
64+
65+
if [ "${VERSION}" != "${VSCODE_EXTENSION_VERSION}" ]; then
66+
echo "Tag ${TAG_NAME} does not match VS Code extension version ${VSCODE_EXTENSION_VERSION}" >&2
67+
exit 1
68+
fi
69+
5770
echo "tag=${TAG_NAME}" >> "${GITHUB_OUTPUT}"
5871
echo "version=${VERSION}" >> "${GITHUB_OUTPUT}"
5972
@@ -66,6 +79,9 @@ jobs:
6679
- name: Install NativeScript inspector dependencies
6780
run: npm ci --prefix packages/nativescript-inspector
6881

82+
- name: Install React Native inspector dependencies
83+
run: npm ci --prefix packages/react-native-inspector
84+
6985
- name: Lint, build, and test
7086
run: npm run ci
7187

@@ -95,10 +111,15 @@ jobs:
95111
test -x "${BUNDLE_DIR}/simdeck"
96112
test -x "${BUNDLE_DIR}/simdeck-bin"
97113
tar -tzf "${ARTIFACTS_DIR}/simdeck-${VERSION}.tgz" | grep -qx "package/build/simdeck-bin"
114+
(
115+
cd packages/react-native-inspector
116+
npm pack --pack-destination "${ARTIFACTS_DIR}"
117+
)
98118
(
99119
cd packages/nativescript-inspector
100120
npm pack --pack-destination "${ARTIFACTS_DIR}"
101121
)
122+
cp build/vscode/simdeck-vscode.vsix "${ARTIFACTS_DIR}/simdeck-vscode-${VERSION}.vsix"
102123
103124
- name: Publish package to npm
104125
env:
@@ -117,6 +138,23 @@ jobs:
117138
118139
npm publish "${RUNNER_TEMP}/release-assets/simdeck-${VERSION}.tgz"
119140
141+
- name: Publish React Native package to npm
142+
env:
143+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
144+
VERSION: ${{ steps.meta.outputs.version }}
145+
run: |
146+
if npm view "react-native-simdeck@${VERSION}" version >/dev/null 2>&1; then
147+
echo "react-native-simdeck@${VERSION} is already published on npm."
148+
exit 0
149+
fi
150+
151+
if [ -z "${NODE_AUTH_TOKEN}" ]; then
152+
echo "NPM_TOKEN repository secret is required to publish react-native-simdeck@${VERSION}." >&2
153+
exit 1
154+
fi
155+
156+
npm publish "${RUNNER_TEMP}/release-assets/react-native-simdeck-${VERSION}.tgz"
157+
120158
- name: Publish NativeScript inspector to npm
121159
env:
122160
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -132,10 +170,24 @@ jobs:
132170
exit 1
133171
fi
134172
135-
(
136-
cd packages/nativescript-inspector
137-
npm publish --access public
138-
)
173+
npm publish "${RUNNER_TEMP}/release-assets/nativescript-simdeck-inspector-${VERSION}.tgz" --access public
174+
175+
- name: Publish VS Code extension
176+
env:
177+
VERSION: ${{ steps.meta.outputs.version }}
178+
VSCE_PAT: ${{ secrets.VSCE_PAT }}
179+
run: |
180+
EXTENSION_ID="$(node -p "const pkg = require('./packages/vscode-extension/package.json'); `${pkg.publisher}.${pkg.name}`")"
181+
182+
if [ -z "${VSCE_PAT}" ]; then
183+
echo "VSCE_PAT repository secret is required to publish ${EXTENSION_ID}." >&2
184+
exit 1
185+
fi
186+
187+
npx --no-install vsce publish \
188+
--packagePath "${RUNNER_TEMP}/release-assets/simdeck-vscode-${VERSION}.vsix" \
189+
--pat "${VSCE_PAT}" \
190+
--skip-duplicate
139191
140192
- name: Upload GitHub release assets
141193
env:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ locations with the React Native inspector package:
198198

199199
```ts
200200
import { AppRegistry } from "react-native";
201-
import { startSimDeckReactNativeInspector } from "@simdeck/react-native-inspector";
201+
import { startSimDeckReactNativeInspector } from "react-native-simdeck";
202202
import App from "./App";
203203

204204
if (__DEV__) {

docs/guide/architecture.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ The client never depends on private APIs and never assumes anything not exposed
7272
### `packages/` — companion packages
7373

7474
- **`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).
75-
- **`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).
75+
- **`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).
7676
- **`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).
7777
- **`packages/vscode-extension/`** is the VS Code extension that opens the browser client inside a webview panel and auto-starts the server.
7878
- **`packages/simdeck-test/`** ships `simdeck/test`, a small JS/TS wrapper around daemon startup and the REST control API. See [Testing](/guide/testing).

docs/guide/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ SimDeck ships as a single npm package (`simdeck`) that installs:
2727
Optional companion packages:
2828

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

docs/inspector/index.md

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

1212
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.
1313

docs/inspector/react-native.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# React Native Runtime Inspector
22

3-
`@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.
3+
`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.
44

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

77
## Install
88

99
```sh
10-
npm install @simdeck/react-native-inspector
10+
npm install react-native-simdeck
1111
cd ios && pod install
1212
```
1313

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

1818
```ts
1919
import { AppRegistry } from "react-native";
20-
import { startSimDeckReactNativeInspector } from "@simdeck/react-native-inspector";
20+
import { startSimDeckReactNativeInspector } from "react-native-simdeck";
2121
import App from "./App";
2222

2323
if (__DEV__) {

packages/react-native-inspector/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# React Native Inspector
22

3-
`@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.
3+
`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.
44

55
## Install
66

77
```sh
8-
npm install @simdeck/react-native-inspector
8+
npm install react-native-simdeck
99
cd ios && pod install
1010
```
1111

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

1616
```ts
1717
import { AppRegistry } from "react-native";
18-
import { startSimDeckReactNativeInspector } from "@simdeck/react-native-inspector";
18+
import { startSimDeckReactNativeInspector } from "react-native-simdeck";
1919
import App from "./App";
2020

2121
if (__DEV__) {

0 commit comments

Comments
 (0)