@cyberskill/shared 1.29.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.
Files changed (129) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +99 -16
  3. package/dist/commands.cjs +1 -1
  4. package/dist/commands.js +1 -1
  5. package/dist/configs/graphql/graphql-codegen.d.cts +1 -4
  6. package/dist/configs/graphql/graphql-codegen.d.ts +1 -4
  7. package/dist/configs/graphql/index.d.cts +1 -4
  8. package/dist/configs/graphql/index.d.ts +1 -4
  9. package/dist/configs/index.cjs +1 -1
  10. package/dist/configs/index.js +1 -1
  11. package/dist/configs/vitest/react/e2e.cjs +1 -1
  12. package/dist/configs/vitest/react/e2e.d.cts +2 -3
  13. package/dist/configs/vitest/react/e2e.d.ts +2 -3
  14. package/dist/configs/vitest/react/e2e.js +1 -1
  15. package/dist/configs/vitest/react/unit.cjs +1 -1
  16. package/dist/configs/vitest/react/unit.d.cts +2 -3
  17. package/dist/configs/vitest/react/unit.d.ts +2 -3
  18. package/dist/configs/vitest/react/unit.js +1 -1
  19. package/dist/contexts/react/index.d.cts +0 -2
  20. package/dist/contexts/react/index.d.ts +0 -2
  21. package/dist/contexts/react/loading.d.cts +0 -2
  22. package/dist/contexts/react/loading.d.ts +0 -2
  23. package/dist/controllers/index.cjs +1 -1
  24. package/dist/controllers/index.js +1 -1
  25. package/dist/controllers/mongo-migration.cjs +1 -1
  26. package/dist/controllers/mongo-migration.js +1 -1
  27. package/dist/controllers/mongoose.cjs +1 -1
  28. package/dist/controllers/mongoose.js +1 -1
  29. package/dist/hocs/react/index.cjs +1 -1
  30. package/dist/hocs/react/index.d.cts +0 -2
  31. package/dist/hocs/react/index.d.ts +0 -2
  32. package/dist/hocs/react/index.js +1 -1
  33. package/dist/hocs/react/next-intl.cjs +1 -1
  34. package/dist/hocs/react/next-intl.d.cts +0 -2
  35. package/dist/hocs/react/next-intl.d.ts +0 -2
  36. package/dist/hocs/react/next-intl.js +1 -1
  37. package/dist/hooks/react/index.cjs +1 -1
  38. package/dist/hooks/react/index.d.cts +3 -4
  39. package/dist/hooks/react/index.d.ts +3 -4
  40. package/dist/hooks/react/index.js +1 -1
  41. package/dist/hooks/react/use-loading.d.cts +0 -2
  42. package/dist/hooks/react/use-loading.d.ts +0 -2
  43. package/dist/hooks/react/use-next-intl.cjs +1 -1
  44. package/dist/hooks/react/use-next-intl.d.cts +4 -2
  45. package/dist/hooks/react/use-next-intl.d.ts +4 -2
  46. package/dist/hooks/react/use-next-intl.js +1 -1
  47. package/dist/index.cjs +1 -1
  48. package/dist/index.d.cts +17 -14
  49. package/dist/index.d.ts +17 -14
  50. package/dist/index.js +1 -1
  51. package/dist/providers/react/apollo-client.cjs +1 -1
  52. package/dist/providers/react/apollo-client.d.cts +3 -7
  53. package/dist/providers/react/apollo-client.d.ts +3 -7
  54. package/dist/providers/react/apollo-client.js +1 -1
  55. package/dist/providers/react/index.cjs +1 -1
  56. package/dist/providers/react/index.d.cts +2 -2
  57. package/dist/providers/react/index.d.ts +2 -2
  58. package/dist/providers/react/index.js +1 -1
  59. package/dist/providers/react/loading.d.cts +0 -2
  60. package/dist/providers/react/loading.d.ts +0 -2
  61. package/dist/providers/react/next-intl.cjs +1 -1
  62. package/dist/providers/react/next-intl.d.cts +0 -2
  63. package/dist/providers/react/next-intl.d.ts +0 -2
  64. package/dist/providers/react/next-intl.js +1 -1
  65. package/dist/styles/reset.css +63 -0
  66. package/dist/styles/reset.d.cts +2 -0
  67. package/dist/styles/reset.d.ts +2 -0
  68. package/dist/typescript/apollo.cjs +1 -0
  69. package/dist/typescript/apollo.d.cts +21 -0
  70. package/dist/typescript/apollo.d.ts +21 -0
  71. package/dist/typescript/apollo.js +0 -0
  72. package/dist/typescript/graphql-codegen.cjs +1 -0
  73. package/dist/typescript/graphql-codegen.d.cts +12 -0
  74. package/dist/typescript/graphql-codegen.d.ts +12 -0
  75. package/dist/typescript/graphql-codegen.js +0 -0
  76. package/dist/typescript/index.cjs +1 -1
  77. package/dist/typescript/index.d.cts +5 -4
  78. package/dist/typescript/index.d.ts +5 -4
  79. package/dist/typescript/index.js +1 -1
  80. package/dist/typescript/mongoose.d.cts +2 -2
  81. package/dist/typescript/mongoose.d.ts +2 -2
  82. package/dist/typescript/react.d.cts +1 -23
  83. package/dist/typescript/react.d.ts +1 -23
  84. package/dist/utils/common.cjs +1 -0
  85. package/dist/utils/common.d.cts +5 -0
  86. package/dist/utils/common.d.ts +5 -0
  87. package/dist/utils/common.js +1 -0
  88. package/dist/utils/config.cjs +1 -1
  89. package/dist/utils/config.js +1 -1
  90. package/dist/utils/index.cjs +1 -1
  91. package/dist/utils/index.d.cts +1 -6
  92. package/dist/utils/index.d.ts +1 -6
  93. package/dist/utils/index.js +1 -1
  94. package/dist/utils/mongoose.d.cts +0 -21
  95. package/dist/utils/mongoose.d.ts +0 -21
  96. package/dist/utils/npm-package.d.cts +0 -12
  97. package/dist/utils/npm-package.d.ts +0 -12
  98. package/dist/utils/serializer.d.cts +1 -1
  99. package/dist/utils/serializer.d.ts +1 -1
  100. package/dist/utils/validate.d.cts +0 -19
  101. package/dist/utils/validate.d.ts +0 -19
  102. package/package.json +19 -12
  103. package/src/public/favicon/android-icon-144x144.png +0 -0
  104. package/src/public/favicon/android-icon-192x192.png +0 -0
  105. package/src/public/favicon/android-icon-36x36.png +0 -0
  106. package/src/public/favicon/android-icon-48x48.png +0 -0
  107. package/src/public/favicon/android-icon-72x72.png +0 -0
  108. package/src/public/favicon/android-icon-96x96.png +0 -0
  109. package/src/public/favicon/apple-icon-114x114.png +0 -0
  110. package/src/public/favicon/apple-icon-120x120.png +0 -0
  111. package/src/public/favicon/apple-icon-144x144.png +0 -0
  112. package/src/public/favicon/apple-icon-152x152.png +0 -0
  113. package/src/public/favicon/apple-icon-180x180.png +0 -0
  114. package/src/public/favicon/apple-icon-57x57.png +0 -0
  115. package/src/public/favicon/apple-icon-60x60.png +0 -0
  116. package/src/public/favicon/apple-icon-72x72.png +0 -0
  117. package/src/public/favicon/apple-icon-76x76.png +0 -0
  118. package/src/public/favicon/apple-icon-precomposed.png +0 -0
  119. package/src/public/favicon/apple-icon.png +0 -0
  120. package/src/public/favicon/browserconfig.xml +2 -0
  121. package/src/public/favicon/favicon-16x16.png +0 -0
  122. package/src/public/favicon/favicon-32x32.png +0 -0
  123. package/src/public/favicon/favicon-96x96.png +0 -0
  124. package/src/public/favicon/favicon.ico +0 -0
  125. package/src/public/favicon/manifest.json +41 -0
  126. package/src/public/favicon/ms-icon-144x144.png +0 -0
  127. package/src/public/favicon/ms-icon-150x150.png +0 -0
  128. package/src/public/favicon/ms-icon-310x310.png +0 -0
  129. package/src/public/favicon/ms-icon-70x70.png +0 -0
