@awes-io/vue-mc 0.9.2 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +60 -9
- package/docs/api-reference.md +841 -0
- package/docs/collections.md +703 -0
- package/docs/index.md +183 -0
- package/docs/models.md +558 -0
- package/docs/request-response.md +611 -0
- package/docs/validation.md +652 -0
- package/package.json +13 -8
- package/.babelrc +0 -15
- package/.editorconfig +0 -13
- package/CHANGELOG.md +0 -235
- package/package.js +0 -3
- package/rollup.config.js +0 -24
- package/src/Structures/Collection.js +0 -26
- package/src/Structures/Model.js +0 -45
- package/src/Structures/Request.js +0 -24
- package/src/Structures/Response.js +0 -19
- package/src/index.js +0 -9
- package/src/injectable.js +0 -13
package/README.md
CHANGED
|
@@ -1,39 +1,90 @@
|
|
|
1
|
-
#
|
|
1
|
+
# AwesCode UI Models and Collections Abstract Layer
|
|
2
2
|
|
|
3
3
|
Based on [VueMC](https://vuemc.io/)
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Installation
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
```bash
|
|
8
|
+
yarn add @awes-io/vue-mc
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
**Requirements:**
|
|
12
|
+
- [@nuxtjs/axios](https://axios.nuxtjs.org/) must be installed in your project
|
|
13
|
+
|
|
14
|
+
## Quick Start
|
|
11
15
|
|
|
12
16
|
```javascript
|
|
13
17
|
import { BaseModel, BaseCollection } from '@awes-io/vue-mc'
|
|
14
18
|
|
|
19
|
+
// Define a Model
|
|
15
20
|
class Todo extends BaseModel {
|
|
16
21
|
defaults() {
|
|
17
22
|
return {
|
|
18
23
|
id: null,
|
|
19
|
-
|
|
24
|
+
title: '',
|
|
25
|
+
done: false
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
routes() {
|
|
30
|
+
return {
|
|
31
|
+
fetch: '/api/todos/{id}',
|
|
32
|
+
save: '/api/todos',
|
|
33
|
+
delete: '/api/todos/{id}'
|
|
20
34
|
}
|
|
21
35
|
}
|
|
22
36
|
}
|
|
23
37
|
|
|
38
|
+
// Define a Collection
|
|
24
39
|
class Todos extends BaseCollection {
|
|
25
40
|
model() {
|
|
26
41
|
return Todo
|
|
27
42
|
}
|
|
43
|
+
|
|
44
|
+
routes() {
|
|
45
|
+
return {
|
|
46
|
+
fetch: '/api/todos'
|
|
47
|
+
}
|
|
48
|
+
}
|
|
28
49
|
}
|
|
29
50
|
|
|
30
|
-
|
|
51
|
+
// Usage
|
|
52
|
+
const todos = new Todos()
|
|
53
|
+
await todos.fetch()
|
|
31
54
|
```
|
|
32
55
|
|
|
33
|
-
##
|
|
56
|
+
## Documentation
|
|
57
|
+
|
|
58
|
+
**Comprehensive documentation is available in the [/docs](./docs/) folder:**
|
|
59
|
+
|
|
60
|
+
- **[Getting Started](./docs/index.md)** - Overview and quick start
|
|
61
|
+
- **[Models Guide](./docs/models.md)** - Define and use models
|
|
62
|
+
- **[Collections Guide](./docs/collections.md)** - Manage arrays of models
|
|
63
|
+
- **[Request/Response](./docs/request-response.md)** - HTTP request handling
|
|
64
|
+
- **[Validation](./docs/validation.md)** - Client and server validation
|
|
65
|
+
- **[API Reference](./docs/api-reference.md)** - Complete API documentation
|
|
66
|
+
|
|
67
|
+
## Key Features
|
|
68
|
+
|
|
69
|
+
- **Models**: Represent individual entities with attributes, validation, and persistence
|
|
70
|
+
- **Collections**: Manage arrays of models with pagination and filtering
|
|
71
|
+
- **Axios Integration**: Built-in HTTP request/response handling via @nuxtjs/axios
|
|
72
|
+
- **Validation**: Client-side and server-side validation support
|
|
73
|
+
- **Reactive**: Fully reactive with Vue.js
|
|
74
|
+
- **Lifecycle Hooks**: Boot, create, fetch, save, delete events
|
|
75
|
+
|
|
76
|
+
## Development
|
|
77
|
+
|
|
78
|
+
### Build before release
|
|
34
79
|
|
|
35
80
|
```bash
|
|
36
81
|
$ yarn build
|
|
37
82
|
```
|
|
38
83
|
|
|
39
84
|
Ensure to write proper commit message according to [Git Commit convention](https://www.conventionalcommits.org/)
|
|
85
|
+
|
|
86
|
+
## External Resources
|
|
87
|
+
|
|
88
|
+
- [VueMC Official Documentation](https://vuemc.io/)
|
|
89
|
+
- [@nuxtjs/axios Documentation](https://axios.nuxtjs.org/)
|
|
90
|
+
- [AwesCode UI Components](../ui/)
|