Skip to content

Commit ccce977

Browse files
committed
Created Base for Plugin
1 parent 21db757 commit ccce977

12 files changed

Lines changed: 5921 additions & 0 deletions

.babelrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
{
3+
"presets": ["@babel/preset-env"]
4+
}

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/node_modules

.eslintrc.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module.exports = {
2+
extends: ["airbnb-base"],
3+
plugins: ['jest'],
4+
parserOptions: {
5+
parser: "babel-eslint",
6+
},
7+
env: {
8+
"jest/globals": true,
9+
},
10+
}

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/node_modules
2+
yarn-error.log
3+
vuex-orm-axios*.tgz
4+
coverage

LICENSE.md

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

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Vuex ORM Plugin: Axios

dist/index.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"name": "@vuex-orm/plugin-axios",
3+
"version": "1.0.0",
4+
"description": "Vuex-ORM Plugin to sync the data against a RESTful API.",
5+
"main": "dist/index.js",
6+
"repository": "https://github.com/vuex-orm/vuex-orm-axios",
7+
"author": "Kani Robinson",
8+
"license": "MIT",
9+
"private": false,
10+
"scripts": {
11+
"watch": "webpack --watch --mode=production",
12+
"build": "webpack --mode=production",
13+
"lint": "eslint src/**/*.js test/**/*.js",
14+
"test": "jest"
15+
},
16+
"jest": {
17+
"transform": {
18+
"^.+\\.jsx?$": "babel-jest"
19+
}
20+
},
21+
"dependencies": {
22+
"@babel/preset-env": "^7.0.0",
23+
"@vuex-orm/core": "^0.26.2",
24+
"lodash": "^4.17.11",
25+
"axios": "^0.18.0"
26+
},
27+
"devDependencies": {
28+
"@babel/core": "^7.0.0",
29+
"babel-core": "7.0.0-bridge.0",
30+
"babel-jest": "^23.4.2",
31+
"babel-loader": "^8.0.0",
32+
"babel-preset-env": "^1.7.0",
33+
"eslint": "^5.4.0",
34+
"eslint-config-airbnb": "^17.1.0",
35+
"eslint-plugin-import": "^2.14.0",
36+
"eslint-plugin-jest": "^21.22.0",
37+
"jest": "^23.5.0",
38+
"webpack": "^4.17.1",
39+
"webpack-cli": "^3.1.0"
40+
}
41+
}

src/index.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import VuexOrmAxios from './vuex-orm-axios';
2+
3+
export default class VuexOrmAxiosPlugin {
4+
/**
5+
* This is called, when VuexORM.install(VuexOrmAxios, options) is called.
6+
*
7+
* @param {Components} components The Vuex-ORM Components collection
8+
* @param {Options} options The options passed to VuexORM.install
9+
* @returns {VuexOrmAxios}
10+
*/
11+
static install(components, options) {
12+
return new VuexOrmAxios(components, options);
13+
}
14+
}

src/vuex-orm-axios.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
export default class VuexOrmAxios {
2+
/**
3+
* @constructor
4+
* @param {Components} components The Vuex-ORM Components collection
5+
* @param {Options} options The options passed to VuexORM.install
6+
*/
7+
constructor(components, options) {
8+
//
9+
}
10+
}

0 commit comments

Comments
 (0)