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
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true

[*]

indent_style = space
indent_size = 2

end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
20 changes: 16 additions & 4 deletions .fallowrc.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,32 @@
{
"$schema": "https://raw.githubusercontent.com/fallow-rs/fallow/main/schema.json",
"entry": ["src/index.ts"],
"entry": ["src/index.tsx"],
"ignoreDependencies": [
"@commitlint/config-conventional",
"@eslint/js",
"@jest/globals",
"@react-native-community/cli",
"@react-native/babel-preset",
"@react-native/jest-preset",
"@release-it/conventional-changelog",
"@types/react",
"commitlint",
"del-cli",
"eslint",
"eslint-config-prettier",
"eslint-import-resolver-typescript",
"eslint-plugin-import-x",
"eslint-plugin-perfectionist",
"fallow",
"globals",
"react-native-builder-bob",
"jest",
"lefthook",
"prettier",
"react-native-builder-bob",
"release-it",
"turbo",
"typescript",
"typescript-eslint",
"@types/react"
"typescript-eslint"
],
"ignorePatterns": ["**/*.d.ts", "./package.json", "example/**", "lib/**", "node_modules/**"],
"duplicates": {
Expand Down
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.pbxproj -text
# specific for windows script files
*.bat text eol=crlf
104 changes: 52 additions & 52 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
name: CI

on:
push:
branches: [main]
pull_request:

jobs:
test:
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
pull-requests: write
steps:
- uses: actions/checkout@v7.0.1
with:
fetch-depth: 0

- uses: actions/setup-node@v7.0.0
with:
node-version: 22
cache: npm

- run: npm ci

- name: Codegen
run: npm run codegen

- name: Lint
run: npm run lint

- name: TypeScript check
run: npm run typecheck

- name: Build
run: npm run build

- name: Fallow health check
uses: fallow-rs/fallow@v3.14.0
with:
command: health
format: sarif
auto-changed-since: true
comment: true
github-token: ${{ github.token }}
args: --report-only

- uses: github/codeql-action/upload-sarif@v4
if: always()
with:
sarif_file: fallow-results.sarif
# name: CI

# on:
# push:
# branches: [main]
# pull_request:

# jobs:
# test:
# runs-on: ubuntu-latest
# permissions:
# contents: read
# security-events: write
# pull-requests: write
# steps:
# - uses: actions/checkout@v7.0.1
# with:
# fetch-depth: 0

# - uses: actions/setup-node@v7.0.0
# with:
# node-version: 22
# cache: npm

# - run: npm ci

# - name: Codegen
# run: npm run codegen

# - name: Lint
# run: npm run lint

# - name: TypeScript check
# run: npm run typecheck

# - name: Build
# run: npm run build

# - name: Fallow health check
# uses: fallow-rs/fallow@v3.14.0
# with:
# command: health
# format: sarif
# auto-changed-since: true
# comment: true
# github-token: ${{ github.token }}
# args: --report-only

# - uses: github/codeql-action/upload-sarif@v4
# if: always()
# with:
# sarif_file: fallow-results.sarif
107 changes: 90 additions & 17 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,24 +1,97 @@
# dependencies
# OSX
#
.DS_Store

# XDE
.expo/

# VSCode
.vscode/
jsconfig.json

# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
project.xcworkspace
**/.xcode.env.local

# Android/IJ
#
.classpath
.cxx
.gradle
.idea
.project
.settings
local.properties
android.iml

# Gradle daemon JVM toolchain (generated by `./gradlew updateDaemonJvm`)
example/android/gradle/gradle-daemon-jvm.properties

# Cocoapods
#
example/ios/Pods

# Ruby
example/vendor/

# node.js
#
node_modules/
npm-debug.log
yarn-debug.log
yarn-error.log

# build output
lib/
android/build/
ios/build/
*.podspec.lock
# BUCK
buck-out/
\.buckd/
android/app/libs
android/keystores/debug.keystore

# Yarn
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# Expo
.expo/

# Turborepo
.turbo/

# generated by bob
tsconfig.tsbuildinfo
lib/

# macOS
.DS_Store
# React Native Codegen
ios/generated
android/generated
example/build/generated/codegen

# logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# React Native Nitro Modules
nitrogen/

# editor
.vscode/
.idea/
.fallow/
# Fallow
.fallow/

# Env files (keep .env.example tracked)
.env
!.env.example
1 change: 1 addition & 0 deletions .watchmanconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
942 changes: 942 additions & 0 deletions .yarn/releases/yarn-4.11.0.cjs

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
nodeLinker: node-modules
nmHoistingLimits: workspaces

yarnPath: .yarn/releases/yarn-4.11.0.cjs
20 changes: 20 additions & 0 deletions BunnyStreamReactNative.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
require "json"

package = JSON.parse(File.read(File.join(__dir__, "package.json")))

Pod::Spec.new do |s|
s.name = "BunnyStreamReactNative"
s.version = package["version"]
s.summary = package["description"]
s.homepage = package["homepage"]
s.license = package["license"]
s.authors = package["author"]

s.platforms = { :ios => min_ios_version_supported }
s.source = { :git => "https://github.com/BunnyWay/bunny-stream-react-native.git", :tag => "#{s.version}" }

s.source_files = "ios/**/*.{h,m,mm,swift,cpp}"
s.private_header_files = "ios/**/*.h"

install_modules_dependencies(s)
end
31 changes: 20 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,35 +22,44 @@ If you are unsure whether a change fits, open an issue first and describe the pr
Requirements:

- Node.js 22+ (see `.nvmrc`)
- npm
- Yarn 4 (managed via Corepack — see below)
- Xcode (latest) with iOS Simulator
- Android Studio with Android SDK and emulator

### Enabling Yarn 4 via Corepack

This project uses Yarn 4 (Berry), pinned via the `packageManager` field in `package.json`. Enable it with Corepack (built into Node.js 16.9+):

```bash
corepack enable
```

Corepack will automatically download and use the exact Yarn version specified in `package.json` (`yarn@4.11.0`). You do **not** need to install Yarn globally.

If you have an older Yarn 1.x installed globally, Corepack takes precedence once enabled.

Useful commands:

```bash
npm install
npm run typecheck
npm run lint
npm run build
yarn install
yarn typecheck
yarn lint
yarn build
```

### Running the example app

The repository includes an example React Native app in `example/` that links the library from source. This is the primary way to iterate on the native bridge.

```bash
# Install example dependencies (from repository root)
npm --prefix example install

# iOS (installs pods and launches simulator)
npm run example:ios
yarn example:ios

# Android (launches emulator)
npm run example:android
yarn example:android

# Typecheck the example app
npm run example:typecheck
yarn example:typecheck
```

The example app resolves the library from `src/` via Metro, so changes to TypeScript source are reflected through Fast Refresh without rebuilding the library.
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@ Bunny Stream is a video platform that provides encoding, storage, delivery, and
| Node.js | 18 (see `.nvmrc` for the version used in CI) |
| React | 18.0.0 |
| React Native | 0.71.0 |
| Android API | 26 (required by the Bunny Stream Android SDK) |

These are the floors declared in `peerDependencies` / `engines` in `package.json` and may be raised as the native bridge is implemented. The planned native implementation will target the React Native **New Architecture** (TurboModules and Fabric components).
These are the floors declared in `peerDependencies` / `engines` in `package.json` and may be raised as the native bridge is implemented. The native implementation targets the React Native **New Architecture** (TurboModules and Fabric components).

## Status

This repository currently contains the base setup for the future npm package (TypeScript configuration, linting, and build tooling via [react-native-builder-bob](https://github.com/callstack/react-native-builder-bob)) and an example app for development. No native bridge exists yet.
This repository contains the TypeScript contract (Codegen specs), build tooling via [react-native-builder-bob](https://github.com/callstack/react-native-builder-bob), the Android native bridge (in progress), and an example app for development. The iOS bridge is planned.

Planned roadmap:

Expand Down
12 changes: 12 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
overrides: [
{
exclude: /\/node_modules\//,
presets: ['module:react-native-builder-bob/babel-preset'],
},
{
include: /\/node_modules\//,
presets: ['module:@react-native/babel-preset'],
},
],
};
Loading