Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Bump dependencies + update example setup #1164

Merged
merged 14 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"@react-native-async-storage/eslint-config",
"async-storage-website",
"@react-native-async-storage/api",
"@react-native-async-storage/sqlite-storage"
"@react-native-async-storage/sqlite-storage",
"react-native-example-sqlitestorage"
]
}
18 changes: 9 additions & 9 deletions .github/workflows/default-storage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: Build e2e binary
run: |
yarn build:e2e:android
working-directory: packages/default-storage
working-directory: packages/default-storage/example

ios:
name: iOS
Expand All @@ -63,15 +63,15 @@ jobs:
- name: Bundle JS
run: |
yarn bundle:ios
working-directory: packages/default-storage
working-directory: packages/default-storage/example
- name: Install Pods
run: |
RCT_NEW_ARCH_ENABLED=1 pod install
working-directory: packages/default-storage/example/ios
- name: Build e2e binary
run: |
yarn build:e2e:ios
working-directory: packages/default-storage
working-directory: packages/default-storage/example

macos:
name: macOS
Expand All @@ -95,20 +95,20 @@ jobs:
- name: Bundle JS
run: |
yarn bundle:macos
working-directory: packages/default-storage
working-directory: packages/default-storage/example
- name: Install Pods
run: |
RCT_NEW_ARCH_ENABLED=1 pod install
working-directory: packages/default-storage/example/macos
- name: Build
run: |
yarn build:e2e:macos
working-directory: packages/default-storage
working-directory: packages/default-storage/example
- name: Test
if: false
run: |
yarn test:e2e:macos
working-directory: packages/default-storage
working-directory: packages/default-storage/example

windows:
name: Windows
Expand All @@ -131,9 +131,9 @@ jobs:
yarn
- name: Install Windows test app
run: |
yarn install-windows-test-app -p example/windows
working-directory: packages/default-storage
yarn install-windows-test-app -p windows
working-directory: packages/default-storage/example
- name: Build
run: |
yarn react-native run-windows --release --arch x64 --logging --no-packager --no-launch --no-deploy --msbuildprops "BundleEntryFile=index.ts,UseBundle=false" --no-telemetry
working-directory: packages/default-storage
working-directory: packages/default-storage/example
24 changes: 6 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,20 @@
"turbo": "^1.12.5",
"typescript": "^5.3.0"
},
"resolutions": {
"@react-native-mac/virtualized-lists": "0.76.0"
},
"engines": {
"node": "v20.11.1"
},
"packageManager": "yarn@4.2.2",
"resolutions": {
"@react-native-community/cli": "^14.0.0",
"@react-native-community/cli-platform-android": "^14.0.0",
"@react-native-community/cli-platform-ios": "^14.0.0",
"@react-native/assets-registry": "^0.75.0",
"@react-native/babel-plugin-codegen": "^0.75.0",
"@react-native/babel-preset": "^0.75.0",
"@react-native/codegen": "^0.75.0",
"@react-native/community-cli-plugin": "^0.75.0",
"@react-native/community-cli-plugin/@react-native-community/cli-server-api": "^14.0.0",
"@react-native/community-cli-plugin/@react-native-community/cli-tools": "^14.0.0",
"@react-native/gradle-plugin": "^0.75.0",
"@react-native/js-polyfills": "^0.75.0",
"@react-native/normalize-colors": "^0.75.0",
"@react-native/virtualized-lists": "^0.75.0",
krizzu marked this conversation as resolved.
Show resolved Hide resolved
"find-babel-config/json5": "^2.1.1"
},
"workspaces": [
"packages/api",
"packages/default-storage",
"packages/eslint-config",
"packages/default-storage/example",
"packages/sqlite-storage",
"packages/sqlite-storage/example",
"packages/eslint-config",
"packages/website"
]
}
6 changes: 4 additions & 2 deletions packages/default-storage/example/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
"displayName": "AsyncStorageExample",
"components": [
{
"appKey": "AsyncStorageExample"
"appKey": "AsyncStorageExample",
"displayName": "AsyncStorageExample"
}
],
"resources": {
"android": ["index.android.jsbundle"],
"ios": ["index.ios.jsbundle"],
"macos": ["index.macos.jsbundle"]
"macos": ["index.macos.jsbundle"],
"windows": ["main.windows.bundle"]
tido64 marked this conversation as resolved.
Show resolved Hide resolved
}
}
15 changes: 12 additions & 3 deletions packages/default-storage/example/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
module.exports = {
presets: ["module:@react-native/babel-preset"],
};
const path = require("path");
const { getConfig } = require("react-native-builder-bob/babel-config");
const pkg = require("../package.json");

const root = path.resolve(__dirname, "..");

module.exports = getConfig(
{
presets: ["module:@react-native/babel-preset"],
},
{ root, pkg }
);

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions packages/default-storage/example/metro.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const path = require("path");
const { getDefaultConfig } = require("@react-native/metro-config");
const { getConfig } = require("react-native-builder-bob/metro-config");
const pkg = require("../package.json");

const root = path.resolve(__dirname, "..");

