@cyberskill/shared 3.13.0 → 3.14.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 (97) hide show
  1. package/dist/config/env/env.util.d.ts +5 -0
  2. package/dist/config/env/env.util.js +20 -16
  3. package/dist/config/env/env.util.js.map +1 -1
  4. package/dist/config/env/index.js +2 -2
  5. package/dist/config/vitest/vitest.e2e.js +4 -4
  6. package/dist/config/vitest/vitest.e2e.js.map +1 -1
  7. package/dist/config/vitest/vitest.unit.js +5 -5
  8. package/dist/config/vitest/vitest.unit.js.map +1 -1
  9. package/dist/config/vitest/vitest.unit.setup.js +10 -0
  10. package/dist/config/vitest/vitest.unit.setup.js.map +1 -0
  11. package/dist/node/apollo-server/apollo-server.type.d.ts +13 -1
  12. package/dist/node/apollo-server/apollo-server.util.d.ts +1 -0
  13. package/dist/node/apollo-server/apollo-server.util.js +40 -16
  14. package/dist/node/apollo-server/apollo-server.util.js.map +1 -1
  15. package/dist/node/cli/index.js +26 -28
  16. package/dist/node/cli/index.js.map +1 -1
  17. package/dist/node/command/command.util.d.ts +5 -0
  18. package/dist/node/command/command.util.js +49 -48
  19. package/dist/node/command/command.util.js.map +1 -1
  20. package/dist/node/command/index.js +2 -2
  21. package/dist/node/express/express.type.d.ts +11 -0
  22. package/dist/node/express/express.util.d.ts +34 -6
  23. package/dist/node/express/express.util.js +81 -56
  24. package/dist/node/express/express.util.js.map +1 -1
  25. package/dist/node/express/index.js +2 -2
  26. package/dist/node/log/log.type.d.ts +17 -0
  27. package/dist/node/log/log.type.js.map +1 -1
  28. package/dist/node/log/log.util.js +25 -11
  29. package/dist/node/log/log.util.js.map +1 -1
  30. package/dist/node/mongo/index.d.ts +2 -1
  31. package/dist/node/mongo/index.js +7 -8
  32. package/dist/node/mongo/mongo.constant.d.ts +5 -0
  33. package/dist/node/mongo/mongo.constant.js +2 -2
  34. package/dist/node/mongo/mongo.constant.js.map +1 -1
  35. package/dist/node/mongo/mongo.controller.mongoose.d.ts +3 -0
  36. package/dist/node/mongo/mongo.controller.mongoose.js +41 -55
  37. package/dist/node/mongo/mongo.controller.mongoose.js.map +1 -1
  38. package/dist/node/mongo/mongo.controller.native.d.ts +29 -2
  39. package/dist/node/mongo/mongo.controller.native.js +31 -14
  40. package/dist/node/mongo/mongo.controller.native.js.map +1 -1
  41. package/dist/node/mongo/mongo.type.d.ts +3 -1
  42. package/dist/node/mongo/mongo.util.d.ts +1 -0
  43. package/dist/node/mongo/mongo.util.js +38 -17
  44. package/dist/node/mongo/mongo.util.js.map +1 -1
  45. package/dist/node/package/package.util.js +47 -47
  46. package/dist/node/path/index.js +2 -2
  47. package/dist/node/path/path.constant.d.ts +4 -0
  48. package/dist/node/path/path.constant.js +75 -72
  49. package/dist/node/path/path.constant.js.map +1 -1
  50. package/dist/node/storage/storage.util.d.ts +50 -1
  51. package/dist/node/storage/storage.util.js +79 -54
  52. package/dist/node/storage/storage.util.js.map +1 -1
  53. package/dist/node/upload/upload.type.d.ts +2 -0
  54. package/dist/node/upload/upload.type.js.map +1 -1
  55. package/dist/node/upload/upload.util.d.ts +1 -0
  56. package/dist/node/upload/upload.util.js +62 -52
  57. package/dist/node/upload/upload.util.js.map +1 -1
  58. package/dist/node/ws/ws.util.d.ts +7 -0
  59. package/dist/node/ws/ws.util.js +20 -19
  60. package/dist/node/ws/ws.util.js.map +1 -1
  61. package/dist/react/apollo-client/apollo-client.component.js.map +1 -1
  62. package/dist/react/apollo-client/apollo-client.type.d.ts +2 -0
  63. package/dist/react/apollo-client/apollo-client.util.js +6 -6
  64. package/dist/react/apollo-client/apollo-client.util.js.map +1 -1
  65. package/dist/react/apollo-error/apollo-error.component.js +1 -1
  66. package/dist/react/apollo-error/apollo-error.component.js.map +1 -1
  67. package/dist/react/apollo-error/apollo-error.util.js.map +1 -1
  68. package/dist/react/i18next/i18next.server.d.ts +17 -0
  69. package/dist/react/i18next/i18next.server.js +9 -0
  70. package/dist/react/i18next/i18next.server.js.map +1 -0
  71. package/dist/react/next-intl/next-intl.hoc.d.ts +4 -8
  72. package/dist/react/next-intl/next-intl.hoc.js +14 -10
  73. package/dist/react/next-intl/next-intl.hoc.js.map +1 -1
  74. package/dist/react/next-intl/next-intl.server.d.ts +10 -0
  75. package/dist/react/next-intl/next-intl.server.js +7 -0
  76. package/dist/react/next-intl/next-intl.server.js.map +1 -0
  77. package/dist/react/storage/storage.util.d.ts +34 -1
  78. package/dist/react/storage/storage.util.js +30 -5
  79. package/dist/react/storage/storage.util.js.map +1 -1
  80. package/dist/react/userback/userback.component.js.map +1 -1
  81. package/dist/typescript/common.type.d.ts +4 -0
  82. package/dist/typescript/common.type.js +2 -2
  83. package/dist/typescript/common.type.js.map +1 -1
  84. package/dist/typescript/index.js +2 -2
  85. package/dist/util/object/object.util.js +29 -18
  86. package/dist/util/object/object.util.js.map +1 -1
  87. package/dist/util/serializer/serializer.util.d.ts +8 -0
  88. package/dist/util/serializer/serializer.util.js +51 -64
  89. package/dist/util/serializer/serializer.util.js.map +1 -1
  90. package/dist/util/storage/storage-envelope.d.ts +25 -0
  91. package/dist/util/storage/storage-envelope.js +18 -0
  92. package/dist/util/storage/storage-envelope.js.map +1 -0
  93. package/package.json +33 -12
  94. package/dist/node/mongo/mongo.type.js +0 -8
  95. package/dist/node/mongo/mongo.type.js.map +0 -1
  96. package/dist/node_modules/.pnpm/vitest@4.1.2_@types_node@25.5.0_jsdom@29.0.1_@noble_hashes@1.8.0__vite@8.0.3_@types_nod_0827261ede788764a5d99ac6bdf44bde/node_modules/vitest/dist/config.js +0 -8
  97. package/dist/node_modules/.pnpm/vitest@4.1.2_@types_node@25.5.0_jsdom@29.0.1_@noble_hashes@1.8.0__vite@8.0.3_@types_nod_0827261ede788764a5d99ac6bdf44bde/node_modules/vitest/dist/config.js.map +0 -1
