Skip to content

Commit 92cf918

Browse files
authored
chore: Bump dependencies + update example setup (#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 91b0e16 commit 92cf918

File tree

35 files changed

+3349
-3644
lines changed

35 files changed

+3349
-3644
lines changed

.changeset/config.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"@react-native-async-storage/eslint-config",
1212
"async-storage-website",
1313
"@react-native-async-storage/api",
14-
"@react-native-async-storage/sqlite-storage"
14+
"@react-native-async-storage/sqlite-storage",
15+
"react-native-example-sqlitestorage"
1516
]
1617
}

.github/workflows/default-storage.yml

+9-9
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
- name: Build e2e binary
4040
run: |
4141
yarn build:e2e:android
42-
working-directory: packages/default-storage
42+
working-directory: packages/default-storage/example
4343

4444
ios:
4545
name: iOS
@@ -63,15 +63,15 @@ jobs:
6363
- name: Bundle JS
6464
run: |
6565
yarn bundle:ios
66-
working-directory: packages/default-storage
66+
working-directory: packages/default-storage/example
6767
- name: Install Pods
6868
run: |
6969
RCT_NEW_ARCH_ENABLED=1 pod install
7070
working-directory: packages/default-storage/example/ios
7171
- name: Build e2e binary
7272
run: |
7373
yarn build:e2e:ios
74-
working-directory: packages/default-storage
74+
working-directory: packages/default-storage/example
7575

7676
macos:
7777
name: macOS
@@ -95,20 +95,20 @@ jobs:
9595
- name: Bundle JS
9696
run: |
9797
yarn bundle:macos
98-
working-directory: packages/default-storage
98+
working-directory: packages/default-storage/example
9999
- name: Install Pods
100100
run: |
101101
RCT_NEW_ARCH_ENABLED=1 pod install
102102
working-directory: packages/default-storage/example/macos
103103
- name: Build
104104
run: |
105105
yarn build:e2e:macos
106-
working-directory: packages/default-storage
106+
working-directory: packages/default-storage/example
107107
- name: Test
108108
if: false
109109
run: |
110110
yarn test:e2e:macos
111-
working-directory: packages/default-storage
111+
working-directory: packages/default-storage/example
112112

113113
windows:
114114
name: Windows
@@ -131,9 +131,9 @@ jobs:
131131
yarn
132132
- name: Install Windows test app
133133
run: |
134-
yarn install-windows-test-app -p example/windows
135-
working-directory: packages/default-storage
134+
yarn install-windows-test-app -p windows
135+
working-directory: packages/default-storage/example
136136
- name: Build
137137
run: |
138138
yarn react-native run-windows --release --arch x64 --logging --no-packager --no-launch --no-deploy --msbuildprops "BundleEntryFile=index.ts,UseBundle=false" --no-telemetry
139-
working-directory: packages/default-storage
139+
working-directory: packages/default-storage/example

package.json

