@cyberskill/shared 2.26.0 → 2.28.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 (71) hide show
  1. package/README.md +1 -1
  2. package/dist/config/config.util.cjs +1 -1
  3. package/dist/config/config.util.js +14 -19
  4. package/dist/config/eslint/index.cjs +1 -1
  5. package/dist/config/eslint/index.d.ts +2 -0
  6. package/dist/config/eslint/index.js +1 -1
  7. package/dist/config/vitest/vitest.e2e.cjs +1 -1
  8. package/dist/config/vitest/vitest.e2e.js +1 -1
  9. package/dist/config/vitest/vitest.unit.cjs +1 -1
  10. package/dist/config/vitest/vitest.unit.js +1 -1
  11. package/dist/node/cli/index.cjs +2 -5
  12. package/dist/node/cli/index.js +108 -103
  13. package/dist/node/command/command.util.js +1 -1
  14. package/dist/node/fs/fs.util.cjs +4 -1
  15. package/dist/node/fs/fs.util.d.ts +8 -0
  16. package/dist/node/fs/fs.util.js +58 -50
  17. package/dist/node/fs/index.cjs +1 -1
  18. package/dist/node/fs/index.js +13 -12
  19. package/dist/node/mongo/mongo.type.js +3 -3
  20. package/dist/node/mongo/mongo.util.cjs +2 -5
  21. package/dist/node/mongo/mongo.util.js +206 -211
  22. package/dist/node/path/index.cjs +1 -1
  23. package/dist/node/path/index.js +53 -51
  24. package/dist/node/path/path.constant.cjs +1 -1
  25. package/dist/node/path/path.constant.d.ts +3 -0
  26. package/dist/node/path/path.constant.js +63 -60
  27. package/dist/node/storage/storage.util.cjs +1 -1
  28. package/dist/node/storage/storage.util.js +1 -1
  29. package/dist/node/upload/upload.util.js +3 -3
  30. package/dist/react/apollo-client/apollo-client.component.cjs +1 -1
  31. package/dist/react/apollo-client/apollo-client.component.d.ts +1 -1
  32. package/dist/react/apollo-client/apollo-client.component.js +4 -3
  33. package/dist/react/apollo-client/apollo-client.context.cjs +1 -1
  34. package/dist/react/apollo-client/apollo-client.context.d.ts +1 -1
  35. package/dist/react/apollo-client/apollo-client.context.js +9 -8
  36. package/dist/react/apollo-client/apollo-client.util.cjs +1 -1
  37. package/dist/react/apollo-client/apollo-client.util.js +3 -3
  38. package/dist/react/apollo-client-nextjs/apollo-client-nextjs.component.cjs +1 -1
  39. package/dist/react/apollo-client-nextjs/apollo-client-nextjs.component.d.ts +1 -1
  40. package/dist/react/apollo-client-nextjs/apollo-client-nextjs.component.js +9 -8
  41. package/dist/react/apollo-error/apollo-error.component.cjs +1 -1
  42. package/dist/react/apollo-error/apollo-error.component.d.ts +1 -1
  43. package/dist/react/apollo-error/apollo-error.component.js +2 -1
  44. package/dist/react/apollo-error/apollo-error.provider.cjs +1 -1
  45. package/dist/react/apollo-error/apollo-error.provider.d.ts +1 -1
  46. package/dist/react/apollo-error/apollo-error.provider.js +4 -3
  47. package/dist/react/loading/loading.component.cjs +2 -2
  48. package/dist/react/loading/loading.component.d.ts +1 -1
  49. package/dist/react/loading/loading.component.js +7 -6
  50. package/dist/react/loading/loading.provider.cjs +1 -1
  51. package/dist/react/loading/loading.provider.d.ts +1 -1
  52. package/dist/react/loading/loading.provider.js +8 -7
  53. package/dist/react/next-intl/next-intl.hoc.cjs +1 -1
  54. package/dist/react/next-intl/next-intl.hoc.d.ts +2 -1
  55. package/dist/react/next-intl/next-intl.hoc.js +12 -12
  56. package/dist/react/next-intl/next-intl.provider.cjs +1 -1
  57. package/dist/react/next-intl/next-intl.provider.d.ts +1 -1
  58. package/dist/react/next-intl/next-intl.provider.js +5 -4
  59. package/dist/util/common/common.util.cjs +1 -1
  60. package/dist/util/common/common.util.d.ts +9 -0
  61. package/dist/util/common/common.util.js +33 -29
  62. package/dist/util/common/index.cjs +1 -1
  63. package/dist/util/common/index.js +6 -5
  64. package/dist/util/index.cjs +1 -1
  65. package/dist/util/index.js +23 -22
  66. package/dist/util/object/object.util.cjs +1 -1
  67. package/dist/util/object/object.util.js +40 -36
  68. package/package.json +45 -44
  69. package/dist/node/mongo/mongo.util.d.ts +0 -1040
  70. /package/dist/node_modules/.pnpm/{vitest@4.0.16_@types_node@25.0.3_jiti@2.6.1_jsdom@27.4.0_sass@1.97.2_tsx@4.21.0_yaml@2.8.2 → vitest@4.0.18_@types_node@25.3.0_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
  71. /package/dist/node_modules/.pnpm/{vitest@4.0.16_@types_node@25.0.3_jiti@2.6.1_jsdom@27.4.0_sass@1.97.2_tsx@4.21.0_yaml@2.8.2 → vitest@4.0.18_@types_node@25.3.0_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
package/README.md CHANGED
@@ -256,7 +256,7 @@ import {
256
256
  useApolloError,
257
257
  useLoading
258
258
  } from '@cyberskill/shared';
259
- import React from 'react';
259
+ import * as React from 'react';
260
260
 
261
261
  // Main application wrapper
262
262
  /**
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("@antfu/eslint-config"),i=require("./config.type.cjs"),o=require("./eslint/index.cjs"),l=require("./vitest/vitest.e2e.cjs"),_=require("./vitest/vitest.unit.cjs"),a=require("../util/object/object.util.cjs");var s=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable,p=(e,n)=>{var t={};for(var r in e)u.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&s)for(var r of s(e))n.indexOf(r)<0&&y.call(e,r)&&(t[r]=e[r]);return t};const E=(...e)=>{const t=a.deepMerge(...Array.isArray(o.default)?o.default:[o.default],...e),{ignores:r}=t,f=p(t,["ignores"]);return g({stylistic:{semi:!0,indent:4,quotes:"single"},formatters:{css:!0,html:!0,markdown:"prettier"},yaml:!1,react:!0},f,...Array.isArray(r)?[{ignores:r}]:[])},T={[i.E_ConfigType.ESLINT]:e=>E(e),[i.E_ConfigType.COMMITLINT]:e=>a.deepMerge(e),[i.E_ConfigType.LINT_STAGED]:e=>a.deepMerge(e),[i.E_ConfigType.VITEST_REACT_UNIT]:e=>_.vitestUnit(e),[i.E_ConfigType.VITEST_REACT_E2E]:e=>l.vitestE2E(e)};function d(e,...n){const t=T[e];if(!n||n.length===0)return t({});if(!t)throw new Error(`Unknown config type: ${e}`);return t(...n)}exports.mergeConfigs=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@antfu/eslint-config"),i=require("./config.type.cjs"),o=require("./eslint/index.cjs"),_=require("./vitest/vitest.e2e.cjs"),l=require("./vitest/vitest.unit.cjs"),a=require("../util/object/object.util.cjs");var f=Object.getOwnPropertySymbols,y=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,E=(e,n)=>{var t={};for(var r in e)y.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&f)for(var r of f(e))n.indexOf(r)<0&&u.call(e,r)&&(t[r]=e[r]);return t};const p=(...e)=>{const t=a.deepMerge(...Array.isArray(o.default)?o.default:[o.default],...e),{ignores:r}=t,g=E(t,["ignores"]);return s({stylistic:{semi:!0,indent:4},formatters:!0,yaml:!1,react:!0},g,...Array.isArray(r)?[{ignores:r}]:[])},T={[i.E_ConfigType.ESLINT]:e=>p(e),[i.E_ConfigType.COMMITLINT]:e=>a.deepMerge(e),[i.E_ConfigType.LINT_STAGED]:e=>a.deepMerge(e),[i.E_ConfigType.VITEST_REACT_UNIT]:e=>l.vitestUnit(e),[i.E_ConfigType.VITEST_REACT_E2E]:e=>_.vitestE2E(e)};function d(e,...n){const t=T[e];if(!n||n.length===0)return t({});if(!t)throw new Error(`Unknown config type: ${e}`);return t(...n)}exports.mergeConfigs=d;
@@ -1,13 +1,13 @@
1
- import m from "@antfu/eslint-config";
1
+ import s from "@antfu/eslint-config";
2
2
  import { E_ConfigType as o } from "./config.type.js";
3
3
  import i from "./eslint/index.js";
4
- import { vitestE2E as l } from "./vitest/vitest.e2e.js";
5
- import { vitestUnit as p } from "./vitest/vitest.unit.js";
4
+ import { vitestE2E as p } from "./vitest/vitest.e2e.js";
5
+ import { vitestUnit as g } from "./vitest/vitest.unit.js";
6
6
  import { deepMerge as a } from "../util/object/object.util.js";
7
- var f = Object.getOwnPropertySymbols, g = Object.prototype.hasOwnProperty, E = Object.prototype.propertyIsEnumerable, _ = (r, n) => {
7
+ var f = Object.getOwnPropertySymbols, l = Object.prototype.hasOwnProperty, E = Object.prototype.propertyIsEnumerable, _ = (r, n) => {
8
8
  var e = {};
9
9
  for (var t in r)
10
- g.call(r, t) && n.indexOf(t) < 0 && (e[t] = r[t]);
10
+ l.call(r, t) && n.indexOf(t) < 0 && (e[t] = r[t]);
11
11
  if (r != null && f)
12
12
  for (var t of f(r))
13
13
  n.indexOf(t) < 0 && E.call(r, t) && (e[t] = r[t]);
@@ -17,33 +17,28 @@ const y = (...r) => {
17
17
  const e = a(
18
18
  ...Array.isArray(i) ? i : [i],
19
19
  ...r
20
- ), { ignores: t } = e, s = _(e, ["ignores"]);
21
- return m(
20
+ ), { ignores: t } = e, m = _(e, ["ignores"]);
21
+ return s(
22
22
  {
23
23
  stylistic: {
24
24
  semi: !0,
25
- indent: 4,
26
- quotes: "single"
27
- },
28
- formatters: {
29
- css: !0,
30
- html: !0,
31
- markdown: "prettier"
25
+ indent: 4
32
26
  },
27
+ formatters: !0,
33
28
  yaml: !1,
34
29
  react: !0
35
30
  },
36
- s,
31
+ m,
37
32
  ...Array.isArray(t) ? [{ ignores: t }] : []
38
33
  );
39
34
  }, T = {
40
35
  [o.ESLINT]: (r) => y(r),
41
36
  [o.COMMITLINT]: (r) => a(r),
42
37
  [o.LINT_STAGED]: (r) => a(r),
43
- [o.VITEST_REACT_UNIT]: (r) => p(r),
44
- [o.VITEST_REACT_E2E]: (r) => l(r)
38
+ [o.VITEST_REACT_UNIT]: (r) => g(r),
39
+ [o.VITEST_REACT_E2E]: (r) => p(r)
45
40
  };
46
- function b(r, ...n) {
41
+ function w(r, ...n) {
47
42
  const e = T[r];
48
43
  if (!n || n.length === 0)
49
44
  return e({});
@@ -52,5 +47,5 @@ function b(r, ...n) {
52
47
  return e(...n);
53
48
  }
54
49
  export {
55
- b as mergeConfigs
50
+ w as mergeConfigs
56
51
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("globals");function u(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,o.get?o:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const n=u(i);var c=Object.defineProperty,a=Object.getOwnPropertySymbols,f=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,l=(t,e,r)=>e in t?c(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,s=(t,e)=>{for(var r in e||(e={}))f.call(e,r)&&l(t,r,e[r]);if(a)for(var r of a(e))p.call(e,r)&&l(t,r,e[r]);return t};const d=[{languageOptions:{globals:s(s({},n.node),n.browser)},rules:{"perfectionist/sort-imports":["error",{internalPattern:["^#.*","^@/.*"]}],"dot-notation":"off"},ignores:["**/node_modules/**","**/.git/**","build","dist"]}];exports.default=d;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("globals");function u(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,o.get?o:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const n=u(i);var c=Object.defineProperty,a=Object.getOwnPropertySymbols,f=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,l=(t,e,r)=>e in t?c(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,s=(t,e)=>{for(var r in e||(e={}))f.call(e,r)&&l(t,r,e[r]);if(a)for(var r of a(e))p.call(e,r)&&l(t,r,e[r]);return t};const d=[{languageOptions:{globals:s(s({},n.node),n.browser)},rules:{"perfectionist/sort-imports":["error",{internalPattern:["^#.*","^@/.*"]}],"dot-notation":"off"},ignores:["**/node_modules/**","**/.git/**","build","dist",".agent"]}];exports.default=d;
@@ -373,6 +373,7 @@ declare const _default: {
373
373
  HTMLFormElement: false;
374
374
  HTMLFrameElement: false;
375
375
  HTMLFrameSetElement: false;
376
+ HTMLGeolocationElement: false;
376
377
  HTMLHeadElement: false;
377
378
  HTMLHeadingElement: false;
378
379
  HTMLHRElement: false;
@@ -1165,6 +1166,7 @@ declare const _default: {
1165
1166
  XRView: false;
1166
1167
  XRViewerPose: false;
1167
1168
  XRViewport: false;
1169
+ XRVisibilityMaskChangeEvent: false;
1168
1170
  XRWebGLBinding: false;
1169
1171
  XRWebGLDepthInformation: false;
1170
1172
  XRWebGLLayer: false;
@@ -18,7 +18,7 @@ const f = [
18
18
  }],
19
19
  "dot-notation": "off"
20
20
  },
21
- ignores: ["**/node_modules/**", "**/.git/**", "build", "dist"]
21
+ ignores: ["**/node_modules/**", "**/.git/**", "build", "dist", ".agent"]
22
22
  }
23
23
  ];
24
24
  export {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@vitejs/plugin-react-swc"),i=require("../../node_modules/.pnpm/vitest@4.0.16_@types_node@25.0.3_jiti@2.6.1_jsdom@27.4.0_sass@1.97.2_tsx@4.21.0_yaml@2.8.2/node_modules/vitest/dist/config.cjs"),o=require("../../util/object/object.util.cjs");function n(e){const r={plugins:[t()],test:{include:["**/*.test.e2e.?(c|m)[jt]s?(x)"],browser:{enabled:!0,provider:"playwright",instances:[{browser:"chromium"},{browser:"firefox"},{browser:"webkit"}]}}};return i.defineConfig(o.deepMerge(r,e))}exports.vitestE2E=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@vitejs/plugin-react-swc"),i=require("../../node_modules/.pnpm/vitest@4.0.18_@types_node@25.3.0_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"),o=require("../../util/object/object.util.cjs");function n(e){const r={plugins:[t()],test:{include:["**/*.test.e2e.?(c|m)[jt]s?(x)"],browser:{enabled:!0,provider:"playwright",instances:[{browser:"chromium"},{browser:"firefox"},{browser:"webkit"}]}}};return i.defineConfig(o.deepMerge(r,e))}exports.vitestE2E=n;
@@ -1,5 +1,5 @@
1
1
  import t from "@vitejs/plugin-react-swc";
2
- import { defineConfig as o } from "../../node_modules/.pnpm/vitest@4.0.16_@types_node@25.0.3_jiti@2.6.1_jsdom@27.4.0_sass@1.97.2_tsx@4.21.0_yaml@2.8.2/node_modules/vitest/dist/config.js";
2
+ import { defineConfig as o } from "../../node_modules/.pnpm/vitest@4.0.18_@types_node@25.3.0_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";
3
3
  import { deepMerge as i } from "../../util/object/object.util.js";
4
4
  function m(e) {
5
5
  const r = {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("@vitejs/plugin-react-swc"),n=require("../../node_modules/.pnpm/vitest@4.0.16_@types_node@25.0.3_jiti@2.6.1_jsdom@27.4.0_sass@1.97.2_tsx@4.21.0_yaml@2.8.2/node_modules/vitest/dist/config.cjs"),s=require("../../util/object/object.util.cjs");function r(e){const t={plugins:[i()],test:{globals:!0,environment:"jsdom",pool:"vmThreads",include:["**/*.test.unit.?(c|m)[jt]s?(x)"],setupFiles:["./vitest.unit.setup.ts"]}};return n.defineConfig(s.deepMerge(t,e))}exports.vitestUnit=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("@vitejs/plugin-react-swc"),n=require("../../node_modules/.pnpm/vitest@4.0.18_@types_node@25.3.0_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"),s=require("../../util/object/object.util.cjs");function r(e){const t={plugins:[i()],test:{globals:!0,environment:"jsdom",pool:"vmThreads",include:["**/*.test.unit.?(c|m)[jt]s?(x)"],setupFiles:["./vitest.unit.setup.ts"]}};return n.defineConfig(s.deepMerge(t,e))}exports.vitestUnit=r;
@@ -1,5 +1,5 @@
1
1
  import i from "@vitejs/plugin-react-swc";
2
- import { defineConfig as o } from "../../node_modules/.pnpm/vitest@4.0.16_@types_node@25.0.3_jiti@2.6.1_jsdom@27.4.0_sass@1.97.2_tsx@4.21.0_yaml@2.8.2/node_modules/vitest/dist/config.js";
2
+ import { defineConfig as o } from "../../node_modules/.pnpm/vitest@4.0.18_@types_node@25.3.0_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";
3
3
  import { deepMerge as n } from "../../util/object/object.util.js";
4
4
  function p(t) {
5
5
  const e = {
@@ -1,6 +1,3 @@
1
1
  #!/usr/bin/env node
2
- "use strict";const u=require("node:process"),I=require("yargs/helpers"),T=require("yargs/yargs"),i=require("../command/command.util.cjs"),y=require("../package/package.util.cjs"),a=require("../fs/fs.util.cjs"),v=require("../path/path.util.cjs"),n=require("../path/path.constant.cjs"),c=require("../log/log.util.cjs"),f=require("../log/log.type.cjs");var t=(e,o,r)=>new Promise((l,p)=>{var k=s=>{try{m(r.next(s))}catch(g){p(g)}},_=s=>{try{m(r.throw(s))}catch(g){p(g)}},m=s=>s.done?l(s.value):Promise.resolve(s.value).then(k,_);m((r=r.apply(e,o)).next())});function L(){try{return JSON.parse(a.readFileSync(v.resolve(__dirname,"../../../package.json"),"utf-8")).version}catch(e){return"1.0.0"}}function E(){return t(this,null,function*(){a.pathExistsSync(n.PATH.TS_CONFIG)?yield i.runCommand("Performing TypeScript validation",yield n.command.typescriptCheck()):c.log.warn("No TypeScript configuration found. Skipping type check.")})}function S(e=!1){return t(this,null,function*(){const o=e?yield n.command.eslintFix():yield n.command.eslintCheck(),r=e?"Running ESLint with auto-fix":"Running ESLint check";try{yield i.runCommand(r,o,{timeout:6e4,throwOnError:!0})}catch(l){l.code==="ETIMEDOUT"||l.killed||l.signal==="SIGTERM"?(c.log.warn("Lint check timed out. Retrying with debug mode enabled..."),u.env.DEBUG="true",yield i.runCommand(`${r} (Debug Mode)`,o)):c.catchError(l)}})}function h(e,o){if(!o.length)return;const r=e==="Errors"?"red":"yellow";c.log.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",o,r)}function d(){return t(this,null,function*(){setTimeout(()=>t(null,null,function*(){const e=(yield i.getStoredErrorLists())||[],o=e.filter(l=>l.type===f.E_IssueType.Error),r=e.filter(l=>l.type===f.E_IssueType.Warning);!o.length&&!r.length?c.log.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(h("Warnings",r),h("Errors",o),o.length>0&&u.exit(1))}),0)})}function M(){return t(this,null,function*(){yield i.clearAllErrorLists();const e=yield y.getPackage({name:n.CYBERSKILL_PACKAGE_NAME});if(!e.success){c.log.error("Failed to retrieve package information. Aborting lint-staged.");return}e.result.isCurrentProject&&(yield i.runCommand(`Building package: ${n.CYBERSKILL_PACKAGE_NAME}`,yield n.command.build())),yield i.runCommand("Executing lint-staged",yield n.command.lintStaged()),d()})}function O(){return t(this,null,function*(){yield i.runCommand("Inspecting ESLint configuration",yield n.command.eslintInspect())})}function P(){return t(this,null,function*(){yield i.clearAllErrorLists(),yield E(),yield S(),d()})}function A(){return t(this,null,function*(){yield i.clearAllErrorLists(),yield E(),yield S(!0),d()})}function R(){return t(this,null,function*(){yield i.clearAllErrorLists(),yield i.runCommand("Validating commit message",yield n.command.commitLint()),d()})}function C(){return t(this,null,function*(){yield i.runCommand("Configuring Git hooks",yield n.command.configureGitHook()),a.removeSync(n.PATH.GIT_HOOK);const e=yield i.resolveCommands(n.createGitHooksConfig);a.writeFileSync(n.PATH.SIMPLE_GIT_HOOKS_JSON,JSON.stringify(e,null,4));const o=`
3
- ${n.SIMPLE_GIT_HOOK_JSON}
4
- `;a.pathExistsSync(n.PATH.GIT_IGNORE)?a.readFileSync(n.PATH.GIT_IGNORE,"utf-8").split(`
5
- `).includes(n.SIMPLE_GIT_HOOK_JSON)||a.appendFileSync(n.PATH.GIT_IGNORE,o):a.writeFileSync(n.PATH.GIT_IGNORE,o),yield i.runCommand("Setting up simple-git-hooks",yield n.command.simpleGitHooks())})}function G(){return t(this,null,function*(){yield y.installDependencies(),yield C()})}function b(){return t(this,null,function*(){a.removeSync(n.PATH.NODE_MODULES,n.PATH.PNPM_LOCK_YAML),yield i.runCommand("Pruning pnpm store",yield n.command.pnpmPruneStore()),yield i.runCommand("Clearing pnpm cache",yield n.command.pnpmCleanCache()),yield y.installDependencies(),yield C()})}function D(){return t(this,null,function*(){yield i.runCommand("Inspecting project dependencies",yield n.command.nodeModulesInspect())})}function B(){return t(this,null,function*(){yield i.runCommand("Running unit tests",yield n.command.testUnit())})}function N(){return t(this,null,function*(){yield i.runCommand("Running end-to-end tests",yield n.command.testE2e())})}function w(e){return t(this,null,function*(){yield i.runCommand("Creating MongoDB migration",yield n.command.mongoMigrateCreate(e))})}function H(){return t(this,null,function*(){yield i.runCommand("Running MongoDB migrations",yield n.command.mongoMigrateUp())})}function q(){return t(this,null,function*(){yield i.runCommand("Rolling back MongoDB migration",yield n.command.mongoMigrateDown())})}function x(){return t(this,null,function*(){yield i.runCommand("Starting Storybook development server",yield n.command.storybookDev())})}function F(){return t(this,null,function*(){yield i.runCommand("Building Storybook",yield n.command.storybookBuild())})}t(null,null,function*(){try{yield T(I.hideBin(u.argv)).scriptName(n.CYBERSKILL_CLI).usage("$0 <command> [options]").command("lint","Check code for linting issues",P).command("lint:fix","Fix linting issues automatically",A).command("lint:inspect","View active ESLint configuration",O).command("lint-staged","Run lint checks on staged files",M).command("commitlint","Validate commit message format",R).command("ready","Initialize project and dependencies",G).command("reset","Reset the project and reinstall dependencies",b).command("inspect","Analyze installed project dependencies",D).command("test:unit","Run unit test suite",B).command("test:e2e","Run end-to-end test suite",N).command("mongo:migrate:create <name>","Create a MongoDB migration",e=>e.positional("name",{describe:"Migration name",type:"string"}),e=>t(null,null,function*(){if(!e.name){c.log.error("Migration name is required.");return}yield w(e.name)})).command("mongo:migrate:up","Apply all MongoDB migrations",H).command("mongo:migrate:down","Rollback last MongoDB migration",q).command("storybook:dev","Start Storybook development server",x).command("storybook:build","Build Storybook for production",F).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(L()).epilog(`💡 Tip: Use "--help" with any command to see options
6
- `).parse()}catch(e){c.catchError(e),u.exit(1)}});
2
+ "use strict";const d=require("node:process"),I=require("yargs/helpers"),T=require("yargs/yargs"),e=require("../command/command.util.cjs"),y=require("../package/package.util.cjs"),a=require("../fs/fs.util.cjs"),v=require("../path/path.util.cjs"),n=require("../path/path.constant.cjs"),u=require("../log/log.util.cjs"),f=require("../log/log.type.cjs");var t=(i,r,o)=>new Promise((l,p)=>{var A=c=>{try{m(o.next(c))}catch(g){p(g)}},S=c=>{try{m(o.throw(c))}catch(g){p(g)}},m=c=>c.done?l(c.value):Promise.resolve(c.value).then(A,S);m((o=o.apply(i,r)).next())});function M(){try{return JSON.parse(a.readFileSync(v.resolve(__dirname,"../../../package.json"),"utf-8")).version}catch(i){return"1.0.0"}}function E(){return t(this,null,function*(){a.pathExistsSync(n.PATH.TS_CONFIG)?yield e.runCommand("Performing TypeScript validation",yield n.command.typescriptCheck()):u.log.warn("No TypeScript configuration found. Skipping type check.")})}function C(i=!1){return t(this,null,function*(){const r=i?yield n.command.eslintFix():yield n.command.eslintCheck(),o=i?"Running ESLint with auto-fix":"Running ESLint check";try{yield e.runCommand(o,r,{timeout:6e4,throwOnError:!0})}catch(l){l.code==="ETIMEDOUT"||l.killed||l.signal==="SIGTERM"?(u.log.warn("Lint check timed out. Retrying with debug mode enabled..."),d.env.DEBUG="true",yield e.runCommand(`${o} (Debug Mode)`,r)):u.catchError(l)}})}function h(i,r){if(!r.length)return;const o=i==="Errors"?"red":"yellow";u.log.printBoxedLog(i==="Errors"?"✖ Errors":"⚠ Warnings",r,o)}function s(){return t(this,null,function*(){setTimeout(()=>t(null,null,function*(){const i=(yield e.getStoredErrorLists())||[],r=i.filter(l=>l.type===f.E_IssueType.Error),o=i.filter(l=>l.type===f.E_IssueType.Warning);!r.length&&!o.length?u.log.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(h("Warnings",o),h("Errors",r),r.length>0&&d.exit(1))}),0)})}function G(){return t(this,null,function*(){yield e.clearAllErrorLists();const i=yield y.getPackage({name:n.CYBERSKILL_PACKAGE_NAME});if(!i.success){u.log.error("Failed to retrieve package information. Aborting lint-staged.");return}i.result.isCurrentProject&&(yield e.runCommand(`Building package: ${n.CYBERSKILL_PACKAGE_NAME}`,yield n.command.build())),yield e.runCommand("Executing lint-staged",yield n.command.lintStaged()),s()})}function L(){return t(this,null,function*(){yield e.runCommand("Inspecting ESLint configuration",yield n.command.eslintInspect())})}function P(){return t(this,null,function*(){yield e.clearAllErrorLists(),yield E(),yield C(),s()})}function b(){return t(this,null,function*(){yield e.clearAllErrorLists(),yield E(),yield C(!0),s()})}function O(){return t(this,null,function*(){yield e.clearAllErrorLists(),yield e.runCommand("Validating commit message",yield n.command.commitLint()),s()})}function _(){return t(this,null,function*(){yield e.runCommand("Configuring Git hooks",yield n.command.configureGitHook()),a.removeSync(n.PATH.GIT_HOOK);const i=yield e.resolveCommands(n.createGitHooksConfig);a.writeFileSync(n.PATH.SIMPLE_GIT_HOOKS_JSON,JSON.stringify(i,null,4)),a.addGitIgnoreEntry(n.PATH.GIT_IGNORE,n.SIMPLE_GIT_HOOK_JSON),yield e.runCommand("Setting up simple-git-hooks",yield n.command.simpleGitHooks())})}function k(){return t(this,null,function*(){try{yield e.runCommand(`Checking for ${n.AG_KIT_PACKAGE_NAME}`,`pnpm list -g ${n.AG_KIT_PACKAGE_NAME}`)}catch(i){yield e.runCommand(`Installing ${n.AG_KIT_PACKAGE_NAME} globally`,`pnpm i -g ${n.AG_KIT_PACKAGE_NAME}`)}a.pathExistsSync(n.PATH.DOT_AGENT)?yield e.runCommand("Updating AI agent","ag-kit update -y"):yield e.runCommand("Initializing AI agent","ag-kit init"),a.addGitIgnoreEntry(n.PATH.GIT_IGNORE,n.DOT_AGENT)})}function D(){return t(this,null,function*(){yield y.installDependencies(),yield _()})}function N(){return t(this,null,function*(){a.removeSync(n.PATH.NODE_MODULES,n.PATH.PNPM_LOCK_YAML),yield e.runCommand("Pruning pnpm store",yield n.command.pnpmPruneStore()),yield e.runCommand("Clearing pnpm cache",yield n.command.pnpmCleanCache()),yield y.installDependencies(),yield _(),yield k()})}function R(){return t(this,null,function*(){yield e.runCommand("Inspecting project dependencies",yield n.command.nodeModulesInspect())})}function B(){return t(this,null,function*(){yield e.runCommand("Running unit tests",yield n.command.testUnit())})}function K(){return t(this,null,function*(){yield e.runCommand("Running end-to-end tests",yield n.command.testE2e())})}function w(i){return t(this,null,function*(){yield e.runCommand("Creating MongoDB migration",yield n.command.mongoMigrateCreate(i))})}function H(){return t(this,null,function*(){yield e.runCommand("Running MongoDB migrations",yield n.command.mongoMigrateUp())})}function q(){return t(this,null,function*(){yield e.runCommand("Rolling back MongoDB migration",yield n.command.mongoMigrateDown())})}function x(){return t(this,null,function*(){yield e.runCommand("Starting Storybook development server",yield n.command.storybookDev())})}function U(){return t(this,null,function*(){yield e.runCommand("Building Storybook",yield n.command.storybookBuild())})}t(null,null,function*(){try{yield T(I.hideBin(d.argv)).scriptName(n.CYBERSKILL_CLI).usage("$0 <command> [options]").command("ai:setup","Setup AI agent environment",k).command("lint","Check code for linting issues",P).command("lint:fix","Fix linting issues automatically",b).command("lint:inspect","View active ESLint configuration",L).command("lint-staged","Run lint checks on staged files",G).command("commitlint","Validate commit message format",O).command("ready","Initialize project and dependencies",D).command("reset","Reset the project and reinstall dependencies",N).command("inspect","Analyze installed project dependencies",R).command("test:unit","Run unit test suite",B).command("test:e2e","Run end-to-end test suite",K).command("mongo:migrate:create <name>","Create a MongoDB migration",i=>i.positional("name",{describe:"Migration name",type:"string"}),i=>t(null,null,function*(){if(!i.name){u.log.error("Migration name is required.");return}yield w(i.name)})).command("mongo:migrate:up","Apply all MongoDB migrations",H).command("mongo:migrate:down","Rollback last MongoDB migration",q).command("storybook:dev","Start Storybook development server",x).command("storybook:build","Build Storybook for production",U).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(M()).epilog(`💡 Tip: Use "--help" with any command to see options
3
+ `).parse()}catch(i){u.catchError(i),d.exit(1)}});
@@ -1,175 +1,180 @@
1
1
  #!/usr/bin/env node
2
- import a from "node:process";
3
- import { hideBin as T } from "yargs/helpers";
4
- import D from "yargs/yargs";
5
- import { clearAllErrorLists as d, runCommand as i, getStoredErrorLists as B, resolveCommands as w } from "../command/command.util.js";
6
- import { getPackage as N, installDependencies as I } from "../package/package.util.js";
7
- import { removeSync as v, readFileSync as C, pathExistsSync as M, writeFileSync as f, appendFileSync as P } from "../fs/fs.util.js";
8
- import { resolve as x } from "../path/path.util.js";
9
- import { CYBERSKILL_CLI as U, command as t, CYBERSKILL_PACKAGE_NAME as h, PATH as s, SIMPLE_GIT_HOOK_JSON as k, createGitHooksConfig as A } from "../path/path.constant.js";
10
- import { log as u, catchError as _ } from "../log/log.util.js";
11
- import { E_IssueType as E } from "../log/log.type.js";
12
- var e = (n, o, r) => new Promise((l, p) => {
13
- var b = (c) => {
2
+ import d from "node:process";
3
+ import { hideBin as G } from "yargs/helpers";
4
+ import R from "yargs/yargs";
5
+ import { runCommand as e, clearAllErrorLists as m, getStoredErrorLists as A, resolveCommands as B } from "../command/command.util.js";
6
+ import { getPackage as N, installDependencies as S } from "../package/package.util.js";
7
+ import { pathExistsSync as I, addGitIgnoreEntry as v, removeSync as C, readFileSync as w, writeFileSync as P } from "../fs/fs.util.js";
8
+ import { resolve as U } from "../path/path.util.js";
9
+ import { CYBERSKILL_CLI as x, command as t, CYBERSKILL_PACKAGE_NAME as h, PATH as s, SIMPLE_GIT_HOOK_JSON as K, createGitHooksConfig as F, AG_KIT_PACKAGE_NAME as u, DOT_AGENT as H } from "../path/path.constant.js";
10
+ import { log as a, catchError as _ } from "../log/log.util.js";
11
+ import { E_IssueType as k } from "../log/log.type.js";
12
+ var i = (n, r, o) => new Promise((l, f) => {
13
+ var T = (c) => {
14
14
  try {
15
- g(r.next(c));
16
- } catch (y) {
17
- p(y);
15
+ y(o.next(c));
16
+ } catch (p) {
17
+ f(p);
18
18
  }
19
- }, G = (c) => {
19
+ }, D = (c) => {
20
20
  try {
21
- g(r.throw(c));
22
- } catch (y) {
23
- p(y);
21
+ y(o.throw(c));
22
+ } catch (p) {
23
+ f(p);
24
24
  }
25
- }, g = (c) => c.done ? l(c.value) : Promise.resolve(c.value).then(b, G);
26
- g((r = r.apply(n, o)).next());
25
+ }, y = (c) => c.done ? l(c.value) : Promise.resolve(c.value).then(T, D);
26
+ y((o = o.apply(n, r)).next());
27
27
  });
28
- function F() {
28
+ function $() {
29
29
  try {
30
30
  return JSON.parse(
31
- C(x(__dirname, "../../../package.json"), "utf-8")
31
+ w(U(__dirname, "../../../package.json"), "utf-8")
32
32
  ).version;
33
33
  } catch (n) {
34
34
  return "1.0.0";
35
35
  }
36
36
  }
37
- function L() {
38
- return e(this, null, function* () {
39
- M(s.TS_CONFIG) ? yield i("Performing TypeScript validation", yield t.typescriptCheck()) : u.warn("No TypeScript configuration found. Skipping type check.");
37
+ function M() {
38
+ return i(this, null, function* () {
39
+ I(s.TS_CONFIG) ? yield e("Performing TypeScript validation", yield t.typescriptCheck()) : a.warn("No TypeScript configuration found. Skipping type check.");
40
40
  });
41
41
  }
42
- function O(n = !1) {
43
- return e(this, null, function* () {
44
- const o = n ? yield t.eslintFix() : yield t.eslintCheck(), r = n ? "Running ESLint with auto-fix" : "Running ESLint check";
42
+ function b(n = !1) {
43
+ return i(this, null, function* () {
44
+ const r = n ? yield t.eslintFix() : yield t.eslintCheck(), o = n ? "Running ESLint with auto-fix" : "Running ESLint check";
45
45
  try {
46
- yield i(r, o, { timeout: 6e4, throwOnError: !0 });
46
+ yield e(o, r, { timeout: 6e4, throwOnError: !0 });
47
47
  } catch (l) {
48
- l.code === "ETIMEDOUT" || l.killed || l.signal === "SIGTERM" ? (u.warn("Lint check timed out. Retrying with debug mode enabled..."), a.env.DEBUG = "true", yield i(`${r} (Debug Mode)`, o)) : _(l);
48
+ l.code === "ETIMEDOUT" || l.killed || l.signal === "SIGTERM" ? (a.warn("Lint check timed out. Retrying with debug mode enabled..."), d.env.DEBUG = "true", yield e(`${o} (Debug Mode)`, r)) : _(l);
49
49
  }
50
50
  });
51
51
  }
52
- function S(n, o) {
53
- if (!o.length)
52
+ function E(n, r) {
53
+ if (!r.length)
54
54
  return;
55
- const r = n === "Errors" ? "red" : "yellow";
56
- u.printBoxedLog(n === "Errors" ? "✖ Errors" : "⚠ Warnings", o, r);
57
- }
58
- function m() {
59
- return e(this, null, function* () {
60
- setTimeout(() => e(null, null, function* () {
61
- const n = (yield B()) || [], o = n.filter((l) => l.type === E.Error), r = n.filter((l) => l.type === E.Warning);
62
- !o.length && !r.length ? u.printBoxedLog("✔ NO ISSUES FOUND", [], "green") : (S("Warnings", r), S("Errors", o), o.length > 0 && a.exit(1));
55
+ const o = n === "Errors" ? "red" : "yellow";
56
+ a.printBoxedLog(n === "Errors" ? "✖ Errors" : "⚠ Warnings", r, o);
57
+ }
58
+ function g() {
59
+ return i(this, null, function* () {
60
+ setTimeout(() => i(null, null, function* () {
61
+ const n = (yield A()) || [], r = n.filter((l) => l.type === k.Error), o = n.filter((l) => l.type === k.Warning);
62
+ !r.length && !o.length ? a.printBoxedLog("✔ NO ISSUES FOUND", [], "green") : (E("Warnings", o), E("Errors", r), r.length > 0 && d.exit(1));
63
63
  }), 0);
64
64
  });
65
65
  }
66
- function H() {
67
- return e(this, null, function* () {
68
- yield d();
66
+ function j() {
67
+ return i(this, null, function* () {
68
+ yield m();
69
69
  const n = yield N({ name: h });
70
70
  if (!n.success) {
71
- u.error("Failed to retrieve package information. Aborting lint-staged.");
71
+ a.error("Failed to retrieve package information. Aborting lint-staged.");
72
72
  return;
73
73
  }
74
- n.result.isCurrentProject && (yield i(`Building package: ${h}`, yield t.build())), yield i("Executing lint-staged", yield t.lintStaged()), m();
75
- });
76
- }
77
- function K() {
78
- return e(this, null, function* () {
79
- yield i("Inspecting ESLint configuration", yield t.eslintInspect());
80
- });
81
- }
82
- function j() {
83
- return e(this, null, function* () {
84
- yield d(), yield L(), yield O(), m();
74
+ n.result.isCurrentProject && (yield e(`Building package: ${h}`, yield t.build())), yield e("Executing lint-staged", yield t.lintStaged()), g();
85
75
  });
86
76
  }
87
77
  function J() {
88
- return e(this, null, function* () {
89
- yield d(), yield L(), yield O(!0), m();
78
+ return i(this, null, function* () {
79
+ yield e("Inspecting ESLint configuration", yield t.eslintInspect());
90
80
  });
91
81
  }
92
82
  function V() {
93
- return e(this, null, function* () {
94
- yield d(), yield i("Validating commit message", yield t.commitLint()), m();
83
+ return i(this, null, function* () {
84
+ yield m(), yield M(), yield b(), g();
95
85
  });
96
86
  }
97
- function R() {
98
- return e(this, null, function* () {
99
- yield i("Configuring Git hooks", yield t.configureGitHook()), v(s.GIT_HOOK);
100
- const n = yield w(A);
101
- f(s.SIMPLE_GIT_HOOKS_JSON, JSON.stringify(n, null, 4));
102
- const o = `
103
- ${k}
104
- `;
105
- M(s.GIT_IGNORE) ? C(s.GIT_IGNORE, "utf-8").split(`
106
- `).includes(k) || P(s.GIT_IGNORE, o) : f(s.GIT_IGNORE, o), yield i("Setting up simple-git-hooks", yield t.simpleGitHooks());
87
+ function z() {
88
+ return i(this, null, function* () {
89
+ yield m(), yield M(), yield b(!0), g();
107
90
  });
108
91
  }
109
- function $() {
110
- return e(this, null, function* () {
111
- yield I(), yield R();
92
+ function W() {
93
+ return i(this, null, function* () {
94
+ yield m(), yield e("Validating commit message", yield t.commitLint()), g();
112
95
  });
113
96
  }
114
- function W() {
115
- return e(this, null, function* () {
116
- v(s.NODE_MODULES, s.PNPM_LOCK_YAML), yield i("Pruning pnpm store", yield t.pnpmPruneStore()), yield i("Clearing pnpm cache", yield t.pnpmCleanCache()), yield I(), yield R();
97
+ function L() {
98
+ return i(this, null, function* () {
99
+ yield e("Configuring Git hooks", yield t.configureGitHook()), C(s.GIT_HOOK);
100
+ const n = yield B(F);
101
+ P(s.SIMPLE_GIT_HOOKS_JSON, JSON.stringify(n, null, 4)), v(s.GIT_IGNORE, K), yield e("Setting up simple-git-hooks", yield t.simpleGitHooks());
117
102
  });
118
103
  }
119
- function Y() {
120
- return e(this, null, function* () {
121
- yield i("Inspecting project dependencies", yield t.nodeModulesInspect());
104
+ function O() {
105
+ return i(this, null, function* () {
106
+ try {
107
+ yield e(`Checking for ${u}`, `pnpm list -g ${u}`);
108
+ } catch (n) {
109
+ yield e(`Installing ${u} globally`, `pnpm i -g ${u}`);
110
+ }
111
+ I(s.DOT_AGENT) ? yield e("Updating AI agent", "ag-kit update -y") : yield e("Initializing AI agent", "ag-kit init"), v(s.GIT_IGNORE, H);
122
112
  });
123
113
  }
124
- function z() {
125
- return e(this, null, function* () {
126
- yield i("Running unit tests", yield t.testUnit());
114
+ function Y() {
115
+ return i(this, null, function* () {
116
+ yield S(), yield L();
127
117
  });
128
118
  }
129
119
  function q() {
130
- return e(this, null, function* () {
131
- yield i("Running end-to-end tests", yield t.testE2e());
120
+ return i(this, null, function* () {
121
+ C(s.NODE_MODULES, s.PNPM_LOCK_YAML), yield e("Pruning pnpm store", yield t.pnpmPruneStore()), yield e("Clearing pnpm cache", yield t.pnpmCleanCache()), yield S(), yield L(), yield O();
132
122
  });
133
123
  }
134
- function Q(n) {
135
- return e(this, null, function* () {
136
- yield i("Creating MongoDB migration", yield t.mongoMigrateCreate(n));
124
+ function Q() {
125
+ return i(this, null, function* () {
126
+ yield e("Inspecting project dependencies", yield t.nodeModulesInspect());
137
127
  });
138
128
  }
139
129
  function X() {
140
- return e(this, null, function* () {
141
- yield i("Running MongoDB migrations", yield t.mongoMigrateUp());
130
+ return i(this, null, function* () {
131
+ yield e("Running unit tests", yield t.testUnit());
142
132
  });
143
133
  }
144
134
  function Z() {
145
- return e(this, null, function* () {
146
- yield i("Rolling back MongoDB migration", yield t.mongoMigrateDown());
135
+ return i(this, null, function* () {
136
+ yield e("Running end-to-end tests", yield t.testE2e());
147
137
  });
148
138
  }
149
- function nn() {
150
- return e(this, null, function* () {
151
- yield i("Starting Storybook development server", yield t.storybookDev());
139
+ function nn(n) {
140
+ return i(this, null, function* () {
141
+ yield e("Creating MongoDB migration", yield t.mongoMigrateCreate(n));
152
142
  });
153
143
  }
154
144
  function en() {
155
- return e(this, null, function* () {
156
- yield i("Building Storybook", yield t.storybookBuild());
145
+ return i(this, null, function* () {
146
+ yield e("Running MongoDB migrations", yield t.mongoMigrateUp());
147
+ });
148
+ }
149
+ function tn() {
150
+ return i(this, null, function* () {
151
+ yield e("Rolling back MongoDB migration", yield t.mongoMigrateDown());
152
+ });
153
+ }
154
+ function on() {
155
+ return i(this, null, function* () {
156
+ yield e("Starting Storybook development server", yield t.storybookDev());
157
+ });
158
+ }
159
+ function rn() {
160
+ return i(this, null, function* () {
161
+ yield e("Building Storybook", yield t.storybookBuild());
157
162
  });
158
163
  }
159
- e(null, null, function* () {
164
+ i(null, null, function* () {
160
165
  try {
161
- yield D(T(a.argv)).scriptName(U).usage("$0 <command> [options]").command("lint", "Check code for linting issues", j).command("lint:fix", "Fix linting issues automatically", J).command("lint:inspect", "View active ESLint configuration", K).command("lint-staged", "Run lint checks on staged files", H).command("commitlint", "Validate commit message format", V).command("ready", "Initialize project and dependencies", $).command("reset", "Reset the project and reinstall dependencies", W).command("inspect", "Analyze installed project dependencies", Y).command("test:unit", "Run unit test suite", z).command("test:e2e", "Run end-to-end test suite", q).command("mongo:migrate:create <name>", "Create a MongoDB migration", (n) => n.positional("name", {
166
+ yield R(G(d.argv)).scriptName(x).usage("$0 <command> [options]").command("ai:setup", "Setup AI agent environment", O).command("lint", "Check code for linting issues", V).command("lint:fix", "Fix linting issues automatically", z).command("lint:inspect", "View active ESLint configuration", J).command("lint-staged", "Run lint checks on staged files", j).command("commitlint", "Validate commit message format", W).command("ready", "Initialize project and dependencies", Y).command("reset", "Reset the project and reinstall dependencies", q).command("inspect", "Analyze installed project dependencies", Q).command("test:unit", "Run unit test suite", X).command("test:e2e", "Run end-to-end test suite", Z).command("mongo:migrate:create <name>", "Create a MongoDB migration", (n) => n.positional("name", {
162
167
  describe: "Migration name",
163
168
  type: "string"
164
- }), (n) => e(null, null, function* () {
169
+ }), (n) => i(null, null, function* () {
165
170
  if (!n.name) {
166
- u.error("Migration name is required.");
171
+ a.error("Migration name is required.");
167
172
  return;
168
173
  }
169
- yield Q(n.name);
170
- })).command("mongo:migrate:up", "Apply all MongoDB migrations", X).command("mongo:migrate:down", "Rollback last MongoDB migration", Z).command("storybook:dev", "Start Storybook development server", nn).command("storybook:build", "Build Storybook for production", en).demandCommand(1, "Please specify a valid command.").strict().help().alias("h", "help").alias("v", "version").version(F()).epilog(`💡 Tip: Use "--help" with any command to see options
174
+ yield nn(n.name);
175
+ })).command("mongo:migrate:up", "Apply all MongoDB migrations", en).command("mongo:migrate:down", "Rollback last MongoDB migration", tn).command("storybook:dev", "Start Storybook development server", on).command("storybook:build", "Build Storybook for production", rn).demandCommand(1, "Please specify a valid command.").strict().help().alias("h", "help").alias("v", "version").version($()).epilog(`💡 Tip: Use "--help" with any command to see options
171
176
  `).parse();
172
177
  } catch (n) {
173
- _(n), a.exit(1);
178
+ _(n), d.exit(1);
174
179
  }
175
180
  });