/**
* Metro configuration
* https://facebook.github.io/metro/docs/configuration
*
* @type {import('metro-config').MetroConfig}
*/
module.exports = getConfig(getDefaultConfig(__dirname), {
root,
pkg,
project: __dirname,
});
krizzu marked this conversation as resolved.
Show resolved Hide resolved
44 changes: 44 additions & 0 deletions packages/default-storage/example/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"name": "example-defaultstorage",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "react-native start",
"start:android": "react-native run-android",
"start:ios": "react-native run-ios",
"start:macos": "react-native run-macos --project-path macos --scheme AsyncStorageExample",
"start:web": "expo start --web",
"start:windows": "install-windows-test-app -p windows && react-native run-windows --logging --no-packager --no-telemetry",
"start:windows:fabric": "install-windows-test-app -p windows --use-fabric && react-native run-windows --logging --no-packager --no-telemetry",
"build:e2e:android": "scripts/android_e2e.sh 'build'",
"build:e2e:ios": "scripts/ios_e2e.sh 'build'",
"build:e2e:macos": "scripts/macos_e2e.sh 'build'",
"bundle:android": "scripts/android_e2e.sh 'bundle'",
"bundle:ios": "scripts/ios_e2e.sh 'bundle'",
"bundle:macos": "react-native bundle --entry-file index.ts --platform macos --dev false --bundle-output index.macos.jsbundle",
"test:e2e:android": "scripts/android_e2e.sh 'test'",
"test:e2e:ios": "scripts/ios_e2e.sh 'test'",
"test:e2e:macos": "scripts/macos_e2e.sh 'test'"
},
"installConfig": {
"hoistingLimits": "workspaces"
},
"dependencies": {
"react": "18.3.1",
"react-native": "0.76.1"
},
"devDependencies": {
"@babel/core": "^7.25.2",
"@babel/preset-env": "^7.25.3",
"@babel/runtime": "^7.25.0",
"@react-native-community/cli": "15.0.0",
"@react-native-community/cli-platform-android": "15.0.0",
"@react-native-community/cli-platform-ios": "15.0.0",
"@react-native/babel-preset": "0.76.2",
"@react-native/metro-config": "0.76.2",
"react-native-builder-bob": "^0.33.3",
"react-native-macos": "^0.76.2",
"react-native-test-app": "^4.0.3",
"react-native-windows": "^0.76.2"
}
}
27 changes: 27 additions & 0 deletions packages/default-storage/example/react-native.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
const path = require("path");
const pkg = require("../package.json");
const { configureProjects } = require("react-native-test-app");

module.exports = {
project: configureProjects({
android: {
sourceDir: "android",
},
ios: {
sourceDir: "ios",
automaticPodsInstallation: true,
},
macos: {
sourceDir: "macos",
},
windows: {
sourceDir: "windows",
solutionFile: path.join("windows", "AsyncStorageExample.sln"),
},
}),
dependencies: {
[pkg.name]: {
root: path.join(__dirname, ".."),
},
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
build_apk() {
echo
echo "[Android E2E] Building APK"
(cd example/android; ./gradlew assembleRelease -PAsyncStorage_useNextStorage=false --max-workers 2)
(cd android; ./gradlew assembleRelease -PAsyncStorage_useNextStorage=false --max-workers 2)
}

bundle_js() {
extraArgs="$@"
echo
echo "[Android E2E] Bundling JS"
react-native bundle --entry-file index.ts --platform android --bundle-output example/index.android.jsbundle --dev false $extraArgs
react-native bundle --entry-file index.ts --platform android --bundle-output index.android.jsbundle --dev false $extraArgs
}


run_e2e_test() {
echo "[Android E2E] Running tests"
wdio run example/__tests__/android.conf.ts
wdio run __tests__/android.conf.ts
}

case $1 in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@
build_project() {
echo "[iOS E2E] Building iOS project"
eval "xcodebuild \
-workspace example/ios/AsyncStorageExample.xcworkspace \
-workspace ios/AsyncStorageExample.xcworkspace \
-scheme ReactTestApp \
-configuration Release \
-sdk iphonesimulator \
-derivedDataPath example/ios/build"
-derivedDataPath ios/build"
}

bundle_js() {
extraArgs="$@"
echo
echo "[iOS E2E] Bundling JS"
react-native bundle --entry-file index.ts --platform ios --bundle-output example/index.ios.jsbundle --dev false $extraArgs
react-native bundle --entry-file index.ts --platform ios --bundle-output index.ios.jsbundle --dev false $extraArgs
}

run_e2e_test() {
echo "[iOS E2E] Running tests"
wdio run example/__tests__/ios.conf.ts
wdio run __tests__/ios.conf.ts
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ fi
defaults write com.microsoft.ReactTestApp "NSWindow Frame MainWindow" "0 0 800 500 0 0 2560 1417 "

xcodebuild \
-workspace example/macos/AsyncStorageExample.xcworkspace \
-workspace macos/AsyncStorageExample.xcworkspace \
-scheme ReactTestApp \
-configuration Release \
-sdk macosx \
-derivedDataPath example/macos/build \
-derivedDataPath macos/build \
$BUILD_ACTIONS

if [[ "$CCACHE_DISABLE" != "1" ]]; then
Expand Down
20 changes: 0 additions & 20 deletions packages/default-storage/metro.config.js

This file was deleted.

Loading
Loading