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