Skip to content

Commit 38cdbda

Browse files
authored
chore: Bump dependencies + update example setup (react-native-async-storage#1164)
* bump deps + example move * sqlite-example * format * github actions update * example * fix windows * ignore * fixes * dedupe * scripts * metro config * more metro fixes * yarn lock * bring back metro config
1 parent 79e6d4a commit 38cdbda

File tree

18 files changed

+293
-214
lines changed

18 files changed

+293
-214
lines changed

example/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ buck-out/
5252

5353
# Bundle artifact
5454
*.jsbundle
55+
*.bundle
5556

5657
# CocoaPods
5758
/ios/Pods/

example/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

example/app.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33
"displayName": "AsyncStorageExample",
44
"components": [
55
{
6-
"appKey": "AsyncStorageExample"
6+
"appKey": "AsyncStorageExample",
7+
"displayName": "AsyncStorageExample"
78
}
89
],
910
"resources": {
10-
"android": ["index.android.jsbundle"],
11-
"ios": ["index.ios.jsbundle"],
12-
"macos": ["index.macos.jsbundle"]
11+
"android": ["main.android.bundle"],
12+
"ios": ["main.ios.bundle"],
13+
"macos": ["main.macos.bundle"],
14+
"windows": ["main.windows.bundle"]
1315
}
1416
}

example/babel.config.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1-
module.exports = {
2-
presets: ["module:@react-native/babel-preset"],
3-
};
1+
const path = require("path");
2+
const { getConfig } = require("react-native-builder-bob/babel-config");
3+
const pkg = require("../package.json");
4+
5+
const root = path.resolve(__dirname, "..");
6+
7+
module.exports = getConfig(
8+
{
9+
presets: ["module:@react-native/babel-preset"],
10+
},
11+
{ root, pkg }
12+
);

example/ios/AsyncStorageExample.xcworkspace/contents.xcworkspacedata

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/macos/AsyncStorageExample.xcworkspace/contents.xcworkspacedata

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

metro.config.js renamed to example/metro.config.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@ const { makeMetroConfig } = require("@rnx-kit/metro-config");
22
const path = require("node:path");
33

44
module.exports = makeMetroConfig({
5-
projectRoot: path.join(__dirname, "example"),
6-
watchFolders: [__dirname],
5+
projectRoot: __dirname,
6+
watchFolders: [__dirname, path.resolve(__dirname, "..")],
77
resolver: {
88
extraNodeModules: {
9-
"@react-native-async-storage/async-storage": __dirname,
9+
"@react-native-async-storage/async-storage": path.resolve(
10+
__dirname,
11+
".."
12+
),
1013
},
1114
},
1215
transformer: {

example/package.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"name": "example-defaultstorage",
3+
"version": "0.0.1",
4+
"private": true,
5+
"scripts": {
6+
"start": "react-native start",
7+
"start:android": "react-native run-android",
8+
"start:ios": "react-native run-ios",
9+
"start:macos": "react-native run-macos --project-path macos --scheme AsyncStorageExample",
10+
"start:web": "expo start --web",
11+
"start:windows": "install-windows-test-app -p windows && react-native run-windows --logging --no-packager --no-telemetry",
12+
"start:windows:fabric": "install-windows-test-app -p windows --use-fabric && react-native run-windows --logging --no-packager --no-telemetry",
13+
"build:e2e:android": "scripts/android_e2e.sh 'build'",
14+
"build:e2e:ios": "scripts/ios_e2e.sh 'build'",
15+
"build:e2e:macos": "scripts/macos_e2e.sh 'build'",
16+
"bundle:android": "scripts/android_e2e.sh 'bundle'",
17+
"bundle:ios": "scripts/ios_e2e.sh 'bundle'",
18+
"bundle:macos": "react-native bundle --entry-file index.ts --platform macos --dev false --bundle-output main.macos.bundle",
19+
"test:e2e:android": "scripts/android_e2e.sh 'test'",
20+
"test:e2e:ios": "scripts/ios_e2e.sh 'test'",
21+
"test:e2e:macos": "scripts/macos_e2e.sh 'test'"
22+
},
23+
"installConfig": {
24+
"hoistingLimits": "workspaces"
25+
},
26+
"dependencies": {
27+
"react": "18.3.1",
28+
"react-native": "0.76.1"
29+
},
30+
"devDependencies": {
31+
"@babel/core": "^7.25.2",
32+
"@babel/preset-env": "^7.25.3",
33+
"@babel/runtime": "^7.25.0",
34+
"@react-native-community/cli": "^15.0.0",
35+
"@react-native-community/cli-platform-android": "^15.0.0",
36+
"@react-native-community/cli-platform-ios": "^15.0.0",
37+
"@react-native/babel-preset": "^0.76.0",
38+
"@react-native/metro-config": "^0.76.0",
39+
"@rnx-kit/metro-config": "^2.0.1",
40+
"react-native-builder-bob": "^0.33.3",
41+
"react-native-macos": "^0.76.0",
42+
"react-native-test-app": "^4.0.3",
43+
"react-native-windows": "^0.76.0"
44+
}
45+
}

example/react-native.config.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
const path = require("path");
2+
const pkg = require("../package.json");
3+
const { configureProjects } = require("react-native-test-app");
4+
5+
module.exports = {
6+
project: configureProjects({
7+
android: {
8+
sourceDir: "android",
9+
},
10+
ios: {
11+
sourceDir: "ios",
12+
automaticPodsInstallation: true,
13+
},
14+
macos: {
15+
sourceDir: "macos",
16+
},
17+
windows: {
18+
sourceDir: "windows",
19+
solutionFile: path.join("windows", "AsyncStorageExample.sln"),
20+
},
21+
}),
22+
dependencies: {
23+
[pkg.name]: {
24+
root: path.join(__dirname, ".."),
25+
},
26+
},
27+
};

scripts/android_e2e.sh renamed to example/scripts/android_e2e.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@
33
build_apk() {
44
echo
55
echo "[Android E2E] Building APK"
6-
(cd example/android; ./gradlew assembleRelease -PAsyncStorage_useNextStorage=false --max-workers 2)
6+
(cd android; ./gradlew assembleRelease -PAsyncStorage_useNextStorage=false --max-workers 2)
77
}
88

99
bundle_js() {
1010
extraArgs="$@"
1111
echo
1212
echo "[Android E2E] Bundling JS"
13-
react-native bundle --entry-file index.ts --platform android --bundle-output example/index.android.jsbundle --dev false $extraArgs
13+
react-native bundle --entry-file index.ts --platform android --bundle-output main.android.bundle --dev false $extraArgs
1414
}
1515

1616

1717
run_e2e_test() {
1818
echo "[Android E2E] Running tests"
19-
wdio run example/__tests__/android.conf.ts
19+
wdio run __tests__/android.conf.ts
2020
}
2121

2222
case $1 in

0 commit comments

Comments
 (0)