@@ -1,18 +1,6 @@
1
- /**
2
- * Get the latest version of an npm package (with cache).
3
- */
4
1
  declare function getLatestPackageVersion(packageName: string, forceRefresh?: boolean): Promise<string>;
5
- /**
6
- * Check if a package is outdated.
7
- */
8
2
  declare function isPackageOutdated(packageName: string, forceRefresh?: boolean): Promise<boolean>;
9
- /**
10
- * Update a package to the latest version.
11
- */
12
3
  declare function updatePackage(packageName: string): Promise<void>;
13
- /**
14
- * Check if current project matches a specific package name.
15
- */
16
4
  declare function isCurrentProject(WORKING_DIRECTORY: string, PACKAGE_NAME: string): boolean;
17
5
 
18
6
  export { getLatestPackageVersion, isCurrentProject, isPackageOutdated, updatePackage };
@@ -1,5 +1,5 @@
1
1
  import { I_Serializer } from '../typescript/serializer.cjs';
2
2
 
3
- declare const serializer: I_Serializer<any>;
3
+ declare const serializer: I_Serializer<unknown>;
4
4
 
5
5
  export { serializer };
@@ -1,5 +1,5 @@
1
1
  import { I_Serializer } from '../typescript/serializer.js';
2
2
 
3
- declare const serializer: I_Serializer<any>;
3
+ declare const serializer: I_Serializer<unknown>;
4
4
 
