@cyberskill/shared 2.25.0 → 2.27.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 (52) 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.js +1 -1
  6. package/dist/config/vitest/vitest.e2e.cjs +1 -1
  7. package/dist/config/vitest/vitest.e2e.js +1 -1
  8. package/dist/config/vitest/vitest.unit.cjs +1 -1
  9. package/dist/config/vitest/vitest.unit.js +1 -1
  10. package/dist/node/cli/index.cjs +3 -3
  11. package/dist/node/cli/index.js +106 -96
  12. package/dist/node/command/command.util.js +1 -1
  13. package/dist/node/express/express.type.d.ts +2 -0
  14. package/dist/node/express/express.util.cjs +1 -1
  15. package/dist/node/express/express.util.js +38 -33
  16. package/dist/node/path/index.cjs +1 -1
  17. package/dist/node/path/index.js +53 -51
  18. package/dist/node/path/path.constant.cjs +1 -1
  19. package/dist/node/path/path.constant.d.ts +3 -0
  20. package/dist/node/path/path.constant.js +63 -60
  21. package/dist/react/apollo-client/apollo-client.component.cjs +1 -1
  22. package/dist/react/apollo-client/apollo-client.component.d.ts +1 -1
  23. package/dist/react/apollo-client/apollo-client.component.js +4 -3
  24. package/dist/react/apollo-client/apollo-client.context.cjs +1 -1
  25. package/dist/react/apollo-client/apollo-client.context.d.ts +1 -1
  26. package/dist/react/apollo-client/apollo-client.context.js +9 -8
  27. package/dist/react/apollo-client/apollo-client.util.cjs +1 -1
  28. package/dist/react/apollo-client/apollo-client.util.js +3 -3
  29. package/dist/react/apollo-client-nextjs/apollo-client-nextjs.component.cjs +1 -1
  30. package/dist/react/apollo-client-nextjs/apollo-client-nextjs.component.d.ts +1 -1
  31. package/dist/react/apollo-client-nextjs/apollo-client-nextjs.component.js +9 -8
  32. package/dist/react/apollo-error/apollo-error.component.cjs +1 -1
  33. package/dist/react/apollo-error/apollo-error.component.d.ts +1 -1
  34. package/dist/react/apollo-error/apollo-error.component.js +2 -1
  35. package/dist/react/apollo-error/apollo-error.provider.cjs +1 -1
  36. package/dist/react/apollo-error/apollo-error.provider.d.ts +1 -1
  37. package/dist/react/apollo-error/apollo-error.provider.js +4 -3
  38. package/dist/react/loading/loading.component.cjs +2 -2
  39. package/dist/react/loading/loading.component.d.ts +1 -1
  40. package/dist/react/loading/loading.component.js +7 -6
  41. package/dist/react/loading/loading.provider.cjs +1 -1
  42. package/dist/react/loading/loading.provider.d.ts +1 -1
  43. package/dist/react/loading/loading.provider.js +8 -7
  44. package/dist/react/next-intl/next-intl.hoc.cjs +1 -1
  45. package/dist/react/next-intl/next-intl.hoc.d.ts +2 -1
  46. package/dist/react/next-intl/next-intl.hoc.js +12 -12
  47. package/dist/react/next-intl/next-intl.provider.cjs +1 -1
  48. package/dist/react/next-intl/next-intl.provider.d.ts +1 -1
  49. package/dist/react/next-intl/next-intl.provider.js +5 -4
  50. package/package.json +25 -24
  51. /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.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}/node_modules/vitest/dist/config.cjs +0 -0
  52. /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.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}/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;
