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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
45 changes: 33 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
node-version: '24.14.0'
cache: 'npm'

- name: Install dependencies
Expand All @@ -35,6 +35,25 @@ jobs:
- name: Run JS linter
run: npm run lint:libOnly

js-build:
name: '[JS] Build'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '24.14.0'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Build JS packages
run: npm run build:all

typecheck:
name: '[JS] Types validation'
runs-on: ubuntu-latest
Expand All @@ -45,14 +64,14 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
node-version: '24.14.0'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Run type check
run: npx tsc --noEmit
run: npm run typecheck

test:
name: '[JS] Test'
Expand All @@ -64,7 +83,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
node-version: '24.14.0'
cache: 'npm'

- name: Install dependencies
Expand Down Expand Up @@ -92,20 +111,22 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
node-version: '24.14.0'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Install example dependencies
run: cd example && npm ci
- name: Build monorepo
run: npm run build:all

- name: Generate Android native project
run: cd example && npx expo prebuild --platform android --non-interactive
working-directory: example
run: CI=1 npx expo prebuild --platform android

- name: Run Kotlin native tests
run: npm run test:kotlin
working-directory: example/android
run: ./gradlew :voltra:testDebugUnitTest

native-swift-test:
name: '[Swift] Test'
Expand All @@ -117,7 +138,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
node-version: '24.14.0'
cache: 'npm'

- name: Install dependencies
Expand All @@ -136,7 +157,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
node-version: '24.14.0'
cache: 'npm'

- name: Check Swift formatting
Expand All @@ -155,7 +176,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
node-version: '24.14.0'
cache: 'npm'

# Downloading the pinned release binary is much faster in CI than installing ktlint via Homebrew.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/website-release-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
node-version: '24.14.0'
cache: 'npm'
cache-dependency-path: website/package-lock.json

Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ npm-debug.log

## Build
/build
/ios/.build/
/packages/voltra/ios/.build/
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.19.5
24.14.0
13 changes: 13 additions & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"plugins": ["typescript", "react", "oxc"],
"ignorePatterns": [
"build/**",
"plugin/build/**",
"website/doc_build/**",
"example/.expo/**",
"example/android/.gradle/**",
"example/android/app/build/**",
"example/ios/build/**",
"node_modules/**"
]
}
17 changes: 17 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
/build
/android/build
/example/android
/packages/*/build
/packages/*/.expo
/packages/*/android/build
/packages/*/ios/.build
/example/.expo
/example/ios
/ios/.build
Expand All @@ -8,3 +13,15 @@
/.expo
/website/doc_build
/website/docs
/.turbo
**/*.d.ts
**/*.d.ts.map
**/*.js.map
/packages/*/src/**/*.js
/example/**/*.js
!/example/index.js
!/example/jest.config.js
!/packages/voltra/app.plugin.js
!/packages/voltra/babel.config.js
!/packages/voltra/jest.config.js
!/scripts/**/*.js
18 changes: 9 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ All work on Voltra happens directly on GitHub. Contributors send pull requests w

