Skip to content

Commit 044a2aa

Browse files
author
Krzysztof Borowy
committed
Module scaffolding
1 parent 6e8fb2a commit 044a2aa

Some content is hidden

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

67 files changed

+9960
-21
lines changed

.eslintrc

+290
Large diffs are not rendered by default.

.flowconfig

+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
[ignore]
2+
; This flowconfig is forked by platform - the only difference between them is which suffix is ignored.
3+
.*/*[.]android.js
4+
;.*/*[.]ios.js
5+
6+
; Ignore templates for 'react-native init'
7+
.*/local-cli/templates/.*
8+
9+
; Ignore the Dangerfile
10+
node_modules/react-native/bots/dangerfile.js
11+
12+
; Ignore "BUCK" generated dirs
13+
node_modules/react-native/\.buckd/
14+
15+
; Ignore unexpected extra "@providesModule"
16+
.*/node_modules/.*/node_modules/fbjs/.*
17+
18+
; Ignore duplicate module providers
19+
; For RN Apps installed via npm, "Libraries" folder is inside
20+
; "node_modules/react-native" but in the source repo it is in the root
21+
.*/Libraries/react-native/React.js
22+
23+
; Ignore polyfills
24+
.*/Libraries/polyfills/.*
25+
26+
; Ignore metro
27+
.*/node_modules/metro/.*
28+
29+
; Ignore "config-chain"'s test folder - it has a corrupt JSON file that's tripping flow
30+
.*/node_modules/config-chain/test/*.
31+
32+
; These should not be required directly
33+
; require from fbjs/lib instead: require('fbjs/lib/invariant')
34+
.*/node_modules/invariant/.*
35+
.*/node_modules/warning/.*
36+
37+
[include]
38+
39+
[libs]
40+
node_modules/react-native/Libraries/react-native/react-native-interface.js
41+
node_modules/react-native/flow/
42+
node_modules/react-native/flow-github/
43+
44+
[lints]
45+
46+
[options]
47+
emoji=true
48+
49+
esproposal.optional_chaining=enable
50+
esproposal.nullish_coalescing=enable
51+
52+
module.system=haste
53+
module.system.haste.use_name_reducers=true
54+
# keep the following in sync with server/haste/hasteImpl.js
55+
# get basename
56+
module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1'
57+
# strip .js or .js.flow suffix
58+
module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1'
59+
# strip platform suffix
60+
module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1'
61+
module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1'
62+
module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
63+
module.system.haste.paths.blacklist=.*/__tests__/.*
64+
module.system.haste.paths.blacklist=.*/__mocks__/.*
65+
module.system.haste.paths.whitelist=<PROJECT_ROOT>/js/.*
66+
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/Libraries/.*
67+
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/RNTester/.*
68+
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/IntegrationTests/.*
69+
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*
70+
71+
munge_underscores=true
72+
73+
module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'
74+
# Support the library import in examples
75+
module.name_mapper='^\@react-native-community/async-storage$' -> '<PROJECT_ROOT>/lib/AsyncStorage.js'
76+
77+
suppress_type=$FlowIssue
78+
suppress_type=$FlowFixMe
79+
suppress_type=$FlowFixMeProps
80+
suppress_type=$FlowFixMeState
81+
82+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*[react_native\\(_android\\)?_oss|react_native\\(_android\\)?_fb][a-z,_]*\\)?)\\)
83+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*[react_native\\(_android\\)?_oss|react_native\\(_android\\)?_fb][a-z,_]*\\)?)\\)?:? #[0-9]+
84+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
85+
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
86+
87+
[strict]
88+
89+
[version]
90+
^0.86.0

.gitignore

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
2+
# OSX
3+
#
4+
.DS_Store
5+
6+
# node.js
7+
#
8+
node_modules/
9+
npm-debug.log
10+
yarn-error.log
11+
12+
13+
# Xcode
14+
#
15+
build/
16+
*.pbxuser
17+
!default.pbxuser
18+
*.mode1v3
19+
!default.mode1v3
20+
*.mode2v3
21+
!default.mode2v3
22+
*.perspectivev3
23+
!default.perspectivev3
24+
xcuserdata
25+
*.xccheckout
26+
*.moved-aside
27+
DerivedData
28+
*.hmap
29+
*.ipa
30+
*.xcuserstate
31+
project.xcworkspace
32+
33+
34+
# Android/IntelliJ
35+
#
36+
build/
37+
.idea
38+
.gradle
39+
local.properties
40+
*.iml
41+
42+
# BUCK
43+
buck-out/
44+
\.buckd/
45+
*.keystore
46+
47+
# Editor config
48+
.vscode

