Skip to content

Commit 2b8a284

Browse files
authored
Merge pull request #15 from Vadko/24.02-expo-plugin-mimetypes-fix
fix: androidmanifest generate mimeTypes with expo plugin
2 parents 0299d59 + db8746d commit 2b8a284

5 files changed

Lines changed: 9 additions & 12 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
uses: ./.github/actions/setup
3434

3535
- name: Run unit tests
36-
run: yarn test --maxWorkers=2 --coverage
36+
run: yarn test --maxWorkers=2 --passWithNoTests --coverage
3737

3838
build-library:
3939
runs-on: ubuntu-latest

app.plugin.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
const { withFilePreviewTurbo } = require('./lib/commonjs/expo');
1+
const {
2+
withFilePreviewTurbo,
3+
} = require('./lib/commonjs/plugin/withFilePreviewTurbo');
24

35
module.exports = withFilePreviewTurbo;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-file-viewer-turbo",
3-
"version": "0.2.1",
3+
"version": "0.3.0",
44
"description": "Native file viewer for react-native - now with TurboModules support",
55
"source": "./src/index.tsx",
66
"main": "./lib/commonjs/index.js",

src/__tests__/index.test.tsx

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/expo.ts renamed to src/plugin/withFilePreviewTurbo.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,10 @@ export const withFilePreviewTurbo: Expo.ConfigPlugin<Props> = (
1414
const withAndroidManifest: Expo.ConfigPlugin<Props> = (config) =>
1515
Expo.withAndroidManifest(config, (config) => {
1616
config.modResults.manifest.queries.push({
17-
intent: [
18-
{
19-
action: [{ $: { 'android:name': 'android.intent.action.VIEW' } }],
20-
data: props.mimeTypes.map((mimeType) => ({
21-
$: { 'android:mimeType': mimeType },
22-
})),
23-
},
24-
],
17+
intent: props.mimeTypes.map((mimeType) => ({
18+
action: [{ $: { 'android:name': 'android.intent.action.VIEW' } }],
19+
data: [{ $: { 'android:mimeType': mimeType } }],
20+
})),
2521
});
2622

2723
return config;

0 commit comments

Comments
 (0)