@@ -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.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/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.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/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.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/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.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/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,6 @@
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=`
2
+ "use strict";const s=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"),G=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=(i,o,r)=>new Promise((l,p)=>{var A=u=>{try{m(r.next(u))}catch(g){p(g)}},k=u=>{try{m(r.throw(u))}catch(g){p(g)}},m=u=>u.done?l(u.value):Promise.resolve(u.value).then(A,k);m((r=r.apply(i,o)).next())});function M(){try{return JSON.parse(a.readFileSync(G.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()):c.log.warn("No TypeScript configuration found. Skipping type check.")})}function C(i=!1){return t(this,null,function*(){const o=i?yield n.command.eslintFix():yield n.command.eslintCheck(),r=i?"Running ESLint with auto-fix":"Running ESLint check";try{yield e.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..."),s.env.DEBUG="true",yield e.runCommand(`${r} (Debug Mode)`,o)):c.catchError(l)}})}function h(i,o){if(!o.length)return;const r=i==="Errors"?"red":"yellow";c.log.printBoxedLog(i==="Errors"?"✖ Errors":"⚠ Warnings",o,r)}function d(){return t(this,null,function*(){setTimeout(()=>t(null,null,function*(){const i=(yield e.getStoredErrorLists())||[],o=i.filter(l=>l.type===f.E_IssueType.Error),r=i.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&&s.exit(1))}),0)})}function v(){return t(this,null,function*(){yield e.clearAllErrorLists();const i=yield y.getPackage({name:n.CYBERSKILL_PACKAGE_NAME});if(!i.success){c.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()),d()})}function P(){return t(this,null,function*(){yield e.runCommand("Inspecting ESLint configuration",yield n.command.eslintInspect())})}function L(){return t(this,null,function*(){yield e.clearAllErrorLists(),yield E(),yield C(),d()})}function O(){return t(this,null,function*(){yield e.clearAllErrorLists(),yield E(),yield C(!0),d()})}function N(){return t(this,null,function*(){yield e.clearAllErrorLists(),yield e.runCommand("Validating commit message",yield n.command.commitLint()),d()})}function S(){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));const o=`
3
3
  ${n.SIMPLE_GIT_HOOK_JSON}
