Skip to content

Commit

Permalink
feat: support react native 0.77 (#766)
Browse files Browse the repository at this point in the history
* feat: support react native 0.77

* Create neat-games-lie.md

* chore: yarn immutable
  • Loading branch information
vonovak authored Jan 29, 2025
1 parent 21838e1 commit 8fb87ea
Show file tree
Hide file tree
Showing 17 changed files with 1,482 additions and 4,010 deletions.
5 changes: 5 additions & 0 deletions .changeset/neat-games-lie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@react-native-documents/picker": minor
---

feat: support react native 0.77
4 changes: 2 additions & 2 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
distribution: 'temurin'
java-version: '17'
- name: Install dependencies
run: yarn install
run: yarn install --immutable
- name: Build android example app on old architecture
run: ./gradlew app:assembleDebug -PnewArchEnabled=false
working-directory: packages/example/android
Expand All @@ -43,7 +43,7 @@ jobs:
distribution: 'temurin'
java-version: '17'
- name: Install dependencies
run: yarn install
run: yarn install --immutable
- name: Build android example app on new architecture
run: ./gradlew app:assembleDebug -PnewArchEnabled=true
working-directory: packages/example/android
4 changes: 2 additions & 2 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
cache: yarn
- name: Install dependencies and build website
run: |
yarn install
yarn install --immutable
yarn build
deploy:
if: github.event_name != 'pull_request'
Expand All @@ -53,5 +53,5 @@ jobs:
run: |
git config --global user.email "[email protected]"
git config --global user.name "Vojtech Novak"
yarn install
yarn install --immutable
yarn deploy
4 changes: 2 additions & 2 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
working-directory: packages/example/ios
bundler-cache: true
- name: Install dependencies
run: yarn install
run: yarn install --immutable
- name: Install pods
run: RCT_NEW_ARCH_ENABLED=0 npx pod-install
working-directory: packages/example/ios
Expand All @@ -48,7 +48,7 @@ jobs:
working-directory: packages/example/ios
bundler-cache: true
- name: Install dependencies
run: yarn install
run: yarn install --immutable
- name: Install pods for new arch
run: RCT_NEW_ARCH_ENABLED=1 npx pod-install
working-directory: packages/example/ios
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: lts/*
- run: yarn install
- run: yarn install --immutable
- run: yarn typescript
- run: yarn prettier:check
- run: yarn lint
Expand All @@ -41,7 +41,7 @@ jobs:
node-version: lts/*
cache: 'yarn'
- name: Install Dependencies
run: yarn install
run: yarn install --immutable

- name: Create Release Pull Request or Publish
id: changesets
Expand Down
556 changes: 278 additions & 278 deletions .yarn/releases/yarn-4.5.1.cjs → .yarn/releases/yarn-4.6.0.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.5.1.cjs
yarnPath: .yarn/releases/yarn-4.6.0.cjs
6 changes: 3 additions & 3 deletions docs/docs/install.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ In regular React Native projects, use RN >= 0.76 or update the [settings in Xcod

:::info

This package cannot be used in ["Expo Go"](https://docs.expo.dev/workflow/overview/#development-builds) because it requires custom native code.
These packages cannot be used in ["Expo Go"](https://docs.expo.dev/workflow/overview/#expo-go-an-optional-tool-for-learning) because they require custom native code.

However, you can add custom native code to Expo through a [development build](https://docs.expo.dev/workflow/overview/#development-builds). That is the approach taken below.
However, you can add custom native code to an Expo app through a [development build](https://docs.expo.dev/workflow/overview/#development-builds). That is the officially recommended approach for building Expo apps. See the commands below to do this.

:::

Expand All @@ -46,6 +46,6 @@ expo run:android

Install the package and then run `pod install` from the ios directory. Then rebuild your project with Xcode.

The packages support last 3 stable releases of RN, but very likely work with RN 0.73 an up.
The packages support last 3 stable releases of RN, but very likely work with RN 0.73 and up.

If you're using the [New Architecture](https://reactnative.dev/docs/new-architecture-intro), it's strongly recommended to use the latest stable release of RN.
7 changes: 1 addition & 6 deletions docs/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,7 @@ const config: Config = {
},
docs: {
sidebarPath: './sidebars.ts',

// Please change this to your repo.
// Remove this to remove the "edit this page" links.
// TODO add this
// editUrl:
// 'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
editUrl: 'https://github.com/react-native-documents/document-picker/edit/main/docs',
},
blog: false,
// blog: {
Expand Down
25 changes: 11 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "react-native-documents",
"private": false,
"description": "A react native interface to access documents from dropbox, google drive, iCloud...",
"scripts": {
"build": "yarn workspaces foreach -A -p run prepare",
Expand Down Expand Up @@ -44,24 +43,22 @@
"@commitlint/config-conventional"
]
},
"packageManager": "[email protected]",
"dependencies": {
"@changesets/cli": "^2.27.11",
"@changesets/cli": "^2.27.12",
"@commitlint/cli": "^18.6.1",
"@commitlint/config-conventional": "^18.6.3",
"@evilmartians/lefthook": "^1.7.15",
"@evilmartians/lefthook": "^1.10.10",
"@jest/globals": "^29.7.0",
"@manypkg/cli": "^0.21.4",
"@react-native/eslint-config": "^0.74.83",
"@semantic-release/git": "^10.0.1",
"@types/jest": "^29.5.13",
"eslint": "^8.57.0",
"@react-native/eslint-config": "^0.77.0",
"@types/jest": "^29.5.14",
"eslint": "^8.57.1",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-prettier": "^5.2.3",
"jest": "^29.7.0",
"pod-install": "^0.2.2",
"prettier": "^3.2.5",
"semantic-release": "^22.0.12",
"typescript": "^5.6.2"
}
"pod-install": "^0.3.4",
"prettier": "^3.4.2",
"typescript": "^5.7.3"
},
"packageManager": "[email protected]"
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,14 @@ class FileOperations(private val uriMap: MutableMap<String, Uri>) {
val map = filesToCopy.getMap(i)

try {
val newFile = copySingleFile(map, context, destinationDir)
val nonNullMap = map ?: throw IllegalArgumentException("keepLocalCopy: The file argument is null at index $i")
val newFile = copySingleFile(nonNullMap, context, destinationDir)
oneResult.merge(newFile)
} catch (e: Exception) {
val message: String = e.localizedMessage ?: e.message ?: "Unknown error"
oneResult.putString("status", "error")
oneResult.putString("copyError", message)
oneResult.putString("sourceUri", map.getString("uri"))
oneResult.putString("sourceUri", map?.getString("uri"))
}
return@async oneResult
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,18 +180,17 @@ class RNDocumentPickerModule(reactContext: ReactApplicationContext) :
val filesToCopy = options.getArray("files")
val copyTo = options.getString("destination")
if (copyTo == null || filesToCopy == null) {
promise.reject("keepLocalCopy",
return promise.reject("keepLocalCopy",
"You did not provide the correct options. Expected 'files' and 'destination', got: ${options.toHashMap().keys}"
)
} else {
fileCopyingCoroutine.launch {
val results = fileOps.copyFilesToLocalStorage(
reactApplicationContext,
filesToCopy,
CopyDestination.fromPath(copyTo),
)
promise.resolve(results)
}
}
fileCopyingCoroutine.launch {
val results = fileOps.copyFilesToLocalStorage(
reactApplicationContext,
filesToCopy,
CopyDestination.fromPath(copyTo),
)
promise.resolve(results)
}
}

Expand Down
10 changes: 4 additions & 6 deletions packages/document-picker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
],
"scripts": {
"build:mock": "tsc --build jest",
"prepare": "bob build && yarn build:mock",
"release": "yarn prepare && npx semantic-release"
"prepare": "bob build && yarn build:mock"
},
"codegenConfig": {
"name": "rndocumentpickerCGen",
Expand Down Expand Up @@ -61,8 +60,8 @@
},
"devDependencies": {
"@tsconfig/node18": "^18.2.4",
"react-native-builder-bob": "^0.30.2",
"typescript": "^5.6.2"
"react-native-builder-bob": "^0.36.0",
"typescript": "^5.7.3"
},
"peerDependencies": {
"react": "*",
Expand All @@ -87,6 +86,5 @@
}
]
]
},
"packageManager": "[email protected]"
}
}
10 changes: 4 additions & 6 deletions packages/document-viewer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
],
"scripts": {
"build:mock": "tsc --build jest",
"prepare": "bob build && yarn build:mock",
"release": "yarn prepare && npx semantic-release"
"prepare": "bob build && yarn build:mock"
},
"codegenConfig": {
"name": "rndocumentviewerCGen",
Expand Down Expand Up @@ -59,8 +58,8 @@
},
"devDependencies": {
"@tsconfig/node18": "^18.2.4",
"react-native-builder-bob": "^0.30.2",
"typescript": "^5.6.2"
"react-native-builder-bob": "^0.36.0",
"typescript": "^5.7.3"
},
"peerDependencies": {
"react": "*",
Expand All @@ -85,6 +84,5 @@
}
]
]
},
"packageManager": "[email protected]"
}
}
Loading

0 comments on commit 8fb87ea

Please sign in to comment.