Skip to content

Commit 8fb87ea

Browse files
authoredJan 29, 2025··
feat: support react native 0.77 (#766)
* feat: support react native 0.77 * Create neat-games-lie.md * chore: yarn immutable

File tree

17 files changed

+1482
-4010
lines changed

17 files changed

+1482
-4010
lines changed
 

‎.changeset/neat-games-lie.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@react-native-documents/picker": minor
3+
---
4+
5+
feat: support react native 0.77

‎.github/workflows/android.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
distribution: 'temurin'
2727
java-version: '17'
2828
- name: Install dependencies
29-
run: yarn install
29+
run: yarn install --immutable
3030
- name: Build android example app on old architecture
3131
run: ./gradlew app:assembleDebug -PnewArchEnabled=false
3232
working-directory: packages/example/android
@@ -43,7 +43,7 @@ jobs:
4343
distribution: 'temurin'
4444
java-version: '17'
4545
- name: Install dependencies
46-
run: yarn install
46+
run: yarn install --immutable
4747
- name: Build android example app on new architecture
4848
run: ./gradlew app:assembleDebug -PnewArchEnabled=true
4949
working-directory: packages/example/android

‎.github/workflows/deploy-docs.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
cache: yarn
3232
- name: Install dependencies and build website
3333
run: |
34-
yarn install
34+
yarn install --immutable
3535
yarn build
3636
deploy:
3737
if: github.event_name != 'pull_request'
@@ -53,5 +53,5 @@ jobs:
5353
run: |
5454
git config --global user.email "vonovak@gmail.com"
5555
git config --global user.name "Vojtech Novak"
56-
yarn install
56+
yarn install --immutable
5757
yarn deploy

‎.github/workflows/ios.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
working-directory: packages/example/ios
2828
bundler-cache: true
2929
- name: Install dependencies
30-
run: yarn install
30+
run: yarn install --immutable
3131
- name: Install pods
3232
run: RCT_NEW_ARCH_ENABLED=0 npx pod-install
3333
working-directory: packages/example/ios
@@ -48,7 +48,7 @@ jobs:
4848
working-directory: packages/example/ios
4949
bundler-cache: true
5050
- name: Install dependencies
51-
run: yarn install
51+
run: yarn install --immutable
5252
- name: Install pods for new arch
5353
run: RCT_NEW_ARCH_ENABLED=1 npx pod-install
5454
working-directory: packages/example/ios

‎.github/workflows/nodejs.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- uses: actions/setup-node@v4
2020
with:
2121
node-version: lts/*
22-
- run: yarn install
22+
- run: yarn install --immutable
2323
- run: yarn typescript
2424
- run: yarn prettier:check
2525
- run: yarn lint
@@ -41,7 +41,7 @@ jobs:
4141
node-version: lts/*
4242
cache: 'yarn'
4343
- name: Install Dependencies
44-
run: yarn install
44+
run: yarn install --immutable
4545

4646
- name: Create Release Pull Request or Publish
4747
id: changesets

‎.yarn/releases/yarn-4.5.1.cjs ‎.yarn/releases/yarn-4.6.0.cjs

+278-278
Large diffs are not rendered by default.

‎.yarnrc.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
nodeLinker: node-modules
22

3-
yarnPath: .yarn/releases/yarn-4.5.1.cjs
3+
yarnPath: .yarn/releases/yarn-4.6.0.cjs

‎docs/docs/install.mdx

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ In regular React Native projects, use RN >= 0.76 or update the [settings in Xcod
2727

2828
:::info
2929

30-
This package cannot be used in ["Expo Go"](https://docs.expo.dev/workflow/overview/#development-builds) because it requires custom native code.
30+
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.
3131

32-
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.
32+
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.
3333

3434
:::
3535

@@ -46,6 +46,6 @@ expo run:android
4646

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

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

5151
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.

‎docs/docusaurus.config.ts

+1-6
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,7 @@ const config: Config = {
4444
},
4545
docs: {
4646
sidebarPath: './sidebars.ts',
47-
48-
// Please change this to your repo.
49-
// Remove this to remove the "edit this page" links.
50-
// TODO add this
51-
// editUrl:
52-
// 'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
47+
editUrl: 'https://github.com/react-native-documents/document-picker/edit/main/docs',
5348
},
5449
blog: false,
5550
// blog: {

‎package.json

+11-14
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"name": "react-native-documents",
3-
"private": false,
43
"description": "A react native interface to access documents from dropbox, google drive, iCloud...",
54
"scripts": {
65
"build": "yarn workspaces foreach -A -p run prepare",
@@ -44,24 +43,22 @@
4443
"@commitlint/config-conventional"
4544
]
4645
},
47-
"packageManager": "yarn@4.5.1",
4846
"dependencies": {
49-
"@changesets/cli": "^2.27.11",
47+
"@changesets/cli": "^2.27.12",
5048
"@commitlint/cli": "^18.6.1",
5149
"@commitlint/config-conventional": "^18.6.3",
52-
"@evilmartians/lefthook": "^1.7.15",
50+
"@evilmartians/lefthook": "^1.10.10",
5351
"@jest/globals": "^29.7.0",
5452
"@manypkg/cli": "^0.21.4",
55-
"@react-native/eslint-config": "^0.74.83",
56-
"@semantic-release/git": "^10.0.1",
57-
"@types/jest": "^29.5.13",
58-
"eslint": "^8.57.0",
53+
"@react-native/eslint-config": "^0.77.0",
54+
"@types/jest": "^29.5.14",
55+
"eslint": "^8.57.1",
5956
"eslint-config-prettier": "^9.1.0",
60-
"eslint-plugin-prettier": "^5.1.3",
57+
"eslint-plugin-prettier": "^5.2.3",
6158
"jest": "^29.7.0",
62-
"pod-install": "^0.2.2",
63-
"prettier": "^3.2.5",
64-
"semantic-release": "^22.0.12",
65-
"typescript": "^5.6.2"
66-
}
59+
"pod-install": "^0.3.4",
60+
"prettier": "^3.4.2",
61+
"typescript": "^5.7.3"
62+
},
63+
"packageManager": "yarn@4.6.0"
6764
}

‎packages/document-picker/android/src/main/java/com/reactnativedocumentpicker/FileOperations.kt

+3-2
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,14 @@ class FileOperations(private val uriMap: MutableMap<String, Uri>) {
4040
val map = filesToCopy.getMap(i)
4141

4242
try {
43-
val newFile = copySingleFile(map, context, destinationDir)
43+
val nonNullMap = map ?: throw IllegalArgumentException("keepLocalCopy: The file argument is null at index $i")
44+
val newFile = copySingleFile(nonNullMap, context, destinationDir)
4445
oneResult.merge(newFile)
4546
} catch (e: Exception) {
4647
val message: String = e.localizedMessage ?: e.message ?: "Unknown error"
4748
oneResult.putString("status", "error")
4849
oneResult.putString("copyError", message)
49-
oneResult.putString("sourceUri", map.getString("uri"))
50+
oneResult.putString("sourceUri", map?.getString("uri"))
5051
}
5152
return@async oneResult
5253
}

‎packages/document-picker/android/src/main/java/com/reactnativedocumentpicker/RNDocumentPickerModule.kt

+9-10
Original file line numberDiff line numberDiff line change
@@ -180,18 +180,17 @@ class RNDocumentPickerModule(reactContext: ReactApplicationContext) :
180180
val filesToCopy = options.getArray("files")
181181
val copyTo = options.getString("destination")
182182
if (copyTo == null || filesToCopy == null) {
183-
promise.reject("keepLocalCopy",
183+
return promise.reject("keepLocalCopy",
184184
"You did not provide the correct options. Expected 'files' and 'destination', got: ${options.toHashMap().keys}"
185185
)
186-
} else {
187-
fileCopyingCoroutine.launch {
188-
val results = fileOps.copyFilesToLocalStorage(
189-
reactApplicationContext,
190-
filesToCopy,
191-
CopyDestination.fromPath(copyTo),
192-
)
193-
promise.resolve(results)
194-
}
186+
}
187+
fileCopyingCoroutine.launch {
188+
val results = fileOps.copyFilesToLocalStorage(
189+
reactApplicationContext,
190+
filesToCopy,
191+
CopyDestination.fromPath(copyTo),
192+
)
193+
promise.resolve(results)
195194
}
196195
}
197196

‎packages/document-picker/package.json

+4-6
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@
2626
],
2727
"scripts": {
2828
"build:mock": "tsc --build jest",
29-
"prepare": "bob build && yarn build:mock",
30-
"release": "yarn prepare && npx semantic-release"
29+
"prepare": "bob build && yarn build:mock"
3130
},
3231
"codegenConfig": {
3332
"name": "rndocumentpickerCGen",
@@ -61,8 +60,8 @@
6160
},
6261
"devDependencies": {
6362
"@tsconfig/node18": "^18.2.4",
64-
"react-native-builder-bob": "^0.30.2",
65-
"typescript": "^5.6.2"
63+
"react-native-builder-bob": "^0.36.0",
64+
"typescript": "^5.7.3"
6665
},
6766
"peerDependencies": {
6867
"react": "*",
@@ -87,6 +86,5 @@
8786
}
8887
]
8988
]
90-
},
91-
"packageManager": "yarn@4.5.1"
89+
}
9290
}

‎packages/document-viewer/package.json

+4-6
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@
2626
],
2727
"scripts": {
2828
"build:mock": "tsc --build jest",
29-
"prepare": "bob build && yarn build:mock",
30-
"release": "yarn prepare && npx semantic-release"
29+
"prepare": "bob build && yarn build:mock"
3130
},
3231
"codegenConfig": {
3332
"name": "rndocumentviewerCGen",
@@ -59,8 +58,8 @@
5958
},
6059
"devDependencies": {
6160
"@tsconfig/node18": "^18.2.4",
62-
"react-native-builder-bob": "^0.30.2",
63-
"typescript": "^5.6.2"
61+
"react-native-builder-bob": "^0.36.0",
62+
"typescript": "^5.7.3"
6463
},
6564
"peerDependencies": {
6665
"react": "*",
@@ -85,6 +84,5 @@
8584
}
8685
]
8786
]
88-
},
89-
"packageManager": "yarn@4.5.1"
87+
}
9088
}

0 commit comments

Comments
 (0)
Please sign in to comment.