Skip to content

Commit 5a16094

Browse files
committed
init
1 parent afabc99 commit 5a16094

File tree

74 files changed

+3475
-16
lines changed

Some content is hidden

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

74 files changed

+3475
-16
lines changed

packages/default-storage/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"src/",
1919
"windows/"
2020
],
21-
"author": "Krzysztof Borowy <hello@krizzu.dev>",
21+
"author": "Krzysztof Borowy <contact@kborowy.com>",
2222
"contributors": [
2323
"Evan Bacon <bacon@expo.io> (https://github.com/evanbacon)",
2424
"Tommy Nguyen <4123478+tido64@users.noreply.github.com> (https://github.com/tido64)"
+3
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/.gitignore

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# OSX
2+
#
3+
.DS_Store
4+
5+
# XDE
6+
.expo/
7+
8+
# VSCode
9+
.vscode/
10+
jsconfig.json
11+
12+
# Xcode
13+
#
14+
build/
15+
*.pbxuser
16+
!default.pbxuser
17+
*.mode1v3
18+
!default.mode1v3
19+
*.mode2v3
20+
!default.mode2v3
21+
*.perspectivev3
22+
!default.perspectivev3
23+
xcuserdata
24+
*.xccheckout
25+
*.moved-aside
26+
DerivedData
27+
*.hmap
28+
*.ipa
29+
*.xcuserstate
30+
project.xcworkspace
31+
32+
# Android/IJ
33+
#
34+
.classpath
35+
.cxx
36+
.gradle
37+
.idea
38+
.project
39+
.settings
40+
local.properties
41+
android.iml
42+
43+
# Cocoapods
44+
#
45+
example/ios/Pods
46+
47+
# Ruby
48+
example/vendor/
49+
50+
# node.js
51+
#
52+
node_modules/
53+
npm-debug.log
54+
yarn-debug.log
55+
yarn-error.log
56+
57+
# BUCK
58+
buck-out/
59+
\.buckd/
60+
android/app/libs
61+
android/keystores/debug.keystore
62+
63+
# Yarn
64+
.yarn/*
65+
!.yarn/patches
66+
!.yarn/plugins
67+
!.yarn/releases
68+
!.yarn/sdks
69+
!.yarn/versions
70+
71+
# Expo
72+
.expo/
73+
74+
# Turborepo
75+
.turbo/
76+
77+
# generated by bob
78+
lib/

packages/sqlite-storage/README.md

+3
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.
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 = "RNAsyncStorageSQLite"
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
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 "com.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+
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
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="com.sqlitestorage">
3+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package com.sqlitestorage
2+
3+
import com.facebook.react.bridge.ReactApplicationContext
4+
import com.facebook.react.bridge.ReactContextBaseJavaModule
5+
import com.facebook.react.bridge.ReactMethod
6+
import com.facebook.react.bridge.Promise
7+
8+
class SqliteStorageModule(reactContext: ReactApplicationContext) :
9+
ReactContextBaseJavaModule(reactContext) {
10+
11+
override fun getName(): String {
12+
return NAME
13+
}
14+
15+
// Example method
16+
// See https://reactnative.dev/docs/native-modules-android
17+
@ReactMethod
18+
fun multiply(a: Double, b: Double, promise: Promise) {
19+
promise.resolve(a * b)
20+
}
21+
22+
companion object {
23+
const val NAME = "SqliteStorage"
24+
}
25+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.sqlitestorage
2+
3+
import com.facebook.react.ReactPackage
4+
import com.facebook.react.bridge.NativeModule
5+
import com.facebook.react.bridge.ReactApplicationContext
6+
import com.facebook.react.uimanager.ViewManager
7+
8+
9+
class SqliteStoragePackage : ReactPackage {
10+
override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> {
11+
return listOf(SqliteStorageModule(reactContext))
12+
}
13+
14+
override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> {
15+
return emptyList()
16+
}
17+
}
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: ["module:@react-native/babel-preset"],
3+
};
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require("@react-native-async-storage/eslint-config");
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
BUNDLE_PATH: "vendor/bundle"
2+
BUNDLE_FORCE_RUBY_PLATFORM: 1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
source 'https://rubygems.org'
2+
3+
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
4+
ruby ">= 2.6.10"
5+
6+
# Cocoapods 1.15 introduced a bug which break the build. We will remove the upper
7+
# bound in the template on Cocoapods with next React Native release.
8+
gem 'cocoapods', '>= 1.13', '< 1.15'
9+
gem 'activesupport', '>= 6.1.7.5', '< 7.1.0'

0 commit comments

Comments
 (0)