1. Fork the repo and create your branch from `main` (a guide on [how to fork a repository](https://help.github.com/articles/fork-a-repo/)).
2. Run `npm install` to install all required dependencies.
3. Build the plugin: `npx tsc -p plugin/tsconfig.json`.
3. Build the plugin: `npm run build --workspace @voltra/expo-plugin`.
4. Now you are ready to make changes.

## Architecture overview
Expand All @@ -21,14 +21,14 @@ All work on Voltra happens directly on GitHub. Contributors send pull requests w

The JavaScript/TypeScript code has **two separate entry points** that must be maintained as independent boundaries:

- **Client entry (`src/index.ts`)**: React Native code that runs in the app. Exports JSX components, hooks, and the imperative API for managing Live Activities.
- **Server entry (`src/server.ts`)**: Node.js code for rendering Voltra components to string payloads. Used for server-side rendering and push notification payloads.
- **Client entry (`packages/voltra/src/index.ts`)**: React Native code that runs in the app. Exports JSX components, hooks, and the imperative API for managing Live Activities.
- **Server entry (`packages/voltra/src/server.ts`)**: Node.js code for rendering Voltra components to string payloads. Used for server-side rendering and push notification payloads.

⚠️ **Important**: These two entry points must remain separate. Client code should not import server-only dependencies, and server code should not import React Native-specific modules.

### Expo config plugin (`plugin/`)
### Expo config plugin (`packages/expo-plugin/`)

The Expo plugin in `plugin/src/` handles all Xcode project setup during `expo prebuild`:
The Expo plugin in `packages/expo-plugin/src/` handles all Xcode project setup during `expo prebuild`:

1. **Creates the widget extension target** with proper build settings
2. **Copies template files** from `ios-files/` (widget bundle, assets, Info.plist) into the extension target
Expand Down Expand Up @@ -125,8 +125,8 @@ The payload schema has a version number to support forward compatibility. When t

The version is defined in two places that must stay in sync:

- **TypeScript**: `src/renderer/renderer.ts` → `VOLTRA_PAYLOAD_VERSION`
- **Swift**: `ios/shared/VoltraPayloadMigrator.swift` → `currentVersion`
- **TypeScript**: `packages/voltra/src/renderer/renderer.ts` → `VOLTRA_PAYLOAD_VERSION`
- **Swift**: `packages/voltra/ios/shared/VoltraPayloadMigrator.swift` → `currentVersion`

### When to increment the version

Expand Down Expand Up @@ -181,7 +181,7 @@ The `example/` directory contains an Expo app for testing changes.

```sh
# 1) Build the plugin
npx tsc -p plugin/tsconfig.json
npm run build --workspace @voltra/expo-plugin

# 2) Install example dependencies
(cd example && npm install)
Expand All @@ -193,7 +193,7 @@ npx tsc -p plugin/tsconfig.json
(cd example && npx expo run:ios)
```

If iterating on the plugin, rebuild after each change in `plugin/src/`.
If iterating on the plugin, rebuild after each change in `packages/expo-plugin/src/`.

### Running tests

Expand Down
2 changes: 0 additions & 2 deletions app.plugin.js

This file was deleted.

49 changes: 0 additions & 49 deletions eslint.config.js

This file was deleted.

10 changes: 5 additions & 5 deletions example/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
},
"plugins": [
[
"../app.plugin.js",
"voltra",
{
"groupIdentifier": "group.callstackincubator.voltraexample",
"keychainGroup": "$(AppIdentifierPrefix)group.callstackincubator.voltraexample",
Expand Down Expand Up @@ -130,10 +130,10 @@
]
},
"fonts": [
"node_modules/@expo-google-fonts/merriweather/400Regular/Merriweather_400Regular.ttf",
"node_modules/@expo-google-fonts/merriweather/700Bold/Merriweather_700Bold.ttf",
"node_modules/@expo-google-fonts/pacifico/400Regular/Pacifico_400Regular.ttf",
"node_modules/@expo-google-fonts/press-start-2p/400Regular/PressStart2P_400Regular.ttf"
"@expo-google-fonts/merriweather/400Regular/Merriweather_400Regular.ttf",
"@expo-google-fonts/merriweather/700Bold/Merriweather_700Bold.ttf",
"@expo-google-fonts/pacifico/400Regular/Pacifico_400Regular.ttf",
"@expo-google-fonts/press-start-2p/400Regular/PressStart2P_400Regular.ttf"
]
}
],
Expand Down
19 changes: 0 additions & 19 deletions example/babel.config.js

This file was deleted.

9 changes: 9 additions & 0 deletions example/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { registerRootComponent } from 'expo'
import { ExpoRoot } from 'expo-router'

export function App() {
const ctx = require.context('./app')
return <ExpoRoot context={ctx} />
}

registerRootComponent(App)
34 changes: 0 additions & 34 deletions example/metro.config.js

This file was deleted.

Loading
Loading