@@ -5,7 +5,7 @@ import { storage as y } from "../storage/storage.util.js";
5
5
  import { getPackage as B } from "../package/package.util.js";
6
6
  import { CYBERSKILL_PACKAGE_NAME as M, PNPM_EXEC_CLI as T, TSX_CLI as O, CYBERSKILL_CLI_PATH as R, CYBERSKILL_CLI as b } from "../path/path.constant.js";
7
7
  import { E_IssueType as f } from "../log/log.type.js";
8
- import { catchError as E, log as h } from "../log/log.util.js";
8
+ import { log as h, catchError as E } from "../log/log.util.js";
9
9
  import { getEnv as N } from "../../config/env/env.util.js";
10
10
  var a = (r, t, e) => new Promise((s, i) => {
11
11
  var o = (u) => {
@@ -1 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("fs-extra"),d=require("node:path");var p=Object.defineProperty,c=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable,l=(e,n,r)=>n in e?p(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,v=(e,n)=>{for(var r in n||(n={}))o.call(n,r)&&l(e,r,n[r]);if(c)for(var r of c(n))S.call(n,r)&&l(e,r,n[r]);return e},m=(e,n)=>{var r={};for(var t in e)o.call(e,t)&&n.indexOf(t)<0&&(r[t]=e[t]);if(e!=null&&c)for(var t of c(e))n.indexOf(t)<0&&S.call(e,t)&&(r[t]=e[t]);return r};const _=i,{lstatSync:O,readdirSync:w,mkdirSync:x,readFileSync:F,unlinkSync:g,statSync:f,createWriteStream:E}=i,h=i.readJsonSync;function P(e,n,r){i.writeFileSync(e,n,r!=null?r:"utf-8")}function b(e,n,r){i.appendFileSync(e,n,r!=null?r:"utf-8")}function s(...e){return e.every(n=>i.pathExistsSync(n))}function j(...e){e.forEach(n=>{s(n)&&i.removeSync(n)})}function J(e,n,r={}){const t=r,{extensions:a}=t,u=m(t,["extensions"]);i.copySync(e,n,v({filter:y=>f(y).isDirectory()||!a||a.length===0?!0:a.includes(d.extname(y))},u))}exports.appendFileSync=b;exports.copySync=J;exports.createWriteStream=E;exports.fs=_;exports.lstatSync=O;exports.mkdirSync=x;exports.pathExistsSync=s;exports.readFileSync=F;exports.readJsonSync=h;exports.readdirSync=w;exports.removeSync=j;exports.statSync=f;exports.unlinkSync=g;exports.writeFileSync=P;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("fs-extra"),m=require("node:path");var _=Object.defineProperty,c=Object.getOwnPropertySymbols,f=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable,l=(n,e,r)=>e in n?_(n,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[e]=r,O=(n,e)=>{for(var r in e||(e={}))f.call(e,r)&&l(n,r,e[r]);if(c)for(var r of c(e))S.call(e,r)&&l(n,r,e[r]);return n},g=(n,e)=>{var r={};for(var t in n)f.call(n,t)&&e.indexOf(t)<0&&(r[t]=n[t]);if(n!=null&&c)for(var t of c(n))e.indexOf(t)<0&&S.call(n,t)&&(r[t]=n[t]);return r};const E=i,{lstatSync:w,readdirSync:x,mkdirSync:F,readFileSync:s,unlinkSync:b,statSync:u,createWriteStream:j}=i,h=i.readJsonSync;function d(n,e,r){i.writeFileSync(n,e,r!=null?r:"utf-8")}function p(n,e,r){i.appendFileSync(n,e,r!=null?r:"utf-8")}function y(...n){return n.every(e=>i.pathExistsSync(e))}function J(...n){n.forEach(e=>{y(e)&&i.removeSync(e)})}function P(n,e,r={}){const t=r,{extensions:a}=t,v=g(t,["extensions"]);i.copySync(n,e,O({filter:o=>u(o).isDirectory()||!a||a.length===0?!0:a.includes(m.extname(o))},v))}function k(n,e){const r=`
2
+ ${e}
3
+ `;y(n)?s(n,"utf-8").split(`
4
+ `).includes(e)||p(n,r):d(n,r)}exports.addGitIgnoreEntry=k;exports.appendFileSync=p;exports.copySync=P;exports.createWriteStream=j;exports.fs=E;exports.lstatSync=w;exports.mkdirSync=F;exports.pathExistsSync=y;exports.readFileSync=s;exports.readJsonSync=h;exports.readdirSync=x;exports.removeSync=J;exports.statSync=u;exports.unlinkSync=b;exports.writeFileSync=d;
@@ -55,3 +55,11 @@ export declare function removeSync(...paths: string[]): void;
55
55
  * @param options - Optional copy configuration including extensions filter and other fs-extra options.
56
56
  */
57
57
  export declare function copySync(src: string, dest: string, options?: I_CopySyncOptions): void;
58
+ /**
59
+ * Adds an entry to the .gitignore file if it doesn't already exist.
60
+ * Creates the .gitignore file if it doesn't exist.
61
+ *
62
+ * @param gitIgnorePath - The absolute path to the .gitignore file.
63
+ * @param entry - The entry name to add (e.g. '.agent', '.simple-git-hooks.json').
64
+ */
65
+ export declare function addGitIgnoreEntry(gitIgnorePath: string, entry: string): void;