Skip to content

Commit 6cbfc54

Browse files
committed
bump deps + example move
1 parent 91b0e16 commit 6cbfc54

File tree

16 files changed

+3507
-665
lines changed

16 files changed

+3507
-665
lines changed

package.json

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,30 +21,17 @@
2121
"turbo": "^1.12.5",
2222
"typescript": "^5.3.0"
2323
},
24+
"resolutions": {
25+
"@react-native-mac/virtualized-lists": "0.76.0"
26+
},
2427
"engines": {
2528
"node": "v20.11.1"
2629
},
2730
"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-
},
4531
"workspaces": [
4632
"packages/api",
4733
"packages/default-storage",
34+
"packages/default-storage/example",
4835
"packages/eslint-config",
4936
"packages/sqlite-storage",
5037
"packages/website"

packages/default-storage/example/app.json

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,22 @@
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": [
12+
"index.android.jsbundle"
13+
],
14+
"ios": [
15+
"index.ios.jsbundle"
16+
],
17+
"macos": [
18+
"index.macos.jsbundle"
19+
],
20+
"windows": [
21+
"main.windows.bundle"
22+
]
1323
}
1424
}
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+
);

packages/default-storage/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.

packages/default-storage/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.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
const path = require('path');
2+
const { getDefaultConfig } = require('@react-native/metro-config');
3+
const { getConfig } = require('react-native-builder-bob/metro-config');
4+
const pkg = require('../package.json');
5+
6+
const root = path.resolve(__dirname, '..');
7+
8+
/**
9+
* Metro configuration
10+
* https://facebook.github.io/metro/docs/configuration
11+
*
12+
* @type {import('metro-config').MetroConfig}
13+
*/
14+
module.exports = getConfig(getDefaultConfig(__dirname), {
15+
root,
16+
pkg,
17+
project: __dirname,
18+
});
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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.js --platform macos --dev false --bundle-output index.macos.jsbundle",
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.1",
38+
"@react-native/metro-config": "0.76.1",
39+
"@react-native/typescript-config": "0.76.1",
40+
"@rnx-kit/metro-config": "^2.0.0",
41+
"react-native-builder-bob": "^0.33.3",
42+
"react-native-test-app": "^4.0.3"
43+
}
44+
}
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+
};

packages/default-storage/scripts/android_e2e.sh renamed to packages/default-storage/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 index.android.jsbundle --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

Lines changed: 4 additions & 4 deletions
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 index.ios.jsbundle --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

Lines changed: 2 additions & 2 deletions
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

packages/default-storage/metro.config.js

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

packages/default-storage/package.json

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"Evan Bacon <[email protected]> (https://github.com/evanbacon)",
2424
"Tommy Nguyen <[email protected]> (https://github.com/tido64)"
2525
],
26+
"source": "src/index",
2627
"homepage": "https://github.com/react-native-async-storage/async-storage#readme",
2728
"license": "MIT",
2829
"keywords": [
@@ -40,25 +41,9 @@
4041
"scripts": {
4142
"prepack": "yarn build",
4243
"build": "bob build",
43-
"start": "react-native start",
44-
"start:android": "react-native run-android",
45-
"start:ios": "react-native run-ios",
46-
"start:macos": "react-native run-macos --project-path example/macos --scheme AsyncStorageExample",
47-
"start:web": "expo start --web",
48-
"start:windows": "install-windows-test-app -p example/windows && react-native run-windows --root example --logging --no-packager --no-telemetry",
49-
"start:windows:fabric": "install-windows-test-app -p example/windows --use-fabric && react-native run-windows --root example --logging --no-packager --no-telemetry",
50-
"build:e2e:android": "scripts/android_e2e.sh 'build'",
51-
"build:e2e:ios": "scripts/ios_e2e.sh 'build'",
52-
"build:e2e:macos": "scripts/macos_e2e.sh 'build'",
53-
"bundle:android": "scripts/android_e2e.sh 'bundle'",
54-
"bundle:ios": "scripts/ios_e2e.sh 'bundle'",
55-
"bundle:macos": "react-native bundle --entry-file index.ts --platform macos --dev false --bundle-output example/index.macos.jsbundle",
56-
"test": "concurrently -n lint,ts yarn:test:lint yarn:test:ts",
44+
"start": "(cd example && react-native start)",
5745
"test:lint": "eslint $(git ls-files '*.js' '*.ts' '*.tsx')",
58-
"test:ts": "tsc",
59-
"test:e2e:android": "scripts/android_e2e.sh 'test'",
60-
"test:e2e:ios": "scripts/ios_e2e.sh 'test'",
61-
"test:e2e:macos": "scripts/macos_e2e.sh 'test'"
46+
"test:ts": "tsc"
6247
},
6348
"installConfig": {
6449
"hoistingLimits": "workspaces"
@@ -92,14 +77,13 @@
9277
"expo": "^48.0.0",
9378
"lodash": "^4.17.21",
9479
"prettier": "2.8.8",
95-
"react": "^18.2.0",
96-
"react-dom": "^18.2.0",
97-
"react-native": "^0.75.0",
98-
"react-native-builder-bob": "^0.18.0",
99-
"react-native-macos": "^0.75.0",
100-
"react-native-test-app": "^3.9.2",
80+
"react": "^18.3.1",
81+
"react-dom": "^18.3.1",
82+
"react-native": "^0.76.2",
83+
"react-native-builder-bob": "^0.33.3",
84+
"react-native-macos": "^0.76.2",
10185
"react-native-web": "~0.18.10",
102-
"react-native-windows": "^0.75.0",
86+
"react-native-windows": "^0.76.2",
10387
"react-test-renderer": "^18.2.0",
10488
"typescript": "^5.3.0",
10589
"webdriverio": "^8.24.0"
Lines changed: 4 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,4 @@
1-
const project = (() => {
2-
const path = require("path");
3-
try {
4-
const { configureProjects } = require("react-native-test-app");
5-
return configureProjects({
6-
android: {
7-
sourceDir: path.join("example", "android"),
8-
},
9-
ios: {
10-
sourceDir: path.join("example", "ios"),
11-
},
12-
macos: {
13-
sourceDir: path.join("example", "macos"),
14-
},
15-
windows: {
16-
sourceDir: path.join("example", "windows"),
17-
solutionFile: path.join(
18-
"example",
19-
"windows",
20-
"AsyncStorageExample.sln"
21-
),
22-
},
23-
});
24-
} catch (_) {
25-
return undefined;
26-
}
27-
})();
28-
29-
module.exports = {
30-
dependencies: {
31-
"@react-native-async-storage/async-storage": {
32-
root: __dirname,
33-
// rn-cli incorrectly resolves node_modules path for the following platforms
34-
platforms: {
35-
ios: null,
36-
macos: null,
37-
},
38-
},
39-
// We don't use Expo in our test apps
40-
expo: {
41-
platforms: {
42-
android: null,
43-
ios: null,
44-
macos: null,
45-
windows: null,
46-
},
47-
},
48-
// Suppress warnings about bob not being a proper native module
49-
"react-native-builder-bob": {
50-
platforms: {
51-
android: null,
52-
ios: null,
53-
macos: null,
54-
windows: null,
55-
},
56-
},
57-
},
58-
...(project ? { project } : undefined),
59-
};
1+
/**
2+
* @type {import('@react-native-community/cli-types').UserDependencyConfig}
3+
*/
4+
module.exports = {};

0 commit comments

Comments
 (0)