5
5
  export { serializer };
@@ -1,31 +1,12 @@
1
1
  declare const validate: {
2
2
  common: {
3
- /**
4
- * Check if a value is empty (null, undefined, empty string, empty array, or empty object).
5
- * @param {unknown} value - The value to check.
6
- * @returns {boolean} - True if the value is empty; otherwise, false.
7
- */
8
3
  isEmpty(value: unknown): boolean;
9
- /**
10
- * Validator to check if a value is not empty.
11
- * @returns {(value: unknown) => Promise<boolean>} - The validation function.
12
- */
13
4
  isEmptyValidator<T>(): (this: T, value: unknown) => Promise<boolean>;
14
- /**
15
- * Validator to check if a value is unique in specified fields.
16
- * @param {string[]} fields - Fields to check for uniqueness.
17
- * @returns {(value: unknown) => Promise<boolean>} - The validation function.
18
- */
19
5
  isUniqueValidator<T extends {
20
6
  constructor: {
21
7
  findOne: (query: Record<string, unknown>) => Promise<unknown>;
22
8
  };
23
9
  }>(fields: string[]): (this: T, value: unknown) => Promise<boolean>;
24
- /**
25
- * Validator to check if a value matches all regex patterns in an array.
26
- * @param {RegExp[]} regexArray - Array of regex patterns.
27
- * @returns {(value: string) => Promise<boolean>} - The validation function.
28
- */
29
10
  matchesRegexValidator(regexArray: RegExp[]): (value: string) => Promise<boolean>;
30
11
  };
31
12
  };
