@cyberskill/shared 1.203.0 → 1.205.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 (89) hide show
  1. package/dist/config.util-Ci2CZDut.cjs +1 -0
  2. package/dist/config.util-DKBwEBKR.js +61 -0
  3. package/dist/log.type-CMvG6Box.cjs +1 -0
  4. package/dist/{src/node/log/log.type.js → log.type-DTOvZHyz.js} +1 -1
  5. package/dist/magic-string.es-C6Zk6wMx.js +671 -0
  6. package/dist/magic-string.es-CjWtD8Pa.cjs +10 -0
  7. package/dist/path.constant-CWtb99gS.cjs +2 -0
  8. package/dist/{path.constant-DJq0jtD0.js → path.constant-CvSr0Rrx.js} +186 -185
  9. package/dist/src/config/config.util.cjs +1 -1
  10. package/dist/src/config/config.util.js +7 -58
  11. package/dist/src/config/eslint/index.d.ts +8 -0
  12. package/dist/src/config/index.cjs +1 -1
  13. package/dist/src/config/index.js +2 -3
  14. package/dist/src/config/vitest/vitest.unit.cjs +1 -1
  15. package/dist/src/config/vitest/vitest.unit.js +1 -1
  16. package/dist/src/config/vitest/vitest.unit.setup.cjs +1 -1
  17. package/dist/src/config/vitest/vitest.unit.setup.js +1 -1
  18. package/dist/src/node/cli/cli.util.cjs +1 -1
  19. package/dist/src/node/cli/cli.util.js +15 -15
  20. package/dist/src/node/command/command.util.cjs +1 -1
  21. package/dist/src/node/command/command.util.js +2 -2
  22. package/dist/src/node/command/index.cjs +1 -1
  23. package/dist/src/node/command/index.js +6 -7
  24. package/dist/src/node/log/index.cjs +1 -1
  25. package/dist/src/node/log/index.js +5 -5
  26. package/dist/src/node/mongo/index.cjs +1 -1
  27. package/dist/src/node/mongo/index.js +24 -15
  28. package/dist/src/node/mongo/mongo.util.cjs +5 -5
  29. package/dist/src/node/mongo/mongo.util.d.ts +1 -4
  30. package/dist/src/node/mongo/mongo.util.js +47 -54
  31. package/dist/src/node/package/index.cjs +1 -1
  32. package/dist/src/node/package/index.js +5 -6
  33. package/dist/src/node/package/package.util.cjs +1 -1
  34. package/dist/src/node/package/package.util.js +5 -6
  35. package/dist/src/node/path/index.cjs +1 -1
  36. package/dist/src/node/path/index.js +1 -1
  37. package/dist/src/node/path/path.constant.cjs +1 -1
  38. package/dist/src/node/path/path.constant.js +43 -45
  39. package/dist/src/node/upload/index.cjs +1 -1
  40. package/dist/src/node/upload/index.js +3 -4
  41. package/dist/src/node/upload/upload.util.cjs +1 -1
  42. package/dist/src/node/upload/upload.util.js +6 -157
  43. package/dist/upload.util-CE3MjBdh.cjs +1 -0
  44. package/dist/upload.util-D4aUdmPo.js +160 -0
  45. package/package.json +11 -11
  46. package/dist/magic-string.es-D_iPNVbJ.cjs +0 -10
  47. package/dist/magic-string.es-cELbkQ5L.js +0 -901
  48. package/dist/path.constant-CPGOAxEp.cjs +0 -2
  49. package/dist/src/config/config.type.cjs +0 -1
  50. package/dist/src/config/config.type.js +0 -4
  51. package/dist/src/config/env/env.type.cjs +0 -1
  52. package/dist/src/config/env/env.type.js +0 -1
  53. package/dist/src/config/graphql-codegen/graphql-codegen.type.cjs +0 -1
  54. package/dist/src/config/graphql-codegen/graphql-codegen.type.js +0 -1
  55. package/dist/src/node/apollo-server/apollo-server.type.cjs +0 -1
  56. package/dist/src/node/apollo-server/apollo-server.type.js +0 -1
  57. package/dist/src/node/command/command.type.cjs +0 -1
  58. package/dist/src/node/command/command.type.js +0 -4
  59. package/dist/src/node/express/express.type.cjs +0 -1
  60. package/dist/src/node/express/express.type.js +0 -4
  61. package/dist/src/node/fs/fs.type.cjs +0 -1
  62. package/dist/src/node/fs/fs.type.js +0 -1
  63. package/dist/src/node/log/log.type.cjs +0 -1
  64. package/dist/src/node/mongo/mongo.type.cjs +0 -1
  65. package/dist/src/node/mongo/mongo.type.js +0 -16
  66. package/dist/src/node/package/package.type.cjs +0 -1
  67. package/dist/src/node/package/package.type.js +0 -4
  68. package/dist/src/node/upload/upload.type.cjs +0 -1
  69. package/dist/src/node/upload/upload.type.js +0 -4
  70. package/dist/src/node/ws/ws.type.cjs +0 -1
  71. package/dist/src/node/ws/ws.type.js +0 -1
  72. package/dist/src/react/apollo-client/apollo-client.type.cjs +0 -1
  73. package/dist/src/react/apollo-client/apollo-client.type.js +0 -1
  74. package/dist/src/react/apollo-error/apollo-error.type.cjs +0 -1
  75. package/dist/src/react/apollo-error/apollo-error.type.js +0 -1
  76. package/dist/src/react/loading/loading.type.cjs +0 -1
  77. package/dist/src/react/loading/loading.type.js +0 -1
  78. package/dist/src/react/log/log.type.cjs +0 -1
  79. package/dist/src/react/log/log.type.js +0 -1
  80. package/dist/src/react/next-intl/next-intl.type.cjs +0 -1
  81. package/dist/src/react/next-intl/next-intl.type.js +0 -1
  82. package/dist/src/react/userback/userback.type.cjs +0 -1
  83. package/dist/src/react/userback/userback.type.js +0 -1
  84. package/dist/src/util/common/common.type.cjs +0 -1
  85. package/dist/src/util/common/common.type.js +0 -1
  86. package/dist/src/util/serializer/serializer.type.cjs +0 -1
  87. package/dist/src/util/serializer/serializer.type.js +0 -1
  88. package/dist/src/util/string/string.type.cjs +0 -1
  89. package/dist/src/util/string/string.type.js +0 -1
