Skip to content

Commit ef200b0

Browse files
authored
Fix sample app
1 parent cc43b3d commit ef200b0

File tree

13 files changed

+9711
-103
lines changed

13 files changed

+9711
-103
lines changed

example/.gitignore

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files
2+
3+
# dependencies
4+
node_modules/
5+
6+
# Expo
7+
.expo/
8+
dist/
9+
web-build/
10+
11+
# Native
12+
*.orig.*
13+
*.jks
14+
*.p8
15+
*.p12
16+
*.key
17+
*.mobileprovision
18+
19+
# Metro
20+
.metro-health-check*
21+
22+
# debug
23+
npm-debug.*
24+
yarn-debug.*
25+
yarn-error.*
26+
27+
# macOS
28+
.DS_Store
29+
*.pem
30+
31+
# local env files
32+
.env*.local
33+
34+
# typescript
35+
*.tsbuildinfo

example/App.js

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { StyleSheet, View } from 'react-native';
2-
import {AdvancedImage, upload} from 'cloudinary-react-native';
2+
import {AdvancedImage, AdvancedVideo} from 'cloudinary-react-native';
33
import {Cloudinary} from '@cloudinary/url-gen';
44
import {scale} from "@cloudinary/url-gen/actions/resize";
55
import {cartoonify} from "@cloudinary/url-gen/actions/effect";
66
import {max} from "@cloudinary/url-gen/actions/roundCorners";
77
import React, {useRef} from "react";
88
import { streamingProfile } from '@cloudinary/url-gen/actions/transcode';
9-
import AdvancedVideo from '../../src/AdvancedVideo';
109
import { Video } from 'expo-av';
10+
import { } from 'cloudinary-react-native';
1111

1212
const cld = new Cloudinary({
1313
cloud: {
@@ -33,8 +33,8 @@ export default function App() {
3333
return (
3434
<View style={styles.container}>
3535
<View>
36-
<AdvancedImage cldImg={createMyImage()} style={{backgroundColor:"black", width:300, height:200}}/>
37-
</View>
36+
<AdvancedImage cldImg={createMyImage()} style={{backgroundColor:"black", width:300, height:200}}/>
37+
</View>
3838
<View style={styles.videoContainer}>
3939
<AdvancedVideo
4040
ref={videoPlayer}

example/app.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@
1515
"**/*"
1616
],
1717
"ios": {
18-
"supportsTablet": true,
19-
"infoPlist": {
20-
"NSPhotoLibraryUsageDescription": "Allow access to photos"
21-
}
18+
"supportsTablet": true
2219
},
2320
"android": {
2421
"adaptiveIcon": {

example/assets/logo.png

-3.3 KB
Binary file not shown.

example/babel.config.js

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,6 @@
1-
const path = require('path');
2-
const pak = require('../package.json');
3-
4-
module.exports = function (api) {
1+
module.exports = function(api) {
52
api.cache(true);
6-
73
return {
84
presets: ['babel-preset-expo'],
9-
plugins: [
10-
[
11-
'module-resolver',
12-
{
13-
extensions: ['.tsx', '.ts', '.js', '.json'],
14-
alias: {
15-
// For development, we want to alias the library to the source
16-
[pak.name]: path.join(__dirname, '..', pak.source),
17-
},
18-
},
19-
],
20-
],
215
};
226
};

example/metro.config.js

Lines changed: 8 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,13 @@
1-
const path = require('path');
2-
const escape = require('escape-string-regexp');
3-
const { getDefaultConfig } = require('@expo/metro-config');
4-
const exclusionList = require('metro-config/src/defaults/exclusionList');
5-
const pak = require('../package.json');
6-
const root = path.resolve(__dirname, '..');
1+
// Learn more https://docs.expo.io/guides/customizing-metro
2+
const { getDefaultConfig } = require('expo/metro-config');
73

8-
const modules = Object.keys({
9-
...pak.peerDependencies,
10-
});
4+
/** @type {import('expo/metro-config').MetroConfig} */
5+
const config = getDefaultConfig(__dirname);
116

12-
const defaultConfig = getDefaultConfig(__dirname);
7+
const packagePath = "../";
138

14-
module.exports = {
15-
...defaultConfig,
9+
config.resolver.nodeModulesPaths.push(packagePath);
1610

17-
projectRoot: __dirname,
18-
watchFolders: [root],
11+
config.watchFolders.push(packagePath);
1912

20-
// We need to make sure that only one version is loaded for peerDependencies
21-
// So we block them at the root, and alias them to the versions in example's node_modules
22-
resolver: {
23-
...defaultConfig.resolver,
24-
25-
blacklistRE: exclusionList(
26-
modules.map(
27-
(m) =>
28-
new RegExp(`^${escape(path.join(root, 'node_modules', m))}\\/.*$`)
29-
)
30-
),
31-
32-
extraNodeModules: modules.reduce((acc, name) => {
33-
acc[name] = path.join(__dirname, 'node_modules', name);
34-
return acc;
35-
}, {}),
36-
},
37-
};
13+
module.exports = config;

example/package.json

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,26 @@
99
"web": "expo start --web"
1010
},
1111
"dependencies": {
12-
"expo": "~48.0.15",
13-
"expo-asset": "^8.10.1",
14-
"expo-file-system": "~15.2.2",
15-
"expo-status-bar": "~1.4.4",
12+
"@expo/config": "~8.5.0",
13+
"@expo/metro-config": "~0.17.1",
14+
"cloudinary-react-native": "../",
15+
"expo": "~50.0.17",
16+
"expo-status-bar": "~1.11.1",
1617
"react": "18.2.0",
17-
"react-dom": "18.2.0",
18-
"react-native": "0.71.8",
19-
"react-native-blob-util": "^0.18.3",
20-
"react-native-sha1": "^1.2.3",
21-
"react-native-sha256": "^1.4.9",
22-
"react-native-web": "~0.18.10"
18+
"react-native": "0.73.6"
2319
},
2420
"devDependencies": {
2521
"@babel/core": "^7.20.0",
26-
"@expo/webpack-config": "^18.0.1",
27-
"babel-loader": "^8.1.0",
28-
"babel-plugin-module-resolver": "^4.1.0"
22+
"@types/react": "~18.2.45",
23+
"typescript": "^5.3.0"
2924
},
30-
"private": true
31-
}
25+
"expo": {
26+
"autolinking": {
27+
"nativeModulesDir": "../../packages"
28+
}
29+
},
30+
"private": true,
31+
"localDependencies": {
32+
"cloudinary-react-native": ".."
33+
}
34+
}

example/src/index.d.ts

Lines changed: 0 additions & 2 deletions
This file was deleted.

example/tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"extends": "../tsconfig",
2+
"extends": "expo/tsconfig.base",
33
"compilerOptions": {
4-
// Avoid expo-cli auto-generating a tsconfig
4+
"strict": true
55
}
66
}

0 commit comments

Comments
 (0)