@@ -1,31 +1,12 @@
1
1
  declare const validate: {
2
2
  common: {
3
- /**
4
- * Check if a value is empty (null, undefined, empty string, empty array, or empty object).
5
- * @param {unknown} value - The value to check.
6
- * @returns {boolean} - True if the value is empty; otherwise, false.
7
- */
8
3
  isEmpty(value: unknown): boolean;
9
- /**
10
- * Validator to check if a value is not empty.
11
- * @returns {(value: unknown) => Promise<boolean>} - The validation function.
12
- */
13
4
  isEmptyValidator<T>(): (this: T, value: unknown) => Promise<boolean>;
14
- /**
15
- * Validator to check if a value is unique in specified fields.
16
- * @param {string[]} fields - Fields to check for uniqueness.
17
- * @returns {(value: unknown) => Promise<boolean>} - The validation function.
18
- */
19
5
  isUniqueValidator<T extends {
20
6
  constructor: {
21
7
  findOne: (query: Record<string, unknown>) => Promise<unknown>;
22
8
  };
23
9
  }>(fields: string[]): (this: T, value: unknown) => Promise<boolean>;
24
- /**
25
- * Validator to check if a value matches all regex patterns in an array.
26
- * @param {RegExp[]} regexArray - Array of regex patterns.
27
- * @returns {(value: string) => Promise<boolean>} - The validation function.
28
- */
29
10
  matchesRegexValidator(regexArray: RegExp[]): (value: string) => Promise<boolean>;
30
11
  };
31
12
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cyberskill/shared",
3
3
  "type": "module",
4
- "version": "1.29.0",
4
+ "version": "1.31.0",
5
5
  "description": "CyberSkill Shared",
6
6
  "author": "Stephen Cheng",
7
7
  "license": "MIT",
@@ -114,6 +114,10 @@
114
114
  "import": "./dist/providers/react/index.js",
115
115
  "require": "./dist/providers/react/index.cjs"
116
116
  },
117
+ "./styles/reset.css": {
118
+ "import": "./dist/styles/reset.css",
119
+ "require": "./dist/styles/reset.css"
120
+ },
117
121
  "./typescript": {
118
122
  "types": "./dist/typescript/index.d.ts",
119
123
  "import": "./dist/typescript/index.js",
@@ -142,7 +146,8 @@
142
146
  "cyberskill": "./dist/commands.js"
143
147
  },
144
148
  "files": [
145
- "dist"
149
+ "dist",
150
+ "src/public"
146
151
  ],
147
152
  "scripts": {
148
153
  "build": "tsup",
@@ -151,38 +156,39 @@
151
156
  "lint:fix": "npx tsx src/commands.ts lint:fix",
152
157
  "lint:inspect": "npx @eslint/config-inspector",
153
158
  "reset": "npx tsx src/commands.ts reset",
154
- "setup": "npx tsx src/commands.ts setup"
159
+ "setup": "npx tsx src/commands.ts setup",
160
+ "inspect": "npx tsx src/commands.ts inspect"
155
161
  },
