Skip to content

Commit dd17ff3

Browse files
committed
Merge branch 'master' into greenkeeper/initial
# Conflicts: # README.md
2 parents a7e8b8f + fbde970 commit dd17ff3

24 files changed

+534
-415
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ lib/
3434

3535
# Editor directories and files
3636
.idea
37-
.vscode
37+
.vscode/settings.json
3838
*.suo
3939
*.ntvs*
4040
*.njsproj

.vscode/launch.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
"--require",
1414
"ts-node/register",
1515
"-u",
16-
"tdd",
16+
"bdd",
1717
"--timeout",
1818
"999999",
1919
"--colors",
2020
"--recursive",
2121
"${workspaceFolder}/test/**/*.ts"
2222
],
2323
"env": {
24-
"TS_NODE_PROJECT": "tsconfig.esnext.json"
24+
"TS_NODE_PROJECT": "tsconfig.test.json"
2525
},
2626
"internalConsoleOptions": "openOnSessionStart"
2727
},
@@ -37,7 +37,6 @@
3737
"request": "attach",
3838
"name": "Attach to Process",
3939
"port": 5858
40-
},
41-
40+
}
4241
]
43-
}
42+
}

README.md

Lines changed: 14 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -1,152 +1,46 @@
11
# feathers-vuex
22