@@ -1,63 +1,62 @@
1
1
  var ue = Object.defineProperty;
2
2
  var Q = Object.getOwnPropertySymbols;
3
- var Ce = Object.prototype.hasOwnProperty, fe = Object.prototype.propertyIsEnumerable;
4
- var Z = (e, t, s) => t in e ? ue(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s, q = (e, t) => {
5
- for (var s in t || (t = {}))
6
- Ce.call(t, s) && Z(e, s, t[s]);
3
+ var Ne = Object.prototype.hasOwnProperty, Ce = Object.prototype.propertyIsEnumerable;
4
+ var Z = (e, s, t) => s in e ? ue(e, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[s] = t, q = (e, s) => {
5
+ for (var t in s || (s = {}))
6
+ Ne.call(s, t) && Z(e, t, s[t]);
7
7
  if (Q)
8
- for (var s of Q(t))
9
- fe.call(t, s) && Z(e, s, t[s]);
8
+ for (var t of Q(s))
9
+ Ce.call(s, t) && Z(e, t, s[t]);
10
10
  return e;
11
11
  };
12
- var C = (e, t, s) => new Promise((n, a) => {
13
- var i = (r) => {
12
+ var N = (e, s, t) => new Promise((n, a) => {
13
+ var c = (r) => {
14
14
  try {
15
- o(s.next(r));
16
- } catch (f) {
17
- a(f);
15
+ o(t.next(r));
16
+ } catch (C) {
17
+ a(C);
18
18
  }
19
19
  }, p = (r) => {
20
20
  try {
21
- o(s.throw(r));
22
- } catch (f) {
23
- a(f);
21
+ o(t.throw(r));
22
+ } catch (C) {
23
+ a(C);
24
24
  }
25
- }, o = (r) => r.done ? n(r.value) : Promise.resolve(r.value).then(i, p);
26
- o((s = s.apply(e, t)).next());
25
+ }, o = (r) => r.done ? n(r.value) : Promise.resolve(r.value).then(c, p);
26
+ o((t = t.apply(e, s)).next());
27
27
  });
28
28
  import Ie from "fs-extra";
29
29
  import { getEnv as b } from "./src/config/env/env.util.js";
30
- import { E_CommandType as l } from "./src/node/command/command.type.js";
31
- import { exec as _e } from "node:child_process";
30
+ import { exec as fe } from "node:child_process";
32
31
  import ee from "node:process";
33
- import * as Ne from "node:util";
34
- import { E_IssueType as y } from "./src/node/log/log.type.js";
35
- import { log as N, catchError as d } from "./src/node/log/log.util.js";
32
+ import * as _e from "node:util";
33
+ import { E as T } from "./log.type-DTOvZHyz.js";
34
+ import { log as _, catchError as d } from "./src/node/log/log.util.js";
36
35
  import de from "node-fetch";
37
36
  import { pathExistsSync as V, readJsonSync as R, writeFileSync as De } from "./src/node/fs/fs.util.js";
38
- import { E_PackageType as c } from "./src/node/package/package.type.js";
39
- import { join as j, resolveWorkingPath as u } from "./src/node/path/path.util.js";
37
+ import { join as U, resolveWorkingPath as u } from "./src/node/path/path.util.js";
40
38
  import { storage as K } from "./src/node/storage/storage.util.js";
41
- const ye = b();
42
- function Te(e) {
43
- return C(this, null, function* () {
39
+ var l = /* @__PURE__ */ ((e) => (e.CLI = "CLI", e.STRING = "STRING", e.FUNCTION = "FUNCTION", e))(l || {}), i = /* @__PURE__ */ ((e) => (e.DEPENDENCY = "dependencies", e.DEV_DEPENDENCY = "devDependencies", e.PEER_DEPENDENCY = "peerDependencies", e.BUNDLE_DEPENDENCY = "bundleDependencies", e.OPTIONAL_DEPENDENCY = "optionalDependencies", e))(i || {});
40
+ const Te = b();
41
+ function ye(e) {
42
+ return N(this, null, function* () {
44
43
  try {
45
- const t = yield de(`https://registry.npmjs.org/${e}/latest`);
46
- if (!t.ok)
47
- throw new Error(`Failed to fetch latest version: ${t.status} ${t.statusText}`);
48
- const { version: s } = yield t.json();
44
+ const s = yield de(`https://registry.npmjs.org/${e}/latest`);
45
+ if (!s.ok)
46
+ throw new Error(`Failed to fetch latest version: ${s.status} ${s.statusText}`);
47
+ const { version: t } = yield s.json();
49
48
  return {
50
49
  success: !0,
51
- result: s
50
+ result: t
52
51
  };
53
- } catch (t) {
54
- return d(t);
52
+ } catch (s) {
53
+ return d(s);
55
54
  }
56
55
  });
57
56
  }
58
57
  function H(e) {
59
- return C(this, null, function* () {
60
- var t, s;
58
+ return N(this, null, function* () {
59
+ var s, t;
61
60
  try {
62
61
  if (!e) {
63
62
  if (V(E.PACKAGE_JSON)) {
@@ -104,30 +103,30 @@ function H(e) {
104
103
  isCurrentProject: !1,
105
104
  isInstalled: !1,
106
105
  isUpToDate: !1,
107
- isDependency: e.type === c.DEPENDENCY,
108
- isDevDependency: e.type === c.DEV_DEPENDENCY,
106
+ isDependency: e.type === i.DEPENDENCY,
107
+ isDevDependency: e.type === i.DEV_DEPENDENCY,
109
108
  installedPath: "",
110
109
  file: {}
111
110
  }
112
111
  };
113
- const n = R(E.PACKAGE_JSON), { name: a, version: i = "", dependencies: p = {}, devDependencies: o = {} } = n;
112
+ const n = R(E.PACKAGE_JSON), { name: a, version: c = "", dependencies: p = {}, devDependencies: o = {} } = n;
114
113
  if (e.name === a)
115
114
  return {
116
115
  success: !0,
117
116
  result: {
118
117
  name: a,
119
- currentVersion: i,
120
- latestVersion: i,
118
+ currentVersion: c,
119
+ latestVersion: c,
121
120
  isCurrentProject: !0,
122
121
  isInstalled: !0,
123
122
  isUpToDate: !0,
124
- isDependency: e.type === c.DEPENDENCY,
125
- isDevDependency: e.type === c.DEV_DEPENDENCY,
123
+ isDependency: e.type === i.DEPENDENCY,
124
+ isDevDependency: e.type === i.DEV_DEPENDENCY,
126
125
  installedPath: E.PACKAGE_JSON,
127
126
  file: n
128
127
  }
129
128
  };
130
- const r = e.name in p, f = e.name in o, D = yield Te(e.name);
129
+ const r = e.name in p, C = e.name in o, D = yield ye(e.name);
131
130
  if (!D.success)
132
131
  return {
133
132
  success: !0,
@@ -139,12 +138,12 @@ function H(e) {
139
138
  isInstalled: !1,
140
139
  isUpToDate: !1,
141
140
  isDependency: r,
142
- isDevDependency: f,
141
+ isDevDependency: C,
143
142
  installedPath: "",
144
143
  file: {}
145
144
  }
146
145
  };
147
- if (!r && !f)
146
+ if (!r && !C)
148
147
  return {
149
148
  success: !0,
150
149
  result: {
@@ -154,13 +153,13 @@ function H(e) {
154
153
  isCurrentProject: !1,
155
154
  isInstalled: !1,
156
155
  isUpToDate: !1,
157
- isDependency: e.type === c.DEPENDENCY,
158
- isDevDependency: e.type === c.DEV_DEPENDENCY,
156
+ isDependency: e.type === i.DEPENDENCY,
157
+ isDevDependency: e.type === i.DEV_DEPENDENCY,
159
158
  installedPath: "",
160
159
  file: {}
161
160
  }
162
161
  };
163
- const T = (s = (t = p[e.name]) != null ? t : o[e.name]) != null ? s : "", g = j(ye.CWD, W, e.name, X);
162
+ const y = (t = (s = p[e.name]) != null ? s : o[e.name]) != null ? t : "", g = U(Te.CWD, W, e.name, X);
164
163
  if (!V(g))
165
164
  return {
166
165
  success: !0,
@@ -172,23 +171,23 @@ function H(e) {
172
171
  isInstalled: !1,
173
172
  isUpToDate: !1,
174
173
  isDependency: r,
175
- isDevDependency: f,
174
+ isDevDependency: C,
176
175
  installedPath: "",
177
176
  file: {}
178
177
  }
179
178
  };
180
179
  const P = R(g), { version: A = "" } = P;
181
- return T !== A ? {
180
+ return y !== A ? {
182
181
  success: !0,
183
182
  result: {
184
183
  name: e.name,
185
- currentVersion: A || T,
184
+ currentVersion: A || y,
186
185
  latestVersion: D.result,
187
186
  isCurrentProject: !1,
188
187
  isInstalled: !0,
189
188
  isUpToDate: !1,
190
189
  isDependency: r,
191
- isDevDependency: f,
190
+ isDevDependency: C,
192
191
  installedPath: g,
193
192
  file: P
194
193
  }
@@ -196,13 +195,13 @@ function H(e) {
196
195
  success: !0,
197
196
  result: {
198
197
  name: e.name,
199
- currentVersion: T,
198
+ currentVersion: y,
200
199
  latestVersion: D.result,
201
200
  isCurrentProject: !1,
202
201
  isInstalled: !0,
203
- isUpToDate: T === D.result,
202
+ isUpToDate: y === D.result,
204
203
  isDependency: r,
205
- isDevDependency: f,
204
+ isDevDependency: C,
206
205
  installedPath: g,
207
206
  file: P
208
207
  }
@@ -212,29 +211,29 @@ function H(e) {
212
211
  }
213
212
  });
214
213
  }
215
- function te(e) {
216
- return C(this, null, function* () {
217
- var t, s;
214
+ function se(e) {
215
+ return N(this, null, function* () {
216
+ var s, t;
218
217
  try {
219
- const n = R(E.PACKAGE_JSON), a = (t = n.dependencies) != null ? t : {}, i = (s = n.devDependencies) != null ? s : {};
220
- e.isDependency ? a[e.name] = e.latestVersion : e.isDevDependency && (i[e.name] = e.latestVersion), De(E.PACKAGE_JSON, JSON.stringify(n, null, 4)), N.info(`Updated "${e.name}" to version ${e.latestVersion}`);
218
+ const n = R(E.PACKAGE_JSON), a = (s = n.dependencies) != null ? s : {}, c = (t = n.devDependencies) != null ? t : {};
219
+ e.isDependency ? a[e.name] = e.latestVersion : e.isDevDependency && (c[e.name] = e.latestVersion), De(E.PACKAGE_JSON, JSON.stringify(n, null, 4)), _.info(`Updated "${e.name}" to version ${e.latestVersion}`);
221
220
  } catch (n) {
222
221
  d(n);
223
222
  }
224
223
  });
225
224
  }
226
225
  function ge() {
227
- return C(this, null, function* () {
226
+ return N(this, null, function* () {
228
227
  try {
229
228
  const e = [
230
229
  { command: () => w.pnpmInstallStandard(), message: "Installing dependencies (standard)" },
231
230
  { command: () => w.pnpmInstallLegacy(), message: "Retrying with legacy peer dependencies" },
232
231
  { command: () => w.pnpmInstallForce(), message: "Retrying with force install" }
233
232
  ];
234
- for (const { command: t, message: s } of e)
233
+ for (const { command: s, message: t } of e)
235
234
  try {
236
- const n = yield t();
237
- yield le(`${s} using: ${n}`, n);
235
+ const n = yield s();
236
+ yield le(`${t} using: ${n}`, n);
238
237
  return;
239
238
  } catch (n) {
240
239
  d(n);
@@ -244,50 +243,50 @@ function ge() {
244
243
  }
245
244
  });
246
245
  }
247
- function Oe(e, t) {
248
- return C(this, null, function* () {
249
- var s;
246
+ function Oe(e, s) {
247
+ return N(this, null, function* () {
248
+ var t;
250
249
  try {
251
250
  if (!V(E.PACKAGE_JSON)) {
252
- N.error("package.json not found. Aborting setup.");
251
+ _.error("package.json not found. Aborting setup.");
253
252
  return;
254
253
  }
255
- const a = (yield Promise.all(e.map(H))).filter((r) => r.success && !!r.result && !r.result.isCurrentProject).map((r) => r.result), i = a.filter((r) => !r.isInstalled), p = a.filter((r) => !r.isUpToDate), o = [];
256
- t != null && t.install && i.length > 0 && o.push(...i.map(te)), t != null && t.update && p.length > 0 && o.push(...p.map(te)), o.length > 0 && (yield Promise.all(o), yield ge(), yield le("Running ESLint with auto-fix", yield w.eslintFix()));
257
- for (const r of (s = t == null ? void 0 : t.callbacks) != null ? s : [])
254
+ const a = (yield Promise.all(e.map(H))).filter((r) => r.success && !!r.result && !r.result.isCurrentProject).map((r) => r.result), c = a.filter((r) => !r.isInstalled), p = a.filter((r) => !r.isUpToDate), o = [];
255
+ s != null && s.install && c.length > 0 && o.push(...c.map(se)), s != null && s.update && p.length > 0 && o.push(...p.map(se)), o.length > 0 && (yield Promise.all(o), yield ge(), yield le("Running ESLint with auto-fix", yield w.eslintFix()));
256
+ for (const r of (t = s == null ? void 0 : s.callbacks) != null ? t : [])
258
257
  yield r();
259
258
  } catch (n) {
260
259
  d(n);
261
260
  }
262
261
  });
263
262
  }
264
- const ie = b(), Ge = Ne.promisify(_e);
263
+ const ie = b(), Ge = _e.promisify(fe);
265
264
  function B() {
266
- return C(this, null, function* () {
265
+ return N(this, null, function* () {
267
266
  const e = yield H();
268
267
  return e.success ? e.result.name : Date.now().toString();
269
268
  });
270
269
  }
271
270
  function ce(e) {
272
- return C(this, null, function* () {
271
+ return N(this, null, function* () {
273
272
  if (e.length === 0)
274
273
  return;
275
- const t = yield B();
274
+ const s = yield B();
276
275
  try {
277
- yield K.set(t, e), setTimeout(() => C(null, null, function* () {
278
- const s = yield K.getLogLink(t);
279
- s && N.info(`📂 Open the error list manually: ${s}`);
276
+ yield K.set(s, e), setTimeout(() => N(null, null, function* () {
277
+ const t = yield K.getLogLink(s);
278
+ t && _.info(`📂 Open the error list manually: ${t}`);
280
279
  }), 0);
281
- } catch (s) {
282
- d(s);
280
+ } catch (t) {
281
+ d(t);
283
282
  }
284
283
  });
285
284
  }
286
- function pt() {
287
- return C(this, null, function* () {
285
+ function Es() {
286
+ return N(this, null, function* () {
288
287
  try {
289
- const e = yield B(), t = yield K.get(e);
290
- return t != null ? t : [];
288
+ const e = yield B(), s = yield K.get(e);
289
+ return s != null ? s : [];
291
290
  } catch (e) {
292
291
  return d(e, {
293
292
  returnValue: []
@@ -295,8 +294,8 @@ function pt() {
295
294
  }
296
295
  });
297
296
  }
298
- function ut() {
299
- return C(this, null, function* () {
297
+ function ms() {
298
+ return N(this, null, function* () {
300
299
  try {
301
300
  const e = yield B();
302
301
  yield K.remove(e);
@@ -306,109 +305,109 @@ function ut() {
306
305
  });
307
306
  }
308
307
  function Pe(e) {
309
- const t = [], s = [];
308
+ const s = [], t = [];
310
309
  let n = "";
311
- const a = /^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/, i = /^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/, p = /^✖\s+(.*?)\s+\[(.*?)\]$/;
310
+ const a = /^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/, c = /^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/, p = /^✖\s+(.*?)\s+\[(.*?)\]$/;
312
311
  e.split(`
313
312
  `).forEach((o) => {
314
- var r, f, D, T, g, P, A, $, M, h, z;
313
+ var r, C, D, y, g, P, A, $, M, h, z;
315
314
  if (o.startsWith("/"))
316
315
  n = o.trim();
317
316
  else {
318
- const I = a.exec(o) || [], _ = i.exec(o) || [], O = p.exec(o) || [];
319
- I.length && n ? t.push({
317
+ const I = a.exec(o) || [], f = c.exec(o) || [], O = p.exec(o) || [];
318
+ I.length && n ? s.push({
320
319
  file: n,
321
320
  position: `${I[1]}:${I[2]}`,
322
- type: I[3] === y.Error ? y.Error : y.Warning,
323
- message: (f = (r = I == null ? void 0 : I[4]) == null ? void 0 : r.trim()) != null ? f : "",
324
- rule: (T = (D = I == null ? void 0 : I[5]) == null ? void 0 : D.trim()) != null ? T : ""
325
- }) : _.length ? t.push({
326
- file: (g = _ == null ? void 0 : _[1]) != null ? g : "",
327
- position: `${_[2]}:${_[3]}`,
328
- type: _[4] === y.Error ? y.Error : y.Warning,
329
- message: (A = (P = _ == null ? void 0 : _[5]) == null ? void 0 : P.trim()) != null ? A : ""
330
- }) : O.length ? t.push({
321
+ type: I[3] === T.Error ? T.Error : T.Warning,
322
+ message: (C = (r = I == null ? void 0 : I[4]) == null ? void 0 : r.trim()) != null ? C : "",
323
+ rule: (y = (D = I == null ? void 0 : I[5]) == null ? void 0 : D.trim()) != null ? y : ""
324
+ }) : f.length ? s.push({
325
+ file: (g = f == null ? void 0 : f[1]) != null ? g : "",
326
+ position: `${f[2]}:${f[3]}`,
327
+ type: f[4] === T.Error ? T.Error : T.Warning,
328
+ message: (A = (P = f == null ? void 0 : f[5]) == null ? void 0 : P.trim()) != null ? A : ""
329
+ }) : O.length ? s.push({
331
330
  file: "commitlint",
332
- type: y.Error,
331
+ type: T.Error,
333
332
  message: (M = ($ = O == null ? void 0 : O[1]) == null ? void 0 : $.trim()) != null ? M : "",
334
333
  rule: (z = (h = O == null ? void 0 : O[2]) == null ? void 0 : h.trim()) != null ? z : ""
335
- }) : s.push(o.trim());
334
+ }) : t.push(o.trim());
336
335
  }
337
- }), t.length && ce(t), ie.DEBUG && s.length && (N.warn("Unmatched lines:"), s.forEach((o) => N.info(` ${o}`)));
336
+ }), s.length && ce(s), ie.DEBUG && t.length && (_.warn("Unmatched lines:"), t.forEach((o) => _.info(` ${o}`)));
338
337
  }
339
338
  function Se(e) {
340
339
  try {
341
- const t = JSON.parse(e), s = [];
342
- t.forEach(({ filePath: n, messages: a }) => {
343
- a.forEach(({ severity: i, line: p, column: o, ruleId: r, message: f }) => {
344
- s.push({
345
- type: i === 2 ? y.Error : y.Warning,
340
+ const s = JSON.parse(e), t = [];
341
+ s.forEach(({ filePath: n, messages: a }) => {
342
+ a.forEach(({ severity: c, line: p, column: o, ruleId: r, message: C }) => {
343
+ t.push({
344
+ type: c === 2 ? T.Error : T.Warning,
346
345
  file: n,
347
346
  position: `${p}:${o}`,
348
347
  rule: r,
349
- message: f
348
+ message: C
350
349
  });
351
350
  });
352
- }), s.length && ce(s);
353
- } catch (t) {
351
+ }), t.length && ce(t);
352
+ } catch (s) {
354
353
  Pe(e);
355
354
  }
356
355
  }
357
- function Le(s) {
358
- return C(this, arguments, function* (e, t = Se) {
356
+ function Le(t) {
357
+ return N(this, arguments, function* (e, s = Se) {
359
358
  const n = new AbortController();
360
359
  ee.on("SIGINT", () => {
361
- N.warn("Process interrupted. Terminating..."), n.abort(), ee.exit();
360
+ _.warn("Process interrupted. Terminating..."), n.abort(), ee.exit();
362
361
  });
363
362
  try {
364
363
  if (typeof e == "string") {
365
- const { stdout: a, stderr: i } = yield Ge(e, {
364
+ const { stdout: a, stderr: c } = yield Ge(e, {
366
365
  maxBuffer: 104857600,
367
366
  signal: n.signal
368
367
  });
369
- [a, i].forEach((p) => p && t(p));
368
+ [a, c].forEach((p) => p && s(p));
370
369
  }
371
370
  } catch (a) {
372
- const { stdout: i, stderr: p, message: o } = a;
373
- [i, p].forEach((r) => r && t(r)), !p && !i && N.error(`Command failed: ${o}`);
371
+ const { stdout: c, stderr: p, message: o } = a;
372
+ [c, p].forEach((r) => r && s(r)), !p && !c && _.error(`Command failed: ${o}`);
374
373
  }
375
374
  });
376
375
  }
377
- function U(e) {
376
+ function j(e) {
378
377
  return { raw: !0, cmd: e };
379
378
  }
380
- function se(e, t) {
381
- return t != null && t.isCurrentProject ? `${x} ${G} ${Je} ${e}` : `${x} ${Ue} ${e}`;
379
+ function te(e, s) {
380
+ return s != null && s.isCurrentProject ? `${x} ${G} ${Fe} ${e}` : `${x} ${je} ${e}`;
382
381
  }
383
- function J(e, t) {
384
- return typeof e == "function" ? se(e(t), t) : typeof e == "object" && (e == null ? void 0 : e.raw) === !0 ? e.cmd : typeof e == "string" ? se(e, t) : e;
382
+ function F(e, s) {
383
+ return typeof e == "function" ? te(e(s), s) : typeof e == "object" && (e == null ? void 0 : e.raw) === !0 ? e.cmd : typeof e == "string" ? te(e, s) : e;
385
384
  }
386
- function Ct(e) {
387
- return C(this, null, function* () {
388
- const t = yield H({ name: F });
389
- if (t.success) {
390
- const s = { isCurrentProject: t.result.isCurrentProject }, n = typeof e == "function" ? e(s) : e;
385
+ function ps(e) {
386
+ return N(this, null, function* () {
387
+ const s = yield H({ name: k });
388
+ if (s.success) {
389
+ const t = { isCurrentProject: s.result.isCurrentProject }, n = typeof e == "function" ? e(t) : e;
391
390
  return Object.fromEntries(
392
- Object.entries(n).map(([a, i]) => [a, J(i, s)])
391
+ Object.entries(n).map(([a, c]) => [a, F(c, t)])
393
392
  );
394
393
  }
395
394
  });
396
395
  }
397
- function le(e, t) {
398
- return C(this, null, function* () {
396
+ function le(e, s) {
397
+ return N(this, null, function* () {
399
398
  try {
400
- N.start(`${e}`), ie.DEBUG && N.info(`→ ${t}`), yield Le(t), N.success(`${e} done.`);
401
- } catch (s) {
402
- d(s);
399
+ _.start(`${e}`), ie.DEBUG && _.info(`→ ${s}`), yield Le(s), _.success(`${e} done.`);
400
+ } catch (t) {
401
+ d(t);
403
402
  }
404
403
  });
405
404
  }
406
- const Ae = b(), k = Ae.CWD, F = "@cyberskill/shared", W = "node_modules", $e = "dist", he = "public", X = "package.json", Me = "package-lock.json", Ve = "tsconfig.json", Re = ".gitignore", we = ".simple-git-hooks.json", Ke = "pnpm-lock.yaml", Ye = ".git/hooks/", ve = ".git/COMMIT_EDITMSG", je = ".migrate-mongo.config.js", S = (() => {
407
- const t = Ie.readJsonSync(u(X)).name === F ? k : j(k, W, F);
408
- return j(t, $e);
409
- })(), Ue = "cyberskill", Je = "src/node/cli/index.ts", ne = "eslint", re = "eslint", ae = "vitest", oe = "vitest", ke = "@commitlint/cli", Fe = "@commitlint/config-conventional", Ee = "commitlint", xe = "lint-staged", me = "lint-staged", be = "typescript", He = "tsc", G = "tsx", pe = "git", L = "pnpm", x = "pnpm exec", Be = "simple-git-hooks", We = "simple-git-hooks", Xe = "@eslint/config-inspector", ze = "eslint-config-inspector", Qe = "node-modules-inspector", Ze = "node-modules-inspector", Y = "migrate-mongo", v = "./node_modules/migrate-mongo/bin/migrate-mongo", E = {
405
+ const Ae = b(), J = Ae.CWD, k = "@cyberskill/shared", W = "node_modules", $e = "dist", he = "public", X = "package.json", Me = "package-lock.json", Ve = "tsconfig.json", Re = ".gitignore", we = ".simple-git-hooks.json", Ke = "pnpm-lock.yaml", Ye = ".git/hooks/", ve = ".git/COMMIT_EDITMSG", Ue = ".migrate-mongo.config.js", S = (() => {
406
+ const s = Ie.readJsonSync(u(X)).name === k ? J : U(J, W, k);
407
+ return U(s, $e);
408
+ })(), je = "cyberskill", Fe = "src/node/cli/index.ts", ne = "eslint", re = "eslint", ae = "vitest", oe = "vitest", Je = "@commitlint/cli", ke = "@commitlint/config-conventional", Ee = "commitlint", xe = "lint-staged", me = "lint-staged", be = "typescript", He = "tsc", G = "tsx", pe = "git", L = "pnpm", x = "pnpm exec", Be = "simple-git-hooks", We = "simple-git-hooks", Xe = "@eslint/config-inspector", ze = "eslint-config-inspector", Qe = "node-modules-inspector", Ze = "node-modules-inspector", Y = "migrate-mongo", v = "./node_modules/migrate-mongo/bin/migrate-mongo", E = {
410
409
  CYBERSKILL_DIRECTORY: S,
411
- WORKING_DIRECTORY: k,
410
+ WORKING_DIRECTORY: J,
412
411
  PUBLIC_DIRECTORY: u(he),
413
412
  TS_CONFIG: u(Ve),
414
413
  GIT_IGNORE: u(Re),
@@ -419,29 +418,29 @@ const Ae = b(), k = Ae.CWD, F = "@cyberskill/shared", W = "node_modules", $e = "
419
418
  PACKAGE_LOCK_JSON: u(Me),
420
419
  PNPM_LOCK_YAML: u(Ke),
421
420
  NODE_MODULES: u(W),
422
- MIGRATE_MONGO_CONFIG: u(je),
421
+ MIGRATE_MONGO_CONFIG: u(Ue),
423
422
  LINT_STAGED_CONFIG: u(`${S}/src/config/lint-staged/index.js`),
424
423
  COMMITLINT_CONFIG: u(`${S}/src/config/commitlint/index.js`),
425
424
  VITEST_UNIT_CONFIG: u(`${S}/src/config/vitest/vitest.unit.js`),
426
425
  VITEST_UNIT_SETUP_CONFIG: u(`${S}/src/config/vitest/vitest.unit.setup.js`),
427
426
  VITEST_E2E_CONFIG: u(`${S}/src/config/vitest/vitest.e2e.js`)
428
427
  };
429
- function ft({ isCurrentProject: e }) {
428
+ function us({ isCurrentProject: e }) {
430
429
  return q({
431
430
  "pre-commit": me,
432
431
  "commit-msg": Ee
433
- }, e && { "pre-push": U(`${pe} pull`) });
432
+ }, e && { "pre-push": j(`${pe} pull`) });
434
433
  }
435
- function m({ type: e, packages: t, command: s }) {
436
- const n = t == null ? void 0 : t.reduce((a, i) => (a.some((p) => p.name === i.name) || a.push(i), a), []);
437
- return () => C(null, null, function* () {
434
+ function m({ type: e, packages: s, command: t }) {
435
+ const n = s == null ? void 0 : s.reduce((a, c) => (a.some((p) => p.name === c.name) || a.push(c), a), []);
436
+ return () => N(null, null, function* () {
438
437
  switch (e) {
439
438
  case l.CLI:
440
439
  return n != null && n.length && (yield Oe(n, {
441
440
  install: !0
442
- })), J(U(`${x} ${s}`));
441
+ })), F(j(`${x} ${t}`));
443
442
  case l.STRING:
444
- return J(U(s));
443
+ return F(j(t));
445
444
  default:
446
445
  throw new Error("Unsupported command type");
447
446
  }
@@ -453,7 +452,7 @@ const w = {
453
452
  packages: [
454
453
  {
455
454
  name: Be,
456
- type: c.DEV_DEPENDENCY
455
+ type: i.DEV_DEPENDENCY
457
456
  }
458
457
  ],
459
458
  command: We
@@ -463,7 +462,7 @@ const w = {
463
462
  packages: [
464
463
  {
465
464
  name: Xe,
466
- type: c.DEV_DEPENDENCY
465
+ type: i.DEV_DEPENDENCY
467
466
  }
468
467
  ],
469
468
  command: ze
@@ -473,7 +472,7 @@ const w = {
473
472
  packages: [
474
473
  {
475
474
  name: Qe,
476
- type: c.DEV_DEPENDENCY
475
+ type: i.DEV_DEPENDENCY
477
476
  }
478
477
  ],
479
478
  command: Ze
@@ -483,7 +482,7 @@ const w = {
483
482
  packages: [
484
483
  {
485
484
  name: ne,
486
- type: c.DEV_DEPENDENCY
485
+ type: i.DEV_DEPENDENCY
487
486
  }
488
487
  ],
489
488
  command: `${re} ${E.WORKING_DIRECTORY} --no-cache`
@@ -493,7 +492,7 @@ const w = {
493
492
  packages: [
494
493
  {
495
494
  name: ne,
496
- type: c.DEV_DEPENDENCY
495
+ type: i.DEV_DEPENDENCY
497
496
  }
498
497
  ],
499
498
  command: `${re} ${E.WORKING_DIRECTORY} --fix --no-cache`
@@ -503,7 +502,7 @@ const w = {
503
502
  packages: [
504
503
  {
505
504
  name: be,
506
- type: c.DEV_DEPENDENCY
505
+ type: i.DEV_DEPENDENCY
507
506
  }
508
507
  ],
509
508
  command: `${He} -p ${E.TS_CONFIG} --noEmit`
@@ -513,7 +512,7 @@ const w = {
513
512
  packages: [
514
513
  {
515
514
  name: ae,
516
- type: c.DEV_DEPENDENCY
515
+ type: i.DEV_DEPENDENCY
517
516
  }
518
517
  ],
519
518
  command: `${oe} --config ${E.VITEST_UNIT_CONFIG}`
@@ -523,7 +522,7 @@ const w = {
523
522
  packages: [
524
523
  {
525
524
  name: ae,
526
- type: c.DEV_DEPENDENCY
525
+ type: i.DEV_DEPENDENCY
527
526
  }
528
527
  ],
529
528
  command: `${oe} --config ${E.VITEST_E2E_CONFIG}`
@@ -533,11 +532,11 @@ const w = {
533
532
  packages: [
534
533
  {
535
534
  name: G,
536
- type: c.DEPENDENCY
535
+ type: i.DEPENDENCY
537
536
  },
538
537
  {
539
538
  name: Y,
540
- type: c.DEPENDENCY
539
+ type: i.DEPENDENCY
541
540
  }
542
541
  ],
543
542
  command: `${G} ${v} create ${e} -f ${E.MIGRATE_MONGO_CONFIG}`
@@ -547,11 +546,11 @@ const w = {
547
546
  packages: [
548
547
  {
549
548
  name: G,
550
- type: c.DEPENDENCY
549
+ type: i.DEPENDENCY
551
550
  },
552
551
  {
553
552
  name: Y,
554
- type: c.DEPENDENCY
553
+ type: i.DEPENDENCY
555
554
  }
556
555
  ],
557
556
  command: `${G} ${v} up -f ${E.MIGRATE_MONGO_CONFIG}`
@@ -561,11 +560,11 @@ const w = {
561
560
  packages: [
562
561
  {
563
562
  name: G,
564
- type: c.DEPENDENCY
563
+ type: i.DEPENDENCY
565
564
  },
566
565
  {
567
566
  name: Y,
568
- type: c.DEPENDENCY
567
+ type: i.DEPENDENCY
569
568
  }
570
569
  ],
571
570
  command: `${G} ${v} down -f ${E.MIGRATE_MONGO_CONFIG}`
@@ -574,12 +573,12 @@ const w = {
574
573
  type: l.CLI,
575
574
  packages: [
576
575
  {
577
- name: ke,
578
- type: c.DEV_DEPENDENCY
576
+ name: Je,
577
+ type: i.DEV_DEPENDENCY
579
578
  },
580
579
  {
581
- name: Fe,
582
- type: c.DEV_DEPENDENCY
580
+ name: ke,
581
+ type: i.DEV_DEPENDENCY
583
582
  }
584
583
  ],
585
584
  command: `${Ee} --edit ${E.GIT_COMMIT_MSG} --config ${E.COMMITLINT_CONFIG}`
@@ -589,7 +588,7 @@ const w = {
589
588
  packages: [
590
589
  {
591
590
  name: xe,
592
- type: c.DEV_DEPENDENCY
591
+ type: i.DEV_DEPENDENCY
593
592
  }
594
593
  ],
595
594
  command: `${me} --config ${E.LINT_STAGED_CONFIG}`
@@ -624,46 +623,48 @@ const w = {
624
623
  })
625
624
  };
626
625
  export {
627
- le as $,
626
+ F as $,
628
627
  Y as A,
629
628
  $e as B,
630
- F as C,
629
+ k as C,
631
630
  v as D,
632
631
  ne as E,
633
632
  E as F,
634
633
  Re as G,
635
- ft as H,
634
+ us as H,
636
635
  w as I,
637
- Te as J,
638
- H as K,
636
+ i as J,
637
+ ye as K,
639
638
  xe as L,
640
- je as M,
639
+ Ue as M,
641
640
  W as N,
642
- te as O,
641
+ H as O,
643
642
  he as P,
644
- ge as Q,
645
- Oe as R,
643
+ se as Q,
644
+ ge as R,
646
645
  we as S,
647
646
  Ve as T,
648
- pt as U,
647
+ Oe as U,
649
648
  ae as V,
650
- k as W,
651
- ut as X,
652
- U as Y,
653
- J as Z,
654
- Ct as _,
649
+ J as W,
650
+ l as X,
651
+ Es as Y,
652
+ ms as Z,
653
+ j as _,
655
654
  X as a,
655
+ ps as a0,
656
+ le as a1,
656
657
  Me as b,
657
658
  Ke as c,
658
659
  Ye as d,
659
660
  ve as e,
660
661
  S as f,
661
- Ue as g,
662
- Je as h,
662
+ je as g,
663
+ Fe as h,
663
664
  re as i,
664
665
  oe as j,
665
- ke as k,
666
- Fe as l,
666
+ Je as k,
667
+ ke as l,
667
668
  Ee as m,
668
669
  me as n,
669
670
  be as o,