156
162
  "dependencies": {
157
- "@antfu/eslint-config": "4.10.1",
158
- "@apollo/client": "3.13.4",
159
- "@apollo/experimental-nextjs-app-support": "0.11.11",
163
+ "@antfu/eslint-config": "4.10.2",
164
+ "@apollo/client": "3.13.5",
160
165
  "@commitlint/cli": "19.8.0",
161
166
  "@commitlint/config-conventional": "19.8.0",
162
- "@eslint-react/eslint-plugin": "1.35.0",
167
+ "@eslint-react/eslint-plugin": "1.37.3",
163
168
  "@eslint/config-inspector": "1.0.2",
164
169
  "@graphql-codegen/cli": "5.0.5",
165
170
  "@graphql-codegen/client-preset": "4.7.0",
166
171
  "@graphql-codegen/typescript-react-apollo": "4.3.2",
172
+ "@next/eslint-plugin-next": "15.2.3",
167
173
  "@swc/core": "1.11.11",
168
174
  "@testing-library/jest-dom": "6.6.3",
169
175
  "@testing-library/react": "16.2.0",
170
176
  "@types/crypto-js": "4.2.2",
171
177
  "@types/mongoose-aggregate-paginate-v2": "1.0.12",
172
178
  "@types/node-persist": "3.1.8",
173
- "@types/react": "19.0.11",
179
+ "@types/react": "19.0.12",
174
180
  "@types/react-dom": "19.0.4",
175
181
  "@types/unorm": "1.3.31",
176
182
  "@types/uuid": "10.0.0",
177
183
  "@types/yargs": "17.0.33",
178
- "@vitejs/plugin-react-swc": "3.8.0",
184
+ "@vitejs/plugin-react-swc": "3.8.1",
179
185
  "@vitest/browser": "3.0.9",
180
186
  "boxen": "8.0.1",
181
187
  "chalk": "5.4.1",
182
188
  "classnames": "2.5.1",
183
189
  "crypto-js": "4.2.0",
184
190
  "date-fns": "4.1.0",
185
- "eslint": "9.22.0",
191
+ "eslint": "9.23.0",
186
192
  "eslint-config-next": "15.2.3",
187
193
  "eslint-plugin-format": "1.0.1",
188
194
  "eslint-plugin-react-hooks": "5.2.0",
@@ -193,11 +199,12 @@
193
199
  "jsdom": "26.0.0",
194
200
  "lint-staged": "15.5.0",
195
201
  "localforage": "1.10.0",
196
- "mongoose": "8.12.1",
202
+ "mongoose": "8.12.2",
197
203
  "mongoose-aggregate-paginate-v2": "1.1.4",
198
204
  "mongoose-paginate-v2": "1.9.0",
199
205
  "next-intl": "4.0.2",
200
206
  "node-fetch": "3.3.2",
207
+ "node-modules-inspector": "0.5.7",
201
208
  "node-persist": "4.0.4",
202
209
  "ora": "8.2.0",
203
210
  "playwright": "1.51.1",
@@ -207,7 +214,7 @@
207
214
  "react-i18next": "15.4.1",
208
215
  "rimraf": "6.0.1",
209
216
  "sass": "1.86.0",
210
- "simple-git-hooks": "2.11.1",
217
+ "simple-git-hooks": "2.12.1",
211
218
  "slugify": "1.6.6",
212
219
  "tsup": "8.4.0",
213
220
  "tsx": "4.19.3",
@@ -0,0 +1,2 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <browserconfig><msapplication><tile><square70x70logo src="/ms-icon-70x70.png"/><square150x150logo src="/ms-icon-150x150.png"/><square310x310logo src="/ms-icon-310x310.png"/><TileColor>#ffffff</TileColor></tile></msapplication></browserconfig>
Binary file
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "App",
3
+ "icons": [
4
+ {
5
+ "src": "\/android-icon-36x36.png",
6
+ "sizes": "36x36",
7
+ "type": "image\/png",
8
+ "density": "0.75"
9
+ },
10
+ {
11
+ "src": "\/android-icon-48x48.png",
12
+ "sizes": "48x48",
13
+ "type": "image\/png",
14
+ "density": "1.0"
15
+ },
16
+ {
17
+ "src": "\/android-icon-72x72.png",
18
+ "sizes": "72x72",
19
+ "type": "image\/png",
20
+ "density": "1.5"
21
+ },
22
+ {
23
+ "src": "\/android-icon-96x96.png",
24
+ "sizes": "96x96",
25
+ "type": "image\/png",
26
+ "density": "2.0"
27
+ },
28
+ {
29
+ "src": "\/android-icon-144x144.png",
30
+ "sizes": "144x144",
31
+ "type": "image\/png",
32
+ "density": "3.0"
33
+ },
34
+ {
35
+ "src": "\/android-icon-192x192.png",
36
+ "sizes": "192x192",
37
+ "type": "image\/png",
38
+ "density": "4.0"
39
+ }
40
+ ]
41
+ }