@cyberskill/shared 1.30.0 → 1.31.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 +93 -32
- package/dist/typescript/mongoose.d.cts +2 -2
- package/dist/typescript/mongoose.d.ts +2 -2
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -1,48 +1,109 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="./src/public/favicon/favicon-96x96.png" width="96" height="96" alt="CyberSkill Logo">
|
|
3
|
+
</p>
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
<h1 align="center">🚀 CyberSkill Shared</h1>
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
[![License][license-src]][license-href]
|
|
7
|
+
<p align="center">
|
|
8
|
+
<b>A shared utility library for consistent development across CyberSkill projects.</b>
|
|
9
|
+
</p>
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
---
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
<p align="center">
|
|
14
|
+
<a href="https://npmjs.com/package/@cyberskill/shared">
|
|
15
|
+
<img src="https://img.shields.io/npm/v/@cyberskill/shared?style=for-the-badge&color=blue" alt="npm version">
|
|
16
|
+
</a>
|
|
17
|
+
<a href="https://npmjs.com/package/@cyberskill/shared">
|
|
18
|
+
<img src="https://img.shields.io/npm/dm/@cyberskill/shared?style=for-the-badge&color=brightgreen" alt="npm downloads">
|
|
19
|
+
</a>
|
|
20
|
+
<a href="https://www.jsdocs.io/package/@cyberskill/shared">
|
|
21
|
+
<img src="https://img.shields.io/badge/jsDocs.io-reference-blue?style=for-the-badge" alt="JSDocs">
|
|
22
|
+
</a>
|
|
23
|
+
<a href="https://github.com/cyberskill-world/shared/blob/main/LICENSE">
|
|
24
|
+
<img src="https://img.shields.io/badge/license-MIT-blue?style=for-the-badge" alt="License">
|
|
25
|
+
</a>
|
|
26
|
+
</p>
|
|
13
27
|
|
|
14
|
-
|
|
28
|
+
---
|
|
15
29
|
|
|
16
|
-
|
|
17
|
-
[npm-version-href]: https://npmjs.com/package/@cyberskill/shared
|
|
18
|
-
[npm-downloads-src]: https://img.shields.io/npm/dm/@cyberskill/shared?style=flat&colorA=080f12&colorB=1fa669
|
|
19
|
-
[npm-downloads-href]: https://npmjs.com/package/@cyberskill/shared
|
|
20
|
-
[jsdocs-src]: https://img.shields.io/badge/jsdocs-reference-080f12?style=flat&colorA=080f12&colorB=1fa669
|
|
21
|
-
[jsdocs-href]: https://www.jsdocs.io/package/@cyberskill/shared
|
|
22
|
-
[license-src]: https://img.shields.io/github/license/cyberskill-world/shared.svg?style=flat&colorA=080f12&colorB=1fa669
|
|
23
|
-
[license-href]: https://github.com/cyberskill-world/shared/blob/main/LICENSE
|
|
30
|
+
## 🎯 **About**
|
|
24
31
|
|
|
25
|
-
|
|
32
|
+
CyberSkill Shared is a modular utility library designed to:
|
|
33
|
+
|
|
34
|
+
- 📦 **Provide reusable utility functions** across multiple projects.
|
|
35
|
+
- ⚙️ **Ensure consistent coding standards**.
|
|
36
|
+
- 🚀 **Boost developer productivity** by reducing repetitive code.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## 🚀 **Installation**
|
|
41
|
+
|
|
42
|
+
Install via **npm**:
|
|
26
43
|
|
|
27
44
|
```bash
|
|
28
|
-
|
|
29
|
-
|
|
45
|
+
npm install @cyberskill/shared
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Install via **yarn**:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
yarn add @cyberskill/shared
|
|
52
|
+
```
|
|
30
53
|
|
|
31
|
-
|
|
32
|
-
npm run build
|
|
54
|
+
---
|
|
33
55
|
|
|
34
|
-
|
|
35
|
-
npm run lint
|
|
56
|
+
## 🛠️ **Scripts**
|
|
36
57
|
|
|
37
|
-
|
|
38
|
-
|
|
58
|
+
| Command | Description |
|
|
59
|
+
| ---------------------- | ----------------------------------- |
|
|
60
|
+
| `npm run dev` | Start development mode 🚧 |
|
|
61
|
+
| `npm run build` | Build for production 🚀 |
|
|
62
|
+
| `npm run lint` | Check for linting issues ✅ |
|
|
63
|
+
| `npm run lint:fix` | Fix linting issues 🔧 |
|
|
64
|
+
| `npm run lint:inspect` | Inspect linting config 🧐 |
|
|
65
|
+
| `npm run setup` | Project setup 🏗️ |
|
|
66
|
+
| `npm run reset` | Reset the project ♻️ |
|
|
67
|
+
| `npm run inspect` | Inspect the project dependencies 🔍 |
|
|
39
68
|
|
|
40
|
-
|
|
41
|
-
npm run lint:inspect
|
|
69
|
+
---
|
|
42
70
|
|
|
43
|
-
|
|
44
|
-
npm run setup
|
|
71
|
+
## 📂 **Project Structure**
|
|
45
72
|
|
|
46
|
-
|
|
47
|
-
|
|
73
|
+
```plaintext
|
|
74
|
+
src/
|
|
75
|
+
├── components/ → Reusable UI components (buttons, modals, etc.)
|
|
76
|
+
├── configs/ → App configuration files
|
|
77
|
+
├── constants/ → Static values used across the app
|
|
78
|
+
├── contexts/ → React context providers
|
|
79
|
+
├── controllers/ → Business logic controllers
|
|
80
|
+
├── hocs/ → Higher Order Components (HOCs)
|
|
81
|
+
├── hooks/ → Custom hooks
|
|
82
|
+
├── providers/ → State management and third-party providers
|
|
83
|
+
├── public/ → Static assets (images, fonts, etc.)
|
|
84
|
+
├── styles/ → Global and component-specific styles
|
|
85
|
+
├── typescript/ → TypeScript types and interfaces
|
|
86
|
+
├── utils/ → Utility functions and helpers
|
|
87
|
+
├── commands.ts → CLI commands and setup logic
|
|
88
|
+
└── index.ts → Entry point for the app
|
|
48
89
|
```
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## 🎯 **Goals**
|
|
94
|
+
|
|
95
|
+
- ✅ Consistent TypeScript support.
|
|
96
|
+
- ✅ Minimize code duplication.
|
|
97
|
+
- ✅ Easy to extend and maintain.
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## 📄 **License**
|
|
102
|
+
|
|
103
|
+
**[MIT](./LICENSE)** License © [Stephen Cheng](https://github.com/zintaen)
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
<p align="center">
|
|
108
|
+
Made with ❤️ by <a href="https://github.com/zintaen">@zintaen</a>
|
|
109
|
+
</p>
|
|
@@ -59,7 +59,7 @@ interface I_GenerateModelOptions<D extends Partial<C_Document>> extends I_Mongoo
|
|
|
59
59
|
}
|
|
60
60
|
interface I_ExtendedModel<D extends Partial<C_Document>> extends Model<D>, PaginateModel<D>, AggregatePaginateModel<D> {
|
|
61
61
|
}
|
|
62
|
-
interface I_ReturnSuccess<D, E =
|
|
62
|
+
interface I_ReturnSuccess<D, E = unknown> {
|
|
63
63
|
success: true;
|
|
64
64
|
result: D & E;
|
|
65
65
|
message?: string;
|
|
@@ -70,7 +70,7 @@ interface I_ReturnFailure {
|
|
|
70
70
|
message: string;
|
|
71
71
|
code: number | string;
|
|
72
72
|
}
|
|
73
|
-
type I_Return<D = void, E =
|
|
73
|
+
type I_Return<D = void, E = unknown> = I_ReturnSuccess<D, E> | I_ReturnFailure;
|
|
74
74
|
type T_Filter<D> = Filter<D>;
|
|
75
75
|
type T_InsertOneResult<D> = InsertOneResult<D>;
|
|
76
76
|
type T_InsertManyResult<D> = InsertManyResult<D>;
|
|
@@ -59,7 +59,7 @@ interface I_GenerateModelOptions<D extends Partial<C_Document>> extends I_Mongoo
|
|
|
59
59
|
}
|
|
60
60
|
interface I_ExtendedModel<D extends Partial<C_Document>> extends Model<D>, PaginateModel<D>, AggregatePaginateModel<D> {
|
|
61
61
|
}
|
|
62
|
-
interface I_ReturnSuccess<D, E =
|
|
62
|
+
interface I_ReturnSuccess<D, E = unknown> {
|
|
63
63
|
success: true;
|
|
64
64
|
result: D & E;
|
|
65
65
|
message?: string;
|
|
@@ -70,7 +70,7 @@ interface I_ReturnFailure {
|
|
|
70
70
|
message: string;
|
|
71
71
|
code: number | string;
|
|
72
72
|
}
|
|
73
|
-
type I_Return<D = void, E =
|
|
73
|
+
type I_Return<D = void, E = unknown> = I_ReturnSuccess<D, E> | I_ReturnFailure;
|
|
74
74
|
type T_Filter<D> = Filter<D>;
|
|
75
75
|
type T_InsertOneResult<D> = InsertOneResult<D>;
|
|
76
76
|
type T_InsertManyResult<D> = InsertManyResult<D>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cyberskill/shared",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.31.0",
|
|
5
5
|
"description": "CyberSkill Shared",
|
|
6
6
|
"author": "Stephen Cheng",
|
|
7
7
|
"license": "MIT",
|
|
@@ -152,19 +152,19 @@
|
|
|
152
152
|
"scripts": {
|
|
153
153
|
"build": "tsup",
|
|
154
154
|
"dev": "tsup --watch",
|
|
155
|
-
"inspect": "npx tsx src/commands.ts inspect",
|
|
156
155
|
"lint": "npx tsx src/commands.ts lint",
|
|
157
156
|
"lint:fix": "npx tsx src/commands.ts lint:fix",
|
|
158
157
|
"lint:inspect": "npx @eslint/config-inspector",
|
|
159
158
|
"reset": "npx tsx src/commands.ts reset",
|
|
160
|
-
"setup": "npx tsx src/commands.ts setup"
|
|
159
|
+
"setup": "npx tsx src/commands.ts setup",
|
|
160
|
+
"inspect": "npx tsx src/commands.ts inspect"
|
|
161
161
|
},
|
|
162
162
|
"dependencies": {
|
|
163
163
|
"@antfu/eslint-config": "4.10.2",
|
|
164
164
|
"@apollo/client": "3.13.5",
|
|
165
165
|
"@commitlint/cli": "19.8.0",
|
|
166
166
|
"@commitlint/config-conventional": "19.8.0",
|
|
167
|
-
"@eslint-react/eslint-plugin": "1.37.
|
|
167
|
+
"@eslint-react/eslint-plugin": "1.37.3",
|
|
168
168
|
"@eslint/config-inspector": "1.0.2",
|
|
169
169
|
"@graphql-codegen/cli": "5.0.5",
|
|
170
170
|
"@graphql-codegen/client-preset": "4.7.0",
|
|
@@ -188,7 +188,7 @@
|
|
|
188
188
|
"classnames": "2.5.1",
|
|
189
189
|
"crypto-js": "4.2.0",
|
|
190
190
|
"date-fns": "4.1.0",
|
|
191
|
-
"eslint": "9.
|
|
191
|
+
"eslint": "9.23.0",
|
|
192
192
|
"eslint-config-next": "15.2.3",
|
|
193
193
|
"eslint-plugin-format": "1.0.1",
|
|
194
194
|
"eslint-plugin-react-hooks": "5.2.0",
|
|
@@ -199,7 +199,7 @@
|
|
|
199
199
|
"jsdom": "26.0.0",
|
|
200
200
|
"lint-staged": "15.5.0",
|
|
201
201
|
"localforage": "1.10.0",
|
|
202
|
-
"mongoose": "8.12.
|
|
202
|
+
"mongoose": "8.12.2",
|
|
203
203
|
"mongoose-aggregate-paginate-v2": "1.1.4",
|
|
204
204
|
"mongoose-paginate-v2": "1.9.0",
|
|
205
205
|
"next-intl": "4.0.2",
|