Skip to content
This repository was archived by the owner on Jul 2, 2021. It is now read-only.

Commit 695eac8

Browse files
committed
Initial commit.
0 parents  commit 695eac8

21 files changed

+970
-0
lines changed

.bowerrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"directory": "bower_components"
3+
}

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
node_modules/
2+
bower_components/
3+
4+
.idea/
5+
6+
*.iml
7+
8+
coverage/
9+
10+
npm-debug.log

.jshintrc

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"node": false,
3+
"browser": true,
4+
"esnext": true,
5+
"bitwise": true,
6+
"camelcase": true,
7+
"curly": true,
8+
"eqeqeq": true,
9+
"immed": true,
10+
"indent": 2,
11+
"latedef": true,
12+
"newcap": true,
13+
"undef": true,
14+
"unused": true,
15+
"noarg": true,
16+
"quotmark": "single",
17+
"regexp": true,
18+
"strict": false,
19+
"trailing": true,
20+
"smarttabs": true,
21+
"globals": {
22+
"describe": true,
23+
"it": true,
24+
"beforeEach": true,
25+
"afterEach": true,
26+
"assert": true,
27+
"fail": true,
28+
"console": true,
29+
"require": true,
30+
"module": true,
31+
"exports": true
32+
}
33+
}

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
##### 0.1.0 - 28 May 2015
2+
3+
- Initial release

