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
6 changes: 6 additions & 0 deletions .changeset/large-doors-return.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@react-native-documents/picker": major
"@react-native-documents/viewer": major
---

feat: do not ship commonjs
2 changes: 2 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ jobs:
- run: yarn lint
- run: yarn test
- run: yarn build
- run: yarn workspace react-native-documents-example run bundle:android
- run: yarn workspace react-native-documents-example run bundle:ios

publish-npm:
needs: build
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/install.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ yarn add @react-native-documents/viewer
The packages are designed to support last 3 stable versions of RN. However, they very likely work with RN 0.73 and up.

:::warning
The document picker package requires iOS 14 or later. If you use Expo, use Expo SDK >=52 or [Expo build properties](https://docs.expo.dev/versions/latest/sdk/build-properties/#example-appjson-with-config-plugin) to update the `deploymentTarget` to `14`.
The document picker package requires iOS 14 or later. If you use Expo, use Expo SDK >= 52 or [Expo build properties](https://docs.expo.dev/versions/latest/sdk/build-properties/#example-appjson-with-config-plugin) to update the `deploymentTarget` to `14`.

In regular React Native projects, use RN >= 0.76 or update the [settings in Xcode](https://stackoverflow.com/a/66798215/2070942).
:::
Expand Down
12 changes: 6 additions & 6 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1282,7 +1282,7 @@ PODS:
- React-RCTFBReactNativeSpec
- ReactCommon/turbomodule/core
- ReactNativeDependencies
- react-native-document-picker (10.1.6):
- react-native-document-picker (10.1.7):
- hermes-engine
- RCTRequired
- RCTTypeSafety
Expand All @@ -1304,7 +1304,7 @@ PODS:
- ReactCommon/turbomodule/core
- ReactNativeDependencies
- Yoga
- react-native-document-viewer (1.0.2):
- react-native-document-viewer (1.0.3):
- hermes-engine
- RCTRequired
- RCTTypeSafety
Expand Down Expand Up @@ -1702,7 +1702,7 @@ PODS:
- ReactCommon/turbomodule/core
- ReactNativeDependencies
- Yoga
- ReactTestApp-DevSupport (4.4.10):
- ReactTestApp-DevSupport (4.4.12):
- React-Core
- React-jsi
- ReactTestApp-Resources (1.0.0-dev)
Expand Down Expand Up @@ -1994,8 +1994,8 @@ SPEC CHECKSUMS:
React-logger: 7b234de35acb469ce76d6bbb0457f664d6f32f62
React-Mapbuffer: fbe1da882a187e5898bdf125e1cc6e603d27ecae
React-microtasksnativemodule: 76905804171d8ccbe69329fc84c57eb7934add7f
react-native-document-picker: 10d97da5ab59c2430e122924a525380d498b5d43
react-native-document-viewer: 49cf47192ee7e15f4ad25f8fdaef6b4f1ab0cc9c
react-native-document-picker: a3c4ce6322b7aa9902fe8ffb8e03d5858b5d7beb
react-native-document-viewer: 6fc76b1f9f2773a39b155f10aae674cf731f21b2
react-native-segmented-control: bf6e0032726727498e18dd437ae88afcdbc18e99
React-NativeModulesApple: a9464983ccc0f66f45e93558671f60fc7536e438
React-oscompat: 73db7dbc80edef36a9d6ed3c6c4e1724ead4236d
Expand Down Expand Up @@ -2029,7 +2029,7 @@ SPEC CHECKSUMS:
ReactCommon: 149b6c05126f2e99f2ed0d3c63539369546f8cae
ReactNativeDependencies: ed6d1e64802b150399f04f1d5728ec16b437251e
ReactNativeHost: 7f059fda99bc0ba0187c19bfe91866c7692d90df
ReactTestApp-DevSupport: 9b7bbba5e8fed998e763809171d9906a1375f9d3
ReactTestApp-DevSupport: 963986104f003af978562535682fec417b4aadfa
ReactTestApp-Resources: 1bd9ff10e4c24f2ad87101a32023721ae923bccf
RNCAsyncStorage: 3a4f5e2777dae1688b781a487923a08569e27fe4
Yoga: 051f086b5ccf465ff2ed38a2cf5a558ae01aaaa1
Expand Down
2 changes: 1 addition & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"appium": "^2.5.4",
"appium-uiautomator2-driver": "^3.1.0",
"pod-install": "1.0.7",
"react-native-test-app": "^4.4.10",
"react-native-test-app": "^4.4.12",
"ts-node": "^10.9.2",
"wdio-wait-for": "^3.0.11"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ class RNDocumentPickerModule(reactContext: ReactApplicationContext) :
}

override fun invalidate() {
fileCopyingCoroutine.cancel("module invalidated")
reactApplicationContext.removeActivityEventListener(activityEventListener)
// TODO verify this should be done (and order)
// reactApplicationContext.removeLifecycleEventListener(this)
Expand Down Expand Up @@ -307,7 +308,7 @@ class RNDocumentPickerModule(reactContext: ReactApplicationContext) :
else -> emptyList()
}

CoroutineScope(Dispatchers.IO).launch {
fileCopyingCoroutine.launch {
try {
val pickOptions = currentPickOptions
require(pickOptions != null)
Expand Down
27 changes: 18 additions & 9 deletions packages/document-picker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@
"name": "@react-native-documents/picker",
"version": "10.1.7",
"description": "A react native interface to access documents from dropbox, google drive, iCloud...",
"main": "lib/commonjs/index",
"module": "lib/module/index",
"types": "lib/typescript/index.d.ts",
"react-native": "src/index",
"source": "src/index",
"main": "./lib/module/index.js",
"types": "./lib/typescript/src/index.d.ts",
"exports": {
".": {
"source": "./src/index.ts",
"types": "./lib/typescript/src/index.d.ts",
"default": "./lib/module/index.js"
},
"./package.json": "./package.json"
},
"files": [
"src",
"lib",
Expand Down Expand Up @@ -60,12 +65,12 @@
},
"devDependencies": {
"@tsconfig/node18": "^18.2.4",
"react-native-builder-bob": "^0.36.0",
"react-native-builder-bob": "^0.40.13",
"typescript": "^5.7.3"
},
"peerDependencies": {
"react": "*",
"react-native": "*"
"react-native": ">=0.79.0"
},
"jest": {
"preset": "react-native",
Expand All @@ -77,8 +82,12 @@
"source": "src",
"output": "lib",
"targets": [
"commonjs",
"module",
[
"module",
{
"esm": true
}
],
[
"typescript",
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ Pod::Spec.new do |s|
s.source = { :git => "https://github.com/react-native-documents/sponsors-only.git", :tag => "v#{s.version}" }

s.source_files = ["ios/**/*.{h,m,mm,swift}"]
s.frameworks = 'MobileCoreServices'

# Swift/Objective-C compatibility
s.pod_target_xcconfig = {
Expand Down
4 changes: 3 additions & 1 deletion packages/document-picker/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

{
"extends": "../../tsconfig.build.json",
"compilerOptions": {
"rootDir": "."
}
}
27 changes: 18 additions & 9 deletions packages/document-viewer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@
"name": "@react-native-documents/viewer",
"version": "1.0.3",
"description": "A react native interface to preview documents",
"main": "lib/commonjs/index",
"module": "lib/module/index",
"types": "lib/typescript/index.d.ts",
"react-native": "src/index",
"source": "src/index",
"main": "./lib/module/index.js",
"types": "./lib/typescript/src/index.d.ts",
"exports": {
".": {
"source": "./src/index.ts",
"types": "./lib/typescript/src/index.d.ts",
"default": "./lib/module/index.js"
},
"./package.json": "./package.json"
},
"files": [
"src",
"lib",
Expand Down Expand Up @@ -59,12 +64,12 @@
},
"devDependencies": {
"@tsconfig/node18": "^18.2.4",
"react-native-builder-bob": "^0.36.0",
"react-native-builder-bob": "^0.40.13",
"typescript": "^5.7.3"
},
"peerDependencies": {
"react": "*",
"react-native": "*"
"react-native": ">=0.79.0"
},
"jest": {
"preset": "react-native",
Expand All @@ -76,8 +81,12 @@
"source": "src",
"output": "lib",
"targets": [
"commonjs",
"module",
[
"module",
{
"esm": true
}
],
[
"typescript",
{
Expand Down
4 changes: 3 additions & 1 deletion packages/document-viewer/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

{
"extends": "../../tsconfig.build.json",
"compilerOptions": {
"rootDir": "."
}
}
Loading
Loading