@cyberskill/shared 2.19.1 → 2.21.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 (68) hide show
  1. package/dist/config/storybook/index.cjs +1 -0
  2. package/dist/config/storybook/index.d.ts +2 -0
  3. package/dist/config/storybook/index.js +6 -0
  4. package/dist/config/storybook/storybook.main.cjs +1 -0
  5. package/dist/config/storybook/storybook.main.d.ts +17 -0
  6. package/dist/config/storybook/storybook.main.js +18 -0
  7. package/dist/config/storybook/storybook.preview.cjs +1 -0
  8. package/dist/config/storybook/storybook.preview.d.ts +18 -0
  9. package/dist/config/storybook/storybook.preview.js +39 -0
  10. package/dist/config/vitest/vitest.e2e.cjs +1 -1
  11. package/dist/config/vitest/vitest.e2e.js +6 -6
  12. package/dist/config/vitest/vitest.unit.cjs +1 -1
  13. package/dist/config/vitest/vitest.unit.js +5 -5
  14. package/dist/node/cli/index.cjs +2 -2
  15. package/dist/node/cli/index.js +51 -41
  16. package/dist/node/express/express.util.cjs +1 -1
  17. package/dist/node/express/express.util.js +21 -21
  18. package/dist/node/mongo/mongo-controller.test.unit.d.ts +1 -0
  19. package/dist/node/mongo/mongo.test.unit.d.ts +1 -0
  20. package/dist/node/mongo/mongo.type.d.ts +2 -2
  21. package/dist/node/mongo/mongo.util.cjs +2 -2
  22. package/dist/node/mongo/mongo.util.d.ts +847 -147
  23. package/dist/node/mongo/mongo.util.js +70 -68
  24. package/dist/node/path/index.cjs +1 -1
  25. package/dist/node/path/index.js +27 -25
  26. package/dist/node/path/path.constant.cjs +1 -1
  27. package/dist/node/path/path.constant.d.ts +6 -0
  28. package/dist/node/path/path.constant.js +171 -143
  29. package/dist/node/path/path.test.unit.d.ts +1 -0
  30. package/dist/node/path/path.util.d.ts +2 -2
  31. package/dist/node/storage/index.cjs +1 -1
  32. package/dist/node/storage/index.d.ts +2 -0
  33. package/dist/node/storage/index.js +7 -2
  34. package/dist/node/storage/storage.constant.cjs +1 -0
  35. package/dist/node/storage/storage.constant.d.ts +4 -0
  36. package/dist/node/storage/storage.constant.js +7 -0
  37. package/dist/node/storage/storage.type.d.ts +14 -0
  38. package/dist/node/storage/storage.util.cjs +1 -1
  39. package/dist/node/storage/storage.util.d.ts +1 -1
  40. package/dist/node/storage/storage.util.js +160 -50
  41. package/dist/react/loading/loading.component.cjs +2 -2
  42. package/dist/react/loading/loading.component.js +32 -19
  43. package/dist/react/loading/loading.test.unit.d.ts +1 -0
  44. package/dist/react/loading/loading.type.d.ts +2 -1
  45. package/dist/util/common/common.test.unit.d.ts +1 -0
  46. package/dist/util/common/common.util.cjs +1 -1
  47. package/dist/util/common/common.util.js +14 -15
  48. package/dist/util/index.cjs +1 -1
  49. package/dist/util/index.js +16 -15
  50. package/dist/util/object/index.cjs +1 -1
  51. package/dist/util/object/index.js +4 -3
  52. package/dist/util/object/object.test.unit.d.ts +1 -0
  53. package/dist/util/object/object.util.cjs +1 -1
  54. package/dist/util/object/object.util.d.ts +10 -30
  55. package/dist/util/object/object.util.js +102 -69
  56. package/dist/util/serializer/serializer.test.unit.d.ts +1 -0
  57. package/dist/util/serializer/serializer.util.cjs +1 -1
  58. package/dist/util/serializer/serializer.util.js +19 -16
  59. package/dist/util/string/string.test.unit.d.ts +1 -0
  60. package/dist/util/string/string.util.cjs +1 -1
  61. package/dist/util/string/string.util.d.ts +4 -3
  62. package/dist/util/string/string.util.js +32 -41
  63. package/dist/util/validate/validate.test.unit.d.ts +1 -0
  64. package/dist/util/validate/validate.util.cjs +1 -1
  65. package/dist/util/validate/validate.util.js +9 -9
  66. package/package.json +49 -52
  67. /package/dist/node_modules/.pnpm/{vitest@4.0.9_@types_debug@4.1.12_@types_node@24.10.1_jiti@2.6.1_jsdom@27.2.0_sass@1.94.0_tsx@4.20.6_yaml@2.8.1 → vitest@4.0.16_@types_node@25.0.3_jiti@2.6.1_jsdom@27.3.0_sass@1.97.0_tsx@4.21.0_yaml@2.8.2}/node_modules/vitest/dist/config.cjs +0 -0
  68. /package/dist/node_modules/.pnpm/{vitest@4.0.9_@types_debug@4.1.12_@types_node@24.10.1_jiti@2.6.1_jsdom@27.2.0_sass@1.94.0_tsx@4.20.6_yaml@2.8.1 → vitest@4.0.16_@types_node@25.0.3_jiti@2.6.1_jsdom@27.3.0_sass@1.97.0_tsx@4.21.0_yaml@2.8.2}/node_modules/vitest/dist/config.js +0 -0
