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 .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Setup
description: Setup Node.js and install dependencies

runs:
using: composite
steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'yarn'

- name: Install dependencies
run: yarn install
shell: bash
38 changes: 14 additions & 24 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ jobs:
name: Build Android App
runs-on: ubuntu-latest

env:
SKIP_YARN_COREPACK_CHECK: 0

steps:
- uses: actions/checkout@v4

Expand All @@ -29,32 +26,28 @@ jobs:
node-version: 'lts/*'
cache: 'yarn'

- name: Install root dependencies
- name: Install dependencies
run: yarn install

- name: Install example dependencies
run: |
cd example
yarn install
cd ..
- name: Build package
run: yarn build

- name: Build Android App
run: |
cd example/kotlin
cd apps/example/kotlin
./gradlew assembleDebug

ios:
name: Build iOS App
runs-on: macos-latest

env:
SKIP_YARN_COREPACK_CHECK: 0

steps:
- uses: actions/checkout@v4

- name: Select Xcode 16.4
run: sudo xcode-select -s /Applications/Xcode_16.4.app
- name: Use appropriate Xcode version
uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
with:
xcode-version: '16'

- name: Setup Node.js
uses: actions/setup-node@v4
Expand All @@ -68,21 +61,18 @@ jobs:
ruby-version: '3.2'
bundler-cache: true

- name: Install root dependencies
- name: Install dependencies
run: yarn install

- name: Install example dependencies
run: |
cd example
yarn install
cd ..
- name: Build package
run: yarn build

- name: Install pods
run: |
cd example/swift
cd apps/example/swift
pod install

- name: Build iOS App
run: |
cd example/swift
xcodebuild -workspace SwiftExample.xcworkspace -scheme SwiftExample -configuration Debug -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 16' build CODE_SIGNING_ALLOWED=NO
cd apps/example/swift
xcodebuild -workspace SwiftExample.xcworkspace -scheme SwiftExample -configuration Debug -sdk iphonesimulator build CODE_SIGNING_ALLOWED=NO
36 changes: 12 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Lint & Type Check
name: CI

on:
push:
Expand All @@ -7,32 +7,20 @@ on:
branches: [main]

jobs:
analyse:
lint:
runs-on: ubuntu-latest

env:
SKIP_YARN_COREPACK_CHECK: 0

steps:
- uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
cache: 'yarn'
- name: Checkout
uses: actions/checkout@v4

- name: Install root dependencies
run: yarn install
- name: Setup
uses: ./.github/actions/setup

- name: Install example dependencies
run: |
cd example
yarn install
cd ..
- name: Build package
run: yarn build

- name: Lint JS Code (ESLint)
run: yarn run lint
- name: Lint files
run: yarn lint

- name: Typescript Type Checking (tsc)
run: yarn run typecheck
- name: Typecheck files
run: yarn typecheck
10 changes: 4 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ build/
.gradle
local.properties
*.iml
example/kotlin/build/
*.iml
*.hprof
**/.cxx/
*.keystore
Expand All @@ -47,7 +45,6 @@ yarn-error.log
# BUCK
buck-out/
\.buckd/
*.keystore

# fastlane
#
Expand All @@ -66,18 +63,19 @@ buck-out/
# CocoaPods
**/Pods


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

# generated by bob
lib/

# Turbo
.turbo

# Gradle
secring.gpg
3 changes: 0 additions & 3 deletions .npmignore

This file was deleted.

942 changes: 942 additions & 0 deletions .yarn/releases/yarn-4.12.0.cjs

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
compressionLevel: mixed

enableGlobalCache: false

nodeLinker: node-modules

nmHoistingLimits: workspaces

yarnPath: .yarn/releases/yarn-4.12.0.cjs
6 changes: 6 additions & 0 deletions apps/example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
Binary file added apps/example/.yarn/install-state.gz
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion example/metro.config.cjs → apps/example/metro.config.cjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');
const path = require('path');

const root = path.resolve(__dirname, '..');
const root = path.resolve(__dirname, '../..');