.npmignore

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# JS
2+
node_modules
3+
yarn.lock
4+
5+
# Project files
6+
CONTRIBUTING.md
7+
CODE_OF_CONDUCT.md
8+
README.md
9+
10+
# Config files
11+
.babelrc
12+
babel.config.js
13+
.editorconfig
14+
.eslintrc
15+
.flowconfig
16+
.watchmanconfig
17+
jsconfig.json
18+
.npmrc
19+
.gitattributes
20+
.circleci
21+
*.coverage.json
22+
.opensource
23+
.circleci
24+
.eslintignore
25+
codecov.yml
26+
27+
# Example
28+
example/
29+
30+
# Android
31+
android/*/build/
32+
android/gradlew
33+
android/build
34+
android/gradlew.bat
35+
android/gradle/
36+
android/com_crashlytics_export_strings.xml
37+
android/local.properties
38+
android/.gradle/
39+
android/.signing/
40+
android/.idea/gradle.xml
41+
android/.idea/libraries/
42+
android/.idea/workspace.xml
43+
android/.idea/tasks.xml
44+
android/.idea/.name
45+
android/.idea/compiler.xml
46+
android/.idea/copyright/profiles_settings.xml
47+
android/.idea/encodings.xml
48+
android/.idea/misc.xml
49+
android/.idea/modules.xml
50+
android/.idea/scopes/scope_settings.xml
51+
android/.idea/vcs.xml
52+
android/*.iml
53+
android/.settings
54+
55+
# iOS
56+
ios/*.xcodeproj/xcuserdata
57+
*.pbxuser
58+
*.mode1v3
59+
*.mode2v3
60+
*.perspectivev3
61+
*.xcuserstate
62+
project.xcworkspace/
63+
xcuserdata/
64+
65+
# Misc
66+
.DS_Store
67+
.DS_Store?
68+
*.DS_Store
69+
coverage.android.json
70+
coverage.ios.json
71+
coverage
72+
npm-debug.log
73+
.github
74+
._*
75+
.Spotlight-V100
76+
.Trashes
77+
ehthumbs.db
78+
Thumbs.dbandroid/gradle
79+
docs
80+
.idea
81+
tests/
82+
bin/test.js
83+
codorials
84+
.vscode
85+
.nyc_output

.prettierrc

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"requirePragma": true,
3+
"singleQuote": true,
4+
"trailingComma": "all",
5+
"bracketSpacing": false,
6+
"jsxBracketSameLine": true,
7+
"parser": "flow"
8+
}

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2015-present, Facebook, Inc.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+23
Original file line numberDiff line numberDiff line change
@@ -1 +1,24 @@
11
# react-native-async-storage
2+
3+
Asynchronous, persistent, key-value storage system for React Native.
4+
5+
## Getting started
6+
7+
8+
### Install
9+
10+
`yarn add @react-native-community/async-storage`
11+
12+
or
13+
14+
`npm install @react-native-community/async-storage --save`
15+
16+
17+
### Link
18+
19+
`react-native link @react-native-community/async-storage`
20+
21+
## Usage
22+
23+
ToDo
24+

android/build.gradle

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
2+
buildscript {
3+
repositories {
4+
google()
5+
jcenter()
6+
}
7+
8+
dependencies {
9+
classpath 'com.android.tools.build:gradle:3.2.1'
10+
}
11+
}
12+
13+
def getExtOrDefault(name) {
14+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['RNAsyncStorage_' + name]
15+
}
16+
17+
def getExtOrIntegerDefault(name) {
18+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties['RNAsyncStorage_' + name]).toInteger()
19+
}
20+
21+
apply plugin: 'com.android.library'
22+
23+
android {
24+
compileSdkVersion getExtOrIntegerDefault('compileSdkVersion')
25+
buildToolsVersion getExtOrDefault('buildToolsVersion')
26+
27+
defaultConfig {
28+
minSdkVersion getExtOrIntegerDefault('minSdkVersion')
29+
targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
30+
}
31+
}
32+
33+
repositories {
34+
mavenCentral()
35+
}
36+
37+
dependencies {
38+
api 'com.facebook.react:react-native:+'
39+
}
40+

android/gradle.properties

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
RNAsyncStorage_compileSdkVersion=28
2+
RNAsyncStorage_buildToolsVersion=28.0.3
3+
RNAsyncStorage_targetSdkVersion=28
4+
RNAsyncStorage_minSdkVersion=19

android/src/main/AndroidManifest.xml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.reactnativecommunity.asyncstorage">
4+
5+
</manifest>
6+

AsyncLocalStorageUtil.java renamed to android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncLocalStorageUtil.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8-
package com.facebook.react.modules.storage;
8+
package com.reactnativecommunity.asyncstorage;
99

1010
import javax.annotation.Nullable;
1111

@@ -22,9 +22,9 @@
2222
import org.json.JSONException;
2323
import org.json.JSONObject;
2424

25-
import static com.facebook.react.modules.storage.ReactDatabaseSupplier.KEY_COLUMN;
26-
import static com.facebook.react.modules.storage.ReactDatabaseSupplier.TABLE_CATALYST;
27-
import static com.facebook.react.modules.storage.ReactDatabaseSupplier.VALUE_COLUMN;
25+
import static com.reactnativecommunity.asyncstorage.ReactDatabaseSupplier.KEY_COLUMN;
26+
import static com.reactnativecommunity.asyncstorage.ReactDatabaseSupplier.TABLE_CATALYST;
27+
import static com.reactnativecommunity.asyncstorage.ReactDatabaseSupplier.VALUE_COLUMN;
2828

2929
/**
3030
* Helper for database operations.

AsyncStorageErrorUtil.java renamed to android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStorageErrorUtil.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8-
package com.facebook.react.modules.storage;
8+
package com.reactnativecommunity.asyncstorage;
99

1010
import javax.annotation.Nullable;
1111

0 commit comments

Comments
 (0)