Skip to content

Commit 65e99ed

Browse files
committed
chore: @commandbar/react-native v1.0.3
1 parent 73ba436 commit 65e99ed

File tree

130 files changed

+4448
-3908
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+4448
-3908
lines changed

.github/actions/setup/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ runs:
1616
path: |
1717
**/node_modules
1818
.yarn/install-state.gz
19-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/package.json') }}
19+
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/package.json', '!node_modules/**') }}
2020
restore-keys: |
21-
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
21+
${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
2222
${{ runner.os }}-yarn-
2323
2424
- name: Install dependencies

.github/workflows/ci.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
uses: actions/cache@v3
6363
with:
6464
path: ${{ env.TURBO_CACHE_DIR }}
65-
key: ${{ runner.os }}-turborepo-android-${{ hashFiles('**/yarn.lock') }}
65+
key: ${{ runner.os }}-turborepo-android-${{ hashFiles('yarn.lock') }}
6666
restore-keys: |
6767
${{ runner.os }}-turborepo-android-
6868
@@ -79,7 +79,7 @@ jobs:
7979
uses: actions/setup-java@v3
8080
with:
8181
distribution: 'zulu'
82-
java-version: '11'
82+
java-version: '17'
8383

8484
- name: Finalize Android SDK
8585
if: env.turbo_cache_hit != 1
@@ -98,11 +98,13 @@ jobs:
9898
${{ runner.os }}-gradle-
9999
100100
- name: Build example for Android
101+
env:
102+
JAVA_OPTS: "-XX:MaxHeapSize=6g"
101103
run: |
102104
yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}"
103105
104106
build-ios:
105-
runs-on: macos-latest
107+
runs-on: macos-14
106108
env:
107109
TURBO_CACHE_DIR: .turbo/ios
108110
steps:
@@ -116,7 +118,7 @@ jobs:
116118
uses: actions/cache@v3
117119
with:
118120
path: ${{ env.TURBO_CACHE_DIR }}
119-
key: ${{ runner.os }}-turborepo-ios-${{ hashFiles('**/yarn.lock') }}
121+
key: ${{ runner.os }}-turborepo-ios-${{ hashFiles('yarn.lock') }}
120122
restore-keys: |
121123
${{ runner.os }}-turborepo-ios-
122124
@@ -142,7 +144,8 @@ jobs:
142144
- name: Install cocoapods
143145
if: env.turbo_cache_hit != 1 && steps.cocoapods-cache.outputs.cache-hit != 'true'
144146
run: |
145-
yarn pod-install example/ios
147+
cd example/ios
148+
pod install
146149
env:
147150
NO_FLIPPER: 1
148151

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,4 @@ android/keystores/debug.keystore
7676

