Skip to content

Commit ad944f8

Browse files
krizzudependabot[bot]AsyncStorageBot
committed
sqlite-storage: scaffold workspace (#1071)
* chore(deps): bump follow-redirects from 1.15.4 to 1.15.6 (#1074) * feat(default-storage): Add Privacy Manifest for iOS (#1075) privacy file * chore(release): 1.23.0 [skip ci] * fix(default-storage): Privacy manifest missing key (#1076) add missing key * chore(release): 1.23.1 [skip ci] * chore(deps): bump webpack-dev-middleware from 5.3.3 to 5.3.4 (#1077) Bumps [webpack-dev-middleware](https://github.com/webpack/webpack-dev-middleware) from 5.3.3 to 5.3.4. - [Release notes](https://github.com/webpack/webpack-dev-middleware/releases) - [Changelog](https://github.com/webpack/webpack-dev-middleware/blob/v5.3.4/CHANGELOG.md) - [Commits](webpack/webpack-dev-middleware@v5.3.3...v5.3.4) --- updated-dependencies: - dependency-name: webpack-dev-middleware dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: GH workflows, turbo and other chores (#1073) * explicit prettierrc * turbo * format test * pull-request workflow * update actions * bump to yarn 4 * build script * init * examples * comments * fix glob * namespace * windows build * fixing windows action * android example search for node_modules --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: AsyncStorageBot <[email protected]>
1 parent d4a3eee commit ad944f8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+4424
-140
lines changed

.github/actions/setup-project/action.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,18 @@ inputs:
55
required: false
66
description: node version to install
77
default: 20.10.0 # is already cached in Ubuntu 22.04 runner
8+
windows-fix:
9+
required: false
10+
description: https://github.com/actions/setup-node/issues/899#issuecomment-1837381044
11+
default: "false"
812
runs:
913
using: composite
1014
steps:
15+
- uses: actions/setup-node@v4
16+
if: ${{ inputs.windows-fix == 'true' }}
17+
name: (Windows fix) Setup node without cache
18+
with:
19+
node-version: ${{ inputs.node-version }}
1120
- name: Enable corepack
1221
shell: bash
1322
run: |

.github/workflows/default-storage.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
token: ${{ secrets.GH_RELEASE_TOKEN }}
1919
filters: |
2020
storage:
21-
- 'packages/default-storage'
21+
- 'packages/default-storage/**'
2222
2323
android:
2424
name: Android
@@ -127,6 +127,8 @@ jobs:
127127
uses: actions/checkout@v4
128128
- name: Setup project
129129
uses: ./.github/actions/setup-project
130+
with:
131+
windows-fix: true
130132
- name: Install JS dependencies
131133
run: |
132134
yarn

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,4 @@ local.properties
3131
#workspaces
3232
/packages/*/lib
3333
.turbo
34+
build/

packages/default-storage/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"src/",
1919
"windows/"
2020
],
21-
"author": "Krzysztof Borowy <[email protected]>",
21+
"author": "Krzysztof Borowy <[email protected]>",
2222
"contributors": [
2323
"Evan Bacon <[email protected]> (https://github.com/evanbacon)",
2424
"Tommy Nguyen <[email protected]> (https://github.com/tido64)"

packages/default-storage/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "./tsconfig.build.json",
2+
"extends": "../../.config/tsconfig.base.json",
33
"compilerOptions": {
44
"noEmit": true,
55
"types": [
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.pbxproj -text
2+
# specific for windows script files
3+
*.bat text eol=crlf

packages/sqlite-storage/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Async Storage SQLite
2+
3+
Key-value persistent storage for React Native backed by SQLite.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
require "json"
2+
3+
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4+
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
5+
6+
Pod::Spec.new do |s|
7+
s.name = File.basename(__FILE__, '.podspec')
8+
s.version = package["version"]
9+
s.summary = package["description"]
10+
s.homepage = package["homepage"]
11+
s.license = package["license"]
12+
s.authors = package["author"]
13+
14+
s.platforms = { :ios => min_ios_version_supported }
15+
s.source = { :git => "https://github.com/react-native-async-storage/async-storage.git", :tag => "#{s.version}" }
16+
17+
s.source_files = "ios/**/*.{h,m,mm,swift}"
18+
19+
# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
20+
# See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
21+
if respond_to?(:install_modules_dependencies, true)
22+
install_modules_dependencies(s)
23+
else
24+
s.dependency "React-Core"
25+
26+
# Don't install the dependencies when we run `pod install` in the old architecture.
27+
if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
28+
s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
29+
s.pod_target_xcconfig = {
30+
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
31+
"OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
32+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
33+
}
34+
s.dependency "React-Codegen"
35+
s.dependency "RCT-Folly"
36+
s.dependency "RCTRequired"
37+
s.dependency "RCTTypeSafety"
38+
s.dependency "ReactCommon/turbomodule/core"
39+
end
40+
end
41+
end
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
buildscript {
2+
// Buildscript is evaluated before everything else so we can't use getExtOrDefault
3+
def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["SqliteStorage_kotlinVersion"]
4+
5+
repositories {
6+
google()
7+
mavenCentral()
8+
}
9+
10+
dependencies {
11+
classpath "com.android.tools.build:gradle:7.2.1"
12+
// noinspection DifferentKotlinGradleVersion
13+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
14+
}
15+
}
16+
17+
def isNewArchitectureEnabled() {
18+
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
19+
}
20+
21+
apply plugin: "com.android.library"
22+
apply plugin: "kotlin-android"
23+
24+
if (isNewArchitectureEnabled()) {
25+
apply plugin: "com.facebook.react"
26+
}
27+
28+
def getExtOrDefault(name) {
29+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["SqliteStorage_" + name]
30+
}
31+
32+
def getExtOrIntegerDefault(name) {
33+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["SqliteStorage_" + name]).toInteger()
34+
}
35+
36+
def supportsNamespace() {
37+
def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')
38+
def major = parsed[0].toInteger()
39+
def minor = parsed[1].toInteger()
40+
41+
// Namespace support was added in 7.3.0
42+
return (major == 7 && minor >= 3) || major >= 8
43+
}
44+
45+
android {
46+
if (supportsNamespace()) {
47+
namespace "org.rnasyncstorage.sqlitestorage"
48+
49+
sourceSets {
50+
main {
51+
manifest.srcFile "src/main/AndroidManifestNew.xml"
52+
}
53+
}
54+
}
55+
56+
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
57+
58+
defaultConfig {
59+
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
60+
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
61+
62+
}
63+
64+
buildTypes {
65+
release {
66+
minifyEnabled false
67+
}
68+
}
69+
70+
lintOptions {
71+
disable "GradleCompatible"
72+
}
73+
74+
compileOptions {
75+
sourceCompatibility JavaVersion.VERSION_1_8
76+
targetCompatibility JavaVersion.VERSION_1_8
77+
}
78+
}
79+
80+
repositories {
81+
mavenCentral()
82+
google()
83+
}
84+
85+
def kotlin_version = getExtOrDefault("kotlinVersion")
86+
87+
dependencies {
88+
// For < 0.71, this will be from the local maven repo
89+
// For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
90+
//noinspection GradleDynamicVersion
91+
implementation "com.facebook.react:react-native:+"
92+
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
93+
}
94+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
SqliteStorage_kotlinVersion=1.7.0
2+
SqliteStorage_minSdkVersion=21
3+
SqliteStorage_targetSdkVersion=31
4+
SqliteStorage_compileSdkVersion=31
5+
SqliteStorage_ndkversion=21.4.7075529

0 commit comments

Comments
 (0)