CONTRIBUTING.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Contributing Guide
2+
3+
First, support is handled via the [Mailing List](https://groups.io/org/groupsio/jsdata). Ask your questions there.
4+
5+
When submitting issues on GitHub, please include as much detail as possible to make debugging quick and easy.
6+
7+
- good - Your versions of Angular, JSData, etc, relevant console logs/error, code examples that revealed the issue
8+
- better - A [plnkr](http://plnkr.co/), [fiddle](http://jsfiddle.net/), or [bin](http://jsbin.com/?html,output) that demonstrates the issue
9+
- best - A Pull Request that fixes the issue, including test coverage for the issue and the fix
10+
11+
[Github Issues](https://github.com/lukasreichart/js-data-asyncstorage/issues).
12+
13+
#### Pull Requests
14+
15+
1. Contribute to the issue that is the reason you'll be developing in the first place
16+
1. Fork js-data-asyncstorage
17+
1. `git clone https://github.com/<you>/js-data-asyncstorage.git`
18+
1. `cd js-data-asyncstorage; npm install; bower install;`
19+
1. You need to follow the instructions in src/index.js to be able to run the tests without react-native.
20+
1. `grunt go` (builds and starts a watch)
21+
1. (in another terminal) `grunt karma:dev` (runs the tests)
22+
1. Write your code, including relevant documentation and tests
23+
1. Submit a PR and we'll review

Gruntfile.js

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
/*
2+
* js-data-asyncstorage
3+
* http://github.com/js-data/js-data-asyncstorage
4+
*
5+
* Copyright (c) 2014-2015 Lukas Reichart <http://www.js-data.io/docs/dsasyncstorageadapter>
6+
* Licensed under the MIT license. <https://github.com/js-data/js-data-asyncstorage/blob/master/LICENSE>
7+
*/
8+
module.exports = function (grunt) {
9+
'use strict';
10+
11+
require('jit-grunt')(grunt, {
12+
coveralls: 'grunt-karma-coveralls'
13+
});
14+
require('time-grunt')(grunt);
15+
16+
var webpack = require('webpack');
17+
var pkg = grunt.file.readJSON('package.json');
18+
var banner = 'js-data-asyncstorage\n' +
19+
'@version ' + pkg.version + ' - Homepage <http://www.js-data.io/docs/dsasyncstorageadapter>\n' +
20+
'@author Lukas Reichart <[email protected]>\n' +
21+
'@copyright (c) 2015 Lukas Reichart \n' +
22+
'@license MIT <https://github.com/lukasreichart/js-data-asyncstorage/blob/master/LICENSE>\n' +
23+
'\n' +
24+
'@overview js-data Adapter for react-native AsyncStorage.';
25+
26+
// Project configuration.
27+
grunt.initConfig({
28+
pkg: pkg,
29+
clean: {
30+
coverage: ['coverage/'],
31+
dist: ['dist/']
32+
},
33+
watch: {
34+
dist: {
35+
files: ['src/**/*.js'],
36+
tasks: ['build']
37+
}
38+
},
39+
uglify: {
40+
main: {
41+
options: {
42+
sourceMap: true,
43+
sourceMapName: 'dist/js-data-asyncstorage.min.map',
44+
banner: '/*!\n' +
45+
'* js-data-asyncstorage\n' +
46+
'* @version <%= pkg.version %> - Homepage <http://www.js-data.io/docs/dsasyncstorageadapter>\n' +
47+
'* @author Lukas Reichart <[email protected]>\n' +
48+
'* @copyright (c) 2015 Lukas Reichart\n' +
49+
'* @license MIT <https://github.com/lukasreichart/js-data-asyncstorage/blob/master/LICENSE>\n' +
50+
'*\n' +
51+
'* @overview js-data Adapter for react-native AsyncStorage.\n' +
52+
'*/\n'
53+
},
54+
files: {
55+
'dist/js-data-asyncstorage.min.js': ['dist/js-data-asyncstorage.js']
56+
}
57+
}
58+
},
59+
webpack: {
60+
dist: {
61+
entry: './src/index.js',
62+
output: {
63+
filename: './dist/js-data-asyncstorage.js',
64+
libraryTarget: 'umd',
65+
library: 'DSAsyncStorageAdapter'
66+
},
67+
externals: {
68+
'js-data': {
69+
amd: 'js-data',
70+
commonjs: 'js-data',
71+
commonjs2: 'js-data',
72+
root: 'JSData'
73+
}
74+
},
75+
module: {
76+
loaders: [
77+
{ test: /(src)(.+)\.js$/, exclude: /node_modules/, loader: 'babel-loader?blacklist=useStrict' }
78+
],
79+
preLoaders: [
80+
{
81+
test: /(src)(.+)\.js$|(test)(.+)\.js$/, // include .js files
82+
exclude: /node_modules/, // exclude any and all files in the node_modules folder
83+
loader: "jshint-loader?failOnHint=true"
84+
}
85+
]
86+
},
87+
plugins: [
88+
new webpack.BannerPlugin(banner)
89+
]
90+
}
91+
},
92+
karma: {
93+
options: {
94+
configFile: './karma.conf.js'
95+
},
96+
dev: {
97+
browsers: ['Chrome'],
98+
autoWatch: true,
99+
singleRun: false,
100+
reporters: ['spec'],
101+
preprocessors: {}
102+
},
103+
min: {
104+
browsers: ['Firefox', 'PhantomJS'],
105+
options: {
106+
files: [
107+
'bower_components/js-data/dist/js-data.min.js',
108+
'dist/js-data-asyncstorage.min.js',
109+
'karma.start.js',
110+
'test/**/*.js'
111+
]
112+
}
113+
},
114+
ci: {
115+
browsers: ['Firefox', 'PhantomJS']
116+
}
117+
},
118+
coveralls: {
119+
options: {
120+
coverage_dir: 'coverage'
121+
}
122+
}
123+
});
124+
125+
grunt.registerTask('version', function (filePath) {
126+
var file = grunt.file.read(filePath);
127+
128+
file = file.replace(/<%= pkg\.version %>/gi, pkg.version);
129+
130+
grunt.file.write(filePath, file);
131+
});
132+
133+
grunt.registerTask('test', ['build', 'karma:ci', 'karma:min']);
134+
grunt.registerTask('build', [
135+
'clean',
136+
'webpack',
137+
'uglify:main'
138+
]);
139+
grunt.registerTask('go', ['build', 'watch:dist']);
140+
grunt.registerTask('default', ['build']);
141+
};

LICENSE

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

README.md

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
<img src="https://raw.githubusercontent.com/js-data/js-data/master/js-data.png" alt="js-data logo" title="js-data" align="right" width="64" height="64" />
2+
3+
## js-data-asyncstorage [![bower version](https://img.shields.io/bower/v/js-data-asyncstorage.svg?style=flat-square)](https://www.npmjs.org/package/js-data-asyncstorage) [![npm version](https://img.shields.io/npm/v/js-data-asyncstorage.svg?style=flat-square)](https://www.npmjs.org/package/js-data-asyncstorage) [![Circle CI](https://img.shields.io/circleci/project/js-data/js-data-asyncstorage/master.svg?style=flat-square)](https://circleci.com/gh/js-data/js-data-asyncstorage/tree/master) [![npm downloads](https://img.shields.io/npm/dm/js-data-asyncstorage.svg?style=flat-square)](https://www.npmjs.org/package/js-data-asyncstorage) [![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://github.com/lukasreichart/js-data-asyncstorage/blob/master/LICENSE)
4+
5+
react-native AsyncStorage adapter for [js-data](http://www.js-data.io/).
6+
7+
### API Documentation
8+
[DSAsyncStorageAdapter](http://www.js-data.io/docs/dsasyncstorageadapter)
9+
10+
### Demo
11+
[https://js-data-asyncstorage.firebaseapp.com/](https://js-data-asyncstorage.firebaseapp.com/)
12+
13+
### Project Status
14+
15+
__Latest Release:__ [![Latest Release](https://img.shields.io/github/release/lukasreichart/js-data-asyncstorage.svg?style=flat-square)](https://github.com/lukasreichart/js-data-asyncstorage/releases)
16+
17+
### Quick Start
18+
`bower install --save js-data js-data-asyncstorage` or `npm install --save js-data js-data-asyncstorage`.
19+
20+
Load `js-data-asyncstorage.js` after `js-data.js`.
21+
22+
```js
23+
var adapter = new DSAsyncStorageAdapter();
24+
25+
var store = new JSData.DS();
26+
store.registerAdapter('asyncstorage', adapter, { default: true });
27+
28+
// "store" will now use the asyncstorage adapter for all async operations
29+
```
30+
31+
### Changelog
32+
[CHANGELOG.md](https://github.com/lukasreichart/js-data-asyncstorage/blob/master/CHANGELOG.md)
33+
34+
### Community
35+
- [Mailing List](https://groups.io/org/groupsio/jsdata) - Ask your questions!
36+
- [Issues](https://github.com/lukasreichart/js-data-asyncstorage/issues) - Found a bug? Feature request? Submit an issue!
37+
- [GitHub](https://github.com/lukasreichart/js-data-asyncstorage) - View the source code for js-data.
38+
- [Contributing Guide](https://github.com/lukasreichart/js-data-asyncstorage/blob/master/CONTRIBUTING.md)
39+
40+
### Contributing
41+
42+
# Contributing Guide
43+
44+
First, support is handled via the [Mailing List](https://groups.io/org/groupsio/jsdata). Ask your questions there.
45+
46+
When submitting issues on GitHub, please include as much detail as possible to make debugging quick and easy.
47+
48+
- good - Your versions of Angular, JSData, etc, relevant console logs/error, code examples that revealed the issue
49+
- better - A [plnkr](http://plnkr.co/), [fiddle](http://jsfiddle.net/), or [bin](http://jsbin.com/?html,output) that demonstrates the issue
50+
- best - A Pull Request that fixes the issue, including test coverage for the issue and the fix
51+
52+
[Github Issues](https://github.com/lukasreichart/js-data-asyncstorage/issues).
53+
54+
#### Pull Requests
55+
56+
1. Contribute to the issue that is the reason you'll be developing in the first place
57+
1. Fork js-data-asyncstorage
58+
1. `git clone https://github.com/<you>/js-data-asyncstorage.git`
59+
1. `cd js-data-asyncstorage; npm install; bower install;`
60+
1. You need to follow the instructions in src/index.js to be able to run the tests without react-native.
61+
1. `grunt go` (builds and starts a watch)
62+
1. (in another terminal) `grunt karma:dev` (runs the tests)
63+
1. Write your code, including relevant documentation and tests
64+
1. Submit a PR and we'll review
65+
66+
### License
67+
68+
This adapter is mainly based on the work of [Jason Dobry](https://github.com/jmdobry)
69+
for the [js-data-localstorage](https://github.com/js-data/js-data-localstorage) adapter.
70+
71+
The MIT License (MIT)
72+
73+
Copyright (c) 2015 Lukas Reichart & Jason Dobry
74+
75+
Permission is hereby granted, free of charge, to any person obtaining a copy
76+
of this software and associated documentation files (the "Software"), to deal
77+
in the Software without restriction, including without limitation the rights
78+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
79+
copies of the Software, and to permit persons to whom the Software is
80+
furnished to do so, subject to the following conditions:
81+
82+
The above copyright notice and this permission notice shall be included in all
83+
copies or substantial portions of the Software.
84+
85+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
86+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
87+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
88+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
89+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
90+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
91+
SOFTWARE.

bower.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"name": "js-data-localstorage",
3+
"description": "localStorage adapter for js-data.",
4+
"homepage": "http://www.js-data.io/docs/dslocalstorageadapter",
5+
"repository": {
6+
"type": "git",
7+
"url": "https://github.com/js-data/js-data-localstorage.git"
8+
},
9+
"author": {
10+
"name": "Jason Dobry",
11+
"url": "http://www.pseudobry.com",
12+
"email": "[email protected]"
13+
},
14+
"main": "./dist/js-data-localstorage.js",
15+
"ignore": [
16+
".idea/",
17+
".*",
18+
"*.iml",
19+
"src/",
20+
"lib/",
21+
"doc/",
22+
"guide/",
23+
"coverage/",
24+
"Gruntfile.js",
25+
"node_modules/",
26+
"test/",
27+
"package.json",
28+
"karma.conf.js",
29+
"karma.start.js"
30+
],
31+
"dependencies": {
32+
"js-data": ">=1.5.7"
33+
}
34+
}

circle.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
dependencies:
2+
pre:
3+
- bower install
4+
cache_directories:
5+
- "bower_components"
6+
test:
7+
post:
8+
- grunt coveralls || true

0 commit comments

Comments
 (0)