+20-18
Original file line numberDiff line numberDiff line change
@@ -21,32 +21,34 @@
2121
"turbo": "^1.12.5",
2222
"typescript": "^5.3.0"
2323
},
24+
"resolutions": {
25+
"@react-native-mac/virtualized-lists": "^0.76.0",
26+
"@react-native-community/cli": "^15.0.0",
27+
"@react-native-community/cli-platform-android": "^15.0.0",
28+
"@react-native-community/cli-platform-ios": "^15.0.0",
29+
"@react-native/assets-registry": "^0.76.0",
30+
"@react-native/babel-plugin-codegen": "^0.76.0",
31+
"@react-native/babel-preset": "^0.76.0",
32+
"@react-native/codegen": "^0.76.0",
33+
"@react-native/community-cli-plugin": "^0.76.0",
34+
"@react-native/community-cli-plugin/@react-native-community/cli-server-api": "^15.0.0",
35+
"@react-native/community-cli-plugin/@react-native-community/cli-tools": "^15.0.0",
36+
"@react-native/gradle-plugin": "^0.76.0",
37+
"@react-native/js-polyfills": "^0.76.0",
38+
"@react-native/normalize-colors": "^0.76.0",
39+
"@react-native/virtualized-lists": "^0.76.0"
40+
},
2441
"engines": {
2542
"node": "v20.11.1"
2643
},
2744
"packageManager": "[email protected]",
28-
"resolutions": {
29-
"@react-native-community/cli": "^14.0.0",
30-
"@react-native-community/cli-platform-android": "^14.0.0",
31-
"@react-native-community/cli-platform-ios": "^14.0.0",
32-
"@react-native/assets-registry": "^0.75.0",
33-
"@react-native/babel-plugin-codegen": "^0.75.0",
34-
"@react-native/babel-preset": "^0.75.0",
35-
"@react-native/codegen": "^0.75.0",
36-
"@react-native/community-cli-plugin": "^0.75.0",
37-
"@react-native/community-cli-plugin/@react-native-community/cli-server-api": "^14.0.0",
38-
"@react-native/community-cli-plugin/@react-native-community/cli-tools": "^14.0.0",
39-
"@react-native/gradle-plugin": "^0.75.0",
40-
"@react-native/js-polyfills": "^0.75.0",
41-
"@react-native/normalize-colors": "^0.75.0",
42-
"@react-native/virtualized-lists": "^0.75.0",
43-
"find-babel-config/json5": "^2.1.1"
44-
},
4545
"workspaces": [
4646
"packages/api",
4747
"packages/default-storage",
48-
"packages/eslint-config",
48+
"packages/default-storage/example",
4949
"packages/sqlite-storage",
50+
"packages/sqlite-storage/example",
51+
"packages/eslint-config",
5052
"packages/website"
5153
]
5254
}

packages/default-storage/example/.gitignore

+1
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/

packages/default-storage/example/android/gradle/wrapper/gradle-wrapper.properties

+1-1
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

packages/default-storage/example/app.json

+6-4
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
}
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+
);

packages/default-storage/example/ios/AsyncStorageExample.xcworkspace/contents.xcworkspacedata

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/default-storage/example/macos/AsyncStorageExample.xcworkspace/contents.xcworkspacedata

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/default-storage/metro.config.js renamed to packages/default-storage/example/metro.config.js

+6-3
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: {
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+
}
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+
};

packages/default-storage/scripts/android_e2e.sh renamed to packages/default-storage/example/scripts/android_e2e.sh

+3-3
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

packages/default-storage/scripts/ios_e2e.sh renamed to packages/default-storage/example/scripts/ios_e2e.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@
33
build_project() {
44
echo "[iOS E2E] Building iOS project"
55
eval "xcodebuild \
6-
-workspace example/ios/AsyncStorageExample.xcworkspace \
6+
-workspace ios/AsyncStorageExample.xcworkspace \
77
-scheme ReactTestApp \
88
-configuration Release \
99
-sdk iphonesimulator \
10-
-derivedDataPath example/ios/build"
10+
-derivedDataPath ios/build"
1111
}
1212

1313
bundle_js() {
1414
extraArgs="$@"
1515
echo
1616
echo "[iOS E2E] Bundling JS"
17-
react-native bundle --entry-file index.ts --platform ios --bundle-output example/index.ios.jsbundle --dev false $extraArgs
17+
react-native bundle --entry-file index.ts --platform ios --bundle-output main.ios.bundle --dev false $extraArgs
1818
}
1919

2020
run_e2e_test() {
2121
echo "[iOS E2E] Running tests"
22-
wdio run example/__tests__/ios.conf.ts
22+
wdio run __tests__/ios.conf.ts
2323
}
2424

2525

packages/default-storage/scripts/macos_e2e.sh renamed to packages/default-storage/example/scripts/macos_e2e.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ fi
2626
defaults write com.microsoft.ReactTestApp "NSWindow Frame MainWindow" "0 0 800 500 0 0 2560 1417 "
2727

2828
xcodebuild \
29-
-workspace example/macos/AsyncStorageExample.xcworkspace \
29+
-workspace macos/AsyncStorageExample.xcworkspace \
3030
-scheme ReactTestApp \
3131
-configuration Release \
3232
-sdk macosx \
33-
-derivedDataPath example/macos/build \
33+
-derivedDataPath macos/build \
3434
$BUILD_ACTIONS
3535

3636
if [[ "$CCACHE_DISABLE" != "1" ]]; then

0 commit comments

Comments
 (0)