3+
<<<<<<< HEAD
34
[![Build Status](https://travis-ci.org/feathers-plus/feathers-vuex.png?branch=master)](https://travis-ci.org/feathers-plus/feathers-vuex)
45
[![Dependency Status](https://img.shields.io/david/feathers-plus/feathers-vuex.svg?style=flat-square)](https://david-dm.org/feathers-plus/feathers-vuex)
56
[![Download Status](https://img.shields.io/npm/dm/feathers-vuex.svg?style=flat-square)](https://www.npmjs.com/package/feathers-vuex) [![Greenkeeper badge](https://badges.greenkeeper.io/feathersjs-ecosystem/feathers-vuex.svg)](https://greenkeeper.io/)
7+
=======
8+
[![Build Status](https://travis-ci.org/feathersjs-ecosystem/feathers-vuex.png?branch=master)](https://travis-ci.org/feathersjs-ecosystem/feathers-vuex)
9+
[![Dependency Status](https://img.shields.io/david/feathersjs-ecosystem/feathers-vuex.svg?style=flat-square)](https://david-dm.org/feathersjs-ecosystem/feathers-vuex)
10+
[![Download Status](https://img.shields.io/npm/dm/feathers-vuex.svg?style=flat-square)](https://www.npmjs.com/package/feathers-vuex)
11+
12+
> > > > > > > master
613
714
![feathers-vuex service logo](./service-logo.png)
815

916
> Integrate the Feathers Client into Vuex
1017
11-
`feathers-vuex` is a first class integration of the Feathers Client and Vuex. It implements many Redux best practices under the hood, eliminates *a lot* of boilerplate code, and still allows you to easily customize the Vuex store.
12-
13-
14-
___________________________________
15-
16-
> NOTICE: this module is almost (but not quite) fully compatible with Feathers V4. The authentication module is written for Feathers V3. If you're going to use Feathers V4, please search the [GitHub issues](https://github.com/feathers-plus/feathers-vuex/issues) for "feathers crow authentication" for workarounds you can implement until this module is properly updated.
17-
>
18-
> IN THE MEANTIME, it is highly recommended that you use the [pre-release version](https://github.com/feathers-plus/feathers-vuex/pull/216), which is production ready for Feathers V4. A proper migration guide and updated documentation are currently in progress.
19-
20-
___________________________________
21-
22-
23-
24-
## Features
25-
26-
- Fully powered by Vuex & Feathers
27-
- Realtime By Default
28-
- Actions With Reactive Data
29-
- Local Queries
30-
- Fall-Through Caching
31-
- Feathers Query Syntax
32-
- $FeathersVuex Vue Plugin
33-
- Live Queries
34-
- Per-Service Data Modeling
35-
- Clone & Commit
36-
- Vuex Strict Mode
37-
- Per-Record Defaults
38-
- Data Level Computes
39-
- Relation Support
18+
`feathers-vuex` is a first class integration of the Feathers Client and Vuex. It implements many Redux best practices under the hood, eliminates _a lot_ of boilerplate code, and still allows you to easily customize the Vuex store.
4019

4120
## Demo & Documentation
4221

4322
[Demo](https://codesandbox.io/s/xk52mqm7o)
4423

45-
See [https://feathers-vuex.feathers-plus.com/index.html](https://feathers-vuex.feathers-plus.com/index.html) for full documentation.
24+
See [https://vuex.feathersjs.com](https://vuex.feathersjs.com) for full documentation.
4625

4726
## Installation
4827

4928
```bash
5029
npm install feathers-vuex --save
5130
```
5231

53-
## Basic Examples
54-
55-
To setup `feathers-vuex`, we first need to setup a Feathers Client. Here's an example using the latest `@feathersjs` npm packages.
56-
57-
**feathers-client.js:**
58-
59-
```js
60-
import feathers from '@feathersjs/feathers'
61-
import socketio from '@feathersjs/socketio-client'
62-
import auth from '@feathersjs/authentication-client'
63-
import io from 'socket.io-client'
64-
65-
const socket = io('http://localhost:3030', {transports: ['websocket']})
66-
67-
const feathersClient = feathers()
68-
.configure(socketio(socket))
69-
.configure(auth({ storage: window.localStorage }))
70-
71-
export default feathersClient
32+
```bash
33+
yarn add feathers-vuex
7234
```
7335

74-
And here's how you would integrate the Feathers Client into the Vuex store:
75-
76-
**store/index.js:**
77-
78-
```js
79-
import Vue from 'vue'
80-
import Vuex from 'vuex'
81-
import feathersVuex from 'feathers-vuex'
82-
import feathersClient from '../feathers-client'
83-
84-
const { service, auth, FeathersVuex } = feathersVuex(feathersClient, { idField: '_id' })
85-
86-
Vue.use(Vuex)
87-
Vue.use(FeathersVuex)
88-
89-
export default new Vuex.Store({
90-
plugins: [
91-
service('todos'),
92-
93-
// Specify custom options per service
94-
service('/v1/tasks', {
95-
idField: '_id', // The field in each record that will contain the id
96-
nameStyle: 'path', // Use the full service path as the Vuex module name, instead of just the last section
97-
namespace: 'custom-namespace', // Customize the Vuex module name. Overrides nameStyle.
98-
autoRemove: true, // Automatically remove records missing from responses (only use with feathers-rest)
99-
enableEvents: false, // Turn off socket event listeners. It's true by default
100-
addOnUpsert: true, // Add new records pushed by 'updated/patched' socketio events into store, instead of discarding them. It's false by default
101-
skipRequestIfExists: true, // For get action, if the record already exists in store, skip the remote request. It's false by default
102-
modelName: 'OldTask' // Default modelName would have been 'Task'
103-
})
104-
105-
// Add custom state, getters, mutations, or actions, if needed. See example in another section, below.
106-
service('things', {
107-
state: {},
108-
getters: {},
109-
mutations: {},
110-
actions: {}
111-
})
112-
113-
// Setup a service with defaults for Model instances
114-
service('manufacturers', {
115-
instanceDefaults: {
116-
name: ''
117-
}
118-
})
119-
// Setup a service with light-weight relational data
120-
service('models', {
121-
instanceDefaults: {
122-
name: '',
123-
manufacturerId: '',
124-
manufacturer: 'Manufacturer' // Refers to data (populated on the server) that gets put in the `manufacturers` vuex store.
125-
}
126-
})
127-
128-
// Setup the auth plugin.
129-
auth({ userService: 'users' })
130-
]
131-
})
132-
```
36+
IMPORTANT: Feathers-Vuex is (and requires to be) published in ES6 format for full compatibility with JS classes. If your project uses Babel, it must be configured properly. See the [Project Configuration](https://vuex.feathersjs.com/api-overview.html#project-configuration) section for more information.
13337

13438
## Contributing
13539

136-
`feathers-vuex` tests run using StealJS, which is a 100% browser-based bundler.
137-
138-
Once you’ve installed all of the npm packages, start an `http-server` in the root folder:
139-
140-
`cd feathers-vuex`
141-
142-
`npm i -g http-server`
143-
144-
`http-server`
145-
146-
Then open the resulting page in your browser and navigate to the test folder to run the tests.
40+
This repo is pre-configured to work with the Visual Studio Code debugger. After running `yarn install`, use the "Mocha Tests" debug script for a smooth debugging experience.
14741

14842
## License
14943

15044
Copyright (c) Forever and Ever, or at least the current year.
15145

152-
Licensed under the [MIT license](https://github.com/feathers-plus/feathers-vuex/blob/master/LICENSE).
46+
Licensed under the [MIT license](https://github.com/feathersjs-ecosystem/feathers-vuex/blob/master/LICENSE).

docs/.vuepress/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module.exports = {
33
description: 'Integration of FeathersJS, Vue, and Nuxt for the artisan developer',
44
theme: 'default-prefers-color-scheme',
55
themeConfig: {
6-
repo: 'feathers-plus/feathers-vuex',
6+
repo: 'feathersjs-ecosystem/feathers-vuex',
77
docsDir: 'docs',
88
editLinks: true,
99
sidebar: [

docs/api-overview.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ sidebarDepth: 3
44
---
55

66
<!--- Usage ------------------------------------------------------------------------------------ -->
7-
[![Build Status](https://travis-ci.org/feathers-plus/feathers-vuex.png?branch=master)](https://travis-ci.org/feathers-plus/feathers-vuex)
8-
[![Dependency Status](https://img.shields.io/david/feathers-plus/feathers-vuex.svg?style=flat-square)](https://david-dm.org/feathers-plus/feathers-vuex)
7+
[![Build Status](https://travis-ci.org/feathersjs-ecosystem/feathers-vuex.png?branch=master)](https://travis-ci.org/feathersjs-ecosystem/feathers-vuex)
8+
[![Dependency Status](https://img.shields.io/david/feathersjs-ecosystem/feathers-vuex.svg?style=flat-square)](https://david-dm.org/feathersjs-ecosystem/feathers-vuex)
99
[![Download Status](https://img.shields.io/npm/dm/feathers-vuex.svg?style=flat-square)](https://www.npmjs.com/package/feathers-vuex)
1010

11-
![feathers-vuex service logo](https://github.com/feathers-plus/feathers-vuex/raw/master/service-logo.png)
11+
![feathers-vuex service logo](https://github.com/feathersjs-ecosystem/feathers-vuex/raw/master/service-logo.png)
1212

1313
> Integrate the Feathers Client into Vuex
1414
1515
`feathers-vuex` is a first class integration of the Feathers Client and Vuex. It implements many Redux best practices under the hood, eliminates *a lot* of boilerplate code, and still allows you to easily customize the Vuex store.
1616

17-
These docs are for version 2.x. For [email protected], please go to [https://feathers-vuex-v1.netlify.com](feathers-vuex-v1.netlify.com).
17+
These docs are for version 2.x. For [email protected], please go to [https://feathers-vuex-v1.netlify.com](https://feathers-vuex-v1.netlify.com).
1818

1919
## Features
2020

@@ -287,7 +287,7 @@ There are two plugins included:
287287
1. The [Service Plugin](./service-plugin.md) adds a Vuex store for new services.
288288
2. The [Auth Plugin](./auth-plugin.md) sets up the Vuex store for authentication / logout.
289289

290-
To see `feathers-vuex` in a working vue-cli application, check out [`feathers-chat-vuex`](https://github.com/feathers-plus/feathers-chat-vuex).
290+
To see `feathers-vuex` in a working vue-cli application, check out [`feathers-chat-vuex`](https://github.com/feathersjs-ecosystem/feathers-chat-vuex).
291291

292292
### Global Configuration
293293

docs/common-patterns.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ The mixin utilities provide the same functionality as the components, but with m
2222

2323
As of version 2.0, Feathers-Vuex has been rewritten in TypeScript.
2424

25-
See [this issue](https://github.com/feathers-plus/feathers-vuex/issues/114) for suggestions for with TypeScript helpers.
25+
See [this issue](https://github.com/feathersjs-ecosystem/feathers-vuex/issues/114) for suggestions for with TypeScript helpers.
2626

2727
## Clearing data upon user logout
2828

29-
The best solution is to simply refresh to clear memory. The alternative to refreshing would be to perform manual cleanup of the service stores. Refreshing is much simpler, so it's the officially supported solution. Feel free to read [this issue](https://github.com/feathers-plus/feathers-vuex/issues/10) for more suggestions.
29+
The best solution is to simply refresh to clear memory. The alternative to refreshing would be to perform manual cleanup of the service stores. Refreshing is much simpler, so it's the officially supported solution. Feel free to read [this issue](https://github.com/feathersjs-ecosystem/feathers-vuex/issues/10) for more suggestions.
3030

3131
## Accessing the store from hooks
3232

@@ -259,7 +259,7 @@ See the [instanceDefaults API](./model-classes.html#instancedefaults)
259259

260260
## Model-Specific Computed Properties
261261

262-
You may find yourself in a position where model-specific computed properties would be very useful. [github issue](https://github.com/feathers-plus/feathers-vuex/issues/163). In Feathers-Vuex 1.7, these could be specified in the `instanceDefaults`. As of 2.0, they are specified directly on each Model class:
262+
You may find yourself in a position where model-specific computed properties would be very useful. [github issue](https://github.com/feathersjs-ecosystem/feathers-vuex/issues/163). In Feathers-Vuex 1.7, these could be specified in the `instanceDefaults`. As of 2.0, they are specified directly on each Model class:
263263

264264
```js
265265
class Post extends BaseModel {

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
home: true
3-
heroImage: https://github.com/feathers-plus/feathers-vuex/raw/master/service-logo.png
3+
heroImage: https://github.com/feathersjs-ecosystem/feathers-vuex/raw/master/service-logo.png
44
heroText: FeathersVuex 2.x
55
tagLine: Integration of FeathersJS, Vue, and Nuxt for the artisan developer
66
actionText: Get Started

docs/model-classes.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ store.dispatch('todos/find', { query: {} })
184184

185185
### `instance.save(params)`
186186

187-
The `save` method is a convenience wrapper for the `create/patch` methods, by default. If the records has no `_id`, the `instance.create()` method will be used. The `params` argument will be used in the Feathers client request. See the [Feathers Service](https://docs.feathersjs.com/api/services.md#service-methods) docs, for reference on where params are used in each method.
187+
The `save` method is a convenience wrapper for the `create/patch` methods, by default. If the records has no `_id`, the `instance.create()` method will be used. The `params` argument will be used in the Feathers client request. See the [Feathers Service](https://docs.feathersjs.com/guides/basics/services.html#service-methods) docs, for reference on where params are used in each method.
188188

189189
```js
190190
// In your Vue component
@@ -202,7 +202,7 @@ As mentioned, `save` performs either `create` or `patch`, but you can use the `p
202202

203203
### `instance.create(params)`
204204

205-
The `create` method calls the `create` action (service method) using the instance data. The `params` argument will be used in the Feathers client request. See the [Feathers Service](https://docs.feathersjs.com/api/services.md#service-methods) docs, for reference.
205+
The `create` method calls the `create` action (service method) using the instance data. The `params` argument will be used in the Feathers client request. See the [Feathers Service](https://docs.feathersjs.com/guides/basics/services.html#service-methods) docs, for reference.
206206

207207
You might not ever need to use `.create()`, but can instead use the `.save()` method. Let `feathers-vuex` call `create` or `patch`.
208208

@@ -216,7 +216,7 @@ todo.create() // --> Creates the todo on the server using the instance data
216216

217217
### `instance.patch(params)`
218218

219-
The `patch` method calls the `patch` action (service method) using the instance data. The instance's id field is used for the `patch` id. The `params` argument will be used in the Feathers client request. See the [Feathers Service](https://docs.feathersjs.com/api/services.md#service-methods) docs, for reference.
219+
The `patch` method calls the `patch` action (service method) using the instance data. The instance's id field is used for the `patch` id. The `params` argument will be used in the Feathers client request. See the [Feathers Service](https://docs.feathersjs.com/guides/basics/services.html#service-methods) docs, for reference.
220220

221221
Similar to the `.create()` method, you might not ever need to use `.patch()` if you just use `.save()` and let `feathers-vuex` figure out how to handle it.
222222

@@ -233,7 +233,7 @@ todo.patch() // --> Sends a `patch` request the with the id and description.
233233

234234
### `instance.update(params)`
235235

236-
The `update` method calls the `update` action (service method) using the instance data. The instance's id field is used for the `update` id. The `params` argument will be used in the Feathers client request. See the [Feathers Service](https://docs.feathersjs.com/api/services.md#service-methods) docs, for reference.
236+
The `update` method calls the `update` action (service method) using the instance data. The instance's id field is used for the `update` id. The `params` argument will be used in the Feathers client request. See the [Feathers Service](https://docs.feathersjs.com/guides/basics/services.html#service-methods) docs, for reference.
237237

238238
Use `.update()` whenever you want to completely replace the data on the server with the instance data. You can also set the `preferUpdate` option to `true` to make `.save()` call `.update()` when an id field is present on the instance.
239239

@@ -248,7 +248,7 @@ todo.update() // --> Sends a `update` request the with all instance data.
248248

249249
### `instance.remove(params)`
250250

251-
The `remove` method calls the `remove` action (service method) using the instance data. The instance's id field is used for the `remove` id. The `params` argument will be used in the Feathers client request. See the [Feathers Service](https://docs.feathersjs.com/api/services.md#service-methods) docs, for reference.
251+
The `remove` method calls the `remove` action (service method) using the instance data. The instance's id field is used for the `remove` id. The `params` argument will be used in the Feathers client request. See the [Feathers Service](https://docs.feathersjs.com/guides/basics/services.html#service-methods) docs, for reference.
252252

253253
```js
254254
const { Todo } = this.$FeathersVuex.api

package.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
11
{
22
"name": "feathers-vuex",
33
"description": "FeathersJS, Vue, and Nuxt for the artisan developer",
4-
"version": "2.0.4",
5-
"homepage": "https:feathers-vuex.feathers-plus.com",
4+
"version": "2.2.3",
5+
"homepage": "https:feathers-vuex.feathersjs-ecosystem.com",
66
"main": "dist/",
77
"module": "dist/",
8+
"types": "dist/",
89
"keywords": [
910
"feathers",
1011
"feathers-plugin"
1112
],
1213
"license": "MIT",
1314
"repository": {
1415
"type": "git",
15-
"url": "git://github.com/feathers-plus/feathers-vuex.git"
16+
"url": "git://github.com/feathersjs-ecosystem/feathers-vuex.git"
1617
},
1718
"author": {
1819
"name": "Marshall Thompson",
1920
"email": "[email protected]",
20-
"url": "https://feathers-plus.github.io."
21+
"url": "https://feathersjs-ecosystem.github.io."
2122
},
2223
"contributors": [],
2324
"bugs": {
24-
"url": "https://github.com/feathers-plus/feathers-vuex/issues"
25+
"url": "https://github.com/feathersjs-ecosystem/feathers-vuex/issues"
2526
},
2627
"engines": {
2728
"node": ">= 4.6.0"
@@ -39,7 +40,7 @@
3940
"watch": "shx rm -rf lib/ && babel --watch -d lib/ src/",
4041
"lint": "standard --fix",
4142
"coverage": "istanbul cover node_modules/mocha/bin/_mocha -- --opts mocha.opts",
42-
"test": "mocha --require ts-node/register test/**/*.test.ts",
43+
"test": "TS_NODE_PROJECT='tsconfig.test.json' mocha --require ts-node/register test/**/*.test.ts",
4344
"testee": "testee test/index.html --browsers firefox",
4445
"start": "npm run compile && node example/app",
4546
"docs:serve": "vuepress dev docs",
@@ -166,7 +167,7 @@
166167
"steal-mocha": "^2.0.1",
167168
"testee": "^0.9.0",
168169
"ts-node": "^8.0.3",
169-
"typescript": "^3.4.1",
170+
"typescript": "^3.7.2",
170171
"vue": "^2.6.10",
171172
"vuepress": "^1.0.2",
172173
"vuex": "^3.1.0"

0 commit comments

Comments
 (0)