/**
* Metro configuration
Expand Down
6 changes: 1 addition & 5 deletions example/package.json → apps/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start"
},
"dependencies": {
"@callstack/react-native-brownfield": "*",
"react": "19.1.1",
"react-native": "0.82.1"
},
Expand All @@ -19,13 +18,10 @@
"@react-native-community/cli-platform-android": "20.0.0",
"@react-native-community/cli-platform-ios": "20.0.0",
"@react-native/babel-preset": "0.82.1",
"@react-native/eslint-config": "0.82.1",
"@react-native/metro-config": "0.82.1",
"@react-native/typescript-config": "0.82.1",
"@react-navigation/native": "^7.0.15",
"@react-navigation/native-stack": "^7.2.1",
"babel-plugin-module-resolver": "5.0.0",
"react-native-builder-bob": "^0.37.0",
"react-native-safe-area-context": "^5.3.0",
"react-native-screens": "^4.15.2"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const path = require('path');
const pkg = require('../package.json');
const pkg = require('../../packages/react-native-brownfield/package.json');

module.exports = {
project: {
Expand All @@ -12,10 +12,8 @@ module.exports = {
},
dependencies: {
[pkg.name]: {
root: path.join(__dirname, '..'),
root: path.join(__dirname, '../../packages/react-native-brownfield'),
platforms: {
// Codegen script incorrectly fails without this
// So we explicitly specify the platforms with empty object
ios: {},
android: {},
},
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions example/swift/Podfile.lock → apps/example/swift/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2322,7 +2322,7 @@ PODS:
- SocketRocket
- ReactAppDependencyProvider (0.82.1):
- ReactCodegen
- ReactBrownfield (1.2.0):
- ReactBrownfield (2.0.1):
- boost
- DoubleConversion
- fast_float
Expand Down Expand Up @@ -2573,7 +2573,7 @@ DEPENDENCIES:
- React-utils (from `../node_modules/react-native/ReactCommon/react/utils`)
- React-webperformancenativemodule (from `../node_modules/react-native/ReactCommon/react/nativemodule/webperformance`)
- ReactAppDependencyProvider (from `build/generated/ios`)
- ReactBrownfield (from `../..`)
- ReactBrownfield (from `../../../packages/react-native-brownfield`)
- ReactCodegen (from `build/generated/ios`)
- ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)
- RNScreens (from `../node_modules/react-native-screens`)
Expand Down Expand Up @@ -2729,7 +2729,7 @@ EXTERNAL SOURCES:
ReactAppDependencyProvider:
:path: build/generated/ios
ReactBrownfield:
:path: "../.."
:path: "../../../packages/react-native-brownfield"
ReactCodegen:
:path: build/generated/ios
ReactCommon:
Expand Down Expand Up @@ -2811,12 +2811,12 @@ SPEC CHECKSUMS:
React-utils: abf37b162f560cd0e3e5d037af30bb796512246d
React-webperformancenativemodule: 50a57c713a90d27ae3ab947a6c9c8859bcb49709
ReactAppDependencyProvider: a45ef34bb22dc1c9b2ac1f74167d9a28af961176
ReactBrownfield: ba90b7c2be36c3ef4ad47e777610ca7c2b0fdf06
ReactBrownfield: 10f9f7370cd8bd6ef30eb9c736d774f9d17565f7
ReactCodegen: 878add6c7d8ff8cea87697c44d29c03b79b6f2d9
ReactCommon: 804dc80944fa90b86800b43c871742ec005ca424
RNScreens: d821082c6dd1cb397cc0c98b026eeafaa68be479
SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748
Yoga: 8e01cef9947ca77f0477a098f0b32848a8e448c6
Yoga: 689c8e04277f3ad631e60fe2a08e41d411daf8eb

PODFILE CHECKSUM: c4add71d30d7b14523f41a732fbf4937f4edbe0f

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,10 @@
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-SwiftExample/Pods-SwiftExample-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
inputPaths = (
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-SwiftExample/Pods-SwiftExample-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-SwiftExample/Pods-SwiftExample-frameworks.sh\"\n";
Expand All @@ -186,7 +182,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "export RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../../node_modules/react-native/scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\nif nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\nif ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\necho \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\nexit 2\nfi\nelse\nopen \"$SRCROOT/../../node_modules/react-native/scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\nfi\nfi\n";
shellScript = "export RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../node_modules/react-native/scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\nif nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\nif ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\necho \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\nexit 2\nfi\nelse\nopen \"$SRCROOT/../node_modules/react-native/scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\nfi\nfi\n";
};
28EDEAEC2312D0910007552C /* Bundle React Native code and images */ = {
isa = PBXShellScriptBuildPhase;
Expand All @@ -204,7 +200,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "set -e\nif [[ -f \"$PODS_ROOT/../.xcode.env\" ]]; then\nsource \"$PODS_ROOT/../.xcode.env\"\nfi\nif [[ -f \"$PODS_ROOT/../.xcode.env.local\" ]]; then\nsource \"$PODS_ROOT/../.xcode.env.local\"\nfi\nREACT_NATIVE_PATH=\"../../node_modules/react-native\"\nWITH_ENVIRONMENT=\"$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"$REACT_NATIVE_PATH/scripts/react-native-xcode.sh\"\nENTRY_FILE=index.js\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n";
shellScript = "set -e\nif [[ -f \"$PODS_ROOT/../.xcode.env\" ]]; then\nsource \"$PODS_ROOT/../.xcode.env\"\nfi\nif [[ -f \"$PODS_ROOT/../.xcode.env.local\" ]]; then\nsource \"$PODS_ROOT/../.xcode.env.local\"\nfi\nWITH_ENVIRONMENT=\"$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"$REACT_NATIVE_PATH/scripts/react-native-xcode.sh\"\nENTRY_FILE=index.js\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n";
};
3922106373FF9547107BB112 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
Expand Down Expand Up @@ -236,14 +232,10 @@
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-SwiftExample/Pods-SwiftExample-resources-${CONFIGURATION}-input-files.xcfilelist",
);
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-SwiftExample/Pods-SwiftExample-resources-${CONFIGURATION}-output-files.xcfilelist",
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-SwiftExample/Pods-SwiftExample-resources.sh\"\n";
Expand Down Expand Up @@ -336,7 +328,10 @@
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = "$(inherited)";
OTHER_CPLUSPLUSFLAGS = "$(inherited)";
OTHER_LDFLAGS = "$(inherited) ";
OTHER_LDFLAGS = (
"$(inherited)",
" ",
);
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG";
Expand Down Expand Up @@ -400,7 +395,10 @@
MTL_FAST_MATH = YES;
OTHER_CFLAGS = "$(inherited)";
OTHER_CPLUSPLUSFLAGS = "$(inherited)";
OTHER_LDFLAGS = "$(inherited) ";
OTHER_LDFLAGS = (
"$(inherited)",
" ",
);
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
Expand Down
13 changes: 0 additions & 13 deletions example/babel.config.cjs

This file was deleted.

Loading