@@ -1,12 +1,12 @@
1
- import { pathExistsSync as e, readJsonSync as t, writeFileSync as n } from "../fs/fs.util.js";
2
- import { getEnv as r } from "../../config/env/env.util.js";
3
- import { catchError as i, log as a } from "../log/log.util.js";
1
+ import { getEnv as e } from "../../config/env/env.util.js";
2
+ import { catchError as t, log as n } from "../log/log.util.js";
3
+ import { pathExistsSync as r, readJsonSync as i, writeFileSync as a } from "../fs/fs.util.js";
4
4
  import { E_PackageType as o } from "./package.type.js";
5
5
  import { runCommand as s } from "../command/command.util.js";
6
6
  import { join as c } from "../path/path.util.js";
7
7
  import { NODE_MODULES as l, PACKAGE_JSON as u, PATH as d, command as f } from "../path/path.constant.js";
8
8
  //#region src/node/package/package.util.ts
9
- var p = r();
9
+ var p = e();
10
10
  async function m(e) {
11
11
  try {
12
12
  let t = await fetch(`https://registry.npmjs.org/${e}/latest`);
@@ -17,20 +17,20 @@ async function m(e) {
17
17
  result: n
18
18
  };
19
19
  } catch (e) {
20
- return i(e);
20
+ return t(e);
21
21
  }
22
22
  }