4
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)}});
5
+ `).includes(n.SIMPLE_GIT_HOOK_JSON)||a.appendFileSync(n.PATH.GIT_IGNORE,o):a.writeFileSync(n.PATH.GIT_IGNORE,o),yield e.runCommand("Setting up simple-git-hooks",yield n.command.simpleGitHooks())})}function R(){return t(this,null,function*(){yield y.installDependencies(),yield S()})}function b(){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 S(),yield _()})}function D(){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 H(){return t(this,null,function*(){yield e.runCommand("Running end-to-end tests",yield n.command.testE2e())})}function K(i){return t(this,null,function*(){yield e.runCommand("Creating MongoDB migration",yield n.command.mongoMigrateCreate(i))})}function w(){return t(this,null,function*(){yield e.runCommand("Running MongoDB migrations",yield n.command.mongoMigrateUp())})}function x(){return t(this,null,function*(){yield e.runCommand("Rolling back MongoDB migration",yield n.command.mongoMigrateDown())})}function q(){return t(this,null,function*(){yield e.runCommand("Starting Storybook development server",yield n.command.storybookDev())})}function F(){return t(this,null,function*(){yield e.runCommand("Building Storybook",yield n.command.storybookBuild())})}function _(){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"):yield e.runCommand("Initializing AI agent","ag-kit init")})}t(null,null,function*(){try{yield T(I.hideBin(s.argv)).scriptName(n.CYBERSKILL_CLI).usage("$0 <command> [options]").command("ai:setup","Setup AI agent environment",_).command("lint","Check code for linting issues",L).command("lint:fix","Fix linting issues automatically",O).command("lint:inspect","View active ESLint configuration",P).command("lint-staged","Run lint checks on staged files",v).command("commitlint","Validate commit message format",N).command("ready","Initialize project and dependencies",R).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",H).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){c.log.error("Migration name is required.");return}yield K(i.name)})).command("mongo:migrate:up","Apply all MongoDB migrations",w).command("mongo:migrate:down","Rollback last MongoDB migration",x).command("storybook:dev","Start Storybook development server",q).command("storybook:build","Build Storybook for production",F).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
6
+ `).parse()}catch(i){c.catchError(i),s.exit(1)}});
@@ -1,175 +1,185 @@
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";
2
+ import d from "node:process";
3
+ import { hideBin as N } from "yargs/helpers";
4
+ import A from "yargs/yargs";
5
+ import { runCommand as e, clearAllErrorLists as m, getStoredErrorLists as B, resolveCommands as w } from "../command/command.util.js";
6
+ import { getPackage as P, installDependencies as _ } from "../package/package.util.js";
7
+ import { pathExistsSync as f, removeSync as C, readFileSync as M, writeFileSync as k, appendFileSync as U } from "../fs/fs.util.js";
8
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) => {
9
+ import { CYBERSKILL_CLI as F, command as t, CYBERSKILL_PACKAGE_NAME as E, PATH as s, SIMPLE_GIT_HOOK_JSON as S, createGitHooksConfig as K, AG_KIT_PACKAGE_NAME as u } from "../path/path.constant.js";
10
+ import { log as a, catchError as O } from "../log/log.util.js";
11
+ import { E_IssueType as I } from "../log/log.type.js";
12
+ var i = (n, o, r) => new Promise((l, h) => {
13
+ var T = (c) => {
14
14
  try {
15
- g(r.next(c));
16
- } catch (y) {
17
- p(y);
15
+ y(r.next(c));
16
+ } catch (p) {
17
+ h(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(r.throw(c));
22
+ } catch (p) {
23
+ h(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((r = r.apply(n, o)).next());
27
27
  });
28
- function F() {
28
+ function H() {
29
29
  try {
30
30
  return JSON.parse(
31
- C(x(__dirname, "../../../package.json"), "utf-8")
31
+ M(x(__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 b() {
38
+ return i(this, null, function* () {
39
+ f(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* () {
42
+ function G(n = !1) {
43
+ return i(this, null, function* () {
44
44
  const o = n ? yield t.eslintFix() : yield t.eslintCheck(), r = n ? "Running ESLint with auto-fix" : "Running ESLint check";
45
45
  try {
46
- yield i(r, o, { timeout: 6e4, throwOnError: !0 });
46
+ yield e(r, o, { 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(`${r} (Debug Mode)`, o)) : O(l);
49
49
  }
50
50
  });
51
51
  }
52
- function S(n, o) {
52
+ function v(n, o) {
53
53
  if (!o.length)
54
54
  return;
55
55
  const r = n === "Errors" ? "red" : "yellow";
56
- u.printBoxedLog(n === "Errors" ? "✖ Errors" : "⚠ Warnings", o, r);
56
+ a.printBoxedLog(n === "Errors" ? "✖ Errors" : "⚠ Warnings", o, r);
57
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));
58
+ function g() {
59
+ return i(this, null, function* () {
60
+ setTimeout(() => i(null, null, function* () {
61
+ const n = (yield B()) || [], o = n.filter((l) => l.type === I.Error), r = n.filter((l) => l.type === I.Warning);
62
+ !o.length && !r.length ? a.printBoxedLog("✔ NO ISSUES FOUND", [], "green") : (v("Warnings", r), v("Errors", o), o.length > 0 && d.exit(1));
63
63
  }), 0);
64
64
  });
65
65
  }
66
- function H() {
67
- return e(this, null, function* () {
68
- yield d();
69
- const n = yield N({ name: h });
66
+ function $() {
67
+ return i(this, null, function* () {
68
+ yield m();
69
+ const n = yield P({ name: E });
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());
74
+ n.result.isCurrentProject && (yield e(`Building package: ${E}`, yield t.build())), yield e("Executing lint-staged", yield t.lintStaged()), g();
80
75
  });
81
76
  }
82
77
  function j() {
83
- return e(this, null, function* () {
84
- yield d(), yield L(), yield O(), m();
78
+ return i(this, null, function* () {
79
+ yield e("Inspecting ESLint configuration", yield t.eslintInspect());
85
80
  });
86
81
  }
87
82
  function J() {
88
- return e(this, null, function* () {
89
- yield d(), yield L(), yield O(!0), m();
83
+ return i(this, null, function* () {
84
+ yield m(), yield b(), yield G(), g();
90
85
  });
91
86
  }
92
87
  function V() {
93
- return e(this, null, function* () {
94
- yield d(), yield i("Validating commit message", yield t.commitLint()), m();
88
+ return i(this, null, function* () {
89
+ yield m(), yield b(), yield G(!0), g();
95
90
  });
96
91
  }
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());
92
+ function z() {
93
+ return i(this, null, function* () {
94
+ yield m(), yield e("Validating commit message", yield t.commitLint()), g();
107
95
  });
108
96
  }
109
- function $() {
110
- return e(this, null, function* () {
111
- 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 w(K);
101
+ k(s.SIMPLE_GIT_HOOKS_JSON, JSON.stringify(n, null, 4));
102
+ const o = `
103
+ ${S}
104
+ `;
105
+ f(s.GIT_IGNORE) ? M(s.GIT_IGNORE, "utf-8").split(`
106
+ `).includes(S) || U(s.GIT_IGNORE, o) : k(s.GIT_IGNORE, o), yield e("Setting up simple-git-hooks", yield t.simpleGitHooks());
112
107
  });
113
108
  }
114
109
  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();
110
+ return i(this, null, function* () {
111
+ yield _(), yield L();
117
112
  });
118
113
  }
119
114
  function Y() {
120
- return e(this, null, function* () {
121
- yield i("Inspecting project dependencies", yield t.nodeModulesInspect());
122
- });
123
- }
124
- function z() {
125
- return e(this, null, function* () {
126
- yield i("Running unit tests", yield t.testUnit());
115
+ return i(this, null, function* () {
116
+ 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 _(), yield L(), yield R();
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
+ yield e("Inspecting project dependencies", yield t.nodeModulesInspect());
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("Running unit tests", yield t.testUnit());
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 end-to-end tests", yield t.testE2e());
142
132
  });
143
133
  }
144
- function Z() {
145
- return e(this, null, function* () {
146
- yield i("Rolling back MongoDB migration", yield t.mongoMigrateDown());
134
+ function Z(n) {
135
+ return i(this, null, function* () {
136
+ yield e("Creating MongoDB migration", yield t.mongoMigrateCreate(n));
147
137
  });
148
138
  }
149
139
  function nn() {
150
- return e(this, null, function* () {
151
- yield i("Starting Storybook development server", yield t.storybookDev());
140
+ return i(this, null, function* () {
141
+ yield e("Running MongoDB migrations", yield t.mongoMigrateUp());
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("Rolling back MongoDB migration", yield t.mongoMigrateDown());
147
+ });
148
+ }
149
+ function tn() {
150
+ return i(this, null, function* () {
151
+ yield e("Starting Storybook development server", yield t.storybookDev());
152
+ });
153
+ }
154
+ function on() {
155
+ return i(this, null, function* () {
156
+ yield e("Building Storybook", yield t.storybookBuild());
157
+ });
158
+ }
159
+ function R() {
160
+ return i(this, null, function* () {
161
+ try {
162
+ yield e(`Checking for ${u}`, `pnpm list -g ${u}`);
163
+ } catch (n) {
164
+ yield e(`Installing ${u} globally`, `pnpm i -g ${u}`);
165
+ }
166
+ f(s.DOT_AGENT) ? yield e("Updating AI agent", "ag-kit update") : yield e("Initializing AI agent", "ag-kit init");
157
167
  });
158
168
  }
159
- e(null, null, function* () {
169
+ i(null, null, function* () {
160
170
  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", {
171
+ yield A(N(d.argv)).scriptName(F).usage("$0 <command> [options]").command("ai:setup", "Setup AI agent environment", R).command("lint", "Check code for linting issues", J).command("lint:fix", "Fix linting issues automatically", V).command("lint:inspect", "View active ESLint configuration", j).command("lint-staged", "Run lint checks on staged files", $).command("commitlint", "Validate commit message format", z).command("ready", "Initialize project and dependencies", W).command("reset", "Reset the project and reinstall dependencies", Y).command("inspect", "Analyze installed project dependencies", q).command("test:unit", "Run unit test suite", Q).command("test:e2e", "Run end-to-end test suite", X).command("mongo:migrate:create <name>", "Create a MongoDB migration", (n) => n.positional("name", {
162
172
  describe: "Migration name",
163
173
  type: "string"
164
- }), (n) => e(null, null, function* () {
174
+ }), (n) => i(null, null, function* () {
165
175
  if (!n.name) {
166
- u.error("Migration name is required.");
176
+ a.error("Migration name is required.");
167
177
  return;
168
178
  }
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
179
+ yield Z(n.name);
180
+ })).command("mongo:migrate:up", "Apply all MongoDB migrations", nn).command("mongo:migrate:down", "Rollback last MongoDB migration", en).command("storybook:dev", "Start Storybook development server", tn).command("storybook:build", "Build Storybook for production", on).demandCommand(1, "Please specify a valid command.").strict().help().alias("h", "help").alias("v", "version").version(H()).epilog(`💡 Tip: Use "--help" with any command to see options
171
181
  `).parse();
172
182
  } catch (n) {
173
- _(n), a.exit(1);
183
+ O(n), d.exit(1);
174
184
  }
175
185
  });
@@ -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) => {
@@ -4,10 +4,12 @@ import { CorsOptions, CorsOptionsDelegate, CorsRequest } from 'cors';
4
4
  export type { NextFunction, Request, Response } from 'express';
5
5
  export { Router } from 'express';
6
6
  export interface I_ExpressOptions {
7
+ isDev?: boolean;
7
8
  static?: string | string[];
8
9
  }
9
10
  export interface I_NestOptions {
10
11
  module: Type<object>;
12
+ isDev?: boolean;
11
13
  static?: string | string[];
12
14
  filters?: ExceptionFilter[];
13
15
  pipes?: ValidationPipe[];
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("@nestjs/core"),m=require("compression"),w=require("cookie-parser"),P=require("cors"),c=require("express"),q=require("express-session"),x=require("express-useragent"),b=require("graphql-upload/graphqlUploadExpress.mjs"),g=require("helmet");var S=Object.defineProperty,l=Object.getOwnPropertySymbols,v=Object.prototype.hasOwnProperty,d=Object.prototype.propertyIsEnumerable,p=(e,r,t)=>r in e?S(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,E=(e,r)=>{for(var t in r||(r={}))v.call(r,t)&&p(e,t,r[t]);if(l)for(var t of l(r))d.call(r,t)&&p(e,t,r[t]);return e},C=(e,r)=>{var t={};for(var s in e)v.call(e,s)&&r.indexOf(s)<0&&(t[s]=e[s]);if(e!=null&&l)for(var s of l(e))r.indexOf(s)<0&&d.call(e,s)&&(t[s]=e[s]);return t},N=(e,r,t)=>new Promise((s,a)=>{var n=i=>{try{o(t.next(i))}catch(f){a(f)}},u=i=>{try{o(t.throw(i))}catch(f){a(f)}},o=i=>i.done?s(i.value):Promise.resolve(i.value).then(n,u);o((t=t.apply(e,r)).next())});function y(e){var r=e,{isDev:t,whiteList:s}=r,a=C(r,["isDev","whiteList"]);return E({origin:(n,u)=>{t||!n||s!=null&&s.includes(n!=null?n:"")?u(null,!0):u(new Error("Not allowed by CORS"),!1)},credentials:!0},a)}function j(e){return P(y(e))}function A(e){return q(e)}function _(e){e.set("trust proxy",1),e.use(g()),e.use(w()),e.use(c.urlencoded({extended:!0})),e.use(m()),e.use(x.express())}function O(e,r){r&&(Array.isArray(r)?r:[r]).forEach(s=>{e.use(`/${s}`,c.static(s))})}function I(e){const r=c();return _(r),O(r,e==null?void 0:e.static),r.use(b()),r}function D(e){return N(this,null,function*(){const r=yield h.NestFactory.create(e.module);return _(r.getHttpAdapter().getInstance()),O(r.getHttpAdapter().getInstance(),e.static),e.filters&&r.useGlobalFilters(...e.filters),e.pipes&&r.useGlobalPipes(...e.pipes),r})}exports.express=c;exports.createCors=j;exports.createCorsOptions=y;exports.createExpress=I;exports.createNest=D;exports.createSession=A;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("@nestjs/core"),m=require("compression"),h=require("cookie-parser"),w=require("cors"),c=require("express"),q=require("express-session"),x=require("express-useragent"),b=require("graphql-upload/graphqlUploadExpress.mjs"),g=require("helmet");var S=Object.defineProperty,u=Object.getOwnPropertySymbols,v=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,d=(e,r,t)=>r in e?S(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,E=(e,r)=>{for(var t in r||(r={}))v.call(r,t)&&d(e,t,r[t]);if(u)for(var t of u(r))p.call(r,t)&&d(e,t,r[t]);return e},C=(e,r)=>{var t={};for(var s in e)v.call(e,s)&&r.indexOf(s)<0&&(t[s]=e[s]);if(e!=null&&u)for(var s of u(e))r.indexOf(s)<0&&p.call(e,s)&&(t[s]=e[s]);return t},N=(e,r,t)=>new Promise((s,a)=>{var n=i=>{try{o(t.next(i))}catch(f){a(f)}},l=i=>{try{o(t.throw(i))}catch(f){a(f)}},o=i=>i.done?s(i.value):Promise.resolve(i.value).then(n,l);o((t=t.apply(e,r)).next())});function y(e){var r=e,{isDev:t,whiteList:s}=r,a=C(r,["isDev","whiteList"]);return E({origin:(n,l)=>{t||!n||s!=null&&s.includes(n!=null?n:"")?l(null,!0):l(new Error("Not allowed by CORS"),!1)},credentials:!0},a)}function j(e){return w(y(e))}function A(e){return q(e)}function _(e,r=!1){e.set("trust proxy",1),e.use(g({crossOriginEmbedderPolicy:r?!1:void 0,contentSecurityPolicy:r?!1:void 0})),e.use(h()),e.use(c.urlencoded({extended:!0})),e.use(m()),e.use(x.express())}function O(e,r){r&&(Array.isArray(r)?r:[r]).forEach(s=>{e.use(`/${s}`,c.static(s))})}function I(e){const r=c();return _(r,e==null?void 0:e.isDev),O(r,e==null?void 0:e.static),r.use(b()),r}function D(e){return N(this,null,function*(){const r=yield P.NestFactory.create(e.module);return _(r.getHttpAdapter().getInstance(),e.isDev),O(r.getHttpAdapter().getInstance(),e.static),e.filters&&r.useGlobalFilters(...e.filters),e.pipes&&r.useGlobalPipes(...e.pipes),r})}exports.express=c;exports.createCors=j;exports.createCorsOptions=y;exports.createExpress=I;exports.createNest=D;exports.createSession=A;
@@ -1,75 +1,80 @@
1
- import { NestFactory as y } from "@nestjs/core";
2
- import h from "compression";
3
- import w from "cookie-parser";
4
- import O from "cors";
1
+ import { NestFactory as _ } from "@nestjs/core";
2
+ import O from "compression";
3
+ import P from "cookie-parser";
4
+ import h from "cors";
5
5
  import c from "express";
6
6
  import { default as J } from "express";
7
- import x from "express-session";
8
- import { express as P } from "express-useragent";
7
+ import w from "express-session";
8
+ import { express as x } from "express-useragent";
9
9
  import b from "graphql-upload/graphqlUploadExpress.mjs";
10
10
  import E from "helmet";
11
- var g = Object.defineProperty, l = Object.getOwnPropertySymbols, m = Object.prototype.hasOwnProperty, v = Object.prototype.propertyIsEnumerable, p = (e, r, t) => r in e ? g(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t, S = (e, r) => {
11
+ var g = Object.defineProperty, o = Object.getOwnPropertySymbols, p = Object.prototype.hasOwnProperty, d = Object.prototype.propertyIsEnumerable, m = (e, r, t) => r in e ? g(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t, S = (e, r) => {
12
12
  for (var t in r || (r = {}))
13
- m.call(r, t) && p(e, t, r[t]);
14
- if (l)
15
- for (var t of l(r))
16
- v.call(r, t) && p(e, t, r[t]);
13
+ p.call(r, t) && m(e, t, r[t]);
14
+ if (o)
15
+ for (var t of o(r))
16
+ d.call(r, t) && m(e, t, r[t]);
17
17
  return e;
18
18
  }, A = (e, r) => {
19
19
  var t = {};
20
20
  for (var s in e)
21
- m.call(e, s) && r.indexOf(s) < 0 && (t[s] = e[s]);
22
- if (e != null && l)
23
- for (var s of l(e))
24
- r.indexOf(s) < 0 && v.call(e, s) && (t[s] = e[s]);
21
+ p.call(e, s) && r.indexOf(s) < 0 && (t[s] = e[s]);
22
+ if (e != null && o)
23
+ for (var s of o(e))
24
+ r.indexOf(s) < 0 && d.call(e, s) && (t[s] = e[s]);
25
25
  return t;
26
- }, I = (e, r, t) => new Promise((s, a) => {
27
- var n = (i) => {
26
+ }, I = (e, r, t) => new Promise((s, n) => {
27
+ var a = (i) => {
28
28
  try {
29
29
  f(t.next(i));
30
30
  } catch (u) {
31
- a(u);
31
+ n(u);
32
32
  }
33
- }, o = (i) => {
33
+ }, l = (i) => {
34
34
  try {
35
35
  f(t.throw(i));
36
36
  } catch (u) {
37
- a(u);
37
+ n(u);
38
38
  }
39
- }, f = (i) => i.done ? s(i.value) : Promise.resolve(i.value).then(n, o);
39
+ }, f = (i) => i.done ? s(i.value) : Promise.resolve(i.value).then(a, l);
40
40
  f((t = t.apply(e, r)).next());
41
41
  });
42
42
  function N(e) {
43
- var r = e, { isDev: t, whiteList: s } = r, a = A(r, ["isDev", "whiteList"]);
43
+ var r = e, { isDev: t, whiteList: s } = r, n = A(r, ["isDev", "whiteList"]);
44
44
  return S({
45
- origin: (n, o) => {
46
- t || !n || s != null && s.includes(n != null ? n : "") ? o(null, !0) : o(new Error("Not allowed by CORS"), !1);
45
+ origin: (a, l) => {
46
+ t || !a || s != null && s.includes(a != null ? a : "") ? l(null, !0) : l(new Error("Not allowed by CORS"), !1);
47
47
  },
48
48
  credentials: !0
49
- }, a);
49
+ }, n);
50
50
  }
51
51
  function M(e) {
52
- return O(N(e));
52
+ return h(N(e));
53
53
  }
54
54
  function U(e) {
55
- return x(e);
55
+ return w(e);
56
56
  }
57
- function d(e) {
58
- e.set("trust proxy", 1), e.use(E()), e.use(w()), e.use(c.urlencoded({ extended: !0 })), e.use(h()), e.use(P());
57
+ function v(e, r = !1) {
58
+ e.set("trust proxy", 1), e.use(
59
+ E({
60
+ crossOriginEmbedderPolicy: r ? !1 : void 0,
61
+ contentSecurityPolicy: r ? !1 : void 0
62
+ })
63
+ ), e.use(P()), e.use(c.urlencoded({ extended: !0 })), e.use(O()), e.use(x());
59
64
  }
60
- function _(e, r) {
65
+ function y(e, r) {
61
66
  r && (Array.isArray(r) ? r : [r]).forEach((s) => {
62
67
  e.use(`/${s}`, c.static(s));
63
68
  });
64
69
  }
65
70
  function V(e) {
66
71
  const r = c();
67
- return d(r), _(r, e == null ? void 0 : e.static), r.use(b()), r;
72
+ return v(r, e == null ? void 0 : e.isDev), y(r, e == null ? void 0 : e.static), r.use(b()), r;
68
73
  }
69
74
  function z(e) {
70
75
  return I(this, null, function* () {
71
- const r = yield y.create(e.module);
72
- return d(r.getHttpAdapter().getInstance()), _(r.getHttpAdapter().getInstance(), e.static), e.filters && r.useGlobalFilters(...e.filters), e.pipes && r.useGlobalPipes(...e.pipes), r;
76
+ const r = yield _.create(e.module);
77
+ return v(r.getHttpAdapter().getInstance(), e.isDev), y(r.getHttpAdapter().getInstance(), e.static), e.filters && r.useGlobalFilters(...e.filters), e.pipes && r.useGlobalPipes(...e.pipes), r;
73
78
  });
74
79
  }
75
80
  export {