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
8 changes: 4 additions & 4 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ jobs:
name: Build docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Restore node_modules from cache
uses: actions/cache@v3
uses: actions/cache@v4
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
Expand All @@ -42,7 +42,7 @@ jobs:
name: Deploy docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Add key to allow access to repository
env:
Expand All @@ -61,7 +61,7 @@ jobs:
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Restore node_modules from cache
uses: actions/cache@v3
uses: actions/cache@v4
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ jobs:
name: Lint Kotlin/Java
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/lint-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ jobs:
name: Lint ObjC
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
Expand All @@ -24,7 +24,6 @@ jobs:
registry-url: "https://registry.npmjs.org"
cache-dependency-path: "**/yarn.lock"
- run: yarn
- run: yarn install:pods
- name: ClangFormat
run: |
#!/bin/bash
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/lint-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,16 @@ on:
- "eslint.config.mjs"
- ".prettierrc.js"
- "package.json"
- "tsconfig.json"
- ".github/workflows/lint-js.yml"

jobs:
lint-js:
name: Lint JS/TS
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/npm-release-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
Expand Down
22 changes: 11 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ We want this community to be friendly and respectful to each other. Please follo
This project is a monorepo, which uses [yarn workspaces](https://classic.yarnpkg.com/lang/en/docs/workspaces/) and is divided into:

- `docs` - contains library's Docusaurus documentation
- `packages/example` - contains mobile app example
- `packages/expo-example` - contains mobile app example
- `packages/react-native-avoid-softinput` - contains library code

## Development workflow
Expand All @@ -20,21 +20,24 @@ To get started with the project, run `yarn` in the root directory to install the
yarn
```

While developing, you can run the [example app](/packages/example/) to test your changes. Any changes you make in your library's JavaScript code will be reflected in the example app without a rebuild. If you change any native code, then you'll need to rebuild the example app.
While developing, you can run the [example app](/packages/expo-example/) to test your changes. Any changes you make in your library's JavaScript code will be reflected in the example app without a rebuild. If you change any native code, then you'll need to rebuild the example app.

To start the packager, run `cd packages/example` and then run `yarn start`
```sh
cd packages/expo-example
yarn prebuild
```

To run the example app on Android:

```sh
cd packages/example
cd packages/expo-example
yarn android
```

To run the example app on iOS:

```sh
cd packages/example
cd packages/expo-example
yarn ios
```

Expand All @@ -53,19 +56,18 @@ yarn format:js

To edit the Objective-C files

- install Pods with `yarn install:pods`
- open XCode with
- install Pods and open XCode with

```sh
cd packages/example
cd packages/expo-example
xed ios
```

- find the source files in XCode at `Pods > Development Pods > ReactNativeAvoidSoftinput`.

To edit the Kotlin files:

- open `packages/example/android` in Android Studio and find the source files at `react-native-avoid-softinput` under `Android`.
- open `packages/expo-example/android` in Android Studio and find the source files at `react-native-avoid-softinput` under `Android`.

To run Docusaurus documentation locally, run the following:

Expand Down Expand Up @@ -140,8 +142,6 @@ The `package.json` file contains various scripts for common tasks:
- `yarn format:android`: format (Spotless/Ktfmt) all Kotlin/Java files.
- `yarn format:ios:objc`: format (ClangFormat) all ObjC/ObjC++ files (install [ClangFormat](https://clang.llvm.org/) e.g. with Homebrew).
- `yarn release` release library to npm.
- `yarn install:pods`: setup project's pods.
- `yarn install:pods:fabric`: setup project's pods with new arch.
- `yarn reset`: clean all project's dependencies and pods.
- `yarn reset:node_modules`: clean all project's dependencies.
- `yarn reset:pods`: clean all project's pods.
Expand Down
3 changes: 3 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ export default [
{
files: ['packages/expo-example/**/*'],
rules: {
// Example app for some reason does not recognize library imported as a workspace dependency on CI
// I don't have time and will to fight with that, let's mark it as a warning and just move on
'import/no-unresolved': 'warn',
'react/react-in-jsx-scope': 'off',
},
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
]
},
"scripts": {
"typescript": "tsc --noEmit -p packages/expo-example/tsconfig.json && tsc --noEmit -p packages/react-native-avoid-softinput/tsconfig.json",
"typescript": "tsc --noEmit",
"lint:js": "eslint \"**/*.{js,ts,tsx}\" && prettier --config .prettierrc.js \"packages/**/*.{js,ts,tsx}\"",
"lint:android": "./packages/react-native-avoid-softinput/android/gradlew -p packages/react-native-avoid-softinput/android spotlessCheck --quiet",
"lint:ios:objc": "clang-format --dry-run -i ./packages/react-native-avoid-softinput/ios/*.{h,mm}",
Expand Down
2 changes: 1 addition & 1 deletion packages/expo-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"expo": "53.0.12",
"react": "19.0.0",
"react-native": "0.79.4",
"react-native-avoid-softinput": "workspace:",
"react-native-avoid-softinput": "workspace:*",
"react-native-edge-to-edge": "1.6.0",
"react-native-gesture-handler": "2.24.0",
"react-native-reanimated": "3.17.4",
Expand Down
5 changes: 4 additions & 1 deletion packages/expo-example/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"extends": "expo/tsconfig.base",
"compilerOptions": {
"strict": true
"strict": true,
"paths": {
"react-native-avoid-softinput": ["../react-native-avoid-softinput/src/index"]
}
}
}
7 changes: 5 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{
"extends": "expo/tsconfig.base",
"compilerOptions": {
"strict": true
"strict": true,
"paths": {
"react-native-avoid-softinput": ["./packages/react-native-avoid-softinput/src/index"]
}
},
"exclude": ["packages/react-native-avoid-softinput/lib/**/*"]
"exclude": ["packages/react-native-avoid-softinput/lib/**/*", "docs"]
}
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6811,7 +6811,7 @@ __metadata:
expo: "npm:53.0.12"
react: "npm:19.0.0"
react-native: "npm:0.79.4"
react-native-avoid-softinput: "workspace:"
react-native-avoid-softinput: "workspace:*"
react-native-edge-to-edge: "npm:1.6.0"
react-native-gesture-handler: "npm:2.24.0"
react-native-reanimated: "npm:3.17.4"
Expand Down Expand Up @@ -11307,7 +11307,7 @@ __metadata:
languageName: node
linkType: hard

"react-native-avoid-softinput@workspace:, react-native-avoid-softinput@workspace:packages/react-native-avoid-softinput":
"react-native-avoid-softinput@workspace:*, react-native-avoid-softinput@workspace:packages/react-native-avoid-softinput":
version: 0.0.0-use.local
resolution: "react-native-avoid-softinput@workspace:packages/react-native-avoid-softinput"
dependencies:
Expand Down
Loading