@@ -1,291 +1,319 @@
1
- import h from "fs-extra";
2
- import { resolveWorkingPath as E, join as d } from "./path.util.js";
1
+ import F from "fs-extra";
2
+ import { resolveWorkingPath as s, join as y } from "./path.util.js";
3
3
  import { E_CommandType as e } from "../command/command.type.js";
4
4
  import { formatCommand as g, rawCommand as D } from "../command/command.util.js";
5
- import { setupPackages as F } from "../package/package.util.js";
6
- import { E_PackageType as c } from "../package/package.type.js";
7
- import { getEnv as V } from "../../config/env/env.util.js";
8
- var w = Object.defineProperty, P = Object.getOwnPropertySymbols, j = Object.prototype.hasOwnProperty, H = Object.prototype.propertyIsEnumerable, M = (s, o, n) => o in s ? w(s, o, { enumerable: !0, configurable: !0, writable: !0, value: n }) : s[o] = n, U = (s, o) => {
9
- for (var n in o || (o = {}))
10
- j.call(o, n) && M(s, n, o[n]);
11
- if (P)
12
- for (var n of P(o))
13
- H.call(o, n) && M(s, n, o[n]);
14
- return s;
15
- }, b = (s, o, n) => new Promise((p, I) => {
16
- var C = (a) => {
5
+ import { setupPackages as b } from "../package/package.util.js";
6
+ import { E_PackageType as n } from "../package/package.type.js";
7
+ import { getEnv as w } from "../../config/env/env.util.js";
8
+ var j = Object.defineProperty, L = Object.getOwnPropertySymbols, B = Object.prototype.hasOwnProperty, H = Object.prototype.propertyIsEnumerable, P = (c, E, o) => E in c ? j(c, E, { enumerable: !0, configurable: !0, writable: !0, value: o }) : c[E] = o, U = (c, E) => {
9
+ for (var o in E || (E = {}))
10
+ B.call(E, o) && P(c, o, E[o]);
11
+ if (L)
12
+ for (var o of L(E))
13
+ H.call(E, o) && P(c, o, E[o]);
14
+ return c;
15
+ }, J = (c, E, o) => new Promise((p, I) => {
16
+ var C = (_) => {
17
17
  try {
18
- O(n.next(a));
18
+ O(o.next(_));
19
19
  } catch (T) {
20
20
  I(T);
21
21
  }
22
- }, N = (a) => {
22
+ }, N = (_) => {
23
23
  try {
24
- O(n.throw(a));
24
+ O(o.throw(_));
25
25
  } catch (T) {
26
26
  I(T);
27
27
  }
28
- }, O = (a) => a.done ? p(a.value) : Promise.resolve(a.value).then(C, N);
29
- O((n = n.apply(s, o)).next());
28
+ }, O = (_) => _.done ? p(_.value) : Promise.resolve(_.value).then(C, N);
29
+ O((o = o.apply(c, E)).next());
30
30
  });
31
- const J = V(), L = J.CWD, S = "@cyberskill/shared", R = "node_modules", y = "dist", x = "public", K = "package.json", B = "package-lock.json", W = "tsconfig.json", X = ".gitignore", q = ".simple-git-hooks.json", z = "pnpm-lock.yaml", Q = ".git/hooks/", Z = ".git/COMMIT_EDITMSG", ee = ".migrate-mongo.config.js", r = h.readJsonSync(E(K)).name === S ? d(L, y) : d(L, R, S, y), De = "cyberskill", Le = "src/node/cli/index.ts", A = "eslint", u = "eslint", f = "vitest", $ = "vitest", te = "@commitlint/cli", ne = "@commitlint/config-conventional", k = "commitlint", oe = "lint-staged", Y = "lint-staged", ce = "typescript", se = "tsc", m = "tsx", v = "git", i = "pnpm", Ee = "pnpm exec", _e = "simple-git-hooks", ae = "simple-git-hooks", Ie = "@eslint/config-inspector", me = "eslint-config-inspector", ie = "node-modules-inspector", pe = "node-modules-inspector", l = "migrate-mongo", G = "./node_modules/migrate-mongo/bin/migrate-mongo", _ = {
32
- CYBERSKILL_DIRECTORY: r,
33
- WORKING_DIRECTORY: L,
34
- PUBLIC_DIRECTORY: E(x),
35
- TS_CONFIG: E(W),
36
- GIT_IGNORE: E(X),
37
- GIT_HOOK: E(Q),
38
- GIT_COMMIT_MSG: E(Z),
39
- SIMPLE_GIT_HOOKS_JSON: E(q),
40
- PACKAGE_JSON: E(K),
41
- PACKAGE_LOCK_JSON: E(B),
42
- PNPM_LOCK_YAML: E(z),
43
- NODE_MODULES: E(R),
44
- MIGRATE_MONGO_CONFIG: E(ee),
45
- LINT_STAGED_CONFIG: E(`${r}/config/lint-staged/index.js`),
46
- COMMITLINT_CONFIG: E(`${r}/config/commitlint/index.js`),
47
- VITEST_UNIT_CONFIG: E(`${r}/config/vitest/vitest.unit.js`),
48
- VITEST_E2E_CONFIG: E(`${r}/config/vitest/vitest.e2e.js`)
31
+ const x = w(), d = x.CWD, M = "@cyberskill/shared", K = "node_modules", S = "dist", W = "public", Y = "package.json", X = "package-lock.json", q = "tsconfig.json", z = ".gitignore", Z = ".simple-git-hooks.json", Q = "pnpm-lock.yaml", ee = ".git/hooks/", te = ".git/COMMIT_EDITMSG", ne = ".migrate-mongo.config.js", m = F.readJsonSync(s(Y)).name === M ? y(d, S) : y(d, K, M, S), ye = "cyberskill", ge = "src/node/cli/index.ts", A = "eslint", u = "eslint", f = "vitest", $ = "vitest", oe = "@commitlint/cli", se = "@commitlint/config-conventional", h = "commitlint", ce = "lint-staged", v = "lint-staged", Ee = "typescript", ae = "tsc", i = "tsx", V = "git", r = "pnpm", _e = "pnpm exec", me = "simple-git-hooks", Ie = "simple-git-hooks", ie = "@eslint/config-inspector", re = "eslint-config-inspector", pe = "node-modules-inspector", Ce = "node-modules-inspector", l = "migrate-mongo", G = "./node_modules/migrate-mongo/bin/migrate-mongo", R = "storybook", k = "storybook", a = {
32
+ CYBERSKILL_DIRECTORY: m,
33
+ WORKING_DIRECTORY: d,
34
+ PUBLIC_DIRECTORY: s(W),
35
+ TS_CONFIG: s(q),
36
+ GIT_IGNORE: s(z),
37
+ GIT_HOOK: s(ee),
38
+ GIT_COMMIT_MSG: s(te),
39
+ SIMPLE_GIT_HOOKS_JSON: s(Z),
40
+ PACKAGE_JSON: s(Y),
41
+ PACKAGE_LOCK_JSON: s(X),
42
+ PNPM_LOCK_YAML: s(Q),
43
+ NODE_MODULES: s(K),
44
+ MIGRATE_MONGO_CONFIG: s(ne),
45
+ LINT_STAGED_CONFIG: s(`${m}/config/lint-staged/index.js`),
46
+ COMMITLINT_CONFIG: s(`${m}/config/commitlint/index.js`),
47
+ VITEST_UNIT_CONFIG: s(`${m}/config/vitest/vitest.unit.js`),
48
+ VITEST_E2E_CONFIG: s(`${m}/config/vitest/vitest.e2e.js`),
49
+ STORYBOOK_MAIN_CONFIG: s(`${m}/config/storybook/storybook.main.js`),
50
+ STORYBOOK_PREVIEW_CONFIG: s(`${m}/config/storybook/storybook.preview.js`)
49
51
  };
50
- function de({ isCurrentProject: s }) {
52
+ function Le({ isCurrentProject: c }) {
51
53
  return U({
52
- "pre-commit": Y,
53
- "commit-msg": k
54
- }, s && { "pre-push": D(`${v} pull`) });
54
+ "pre-commit": v,
55
+ "commit-msg": h
56
+ }, c && { "pre-push": D(`${V} pull`) });
55
57
  }
56
- function t({ type: s, packages: o, command: n }) {
57
- const p = o == null ? void 0 : o.reduce((I, C) => (I.some((N) => N.name === C.name) || I.push(C), I), []);
58
- return () => b(null, null, function* () {
59
- switch (s) {
58
+ function t({ type: c, packages: E, command: o }) {
59
+ const p = E == null ? void 0 : E.reduce((I, C) => (I.some((N) => N.name === C.name) || I.push(C), I), []);
60
+ return () => J(null, null, function* () {
61
+ switch (c) {
60
62
  case e.CLI:
61
- return p != null && p.length && (yield F(p, {
63
+ return p != null && p.length && (yield b(p, {
62
64
  install: !0
63
- })), g(D(`${Ee} ${n}`));
65
+ })), g(D(`${_e} ${o}`));
64
66
  case e.STRING:
65
- return g(D(n));
67
+ return g(D(o));
66
68
  default:
67
69
  throw new Error("Unsupported command type");
68
70
  }
69
71
  });
70
72
  }
71
- const ge = {
73
+ const Pe = {
72
74
  simpleGitHooks: t({
73
75
  type: e.CLI,
74
76
  packages: [
75
77
  {
76
- name: _e,
77
- type: c.DEV_DEPENDENCY
78
+ name: me,
79
+ type: n.DEV_DEPENDENCY
78
80
  }
79
81
  ],
80
- command: ae
82
+ command: Ie
81
83
  }),
82
84
  eslintInspect: t({
83
85
  type: e.CLI,
84
86
  packages: [
85
87
  {
86
- name: Ie,
87
- type: c.DEV_DEPENDENCY
88
+ name: ie,
89
+ type: n.DEV_DEPENDENCY
88
90
  }
89
91
  ],
90
- command: me
92
+ command: re
91
93
  }),
92
94
  nodeModulesInspect: t({
93
95
  type: e.CLI,
94
96
  packages: [
95
97
  {
96
- name: ie,
97
- type: c.DEV_DEPENDENCY
98
+ name: pe,
99
+ type: n.DEV_DEPENDENCY
98
100
  }
99
101
  ],
100
- command: pe
102
+ command: Ce
101
103
  }),
102
104
  eslintCheck: t({
103
105
  type: e.CLI,
104
106
  packages: [
105
107
  {
106
108
  name: A,
107
- type: c.DEV_DEPENDENCY
109
+ type: n.DEV_DEPENDENCY
108
110
  }
109
111
  ],
110
- command: `${u} ${_.WORKING_DIRECTORY} --no-cache`
112
+ command: `${u} ${a.WORKING_DIRECTORY} --no-cache`
111
113
  }),
112
114
  eslintFix: t({
113
115
  type: e.CLI,
114
116
  packages: [
115
117
  {
116
118
  name: A,
117
- type: c.DEV_DEPENDENCY
119
+ type: n.DEV_DEPENDENCY
118
120
  }
119
121
  ],
120
- command: `${u} ${_.WORKING_DIRECTORY} --fix --no-cache`
122
+ command: `${u} ${a.WORKING_DIRECTORY} --fix --no-cache`
121
123
  }),
122
124
  typescriptCheck: t({
123
125
  type: e.CLI,
124
126
  packages: [
125
127
  {
126
- name: ce,
127
- type: c.DEV_DEPENDENCY
128
+ name: Ee,
129
+ type: n.DEV_DEPENDENCY
128
130
  }
129
131
  ],
130
- command: `${se} -p ${_.TS_CONFIG} --noEmit`
132
+ command: `${ae} -p ${a.TS_CONFIG} --noEmit`
131
133
  }),
132
134
  testUnit: t({
133
135
  type: e.CLI,
134
136
  packages: [
135
137
  {
136
138
  name: f,
137
- type: c.DEV_DEPENDENCY
139
+ type: n.DEV_DEPENDENCY
138
140
  }
139
141
  ],
140
- command: `${$} --config ${_.VITEST_UNIT_CONFIG}`
142
+ command: `${$} --config ${a.VITEST_UNIT_CONFIG}`
141
143
  }),
142
144
  testE2e: t({
143
145
  type: e.CLI,
144
146
  packages: [
145
147
  {
146
148
  name: f,
147
- type: c.DEV_DEPENDENCY
149
+ type: n.DEV_DEPENDENCY
148
150
  }
149
151
  ],
150
- command: `${$} --config ${_.VITEST_E2E_CONFIG}`
152
+ command: `${$} --config ${a.VITEST_E2E_CONFIG}`
151
153
  }),
152
- mongoMigrateCreate: (s) => t({
153
- type: e.CLI,
154
- packages: [
155
- {
156
- name: m,
157
- type: c.DEPENDENCY
158
- },
159
- {
160
- name: l,
161
- type: c.DEPENDENCY
162
- }
163
- ],
164
- command: `${m} ${G} create ${s} -f ${_.MIGRATE_MONGO_CONFIG}`
165
- })(),
154
+ mongoMigrateCreate: (c) => {
155
+ if (!/^[a-zA-Z0-9_-]+$/.test(c))
156
+ throw new Error("Migration name must only contain alphanumeric characters, underscores, and hyphens.");
157
+ return t({
158
+ type: e.CLI,
159
+ packages: [
160
+ {
161
+ name: i,
162
+ type: n.DEPENDENCY
163
+ },
164
+ {
165
+ name: l,
166
+ type: n.DEPENDENCY
167
+ }
168
+ ],
169
+ command: `${i} ${G} create ${c} -f ${a.MIGRATE_MONGO_CONFIG}`
170
+ })();
171
+ },
166
172
  mongoMigrateUp: t({
167
173
  type: e.CLI,
168
174
  packages: [
169
175
  {
170
- name: m,
171
- type: c.DEPENDENCY
176
+ name: i,
177
+ type: n.DEPENDENCY
172
178
  },
173
179
  {
174
180
  name: l,
175
- type: c.DEPENDENCY
181
+ type: n.DEPENDENCY
176
182
  }
177
183
  ],
178
- command: `${m} ${G} up -f ${_.MIGRATE_MONGO_CONFIG}`
184
+ command: `${i} ${G} up -f ${a.MIGRATE_MONGO_CONFIG}`
179
185
  }),
180
186
  mongoMigrateDown: t({
181
187
  type: e.CLI,
182
188
  packages: [
183
189
  {
184
- name: m,
185
- type: c.DEPENDENCY
190
+ name: i,
191
+ type: n.DEPENDENCY
186
192
  },
187
193
  {
188
194
  name: l,
189
- type: c.DEPENDENCY
195
+ type: n.DEPENDENCY
190
196
  }
191
197
  ],
192
- command: `${m} ${G} down -f ${_.MIGRATE_MONGO_CONFIG}`
198
+ command: `${i} ${G} down -f ${a.MIGRATE_MONGO_CONFIG}`
193
199
  }),
194
200
  commitLint: t({
195
201
  type: e.CLI,
196
202
  packages: [
197
203
  {
198
- name: te,
199
- type: c.DEV_DEPENDENCY
204
+ name: oe,
205
+ type: n.DEV_DEPENDENCY
200
206
  },
201
207
  {
202
- name: ne,
203
- type: c.DEV_DEPENDENCY
208
+ name: se,
209
+ type: n.DEV_DEPENDENCY
204
210
  }
205
211
  ],
206
- command: `${k} --edit ${_.GIT_COMMIT_MSG} --config ${_.COMMITLINT_CONFIG}`
212
+ command: `${h} --edit ${a.GIT_COMMIT_MSG} --config ${a.COMMITLINT_CONFIG}`
207
213
  }),
208
214
  lintStaged: t({
209
215
  type: e.CLI,
210
216
  packages: [
211
217
  {
212
- name: oe,
213
- type: c.DEV_DEPENDENCY
218
+ name: ce,
219
+ type: n.DEV_DEPENDENCY
214
220
  }
215
221
  ],
216
- command: `${Y} --config ${_.LINT_STAGED_CONFIG}`
222
+ command: `${v} --config ${a.LINT_STAGED_CONFIG}`
217
223
  }),
218
224
  configureGitHook: t({
219
225
  type: e.STRING,
220
- command: `${v} config core.hooksPath ${_.GIT_HOOK}`
226
+ command: `${V} config core.hooksPath ${a.GIT_HOOK}`
221
227
  }),
222
228
  build: t({
223
229
  type: e.STRING,
224
- command: `${i} run --if-present build`
230
+ command: `${r} run --if-present build`
225
231
  }),
226
232
  pnpmInstallStandard: t({
227
233
  type: e.STRING,
228
- command: `${i} install --ignore-scripts`
234
+ command: `${r} install --ignore-scripts`
229
235
  }),
230
236
  pnpmInstallLegacy: t({
231
237
  type: e.STRING,
232
- command: `${i} install --ignore-scripts --legacy-peer-deps`
238
+ command: `${r} install --ignore-scripts --legacy-peer-deps`
233
239
  }),
234
240
  pnpmInstallForce: t({
235
241
  type: e.STRING,
236
- command: `${i} install --ignore-scripts --force`
242
+ command: `${r} install --ignore-scripts --force`
237
243
  }),
238
244
  pnpmPruneStore: t({
239
245
  type: e.STRING,
240
- command: `${i} store prune`
246
+ command: `${r} store prune`
241
247
  }),
242
248
  pnpmCleanCache: t({
243
249
  type: e.STRING,
244
- command: `${i} cache delete`
250
+ command: `${r} cache delete`
251
+ }),
252
+ storybookDev: t({
253
+ type: e.CLI,
254
+ packages: [
255
+ {
256
+ name: R,
257
+ type: n.DEV_DEPENDENCY
258
+ }
259
+ ],
260
+ command: `${k} dev`
261
+ }),
262
+ storybookBuild: t({
263
+ type: e.CLI,
264
+ packages: [
265
+ {
266
+ name: R,
267
+ type: n.DEV_DEPENDENCY
268
+ }
269
+ ],
270
+ command: `${k} build`
245
271
  })
246
272
  };
247
273
  export {
248
- y as BUILD_DIRECTORY,
249
- k as COMMIT_LINT_CLI,
250
- ne as COMMIT_LINT_CONVENTIONAL_CONFIG_PACKAGE_NAME,
251
- te as COMMIT_LINT_PACKAGE_NAME,
252
- De as CYBERSKILL_CLI,
253
- Le as CYBERSKILL_CLI_PATH,
254
- r as CYBERSKILL_DIRECTORY,
255
- S as CYBERSKILL_PACKAGE_NAME,
274
+ S as BUILD_DIRECTORY,
275
+ h as COMMIT_LINT_CLI,
276
+ se as COMMIT_LINT_CONVENTIONAL_CONFIG_PACKAGE_NAME,
277
+ oe as COMMIT_LINT_PACKAGE_NAME,
278
+ ye as CYBERSKILL_CLI,
279
+ ge as CYBERSKILL_CLI_PATH,
280
+ m as CYBERSKILL_DIRECTORY,
281
+ M as CYBERSKILL_PACKAGE_NAME,
256
282
  u as ESLINT_CLI,
257
- me as ESLINT_INSPECT_CLI,
258
- Ie as ESLINT_INSPECT_PACKAGE_NAME,
283
+ re as ESLINT_INSPECT_CLI,
284
+ ie as ESLINT_INSPECT_PACKAGE_NAME,
259
285
  A as ESLINT_PACKAGE_NAME,
260
- v as GIT_CLI,
261
- Z as GIT_COMMIT_EDITMSG,
262
- Q as GIT_HOOK,
263
- X as GIT_IGNORE,
264
- Y as LINT_STAGED_CLI,
265
- oe as LINT_STAGED_PACKAGE_NAME,
286
+ V as GIT_CLI,
287
+ te as GIT_COMMIT_EDITMSG,
288
+ ee as GIT_HOOK,
289
+ z as GIT_IGNORE,
290
+ v as LINT_STAGED_CLI,
291
+ ce as LINT_STAGED_PACKAGE_NAME,
266
292
  G as MIGRATE_MONGO_CLI,
267
- ee as MIGRATE_MONGO_CONFIG,
293
+ ne as MIGRATE_MONGO_CONFIG,
268
294
  l as MIGRATE_MONGO_PACKAGE_NAME,
269
- R as NODE_MODULES,
270
- pe as NODE_MODULES_INSPECT_CLI,
271
- ie as NODE_MODULES_INSPECT_PACKAGE_NAME,
272
- K as PACKAGE_JSON,
273
- B as PACKAGE_LOCK_JSON,
274
- _ as PATH,
275
- i as PNPM_CLI,
276
- Ee as PNPM_EXEC_CLI,
277
- z as PNPM_LOCK_YAML,
278
- x as PUBLIC_DIRECTORY,
279
- _e as SIMPLE_GIT_HOOKS_PACKAGE_NAME,
280
- ae as SIMPLE_GIT_HOOK_CLI,
281
- q as SIMPLE_GIT_HOOK_JSON,
282
- W as TSCONFIG_JSON,
283
- se as TSC_CLI,
284
- ce as TSC_PACKAGE_NAME,
285
- m as TSX_CLI,
295
+ K as NODE_MODULES,
296
+ Ce as NODE_MODULES_INSPECT_CLI,
297
+ pe as NODE_MODULES_INSPECT_PACKAGE_NAME,
298
+ Y as PACKAGE_JSON,
299
+ X as PACKAGE_LOCK_JSON,
300
+ a as PATH,
301
+ r as PNPM_CLI,
302
+ _e as PNPM_EXEC_CLI,
303
+ Q as PNPM_LOCK_YAML,
304
+ W as PUBLIC_DIRECTORY,
305
+ me as SIMPLE_GIT_HOOKS_PACKAGE_NAME,
306
+ Ie as SIMPLE_GIT_HOOK_CLI,
307
+ Z as SIMPLE_GIT_HOOK_JSON,
308
+ k as STORYBOOK_CLI,
309
+ R as STORYBOOK_PACKAGE_NAME,
310
+ q as TSCONFIG_JSON,
311
+ ae as TSC_CLI,
312
+ Ee as TSC_PACKAGE_NAME,
313
+ i as TSX_CLI,
286
314
  $ as VITEST_CLI,
287
315
  f as VITEST_PACKAGE_NAME,
288
- L as WORKING_DIRECTORY,
289
- ge as command,
290
- de as createGitHooksConfig
316
+ d as WORKING_DIRECTORY,
317
+ Pe as command,
318
+ Le as createGitHooksConfig
291
319
  };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,6 +1,6 @@
1
1
  import { default as pathNode } from 'node:path';
2
- export declare const path: pathNode.PlatformPath;
3
- export declare const dirname: (path: string) => string;
2
+ export declare const path: typeof pathNode;
3
+ export declare const dirname: typeof pathNode.dirname;
4
4
  /**
5
5
  * Resolves a path relative to the current working directory.
6
6
  * This function creates an absolute path by combining the current working directory
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./storage.util.cjs");exports.storage=e.storage;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("./storage.constant.cjs"),_=require("./storage.util.cjs");exports.NODE_FS_DRIVER_NAME=E.NODE_FS_DRIVER_NAME;exports.STORAGE_INSTANCE_NAME=E.STORAGE_INSTANCE_NAME;exports.STORAGE_KEY_EXTENSION=E.STORAGE_KEY_EXTENSION;exports.STORAGE_STORE_NAME=E.STORAGE_STORE_NAME;exports.storage=_.storage;
@@ -1 +1,3 @@
1
+ export * from './storage.constant.js';
2
+ export * from './storage.type.js';
1
3
  export * from './storage.util.js';
@@ -1,4 +1,9 @@
1
- import { storage as e } from "./storage.util.js";
1
+ import { NODE_FS_DRIVER_NAME as N, STORAGE_INSTANCE_NAME as A, STORAGE_KEY_EXTENSION as S, STORAGE_STORE_NAME as O } from "./storage.constant.js";
2
+ import { storage as T } from "./storage.util.js";
2
3
  export {
3
- e as storage
4
+ N as NODE_FS_DRIVER_NAME,
5
+ A as STORAGE_INSTANCE_NAME,
6
+ S as STORAGE_KEY_EXTENSION,
7
+ O as STORAGE_STORE_NAME,
8
+ T as storage
4
9
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E="localforage-node-fs",_=".json",N="cyberskill",S="node-storage";exports.NODE_FS_DRIVER_NAME=E;exports.STORAGE_INSTANCE_NAME=N;exports.STORAGE_KEY_EXTENSION=_;exports.STORAGE_STORE_NAME=S;
@@ -0,0 +1,4 @@
1
+ export declare const NODE_FS_DRIVER_NAME = "localforage-node-fs";
2
+ export declare const STORAGE_KEY_EXTENSION = ".json";
3
+ export declare const STORAGE_INSTANCE_NAME = "cyberskill";
4
+ export declare const STORAGE_STORE_NAME = "node-storage";
@@ -0,0 +1,7 @@
1
+ const E = "localforage-node-fs", o = ".json", _ = "cyberskill", s = "node-storage";
2
+ export {
3
+ E as NODE_FS_DRIVER_NAME,
4
+ _ as STORAGE_INSTANCE_NAME,
5
+ o as STORAGE_KEY_EXTENSION,
6
+ s as STORAGE_STORE_NAME
7
+ };
@@ -0,0 +1,14 @@
1
+ import { default as localForage } from 'localforage';
2
+ export type LocalForageDriver = Parameters<typeof localForage.defineDriver>[0];
3
+ export interface NodeLocalForageOptions {
4
+ driver?: string | string[];
5
+ size?: number;
6
+ version?: number;
7
+ description?: string;
8
+ name?: string;
9
+ storeName?: string;
10
+ baseDir?: string;
11
+ }
12
+ export interface NodeFsDriverState {
13
+ baseDir: string;
14
+ }
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("node-persist"),f=require("../../config/env/env.util.cjs"),u=require("../log/log.util.cjs");var l=(r,e,n)=>new Promise((h,a)=>{var d=t=>{try{c(n.next(t))}catch(s){a(s)}},v=t=>{try{c(n.throw(t))}catch(s){a(s)}},c=t=>t.done?h(t.value):Promise.resolve(t.value).then(d,v);c((n=n.apply(r,e)).next())});const y=f.getEnv();function o(){return l(this,null,function*(){i.defaultInstance||(yield i.init({dir:y.CYBERSKILL_STORAGE_DIRECTORY}))})}const E={get(r){return l(this,null,function*(){try{yield o();const e=yield i.getItem(r);return e!=null?e:null}catch(e){return u.catchError(e,{returnValue:null})}})},set(r,e){return l(this,null,function*(){try{yield o(),yield i.setItem(r,e)}catch(n){u.catchError(n)}})},remove(r){return l(this,null,function*(){try{yield o(),yield i.removeItem(r)}catch(e){u.catchError(e)}})},keys(){return l(this,null,function*(){try{yield o();const r=yield i.keys();return Array.isArray(r)?r:(u.log.warn("[Storage:keys] Invalid keys response:",r),[])}catch(r){return u.catchError(r,{returnValue:[]})}})},getLogLink(r){return l(this,null,function*(){try{return`${y.CYBERSKILL_STORAGE_DIRECTORY} (key: ${r})`}catch(e){return u.catchError(e,{returnValue:null})}})}};exports.storage=E;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("localforage"),o=require("node:fs/promises"),D=require("node:path"),c=require("./storage.constant.cjs"),I=require("../../config/env/env.util.cjs"),s=require("../log/log.util.cjs");var n=(e,r,t)=>new Promise((i,y)=>{var h=u=>{try{v(t.next(u))}catch(_){y(_)}},O=u=>{try{v(t.throw(u))}catch(_){y(_)}},v=u=>u.done?i(u.value):Promise.resolve(u.value).then(h,O);v((t=t.apply(e,r)).next())});const E=I.getEnv(),l={baseDir:E.CYBERSKILL_STORAGE_DIRECTORY};function m(e){return`${encodeURIComponent(e)}${c.STORAGE_KEY_EXTENSION}`}function N(e){return decodeURIComponent(e.slice(0,-c.STORAGE_KEY_EXTENSION.length))}function R(e,r){return D.join(r,m(e))}const d={_driver:c.NODE_FS_DRIVER_NAME,_support:!0,_initStorage(e){return n(this,null,function*(){try{const r=typeof e=="object"&&e!==null&&"baseDir"in e?e.baseDir:void 0;typeof r=="string"&&r.length>0?l.baseDir=r:l.baseDir=E.CYBERSKILL_STORAGE_DIRECTORY,yield o.mkdir(l.baseDir,{recursive:!0})}catch(r){throw s.log.error("[Storage:init]",r),r}})},clear(){return n(this,null,function*(){const{baseDir:e}=l;yield o.rm(e,{recursive:!0,force:!0}),yield o.mkdir(e,{recursive:!0})})},getItem(e){return n(this,null,function*(){const{baseDir:r}=l,t=R(e,r);try{const i=yield o.readFile(t,"utf8");return JSON.parse(i)}catch(i){if(i.code==="ENOENT")return null;throw i}})},iterate(e){return n(this,null,function*(){const r=yield d.keys();let t=1;for(const i of r){const y=yield d.getItem(i),h=e(y,i,t);if(h!==void 0)return h;t+=1}})},key(e){return n(this,null,function*(){var r;return(r=(yield d.keys())[e])!=null?r:null})},keys(){return n(this,null,function*(){const{baseDir:e}=l;try{return(yield o.readdir(e)).filter(t=>t.endsWith(c.STORAGE_KEY_EXTENSION)).map(N)}catch(r){if(r.code==="ENOENT")return[];throw r}})},length(){return n(this,null,function*(){return(yield d.keys()).length})},removeItem(e){return n(this,null,function*(){const{baseDir:r}=l,t=R(e,r);yield o.rm(t,{force:!0})})},setItem(e,r){return n(this,null,function*(){const{baseDir:t}=l,i=R(e,t);return yield o.mkdir(t,{recursive:!0}),yield o.writeFile(i,JSON.stringify(r),"utf8"),r})}};let a=null,S=null;function f(){return n(this,null,function*(){return a?(yield a,S):(a=n(null,null,function*(){yield g.defineDriver(d),l.baseDir=E.CYBERSKILL_STORAGE_DIRECTORY;const e=yield g.getDriver(c.NODE_FS_DRIVER_NAME),r={baseDir:l.baseDir,name:c.STORAGE_INSTANCE_NAME,storeName:c.STORAGE_STORE_NAME};yield e._initStorage(r),S=e}).catch(e=>{throw a=null,e}),yield a,S)})}const T={get(e){return n(this,null,function*(){try{const t=yield(yield f()).getItem(e);return t!=null?t:null}catch(r){return s.catchError(r,{returnValue:null})}})},set(e,r){return n(this,null,function*(){try{yield(yield f()).setItem(e,r)}catch(t){s.catchError(t)}})},remove(e){return n(this,null,function*(){try{yield(yield f()).removeItem(e)}catch(r){s.catchError(r)}})},keys(){return n(this,null,function*(){try{const r=yield(yield f()).keys();return Array.isArray(r)?r:(s.log.warn("[Storage:keys] Invalid keys response:",r),[])}catch(e){return s.catchError(e,{returnValue:[]})}})},getLogLink(e){return n(this,null,function*(){try{return`${D.join(E.CYBERSKILL_STORAGE_DIRECTORY,m(e))} (key: ${e})`}catch(r){return s.catchError(r,{returnValue:null})}})}};exports.storage=T;
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Persistent storage utility object for data persistence across application sessions.
3
- * This object provides methods for storing, retrieving, and managing data using node-persist,
3
+ * This object provides methods for storing, retrieving, and managing data using localForage,
4
4
  * with automatic initialization and error handling.
5
5
  */
6
6
  export declare const storage: {