7777
# generated by bob
7878
lib/
79+
**/*.env.local

.yarnrc.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ nodeLinker: node-modules
22
nmHoistingLimits: workspaces
33

44
plugins:
5-
- path: scripts/pod-install.cjs
65
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
76
spec: "@yarnpkg/plugin-interactive-tools"
87
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The [example app](/example/) demonstrates usage of the library. You need to run
2323

2424
It is configured to use the local version of the library, so any changes you make to the library's source code will be reflected in the example app. Changes to the library's JavaScript code will be reflected in the example app without a rebuild, but native code changes will require a rebuild of the example app.
2525

26-
If you want to use Android Studio or XCode to edit the native code, you can open the `example/android` or `example/ios` directories respectively in those editors. To edit the Objective-C or Swift files, open `example/ios/CommandbarExample.xcworkspace` in XCode and find the source files at `Pods > Development Pods > react-native-commandbar`.
26+
If you want to use Android Studio or XCode to edit the native code, you can open the `example/android` or `example/ios` directories respectively in those editors. To edit the Objective-C or Swift files, open `example/ios/ReactNativeExample.xcworkspace` in XCode and find the source files at `Pods > Development Pods > @commandbar/react-native`.
2727

2828
To edit the Java or Kotlin files, open `example/android` in Android studio and find the source files at `react-native-commandbar` under `Android`.
2929

@@ -101,7 +101,7 @@ yarn release
101101

102102
The `package.json` file contains various scripts for common tasks:
103103

104-
- `yarn`: setup project by installing dependencies and pods - run with `POD_INSTALL=0` to skip installing pods.
104+
- `yarn`: setup project by installing dependencies.
105105
- `yarn typecheck`: type-check files with TypeScript.
106106
- `yarn lint`: lint files with ESLint.
107107
- `yarn test`: run unit tests with Jest.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2023 CommandBar Engineering
3+
Copyright (c) 2024 CommandBar Team
44
Permission is hereby granted, free of charge, to any person obtaining a copy
55
of this software and associated documentation files (the "Software"), to deal
66
in the Software without restriction, including without limitation the rights

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ npm install @commandbar/react-native
3232

3333
```jsx
3434
import { Button, View } from 'react-native';
35-
import { CommandBar } from 'react-native-commandbar';
35+
import { CommandBar } from '@commandbar/react-native';
3636

3737
const MyComponent = () => {
3838
return (

android/build.gradle

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
buildscript {
22
// Buildscript is evaluated before everything else so we can't use getExtOrDefault
3-
def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["Commandbar_kotlinVersion"]
3+
def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["ReactNative_kotlinVersion"]
44

55
repositories {
66
google()
@@ -12,7 +12,11 @@ buildscript {
1212
// noinspection DifferentKotlinGradleVersion
1313
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1414
}
15+
}
1516

17+
def reactNativeArchitectures() {
18+
def value = rootProject.getProperties().get("reactNativeArchitectures")
19+
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
1620
}
1721

1822
def isNewArchitectureEnabled() {
@@ -27,11 +31,11 @@ if (isNewArchitectureEnabled()) {
2731
}
2832

2933
def getExtOrDefault(name) {
30-
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["Commandbar_" + name]
34+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["ReactNative_" + name]
3135
}
3236

3337
def getExtOrIntegerDefault(name) {
34-
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["Commandbar_" + name]).toInteger()
38+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["ReactNative_" + name]).toInteger()
3539
}
3640

3741
def supportsNamespace() {
@@ -45,7 +49,7 @@ def supportsNamespace() {
4549

4650
android {
4751
if (supportsNamespace()) {
48-
namespace "com.commandbarmodule"
52+
namespace "com.commandbar.reactnative"
4953

5054
sourceSets {
5155
main {
@@ -76,7 +80,6 @@ android {
7680
sourceCompatibility JavaVersion.VERSION_1_8
7781
targetCompatibility JavaVersion.VERSION_1_8
7882
}
79-
8083
}
8184

8285
repositories {
@@ -92,6 +95,6 @@ dependencies {
9295
//noinspection GradleDynamicVersion
9396
implementation "com.facebook.react:react-native:+"
9497
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
95-
implementation 'com.google.android.material:material:1.4.0'
96-
implementation "com.commandbar.android:commandbar:1.0.6"
98+
implementation "com.commandbar.android:commandbar:1.0.7"
9799
}
100+

android/gradle.properties

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Commandbar_kotlinVersion=1.7.0
2-
Commandbar_minSdkVersion=21
3-
Commandbar_targetSdkVersion=33
4-
Commandbar_compileSdkVersion=33
5-
Commandbar_ndkversion=21.4.7075529
1+
ReactNative_kotlinVersion=1.7.0
2+
ReactNative_minSdkVersion=21
3+
ReactNative_targetSdkVersion=31
4+
ReactNative_compileSdkVersion=31
5+
ReactNative_ndkversion=21.4.7075529

android/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.commandbarmodule">
2+
package="com.commandbar.reactnative">
33
</manifest>

android/src/main/java/com/commandbarmodule/CommandBarModule.kt renamed to android/src/main/java/com/commandbar/reactnative/CommandBarModule.kt

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.commandbarmodule
1+
package com.commandbar.reactnative
22

33

44
import com.facebook.react.bridge.*
@@ -8,16 +8,11 @@ import com.commandbar.android.CommandBarOptions
88
class CommandBarModule(reactContext: ReactApplicationContext) :
99
ReactContextBaseJavaModule(reactContext) {
1010

11-
override fun getName(): String {
12-
return "RNCommandBar"
13-
}
11+
override fun getName() = "RNCommandBar"
1412

1513
@ReactMethod
1614
fun openHelpHub(options: ReadableMap, onFallbackActionCallback: Callback? = null) {
17-
val activity = currentActivity
18-
if (activity == null) {
19-
return
20-
}
15+
val activity = currentActivity ?: return
2116

2217
val commandBarOptions = CommandBarOptions(dictionary = options.toHashMap())
2318

android/src/main/java/com/commandbarmodule/CommandBarPackage.kt renamed to android/src/main/java/com/commandbar/reactnative/CommandBarPackage.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.commandbarmodule
1+
package com.commandbar.reactnative
22

33
import com.facebook.react.ReactPackage
44
import com.facebook.react.bridge.NativeModule

android/src/main/java/com/commandbarmodule/HelpHubViewManager.kt renamed to android/src/main/java/com/commandbar/reactnative/HelpHubViewManager.kt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1-
package com.commandbarmodule
1+
package com.commandbar.reactnative
22

33
import com.commandbar.android.CommandBarOptions
44
import com.commandbar.android.HelpHubWebView
55
import com.facebook.react.bridge.Arguments
6-
import com.facebook.react.bridge.Callback
76
import com.facebook.react.bridge.ReactApplicationContext
87
import com.facebook.react.bridge.ReadableMap
98
import com.facebook.react.bridge.WritableMap
109
import com.facebook.react.modules.core.DeviceEventManagerModule
11-
import com.facebook.react.uimanager.ReactStylesDiffMap
1210
import com.facebook.react.uimanager.SimpleViewManager
1311
import com.facebook.react.uimanager.ThemedReactContext
14-
import com.facebook.react.uimanager.ViewManager
1512
import com.facebook.react.uimanager.annotations.ReactProp
1613

1714

babel.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module.exports = {
2-
presets: ['module:metro-react-native-babel-preset'],
2+
presets: ['module:@react-native/babel-preset'],
33
};

example/Gemfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@ source 'https://rubygems.org'
33
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
44
ruby ">= 2.6.10"
55

6-
gem 'cocoapods', '~> 1.13'
7-
gem 'activesupport', '>= 6.1.7.3', '< 7.1.0'
6+
# Cocoapods 1.15 introduced a bug which break the build. We will remove the upper
7+
# bound in the template on Cocoapods with next React Native release.
8+
gem 'cocoapods', '>= 1.13', '< 1.15'
9+
gem 'activesupport', '>= 6.1.7.5', '< 7.1.0'

example/android/app/build.gradle

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
apply plugin: "com.android.application"
2+
apply plugin: "org.jetbrains.kotlin.android"
23
apply plugin: "com.facebook.react"
34

45
/**
@@ -70,12 +71,12 @@ def jscFlavor = 'org.webkit:android-jsc:+'
7071

7172
android {
7273
ndkVersion rootProject.ext.ndkVersion
74+
buildToolsVersion rootProject.ext.buildToolsVersion
75+
compileSdk rootProject.ext.compileSdkVersion
7376

74-
compileSdkVersion rootProject.ext.compileSdkVersion
75-
76-
namespace "com.commandbarexample"
77+
namespace "com.reactnativeexample"
7778
defaultConfig {
78-
applicationId "com.commandbarexample"
79+
applicationId "com.reactnativeexample"
7980
minSdkVersion rootProject.ext.minSdkVersion
8081
targetSdkVersion rootProject.ext.targetSdkVersion
8182
versionCode 1
@@ -107,12 +108,6 @@ dependencies {
107108
// The version of react-native is set by the React Native Gradle Plugin
108109
implementation("com.facebook.react:react-android")
109110

110-
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
111-
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
112-
exclude group:'com.squareup.okhttp3', module:'okhttp'
113-
}
114-
115-
debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}")
116111
if (hermesEnabled.toBoolean()) {
117112
implementation("com.facebook.react:hermes-android")
118113
} else {

example/android/app/src/debug/AndroidManifest.xml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,8 @@
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:tools="http://schemas.android.com/tools">
44

5-
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
6-
75
<application
86
android:usesCleartextTraffic="true"
97
tools:targetApi="28"
10-
tools:ignore="GoogleAppIndexingWarning">
11-
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false" />
12-
</application>
8+
tools:ignore="GoogleAppIndexingWarning"/>
139
</manifest>

example/android/app/src/debug/java/com/commandbarexample/ReactNativeFlipper.java

Lines changed: 0 additions & 75 deletions
This file was deleted.

0 commit comments

Comments
 (0)