23
- async function h(n) {
23
+ async function h(e) {
24
24
  try {
25
- if (!n) {
26
- if (e(d.PACKAGE_JSON)) {
27
- let e = t(d.PACKAGE_JSON), { name: n = "", version: r = "" } = e;
25
+ if (!e) {
26
+ if (r(d.PACKAGE_JSON)) {
27
+ let e = i(d.PACKAGE_JSON), { name: t = "", version: n = "" } = e;
28
28
  return {
29
29
  success: !0,
30
30
  result: {
31
- name: n,
32
- currentVersion: r,
33
- latestVersion: r,
31
+ name: t,
32
+ currentVersion: n,
33
+ latestVersion: n,
34
34
  isCurrentProject: !0,
35
35
  isInstalled: !0,
36
36
  isUpToDate: !0,
@@ -57,42 +57,42 @@ async function h(n) {
57
57
  }
58
58
  };
59
59
  }
60
- if (!e(d.PACKAGE_JSON)) return {
60
+ if (!r(d.PACKAGE_JSON)) return {
61
61
  success: !0,
62
62
  result: {
63
- name: n.name,
63
+ name: e.name,
64
64
  currentVersion: "",
65
65
  latestVersion: "",
66
66
  isCurrentProject: !1,
67
67
  isInstalled: !1,
68
68
  isUpToDate: !1,
69
- isDependency: n.type === o.DEPENDENCY,
70
- isDevDependency: n.type === o.DEV_DEPENDENCY,
69
+ isDependency: e.type === o.DEPENDENCY,
70
+ isDevDependency: e.type === o.DEV_DEPENDENCY,
71
71
  installedPath: "",
72
72
  file: {}
73
73
  }
74
74
  };
75
- let r = t(d.PACKAGE_JSON), { name: i, version: a = "", dependencies: s = {}, devDependencies: f = {} } = r;
76
- if (n.name === i) return {
75
+ let t = i(d.PACKAGE_JSON), { name: n, version: a = "", dependencies: s = {}, devDependencies: f = {} } = t;
76
+ if (e.name === n) return {
77
77
  success: !0,
78
78
  result: {
79
- name: i,
79
+ name: n,
80
80
  currentVersion: a,
81
81
  latestVersion: a,
82
82
  isCurrentProject: !0,
83
83
  isInstalled: !0,
84
84
  isUpToDate: !0,
85
- isDependency: n.type === o.DEPENDENCY,
86
- isDevDependency: n.type === o.DEV_DEPENDENCY,
85
+ isDependency: e.type === o.DEPENDENCY,
86
+ isDevDependency: e.type === o.DEV_DEPENDENCY,
87
87
  installedPath: d.PACKAGE_JSON,
88
- file: r
88
+ file: t
89
89
  }
90
90
  };
91
- let h = n.name in s, g = n.name in f, _ = await m(n.name);
91
+ let h = e.name in s, g = e.name in f, _ = await m(e.name);
92
92
  if (!_.success) return {
93
93
  success: !0,
94
94
  result: {
95
- name: n.name,
95
+ name: e.name,
96
96
  currentVersion: "",
97
97
  latestVersion: "",
98
98
  isCurrentProject: !1,
@@ -107,23 +107,23 @@ async function h(n) {
107
107
  if (!h && !g) return {
108
108
  success: !0,
109
109
  result: {
110
- name: n.name,
110
+ name: e.name,
111
111
  currentVersion: "",
112
112
  latestVersion: _.result,
113
113
  isCurrentProject: !1,
114
114
  isInstalled: !1,
115
115
  isUpToDate: !1,
116
- isDependency: n.type === o.DEPENDENCY,
117
- isDevDependency: n.type === o.DEV_DEPENDENCY,
116
+ isDependency: e.type === o.DEPENDENCY,
117
+ isDevDependency: e.type === o.DEV_DEPENDENCY,
118
118
  installedPath: "",
119
119
  file: {}
120
120
  }
121
121
  };
122
- let v = s[n.name] ?? f[n.name] ?? "", y = c(p.CWD, l, n.name, u);
123
- if (!e(y)) return {
122
+ let v = s[e.name] ?? f[e.name] ?? "", y = c(p.CWD, l, e.name, u);
123
+ if (!r(y)) return {
124
124
  success: !0,
125
125
  result: {
126
- name: n.name,
126
+ name: e.name,
127
127
  currentVersion: "",
128
128
  latestVersion: _.result,
129
129
  isCurrentProject: !1,
@@ -135,11 +135,11 @@ async function h(n) {
135
135
  file: {}
136
136
  }
137
137
  };
138
- let b = t(y), { version: x = "" } = b;
138
+ let b = i(y), { version: x = "" } = b;
139
139
  return v === x ? {
140
140
  success: !0,
141
141
  result: {
142
- name: n.name,
142
+ name: e.name,
143
143
  currentVersion: v,
144
144
  latestVersion: _.result,
145
145
  isCurrentProject: !1,
@@ -153,7 +153,7 @@ async function h(n) {
153
153
  } : {
154
154
  success: !0,
155
155
  result: {
156
- name: n.name,
156
+ name: e.name,
157
157
  currentVersion: x || v,
158
158
  latestVersion: _.result,
159
159
  isCurrentProject: !1,
@@ -166,15 +166,15 @@ async function h(n) {
166
166
  }
167
167
  };
168
168
  } catch (e) {
169
- return i(e);
169
+ return t(e);
170
170
  }
171
171
  }
172
172
  async function g(e) {
173
173
  try {
174
- let r = t(d.PACKAGE_JSON), i = r.dependencies ?? {}, o = r.devDependencies ?? {};
175
- e.isDependency ? i[e.name] = e.latestVersion : e.isDevDependency && (o[e.name] = e.latestVersion), n(d.PACKAGE_JSON, JSON.stringify(r, null, 4)), a.info(`Updated "${e.name}" to version ${e.latestVersion}`);
174
+ let t = i(d.PACKAGE_JSON), r = t.dependencies ?? {}, o = t.devDependencies ?? {};
175
+ e.isDependency ? r[e.name] = e.latestVersion : e.isDevDependency && (o[e.name] = e.latestVersion), a(d.PACKAGE_JSON, JSON.stringify(t, null, 4)), n.info(`Updated "${e.name}" to version ${e.latestVersion}`);
176
176
  } catch (e) {
177
- i(e);
177
+ t(e);
178
178
  }
179
179
  }
180
180
  async function _() {
@@ -184,35 +184,35 @@ async function _() {
184
184
  await s(`Installing dependencies (standard) using: ${e}`, e);
185
185
  return;
186
186
  } catch (e) {
187
- i(e);
187
+ t(e);
188
188
  }
189
189
  try {
190
190
  let e = await f.pnpmInstallLegacy();
191
191
  await s(`Retrying with legacy peer dependencies using: ${e}`, e);
192
192
  return;
193
193
  } catch (e) {
194
- i(e);
194
+ t(e);
195
195
  }
196
196
  try {
197
197
  let e = await f.pnpmInstallForce();
198
198
  await s(`Retrying with force install using: ${e}`, e);
199
199
  } catch (e) {
200
- i(e);
200
+ t(e);
201
201
  }
202
202
  } catch (e) {
203
- i(e);
203
+ t(e);
204
204
  }
205
205
  }
206
- async function v(t, n) {
206
+ async function v(e, i) {
207
207
  try {
208
- if (!e(d.PACKAGE_JSON)) {
209
- a.error("package.json not found. Aborting setup.");
208
+ if (!r(d.PACKAGE_JSON)) {
209
+ n.error("package.json not found. Aborting setup.");
210
210
  return;
211
211
  }
212
- let r = (await Promise.all(t.map(h))).filter((e) => e.success && !!e.result && !e.result.isCurrentProject).map((e) => e.result), i = r.filter((e) => !e.isInstalled), o = r.filter((e) => !e.isUpToDate), c = [];
213
- n?.install && i.length > 0 && c.push(...i.map(g)), n?.update && o.length > 0 && c.push(...o.map(g)), c.length > 0 && (await Promise.all(c), await _(), await s("Running ESLint with auto-fix", await f.eslintFix())), await n?.callback?.();
212
+ let t = (await Promise.all(e.map(h))).filter((e) => e.success && !!e.result && !e.result.isCurrentProject).map((e) => e.result), a = t.filter((e) => !e.isInstalled), o = t.filter((e) => !e.isUpToDate), c = [];
213
+ i?.install && a.length > 0 && c.push(...a.map(g)), i?.update && o.length > 0 && c.push(...o.map(g)), c.length > 0 && (await Promise.all(c), await _(), await s("Running ESLint with auto-fix", await f.eslintFix())), await i?.callback?.();
214
214
  } catch (e) {
215
- i(e);
215
+ t(e);
216
216
  }
217
217
  }
218
218
  //#endregion
@@ -1,3 +1,3 @@
1
1
  import { dirname as e, join as t, path as n, resolve as r, resolveWorkingPath as i } from "./path.util.js";
2
- import { AG_KIT_PACKAGE_NAME as a, BUILD_DIRECTORY as o, COMMIT_LINT_CLI as s, COMMIT_LINT_CONVENTIONAL_CONFIG_PACKAGE_NAME as c, COMMIT_LINT_PACKAGE_NAME as l, CYBERSKILL_CLI as u, CYBERSKILL_CLI_PATH as d, CYBERSKILL_DIRECTORY as f, CYBERSKILL_PACKAGE_NAME as p, DOT_AGENT as m, ESLINT_CLI as h, ESLINT_INSPECT_CLI as g, ESLINT_INSPECT_PACKAGE_NAME as _, ESLINT_PACKAGE_NAME as v, GIT_CLI as y, GIT_COMMIT_EDITMSG as b, GIT_EXCLUDE as x, GIT_HOOK as S, GIT_IGNORE as C, LINT_STAGED_CLI as w, LINT_STAGED_PACKAGE_NAME as T, MIGRATE_MONGO_CLI as E, MIGRATE_MONGO_CONFIG as D, MIGRATE_MONGO_PACKAGE_NAME as O, NODE_MODULES as k, NODE_MODULES_INSPECT_CLI as A, NODE_MODULES_INSPECT_PACKAGE_NAME as j, PACKAGE_JSON as M, PACKAGE_LOCK_JSON as N, PATH as P, PNPM_CLI as F, PNPM_EXEC_CLI as I, PNPM_LOCK_YAML as L, PUBLIC_DIRECTORY as R, SIMPLE_GIT_HOOKS_PACKAGE_NAME as z, SIMPLE_GIT_HOOK_CLI as B, SIMPLE_GIT_HOOK_JSON as V, STORYBOOK_CLI as H, STORYBOOK_PACKAGE_NAME as U, TSCONFIG_JSON as W, TSC_CLI as G, TSC_PACKAGE_NAME as K, TSX_CLI as q, VITEST_CLI as J, VITEST_PACKAGE_NAME as Y, WORKING_DIRECTORY as X, command as Z, createGitHooksConfig as Q, getCyberskillDirectory as $ } from "./path.constant.js";
3
- export { a as AG_KIT_PACKAGE_NAME, o as BUILD_DIRECTORY, s as COMMIT_LINT_CLI, c as COMMIT_LINT_CONVENTIONAL_CONFIG_PACKAGE_NAME, l as COMMIT_LINT_PACKAGE_NAME, u as CYBERSKILL_CLI, d as CYBERSKILL_CLI_PATH, f as CYBERSKILL_DIRECTORY, p as CYBERSKILL_PACKAGE_NAME, m as DOT_AGENT, h as ESLINT_CLI, g as ESLINT_INSPECT_CLI, _ as ESLINT_INSPECT_PACKAGE_NAME, v as ESLINT_PACKAGE_NAME, y as GIT_CLI, b as GIT_COMMIT_EDITMSG, x as GIT_EXCLUDE, S as GIT_HOOK, C as GIT_IGNORE, w as LINT_STAGED_CLI, T as LINT_STAGED_PACKAGE_NAME, E as MIGRATE_MONGO_CLI, D as MIGRATE_MONGO_CONFIG, O as MIGRATE_MONGO_PACKAGE_NAME, k as NODE_MODULES, A as NODE_MODULES_INSPECT_CLI, j as NODE_MODULES_INSPECT_PACKAGE_NAME, M as PACKAGE_JSON, N as PACKAGE_LOCK_JSON, P as PATH, F as PNPM_CLI, I as PNPM_EXEC_CLI, L as PNPM_LOCK_YAML, R as PUBLIC_DIRECTORY, z as SIMPLE_GIT_HOOKS_PACKAGE_NAME, B as SIMPLE_GIT_HOOK_CLI, V as SIMPLE_GIT_HOOK_JSON, H as STORYBOOK_CLI, U as STORYBOOK_PACKAGE_NAME, W as TSCONFIG_JSON, G as TSC_CLI, K as TSC_PACKAGE_NAME, q as TSX_CLI, J as VITEST_CLI, Y as VITEST_PACKAGE_NAME, X as WORKING_DIRECTORY, Z as command, Q as createGitHooksConfig, e as dirname, $ as getCyberskillDirectory, t as join, n as path, r as resolve, i as resolveWorkingPath };
2
+ import { AG_KIT_PACKAGE_NAME as a, BUILD_DIRECTORY as o, COMMIT_LINT_CLI as s, COMMIT_LINT_CONVENTIONAL_CONFIG_PACKAGE_NAME as c, COMMIT_LINT_PACKAGE_NAME as l, CYBERSKILL_CLI as u, CYBERSKILL_CLI_PATH as d, CYBERSKILL_DIRECTORY as f, CYBERSKILL_PACKAGE_NAME as p, DOT_AGENT as m, ESLINT_CLI as h, ESLINT_INSPECT_CLI as g, ESLINT_INSPECT_PACKAGE_NAME as _, ESLINT_PACKAGE_NAME as v, GIT_CLI as y, GIT_COMMIT_EDITMSG as b, GIT_EXCLUDE as x, GIT_HOOK as S, GIT_IGNORE as C, LINT_STAGED_CLI as w, LINT_STAGED_PACKAGE_NAME as T, MIGRATE_MONGO_CLI as E, MIGRATE_MONGO_CONFIG as D, MIGRATE_MONGO_PACKAGE_NAME as O, NODE_MODULES as k, NODE_MODULES_INSPECT_CLI as A, NODE_MODULES_INSPECT_PACKAGE_NAME as j, PACKAGE_JSON as M, PACKAGE_LOCK_JSON as N, PATH as P, PNPM_CLI as F, PNPM_EXEC_CLI as I, PNPM_LOCK_YAML as L, PUBLIC_DIRECTORY as R, SIMPLE_GIT_HOOKS_PACKAGE_NAME as z, SIMPLE_GIT_HOOK_CLI as B, SIMPLE_GIT_HOOK_JSON as V, STORYBOOK_CLI as H, STORYBOOK_PACKAGE_NAME as U, TSCONFIG_JSON as W, TSC_CLI as G, TSC_PACKAGE_NAME as K, TSX_CLI as q, VITEST_CLI as J, VITEST_PACKAGE_NAME as Y, WORKING_DIRECTORY as X, command as Z, createGitHooksConfig as Q, getCyberskillDirectory as $, resetCyberskillDirCacheForTesting as ee } from "./path.constant.js";
3
+ export { a as AG_KIT_PACKAGE_NAME, o as BUILD_DIRECTORY, s as COMMIT_LINT_CLI, c as COMMIT_LINT_CONVENTIONAL_CONFIG_PACKAGE_NAME, l as COMMIT_LINT_PACKAGE_NAME, u as CYBERSKILL_CLI, d as CYBERSKILL_CLI_PATH, f as CYBERSKILL_DIRECTORY, p as CYBERSKILL_PACKAGE_NAME, m as DOT_AGENT, h as ESLINT_CLI, g as ESLINT_INSPECT_CLI, _ as ESLINT_INSPECT_PACKAGE_NAME, v as ESLINT_PACKAGE_NAME, y as GIT_CLI, b as GIT_COMMIT_EDITMSG, x as GIT_EXCLUDE, S as GIT_HOOK, C as GIT_IGNORE, w as LINT_STAGED_CLI, T as LINT_STAGED_PACKAGE_NAME, E as MIGRATE_MONGO_CLI, D as MIGRATE_MONGO_CONFIG, O as MIGRATE_MONGO_PACKAGE_NAME, k as NODE_MODULES, A as NODE_MODULES_INSPECT_CLI, j as NODE_MODULES_INSPECT_PACKAGE_NAME, M as PACKAGE_JSON, N as PACKAGE_LOCK_JSON, P as PATH, F as PNPM_CLI, I as PNPM_EXEC_CLI, L as PNPM_LOCK_YAML, R as PUBLIC_DIRECTORY, z as SIMPLE_GIT_HOOKS_PACKAGE_NAME, B as SIMPLE_GIT_HOOK_CLI, V as SIMPLE_GIT_HOOK_JSON, H as STORYBOOK_CLI, U as STORYBOOK_PACKAGE_NAME, W as TSCONFIG_JSON, G as TSC_CLI, K as TSC_PACKAGE_NAME, q as TSX_CLI, J as VITEST_CLI, Y as VITEST_PACKAGE_NAME, X as WORKING_DIRECTORY, Z as command, Q as createGitHooksConfig, e as dirname, $ as getCyberskillDirectory, t as join, n as path, ee as resetCyberskillDirCacheForTesting, r as resolve, i as resolveWorkingPath };
@@ -13,6 +13,10 @@ export declare const GIT_HOOK = ".git/hooks/";
13
13
  export declare const GIT_COMMIT_EDITMSG = ".git/COMMIT_EDITMSG";
14
14
  export declare const GIT_EXCLUDE = ".git/info/exclude";
15
15
  export declare const MIGRATE_MONGO_CONFIG = ".migrate-mongo.config.js";
16
+ /**
17
+ * Resets the cached directory path. For testing only.
18
+ */
19
+ export declare function resetCyberskillDirCacheForTesting(): void;
16
20
  /**
17
21
  * Lazily computes the CyberSkill directory path.
18
22
  * Reads package.json on first access to determine whether this is the shared package itself
@@ -4,117 +4,120 @@ import { E_PackageType as n } from "../package/package.type.js";
4
4
  import { setupPackages as ee } from "../package/package.util.js";
5
5
  import { formatCommand as r, rawCommand as i } from "../command/command.util.js";
6
6
  import { join as a, resolveWorkingPath as o } from "./path.util.js";
7
- import te from "fs-extra";
7
+ import s from "fs-extra";
8
8
  //#region src/node/path/path.constant.ts
9
- var s = e().CWD, c = "@cyberskill/shared", l = "node_modules", u = "dist", d = "public", f = "package.json", p = "package-lock.json", m = "tsconfig.json", h = ".gitignore", g = ".simple-git-hooks.json", _ = "pnpm-lock.yaml", v = ".git/hooks/", y = ".git/COMMIT_EDITMSG", b = ".git/info/exclude", x = ".migrate-mongo.config.js", S = null;
10
- function C() {
11
- if (S !== null) return S;
9
+ var c = e().CWD, l = "@cyberskill/shared", u = "node_modules", d = "dist", f = "public", p = "package.json", m = "package-lock.json", h = "tsconfig.json", g = ".gitignore", _ = ".simple-git-hooks.json", v = "pnpm-lock.yaml", y = ".git/hooks/", b = ".git/COMMIT_EDITMSG", x = ".git/info/exclude", S = ".migrate-mongo.config.js", C = null;
10
+ function te() {
11
+ C = null;
12
+ }
13
+ function w() {
14
+ if (C !== null) return C;
12
15
  try {
13
- S = te.readJsonSync(o("package.json")).name === "@cyberskill/shared" ? a(s, u) : a(s, l, c, u);
16
+ C = s.readJsonSync(o("package.json")).name === "@cyberskill/shared" ? a(c, d) : a(c, u, l, d);
14
17
  } catch {
15
- S = a(s, l, c, u);
18
+ C = a(c, u, l, d);
16
19
  }
17
- return S;
20
+ return C;
18
21
  }
19
- var ne = C(), w = "cyberskill", re = "src/node/cli/index.ts", T = "eslint", E = "eslint", D = "vitest", O = "vitest", k = "@commitlint/cli", A = "@commitlint/config-conventional", j = "commitlint", M = "lint-staged", N = "lint-staged", P = "typescript", F = "tsc", I = "tsx", L = "git", R = "pnpm", z = "pnpm exec", B = "simple-git-hooks", V = "simple-git-hooks", H = "@eslint/config-inspector", U = "eslint-config-inspector", W = "node-modules-inspector", G = "node-modules-inspector", K = "migrate-mongo", q = "./node_modules/migrate-mongo/bin/migrate-mongo", J = "storybook", Y = "storybook", X = "@vudovn/ag-kit", Z = ".agent", Q = {
22
+ var T = w(), E = "cyberskill", ne = "src/node/cli/index.ts", D = "eslint", O = "eslint", k = "vitest", A = "vitest", j = "@commitlint/cli", M = "@commitlint/config-conventional", N = "commitlint", P = "lint-staged", F = "lint-staged", I = "typescript", re = "tsc", L = "tsx", R = "git", z = "pnpm", B = "pnpm exec", V = "simple-git-hooks", H = "simple-git-hooks", U = "@eslint/config-inspector", W = "eslint-config-inspector", G = "node-modules-inspector", K = "node-modules-inspector", q = "migrate-mongo", J = "./node_modules/migrate-mongo/bin/migrate-mongo", Y = "storybook", X = "storybook", ie = "@vudovn/ag-kit", Z = ".agent", Q = {
20
23
  get CYBERSKILL_DIRECTORY() {
21
- return C();
24
+ return w();
22
25
  },
23
- WORKING_DIRECTORY: s,
24
- PUBLIC_DIRECTORY: o(d),
25
- TS_CONFIG: o(m),
26
- GIT_IGNORE: o(h),
27
- GIT_HOOK: o(v),
28
- GIT_COMMIT_MSG: o(y),
29
- GIT_EXCLUDE: o(b),
30
- SIMPLE_GIT_HOOKS_JSON: o(g),
31
- PACKAGE_JSON: o(f),
32
- PACKAGE_LOCK_JSON: o(p),
33
- PNPM_LOCK_YAML: o(_),
34
- NODE_MODULES: o(l),
35
- MIGRATE_MONGO_CONFIG: o(x),
26
+ WORKING_DIRECTORY: c,
27
+ PUBLIC_DIRECTORY: o(f),
28
+ TS_CONFIG: o(h),
29
+ GIT_IGNORE: o(g),
30
+ GIT_HOOK: o(y),
31
+ GIT_COMMIT_MSG: o(b),
32
+ GIT_EXCLUDE: o(x),
33
+ SIMPLE_GIT_HOOKS_JSON: o(_),
34
+ PACKAGE_JSON: o(p),
35
+ PACKAGE_LOCK_JSON: o(m),
36
+ PNPM_LOCK_YAML: o(v),
37
+ NODE_MODULES: o(u),
38
+ MIGRATE_MONGO_CONFIG: o(S),
36
39
  get LINT_STAGED_CONFIG() {
37
- return o(`${C()}/config/lint-staged/index.js`);
40
+ return o(`${w()}/config/lint-staged/index.js`);
38
41
  },
39
42
  get COMMITLINT_CONFIG() {
40
- return o(`${C()}/config/commitlint/index.js`);
43
+ return o(`${w()}/config/commitlint/index.js`);
41
44
  },
42
45
  get VITEST_UNIT_CONFIG() {
43
- return o(`${C()}/config/vitest/vitest.unit.js`);
46
+ return o(`${w()}/config/vitest/vitest.unit.js`);
44
47
  },
45
48
  get VITEST_E2E_CONFIG() {
46
- return o(`${C()}/config/vitest/vitest.e2e.js`);
49
+ return o(`${w()}/config/vitest/vitest.e2e.js`);
47
50
  },
48
51
  get STORYBOOK_MAIN_CONFIG() {
49
- return o(`${C()}/config/storybook/storybook.main.js`);
52
+ return o(`${w()}/config/storybook/storybook.main.js`);
50
53
  },
51
54
  get STORYBOOK_PREVIEW_CONFIG() {
52
- return o(`${C()}/config/storybook/storybook.preview.js`);
55
+ return o(`${w()}/config/storybook/storybook.preview.js`);
53
56
  },
54
57
  DOT_AGENT: o(Z)
55
58
  };
56
- function ie() {
59
+ function ae() {
57
60
  return {
58
- "pre-commit": N,
59
- "commit-msg": j,
60
- "pre-push": i(`git pull && ${R} run --if-present test`)
61
+ "pre-commit": F,
62
+ "commit-msg": N,
63
+ "pre-push": i(`git pull && ${z} run --if-present test`)
61
64
  };
62
65
  }
63
66
  function $({ type: e, packages: n, command: a }) {
64
67
  let o = n?.reduce((e, t) => (e.some((e) => e.name === t.name) || e.push(t), e), []);
65
68
  return async () => {
66
69
  switch (e) {
67
- case t.CLI: return o?.length && await ee(o, { install: !0 }), r(i(`${z} ${a}`));
70
+ case t.CLI: return o?.length && await ee(o, { install: !0 }), r(i(`${B} ${a}`));
68
71
  case t.STRING: return r(i(a));
69
72
  default: throw Error("Unsupported command type");
70
73
  }
71
74
  };
72
75
  }
73
- var ae = /^[\w-]+$/, oe = {
76
+ var oe = /^[\w-]+$/, se = {
74
77
  simpleGitHooks: $({
75
78
  type: t.CLI,
76
79
  packages: [{
77
- name: B,
80
+ name: V,
78
81
  type: n.DEV_DEPENDENCY
79
82
  }],
80
- command: V
83
+ command: H
81
84
  }),
82
85
  eslintInspect: $({
83
86
  type: t.CLI,
84
87
  packages: [{
85
- name: H,
88
+ name: U,
86
89
  type: n.DEV_DEPENDENCY
87
90
  }],
88
- command: U
91
+ command: W
89
92
  }),
90
93
  nodeModulesInspect: $({
91
94
  type: t.CLI,
92
95
  packages: [{
93
- name: W,
96
+ name: G,
94
97
  type: n.DEV_DEPENDENCY
95
98
  }],
96
- command: G
99
+ command: K
97
100
  }),
98
101
  eslintCheck: $({
99
102
  type: t.CLI,
100
103
  packages: [{
101
- name: T,
104
+ name: D,
102
105
  type: n.DEV_DEPENDENCY
103
106
  }],
104
- command: `${E} ${Q.WORKING_DIRECTORY} --no-cache`
107
+ command: `${O} ${Q.WORKING_DIRECTORY} --no-cache`
105
108
  }),
106
109
  eslintFix: $({
107
110
  type: t.CLI,
108
111
  packages: [{
109
- name: T,
112
+ name: D,
110
113
  type: n.DEV_DEPENDENCY
111
114
  }],
112
- command: `${E} ${Q.WORKING_DIRECTORY} --fix --no-cache`
115
+ command: `${O} ${Q.WORKING_DIRECTORY} --fix --no-cache`
113
116
  }),
114
117
  typescriptCheck: $({
115
118
  type: t.CLI,
116
119
  packages: [{
117
- name: P,
120
+ name: I,
118
121
  type: n.DEV_DEPENDENCY
119
122
  }],
120
123
  command: `tsc -p ${Q.TS_CONFIG} --noEmit --incremental`
@@ -122,31 +125,31 @@ var ae = /^[\w-]+$/, oe = {
122
125
  testUnit: $({
123
126
  type: t.CLI,
124
127
  packages: [{
125
- name: D,
128
+ name: k,
126
129
  type: n.DEV_DEPENDENCY
127
130
  }],
128
- command: `${O} --config ${Q.VITEST_UNIT_CONFIG}`
131
+ command: `${A} --config ${Q.VITEST_UNIT_CONFIG}`
129
132
  }),
130
133
  testE2e: $({
131
134
  type: t.CLI,
132
135
  packages: [{
133
- name: D,
136
+ name: k,
134
137
  type: n.DEV_DEPENDENCY
135
138
  }],
136
- command: `${O} --config ${Q.VITEST_E2E_CONFIG}`
139
+ command: `${A} --config ${Q.VITEST_E2E_CONFIG}`
137
140
  }),
138
141
  mongoMigrateCreate: (e) => {
139
- if (!ae.test(e)) throw Error("Migration name must only contain alphanumeric characters, underscores, and hyphens.");
142
+ if (!oe.test(e)) throw Error("Migration name must only contain alphanumeric characters, underscores, and hyphens.");
140
143
  return $({
141
144
  type: t.CLI,
142
145
  packages: [{
143
146
  name: "tsx",
144
147
  type: n.DEPENDENCY
145
148
  }, {
146
- name: K,
149
+ name: q,
147
150
  type: n.DEPENDENCY
148
151
  }],
149
- command: `tsx ${q} create ${e} -f ${Q.MIGRATE_MONGO_CONFIG}`
152
+ command: `tsx ${J} create ${e} -f ${Q.MIGRATE_MONGO_CONFIG}`
150
153
  })();
151
154
  },
152
155
  mongoMigrateUp: $({
@@ -155,10 +158,10 @@ var ae = /^[\w-]+$/, oe = {
155
158
  name: "tsx",
156
159
  type: n.DEPENDENCY
157
160
  }, {
158
- name: K,
161
+ name: q,
159
162
  type: n.DEPENDENCY
160
163
  }],
161
- command: `tsx ${q} up -f ${Q.MIGRATE_MONGO_CONFIG}`
164
+ command: `tsx ${J} up -f ${Q.MIGRATE_MONGO_CONFIG}`
162
165
  }),
163
166
  mongoMigrateDown: $({
164
167
  type: t.CLI,
@@ -166,29 +169,29 @@ var ae = /^[\w-]+$/, oe = {
166
169
  name: "tsx",
167
170
  type: n.DEPENDENCY
168
171
  }, {
169
- name: K,
172
+ name: q,
170
173
  type: n.DEPENDENCY
171
174
  }],
172
- command: `tsx ${q} down -f ${Q.MIGRATE_MONGO_CONFIG}`
175
+ command: `tsx ${J} down -f ${Q.MIGRATE_MONGO_CONFIG}`
173
176
  }),
174
177
  commitLint: $({
175
178
  type: t.CLI,
176
179
  packages: [{
177
- name: k,
180
+ name: j,
178
181
  type: n.DEV_DEPENDENCY
179
182
  }, {
180
- name: A,
183
+ name: M,
181
184
  type: n.DEV_DEPENDENCY
182
185
  }],
183
- command: `${j} --edit ${Q.GIT_COMMIT_MSG} --config ${Q.COMMITLINT_CONFIG}`
186
+ command: `${N} --edit ${Q.GIT_COMMIT_MSG} --config ${Q.COMMITLINT_CONFIG}`
184
187
  }),
185
188
  lintStaged: $({
186
189
  type: t.CLI,
187
190
  packages: [{
188
- name: M,
191
+ name: P,
189
192
  type: n.DEV_DEPENDENCY
190
193
  }],
191
- command: `${N} --config ${Q.LINT_STAGED_CONFIG}`
194
+ command: `${F} --config ${Q.LINT_STAGED_CONFIG}`
192
195
  }),
193
196
  configureGitHook: $({
194
197
  type: t.STRING,
@@ -196,46 +199,46 @@ var ae = /^[\w-]+$/, oe = {
196
199
  }),
197
200
  build: $({
198
201
  type: t.STRING,
199
- command: `${R} run --if-present build`
202
+ command: `${z} run --if-present build`
200
203
  }),
201
204
  pnpmInstallStandard: $({
202
205
  type: t.STRING,
203
- command: `${R} install --ignore-scripts`
206
+ command: `${z} install --ignore-scripts`
204
207
  }),
205
208
  pnpmInstallLegacy: $({
206
209
  type: t.STRING,
207
- command: `${R} install --ignore-scripts --legacy-peer-deps`
210
+ command: `${z} install --ignore-scripts --legacy-peer-deps`
208
211
  }),
209
212
  pnpmInstallForce: $({
210
213
  type: t.STRING,
211
- command: `${R} install --ignore-scripts --force`
214
+ command: `${z} install --ignore-scripts --force`
212
215
  }),
213
216
  pnpmPruneStore: $({
214
217
  type: t.STRING,
215
- command: `${R} store prune`
218
+ command: `${z} store prune`
216
219
  }),
217
220
  pnpmCleanCache: $({
218
221
  type: t.STRING,
219
- command: `${R} cache delete`
222
+ command: `${z} cache delete`
220
223
  }),
221
224
  storybookDev: $({
222
225
  type: t.CLI,
223
226
  packages: [{
224
- name: J,
227
+ name: Y,
225
228
  type: n.DEV_DEPENDENCY
226
229
  }],
227
- command: `${Y} dev`
230
+ command: `${X} dev`
228
231
  }),
229
232
  storybookBuild: $({
230
233
  type: t.CLI,
231
234
  packages: [{
232
- name: J,
235
+ name: Y,
233
236
  type: n.DEV_DEPENDENCY
234
237
  }],
235
- command: `${Y} build`
238
+ command: `${X} build`
236
239
  })
237
240
  };
238
241
  //#endregion
239
- export { X as AG_KIT_PACKAGE_NAME, u as BUILD_DIRECTORY, j as COMMIT_LINT_CLI, A as COMMIT_LINT_CONVENTIONAL_CONFIG_PACKAGE_NAME, k as COMMIT_LINT_PACKAGE_NAME, w as CYBERSKILL_CLI, re as CYBERSKILL_CLI_PATH, ne as CYBERSKILL_DIRECTORY, c as CYBERSKILL_PACKAGE_NAME, Z as DOT_AGENT, E as ESLINT_CLI, U as ESLINT_INSPECT_CLI, H as ESLINT_INSPECT_PACKAGE_NAME, T as ESLINT_PACKAGE_NAME, L as GIT_CLI, y as GIT_COMMIT_EDITMSG, b as GIT_EXCLUDE, v as GIT_HOOK, h as GIT_IGNORE, N as LINT_STAGED_CLI, M as LINT_STAGED_PACKAGE_NAME, q as MIGRATE_MONGO_CLI, x as MIGRATE_MONGO_CONFIG, K as MIGRATE_MONGO_PACKAGE_NAME, l as NODE_MODULES, G as NODE_MODULES_INSPECT_CLI, W as NODE_MODULES_INSPECT_PACKAGE_NAME, f as PACKAGE_JSON, p as PACKAGE_LOCK_JSON, Q as PATH, R as PNPM_CLI, z as PNPM_EXEC_CLI, _ as PNPM_LOCK_YAML, d as PUBLIC_DIRECTORY, B as SIMPLE_GIT_HOOKS_PACKAGE_NAME, V as SIMPLE_GIT_HOOK_CLI, g as SIMPLE_GIT_HOOK_JSON, Y as STORYBOOK_CLI, J as STORYBOOK_PACKAGE_NAME, m as TSCONFIG_JSON, F as TSC_CLI, P as TSC_PACKAGE_NAME, I as TSX_CLI, O as VITEST_CLI, D as VITEST_PACKAGE_NAME, s as WORKING_DIRECTORY, oe as command, ie as createGitHooksConfig, C as getCyberskillDirectory };
242
+ export { ie as AG_KIT_PACKAGE_NAME, d as BUILD_DIRECTORY, N as COMMIT_LINT_CLI, M as COMMIT_LINT_CONVENTIONAL_CONFIG_PACKAGE_NAME, j as COMMIT_LINT_PACKAGE_NAME, E as CYBERSKILL_CLI, ne as CYBERSKILL_CLI_PATH, T as CYBERSKILL_DIRECTORY, l as CYBERSKILL_PACKAGE_NAME, Z as DOT_AGENT, O as ESLINT_CLI, W as ESLINT_INSPECT_CLI, U as ESLINT_INSPECT_PACKAGE_NAME, D as ESLINT_PACKAGE_NAME, R as GIT_CLI, b as GIT_COMMIT_EDITMSG, x as GIT_EXCLUDE, y as GIT_HOOK, g as GIT_IGNORE, F as LINT_STAGED_CLI, P as LINT_STAGED_PACKAGE_NAME, J as MIGRATE_MONGO_CLI, S as MIGRATE_MONGO_CONFIG, q as MIGRATE_MONGO_PACKAGE_NAME, u as NODE_MODULES, K as NODE_MODULES_INSPECT_CLI, G as NODE_MODULES_INSPECT_PACKAGE_NAME, p as PACKAGE_JSON, m as PACKAGE_LOCK_JSON, Q as PATH, z as PNPM_CLI, B as PNPM_EXEC_CLI, v as PNPM_LOCK_YAML, f as PUBLIC_DIRECTORY, V as SIMPLE_GIT_HOOKS_PACKAGE_NAME, H as SIMPLE_GIT_HOOK_CLI, _ as SIMPLE_GIT_HOOK_JSON, X as STORYBOOK_CLI, Y as STORYBOOK_PACKAGE_NAME, h as TSCONFIG_JSON, re as TSC_CLI, I as TSC_PACKAGE_NAME, L as TSX_CLI, A as VITEST_CLI, k as VITEST_PACKAGE_NAME, c as WORKING_DIRECTORY, se as command, ae as createGitHooksConfig, w as getCyberskillDirectory, te as resetCyberskillDirCacheForTesting };
240
243
 
241
244
  //# sourceMappingURL=path.constant.js.map