@cyberskill/shared 1.127.0 → 1.129.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.
- package/README.md +2 -2
- package/dist/_tsup-dts-rollup.d.cts +57 -44
- package/dist/_tsup-dts-rollup.d.ts +57 -44
- package/dist/configs/commitlint/index.cjs +1 -1
- package/dist/configs/commitlint/index.js +1 -1
- package/dist/configs/config.util.cjs +1 -1
- package/dist/configs/config.util.js +1 -1
- package/dist/configs/index.cjs +1 -1
- package/dist/configs/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +6 -5
- package/dist/index.d.ts +6 -5
- package/dist/index.js +1 -1
- package/dist/{nodejs → node}/apollo-server/apollo-server.util.cjs +1 -1
- package/dist/{nodejs → node}/apollo-server/apollo-server.util.js +1 -1
- package/dist/{nodejs → node}/apollo-server/index.cjs +1 -1
- package/dist/{nodejs → node}/apollo-server/index.js +1 -1
- package/dist/node/cli/cli.util.cjs +2 -0
- package/dist/node/cli/cli.util.js +2 -0
- package/dist/node/cli/index.cjs +1 -0
- package/dist/node/cli/index.js +1 -0
- package/dist/node/command/command.util.cjs +1 -0
- package/dist/node/command/command.util.js +1 -0
- package/dist/node/command/index.cjs +1 -0
- package/dist/node/command/index.js +1 -0
- package/dist/{nodejs → node}/express/express.util.cjs +1 -1
- package/dist/{nodejs → node}/express/express.util.js +1 -1
- package/dist/{nodejs → node}/express/index.cjs +1 -1
- package/dist/{nodejs → node}/express/index.js +1 -1
- package/dist/node/fs/fs.util.cjs +1 -0
- package/dist/node/fs/fs.util.js +1 -0
- package/dist/node/fs/index.cjs +1 -0
- package/dist/node/fs/index.js +1 -0
- package/dist/node/index.cjs +1 -0
- package/dist/{nodejs → node}/index.d.cts +6 -5
- package/dist/{nodejs → node}/index.d.ts +6 -5
- package/dist/node/index.js +1 -0
- package/dist/node/mongo/index.cjs +1 -0
- package/dist/node/mongo/index.js +1 -0
- package/dist/node/mongo/mongo.util.cjs +1 -0
- package/dist/node/mongo/mongo.util.js +1 -0
- package/dist/node/package/index.cjs +1 -0
- package/dist/{nodejs → node}/package/index.d.cts +5 -5
- package/dist/{nodejs → node}/package/index.d.ts +5 -5
- package/dist/node/package/index.js +1 -0
- package/dist/node/package/package.type.cjs +1 -0
- package/dist/node/package/package.type.d.cts +4 -0
- package/dist/node/package/package.type.d.ts +4 -0
- package/dist/node/package/package.type.js +1 -0
- package/dist/node/package/package.util.cjs +1 -0
- package/dist/{nodejs → node}/package/package.util.d.cts +2 -2
- package/dist/{nodejs → node}/package/package.util.d.ts +2 -2
- package/dist/node/package/package.util.js +1 -0
- package/dist/node/path/index.cjs +1 -0
- package/dist/{nodejs → node}/path/index.d.cts +1 -0
- package/dist/{nodejs → node}/path/index.d.ts +1 -0
- package/dist/node/path/index.js +1 -0
- package/dist/node/path/path.constant.cjs +1 -0
- package/dist/{nodejs → node}/path/path.constant.d.cts +1 -0
- package/dist/{nodejs → node}/path/path.constant.d.ts +1 -0
- package/dist/node/path/path.constant.js +1 -0
- package/dist/node/storage/index.cjs +1 -0
- package/dist/node/storage/index.js +1 -0
- package/dist/node/storage/storage.util.cjs +1 -0
- package/dist/node/storage/storage.util.js +1 -0
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.js +1 -1
- package/dist/react/next-intl/index.cjs +1 -1
- package/dist/react/next-intl/index.js +1 -1
- package/dist/react/next-intl/next-intl.provider.cjs +1 -1
- package/dist/react/next-intl/next-intl.provider.js +1 -1
- package/dist/react/storage/index.cjs +1 -1
- package/dist/react/storage/index.js +1 -1
- package/dist/react/storage/storage.hook.cjs +1 -1
- package/dist/react/storage/storage.hook.js +1 -1
- package/dist/react/storage/storage.util.cjs +1 -1
- package/dist/react/storage/storage.util.js +1 -1
- package/dist/react/vitest/index.cjs +1 -1
- package/dist/react/vitest/index.js +1 -1
- package/dist/react/vitest/vitest.unit.cjs +1 -1
- package/dist/react/vitest/vitest.unit.js +1 -1
- package/package.json +75 -74
- package/public/wiki/convention.md +1 -1
- package/dist/nodejs/cli/cli.util.cjs +0 -2
- package/dist/nodejs/cli/cli.util.js +0 -2
- package/dist/nodejs/cli/index.cjs +0 -1
- package/dist/nodejs/cli/index.js +0 -1
- package/dist/nodejs/command/command.util.cjs +0 -1
- package/dist/nodejs/command/command.util.js +0 -1
- package/dist/nodejs/command/index.cjs +0 -1
- package/dist/nodejs/command/index.js +0 -1
- package/dist/nodejs/fs/fs.util.cjs +0 -1
- package/dist/nodejs/fs/fs.util.js +0 -1
- package/dist/nodejs/fs/index.cjs +0 -1
- package/dist/nodejs/fs/index.js +0 -1
- package/dist/nodejs/index.cjs +0 -1
- package/dist/nodejs/index.js +0 -1
- package/dist/nodejs/mongo/index.cjs +0 -1
- package/dist/nodejs/mongo/index.js +0 -1
- package/dist/nodejs/mongo/mongo.util.cjs +0 -1
- package/dist/nodejs/mongo/mongo.util.js +0 -1
- package/dist/nodejs/package/index.cjs +0 -1
- package/dist/nodejs/package/index.js +0 -1
- package/dist/nodejs/package/package.constant.cjs +0 -1
- package/dist/nodejs/package/package.constant.d.cts +0 -1
- package/dist/nodejs/package/package.constant.d.ts +0 -1
- package/dist/nodejs/package/package.constant.js +0 -1
- package/dist/nodejs/package/package.type.cjs +0 -1
- package/dist/nodejs/package/package.type.d.cts +0 -3
- package/dist/nodejs/package/package.type.d.ts +0 -3
- package/dist/nodejs/package/package.type.js +0 -0
- package/dist/nodejs/package/package.util.cjs +0 -1
- package/dist/nodejs/package/package.util.js +0 -1
- package/dist/nodejs/path/index.cjs +0 -1
- package/dist/nodejs/path/index.js +0 -1
- package/dist/nodejs/path/path.constant.cjs +0 -1
- package/dist/nodejs/path/path.constant.js +0 -1
- package/dist/nodejs/storage/index.cjs +0 -1
- package/dist/nodejs/storage/index.js +0 -1
- package/dist/nodejs/storage/storage.util.cjs +0 -1
- package/dist/nodejs/storage/storage.util.js +0 -1
- /package/dist/{nodejs → node}/apollo-server/apollo-server.type.cjs +0 -0
- /package/dist/{nodejs → node}/apollo-server/apollo-server.type.d.cts +0 -0
- /package/dist/{nodejs → node}/apollo-server/apollo-server.type.d.ts +0 -0
- /package/dist/{nodejs → node}/apollo-server/apollo-server.type.js +0 -0
- /package/dist/{nodejs → node}/apollo-server/apollo-server.util.d.cts +0 -0
- /package/dist/{nodejs → node}/apollo-server/apollo-server.util.d.ts +0 -0
- /package/dist/{nodejs → node}/apollo-server/index.d.cts +0 -0
- /package/dist/{nodejs → node}/apollo-server/index.d.ts +0 -0
- /package/dist/{nodejs → node}/cli/cli.util.d.cts +0 -0
- /package/dist/{nodejs → node}/cli/cli.util.d.ts +0 -0
- /package/dist/{nodejs → node}/cli/index.d.cts +0 -0
- /package/dist/{nodejs → node}/cli/index.d.ts +0 -0
- /package/dist/{nodejs → node}/command/command.type.cjs +0 -0
- /package/dist/{nodejs → node}/command/command.type.d.cts +0 -0
- /package/dist/{nodejs → node}/command/command.type.d.ts +0 -0
- /package/dist/{nodejs → node}/command/command.type.js +0 -0
- /package/dist/{nodejs → node}/command/command.util.d.cts +0 -0
- /package/dist/{nodejs → node}/command/command.util.d.ts +0 -0
- /package/dist/{nodejs → node}/command/index.d.cts +0 -0
- /package/dist/{nodejs → node}/command/index.d.ts +0 -0
- /package/dist/{nodejs → node}/express/express.type.cjs +0 -0
- /package/dist/{nodejs → node}/express/express.type.d.cts +0 -0
- /package/dist/{nodejs → node}/express/express.type.d.ts +0 -0
- /package/dist/{nodejs → node}/express/express.type.js +0 -0
- /package/dist/{nodejs → node}/express/express.util.d.cts +0 -0
- /package/dist/{nodejs → node}/express/express.util.d.ts +0 -0
- /package/dist/{nodejs → node}/express/index.d.cts +0 -0
- /package/dist/{nodejs → node}/express/index.d.ts +0 -0
- /package/dist/{nodejs → node}/fs/fs.type.cjs +0 -0
- /package/dist/{nodejs → node}/fs/fs.type.d.cts +0 -0
- /package/dist/{nodejs → node}/fs/fs.type.d.ts +0 -0
- /package/dist/{nodejs → node}/fs/fs.type.js +0 -0
- /package/dist/{nodejs → node}/fs/fs.util.d.cts +0 -0
- /package/dist/{nodejs → node}/fs/fs.util.d.ts +0 -0
- /package/dist/{nodejs → node}/fs/index.d.cts +0 -0
- /package/dist/{nodejs → node}/fs/index.d.ts +0 -0
- /package/dist/{nodejs → node}/log/index.cjs +0 -0
- /package/dist/{nodejs → node}/log/index.d.cts +0 -0
- /package/dist/{nodejs → node}/log/index.d.ts +0 -0
- /package/dist/{nodejs → node}/log/index.js +0 -0
- /package/dist/{nodejs → node}/log/log.type.cjs +0 -0
- /package/dist/{nodejs → node}/log/log.type.d.cts +0 -0
- /package/dist/{nodejs → node}/log/log.type.d.ts +0 -0
- /package/dist/{nodejs → node}/log/log.type.js +0 -0
- /package/dist/{nodejs → node}/log/log.util.cjs +0 -0
- /package/dist/{nodejs → node}/log/log.util.d.cts +0 -0
- /package/dist/{nodejs → node}/log/log.util.d.ts +0 -0
- /package/dist/{nodejs → node}/log/log.util.js +0 -0
- /package/dist/{nodejs → node}/mongo/index.d.cts +0 -0
- /package/dist/{nodejs → node}/mongo/index.d.ts +0 -0
- /package/dist/{nodejs → node}/mongo/mongo.constant.cjs +0 -0
- /package/dist/{nodejs → node}/mongo/mongo.constant.d.cts +0 -0
- /package/dist/{nodejs → node}/mongo/mongo.constant.d.ts +0 -0
- /package/dist/{nodejs → node}/mongo/mongo.constant.js +0 -0
- /package/dist/{nodejs → node}/mongo/mongo.type.cjs +0 -0
- /package/dist/{nodejs → node}/mongo/mongo.type.d.cts +0 -0
- /package/dist/{nodejs → node}/mongo/mongo.type.d.ts +0 -0
- /package/dist/{nodejs → node}/mongo/mongo.type.js +0 -0
- /package/dist/{nodejs → node}/mongo/mongo.util.d.cts +0 -0
- /package/dist/{nodejs → node}/mongo/mongo.util.d.ts +0 -0
- /package/dist/{nodejs → node}/path/path.util.cjs +0 -0
- /package/dist/{nodejs → node}/path/path.util.d.cts +0 -0
- /package/dist/{nodejs → node}/path/path.util.d.ts +0 -0
- /package/dist/{nodejs → node}/path/path.util.js +0 -0
- /package/dist/{nodejs → node}/storage/index.d.cts +0 -0
- /package/dist/{nodejs → node}/storage/index.d.ts +0 -0
- /package/dist/{nodejs → node}/storage/storage.util.d.cts +0 -0
- /package/dist/{nodejs → node}/storage/storage.util.d.ts +0 -0
- /package/dist/{nodejs → node}/ws/index.cjs +0 -0
- /package/dist/{nodejs → node}/ws/index.d.cts +0 -0
- /package/dist/{nodejs → node}/ws/index.d.ts +0 -0
- /package/dist/{nodejs → node}/ws/index.js +0 -0
- /package/dist/{nodejs → node}/ws/ts.util.cjs +0 -0
- /package/dist/{nodejs → node}/ws/ts.util.d.cts +0 -0
- /package/dist/{nodejs → node}/ws/ts.util.d.ts +0 -0
- /package/dist/{nodejs → node}/ws/ts.util.js +0 -0
- /package/dist/{nodejs → node}/ws/ws.type.cjs +0 -0
- /package/dist/{nodejs → node}/ws/ws.type.d.cts +0 -0
- /package/dist/{nodejs → node}/ws/ws.type.d.ts +0 -0
- /package/dist/{nodejs → node}/ws/ws.type.js +0 -0
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";function e(e,t){if(t==null||t>e.length)t=e.length;for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function t(e){if(Array.isArray(e))return e}function n(t){if(Array.isArray(t))return e(t)}function r(e,t,n,r,s,i,o){try{var a=e[i](o);var c=a.value}catch(e){n(e);return}if(a.done){t(c)}else{Promise.resolve(c).then(r,s)}}function s(e){return function(){var t=this,n=arguments;return new Promise(function(s,i){var o=e.apply(t,n);function a(e){r(o,s,i,a,c,"next",e)}function c(e){r(o,s,i,a,c,"throw",e)}a(undefined)})}}function i(e,t,n){if(t in e){Object.defineProperty(e,t,{value:n,enumerable:true,configurable:true,writable:true})}else{e[t]=n}return e}function o(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function a(e,t){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var r=[];var s=true;var i=false;var o,a;try{for(n=n.call(e);!(s=(o=n.next()).done);s=true){r.push(o.value);if(t&&r.length===t)break}}catch(e){i=true;a=e}finally{try{if(!s&&n["return"]!=null)n["return"]()}finally{if(i)throw a}}return r}function c(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};var r=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))}r.forEach(function(t){i(e,t,n[t])})}return e}function d(e,n){return t(e)||a(e,n)||g(e,n)||c()}function f(e){return n(e)||o(e)||g(e)||u()}function p(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function g(t,n){if(!t)return;if(typeof t==="string")return e(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return e(t,n)}function m(e,t){var n,r,s,i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},o=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return o.next=a(0),o["throw"]=a(1),o["return"]=a(2),typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(e){return function(t){return c([e,t])}}function c(a){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,a[0]&&(i=0)),i)try{if(n=1,r&&(s=a[0]&2?r["return"]:a[0]?r["throw"]||((s=r["return"])&&s.call(r),0):r.next)&&!(s=s.call(r,a[1])).done)return s;if(r=0,s)a=[a[0]&2,s.value];switch(a[0]){case 0:case 1:s=a;break;case 4:i.label++;return{value:a[1],done:false};case 5:i.label++;r=a[1];a=[0];continue;case 7:a=i.ops.pop();i.trys.pop();continue;default:if(!(s=i.trys,s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){i.label=a[1];break}if(a[0]===6&&i.label<s[1]){i.label=s[1];s=a;break}if(s&&i.label<s[2]){i.label=s[2];i.ops.push(a);break}if(s[2])i.ops.pop();i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e];r=0}finally{n=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}}var v=Object.create;var y=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,b=Object.prototype.hasOwnProperty;var I=function(e,t){return y(e,"name",{value:t,configurable:!0})};var w=function(e,t,n,r){var s=true,i=false,o=undefined;if(t&&(typeof t==="undefined"?"undefined":p(t))=="object"||typeof t=="function")try{var a=function(){var s=u.value;!b.call(e,s)&&s!==n&&y(e,s,{get:function(){return t[s]},enumerable:!(r=h(t,s))||r.enumerable})};for(var c=x(t)[Symbol.iterator](),u;!(s=(u=c.next()).done);s=true)a()}catch(e){i=true;o=e}finally{try{if(!s&&c.return!=null){c.return()}}finally{if(i){throw o}}}return e};var E=function(e,t,n){return n=e!=null?v(j(e)):{},w(t||!e||!e.__esModule?y(n,"default",{value:e,enumerable:!0}):n,e)};var S=E(require("process"),1),O=require("yargs/helpers"),C=E(require("yargs/yargs"),1);var k={name:"@cyberskill/shared",type:"module",version:"1.126.0",description:"CyberSkill Shared",author:"Stephen Cheng",license:"MIT",homepage:"https://github.com/cyberskill-world/shared#readme",repository:{type:"git",url:"git+https://github.com/cyberskill-world/shared.git"},bugs:{url:"https://github.com/cyberskill-world/shared/issues"},exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./configs":{types:"./dist/configs/index.d.ts",import:"./dist/configs/index.js",require:"./dist/configs/index.cjs"},"./configs/commitlint":{types:"./dist/configs/commitlint/index.d.ts",import:"./dist/configs/commitlint/index.js",require:"./dist/configs/commitlint/index.cjs"},"./configs/env":{types:"./dist/configs/env/index.d.ts",import:"./dist/configs/env/index.js",require:"./dist/configs/env/index.cjs"},"./configs/eslint":{types:"./dist/configs/eslint/index.d.ts",import:"./dist/configs/eslint/index.js",require:"./dist/configs/eslint/index.cjs"},"./configs/graphql-codegen":{types:"./dist/configs/graphql-codegen/index.d.ts",import:"./dist/configs/graphql-codegen/index.js",require:"./dist/configs/graphql-codegen/index.cjs"},"./configs/lint-staged":{types:"./dist/configs/lint-staged/index.d.ts",import:"./dist/configs/lint-staged/index.js",require:"./dist/configs/lint-staged/index.cjs"},"./constants":{types:"./dist/constants/index.d.ts",import:"./dist/constants/index.js",require:"./dist/constants/index.cjs"},"./nodejs":{types:"./dist/nodejs/index.d.ts",import:"./dist/nodejs/index.js",require:"./dist/nodejs/index.cjs"},"./nodejs/apollo-server":{types:"./dist/nodejs/apollo-server/index.d.ts",import:"./dist/nodejs/apollo-server/index.js",require:"./dist/nodejs/apollo-server/index.cjs"},"./nodejs/cli":{types:"./dist/nodejs/cli/index.d.ts",import:"./dist/nodejs/cli/index.js",require:"./dist/nodejs/cli/index.cjs"},"./nodejs/command":{types:"./dist/nodejs/command/index.d.ts",import:"./dist/nodejs/command/index.js",require:"./dist/nodejs/command/index.cjs"},"./nodejs/express":{types:"./dist/nodejs/express/index.d.ts",import:"./dist/nodejs/express/index.js",require:"./dist/nodejs/express/index.cjs"},"./nodejs/fs":{types:"./dist/nodejs/fs/index.d.ts",import:"./dist/nodejs/fs/index.js",require:"./dist/nodejs/fs/index.cjs"},"./nodejs/log":{types:"./dist/nodejs/log/index.d.ts",import:"./dist/nodejs/log/index.js",require:"./dist/nodejs/log/index.cjs"},"./nodejs/mongo":{types:"./dist/nodejs/mongo/index.d.ts",import:"./dist/nodejs/mongo/index.js",require:"./dist/nodejs/mongo/index.cjs"},"./nodejs/package":{types:"./dist/nodejs/package/index.d.ts",import:"./dist/nodejs/package/index.js",require:"./dist/nodejs/package/index.cjs"},"./nodejs/path":{types:"./dist/nodejs/path/index.d.ts",import:"./dist/nodejs/path/index.js",require:"./dist/nodejs/path/index.cjs"},"./nodejs/storage":{types:"./dist/nodejs/storage/index.d.ts",import:"./dist/nodejs/storage/index.js",require:"./dist/nodejs/storage/index.cjs"},"./nodejs/ws":{types:"./dist/nodejs/ws/index.d.ts",import:"./dist/nodejs/ws/index.js",require:"./dist/nodejs/ws/index.cjs"},"./react":{types:"./dist/react/index.d.ts",import:"./dist/react/index.js",require:"./dist/react/index.cjs"},"./react/apollo-client":{types:"./dist/react/apollo-client/index.d.ts",import:"./dist/react/apollo-client/index.js",require:"./dist/react/apollo-client/index.cjs"},"./react/apollo-error":{types:"./dist/react/apollo-error/index.d.ts",import:"./dist/react/apollo-error/index.js",require:"./dist/react/apollo-error/index.cjs"},"./react/i18next":{types:"./dist/react/i18next/index.d.ts",import:"./dist/react/i18next/index.js",require:"./dist/react/i18next/index.cjs"},"./react/loading":{types:"./dist/react/loading/index.d.ts",import:"./dist/react/loading/index.js",require:"./dist/react/loading/index.cjs"},"./react/log":{types:"./dist/react/log/index.d.ts",import:"./dist/react/log/index.js",require:"./dist/react/log/index.cjs"},"./react/next-intl":{types:"./dist/react/next-intl/index.d.ts",import:"./dist/react/next-intl/index.js",require:"./dist/react/next-intl/index.cjs"},"./react/storage":{types:"./dist/react/storage/index.d.ts",import:"./dist/react/storage/index.js",require:"./dist/react/storage/index.cjs"},"./react/toast":{types:"./dist/react/toast/index.d.ts",import:"./dist/react/toast/index.js",require:"./dist/react/toast/index.cjs"},"./react/vitest":{types:"./dist/react/vitest/index.d.ts",import:"./dist/react/vitest/index.js",require:"./dist/react/vitest/index.cjs"},"./styles/reset.css":{import:"./dist/styles/reset.css",require:"./dist/styles/reset.css"},"./typescript":{types:"./dist/typescript/index.d.ts",import:"./dist/typescript/index.js",require:"./dist/typescript/index.cjs"},"./utils":{types:"./dist/utils/index.d.ts",import:"./dist/utils/index.js",require:"./dist/utils/index.cjs"}},main:"./dist/index.cjs",module:"./dist/index.js",types:"./dist/index.d.ts",bin:{cyberskill:"./dist/nodejs/cli/index.js"},files:["dist","public"],scripts:{build:"tsup",dev:"tsup --watch",lint:"tsx src/nodejs/cli/index.ts lint","lint:fix":"tsx src/nodejs/cli/index.ts lint:fix","lint:inspect":"tsx src/nodejs/cli/index.ts lint:inspect",reset:"tsx src/nodejs/cli/index.ts reset",setup:"tsx src/nodejs/cli/index.ts setup",inspect:"tsx src/nodejs/cli/index.ts inspect","test:unit":"tsx src/nodejs/cli/index.ts test:unit","test:e2e":"tsx src/nodejs/cli/index.ts test:e2e",commitlint:"tsx src/nodejs/cli/index.ts commitlint","lint-staged":"tsx src/nodejs/cli/index.ts lint-staged"},dependencies:{"@antfu/eslint-config":"4.12.0","@apollo/client":"3.13.8","@apollo/server":"4.12.0","@dotenvx/dotenvx":"1.41.0","@eddeee888/gcg-typescript-resolver-files":"0.12.0","@eslint-react/eslint-plugin":"1.48.5","@graphql-codegen/cli":"5.0.5","@graphql-codegen/client-preset":"4.8.0","@microsoft/api-extractor":"7.52.5","@nestjs/common":"11.1.0","@nestjs/core":"11.1.0","@next/eslint-plugin-next":"15.3.1","@testing-library/jest-dom":"6.6.3","@testing-library/react":"16.3.0","@vitejs/plugin-react-swc":"3.9.0","@vitest/browser":"3.1.2","body-parser":"2.2.0",chalk:"5.4.1",classnames:"2.5.1",compression:"1.8.0",consola:"3.4.2","cookie-parser":"1.4.7",cors:"2.8.5","crypto-js":"4.2.0","date-fns":"4.1.0","dotenv-cli":"8.0.0",envalid:"8.0.0","eslint-config-next":"15.3.1","eslint-plugin-format":"1.0.1","eslint-plugin-react-hooks":"5.2.0","eslint-plugin-react-refresh":"0.4.20",express:"4.21.2","express-session":"1.18.1","express-useragent":"1.0.15","fs-extra":"11.3.0",globals:"16.0.0",graphql:"16.11.0","graphql-ws":"6.0.4",i18next:"25.0.2",jsdom:"26.1.0",localforage:"1.10.0","migrate-mongo":"12.1.3","modern-normalize":"3.0.1",mongodb:"6.16.0",mongoose:"8.14.1","mongoose-aggregate-paginate-v2":"1.1.4","mongoose-paginate-v2":"1.9.0","next-intl":"4.1.0","node-fetch":"3.3.2","node-persist":"4.0.4",playwright:"1.52.0","postcss-modules":"6.0.1",qs:"6.14.0",react:"19.1.0","react-dom":"19.1.0","react-hot-toast":"2.5.2","react-i18next":"15.5.1","react-icons":"5.5.0",sass:"1.87.0",slugify:"1.6.6",tsup:"8.4.0",tsx:"4.19.4",typescript:"5.8.3",unorm:"1.6.0",uuid:"11.1.0",vite:"6.3.3",vitest:"3.1.2","vitest-browser-react":"0.1.1",ws:"8.18.1",yargs:"17.7.2"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},devDependencies:{"@commitlint/cli":"19.8.0","@eslint/config-inspector":"1.0.2","@types/body-parser":"1.19.5","@types/compression":"1.7.5","@types/cookie-parser":"1.4.8","@types/cors":"2.8.17","@types/crypto-js":"4.2.2","@types/express":"4.17.21","@types/express-session":"1.18.1","@types/express-useragent":"1.0.5","@types/fs-extra":"11.0.4","@types/migrate-mongo":"10.0.5","@types/mongoose-aggregate-paginate-v2":"1.0.12","@types/node":"22.15.3","@types/node-persist":"3.1.8","@types/react":"19.1.2","@types/react-dom":"19.1.2","@types/unorm":"1.3.31","@types/uuid":"10.0.0","@types/ws":"8.18.1","@types/yargs":"17.0.33",eslint:"9.25.1","lint-staged":"15.5.1","node-modules-inspector":"0.6.7","simple-git-hooks":"2.13.0"}};var T=function(e){return e.CLI="CLI",e.STRING="STRING",e.FUNCTION="FUNCTION",e}({});var G=require("child_process"),_=E(require("process"),1),N=E(require("util"),1);var R=".cyberskill-storage";var L=E(require("@dotenvx/dotenvx"),1),q=require("envalid"),D=E(require("os"),1),M=E(require("path"),1),P=E(require("process"),1);var A=!1;function F(){A||(L.default.config(),A=!0)}I(F,"loadEnvFile");function U(){F();var e=(0,q.cleanEnv)(P.default.env,{CWD:(0,q.str)({default:P.default.cwd()}),DEBUG:(0,q.bool)({default:!1}),CYBERSKILL_STORAGE_DIRECTORY:(0,q.str)({default:M.default.join(D.default.homedir(),R)})});return{CWD:e.CWD,DEBUG:e.DEBUG,CYBERSKILL_STORAGE_DIRECTORY:e.CYBERSKILL_STORAGE_DIRECTORY}}I(U,"getEnv");var B=function(e){return e.Error="error",e.Warning="warning",e}({});var K=E(require("chalk"),1),W=E(require("consola"),1),Y=require("graphql");var H=U();H.DEBUG||(W.default.level=4);function J(e){var t=K.default[e];return typeof t=="function"?t:K.default.green}I(J,"chalkKeyword");var $={silent:W.default.silent,level:W.default.level,fatal:W.default.fatal,error:W.default.error,warn:W.default.warn,log:W.default.log,info:W.default.info,success:W.default.success,ready:W.default.ready,start:W.default.start,box:W.default.box,debug:W.default.debug,trace:W.default.trace,verbose:W.default.verbose,printBoxedLog:function e(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(t===null||t===void 0?void 0:t.length)){W.default.box(K.default.green(e));return}t.forEach(function(e){var t=e.file,r=e.position,s=e.rule,i=e.message;W.default.log("".concat(K.default.gray("File:")," ").concat(K.default.blue("".concat(t).concat(r?":".concat(r):"")))),s&&W.default.log(" ".concat(J(n)("Rule:")," ").concat(s)),W.default.log(" ".concat(J(n)("Message:")," ").concat(i))}),W.default.box(J(n)("".concat(e," : ").concat(t.length))),W.default.log(K.default.gray("─".repeat(40)))}};var V={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};var z=E(require("node-fetch"),1);var Q=E(require("fs-extra"),1);var X=E(require("path"),1);var Z=U(),ee=X.default;function et(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=ee).resolve.apply(r,[Z.CWD].concat(f(t)))}I(et,"resolveWorkingPath");function en(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=ee).join.apply(r,f(t))}I(en,"join");var er=U(),es=er.CWD,ei="@cyberskill/shared",eo="node_modules",ea="dist",ec="package.json",eu="package-lock.json",el="tsconfig.json",ed=".gitignore",ef=".simple-git-hooks.json",ep="pnpm-lock.yaml",eg=".git/hooks/",em=".git/COMMIT_EDITMSG",ev=".migrate-mongo.config.js",ey=en(es,eo,ei,ea),eh="cyberskill",ex="src/nodejs/cli/index.ts",ej="eslint",eb="eslint",eI="vitest",ew="playwright",eE="vitest",eS="@commitlint/cli",eO="commitlint",eC="lint-staged",ek="lint-staged",eT="typescript",eG="tsc",e_="tsx",eN="git",eR="pnpm",eL="pnpm exec",eq="simple-git-hooks",eD="simple-git-hooks",eM="@eslint/config-inspector",eP="eslint-config-inspector",eA="node-modules-inspector",eF="node-modules-inspector",eU="migrate-mongo",eB="./node_modules/migrate-mongo/bin/migrate-mongo",eK={CYBERSKILL_DIRECTORY:ey,WORKING_DIRECTORY:es,TS_CONFIG:et(el),GIT_IGNORE:et(ed),GIT_HOOK:et(eg),GIT_COMMIT_MSG:et(em),SIMPLE_GIT_HOOKS_JSON:et(ef),PACKAGE_JSON:et(ec),PACKAGE_LOCK_JSON:et(eu),PNPM_LOCK_YAML:et(ep),NODE_MODULES:et(eo),MIGRATE_MONGO_CONFIG:et(ev),LINT_STAGED_CONFIG:et("".concat(ey,"/configs/lint-staged/index.js")),COMMITLINT_CONFIG:et("".concat(ey,"/configs/commitlint/index.js")),UNIT_TEST_CONFIG:et("".concat(ey,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:et("".concat(ey,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:et("".concat(ey,"/react/vitest/vitest.e2e.js"))};function eW(e){var t=e.isCurrentProject;return l({"pre-commit":ek,"commit-msg":eO},t&&{"pre-push":tm("".concat(eN," pull"))})}I(eW,"createGitHooksConfig");function eY(e,t,n){return s(function(){return m(this,function(r){switch(r.label){case 0:if(!t)throw new Error("'first' argument is undefined");switch(e){case T.CLI:return[3,1];case T.STRING:return[3,3]}return[3,4];case 1:return[4,tt(t.split(" "),{update:!0})];case 2:return[2,(r.sent(),ty(tm("".concat(eL," ").concat(n))))];case 3:return[2,ty(tm(t))];case 4:throw new Error("Unsupported command type");case 5:return[2]}})})()}I(eY,"buildCommand");function eH(e,t,n){return function(){return s(function(){return m(this,function(r){return[2,eY(e,t,n)]})})()}}I(eH,"commandFactory");var eJ={simpleGitHooks:eH(T.CLI,eq,eD),eslintInspect:eH(T.CLI,eM,eP),nodeModulesInspect:eH(T.CLI,eA,eF),eslintCheck:eH(T.CLI,ej,"".concat(eb," ").concat(eK.WORKING_DIRECTORY," --no-cache")),eslintFix:eH(T.CLI,ej,"".concat(eb," ").concat(eK.WORKING_DIRECTORY," --fix --no-cache")),typescriptCheck:eH(T.CLI,eT,"".concat(eG," -p ").concat(eK.TS_CONFIG," --noEmit")),configureGitHook:eH(T.STRING,"".concat(eN," config core.hooksPath ").concat(eK.GIT_HOOK)),testUnit:eH(T.CLI,eI,"".concat(eE," --config ").concat(eK.UNIT_TEST_CONFIG)),testE2e:eH(T.CLI,"".concat(eI," ").concat(ew),"".concat(eE," --config ").concat(eK.E2E_TEST_CONFIG)),mongoMigrateCreate:I(function(e){return eH(T.CLI,eU,"".concat(e_," ").concat(eB," create ").concat(e," -f ").concat(eK.MIGRATE_MONGO_CONFIG))()},"mongoMigrateCreate"),mongoMigrateUp:eH(T.CLI,eU,"".concat(e_," ").concat(eB," up -f ").concat(eK.MIGRATE_MONGO_CONFIG)),mongoMigrateDown:eH(T.CLI,eU,"".concat(e_," ").concat(eB," down -f ").concat(eK.MIGRATE_MONGO_CONFIG)),commitLint:eH(T.CLI,eS,"".concat(eO," --edit ").concat(eK.GIT_COMMIT_MSG," --config ").concat(eK.COMMITLINT_CONFIG)),lintStaged:eH(T.CLI,eC,"".concat(ek," --config ").concat(eK.LINT_STAGED_CONFIG)),stageBuildDirectory:eH(T.STRING,"".concat(eN," add ").concat(ea)),build:eH(T.STRING,"".concat(eR," run build")),pnpmInstallStandard:eH(T.STRING,"".concat(eR," install")),pnpmInstallLegacy:eH(T.STRING,"".concat(eR," install --legacy-peer-deps")),pnpmInstallForce:eH(T.STRING,"".concat(eR," install --force"))};var e$=Q.default,eV=e$.lstatSync,ez=e$.readdirSync,eQ=e$.mkdirSync,eX=e$.readFileSync,eZ=e$.unlinkSync,e0=e$.statSync,e1=Q.default.readJsonSync;function e2(e,t,n){Q.default.writeFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}I(e2,"writeFileSync");function e4(e,t,n){Q.default.appendFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}I(e4,"appendFileSync");function e3(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return t.every(function(e){return Q.default.pathExistsSync(e)})}I(e3,"pathExistsSync");function e5(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}t.forEach(function(e){e3(e)&&Q.default.removeSync(e)})}I(e5,"removeSync");var e8=U();function e6(e){var t=en(e8.CWD,ec);if(!e3(t))return!1;try{var n=e1(t),r=n.name,s=n.dependencies,i=s===void 0?{}:s,o=n.devDependencies,a=o===void 0?{}:o,c=r===e,u=e in i,l=e in a;return c||u||l?{path:t,file:n,isCurrentProject:c,isDepend:u,isDevDepend:l}:!1}catch(e){return $.warn("Failed to read package.json: ".concat(e.message)),!1}}I(e6,"getPackage");function e7(e){return s(function(){var t,n,r,s;return m(this,function(i){switch(i.label){case 0:i.trys.push([0,3,,4]);return[4,(0,z.default)("https://registry.npmjs.org/".concat(e,"/latest"))];case 1:t=i.sent();if(!t.ok)throw new Error("Failed to fetch latest version: ".concat(t.status," ").concat(t.statusText));return[4,t.json()];case 2:n=i.sent(),r=n.version;return[2,r];case 3:s=i.sent();throw $.error('Failed to fetch version for "'.concat(e,'": ').concat(s.message)),s;case 4:return[2]}})})()}I(e7,"getLatestPackageVersion");function e9(e,t){return s(function(){var n,r,s,i,o,a,c,u,d,f,p,g,v,y,h,x,j,b,I,w,E;return m(this,function(m){switch(m.label){case 0:m.trys.push([0,4,,5]);n=e6(e);if(!n)return[2,l({},V)];c=n.path,u=n.file,d=n.isCurrentProject,f=n.isDepend,p=n.isDevDepend,g=(r=u.dependencies)!==null&&r!==void 0?r:{},v=(s=u.devDependencies)!==null&&s!==void 0?s:{},y=d?(i=u.version)!==null&&i!==void 0?i:"0.0.0":f?(o=g[e])!==null&&o!==void 0?o:"0.0.0":p?(a=v[e])!==null&&a!==void 0?a:"0.0.0":"0.0.0";if(!d)return[3,1];j=y;return[3,3];case 1:return[4,e7(e)];case 2:j=m.sent();m.label=3;case 3:h=j,x=d||y===h;if(!x&&(t===null||t===void 0?void 0:t.update)){;I=f?"dependencies":p?"devDependencies":null;I&&((b=u[I])===null||b===void 0?void 0:b[e])!==h&&(u[I]=(w=u[I])!==null&&w!==void 0?w:{},u[I][e]=h,e2(c,JSON.stringify(u,null,4)),$.info('Updated "'.concat(e,'" to version ').concat(h)))}return[2,{isCurrentProject:d,installedPath:c,file:u,isUpToDate:x}];case 4:E=m.sent();return[2,($.error('Error checking package "'.concat(e,'": ').concat(E.message)),l({},V))];case 5:return[2]}})})()}I(e9,"checkPackage");function te(){return s(function(){var e,t,n,r,s,i,o,a,c,u,l,d;return m(this,function(f){switch(f.label){case 0:e=[{command:I(function(){return eJ.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:I(function(){return eJ.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:I(function(){return eJ.pnpmInstallForce()},"command"),message:"Retrying with force install"}];t=true,n=false,r=undefined;f.label=1;case 1:f.trys.push([1,9,10,11]);s=e[Symbol.iterator]();f.label=2;case 2:if(!!(t=(i=s.next()).done))return[3,8];o=i.value,a=o.command,c=o.message;f.label=3;case 3:f.trys.push([3,6,,7]);return[4,a()];case 4:u=f.sent();return[4,tx("".concat(c," using: ").concat(u),u)];case 5:f.sent();return[2];case 6:l=f.sent();$.warn("Installation attempt failed: ".concat(c)),$.error("Details: ".concat(l.message));return[3,7];case 7:t=true;return[3,2];case 8:return[3,11];case 9:d=f.sent();n=true;r=d;return[3,11];case 10:try{if(!t&&s.return!=null){s.return()}}finally{if(n){throw r}}return[7];case 11:throw new Error("All dependency installation strategies failed.")}})})()}I(te,"installDependencies");function tt(e,t){return s(function(){var n,r,s,i,o,a,c,u,d,p,g;return m(this,function(m){switch(m.label){case 0:if(!e3(eK.PACKAGE_JSON)){$.error("package.json not found. Aborting setup.");return[2]}m.label=1;case 1:m.trys.push([1,13,,14]);n=f(new Set(e)).sort();return[4,Promise.all(n.map(function(e){return e9(e,l({},(t===null||t===void 0?void 0:t.update)&&{update:t.update}))}))];case 2:r=m.sent().every(function(e){return e.isUpToDate});if(r)return[3,4];return[4,te()];case 3:r=m.sent();m.label=4;case 4:r;i=true,o=false,a=undefined;m.label=5;case 5:m.trys.push([5,10,11,12]);c=((s=t===null||t===void 0?void 0:t.postInstallActions)!==null&&s!==void 0?s:[])[Symbol.iterator]();m.label=6;case 6:if(!!(i=(u=c.next()).done))return[3,9];d=u.value;return[4,d()];case 7:m.sent();m.label=8;case 8:i=true;return[3,6];case 9:return[3,12];case 10:p=m.sent();o=true;a=p;return[3,12];case 11:try{if(!i&&c.return!=null){c.return()}}finally{if(o){throw a}}return[7];case 12:return[3,14];case 13:g=m.sent();throw $.error('Failed to setup "'.concat(e.join(", "),'": ').concat(g.message)),g;case 14:return[2]}})})()}I(tt,"setupPackages");var tn=E(require("node-persist"),1);var tr=U();function ts(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=tn.default.defaultInstance;if(e)return[3,2];return[4,tn.default.init({dir:tr.CYBERSKILL_STORAGE_DIRECTORY,stringify:JSON.stringify,parse:JSON.parse,encoding:"utf8",logging:!1,forgiveParseErrors:!0})];case 1:e=t.sent();t.label=2;case 2:e;return[2]}})})()}I(ts,"initNodePersist");var ti={get:function e(e){return s(function(){var t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,ts()];case 1:r.sent();return[4,tn.default.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,($.error('[Storage:get] Error getting key "'.concat(e,'":'),n),null)];case 4:return[2]}})})()},set:function e(e,t){return s(function(){var n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,ts()];case 1:r.sent();return[4,tn.default.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();$.error('[Storage:set] Error setting key "'.concat(e,'":'),n);return[3,4];case 4:return[2]}})})()},remove:function e(e){return s(function(){var t;return m(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,ts()];case 1:n.sent();return[4,tn.default.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();$.error('[Storage:remove] Error removing key "'.concat(e,'":'),t);return[3,4];case 4:return[2]}})})()},keys:function e(){return s(function(){var e,t;return m(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,ts()];case 1:n.sent();return[4,tn.default.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:($.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,($.error("[Storage:keys] Error getting keys:",t),[])];case 4:return[2]}})})()},getLogLink:function e(e){return s(function(){return m(this,function(t){try{return[2,"".concat(tr.CYBERSKILL_STORAGE_DIRECTORY," (key: ").concat(e,")")]}catch(e){return[2,($.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var to=U(),ta=N.promisify(G.exec);function tc(e){return"error_list:".concat(e)}I(tc,"getErrorListKey");function tu(e){return s(function(){var t,n,r;return m(this,function(i){switch(i.label){case 0:if(e.length===0)return[2];t=Date.now(),n=tc(t);i.label=1;case 1:i.trys.push([1,3,,4]);return[4,ti.set(n,{errors:e,timestamp:t})];case 2:i.sent(),setTimeout(function(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,ti.getLogLink(n)];case 1:e=t.sent();e&&$.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})})()},10);return[3,4];case 3:r=i.sent();$.error("Failed to save errors: ".concat(r.message));return[3,4];case 4:return[2]}})})()}I(tu,"saveErrorListToStorage");function tl(){return s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,ti.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(function(e){return s(function(){var t;return m(this,function(n){switch(n.label){case 0:return[4,ti.get(e)];case 1:return[2,((t=n.sent())===null||t===void 0?void 0:t.errors)||[]]}})})()}))];case 2:return[2,r.sent().flat()];case 3:n=r.sent();return[2,($.error("Failed to retrieve stored errors: ".concat(n.message)),[])];case 4:return[2]}})})()}I(tl,"getStoredErrorLists");function td(){return s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,ti.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(function(e){return ti.remove(e)}))];case 2:r.sent();return[3,4];case 3:n=r.sent();$.error("Failed to clear error lists: ".concat(n.message));return[3,4];case 4:return[2]}})})()}I(td,"clearAllErrorLists");function tf(e){var t=[],n=[],r="",s=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,i=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,o=/^✖\s+(.*?)\s+\[(.*?)\]$/;e.split("\n").forEach(function(e){if(e.startsWith("/"))r=e.trim();else{var a,c,u,l,d;var f=s.exec(e)||[],p=i.exec(e)||[],g=o.exec(e)||[];var m,v,y,h,x,j;f.length&&r?t.push({file:r,position:"".concat(f[1],":").concat(f[2]),type:f[3]===B.Error?B.Error:B.Warning,message:(m=f===null||f===void 0?void 0:(a=f[4])===null||a===void 0?void 0:a.trim())!==null&&m!==void 0?m:"",rule:(v=f===null||f===void 0?void 0:(c=f[5])===null||c===void 0?void 0:c.trim())!==null&&v!==void 0?v:""}):p.length?t.push({file:(y=p===null||p===void 0?void 0:p[1])!==null&&y!==void 0?y:"",position:"".concat(p[2],":").concat(p[3]),type:p[4]===B.Error?B.Error:B.Warning,message:(h=p===null||p===void 0?void 0:(u=p[5])===null||u===void 0?void 0:u.trim())!==null&&h!==void 0?h:""}):g.length?t.push({file:"commitlint",type:B.Error,message:(x=g===null||g===void 0?void 0:(l=g[1])===null||l===void 0?void 0:l.trim())!==null&&x!==void 0?x:"",rule:(j=g===null||g===void 0?void 0:(d=g[2])===null||d===void 0?void 0:d.trim())!==null&&j!==void 0?j:""}):n.push(e.trim())}}),t.length&&tu(t),to.DEBUG&&n.length&&($.warn("Unmatched lines:"),n.forEach(function(e){return $.info(" ".concat(e))}))}I(tf,"parseTextErrors");function tp(e){try{var t=JSON.parse(e),n=[];t.forEach(function(e){var t=e.filePath,r=e.messages;r.forEach(function(e){var r=e.severity,s=e.line,i=e.column,o=e.ruleId,a=e.message;n.push({type:r===2?B.Error:B.Warning,file:t,position:"".concat(s,":").concat(i),rule:o,message:a})})}),n.length&&tu(n)}catch(t){tf(e)}}I(tp,"parseCommandOutput");function tg(e){return s(function(e){var t,n,r,s,i,o,a,c,u;var l=arguments;return m(this,function(d){switch(d.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:tp;n=new AbortController;_.default.on("SIGINT",function(){$.warn("Process interrupted. Terminating..."),n.abort(),_.default.exit()});d.label=1;case 1:d.trys.push([1,4,,5]);if(!(typeof e=="string"))return[3,3];return[4,ta(e,{maxBuffer:0x6400000,signal:n.signal})];case 2:r=d.sent(),s=r.stdout,i=r.stderr;[s,i].forEach(function(e){return e&&t(e)});d.label=3;case 3:return[3,5];case 4:o=d.sent();a=o.stdout,c=o.stderr,u=o.message;[a,c].forEach(function(e){return e&&t(e)}),!c&&!a&&$.error("Command failed: ".concat(u));return[3,5];case 5:return[2]}})}).apply(this,arguments)}I(tg,"executeCommand");function tm(e){return{raw:!0,cmd:e}}I(tm,"rawCommand");function tv(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(eL," ").concat(ei," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(eL," ").concat(e_," ").concat(ex," ").concat(e):"".concat(eL," ").concat(eh," ").concat(e)}I(tv,"formatCLI");function ty(e,t){return typeof e=="function"?tv(e(t),t):(typeof e==="undefined"?"undefined":p(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?tv(e,t):e}I(ty,"formatCommand");function th(e){return s(function(e){var t,n,r,s,i,o,a;var c=arguments;return m(this,function(u){switch(u.label){case 0:t=c.length>1&&c[1]!==void 0?c[1]:{};r=(n=t===null||t===void 0?void 0:t.isRemote)!==null&&n!==void 0?n:!1;if(!r)return[3,1];a=!1;return[3,3];case 1:return[4,e9(ei)];case 2:a=u.sent().isCurrentProject;u.label=3;case 3:s=a,i={isRemote:r,isCurrentProject:s},o=typeof e=="function"?e(i):e;return[2,Object.fromEntries(Object.entries(o).map(function(e){var t=d(e,2),n=t[0],r=t[1];return[n,ty(r,i)]}))]}})}).apply(this,arguments)}I(th,"resolveCommands");function tx(e,t){return s(function(){var n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);$.start("".concat(e)),to.DEBUG&&$.info("→ ".concat(t));return[4,tg(t)];case 1:r.sent(),$.success("".concat(e," done."));return[3,3];case 2:n=r.sent();throw $.error("".concat(e," failed: ").concat(n.message)),n;case 3:return[2]}})})()}I(tx,"runCommand");function tj(){return s(function(){var e,t;return m(this,function(n){switch(n.label){case 0:if(!e3(eK.TS_CONFIG))return[3,3];t=["Performing TypeScript validation"];return[4,eJ.typescriptCheck()];case 1:return[4,tx.apply(void 0,t.concat([n.sent()]))];case 2:e=n.sent();return[3,4];case 3:e=$.warn("No TypeScript configuration found. Skipping type check.");n.label=4;case 4:e;return[2]}})})()}I(tj,"checkTypescript");function tb(){return s(function(){var e,t,n,r;var s=arguments;return m(this,function(i){switch(i.label){case 0:e=s.length>0&&s[0]!==void 0?s[0]:!1;if(!e)return[3,3];n=["Running ESLint with auto-fix"];return[4,eJ.eslintFix()];case 1:return[4,tx.apply(void 0,n.concat([i.sent()]))];case 2:t=i.sent();return[3,6];case 3:r=["Running ESLint check"];return[4,eJ.eslintCheck()];case 4:return[4,tx.apply(void 0,r.concat([i.sent()]))];case 5:t=i.sent();i.label=6;case 6:t;return[2]}})}).apply(this,arguments)}I(tb,"checkEslint");function tI(e,t){if(!t.length)return;var n=e==="Errors"?"red":"yellow";$.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,n)}I(tI,"printIssues");function tw(){return s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:return[4,tl()];case 1:e=r.sent(),t=e.filter(function(e){return e.type===B.Error}),n=e.filter(function(e){return e.type===B.Warning});!t.length&&!n.length?$.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(tI("Warnings",n),tI("Errors",t),(t.length>0||n.length>0)&&S.default.exit(1));return[2]}})})()}I(tw,"showCheckResult");function tE(){return s(function(){var e,t,n,r,s,i;return m(this,function(o){switch(o.label){case 0:return[4,td()];case 1:o.sent();return[4,e9(ei)];case 2:e=o.sent(),t=e.isCurrentProject;if(!t)return[3,9];o.label=3;case 3:o.trys.push([3,8,,9]);n=["Building package: ".concat(ei)];return[4,eJ.build()];case 4:return[4,tx.apply(void 0,n.concat([o.sent()]))];case 5:o.sent();r=["Staging build artifacts"];return[4,eJ.stageBuildDirectory()];case 6:return[4,tx.apply(void 0,r.concat([o.sent()]))];case 7:o.sent();return[3,9];case 8:s=o.sent();throw $.error("Error building and staging ".concat(ei,": ").concat(s.message)),s;case 9:i=["Executing lint-staged"];return[4,eJ.lintStaged()];case 10:return[4,tx.apply(void 0,i.concat([o.sent()]))];case 11:o.sent(),tw();return[2]}})})()}I(tE,"lintStaged");function tS(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Inspecting ESLint configuration"];return[4,eJ.eslintInspect()];case 1:return[4,tx.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}I(tS,"inspectLint");function tO(){return s(function(){return m(this,function(e){switch(e.label){case 0:return[4,td()];case 1:e.sent();return[4,Promise.all([tj(),tb()])];case 2:e.sent(),tw();return[2]}})})()}I(tO,"lintCheck");function tC(){return s(function(){return m(this,function(e){switch(e.label){case 0:return[4,td()];case 1:e.sent();return[4,Promise.all([tj(),tb(!0)])];case 2:e.sent(),tw();return[2]}})})()}I(tC,"lintFix");function tk(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,td()];case 1:t.sent();e=["Validating commit message"];return[4,eJ.commitLint()];case 2:return[4,tx.apply(void 0,e.concat([t.sent()]))];case 3:t.sent(),tw();return[2]}})})()}I(tk,"commitLint");function tT(){return s(function(){var e,t,n,r;return m(this,function(s){switch(s.label){case 0:e=["Configuring Git hooks"];return[4,eJ.configureGitHook()];case 1:return[4,tx.apply(void 0,e.concat([s.sent()]))];case 2:s.sent(),e5(eK.GIT_HOOK);return[4,th(eW)];case 3:t=s.sent();e2(eK.SIMPLE_GIT_HOOKS_JSON,JSON.stringify(t,null,4));n="\n".concat(ef,"\n");e3(eK.GIT_IGNORE)?eX(eK.GIT_IGNORE,"utf-8").split("\n").includes(ef)||e4(eK.GIT_IGNORE,n):e2(eK.GIT_IGNORE,n);r=["Setting up simple-git-hooks"];return[4,eJ.simpleGitHooks()];case 4:return[4,tx.apply(void 0,r.concat([s.sent()]))];case 5:s.sent();return[2]}})})()}I(tT,"setupGitHook");function tG(){return s(function(){return m(this,function(e){switch(e.label){case 0:return[4,tt([ei],{update:!0,postInstallActions:[tT]})];case 1:e.sent();return[2]}})})()}I(tG,"setup");function t_(){return s(function(){return m(this,function(e){switch(e.label){case 0:e5(eK.NODE_MODULES,eK.PNPM_LOCK_YAML);return[4,te()];case 1:e.sent();return[4,tT()];case 2:e.sent();return[2]}})})()}I(t_,"reset");function tN(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Inspecting project dependencies"];return[4,eJ.nodeModulesInspect()];case 1:return[4,tx.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}I(tN,"inspect");function tR(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running unit tests"];return[4,eJ.testUnit()];case 1:return[4,tx.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}I(tR,"testUnit");function tL(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running end-to-end tests"];return[4,eJ.testE2e()];case 1:return[4,tx.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}I(tL,"testE2E");function tq(e){return s(function(){var t;return m(this,function(n){switch(n.label){case 0:t=["Creating MongoDB migration"];return[4,eJ.mongoMigrateCreate(e)];case 1:return[4,tx.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})})()}I(tq,"mongoMigrateCreate");function tD(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running MongoDB migrations"];return[4,eJ.mongoMigrateUp()];case 1:return[4,tx.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}I(tD,"mongoMigrateUp");function tM(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Rolling back MongoDB migration"];return[4,eJ.mongoMigrateDown()];case 1:return[4,tx.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}I(tM,"mongoMigrateDown");(function(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,(0,C.default)((0,O.hideBin)(S.default.argv)).scriptName(eh).usage("$0 <command> [options]").command("lint","Check code for linting issues",tO).command("lint:fix","Fix linting issues automatically",tC).command("lint:inspect","View active ESLint configuration",tS).command("lint-staged","Run lint checks on staged files",tE).command("commitlint","Validate commit message format",tk).command("setup","Initialize project setup and dependencies",tG).command("reset","Reset the project and reinstall dependencies",t_).command("inspect","Analyze installed project dependencies",tN).command("test:unit","Run unit test suite",tR).command("test:e2e","Run end-to-end test suite",tL).command("mongo:migrate:create <name>","Create a MongoDB migration",function(e){return e.positional("name",{describe:"Migration name",type:"string"})},function(e){return s(function(){return m(this,function(t){switch(t.label){case 0:if(!e.name){$.error("Migration name is required.");return[2]}return[4,tq(e.name)];case 1:t.sent();return[2]}})})()}).command("mongo:migrate:up","Apply all MongoDB migrations",tD).command("mongo:migrate:down","Rollback last MongoDB migration",tM).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(k.version).epilog('\uD83D\uDCA1 Tip: Use "--help" with any command to see options\n').parse()];case 1:t.sent();return[3,3];case 2:e=t.sent();$.error("Fatal: ".concat(e.message)),S.default.exit(1);return[3,3];case 3:return[2]}})})()})();
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
function e(e,t){if(t==null||t>e.length)t=e.length;for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function t(e){if(Array.isArray(e))return e}function n(t){if(Array.isArray(t))return e(t)}function r(e,t,n,r,s,i,o){try{var c=e[i](o);var a=c.value}catch(e){n(e);return}if(c.done){t(a)}else{Promise.resolve(a).then(r,s)}}function s(e){return function(){var t=this,n=arguments;return new Promise(function(s,i){var o=e.apply(t,n);function c(e){r(o,s,i,c,a,"next",e)}function a(e){r(o,s,i,c,a,"throw",e)}c(undefined)})}}function i(e,t,n){if(t in e){Object.defineProperty(e,t,{value:n,enumerable:true,configurable:true,writable:true})}else{e[t]=n}return e}function o(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function c(e,t){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var r=[];var s=true;var i=false;var o,c;try{for(n=n.call(e);!(s=(o=n.next()).done);s=true){r.push(o.value);if(t&&r.length===t)break}}catch(e){i=true;c=e}finally{try{if(!s&&n["return"]!=null)n["return"]()}finally{if(i)throw c}}return r}function a(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};var r=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))}r.forEach(function(t){i(e,t,n[t])})}return e}function d(e,n){return t(e)||c(e,n)||g(e,n)||a()}function p(e){return n(e)||o(e)||g(e)||u()}function f(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function g(t,n){if(!t)return;if(typeof t==="string")return e(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return e(t,n)}function m(e,t){var n,r,s,i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},o=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return o.next=c(0),o["throw"]=c(1),o["return"]=c(2),typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function c(e){return function(t){return a([e,t])}}function a(c){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,c[0]&&(i=0)),i)try{if(n=1,r&&(s=c[0]&2?r["return"]:c[0]?r["throw"]||((s=r["return"])&&s.call(r),0):r.next)&&!(s=s.call(r,c[1])).done)return s;if(r=0,s)c=[c[0]&2,s.value];switch(c[0]){case 0:case 1:s=c;break;case 4:i.label++;return{value:c[1],done:false};case 5:i.label++;r=c[1];c=[0];continue;case 7:c=i.ops.pop();i.trys.pop();continue;default:if(!(s=i.trys,s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){i=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){i.label=c[1];break}if(c[0]===6&&i.label<s[1]){i.label=s[1];s=c;break}if(s&&i.label<s[2]){i.label=s[2];i.ops.push(c);break}if(s[2])i.ops.pop();i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e];r=0}finally{n=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}}var y=Object.defineProperty;var v=function(e,t){return y(e,"name",{value:t,configurable:!0})};import h from"node:process";import{hideBin as x}from"yargs/helpers";import j from"yargs/yargs";var b={name:"@cyberskill/shared",type:"module",version:"1.126.0",description:"CyberSkill Shared",author:"Stephen Cheng",license:"MIT",homepage:"https://github.com/cyberskill-world/shared#readme",repository:{type:"git",url:"git+https://github.com/cyberskill-world/shared.git"},bugs:{url:"https://github.com/cyberskill-world/shared/issues"},exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./configs":{types:"./dist/configs/index.d.ts",import:"./dist/configs/index.js",require:"./dist/configs/index.cjs"},"./configs/commitlint":{types:"./dist/configs/commitlint/index.d.ts",import:"./dist/configs/commitlint/index.js",require:"./dist/configs/commitlint/index.cjs"},"./configs/env":{types:"./dist/configs/env/index.d.ts",import:"./dist/configs/env/index.js",require:"./dist/configs/env/index.cjs"},"./configs/eslint":{types:"./dist/configs/eslint/index.d.ts",import:"./dist/configs/eslint/index.js",require:"./dist/configs/eslint/index.cjs"},"./configs/graphql-codegen":{types:"./dist/configs/graphql-codegen/index.d.ts",import:"./dist/configs/graphql-codegen/index.js",require:"./dist/configs/graphql-codegen/index.cjs"},"./configs/lint-staged":{types:"./dist/configs/lint-staged/index.d.ts",import:"./dist/configs/lint-staged/index.js",require:"./dist/configs/lint-staged/index.cjs"},"./constants":{types:"./dist/constants/index.d.ts",import:"./dist/constants/index.js",require:"./dist/constants/index.cjs"},"./nodejs":{types:"./dist/nodejs/index.d.ts",import:"./dist/nodejs/index.js",require:"./dist/nodejs/index.cjs"},"./nodejs/apollo-server":{types:"./dist/nodejs/apollo-server/index.d.ts",import:"./dist/nodejs/apollo-server/index.js",require:"./dist/nodejs/apollo-server/index.cjs"},"./nodejs/cli":{types:"./dist/nodejs/cli/index.d.ts",import:"./dist/nodejs/cli/index.js",require:"./dist/nodejs/cli/index.cjs"},"./nodejs/command":{types:"./dist/nodejs/command/index.d.ts",import:"./dist/nodejs/command/index.js",require:"./dist/nodejs/command/index.cjs"},"./nodejs/express":{types:"./dist/nodejs/express/index.d.ts",import:"./dist/nodejs/express/index.js",require:"./dist/nodejs/express/index.cjs"},"./nodejs/fs":{types:"./dist/nodejs/fs/index.d.ts",import:"./dist/nodejs/fs/index.js",require:"./dist/nodejs/fs/index.cjs"},"./nodejs/log":{types:"./dist/nodejs/log/index.d.ts",import:"./dist/nodejs/log/index.js",require:"./dist/nodejs/log/index.cjs"},"./nodejs/mongo":{types:"./dist/nodejs/mongo/index.d.ts",import:"./dist/nodejs/mongo/index.js",require:"./dist/nodejs/mongo/index.cjs"},"./nodejs/package":{types:"./dist/nodejs/package/index.d.ts",import:"./dist/nodejs/package/index.js",require:"./dist/nodejs/package/index.cjs"},"./nodejs/path":{types:"./dist/nodejs/path/index.d.ts",import:"./dist/nodejs/path/index.js",require:"./dist/nodejs/path/index.cjs"},"./nodejs/storage":{types:"./dist/nodejs/storage/index.d.ts",import:"./dist/nodejs/storage/index.js",require:"./dist/nodejs/storage/index.cjs"},"./nodejs/ws":{types:"./dist/nodejs/ws/index.d.ts",import:"./dist/nodejs/ws/index.js",require:"./dist/nodejs/ws/index.cjs"},"./react":{types:"./dist/react/index.d.ts",import:"./dist/react/index.js",require:"./dist/react/index.cjs"},"./react/apollo-client":{types:"./dist/react/apollo-client/index.d.ts",import:"./dist/react/apollo-client/index.js",require:"./dist/react/apollo-client/index.cjs"},"./react/apollo-error":{types:"./dist/react/apollo-error/index.d.ts",import:"./dist/react/apollo-error/index.js",require:"./dist/react/apollo-error/index.cjs"},"./react/i18next":{types:"./dist/react/i18next/index.d.ts",import:"./dist/react/i18next/index.js",require:"./dist/react/i18next/index.cjs"},"./react/loading":{types:"./dist/react/loading/index.d.ts",import:"./dist/react/loading/index.js",require:"./dist/react/loading/index.cjs"},"./react/log":{types:"./dist/react/log/index.d.ts",import:"./dist/react/log/index.js",require:"./dist/react/log/index.cjs"},"./react/next-intl":{types:"./dist/react/next-intl/index.d.ts",import:"./dist/react/next-intl/index.js",require:"./dist/react/next-intl/index.cjs"},"./react/storage":{types:"./dist/react/storage/index.d.ts",import:"./dist/react/storage/index.js",require:"./dist/react/storage/index.cjs"},"./react/toast":{types:"./dist/react/toast/index.d.ts",import:"./dist/react/toast/index.js",require:"./dist/react/toast/index.cjs"},"./react/vitest":{types:"./dist/react/vitest/index.d.ts",import:"./dist/react/vitest/index.js",require:"./dist/react/vitest/index.cjs"},"./styles/reset.css":{import:"./dist/styles/reset.css",require:"./dist/styles/reset.css"},"./typescript":{types:"./dist/typescript/index.d.ts",import:"./dist/typescript/index.js",require:"./dist/typescript/index.cjs"},"./utils":{types:"./dist/utils/index.d.ts",import:"./dist/utils/index.js",require:"./dist/utils/index.cjs"}},main:"./dist/index.cjs",module:"./dist/index.js",types:"./dist/index.d.ts",bin:{cyberskill:"./dist/nodejs/cli/index.js"},files:["dist","public"],scripts:{build:"tsup",dev:"tsup --watch",lint:"tsx src/nodejs/cli/index.ts lint","lint:fix":"tsx src/nodejs/cli/index.ts lint:fix","lint:inspect":"tsx src/nodejs/cli/index.ts lint:inspect",reset:"tsx src/nodejs/cli/index.ts reset",setup:"tsx src/nodejs/cli/index.ts setup",inspect:"tsx src/nodejs/cli/index.ts inspect","test:unit":"tsx src/nodejs/cli/index.ts test:unit","test:e2e":"tsx src/nodejs/cli/index.ts test:e2e",commitlint:"tsx src/nodejs/cli/index.ts commitlint","lint-staged":"tsx src/nodejs/cli/index.ts lint-staged"},dependencies:{"@antfu/eslint-config":"4.12.0","@apollo/client":"3.13.8","@apollo/server":"4.12.0","@dotenvx/dotenvx":"1.41.0","@eddeee888/gcg-typescript-resolver-files":"0.12.0","@eslint-react/eslint-plugin":"1.48.5","@graphql-codegen/cli":"5.0.5","@graphql-codegen/client-preset":"4.8.0","@microsoft/api-extractor":"7.52.5","@nestjs/common":"11.1.0","@nestjs/core":"11.1.0","@next/eslint-plugin-next":"15.3.1","@testing-library/jest-dom":"6.6.3","@testing-library/react":"16.3.0","@vitejs/plugin-react-swc":"3.9.0","@vitest/browser":"3.1.2","body-parser":"2.2.0",chalk:"5.4.1",classnames:"2.5.1",compression:"1.8.0",consola:"3.4.2","cookie-parser":"1.4.7",cors:"2.8.5","crypto-js":"4.2.0","date-fns":"4.1.0","dotenv-cli":"8.0.0",envalid:"8.0.0","eslint-config-next":"15.3.1","eslint-plugin-format":"1.0.1","eslint-plugin-react-hooks":"5.2.0","eslint-plugin-react-refresh":"0.4.20",express:"4.21.2","express-session":"1.18.1","express-useragent":"1.0.15","fs-extra":"11.3.0",globals:"16.0.0",graphql:"16.11.0","graphql-ws":"6.0.4",i18next:"25.0.2",jsdom:"26.1.0",localforage:"1.10.0","migrate-mongo":"12.1.3","modern-normalize":"3.0.1",mongodb:"6.16.0",mongoose:"8.14.1","mongoose-aggregate-paginate-v2":"1.1.4","mongoose-paginate-v2":"1.9.0","next-intl":"4.1.0","node-fetch":"3.3.2","node-persist":"4.0.4",playwright:"1.52.0","postcss-modules":"6.0.1",qs:"6.14.0",react:"19.1.0","react-dom":"19.1.0","react-hot-toast":"2.5.2","react-i18next":"15.5.1","react-icons":"5.5.0",sass:"1.87.0",slugify:"1.6.6",tsup:"8.4.0",tsx:"4.19.4",typescript:"5.8.3",unorm:"1.6.0",uuid:"11.1.0",vite:"6.3.3",vitest:"3.1.2","vitest-browser-react":"0.1.1",ws:"8.18.1",yargs:"17.7.2"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},devDependencies:{"@commitlint/cli":"19.8.0","@eslint/config-inspector":"1.0.2","@types/body-parser":"1.19.5","@types/compression":"1.7.5","@types/cookie-parser":"1.4.8","@types/cors":"2.8.17","@types/crypto-js":"4.2.2","@types/express":"4.17.21","@types/express-session":"1.18.1","@types/express-useragent":"1.0.5","@types/fs-extra":"11.0.4","@types/migrate-mongo":"10.0.5","@types/mongoose-aggregate-paginate-v2":"1.0.12","@types/node":"22.15.3","@types/node-persist":"3.1.8","@types/react":"19.1.2","@types/react-dom":"19.1.2","@types/unorm":"1.3.31","@types/uuid":"10.0.0","@types/ws":"8.18.1","@types/yargs":"17.0.33",eslint:"9.25.1","lint-staged":"15.5.1","node-modules-inspector":"0.6.7","simple-git-hooks":"2.13.0"}};var I=function(e){return e.CLI="CLI",e.STRING="STRING",e.FUNCTION="FUNCTION",e}({});import{exec as w}from"node:child_process";import E from"node:process";import*as S from"node:util";var C=".cyberskill-storage";import O from"@dotenvx/dotenvx";import{bool as k,cleanEnv as T,str as G}from"envalid";import _ from"node:os";import N from"node:path";import R from"node:process";var L=!1;function D(){L||(O.config(),L=!0)}v(D,"loadEnvFile");function M(){D();var e=T(R.env,{CWD:G({default:R.cwd()}),DEBUG:k({default:!1}),CYBERSKILL_STORAGE_DIRECTORY:G({default:N.join(_.homedir(),C)})});return{CWD:e.CWD,DEBUG:e.DEBUG,CYBERSKILL_STORAGE_DIRECTORY:e.CYBERSKILL_STORAGE_DIRECTORY}}v(M,"getEnv");var A=function(e){return e.Error="error",e.Warning="warning",e}({});import P from"chalk";import q from"consola";import{GraphQLError as F}from"graphql";var U=M();U.DEBUG||(q.level=4);function B(e){var t=P[e];return typeof t=="function"?t:P.green}v(B,"chalkKeyword");var K={silent:q.silent,level:q.level,fatal:q.fatal,error:q.error,warn:q.warn,log:q.log,info:q.info,success:q.success,ready:q.ready,start:q.start,box:q.box,debug:q.debug,trace:q.trace,verbose:q.verbose,printBoxedLog:function e(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(t===null||t===void 0?void 0:t.length)){q.box(P.green(e));return}t.forEach(function(e){var t=e.file,r=e.position,s=e.rule,i=e.message;q.log("".concat(P.gray("File:")," ").concat(P.blue("".concat(t).concat(r?":".concat(r):"")))),s&&q.log(" ".concat(B(n)("Rule:")," ").concat(s)),q.log(" ".concat(B(n)("Message:")," ").concat(i))}),q.box(B(n)("".concat(e," : ").concat(t.length))),q.log(P.gray("─".repeat(40)))}};var W={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};import Y from"node-fetch";import H from"fs-extra";import J from"node:path";var $=M(),V=J;function z(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=V).resolve.apply(r,[$.CWD].concat(p(t)))}v(z,"resolveWorkingPath");function Q(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=V).join.apply(r,p(t))}v(Q,"join");var X=M(),Z=X.CWD,ee="@cyberskill/shared",et="node_modules",en="dist",er="package.json",es="package-lock.json",ei="tsconfig.json",eo=".gitignore",ec=".simple-git-hooks.json",ea="pnpm-lock.yaml",eu=".git/hooks/",el=".git/COMMIT_EDITMSG",ed=".migrate-mongo.config.js",ep=Q(Z,et,ee,en),ef="cyberskill",eg="src/nodejs/cli/index.ts",em="eslint",ey="eslint",ev="vitest",eh="playwright",ex="vitest",ej="@commitlint/cli",eb="commitlint",eI="lint-staged",ew="lint-staged",eE="typescript",eS="tsc",eC="tsx",eO="git",ek="pnpm",eT="pnpm exec",eG="simple-git-hooks",e_="simple-git-hooks",eN="@eslint/config-inspector",eR="eslint-config-inspector",eL="node-modules-inspector",eD="node-modules-inspector",eM="migrate-mongo",eA="./node_modules/migrate-mongo/bin/migrate-mongo",eP={CYBERSKILL_DIRECTORY:ep,WORKING_DIRECTORY:Z,TS_CONFIG:z(ei),GIT_IGNORE:z(eo),GIT_HOOK:z(eu),GIT_COMMIT_MSG:z(el),SIMPLE_GIT_HOOKS_JSON:z(ec),PACKAGE_JSON:z(er),PACKAGE_LOCK_JSON:z(es),PNPM_LOCK_YAML:z(ea),NODE_MODULES:z(et),MIGRATE_MONGO_CONFIG:z(ed),LINT_STAGED_CONFIG:z("".concat(ep,"/configs/lint-staged/index.js")),COMMITLINT_CONFIG:z("".concat(ep,"/configs/commitlint/index.js")),UNIT_TEST_CONFIG:z("".concat(ep,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:z("".concat(ep,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:z("".concat(ep,"/react/vitest/vitest.e2e.js"))};function eq(e){var t=e.isCurrentProject;return l({"pre-commit":ew,"commit-msg":eb},t&&{"pre-push":tu("".concat(eO," pull"))})}v(eq,"createGitHooksConfig");function eF(e,t,n){return s(function(){return m(this,function(r){switch(r.label){case 0:if(!t)throw new Error("'first' argument is undefined");switch(e){case I.CLI:return[3,1];case I.STRING:return[3,3]}return[3,4];case 1:return[4,e5(t.split(" "),{update:!0})];case 2:return[2,(r.sent(),td(tu("".concat(eT," ").concat(n))))];case 3:return[2,td(tu(t))];case 4:throw new Error("Unsupported command type");case 5:return[2]}})})()}v(eF,"buildCommand");function eU(e,t,n){return function(){return s(function(){return m(this,function(r){return[2,eF(e,t,n)]})})()}}v(eU,"commandFactory");var eB={simpleGitHooks:eU(I.CLI,eG,e_),eslintInspect:eU(I.CLI,eN,eR),nodeModulesInspect:eU(I.CLI,eL,eD),eslintCheck:eU(I.CLI,em,"".concat(ey," ").concat(eP.WORKING_DIRECTORY," --no-cache")),eslintFix:eU(I.CLI,em,"".concat(ey," ").concat(eP.WORKING_DIRECTORY," --fix --no-cache")),typescriptCheck:eU(I.CLI,eE,"".concat(eS," -p ").concat(eP.TS_CONFIG," --noEmit")),configureGitHook:eU(I.STRING,"".concat(eO," config core.hooksPath ").concat(eP.GIT_HOOK)),testUnit:eU(I.CLI,ev,"".concat(ex," --config ").concat(eP.UNIT_TEST_CONFIG)),testE2e:eU(I.CLI,"".concat(ev," ").concat(eh),"".concat(ex," --config ").concat(eP.E2E_TEST_CONFIG)),mongoMigrateCreate:v(function(e){return eU(I.CLI,eM,"".concat(eC," ").concat(eA," create ").concat(e," -f ").concat(eP.MIGRATE_MONGO_CONFIG))()},"mongoMigrateCreate"),mongoMigrateUp:eU(I.CLI,eM,"".concat(eC," ").concat(eA," up -f ").concat(eP.MIGRATE_MONGO_CONFIG)),mongoMigrateDown:eU(I.CLI,eM,"".concat(eC," ").concat(eA," down -f ").concat(eP.MIGRATE_MONGO_CONFIG)),commitLint:eU(I.CLI,ej,"".concat(eb," --edit ").concat(eP.GIT_COMMIT_MSG," --config ").concat(eP.COMMITLINT_CONFIG)),lintStaged:eU(I.CLI,eI,"".concat(ew," --config ").concat(eP.LINT_STAGED_CONFIG)),stageBuildDirectory:eU(I.STRING,"".concat(eO," add ").concat(en)),build:eU(I.STRING,"".concat(ek," run build")),pnpmInstallStandard:eU(I.STRING,"".concat(ek," install")),pnpmInstallLegacy:eU(I.STRING,"".concat(ek," install --legacy-peer-deps")),pnpmInstallForce:eU(I.STRING,"".concat(ek," install --force"))};var eK=H.lstatSync,eW=H.readdirSync,eY=H.mkdirSync,eH=H.readFileSync,eJ=H.unlinkSync,e$=H.statSync,eV=H.readJsonSync;function ez(e,t,n){H.writeFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}v(ez,"writeFileSync");function eQ(e,t,n){H.appendFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}v(eQ,"appendFileSync");function eX(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return t.every(function(e){return H.pathExistsSync(e)})}v(eX,"pathExistsSync");function eZ(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}t.forEach(function(e){eX(e)&&H.removeSync(e)})}v(eZ,"removeSync");var e0=M();function e1(e){var t=Q(e0.CWD,er);if(!eX(t))return!1;try{var n=eV(t),r=n.name,s=n.dependencies,i=s===void 0?{}:s,o=n.devDependencies,c=o===void 0?{}:o,a=r===e,u=e in i,l=e in c;return a||u||l?{path:t,file:n,isCurrentProject:a,isDepend:u,isDevDepend:l}:!1}catch(e){return K.warn("Failed to read package.json: ".concat(e.message)),!1}}v(e1,"getPackage");function e2(e){return s(function(){var t,n,r,s;return m(this,function(i){switch(i.label){case 0:i.trys.push([0,3,,4]);return[4,Y("https://registry.npmjs.org/".concat(e,"/latest"))];case 1:t=i.sent();if(!t.ok)throw new Error("Failed to fetch latest version: ".concat(t.status," ").concat(t.statusText));return[4,t.json()];case 2:n=i.sent(),r=n.version;return[2,r];case 3:s=i.sent();throw K.error('Failed to fetch version for "'.concat(e,'": ').concat(s.message)),s;case 4:return[2]}})})()}v(e2,"getLatestPackageVersion");function e4(e,t){return s(function(){var n,r,s,i,o,c,a,u,d,p,f,g,y,v,h,x,j,b,I,w,E;return m(this,function(m){switch(m.label){case 0:m.trys.push([0,4,,5]);n=e1(e);if(!n)return[2,l({},W)];a=n.path,u=n.file,d=n.isCurrentProject,p=n.isDepend,f=n.isDevDepend,g=(r=u.dependencies)!==null&&r!==void 0?r:{},y=(s=u.devDependencies)!==null&&s!==void 0?s:{},v=d?(i=u.version)!==null&&i!==void 0?i:"0.0.0":p?(o=g[e])!==null&&o!==void 0?o:"0.0.0":f?(c=y[e])!==null&&c!==void 0?c:"0.0.0":"0.0.0";if(!d)return[3,1];j=v;return[3,3];case 1:return[4,e2(e)];case 2:j=m.sent();m.label=3;case 3:h=j,x=d||v===h;if(!x&&(t===null||t===void 0?void 0:t.update)){;I=p?"dependencies":f?"devDependencies":null;I&&((b=u[I])===null||b===void 0?void 0:b[e])!==h&&(u[I]=(w=u[I])!==null&&w!==void 0?w:{},u[I][e]=h,ez(a,JSON.stringify(u,null,4)),K.info('Updated "'.concat(e,'" to version ').concat(h)))}return[2,{isCurrentProject:d,installedPath:a,file:u,isUpToDate:x}];case 4:E=m.sent();return[2,(K.error('Error checking package "'.concat(e,'": ').concat(E.message)),l({},W))];case 5:return[2]}})})()}v(e4,"checkPackage");function e3(){return s(function(){var e,t,n,r,s,i,o,c,a,u,l,d;return m(this,function(p){switch(p.label){case 0:e=[{command:v(function(){return eB.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:v(function(){return eB.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:v(function(){return eB.pnpmInstallForce()},"command"),message:"Retrying with force install"}];t=true,n=false,r=undefined;p.label=1;case 1:p.trys.push([1,9,10,11]);s=e[Symbol.iterator]();p.label=2;case 2:if(!!(t=(i=s.next()).done))return[3,8];o=i.value,c=o.command,a=o.message;p.label=3;case 3:p.trys.push([3,6,,7]);return[4,c()];case 4:u=p.sent();return[4,tf("".concat(a," using: ").concat(u),u)];case 5:p.sent();return[2];case 6:l=p.sent();K.warn("Installation attempt failed: ".concat(a)),K.error("Details: ".concat(l.message));return[3,7];case 7:t=true;return[3,2];case 8:return[3,11];case 9:d=p.sent();n=true;r=d;return[3,11];case 10:try{if(!t&&s.return!=null){s.return()}}finally{if(n){throw r}}return[7];case 11:throw new Error("All dependency installation strategies failed.")}})})()}v(e3,"installDependencies");function e5(e,t){return s(function(){var n,r,s,i,o,c,a,u,d,f,g;return m(this,function(m){switch(m.label){case 0:if(!eX(eP.PACKAGE_JSON)){K.error("package.json not found. Aborting setup.");return[2]}m.label=1;case 1:m.trys.push([1,13,,14]);n=p(new Set(e)).sort();return[4,Promise.all(n.map(function(e){return e4(e,l({},(t===null||t===void 0?void 0:t.update)&&{update:t.update}))}))];case 2:r=m.sent().every(function(e){return e.isUpToDate});if(r)return[3,4];return[4,e3()];case 3:r=m.sent();m.label=4;case 4:r;i=true,o=false,c=undefined;m.label=5;case 5:m.trys.push([5,10,11,12]);a=((s=t===null||t===void 0?void 0:t.postInstallActions)!==null&&s!==void 0?s:[])[Symbol.iterator]();m.label=6;case 6:if(!!(i=(u=a.next()).done))return[3,9];d=u.value;return[4,d()];case 7:m.sent();m.label=8;case 8:i=true;return[3,6];case 9:return[3,12];case 10:f=m.sent();o=true;c=f;return[3,12];case 11:try{if(!i&&a.return!=null){a.return()}}finally{if(o){throw c}}return[7];case 12:return[3,14];case 13:g=m.sent();throw K.error('Failed to setup "'.concat(e.join(", "),'": ').concat(g.message)),g;case 14:return[2]}})})()}v(e5,"setupPackages");import e8 from"node-persist";var e6=M();function e7(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=e8.defaultInstance;if(e)return[3,2];return[4,e8.init({dir:e6.CYBERSKILL_STORAGE_DIRECTORY,stringify:JSON.stringify,parse:JSON.parse,encoding:"utf8",logging:!1,forgiveParseErrors:!0})];case 1:e=t.sent();t.label=2;case 2:e;return[2]}})})()}v(e7,"initNodePersist");var e9={get:function e(e){return s(function(){var t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,e7()];case 1:r.sent();return[4,e8.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,(K.error('[Storage:get] Error getting key "'.concat(e,'":'),n),null)];case 4:return[2]}})})()},set:function e(e,t){return s(function(){var n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,e7()];case 1:r.sent();return[4,e8.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();K.error('[Storage:set] Error setting key "'.concat(e,'":'),n);return[3,4];case 4:return[2]}})})()},remove:function e(e){return s(function(){var t;return m(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,e7()];case 1:n.sent();return[4,e8.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();K.error('[Storage:remove] Error removing key "'.concat(e,'":'),t);return[3,4];case 4:return[2]}})})()},keys:function e(){return s(function(){var e,t;return m(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,e7()];case 1:n.sent();return[4,e8.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:(K.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,(K.error("[Storage:keys] Error getting keys:",t),[])];case 4:return[2]}})})()},getLogLink:function e(e){return s(function(){return m(this,function(t){try{return[2,"".concat(e6.CYBERSKILL_STORAGE_DIRECTORY," (key: ").concat(e,")")]}catch(e){return[2,(K.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var te=M(),tt=S.promisify(w);function tn(e){return"error_list:".concat(e)}v(tn,"getErrorListKey");function tr(e){return s(function(){var t,n,r;return m(this,function(i){switch(i.label){case 0:if(e.length===0)return[2];t=Date.now(),n=tn(t);i.label=1;case 1:i.trys.push([1,3,,4]);return[4,e9.set(n,{errors:e,timestamp:t})];case 2:i.sent(),setTimeout(function(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,e9.getLogLink(n)];case 1:e=t.sent();e&&K.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})})()},10);return[3,4];case 3:r=i.sent();K.error("Failed to save errors: ".concat(r.message));return[3,4];case 4:return[2]}})})()}v(tr,"saveErrorListToStorage");function ts(){return s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,e9.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(function(e){return s(function(){var t;return m(this,function(n){switch(n.label){case 0:return[4,e9.get(e)];case 1:return[2,((t=n.sent())===null||t===void 0?void 0:t.errors)||[]]}})})()}))];case 2:return[2,r.sent().flat()];case 3:n=r.sent();return[2,(K.error("Failed to retrieve stored errors: ".concat(n.message)),[])];case 4:return[2]}})})()}v(ts,"getStoredErrorLists");function ti(){return s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,e9.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(function(e){return e9.remove(e)}))];case 2:r.sent();return[3,4];case 3:n=r.sent();K.error("Failed to clear error lists: ".concat(n.message));return[3,4];case 4:return[2]}})})()}v(ti,"clearAllErrorLists");function to(e){var t=[],n=[],r="",s=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,i=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,o=/^✖\s+(.*?)\s+\[(.*?)\]$/;e.split("\n").forEach(function(e){if(e.startsWith("/"))r=e.trim();else{var c,a,u,l,d;var p=s.exec(e)||[],f=i.exec(e)||[],g=o.exec(e)||[];var m,y,v,h,x,j;p.length&&r?t.push({file:r,position:"".concat(p[1],":").concat(p[2]),type:p[3]===A.Error?A.Error:A.Warning,message:(m=p===null||p===void 0?void 0:(c=p[4])===null||c===void 0?void 0:c.trim())!==null&&m!==void 0?m:"",rule:(y=p===null||p===void 0?void 0:(a=p[5])===null||a===void 0?void 0:a.trim())!==null&&y!==void 0?y:""}):f.length?t.push({file:(v=f===null||f===void 0?void 0:f[1])!==null&&v!==void 0?v:"",position:"".concat(f[2],":").concat(f[3]),type:f[4]===A.Error?A.Error:A.Warning,message:(h=f===null||f===void 0?void 0:(u=f[5])===null||u===void 0?void 0:u.trim())!==null&&h!==void 0?h:""}):g.length?t.push({file:"commitlint",type:A.Error,message:(x=g===null||g===void 0?void 0:(l=g[1])===null||l===void 0?void 0:l.trim())!==null&&x!==void 0?x:"",rule:(j=g===null||g===void 0?void 0:(d=g[2])===null||d===void 0?void 0:d.trim())!==null&&j!==void 0?j:""}):n.push(e.trim())}}),t.length&&tr(t),te.DEBUG&&n.length&&(K.warn("Unmatched lines:"),n.forEach(function(e){return K.info(" ".concat(e))}))}v(to,"parseTextErrors");function tc(e){try{var t=JSON.parse(e),n=[];t.forEach(function(e){var t=e.filePath,r=e.messages;r.forEach(function(e){var r=e.severity,s=e.line,i=e.column,o=e.ruleId,c=e.message;n.push({type:r===2?A.Error:A.Warning,file:t,position:"".concat(s,":").concat(i),rule:o,message:c})})}),n.length&&tr(n)}catch(t){to(e)}}v(tc,"parseCommandOutput");function ta(e){return s(function(e){var t,n,r,s,i,o,c,a,u;var l=arguments;return m(this,function(d){switch(d.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:tc;n=new AbortController;E.on("SIGINT",function(){K.warn("Process interrupted. Terminating..."),n.abort(),E.exit()});d.label=1;case 1:d.trys.push([1,4,,5]);if(!(typeof e=="string"))return[3,3];return[4,tt(e,{maxBuffer:0x6400000,signal:n.signal})];case 2:r=d.sent(),s=r.stdout,i=r.stderr;[s,i].forEach(function(e){return e&&t(e)});d.label=3;case 3:return[3,5];case 4:o=d.sent();c=o.stdout,a=o.stderr,u=o.message;[c,a].forEach(function(e){return e&&t(e)}),!a&&!c&&K.error("Command failed: ".concat(u));return[3,5];case 5:return[2]}})}).apply(this,arguments)}v(ta,"executeCommand");function tu(e){return{raw:!0,cmd:e}}v(tu,"rawCommand");function tl(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(eT," ").concat(ee," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(eT," ").concat(eC," ").concat(eg," ").concat(e):"".concat(eT," ").concat(ef," ").concat(e)}v(tl,"formatCLI");function td(e,t){return typeof e=="function"?tl(e(t),t):(typeof e==="undefined"?"undefined":f(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?tl(e,t):e}v(td,"formatCommand");function tp(e){return s(function(e){var t,n,r,s,i,o,c;var a=arguments;return m(this,function(u){switch(u.label){case 0:t=a.length>1&&a[1]!==void 0?a[1]:{};r=(n=t===null||t===void 0?void 0:t.isRemote)!==null&&n!==void 0?n:!1;if(!r)return[3,1];c=!1;return[3,3];case 1:return[4,e4(ee)];case 2:c=u.sent().isCurrentProject;u.label=3;case 3:s=c,i={isRemote:r,isCurrentProject:s},o=typeof e=="function"?e(i):e;return[2,Object.fromEntries(Object.entries(o).map(function(e){var t=d(e,2),n=t[0],r=t[1];return[n,td(r,i)]}))]}})}).apply(this,arguments)}v(tp,"resolveCommands");function tf(e,t){return s(function(){var n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);K.start("".concat(e)),te.DEBUG&&K.info("→ ".concat(t));return[4,ta(t)];case 1:r.sent(),K.success("".concat(e," done."));return[3,3];case 2:n=r.sent();throw K.error("".concat(e," failed: ").concat(n.message)),n;case 3:return[2]}})})()}v(tf,"runCommand");function tg(){return s(function(){var e,t;return m(this,function(n){switch(n.label){case 0:if(!eX(eP.TS_CONFIG))return[3,3];t=["Performing TypeScript validation"];return[4,eB.typescriptCheck()];case 1:return[4,tf.apply(void 0,t.concat([n.sent()]))];case 2:e=n.sent();return[3,4];case 3:e=K.warn("No TypeScript configuration found. Skipping type check.");n.label=4;case 4:e;return[2]}})})()}v(tg,"checkTypescript");function tm(){return s(function(){var e,t,n,r;var s=arguments;return m(this,function(i){switch(i.label){case 0:e=s.length>0&&s[0]!==void 0?s[0]:!1;if(!e)return[3,3];n=["Running ESLint with auto-fix"];return[4,eB.eslintFix()];case 1:return[4,tf.apply(void 0,n.concat([i.sent()]))];case 2:t=i.sent();return[3,6];case 3:r=["Running ESLint check"];return[4,eB.eslintCheck()];case 4:return[4,tf.apply(void 0,r.concat([i.sent()]))];case 5:t=i.sent();i.label=6;case 6:t;return[2]}})}).apply(this,arguments)}v(tm,"checkEslint");function ty(e,t){if(!t.length)return;var n=e==="Errors"?"red":"yellow";K.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,n)}v(ty,"printIssues");function tv(){return s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:return[4,ts()];case 1:e=r.sent(),t=e.filter(function(e){return e.type===A.Error}),n=e.filter(function(e){return e.type===A.Warning});!t.length&&!n.length?K.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(ty("Warnings",n),ty("Errors",t),(t.length>0||n.length>0)&&h.exit(1));return[2]}})})()}v(tv,"showCheckResult");function th(){return s(function(){var e,t,n,r,s,i;return m(this,function(o){switch(o.label){case 0:return[4,ti()];case 1:o.sent();return[4,e4(ee)];case 2:e=o.sent(),t=e.isCurrentProject;if(!t)return[3,9];o.label=3;case 3:o.trys.push([3,8,,9]);n=["Building package: ".concat(ee)];return[4,eB.build()];case 4:return[4,tf.apply(void 0,n.concat([o.sent()]))];case 5:o.sent();r=["Staging build artifacts"];return[4,eB.stageBuildDirectory()];case 6:return[4,tf.apply(void 0,r.concat([o.sent()]))];case 7:o.sent();return[3,9];case 8:s=o.sent();throw K.error("Error building and staging ".concat(ee,": ").concat(s.message)),s;case 9:i=["Executing lint-staged"];return[4,eB.lintStaged()];case 10:return[4,tf.apply(void 0,i.concat([o.sent()]))];case 11:o.sent(),tv();return[2]}})})()}v(th,"lintStaged");function tx(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Inspecting ESLint configuration"];return[4,eB.eslintInspect()];case 1:return[4,tf.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}v(tx,"inspectLint");function tj(){return s(function(){return m(this,function(e){switch(e.label){case 0:return[4,ti()];case 1:e.sent();return[4,Promise.all([tg(),tm()])];case 2:e.sent(),tv();return[2]}})})()}v(tj,"lintCheck");function tb(){return s(function(){return m(this,function(e){switch(e.label){case 0:return[4,ti()];case 1:e.sent();return[4,Promise.all([tg(),tm(!0)])];case 2:e.sent(),tv();return[2]}})})()}v(tb,"lintFix");function tI(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,ti()];case 1:t.sent();e=["Validating commit message"];return[4,eB.commitLint()];case 2:return[4,tf.apply(void 0,e.concat([t.sent()]))];case 3:t.sent(),tv();return[2]}})})()}v(tI,"commitLint");function tw(){return s(function(){var e,t,n,r;return m(this,function(s){switch(s.label){case 0:e=["Configuring Git hooks"];return[4,eB.configureGitHook()];case 1:return[4,tf.apply(void 0,e.concat([s.sent()]))];case 2:s.sent(),eZ(eP.GIT_HOOK);return[4,tp(eq)];case 3:t=s.sent();ez(eP.SIMPLE_GIT_HOOKS_JSON,JSON.stringify(t,null,4));n="\n".concat(ec,"\n");eX(eP.GIT_IGNORE)?eH(eP.GIT_IGNORE,"utf-8").split("\n").includes(ec)||eQ(eP.GIT_IGNORE,n):ez(eP.GIT_IGNORE,n);r=["Setting up simple-git-hooks"];return[4,eB.simpleGitHooks()];case 4:return[4,tf.apply(void 0,r.concat([s.sent()]))];case 5:s.sent();return[2]}})})()}v(tw,"setupGitHook");function tE(){return s(function(){return m(this,function(e){switch(e.label){case 0:return[4,e5([ee],{update:!0,postInstallActions:[tw]})];case 1:e.sent();return[2]}})})()}v(tE,"setup");function tS(){return s(function(){return m(this,function(e){switch(e.label){case 0:eZ(eP.NODE_MODULES,eP.PNPM_LOCK_YAML);return[4,e3()];case 1:e.sent();return[4,tw()];case 2:e.sent();return[2]}})})()}v(tS,"reset");function tC(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Inspecting project dependencies"];return[4,eB.nodeModulesInspect()];case 1:return[4,tf.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}v(tC,"inspect");function tO(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running unit tests"];return[4,eB.testUnit()];case 1:return[4,tf.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}v(tO,"testUnit");function tk(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running end-to-end tests"];return[4,eB.testE2e()];case 1:return[4,tf.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}v(tk,"testE2E");function tT(e){return s(function(){var t;return m(this,function(n){switch(n.label){case 0:t=["Creating MongoDB migration"];return[4,eB.mongoMigrateCreate(e)];case 1:return[4,tf.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})})()}v(tT,"mongoMigrateCreate");function tG(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running MongoDB migrations"];return[4,eB.mongoMigrateUp()];case 1:return[4,tf.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}v(tG,"mongoMigrateUp");function t_(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Rolling back MongoDB migration"];return[4,eB.mongoMigrateDown()];case 1:return[4,tf.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}v(t_,"mongoMigrateDown");(function(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,j(x(h.argv)).scriptName(ef).usage("$0 <command> [options]").command("lint","Check code for linting issues",tj).command("lint:fix","Fix linting issues automatically",tb).command("lint:inspect","View active ESLint configuration",tx).command("lint-staged","Run lint checks on staged files",th).command("commitlint","Validate commit message format",tI).command("setup","Initialize project setup and dependencies",tE).command("reset","Reset the project and reinstall dependencies",tS).command("inspect","Analyze installed project dependencies",tC).command("test:unit","Run unit test suite",tO).command("test:e2e","Run end-to-end test suite",tk).command("mongo:migrate:create <name>","Create a MongoDB migration",function(e){return e.positional("name",{describe:"Migration name",type:"string"})},function(e){return s(function(){return m(this,function(t){switch(t.label){case 0:if(!e.name){K.error("Migration name is required.");return[2]}return[4,tT(e.name)];case 1:t.sent();return[2]}})})()}).command("mongo:migrate:up","Apply all MongoDB migrations",tG).command("mongo:migrate:down","Rollback last MongoDB migration",t_).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(b.version).epilog('\uD83D\uDCA1 Tip: Use "--help" with any command to see options\n').parse()];case 1:t.sent();return[3,3];case 2:e=t.sent();K.error("Fatal: ".concat(e.message)),h.exit(1);return[3,3];case 3:return[2]}})})()})();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";function e(e,t){if(t==null||t>e.length)t=e.length;for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function t(e){if(Array.isArray(e))return e}function n(t){if(Array.isArray(t))return e(t)}function r(e,t,n,r,s,i,o){try{var a=e[i](o);var c=a.value}catch(e){n(e);return}if(a.done){t(c)}else{Promise.resolve(c).then(r,s)}}function s(e){return function(){var t=this,n=arguments;return new Promise(function(s,i){var o=e.apply(t,n);function a(e){r(o,s,i,a,c,"next",e)}function c(e){r(o,s,i,a,c,"throw",e)}a(undefined)})}}function i(e,t,n){if(t in e){Object.defineProperty(e,t,{value:n,enumerable:true,configurable:true,writable:true})}else{e[t]=n}return e}function o(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function a(e,t){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var r=[];var s=true;var i=false;var o,a;try{for(n=n.call(e);!(s=(o=n.next()).done);s=true){r.push(o.value);if(t&&r.length===t)break}}catch(e){i=true;a=e}finally{try{if(!s&&n["return"]!=null)n["return"]()}finally{if(i)throw a}}return r}function c(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};var r=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))}r.forEach(function(t){i(e,t,n[t])})}return e}function d(e,n){return t(e)||a(e,n)||g(e,n)||c()}function f(e){return n(e)||o(e)||g(e)||u()}function p(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function g(t,n){if(!t)return;if(typeof t==="string")return e(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return e(t,n)}function m(e,t){var n,r,s,i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},o=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return o.next=a(0),o["throw"]=a(1),o["return"]=a(2),typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(e){return function(t){return c([e,t])}}function c(a){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,a[0]&&(i=0)),i)try{if(n=1,r&&(s=a[0]&2?r["return"]:a[0]?r["throw"]||((s=r["return"])&&s.call(r),0):r.next)&&!(s=s.call(r,a[1])).done)return s;if(r=0,s)a=[a[0]&2,s.value];switch(a[0]){case 0:case 1:s=a;break;case 4:i.label++;return{value:a[1],done:false};case 5:i.label++;r=a[1];a=[0];continue;case 7:a=i.ops.pop();i.trys.pop();continue;default:if(!(s=i.trys,s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){i.label=a[1];break}if(a[0]===6&&i.label<s[1]){i.label=s[1];s=a;break}if(s&&i.label<s[2]){i.label=s[2];i.ops.push(a);break}if(s[2])i.ops.pop();i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e];r=0}finally{n=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}}var v=Object.create;var y=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,b=Object.prototype.hasOwnProperty;var I=function(e,t){return y(e,"name",{value:t,configurable:!0})};var w=function(e,t,n,r){var s=true,i=false,o=undefined;if(t&&(typeof t==="undefined"?"undefined":p(t))=="object"||typeof t=="function")try{var a=function(){var s=u.value;!b.call(e,s)&&s!==n&&y(e,s,{get:function(){return t[s]},enumerable:!(r=h(t,s))||r.enumerable})};for(var c=x(t)[Symbol.iterator](),u;!(s=(u=c.next()).done);s=true)a()}catch(e){i=true;o=e}finally{try{if(!s&&c.return!=null){c.return()}}finally{if(i){throw o}}}return e};var E=function(e,t,n){return n=e!=null?v(j(e)):{},w(t||!e||!e.__esModule?y(n,"default",{value:e,enumerable:!0}):n,e)},S=function(e){return w(y({},"__esModule",{value:!0}),e)};var O={};module.exports=S(O);var C=E(require("process"),1),k=require("yargs/helpers"),T=E(require("yargs/yargs"),1);var G={name:"@cyberskill/shared",type:"module",version:"1.126.0",description:"CyberSkill Shared",author:"Stephen Cheng",license:"MIT",homepage:"https://github.com/cyberskill-world/shared#readme",repository:{type:"git",url:"git+https://github.com/cyberskill-world/shared.git"},bugs:{url:"https://github.com/cyberskill-world/shared/issues"},exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./configs":{types:"./dist/configs/index.d.ts",import:"./dist/configs/index.js",require:"./dist/configs/index.cjs"},"./configs/commitlint":{types:"./dist/configs/commitlint/index.d.ts",import:"./dist/configs/commitlint/index.js",require:"./dist/configs/commitlint/index.cjs"},"./configs/env":{types:"./dist/configs/env/index.d.ts",import:"./dist/configs/env/index.js",require:"./dist/configs/env/index.cjs"},"./configs/eslint":{types:"./dist/configs/eslint/index.d.ts",import:"./dist/configs/eslint/index.js",require:"./dist/configs/eslint/index.cjs"},"./configs/graphql-codegen":{types:"./dist/configs/graphql-codegen/index.d.ts",import:"./dist/configs/graphql-codegen/index.js",require:"./dist/configs/graphql-codegen/index.cjs"},"./configs/lint-staged":{types:"./dist/configs/lint-staged/index.d.ts",import:"./dist/configs/lint-staged/index.js",require:"./dist/configs/lint-staged/index.cjs"},"./constants":{types:"./dist/constants/index.d.ts",import:"./dist/constants/index.js",require:"./dist/constants/index.cjs"},"./nodejs":{types:"./dist/nodejs/index.d.ts",import:"./dist/nodejs/index.js",require:"./dist/nodejs/index.cjs"},"./nodejs/apollo-server":{types:"./dist/nodejs/apollo-server/index.d.ts",import:"./dist/nodejs/apollo-server/index.js",require:"./dist/nodejs/apollo-server/index.cjs"},"./nodejs/cli":{types:"./dist/nodejs/cli/index.d.ts",import:"./dist/nodejs/cli/index.js",require:"./dist/nodejs/cli/index.cjs"},"./nodejs/command":{types:"./dist/nodejs/command/index.d.ts",import:"./dist/nodejs/command/index.js",require:"./dist/nodejs/command/index.cjs"},"./nodejs/express":{types:"./dist/nodejs/express/index.d.ts",import:"./dist/nodejs/express/index.js",require:"./dist/nodejs/express/index.cjs"},"./nodejs/fs":{types:"./dist/nodejs/fs/index.d.ts",import:"./dist/nodejs/fs/index.js",require:"./dist/nodejs/fs/index.cjs"},"./nodejs/log":{types:"./dist/nodejs/log/index.d.ts",import:"./dist/nodejs/log/index.js",require:"./dist/nodejs/log/index.cjs"},"./nodejs/mongo":{types:"./dist/nodejs/mongo/index.d.ts",import:"./dist/nodejs/mongo/index.js",require:"./dist/nodejs/mongo/index.cjs"},"./nodejs/package":{types:"./dist/nodejs/package/index.d.ts",import:"./dist/nodejs/package/index.js",require:"./dist/nodejs/package/index.cjs"},"./nodejs/path":{types:"./dist/nodejs/path/index.d.ts",import:"./dist/nodejs/path/index.js",require:"./dist/nodejs/path/index.cjs"},"./nodejs/storage":{types:"./dist/nodejs/storage/index.d.ts",import:"./dist/nodejs/storage/index.js",require:"./dist/nodejs/storage/index.cjs"},"./nodejs/ws":{types:"./dist/nodejs/ws/index.d.ts",import:"./dist/nodejs/ws/index.js",require:"./dist/nodejs/ws/index.cjs"},"./react":{types:"./dist/react/index.d.ts",import:"./dist/react/index.js",require:"./dist/react/index.cjs"},"./react/apollo-client":{types:"./dist/react/apollo-client/index.d.ts",import:"./dist/react/apollo-client/index.js",require:"./dist/react/apollo-client/index.cjs"},"./react/apollo-error":{types:"./dist/react/apollo-error/index.d.ts",import:"./dist/react/apollo-error/index.js",require:"./dist/react/apollo-error/index.cjs"},"./react/i18next":{types:"./dist/react/i18next/index.d.ts",import:"./dist/react/i18next/index.js",require:"./dist/react/i18next/index.cjs"},"./react/loading":{types:"./dist/react/loading/index.d.ts",import:"./dist/react/loading/index.js",require:"./dist/react/loading/index.cjs"},"./react/log":{types:"./dist/react/log/index.d.ts",import:"./dist/react/log/index.js",require:"./dist/react/log/index.cjs"},"./react/next-intl":{types:"./dist/react/next-intl/index.d.ts",import:"./dist/react/next-intl/index.js",require:"./dist/react/next-intl/index.cjs"},"./react/storage":{types:"./dist/react/storage/index.d.ts",import:"./dist/react/storage/index.js",require:"./dist/react/storage/index.cjs"},"./react/toast":{types:"./dist/react/toast/index.d.ts",import:"./dist/react/toast/index.js",require:"./dist/react/toast/index.cjs"},"./react/vitest":{types:"./dist/react/vitest/index.d.ts",import:"./dist/react/vitest/index.js",require:"./dist/react/vitest/index.cjs"},"./styles/reset.css":{import:"./dist/styles/reset.css",require:"./dist/styles/reset.css"},"./typescript":{types:"./dist/typescript/index.d.ts",import:"./dist/typescript/index.js",require:"./dist/typescript/index.cjs"},"./utils":{types:"./dist/utils/index.d.ts",import:"./dist/utils/index.js",require:"./dist/utils/index.cjs"}},main:"./dist/index.cjs",module:"./dist/index.js",types:"./dist/index.d.ts",bin:{cyberskill:"./dist/nodejs/cli/index.js"},files:["dist","public"],scripts:{build:"tsup",dev:"tsup --watch",lint:"tsx src/nodejs/cli/index.ts lint","lint:fix":"tsx src/nodejs/cli/index.ts lint:fix","lint:inspect":"tsx src/nodejs/cli/index.ts lint:inspect",reset:"tsx src/nodejs/cli/index.ts reset",setup:"tsx src/nodejs/cli/index.ts setup",inspect:"tsx src/nodejs/cli/index.ts inspect","test:unit":"tsx src/nodejs/cli/index.ts test:unit","test:e2e":"tsx src/nodejs/cli/index.ts test:e2e",commitlint:"tsx src/nodejs/cli/index.ts commitlint","lint-staged":"tsx src/nodejs/cli/index.ts lint-staged"},dependencies:{"@antfu/eslint-config":"4.12.0","@apollo/client":"3.13.8","@apollo/server":"4.12.0","@dotenvx/dotenvx":"1.41.0","@eddeee888/gcg-typescript-resolver-files":"0.12.0","@eslint-react/eslint-plugin":"1.48.5","@graphql-codegen/cli":"5.0.5","@graphql-codegen/client-preset":"4.8.0","@microsoft/api-extractor":"7.52.5","@nestjs/common":"11.1.0","@nestjs/core":"11.1.0","@next/eslint-plugin-next":"15.3.1","@testing-library/jest-dom":"6.6.3","@testing-library/react":"16.3.0","@vitejs/plugin-react-swc":"3.9.0","@vitest/browser":"3.1.2","body-parser":"2.2.0",chalk:"5.4.1",classnames:"2.5.1",compression:"1.8.0",consola:"3.4.2","cookie-parser":"1.4.7",cors:"2.8.5","crypto-js":"4.2.0","date-fns":"4.1.0","dotenv-cli":"8.0.0",envalid:"8.0.0","eslint-config-next":"15.3.1","eslint-plugin-format":"1.0.1","eslint-plugin-react-hooks":"5.2.0","eslint-plugin-react-refresh":"0.4.20",express:"4.21.2","express-session":"1.18.1","express-useragent":"1.0.15","fs-extra":"11.3.0",globals:"16.0.0",graphql:"16.11.0","graphql-ws":"6.0.4",i18next:"25.0.2",jsdom:"26.1.0",localforage:"1.10.0","migrate-mongo":"12.1.3","modern-normalize":"3.0.1",mongodb:"6.16.0",mongoose:"8.14.1","mongoose-aggregate-paginate-v2":"1.1.4","mongoose-paginate-v2":"1.9.0","next-intl":"4.1.0","node-fetch":"3.3.2","node-persist":"4.0.4",playwright:"1.52.0","postcss-modules":"6.0.1",qs:"6.14.0",react:"19.1.0","react-dom":"19.1.0","react-hot-toast":"2.5.2","react-i18next":"15.5.1","react-icons":"5.5.0",sass:"1.87.0",slugify:"1.6.6",tsup:"8.4.0",tsx:"4.19.4",typescript:"5.8.3",unorm:"1.6.0",uuid:"11.1.0",vite:"6.3.3",vitest:"3.1.2","vitest-browser-react":"0.1.1",ws:"8.18.1",yargs:"17.7.2"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},devDependencies:{"@commitlint/cli":"19.8.0","@eslint/config-inspector":"1.0.2","@types/body-parser":"1.19.5","@types/compression":"1.7.5","@types/cookie-parser":"1.4.8","@types/cors":"2.8.17","@types/crypto-js":"4.2.2","@types/express":"4.17.21","@types/express-session":"1.18.1","@types/express-useragent":"1.0.5","@types/fs-extra":"11.0.4","@types/migrate-mongo":"10.0.5","@types/mongoose-aggregate-paginate-v2":"1.0.12","@types/node":"22.15.3","@types/node-persist":"3.1.8","@types/react":"19.1.2","@types/react-dom":"19.1.2","@types/unorm":"1.3.31","@types/uuid":"10.0.0","@types/ws":"8.18.1","@types/yargs":"17.0.33",eslint:"9.25.1","lint-staged":"15.5.1","node-modules-inspector":"0.6.7","simple-git-hooks":"2.13.0"}};var _=function(e){return e.CLI="CLI",e.STRING="STRING",e.FUNCTION="FUNCTION",e}({});var N=require("child_process"),R=E(require("process"),1),L=E(require("util"),1);var q=".cyberskill-storage";var D=E(require("@dotenvx/dotenvx"),1),M=require("envalid"),P=E(require("os"),1),A=E(require("path"),1),F=E(require("process"),1);var U=!1;function B(){U||(D.default.config(),U=!0)}I(B,"loadEnvFile");function K(){B();var e=(0,M.cleanEnv)(F.default.env,{CWD:(0,M.str)({default:F.default.cwd()}),DEBUG:(0,M.bool)({default:!1}),CYBERSKILL_STORAGE_DIRECTORY:(0,M.str)({default:A.default.join(P.default.homedir(),q)})});return{CWD:e.CWD,DEBUG:e.DEBUG,CYBERSKILL_STORAGE_DIRECTORY:e.CYBERSKILL_STORAGE_DIRECTORY}}I(K,"getEnv");var W=function(e){return e.Error="error",e.Warning="warning",e}({});var Y=E(require("chalk"),1),H=E(require("consola"),1),J=require("graphql");var $=K();$.DEBUG||(H.default.level=4);function V(e){var t=Y.default[e];return typeof t=="function"?t:Y.default.green}I(V,"chalkKeyword");var z={silent:H.default.silent,level:H.default.level,fatal:H.default.fatal,error:H.default.error,warn:H.default.warn,log:H.default.log,info:H.default.info,success:H.default.success,ready:H.default.ready,start:H.default.start,box:H.default.box,debug:H.default.debug,trace:H.default.trace,verbose:H.default.verbose,printBoxedLog:function e(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(t===null||t===void 0?void 0:t.length)){H.default.box(Y.default.green(e));return}t.forEach(function(e){var t=e.file,r=e.position,s=e.rule,i=e.message;H.default.log("".concat(Y.default.gray("File:")," ").concat(Y.default.blue("".concat(t).concat(r?":".concat(r):"")))),s&&H.default.log(" ".concat(V(n)("Rule:")," ").concat(s)),H.default.log(" ".concat(V(n)("Message:")," ").concat(i))}),H.default.box(V(n)("".concat(e," : ").concat(t.length))),H.default.log(Y.default.gray("─".repeat(40)))}};var Q={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};var X=E(require("node-fetch"),1);var Z=E(require("fs-extra"),1);var ee=E(require("path"),1);var et=K(),en=ee.default;function er(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=en).resolve.apply(r,[et.CWD].concat(f(t)))}I(er,"resolveWorkingPath");function es(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=en).join.apply(r,f(t))}I(es,"join");var ei=K(),eo=ei.CWD,ea="@cyberskill/shared",ec="node_modules",eu="dist",el="package.json",ed="package-lock.json",ef="tsconfig.json",ep=".gitignore",eg=".simple-git-hooks.json",em="pnpm-lock.yaml",ev=".git/hooks/",ey=".git/COMMIT_EDITMSG",eh=".migrate-mongo.config.js",ex=es(eo,ec,ea,eu),ej="cyberskill",eb="src/nodejs/cli/index.ts",eI="eslint",ew="eslint",eE="vitest",eS="playwright",eO="vitest",eC="@commitlint/cli",ek="commitlint",eT="lint-staged",eG="lint-staged",e_="typescript",eN="tsc",eR="tsx",eL="git",eq="pnpm",eD="pnpm exec",eM="simple-git-hooks",eP="simple-git-hooks",eA="@eslint/config-inspector",eF="eslint-config-inspector",eU="node-modules-inspector",eB="node-modules-inspector",eK="migrate-mongo",eW="./node_modules/migrate-mongo/bin/migrate-mongo",eY={CYBERSKILL_DIRECTORY:ex,WORKING_DIRECTORY:eo,TS_CONFIG:er(ef),GIT_IGNORE:er(ep),GIT_HOOK:er(ev),GIT_COMMIT_MSG:er(ey),SIMPLE_GIT_HOOKS_JSON:er(eg),PACKAGE_JSON:er(el),PACKAGE_LOCK_JSON:er(ed),PNPM_LOCK_YAML:er(em),NODE_MODULES:er(ec),MIGRATE_MONGO_CONFIG:er(eh),LINT_STAGED_CONFIG:er("".concat(ex,"/configs/lint-staged/index.js")),COMMITLINT_CONFIG:er("".concat(ex,"/configs/commitlint/index.js")),UNIT_TEST_CONFIG:er("".concat(ex,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:er("".concat(ex,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:er("".concat(ex,"/react/vitest/vitest.e2e.js"))};function eH(e){var t=e.isCurrentProject;return l({"pre-commit":eG,"commit-msg":ek},t&&{"pre-push":ty("".concat(eL," pull"))})}I(eH,"createGitHooksConfig");function eJ(e,t,n){return s(function(){return m(this,function(r){switch(r.label){case 0:if(!t)throw new Error("'first' argument is undefined");switch(e){case _.CLI:return[3,1];case _.STRING:return[3,3]}return[3,4];case 1:return[4,tr(t.split(" "),{update:!0})];case 2:return[2,(r.sent(),tx(ty("".concat(eD," ").concat(n))))];case 3:return[2,tx(ty(t))];case 4:throw new Error("Unsupported command type");case 5:return[2]}})})()}I(eJ,"buildCommand");function e$(e,t,n){return function(){return s(function(){return m(this,function(r){return[2,eJ(e,t,n)]})})()}}I(e$,"commandFactory");var eV={simpleGitHooks:e$(_.CLI,eM,eP),eslintInspect:e$(_.CLI,eA,eF),nodeModulesInspect:e$(_.CLI,eU,eB),eslintCheck:e$(_.CLI,eI,"".concat(ew," ").concat(eY.WORKING_DIRECTORY," --no-cache")),eslintFix:e$(_.CLI,eI,"".concat(ew," ").concat(eY.WORKING_DIRECTORY," --fix --no-cache")),typescriptCheck:e$(_.CLI,e_,"".concat(eN," -p ").concat(eY.TS_CONFIG," --noEmit")),configureGitHook:e$(_.STRING,"".concat(eL," config core.hooksPath ").concat(eY.GIT_HOOK)),testUnit:e$(_.CLI,eE,"".concat(eO," --config ").concat(eY.UNIT_TEST_CONFIG)),testE2e:e$(_.CLI,"".concat(eE," ").concat(eS),"".concat(eO," --config ").concat(eY.E2E_TEST_CONFIG)),mongoMigrateCreate:I(function(e){return e$(_.CLI,eK,"".concat(eR," ").concat(eW," create ").concat(e," -f ").concat(eY.MIGRATE_MONGO_CONFIG))()},"mongoMigrateCreate"),mongoMigrateUp:e$(_.CLI,eK,"".concat(eR," ").concat(eW," up -f ").concat(eY.MIGRATE_MONGO_CONFIG)),mongoMigrateDown:e$(_.CLI,eK,"".concat(eR," ").concat(eW," down -f ").concat(eY.MIGRATE_MONGO_CONFIG)),commitLint:e$(_.CLI,eC,"".concat(ek," --edit ").concat(eY.GIT_COMMIT_MSG," --config ").concat(eY.COMMITLINT_CONFIG)),lintStaged:e$(_.CLI,eT,"".concat(eG," --config ").concat(eY.LINT_STAGED_CONFIG)),stageBuildDirectory:e$(_.STRING,"".concat(eL," add ").concat(eu)),build:e$(_.STRING,"".concat(eq," run build")),pnpmInstallStandard:e$(_.STRING,"".concat(eq," install")),pnpmInstallLegacy:e$(_.STRING,"".concat(eq," install --legacy-peer-deps")),pnpmInstallForce:e$(_.STRING,"".concat(eq," install --force"))};var ez=Z.default,eQ=ez.lstatSync,eX=ez.readdirSync,eZ=ez.mkdirSync,e0=ez.readFileSync,e1=ez.unlinkSync,e2=ez.statSync,e4=Z.default.readJsonSync;function e3(e,t,n){Z.default.writeFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}I(e3,"writeFileSync");function e5(e,t,n){Z.default.appendFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}I(e5,"appendFileSync");function e8(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return t.every(function(e){return Z.default.pathExistsSync(e)})}I(e8,"pathExistsSync");function e6(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}t.forEach(function(e){e8(e)&&Z.default.removeSync(e)})}I(e6,"removeSync");var e7=K();function e9(e){var t=es(e7.CWD,el);if(!e8(t))return!1;try{var n=e4(t),r=n.name,s=n.dependencies,i=s===void 0?{}:s,o=n.devDependencies,a=o===void 0?{}:o,c=r===e,u=e in i,l=e in a;return c||u||l?{path:t,file:n,isCurrentProject:c,isDepend:u,isDevDepend:l}:!1}catch(e){return z.warn("Failed to read package.json: ".concat(e.message)),!1}}I(e9,"getPackage");function te(e){return s(function(){var t,n,r,s;return m(this,function(i){switch(i.label){case 0:i.trys.push([0,3,,4]);return[4,(0,X.default)("https://registry.npmjs.org/".concat(e,"/latest"))];case 1:t=i.sent();if(!t.ok)throw new Error("Failed to fetch latest version: ".concat(t.status," ").concat(t.statusText));return[4,t.json()];case 2:n=i.sent(),r=n.version;return[2,r];case 3:s=i.sent();throw z.error('Failed to fetch version for "'.concat(e,'": ').concat(s.message)),s;case 4:return[2]}})})()}I(te,"getLatestPackageVersion");function tt(e,t){return s(function(){var n,r,s,i,o,a,c,u,d,f,p,g,v,y,h,x,j,b,I,w,E;return m(this,function(m){switch(m.label){case 0:m.trys.push([0,4,,5]);n=e9(e);if(!n)return[2,l({},Q)];c=n.path,u=n.file,d=n.isCurrentProject,f=n.isDepend,p=n.isDevDepend,g=(r=u.dependencies)!==null&&r!==void 0?r:{},v=(s=u.devDependencies)!==null&&s!==void 0?s:{},y=d?(i=u.version)!==null&&i!==void 0?i:"0.0.0":f?(o=g[e])!==null&&o!==void 0?o:"0.0.0":p?(a=v[e])!==null&&a!==void 0?a:"0.0.0":"0.0.0";if(!d)return[3,1];j=y;return[3,3];case 1:return[4,te(e)];case 2:j=m.sent();m.label=3;case 3:h=j,x=d||y===h;if(!x&&(t===null||t===void 0?void 0:t.update)){;I=f?"dependencies":p?"devDependencies":null;I&&((b=u[I])===null||b===void 0?void 0:b[e])!==h&&(u[I]=(w=u[I])!==null&&w!==void 0?w:{},u[I][e]=h,e3(c,JSON.stringify(u,null,4)),z.info('Updated "'.concat(e,'" to version ').concat(h)))}return[2,{isCurrentProject:d,installedPath:c,file:u,isUpToDate:x}];case 4:E=m.sent();return[2,(z.error('Error checking package "'.concat(e,'": ').concat(E.message)),l({},Q))];case 5:return[2]}})})()}I(tt,"checkPackage");function tn(){return s(function(){var e,t,n,r,s,i,o,a,c,u,l,d;return m(this,function(f){switch(f.label){case 0:e=[{command:I(function(){return eV.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:I(function(){return eV.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:I(function(){return eV.pnpmInstallForce()},"command"),message:"Retrying with force install"}];t=true,n=false,r=undefined;f.label=1;case 1:f.trys.push([1,9,10,11]);s=e[Symbol.iterator]();f.label=2;case 2:if(!!(t=(i=s.next()).done))return[3,8];o=i.value,a=o.command,c=o.message;f.label=3;case 3:f.trys.push([3,6,,7]);return[4,a()];case 4:u=f.sent();return[4,tb("".concat(c," using: ").concat(u),u)];case 5:f.sent();return[2];case 6:l=f.sent();z.warn("Installation attempt failed: ".concat(c)),z.error("Details: ".concat(l.message));return[3,7];case 7:t=true;return[3,2];case 8:return[3,11];case 9:d=f.sent();n=true;r=d;return[3,11];case 10:try{if(!t&&s.return!=null){s.return()}}finally{if(n){throw r}}return[7];case 11:throw new Error("All dependency installation strategies failed.")}})})()}I(tn,"installDependencies");function tr(e,t){return s(function(){var n,r,s,i,o,a,c,u,d,p,g;return m(this,function(m){switch(m.label){case 0:if(!e8(eY.PACKAGE_JSON)){z.error("package.json not found. Aborting setup.");return[2]}m.label=1;case 1:m.trys.push([1,13,,14]);n=f(new Set(e)).sort();return[4,Promise.all(n.map(function(e){return tt(e,l({},(t===null||t===void 0?void 0:t.update)&&{update:t.update}))}))];case 2:r=m.sent().every(function(e){return e.isUpToDate});if(r)return[3,4];return[4,tn()];case 3:r=m.sent();m.label=4;case 4:r;i=true,o=false,a=undefined;m.label=5;case 5:m.trys.push([5,10,11,12]);c=((s=t===null||t===void 0?void 0:t.postInstallActions)!==null&&s!==void 0?s:[])[Symbol.iterator]();m.label=6;case 6:if(!!(i=(u=c.next()).done))return[3,9];d=u.value;return[4,d()];case 7:m.sent();m.label=8;case 8:i=true;return[3,6];case 9:return[3,12];case 10:p=m.sent();o=true;a=p;return[3,12];case 11:try{if(!i&&c.return!=null){c.return()}}finally{if(o){throw a}}return[7];case 12:return[3,14];case 13:g=m.sent();throw z.error('Failed to setup "'.concat(e.join(", "),'": ').concat(g.message)),g;case 14:return[2]}})})()}I(tr,"setupPackages");var ts=E(require("node-persist"),1);var ti=K();function to(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=ts.default.defaultInstance;if(e)return[3,2];return[4,ts.default.init({dir:ti.CYBERSKILL_STORAGE_DIRECTORY,stringify:JSON.stringify,parse:JSON.parse,encoding:"utf8",logging:!1,forgiveParseErrors:!0})];case 1:e=t.sent();t.label=2;case 2:e;return[2]}})})()}I(to,"initNodePersist");var ta={get:function e(e){return s(function(){var t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,to()];case 1:r.sent();return[4,ts.default.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,(z.error('[Storage:get] Error getting key "'.concat(e,'":'),n),null)];case 4:return[2]}})})()},set:function e(e,t){return s(function(){var n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,to()];case 1:r.sent();return[4,ts.default.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();z.error('[Storage:set] Error setting key "'.concat(e,'":'),n);return[3,4];case 4:return[2]}})})()},remove:function e(e){return s(function(){var t;return m(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,to()];case 1:n.sent();return[4,ts.default.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();z.error('[Storage:remove] Error removing key "'.concat(e,'":'),t);return[3,4];case 4:return[2]}})})()},keys:function e(){return s(function(){var e,t;return m(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,to()];case 1:n.sent();return[4,ts.default.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:(z.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,(z.error("[Storage:keys] Error getting keys:",t),[])];case 4:return[2]}})})()},getLogLink:function e(e){return s(function(){return m(this,function(t){try{return[2,"".concat(ti.CYBERSKILL_STORAGE_DIRECTORY," (key: ").concat(e,")")]}catch(e){return[2,(z.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var tc=K(),tu=L.promisify(N.exec);function tl(e){return"error_list:".concat(e)}I(tl,"getErrorListKey");function td(e){return s(function(){var t,n,r;return m(this,function(i){switch(i.label){case 0:if(e.length===0)return[2];t=Date.now(),n=tl(t);i.label=1;case 1:i.trys.push([1,3,,4]);return[4,ta.set(n,{errors:e,timestamp:t})];case 2:i.sent(),setTimeout(function(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,ta.getLogLink(n)];case 1:e=t.sent();e&&z.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})})()},10);return[3,4];case 3:r=i.sent();z.error("Failed to save errors: ".concat(r.message));return[3,4];case 4:return[2]}})})()}I(td,"saveErrorListToStorage");function tf(){return s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,ta.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(function(e){return s(function(){var t;return m(this,function(n){switch(n.label){case 0:return[4,ta.get(e)];case 1:return[2,((t=n.sent())===null||t===void 0?void 0:t.errors)||[]]}})})()}))];case 2:return[2,r.sent().flat()];case 3:n=r.sent();return[2,(z.error("Failed to retrieve stored errors: ".concat(n.message)),[])];case 4:return[2]}})})()}I(tf,"getStoredErrorLists");function tp(){return s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,ta.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(function(e){return ta.remove(e)}))];case 2:r.sent();return[3,4];case 3:n=r.sent();z.error("Failed to clear error lists: ".concat(n.message));return[3,4];case 4:return[2]}})})()}I(tp,"clearAllErrorLists");function tg(e){var t=[],n=[],r="",s=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,i=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,o=/^✖\s+(.*?)\s+\[(.*?)\]$/;e.split("\n").forEach(function(e){if(e.startsWith("/"))r=e.trim();else{var a,c,u,l,d;var f=s.exec(e)||[],p=i.exec(e)||[],g=o.exec(e)||[];var m,v,y,h,x,j;f.length&&r?t.push({file:r,position:"".concat(f[1],":").concat(f[2]),type:f[3]===W.Error?W.Error:W.Warning,message:(m=f===null||f===void 0?void 0:(a=f[4])===null||a===void 0?void 0:a.trim())!==null&&m!==void 0?m:"",rule:(v=f===null||f===void 0?void 0:(c=f[5])===null||c===void 0?void 0:c.trim())!==null&&v!==void 0?v:""}):p.length?t.push({file:(y=p===null||p===void 0?void 0:p[1])!==null&&y!==void 0?y:"",position:"".concat(p[2],":").concat(p[3]),type:p[4]===W.Error?W.Error:W.Warning,message:(h=p===null||p===void 0?void 0:(u=p[5])===null||u===void 0?void 0:u.trim())!==null&&h!==void 0?h:""}):g.length?t.push({file:"commitlint",type:W.Error,message:(x=g===null||g===void 0?void 0:(l=g[1])===null||l===void 0?void 0:l.trim())!==null&&x!==void 0?x:"",rule:(j=g===null||g===void 0?void 0:(d=g[2])===null||d===void 0?void 0:d.trim())!==null&&j!==void 0?j:""}):n.push(e.trim())}}),t.length&&td(t),tc.DEBUG&&n.length&&(z.warn("Unmatched lines:"),n.forEach(function(e){return z.info(" ".concat(e))}))}I(tg,"parseTextErrors");function tm(e){try{var t=JSON.parse(e),n=[];t.forEach(function(e){var t=e.filePath,r=e.messages;r.forEach(function(e){var r=e.severity,s=e.line,i=e.column,o=e.ruleId,a=e.message;n.push({type:r===2?W.Error:W.Warning,file:t,position:"".concat(s,":").concat(i),rule:o,message:a})})}),n.length&&td(n)}catch(t){tg(e)}}I(tm,"parseCommandOutput");function tv(e){return s(function(e){var t,n,r,s,i,o,a,c,u;var l=arguments;return m(this,function(d){switch(d.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:tm;n=new AbortController;R.default.on("SIGINT",function(){z.warn("Process interrupted. Terminating..."),n.abort(),R.default.exit()});d.label=1;case 1:d.trys.push([1,4,,5]);if(!(typeof e=="string"))return[3,3];return[4,tu(e,{maxBuffer:0x6400000,signal:n.signal})];case 2:r=d.sent(),s=r.stdout,i=r.stderr;[s,i].forEach(function(e){return e&&t(e)});d.label=3;case 3:return[3,5];case 4:o=d.sent();a=o.stdout,c=o.stderr,u=o.message;[a,c].forEach(function(e){return e&&t(e)}),!c&&!a&&z.error("Command failed: ".concat(u));return[3,5];case 5:return[2]}})}).apply(this,arguments)}I(tv,"executeCommand");function ty(e){return{raw:!0,cmd:e}}I(ty,"rawCommand");function th(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(eD," ").concat(ea," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(eD," ").concat(eR," ").concat(eb," ").concat(e):"".concat(eD," ").concat(ej," ").concat(e)}I(th,"formatCLI");function tx(e,t){return typeof e=="function"?th(e(t),t):(typeof e==="undefined"?"undefined":p(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?th(e,t):e}I(tx,"formatCommand");function tj(e){return s(function(e){var t,n,r,s,i,o,a;var c=arguments;return m(this,function(u){switch(u.label){case 0:t=c.length>1&&c[1]!==void 0?c[1]:{};r=(n=t===null||t===void 0?void 0:t.isRemote)!==null&&n!==void 0?n:!1;if(!r)return[3,1];a=!1;return[3,3];case 1:return[4,tt(ea)];case 2:a=u.sent().isCurrentProject;u.label=3;case 3:s=a,i={isRemote:r,isCurrentProject:s},o=typeof e=="function"?e(i):e;return[2,Object.fromEntries(Object.entries(o).map(function(e){var t=d(e,2),n=t[0],r=t[1];return[n,tx(r,i)]}))]}})}).apply(this,arguments)}I(tj,"resolveCommands");function tb(e,t){return s(function(){var n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);z.start("".concat(e)),tc.DEBUG&&z.info("→ ".concat(t));return[4,tv(t)];case 1:r.sent(),z.success("".concat(e," done."));return[3,3];case 2:n=r.sent();throw z.error("".concat(e," failed: ").concat(n.message)),n;case 3:return[2]}})})()}I(tb,"runCommand");function tI(){return s(function(){var e,t;return m(this,function(n){switch(n.label){case 0:if(!e8(eY.TS_CONFIG))return[3,3];t=["Performing TypeScript validation"];return[4,eV.typescriptCheck()];case 1:return[4,tb.apply(void 0,t.concat([n.sent()]))];case 2:e=n.sent();return[3,4];case 3:e=z.warn("No TypeScript configuration found. Skipping type check.");n.label=4;case 4:e;return[2]}})})()}I(tI,"checkTypescript");function tw(){return s(function(){var e,t,n,r;var s=arguments;return m(this,function(i){switch(i.label){case 0:e=s.length>0&&s[0]!==void 0?s[0]:!1;if(!e)return[3,3];n=["Running ESLint with auto-fix"];return[4,eV.eslintFix()];case 1:return[4,tb.apply(void 0,n.concat([i.sent()]))];case 2:t=i.sent();return[3,6];case 3:r=["Running ESLint check"];return[4,eV.eslintCheck()];case 4:return[4,tb.apply(void 0,r.concat([i.sent()]))];case 5:t=i.sent();i.label=6;case 6:t;return[2]}})}).apply(this,arguments)}I(tw,"checkEslint");function tE(e,t){if(!t.length)return;var n=e==="Errors"?"red":"yellow";z.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,n)}I(tE,"printIssues");function tS(){return s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:return[4,tf()];case 1:e=r.sent(),t=e.filter(function(e){return e.type===W.Error}),n=e.filter(function(e){return e.type===W.Warning});!t.length&&!n.length?z.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(tE("Warnings",n),tE("Errors",t),(t.length>0||n.length>0)&&C.default.exit(1));return[2]}})})()}I(tS,"showCheckResult");function tO(){return s(function(){var e,t,n,r,s,i;return m(this,function(o){switch(o.label){case 0:return[4,tp()];case 1:o.sent();return[4,tt(ea)];case 2:e=o.sent(),t=e.isCurrentProject;if(!t)return[3,9];o.label=3;case 3:o.trys.push([3,8,,9]);n=["Building package: ".concat(ea)];return[4,eV.build()];case 4:return[4,tb.apply(void 0,n.concat([o.sent()]))];case 5:o.sent();r=["Staging build artifacts"];return[4,eV.stageBuildDirectory()];case 6:return[4,tb.apply(void 0,r.concat([o.sent()]))];case 7:o.sent();return[3,9];case 8:s=o.sent();throw z.error("Error building and staging ".concat(ea,": ").concat(s.message)),s;case 9:i=["Executing lint-staged"];return[4,eV.lintStaged()];case 10:return[4,tb.apply(void 0,i.concat([o.sent()]))];case 11:o.sent(),tS();return[2]}})})()}I(tO,"lintStaged");function tC(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Inspecting ESLint configuration"];return[4,eV.eslintInspect()];case 1:return[4,tb.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}I(tC,"inspectLint");function tk(){return s(function(){return m(this,function(e){switch(e.label){case 0:return[4,tp()];case 1:e.sent();return[4,Promise.all([tI(),tw()])];case 2:e.sent(),tS();return[2]}})})()}I(tk,"lintCheck");function tT(){return s(function(){return m(this,function(e){switch(e.label){case 0:return[4,tp()];case 1:e.sent();return[4,Promise.all([tI(),tw(!0)])];case 2:e.sent(),tS();return[2]}})})()}I(tT,"lintFix");function tG(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,tp()];case 1:t.sent();e=["Validating commit message"];return[4,eV.commitLint()];case 2:return[4,tb.apply(void 0,e.concat([t.sent()]))];case 3:t.sent(),tS();return[2]}})})()}I(tG,"commitLint");function t_(){return s(function(){var e,t,n,r;return m(this,function(s){switch(s.label){case 0:e=["Configuring Git hooks"];return[4,eV.configureGitHook()];case 1:return[4,tb.apply(void 0,e.concat([s.sent()]))];case 2:s.sent(),e6(eY.GIT_HOOK);return[4,tj(eH)];case 3:t=s.sent();e3(eY.SIMPLE_GIT_HOOKS_JSON,JSON.stringify(t,null,4));n="\n".concat(eg,"\n");e8(eY.GIT_IGNORE)?e0(eY.GIT_IGNORE,"utf-8").split("\n").includes(eg)||e5(eY.GIT_IGNORE,n):e3(eY.GIT_IGNORE,n);r=["Setting up simple-git-hooks"];return[4,eV.simpleGitHooks()];case 4:return[4,tb.apply(void 0,r.concat([s.sent()]))];case 5:s.sent();return[2]}})})()}I(t_,"setupGitHook");function tN(){return s(function(){return m(this,function(e){switch(e.label){case 0:return[4,tr([ea],{update:!0,postInstallActions:[t_]})];case 1:e.sent();return[2]}})})()}I(tN,"setup");function tR(){return s(function(){return m(this,function(e){switch(e.label){case 0:e6(eY.NODE_MODULES,eY.PNPM_LOCK_YAML);return[4,tn()];case 1:e.sent();return[4,t_()];case 2:e.sent();return[2]}})})()}I(tR,"reset");function tL(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Inspecting project dependencies"];return[4,eV.nodeModulesInspect()];case 1:return[4,tb.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}I(tL,"inspect");function tq(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running unit tests"];return[4,eV.testUnit()];case 1:return[4,tb.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}I(tq,"testUnit");function tD(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running end-to-end tests"];return[4,eV.testE2e()];case 1:return[4,tb.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}I(tD,"testE2E");function tM(e){return s(function(){var t;return m(this,function(n){switch(n.label){case 0:t=["Creating MongoDB migration"];return[4,eV.mongoMigrateCreate(e)];case 1:return[4,tb.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})})()}I(tM,"mongoMigrateCreate");function tP(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running MongoDB migrations"];return[4,eV.mongoMigrateUp()];case 1:return[4,tb.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}I(tP,"mongoMigrateUp");function tA(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Rolling back MongoDB migration"];return[4,eV.mongoMigrateDown()];case 1:return[4,tb.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}I(tA,"mongoMigrateDown");(function(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,(0,T.default)((0,k.hideBin)(C.default.argv)).scriptName(ej).usage("$0 <command> [options]").command("lint","Check code for linting issues",tk).command("lint:fix","Fix linting issues automatically",tT).command("lint:inspect","View active ESLint configuration",tC).command("lint-staged","Run lint checks on staged files",tO).command("commitlint","Validate commit message format",tG).command("setup","Initialize project setup and dependencies",tN).command("reset","Reset the project and reinstall dependencies",tR).command("inspect","Analyze installed project dependencies",tL).command("test:unit","Run unit test suite",tq).command("test:e2e","Run end-to-end test suite",tD).command("mongo:migrate:create <name>","Create a MongoDB migration",function(e){return e.positional("name",{describe:"Migration name",type:"string"})},function(e){return s(function(){return m(this,function(t){switch(t.label){case 0:if(!e.name){z.error("Migration name is required.");return[2]}return[4,tM(e.name)];case 1:t.sent();return[2]}})})()}).command("mongo:migrate:up","Apply all MongoDB migrations",tP).command("mongo:migrate:down","Rollback last MongoDB migration",tA).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(G.version).epilog('\uD83D\uDCA1 Tip: Use "--help" with any command to see options\n').parse()];case 1:t.sent();return[3,3];case 2:e=t.sent();z.error("Fatal: ".concat(e.message)),C.default.exit(1);return[3,3];case 3:return[2]}})})()})();
|
package/dist/nodejs/cli/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(e,t){if(t==null||t>e.length)t=e.length;for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function t(e){if(Array.isArray(e))return e}function n(t){if(Array.isArray(t))return e(t)}function r(e,t,n,r,s,i,o){try{var c=e[i](o);var a=c.value}catch(e){n(e);return}if(c.done){t(a)}else{Promise.resolve(a).then(r,s)}}function s(e){return function(){var t=this,n=arguments;return new Promise(function(s,i){var o=e.apply(t,n);function c(e){r(o,s,i,c,a,"next",e)}function a(e){r(o,s,i,c,a,"throw",e)}c(undefined)})}}function i(e,t,n){if(t in e){Object.defineProperty(e,t,{value:n,enumerable:true,configurable:true,writable:true})}else{e[t]=n}return e}function o(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function c(e,t){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var r=[];var s=true;var i=false;var o,c;try{for(n=n.call(e);!(s=(o=n.next()).done);s=true){r.push(o.value);if(t&&r.length===t)break}}catch(e){i=true;c=e}finally{try{if(!s&&n["return"]!=null)n["return"]()}finally{if(i)throw c}}return r}function a(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};var r=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))}r.forEach(function(t){i(e,t,n[t])})}return e}function d(e,n){return t(e)||c(e,n)||g(e,n)||a()}function p(e){return n(e)||o(e)||g(e)||u()}function f(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function g(t,n){if(!t)return;if(typeof t==="string")return e(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return e(t,n)}function m(e,t){var n,r,s,i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},o=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return o.next=c(0),o["throw"]=c(1),o["return"]=c(2),typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function c(e){return function(t){return a([e,t])}}function a(c){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,c[0]&&(i=0)),i)try{if(n=1,r&&(s=c[0]&2?r["return"]:c[0]?r["throw"]||((s=r["return"])&&s.call(r),0):r.next)&&!(s=s.call(r,c[1])).done)return s;if(r=0,s)c=[c[0]&2,s.value];switch(c[0]){case 0:case 1:s=c;break;case 4:i.label++;return{value:c[1],done:false};case 5:i.label++;r=c[1];c=[0];continue;case 7:c=i.ops.pop();i.trys.pop();continue;default:if(!(s=i.trys,s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){i=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){i.label=c[1];break}if(c[0]===6&&i.label<s[1]){i.label=s[1];s=c;break}if(s&&i.label<s[2]){i.label=s[2];i.ops.push(c);break}if(s[2])i.ops.pop();i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e];r=0}finally{n=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}}var y=Object.defineProperty;var v=function(e,t){return y(e,"name",{value:t,configurable:!0})};import h from"node:process";import{hideBin as x}from"yargs/helpers";import j from"yargs/yargs";var b={name:"@cyberskill/shared",type:"module",version:"1.126.0",description:"CyberSkill Shared",author:"Stephen Cheng",license:"MIT",homepage:"https://github.com/cyberskill-world/shared#readme",repository:{type:"git",url:"git+https://github.com/cyberskill-world/shared.git"},bugs:{url:"https://github.com/cyberskill-world/shared/issues"},exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./configs":{types:"./dist/configs/index.d.ts",import:"./dist/configs/index.js",require:"./dist/configs/index.cjs"},"./configs/commitlint":{types:"./dist/configs/commitlint/index.d.ts",import:"./dist/configs/commitlint/index.js",require:"./dist/configs/commitlint/index.cjs"},"./configs/env":{types:"./dist/configs/env/index.d.ts",import:"./dist/configs/env/index.js",require:"./dist/configs/env/index.cjs"},"./configs/eslint":{types:"./dist/configs/eslint/index.d.ts",import:"./dist/configs/eslint/index.js",require:"./dist/configs/eslint/index.cjs"},"./configs/graphql-codegen":{types:"./dist/configs/graphql-codegen/index.d.ts",import:"./dist/configs/graphql-codegen/index.js",require:"./dist/configs/graphql-codegen/index.cjs"},"./configs/lint-staged":{types:"./dist/configs/lint-staged/index.d.ts",import:"./dist/configs/lint-staged/index.js",require:"./dist/configs/lint-staged/index.cjs"},"./constants":{types:"./dist/constants/index.d.ts",import:"./dist/constants/index.js",require:"./dist/constants/index.cjs"},"./nodejs":{types:"./dist/nodejs/index.d.ts",import:"./dist/nodejs/index.js",require:"./dist/nodejs/index.cjs"},"./nodejs/apollo-server":{types:"./dist/nodejs/apollo-server/index.d.ts",import:"./dist/nodejs/apollo-server/index.js",require:"./dist/nodejs/apollo-server/index.cjs"},"./nodejs/cli":{types:"./dist/nodejs/cli/index.d.ts",import:"./dist/nodejs/cli/index.js",require:"./dist/nodejs/cli/index.cjs"},"./nodejs/command":{types:"./dist/nodejs/command/index.d.ts",import:"./dist/nodejs/command/index.js",require:"./dist/nodejs/command/index.cjs"},"./nodejs/express":{types:"./dist/nodejs/express/index.d.ts",import:"./dist/nodejs/express/index.js",require:"./dist/nodejs/express/index.cjs"},"./nodejs/fs":{types:"./dist/nodejs/fs/index.d.ts",import:"./dist/nodejs/fs/index.js",require:"./dist/nodejs/fs/index.cjs"},"./nodejs/log":{types:"./dist/nodejs/log/index.d.ts",import:"./dist/nodejs/log/index.js",require:"./dist/nodejs/log/index.cjs"},"./nodejs/mongo":{types:"./dist/nodejs/mongo/index.d.ts",import:"./dist/nodejs/mongo/index.js",require:"./dist/nodejs/mongo/index.cjs"},"./nodejs/package":{types:"./dist/nodejs/package/index.d.ts",import:"./dist/nodejs/package/index.js",require:"./dist/nodejs/package/index.cjs"},"./nodejs/path":{types:"./dist/nodejs/path/index.d.ts",import:"./dist/nodejs/path/index.js",require:"./dist/nodejs/path/index.cjs"},"./nodejs/storage":{types:"./dist/nodejs/storage/index.d.ts",import:"./dist/nodejs/storage/index.js",require:"./dist/nodejs/storage/index.cjs"},"./nodejs/ws":{types:"./dist/nodejs/ws/index.d.ts",import:"./dist/nodejs/ws/index.js",require:"./dist/nodejs/ws/index.cjs"},"./react":{types:"./dist/react/index.d.ts",import:"./dist/react/index.js",require:"./dist/react/index.cjs"},"./react/apollo-client":{types:"./dist/react/apollo-client/index.d.ts",import:"./dist/react/apollo-client/index.js",require:"./dist/react/apollo-client/index.cjs"},"./react/apollo-error":{types:"./dist/react/apollo-error/index.d.ts",import:"./dist/react/apollo-error/index.js",require:"./dist/react/apollo-error/index.cjs"},"./react/i18next":{types:"./dist/react/i18next/index.d.ts",import:"./dist/react/i18next/index.js",require:"./dist/react/i18next/index.cjs"},"./react/loading":{types:"./dist/react/loading/index.d.ts",import:"./dist/react/loading/index.js",require:"./dist/react/loading/index.cjs"},"./react/log":{types:"./dist/react/log/index.d.ts",import:"./dist/react/log/index.js",require:"./dist/react/log/index.cjs"},"./react/next-intl":{types:"./dist/react/next-intl/index.d.ts",import:"./dist/react/next-intl/index.js",require:"./dist/react/next-intl/index.cjs"},"./react/storage":{types:"./dist/react/storage/index.d.ts",import:"./dist/react/storage/index.js",require:"./dist/react/storage/index.cjs"},"./react/toast":{types:"./dist/react/toast/index.d.ts",import:"./dist/react/toast/index.js",require:"./dist/react/toast/index.cjs"},"./react/vitest":{types:"./dist/react/vitest/index.d.ts",import:"./dist/react/vitest/index.js",require:"./dist/react/vitest/index.cjs"},"./styles/reset.css":{import:"./dist/styles/reset.css",require:"./dist/styles/reset.css"},"./typescript":{types:"./dist/typescript/index.d.ts",import:"./dist/typescript/index.js",require:"./dist/typescript/index.cjs"},"./utils":{types:"./dist/utils/index.d.ts",import:"./dist/utils/index.js",require:"./dist/utils/index.cjs"}},main:"./dist/index.cjs",module:"./dist/index.js",types:"./dist/index.d.ts",bin:{cyberskill:"./dist/nodejs/cli/index.js"},files:["dist","public"],scripts:{build:"tsup",dev:"tsup --watch",lint:"tsx src/nodejs/cli/index.ts lint","lint:fix":"tsx src/nodejs/cli/index.ts lint:fix","lint:inspect":"tsx src/nodejs/cli/index.ts lint:inspect",reset:"tsx src/nodejs/cli/index.ts reset",setup:"tsx src/nodejs/cli/index.ts setup",inspect:"tsx src/nodejs/cli/index.ts inspect","test:unit":"tsx src/nodejs/cli/index.ts test:unit","test:e2e":"tsx src/nodejs/cli/index.ts test:e2e",commitlint:"tsx src/nodejs/cli/index.ts commitlint","lint-staged":"tsx src/nodejs/cli/index.ts lint-staged"},dependencies:{"@antfu/eslint-config":"4.12.0","@apollo/client":"3.13.8","@apollo/server":"4.12.0","@dotenvx/dotenvx":"1.41.0","@eddeee888/gcg-typescript-resolver-files":"0.12.0","@eslint-react/eslint-plugin":"1.48.5","@graphql-codegen/cli":"5.0.5","@graphql-codegen/client-preset":"4.8.0","@microsoft/api-extractor":"7.52.5","@nestjs/common":"11.1.0","@nestjs/core":"11.1.0","@next/eslint-plugin-next":"15.3.1","@testing-library/jest-dom":"6.6.3","@testing-library/react":"16.3.0","@vitejs/plugin-react-swc":"3.9.0","@vitest/browser":"3.1.2","body-parser":"2.2.0",chalk:"5.4.1",classnames:"2.5.1",compression:"1.8.0",consola:"3.4.2","cookie-parser":"1.4.7",cors:"2.8.5","crypto-js":"4.2.0","date-fns":"4.1.0","dotenv-cli":"8.0.0",envalid:"8.0.0","eslint-config-next":"15.3.1","eslint-plugin-format":"1.0.1","eslint-plugin-react-hooks":"5.2.0","eslint-plugin-react-refresh":"0.4.20",express:"4.21.2","express-session":"1.18.1","express-useragent":"1.0.15","fs-extra":"11.3.0",globals:"16.0.0",graphql:"16.11.0","graphql-ws":"6.0.4",i18next:"25.0.2",jsdom:"26.1.0",localforage:"1.10.0","migrate-mongo":"12.1.3","modern-normalize":"3.0.1",mongodb:"6.16.0",mongoose:"8.14.1","mongoose-aggregate-paginate-v2":"1.1.4","mongoose-paginate-v2":"1.9.0","next-intl":"4.1.0","node-fetch":"3.3.2","node-persist":"4.0.4",playwright:"1.52.0","postcss-modules":"6.0.1",qs:"6.14.0",react:"19.1.0","react-dom":"19.1.0","react-hot-toast":"2.5.2","react-i18next":"15.5.1","react-icons":"5.5.0",sass:"1.87.0",slugify:"1.6.6",tsup:"8.4.0",tsx:"4.19.4",typescript:"5.8.3",unorm:"1.6.0",uuid:"11.1.0",vite:"6.3.3",vitest:"3.1.2","vitest-browser-react":"0.1.1",ws:"8.18.1",yargs:"17.7.2"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},devDependencies:{"@commitlint/cli":"19.8.0","@eslint/config-inspector":"1.0.2","@types/body-parser":"1.19.5","@types/compression":"1.7.5","@types/cookie-parser":"1.4.8","@types/cors":"2.8.17","@types/crypto-js":"4.2.2","@types/express":"4.17.21","@types/express-session":"1.18.1","@types/express-useragent":"1.0.5","@types/fs-extra":"11.0.4","@types/migrate-mongo":"10.0.5","@types/mongoose-aggregate-paginate-v2":"1.0.12","@types/node":"22.15.3","@types/node-persist":"3.1.8","@types/react":"19.1.2","@types/react-dom":"19.1.2","@types/unorm":"1.3.31","@types/uuid":"10.0.0","@types/ws":"8.18.1","@types/yargs":"17.0.33",eslint:"9.25.1","lint-staged":"15.5.1","node-modules-inspector":"0.6.7","simple-git-hooks":"2.13.0"}};var I=function(e){return e.CLI="CLI",e.STRING="STRING",e.FUNCTION="FUNCTION",e}({});import{exec as w}from"node:child_process";import E from"node:process";import*as S from"node:util";var C=".cyberskill-storage";import O from"@dotenvx/dotenvx";import{bool as k,cleanEnv as T,str as G}from"envalid";import _ from"node:os";import N from"node:path";import R from"node:process";var L=!1;function D(){L||(O.config(),L=!0)}v(D,"loadEnvFile");function M(){D();var e=T(R.env,{CWD:G({default:R.cwd()}),DEBUG:k({default:!1}),CYBERSKILL_STORAGE_DIRECTORY:G({default:N.join(_.homedir(),C)})});return{CWD:e.CWD,DEBUG:e.DEBUG,CYBERSKILL_STORAGE_DIRECTORY:e.CYBERSKILL_STORAGE_DIRECTORY}}v(M,"getEnv");var A=function(e){return e.Error="error",e.Warning="warning",e}({});import P from"chalk";import q from"consola";import{GraphQLError as F}from"graphql";var U=M();U.DEBUG||(q.level=4);function B(e){var t=P[e];return typeof t=="function"?t:P.green}v(B,"chalkKeyword");var K={silent:q.silent,level:q.level,fatal:q.fatal,error:q.error,warn:q.warn,log:q.log,info:q.info,success:q.success,ready:q.ready,start:q.start,box:q.box,debug:q.debug,trace:q.trace,verbose:q.verbose,printBoxedLog:function e(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(t===null||t===void 0?void 0:t.length)){q.box(P.green(e));return}t.forEach(function(e){var t=e.file,r=e.position,s=e.rule,i=e.message;q.log("".concat(P.gray("File:")," ").concat(P.blue("".concat(t).concat(r?":".concat(r):"")))),s&&q.log(" ".concat(B(n)("Rule:")," ").concat(s)),q.log(" ".concat(B(n)("Message:")," ").concat(i))}),q.box(B(n)("".concat(e," : ").concat(t.length))),q.log(P.gray("─".repeat(40)))}};var W={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};import Y from"node-fetch";import H from"fs-extra";import J from"node:path";var $=M(),V=J;function z(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=V).resolve.apply(r,[$.CWD].concat(p(t)))}v(z,"resolveWorkingPath");function Q(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=V).join.apply(r,p(t))}v(Q,"join");var X=M(),Z=X.CWD,ee="@cyberskill/shared",et="node_modules",en="dist",er="package.json",es="package-lock.json",ei="tsconfig.json",eo=".gitignore",ec=".simple-git-hooks.json",ea="pnpm-lock.yaml",eu=".git/hooks/",el=".git/COMMIT_EDITMSG",ed=".migrate-mongo.config.js",ep=Q(Z,et,ee,en),ef="cyberskill",eg="src/nodejs/cli/index.ts",em="eslint",ey="eslint",ev="vitest",eh="playwright",ex="vitest",ej="@commitlint/cli",eb="commitlint",eI="lint-staged",ew="lint-staged",eE="typescript",eS="tsc",eC="tsx",eO="git",ek="pnpm",eT="pnpm exec",eG="simple-git-hooks",e_="simple-git-hooks",eN="@eslint/config-inspector",eR="eslint-config-inspector",eL="node-modules-inspector",eD="node-modules-inspector",eM="migrate-mongo",eA="./node_modules/migrate-mongo/bin/migrate-mongo",eP={CYBERSKILL_DIRECTORY:ep,WORKING_DIRECTORY:Z,TS_CONFIG:z(ei),GIT_IGNORE:z(eo),GIT_HOOK:z(eu),GIT_COMMIT_MSG:z(el),SIMPLE_GIT_HOOKS_JSON:z(ec),PACKAGE_JSON:z(er),PACKAGE_LOCK_JSON:z(es),PNPM_LOCK_YAML:z(ea),NODE_MODULES:z(et),MIGRATE_MONGO_CONFIG:z(ed),LINT_STAGED_CONFIG:z("".concat(ep,"/configs/lint-staged/index.js")),COMMITLINT_CONFIG:z("".concat(ep,"/configs/commitlint/index.js")),UNIT_TEST_CONFIG:z("".concat(ep,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:z("".concat(ep,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:z("".concat(ep,"/react/vitest/vitest.e2e.js"))};function eq(e){var t=e.isCurrentProject;return l({"pre-commit":ew,"commit-msg":eb},t&&{"pre-push":tu("".concat(eO," pull"))})}v(eq,"createGitHooksConfig");function eF(e,t,n){return s(function(){return m(this,function(r){switch(r.label){case 0:if(!t)throw new Error("'first' argument is undefined");switch(e){case I.CLI:return[3,1];case I.STRING:return[3,3]}return[3,4];case 1:return[4,e5(t.split(" "),{update:!0})];case 2:return[2,(r.sent(),td(tu("".concat(eT," ").concat(n))))];case 3:return[2,td(tu(t))];case 4:throw new Error("Unsupported command type");case 5:return[2]}})})()}v(eF,"buildCommand");function eU(e,t,n){return function(){return s(function(){return m(this,function(r){return[2,eF(e,t,n)]})})()}}v(eU,"commandFactory");var eB={simpleGitHooks:eU(I.CLI,eG,e_),eslintInspect:eU(I.CLI,eN,eR),nodeModulesInspect:eU(I.CLI,eL,eD),eslintCheck:eU(I.CLI,em,"".concat(ey," ").concat(eP.WORKING_DIRECTORY," --no-cache")),eslintFix:eU(I.CLI,em,"".concat(ey," ").concat(eP.WORKING_DIRECTORY," --fix --no-cache")),typescriptCheck:eU(I.CLI,eE,"".concat(eS," -p ").concat(eP.TS_CONFIG," --noEmit")),configureGitHook:eU(I.STRING,"".concat(eO," config core.hooksPath ").concat(eP.GIT_HOOK)),testUnit:eU(I.CLI,ev,"".concat(ex," --config ").concat(eP.UNIT_TEST_CONFIG)),testE2e:eU(I.CLI,"".concat(ev," ").concat(eh),"".concat(ex," --config ").concat(eP.E2E_TEST_CONFIG)),mongoMigrateCreate:v(function(e){return eU(I.CLI,eM,"".concat(eC," ").concat(eA," create ").concat(e," -f ").concat(eP.MIGRATE_MONGO_CONFIG))()},"mongoMigrateCreate"),mongoMigrateUp:eU(I.CLI,eM,"".concat(eC," ").concat(eA," up -f ").concat(eP.MIGRATE_MONGO_CONFIG)),mongoMigrateDown:eU(I.CLI,eM,"".concat(eC," ").concat(eA," down -f ").concat(eP.MIGRATE_MONGO_CONFIG)),commitLint:eU(I.CLI,ej,"".concat(eb," --edit ").concat(eP.GIT_COMMIT_MSG," --config ").concat(eP.COMMITLINT_CONFIG)),lintStaged:eU(I.CLI,eI,"".concat(ew," --config ").concat(eP.LINT_STAGED_CONFIG)),stageBuildDirectory:eU(I.STRING,"".concat(eO," add ").concat(en)),build:eU(I.STRING,"".concat(ek," run build")),pnpmInstallStandard:eU(I.STRING,"".concat(ek," install")),pnpmInstallLegacy:eU(I.STRING,"".concat(ek," install --legacy-peer-deps")),pnpmInstallForce:eU(I.STRING,"".concat(ek," install --force"))};var eK=H.lstatSync,eW=H.readdirSync,eY=H.mkdirSync,eH=H.readFileSync,eJ=H.unlinkSync,e$=H.statSync,eV=H.readJsonSync;function ez(e,t,n){H.writeFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}v(ez,"writeFileSync");function eQ(e,t,n){H.appendFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}v(eQ,"appendFileSync");function eX(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return t.every(function(e){return H.pathExistsSync(e)})}v(eX,"pathExistsSync");function eZ(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}t.forEach(function(e){eX(e)&&H.removeSync(e)})}v(eZ,"removeSync");var e0=M();function e1(e){var t=Q(e0.CWD,er);if(!eX(t))return!1;try{var n=eV(t),r=n.name,s=n.dependencies,i=s===void 0?{}:s,o=n.devDependencies,c=o===void 0?{}:o,a=r===e,u=e in i,l=e in c;return a||u||l?{path:t,file:n,isCurrentProject:a,isDepend:u,isDevDepend:l}:!1}catch(e){return K.warn("Failed to read package.json: ".concat(e.message)),!1}}v(e1,"getPackage");function e2(e){return s(function(){var t,n,r,s;return m(this,function(i){switch(i.label){case 0:i.trys.push([0,3,,4]);return[4,Y("https://registry.npmjs.org/".concat(e,"/latest"))];case 1:t=i.sent();if(!t.ok)throw new Error("Failed to fetch latest version: ".concat(t.status," ").concat(t.statusText));return[4,t.json()];case 2:n=i.sent(),r=n.version;return[2,r];case 3:s=i.sent();throw K.error('Failed to fetch version for "'.concat(e,'": ').concat(s.message)),s;case 4:return[2]}})})()}v(e2,"getLatestPackageVersion");function e4(e,t){return s(function(){var n,r,s,i,o,c,a,u,d,p,f,g,y,v,h,x,j,b,I,w,E;return m(this,function(m){switch(m.label){case 0:m.trys.push([0,4,,5]);n=e1(e);if(!n)return[2,l({},W)];a=n.path,u=n.file,d=n.isCurrentProject,p=n.isDepend,f=n.isDevDepend,g=(r=u.dependencies)!==null&&r!==void 0?r:{},y=(s=u.devDependencies)!==null&&s!==void 0?s:{},v=d?(i=u.version)!==null&&i!==void 0?i:"0.0.0":p?(o=g[e])!==null&&o!==void 0?o:"0.0.0":f?(c=y[e])!==null&&c!==void 0?c:"0.0.0":"0.0.0";if(!d)return[3,1];j=v;return[3,3];case 1:return[4,e2(e)];case 2:j=m.sent();m.label=3;case 3:h=j,x=d||v===h;if(!x&&(t===null||t===void 0?void 0:t.update)){;I=p?"dependencies":f?"devDependencies":null;I&&((b=u[I])===null||b===void 0?void 0:b[e])!==h&&(u[I]=(w=u[I])!==null&&w!==void 0?w:{},u[I][e]=h,ez(a,JSON.stringify(u,null,4)),K.info('Updated "'.concat(e,'" to version ').concat(h)))}return[2,{isCurrentProject:d,installedPath:a,file:u,isUpToDate:x}];case 4:E=m.sent();return[2,(K.error('Error checking package "'.concat(e,'": ').concat(E.message)),l({},W))];case 5:return[2]}})})()}v(e4,"checkPackage");function e3(){return s(function(){var e,t,n,r,s,i,o,c,a,u,l,d;return m(this,function(p){switch(p.label){case 0:e=[{command:v(function(){return eB.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:v(function(){return eB.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:v(function(){return eB.pnpmInstallForce()},"command"),message:"Retrying with force install"}];t=true,n=false,r=undefined;p.label=1;case 1:p.trys.push([1,9,10,11]);s=e[Symbol.iterator]();p.label=2;case 2:if(!!(t=(i=s.next()).done))return[3,8];o=i.value,c=o.command,a=o.message;p.label=3;case 3:p.trys.push([3,6,,7]);return[4,c()];case 4:u=p.sent();return[4,tf("".concat(a," using: ").concat(u),u)];case 5:p.sent();return[2];case 6:l=p.sent();K.warn("Installation attempt failed: ".concat(a)),K.error("Details: ".concat(l.message));return[3,7];case 7:t=true;return[3,2];case 8:return[3,11];case 9:d=p.sent();n=true;r=d;return[3,11];case 10:try{if(!t&&s.return!=null){s.return()}}finally{if(n){throw r}}return[7];case 11:throw new Error("All dependency installation strategies failed.")}})})()}v(e3,"installDependencies");function e5(e,t){return s(function(){var n,r,s,i,o,c,a,u,d,f,g;return m(this,function(m){switch(m.label){case 0:if(!eX(eP.PACKAGE_JSON)){K.error("package.json not found. Aborting setup.");return[2]}m.label=1;case 1:m.trys.push([1,13,,14]);n=p(new Set(e)).sort();return[4,Promise.all(n.map(function(e){return e4(e,l({},(t===null||t===void 0?void 0:t.update)&&{update:t.update}))}))];case 2:r=m.sent().every(function(e){return e.isUpToDate});if(r)return[3,4];return[4,e3()];case 3:r=m.sent();m.label=4;case 4:r;i=true,o=false,c=undefined;m.label=5;case 5:m.trys.push([5,10,11,12]);a=((s=t===null||t===void 0?void 0:t.postInstallActions)!==null&&s!==void 0?s:[])[Symbol.iterator]();m.label=6;case 6:if(!!(i=(u=a.next()).done))return[3,9];d=u.value;return[4,d()];case 7:m.sent();m.label=8;case 8:i=true;return[3,6];case 9:return[3,12];case 10:f=m.sent();o=true;c=f;return[3,12];case 11:try{if(!i&&a.return!=null){a.return()}}finally{if(o){throw c}}return[7];case 12:return[3,14];case 13:g=m.sent();throw K.error('Failed to setup "'.concat(e.join(", "),'": ').concat(g.message)),g;case 14:return[2]}})})()}v(e5,"setupPackages");import e8 from"node-persist";var e6=M();function e7(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=e8.defaultInstance;if(e)return[3,2];return[4,e8.init({dir:e6.CYBERSKILL_STORAGE_DIRECTORY,stringify:JSON.stringify,parse:JSON.parse,encoding:"utf8",logging:!1,forgiveParseErrors:!0})];case 1:e=t.sent();t.label=2;case 2:e;return[2]}})})()}v(e7,"initNodePersist");var e9={get:function e(e){return s(function(){var t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,e7()];case 1:r.sent();return[4,e8.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,(K.error('[Storage:get] Error getting key "'.concat(e,'":'),n),null)];case 4:return[2]}})})()},set:function e(e,t){return s(function(){var n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,e7()];case 1:r.sent();return[4,e8.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();K.error('[Storage:set] Error setting key "'.concat(e,'":'),n);return[3,4];case 4:return[2]}})})()},remove:function e(e){return s(function(){var t;return m(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,e7()];case 1:n.sent();return[4,e8.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();K.error('[Storage:remove] Error removing key "'.concat(e,'":'),t);return[3,4];case 4:return[2]}})})()},keys:function e(){return s(function(){var e,t;return m(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,e7()];case 1:n.sent();return[4,e8.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:(K.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,(K.error("[Storage:keys] Error getting keys:",t),[])];case 4:return[2]}})})()},getLogLink:function e(e){return s(function(){return m(this,function(t){try{return[2,"".concat(e6.CYBERSKILL_STORAGE_DIRECTORY," (key: ").concat(e,")")]}catch(e){return[2,(K.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var te=M(),tt=S.promisify(w);function tn(e){return"error_list:".concat(e)}v(tn,"getErrorListKey");function tr(e){return s(function(){var t,n,r;return m(this,function(i){switch(i.label){case 0:if(e.length===0)return[2];t=Date.now(),n=tn(t);i.label=1;case 1:i.trys.push([1,3,,4]);return[4,e9.set(n,{errors:e,timestamp:t})];case 2:i.sent(),setTimeout(function(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,e9.getLogLink(n)];case 1:e=t.sent();e&&K.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})})()},10);return[3,4];case 3:r=i.sent();K.error("Failed to save errors: ".concat(r.message));return[3,4];case 4:return[2]}})})()}v(tr,"saveErrorListToStorage");function ts(){return s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,e9.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(function(e){return s(function(){var t;return m(this,function(n){switch(n.label){case 0:return[4,e9.get(e)];case 1:return[2,((t=n.sent())===null||t===void 0?void 0:t.errors)||[]]}})})()}))];case 2:return[2,r.sent().flat()];case 3:n=r.sent();return[2,(K.error("Failed to retrieve stored errors: ".concat(n.message)),[])];case 4:return[2]}})})()}v(ts,"getStoredErrorLists");function ti(){return s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,e9.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(function(e){return e9.remove(e)}))];case 2:r.sent();return[3,4];case 3:n=r.sent();K.error("Failed to clear error lists: ".concat(n.message));return[3,4];case 4:return[2]}})})()}v(ti,"clearAllErrorLists");function to(e){var t=[],n=[],r="",s=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,i=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,o=/^✖\s+(.*?)\s+\[(.*?)\]$/;e.split("\n").forEach(function(e){if(e.startsWith("/"))r=e.trim();else{var c,a,u,l,d;var p=s.exec(e)||[],f=i.exec(e)||[],g=o.exec(e)||[];var m,y,v,h,x,j;p.length&&r?t.push({file:r,position:"".concat(p[1],":").concat(p[2]),type:p[3]===A.Error?A.Error:A.Warning,message:(m=p===null||p===void 0?void 0:(c=p[4])===null||c===void 0?void 0:c.trim())!==null&&m!==void 0?m:"",rule:(y=p===null||p===void 0?void 0:(a=p[5])===null||a===void 0?void 0:a.trim())!==null&&y!==void 0?y:""}):f.length?t.push({file:(v=f===null||f===void 0?void 0:f[1])!==null&&v!==void 0?v:"",position:"".concat(f[2],":").concat(f[3]),type:f[4]===A.Error?A.Error:A.Warning,message:(h=f===null||f===void 0?void 0:(u=f[5])===null||u===void 0?void 0:u.trim())!==null&&h!==void 0?h:""}):g.length?t.push({file:"commitlint",type:A.Error,message:(x=g===null||g===void 0?void 0:(l=g[1])===null||l===void 0?void 0:l.trim())!==null&&x!==void 0?x:"",rule:(j=g===null||g===void 0?void 0:(d=g[2])===null||d===void 0?void 0:d.trim())!==null&&j!==void 0?j:""}):n.push(e.trim())}}),t.length&&tr(t),te.DEBUG&&n.length&&(K.warn("Unmatched lines:"),n.forEach(function(e){return K.info(" ".concat(e))}))}v(to,"parseTextErrors");function tc(e){try{var t=JSON.parse(e),n=[];t.forEach(function(e){var t=e.filePath,r=e.messages;r.forEach(function(e){var r=e.severity,s=e.line,i=e.column,o=e.ruleId,c=e.message;n.push({type:r===2?A.Error:A.Warning,file:t,position:"".concat(s,":").concat(i),rule:o,message:c})})}),n.length&&tr(n)}catch(t){to(e)}}v(tc,"parseCommandOutput");function ta(e){return s(function(e){var t,n,r,s,i,o,c,a,u;var l=arguments;return m(this,function(d){switch(d.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:tc;n=new AbortController;E.on("SIGINT",function(){K.warn("Process interrupted. Terminating..."),n.abort(),E.exit()});d.label=1;case 1:d.trys.push([1,4,,5]);if(!(typeof e=="string"))return[3,3];return[4,tt(e,{maxBuffer:0x6400000,signal:n.signal})];case 2:r=d.sent(),s=r.stdout,i=r.stderr;[s,i].forEach(function(e){return e&&t(e)});d.label=3;case 3:return[3,5];case 4:o=d.sent();c=o.stdout,a=o.stderr,u=o.message;[c,a].forEach(function(e){return e&&t(e)}),!a&&!c&&K.error("Command failed: ".concat(u));return[3,5];case 5:return[2]}})}).apply(this,arguments)}v(ta,"executeCommand");function tu(e){return{raw:!0,cmd:e}}v(tu,"rawCommand");function tl(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(eT," ").concat(ee," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(eT," ").concat(eC," ").concat(eg," ").concat(e):"".concat(eT," ").concat(ef," ").concat(e)}v(tl,"formatCLI");function td(e,t){return typeof e=="function"?tl(e(t),t):(typeof e==="undefined"?"undefined":f(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?tl(e,t):e}v(td,"formatCommand");function tp(e){return s(function(e){var t,n,r,s,i,o,c;var a=arguments;return m(this,function(u){switch(u.label){case 0:t=a.length>1&&a[1]!==void 0?a[1]:{};r=(n=t===null||t===void 0?void 0:t.isRemote)!==null&&n!==void 0?n:!1;if(!r)return[3,1];c=!1;return[3,3];case 1:return[4,e4(ee)];case 2:c=u.sent().isCurrentProject;u.label=3;case 3:s=c,i={isRemote:r,isCurrentProject:s},o=typeof e=="function"?e(i):e;return[2,Object.fromEntries(Object.entries(o).map(function(e){var t=d(e,2),n=t[0],r=t[1];return[n,td(r,i)]}))]}})}).apply(this,arguments)}v(tp,"resolveCommands");function tf(e,t){return s(function(){var n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);K.start("".concat(e)),te.DEBUG&&K.info("→ ".concat(t));return[4,ta(t)];case 1:r.sent(),K.success("".concat(e," done."));return[3,3];case 2:n=r.sent();throw K.error("".concat(e," failed: ").concat(n.message)),n;case 3:return[2]}})})()}v(tf,"runCommand");function tg(){return s(function(){var e,t;return m(this,function(n){switch(n.label){case 0:if(!eX(eP.TS_CONFIG))return[3,3];t=["Performing TypeScript validation"];return[4,eB.typescriptCheck()];case 1:return[4,tf.apply(void 0,t.concat([n.sent()]))];case 2:e=n.sent();return[3,4];case 3:e=K.warn("No TypeScript configuration found. Skipping type check.");n.label=4;case 4:e;return[2]}})})()}v(tg,"checkTypescript");function tm(){return s(function(){var e,t,n,r;var s=arguments;return m(this,function(i){switch(i.label){case 0:e=s.length>0&&s[0]!==void 0?s[0]:!1;if(!e)return[3,3];n=["Running ESLint with auto-fix"];return[4,eB.eslintFix()];case 1:return[4,tf.apply(void 0,n.concat([i.sent()]))];case 2:t=i.sent();return[3,6];case 3:r=["Running ESLint check"];return[4,eB.eslintCheck()];case 4:return[4,tf.apply(void 0,r.concat([i.sent()]))];case 5:t=i.sent();i.label=6;case 6:t;return[2]}})}).apply(this,arguments)}v(tm,"checkEslint");function ty(e,t){if(!t.length)return;var n=e==="Errors"?"red":"yellow";K.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,n)}v(ty,"printIssues");function tv(){return s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:return[4,ts()];case 1:e=r.sent(),t=e.filter(function(e){return e.type===A.Error}),n=e.filter(function(e){return e.type===A.Warning});!t.length&&!n.length?K.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(ty("Warnings",n),ty("Errors",t),(t.length>0||n.length>0)&&h.exit(1));return[2]}})})()}v(tv,"showCheckResult");function th(){return s(function(){var e,t,n,r,s,i;return m(this,function(o){switch(o.label){case 0:return[4,ti()];case 1:o.sent();return[4,e4(ee)];case 2:e=o.sent(),t=e.isCurrentProject;if(!t)return[3,9];o.label=3;case 3:o.trys.push([3,8,,9]);n=["Building package: ".concat(ee)];return[4,eB.build()];case 4:return[4,tf.apply(void 0,n.concat([o.sent()]))];case 5:o.sent();r=["Staging build artifacts"];return[4,eB.stageBuildDirectory()];case 6:return[4,tf.apply(void 0,r.concat([o.sent()]))];case 7:o.sent();return[3,9];case 8:s=o.sent();throw K.error("Error building and staging ".concat(ee,": ").concat(s.message)),s;case 9:i=["Executing lint-staged"];return[4,eB.lintStaged()];case 10:return[4,tf.apply(void 0,i.concat([o.sent()]))];case 11:o.sent(),tv();return[2]}})})()}v(th,"lintStaged");function tx(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Inspecting ESLint configuration"];return[4,eB.eslintInspect()];case 1:return[4,tf.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}v(tx,"inspectLint");function tj(){return s(function(){return m(this,function(e){switch(e.label){case 0:return[4,ti()];case 1:e.sent();return[4,Promise.all([tg(),tm()])];case 2:e.sent(),tv();return[2]}})})()}v(tj,"lintCheck");function tb(){return s(function(){return m(this,function(e){switch(e.label){case 0:return[4,ti()];case 1:e.sent();return[4,Promise.all([tg(),tm(!0)])];case 2:e.sent(),tv();return[2]}})})()}v(tb,"lintFix");function tI(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,ti()];case 1:t.sent();e=["Validating commit message"];return[4,eB.commitLint()];case 2:return[4,tf.apply(void 0,e.concat([t.sent()]))];case 3:t.sent(),tv();return[2]}})})()}v(tI,"commitLint");function tw(){return s(function(){var e,t,n,r;return m(this,function(s){switch(s.label){case 0:e=["Configuring Git hooks"];return[4,eB.configureGitHook()];case 1:return[4,tf.apply(void 0,e.concat([s.sent()]))];case 2:s.sent(),eZ(eP.GIT_HOOK);return[4,tp(eq)];case 3:t=s.sent();ez(eP.SIMPLE_GIT_HOOKS_JSON,JSON.stringify(t,null,4));n="\n".concat(ec,"\n");eX(eP.GIT_IGNORE)?eH(eP.GIT_IGNORE,"utf-8").split("\n").includes(ec)||eQ(eP.GIT_IGNORE,n):ez(eP.GIT_IGNORE,n);r=["Setting up simple-git-hooks"];return[4,eB.simpleGitHooks()];case 4:return[4,tf.apply(void 0,r.concat([s.sent()]))];case 5:s.sent();return[2]}})})()}v(tw,"setupGitHook");function tE(){return s(function(){return m(this,function(e){switch(e.label){case 0:return[4,e5([ee],{update:!0,postInstallActions:[tw]})];case 1:e.sent();return[2]}})})()}v(tE,"setup");function tS(){return s(function(){return m(this,function(e){switch(e.label){case 0:eZ(eP.NODE_MODULES,eP.PNPM_LOCK_YAML);return[4,e3()];case 1:e.sent();return[4,tw()];case 2:e.sent();return[2]}})})()}v(tS,"reset");function tC(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Inspecting project dependencies"];return[4,eB.nodeModulesInspect()];case 1:return[4,tf.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}v(tC,"inspect");function tO(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running unit tests"];return[4,eB.testUnit()];case 1:return[4,tf.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}v(tO,"testUnit");function tk(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running end-to-end tests"];return[4,eB.testE2e()];case 1:return[4,tf.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}v(tk,"testE2E");function tT(e){return s(function(){var t;return m(this,function(n){switch(n.label){case 0:t=["Creating MongoDB migration"];return[4,eB.mongoMigrateCreate(e)];case 1:return[4,tf.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})})()}v(tT,"mongoMigrateCreate");function tG(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running MongoDB migrations"];return[4,eB.mongoMigrateUp()];case 1:return[4,tf.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}v(tG,"mongoMigrateUp");function t_(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Rolling back MongoDB migration"];return[4,eB.mongoMigrateDown()];case 1:return[4,tf.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}v(t_,"mongoMigrateDown");(function(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,j(x(h.argv)).scriptName(ef).usage("$0 <command> [options]").command("lint","Check code for linting issues",tj).command("lint:fix","Fix linting issues automatically",tb).command("lint:inspect","View active ESLint configuration",tx).command("lint-staged","Run lint checks on staged files",th).command("commitlint","Validate commit message format",tI).command("setup","Initialize project setup and dependencies",tE).command("reset","Reset the project and reinstall dependencies",tS).command("inspect","Analyze installed project dependencies",tC).command("test:unit","Run unit test suite",tO).command("test:e2e","Run end-to-end test suite",tk).command("mongo:migrate:create <name>","Create a MongoDB migration",function(e){return e.positional("name",{describe:"Migration name",type:"string"})},function(e){return s(function(){return m(this,function(t){switch(t.label){case 0:if(!e.name){K.error("Migration name is required.");return[2]}return[4,tT(e.name)];case 1:t.sent();return[2]}})})()}).command("mongo:migrate:up","Apply all MongoDB migrations",tG).command("mongo:migrate:down","Rollback last MongoDB migration",t_).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(b.version).epilog('\uD83D\uDCA1 Tip: Use "--help" with any command to see options\n').parse()];case 1:t.sent();return[3,3];case 2:e=t.sent();K.error("Fatal: ".concat(e.message)),h.exit(1);return[3,3];case 3:return[2]}})})()})();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";function e(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function t(e){if(Array.isArray(e))return e}function r(t){if(Array.isArray(t))return e(t)}function n(e,t,r,n,o,a,c){try{var i=e[a](c);var u=i.value}catch(e){r(e);return}if(i.done){t(u)}else{Promise.resolve(u).then(n,o)}}function o(e){return function(){var t=this,r=arguments;return new Promise(function(o,a){var c=e.apply(t,r);function i(e){n(c,o,a,i,u,"next",e)}function u(e){n(c,o,a,i,u,"throw",e)}i(undefined)})}}function a(e,t,r){if(t in e){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true})}else{e[t]=r}return e}function c(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function i(e,t){var r=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r==null)return;var n=[];var o=true;var a=false;var c,i;try{for(r=r.call(e);!(o=(c=r.next()).done);o=true){n.push(c.value);if(t&&n.length===t)break}}catch(e){a=true;i=e}finally{try{if(!o&&r["return"]!=null)r["return"]()}finally{if(a)throw i}}return n}function u(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function s(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};var n=Object.keys(r);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))}n.forEach(function(t){a(e,t,r[t])})}return e}function f(e,r){return t(e)||i(e,r)||m(e,r)||u()}function d(e){return r(e)||c(e)||m(e)||s()}function v(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function m(t,r){if(!t)return;if(typeof t==="string")return e(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor)n=t.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,r)}function p(e,t){var r,n,o,a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},c=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return c.next=i(0),c["throw"]=i(1),c["return"]=i(2),typeof Symbol==="function"&&(c[Symbol.iterator]=function(){return this}),c;function i(e){return function(t){return u([e,t])}}function u(i){if(r)throw new TypeError("Generator is already executing.");while(c&&(c=0,i[0]&&(a=0)),a)try{if(r=1,n&&(o=i[0]&2?n["return"]:i[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;if(n=0,o)i=[i[0]&2,o.value];switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:false};case 5:a.label++;n=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(i[0]===6||i[0]===2)){a=0;continue}if(i[0]===3&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(i[0]===6&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}if(o[2])a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];n=0}finally{r=o=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}}var g=Object.create;var y=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var I=Object.getPrototypeOf,C=Object.prototype.hasOwnProperty;var E=function(e,t){return y(e,"name",{value:t,configurable:!0})};var O=function(e,t){for(var r in t)y(e,r,{get:t[r],enumerable:!0})},S=function(e,t,r,n){var o=true,a=false,c=undefined;if(t&&(typeof t==="undefined"?"undefined":v(t))=="object"||typeof t=="function")try{var i=function(){var o=s.value;!C.call(e,o)&&o!==r&&y(e,o,{get:function(){return t[o]},enumerable:!(n=h(t,o))||n.enumerable})};for(var u=b(t)[Symbol.iterator](),s;!(o=(s=u.next()).done);o=true)i()}catch(e){a=true;c=e}finally{try{if(!o&&u.return!=null){u.return()}}finally{if(a){throw c}}}return e};var w=function(e,t,r){return r=e!=null?g(I(e)):{},S(t||!e||!e.__esModule?y(r,"default",{value:e,enumerable:!0}):r,e)},T=function(e){return S(y({},"__esModule",{value:!0}),e)};var _={};O(_,{clearAllErrorLists:function(){return ti},formatCommand:function(){return tv},getStoredErrorLists:function(){return tc},rawCommand:function(){return tf},resolveCommands:function(){return tm},runCommand:function(){return tp}});module.exports=T(_);var G=require("child_process"),L=w(require("process"),1),N=w(require("util"),1);var k=".cyberskill-storage";var R=w(require("@dotenvx/dotenvx"),1),j=require("envalid"),D=w(require("os"),1),A=w(require("path"),1),P=w(require("process"),1);var x=!1;function M(){x||(R.default.config(),x=!0)}E(M,"loadEnvFile");function F(){M();var e=(0,j.cleanEnv)(P.default.env,{CWD:(0,j.str)({default:P.default.cwd()}),DEBUG:(0,j.bool)({default:!1}),CYBERSKILL_STORAGE_DIRECTORY:(0,j.str)({default:A.default.join(D.default.homedir(),k)})});return{CWD:e.CWD,DEBUG:e.DEBUG,CYBERSKILL_STORAGE_DIRECTORY:e.CYBERSKILL_STORAGE_DIRECTORY}}E(F,"getEnv");var U=function(e){return e.Error="error",e.Warning="warning",e}({});var K=w(require("chalk"),1),W=w(require("consola"),1),q=require("graphql");var Y=F();Y.DEBUG||(W.default.level=4);function B(e){var t=K.default[e];return typeof t=="function"?t:K.default.green}E(B,"chalkKeyword");var J={silent:W.default.silent,level:W.default.level,fatal:W.default.fatal,error:W.default.error,warn:W.default.warn,log:W.default.log,info:W.default.info,success:W.default.success,ready:W.default.ready,start:W.default.start,box:W.default.box,debug:W.default.debug,trace:W.default.trace,verbose:W.default.verbose,printBoxedLog:function e(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(t===null||t===void 0?void 0:t.length)){W.default.box(K.default.green(e));return}t.forEach(function(e){var t=e.file,n=e.position,o=e.rule,a=e.message;W.default.log("".concat(K.default.gray("File:")," ").concat(K.default.blue("".concat(t).concat(n?":".concat(n):"")))),o&&W.default.log(" ".concat(B(r)("Rule:")," ").concat(o)),W.default.log(" ".concat(B(r)("Message:")," ").concat(a))}),W.default.box(B(r)("".concat(e," : ").concat(t.length))),W.default.log(K.default.gray("─".repeat(40)))}};var H={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};var $=w(require("node-fetch"),1);var V=function(e){return e.CLI="CLI",e.STRING="STRING",e.FUNCTION="FUNCTION",e}({});var z=w(require("fs-extra"),1);var Q=w(require("path"),1);var X=F(),Z=Q.default;function ee(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}var n;return(n=Z).resolve.apply(n,[X.CWD].concat(d(t)))}E(ee,"resolveWorkingPath");function et(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}var n;return(n=Z).join.apply(n,d(t))}E(et,"join");var er=F(),en=er.CWD,eo="@cyberskill/shared",ea="node_modules",ec="dist",ei="package.json",eu="package-lock.json",es="tsconfig.json",el=".gitignore",ef=".simple-git-hooks.json",ed="pnpm-lock.yaml",ev=".git/hooks/",em=".git/COMMIT_EDITMSG",ep=".migrate-mongo.config.js",eg=et(en,ea,eo,ec),ey="cyberskill",eh="src/nodejs/cli/index.ts",eb="eslint",eI="eslint",eC="vitest",eE="playwright",eO="vitest",eS="@commitlint/cli",ew="commitlint",eT="lint-staged",e_="lint-staged",eG="typescript",eL="tsc",eN="tsx",ek="git",eR="pnpm",ej="pnpm exec",eD="simple-git-hooks",eA="simple-git-hooks",eP="@eslint/config-inspector",ex="eslint-config-inspector",eM="node-modules-inspector",eF="node-modules-inspector",eU="migrate-mongo",eK="./node_modules/migrate-mongo/bin/migrate-mongo",eW={CYBERSKILL_DIRECTORY:eg,WORKING_DIRECTORY:en,TS_CONFIG:ee(es),GIT_IGNORE:ee(el),GIT_HOOK:ee(ev),GIT_COMMIT_MSG:ee(em),SIMPLE_GIT_HOOKS_JSON:ee(ef),PACKAGE_JSON:ee(ei),PACKAGE_LOCK_JSON:ee(eu),PNPM_LOCK_YAML:ee(ed),NODE_MODULES:ee(ea),MIGRATE_MONGO_CONFIG:ee(ep),LINT_STAGED_CONFIG:ee("".concat(eg,"/configs/lint-staged/index.js")),COMMITLINT_CONFIG:ee("".concat(eg,"/configs/commitlint/index.js")),UNIT_TEST_CONFIG:ee("".concat(eg,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:ee("".concat(eg,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:ee("".concat(eg,"/react/vitest/vitest.e2e.js"))};function eq(e,t,r){return o(function(){return p(this,function(n){switch(n.label){case 0:if(!t)throw new Error("'first' argument is undefined");switch(e){case V.CLI:return[3,1];case V.STRING:return[3,3]}return[3,4];case 1:return[4,e8(t.split(" "),{update:!0})];case 2:return[2,(n.sent(),tv(tf("".concat(ej," ").concat(r))))];case 3:return[2,tv(tf(t))];case 4:throw new Error("Unsupported command type");case 5:return[2]}})})()}E(eq,"buildCommand");function eY(e,t,r){return function(){return o(function(){return p(this,function(n){return[2,eq(e,t,r)]})})()}}E(eY,"commandFactory");var eB={simpleGitHooks:eY(V.CLI,eD,eA),eslintInspect:eY(V.CLI,eP,ex),nodeModulesInspect:eY(V.CLI,eM,eF),eslintCheck:eY(V.CLI,eb,"".concat(eI," ").concat(eW.WORKING_DIRECTORY," --no-cache")),eslintFix:eY(V.CLI,eb,"".concat(eI," ").concat(eW.WORKING_DIRECTORY," --fix --no-cache")),typescriptCheck:eY(V.CLI,eG,"".concat(eL," -p ").concat(eW.TS_CONFIG," --noEmit")),configureGitHook:eY(V.STRING,"".concat(ek," config core.hooksPath ").concat(eW.GIT_HOOK)),testUnit:eY(V.CLI,eC,"".concat(eO," --config ").concat(eW.UNIT_TEST_CONFIG)),testE2e:eY(V.CLI,"".concat(eC," ").concat(eE),"".concat(eO," --config ").concat(eW.E2E_TEST_CONFIG)),mongoMigrateCreate:E(function(e){return eY(V.CLI,eU,"".concat(eN," ").concat(eK," create ").concat(e," -f ").concat(eW.MIGRATE_MONGO_CONFIG))()},"mongoMigrateCreate"),mongoMigrateUp:eY(V.CLI,eU,"".concat(eN," ").concat(eK," up -f ").concat(eW.MIGRATE_MONGO_CONFIG)),mongoMigrateDown:eY(V.CLI,eU,"".concat(eN," ").concat(eK," down -f ").concat(eW.MIGRATE_MONGO_CONFIG)),commitLint:eY(V.CLI,eS,"".concat(ew," --edit ").concat(eW.GIT_COMMIT_MSG," --config ").concat(eW.COMMITLINT_CONFIG)),lintStaged:eY(V.CLI,eT,"".concat(e_," --config ").concat(eW.LINT_STAGED_CONFIG)),stageBuildDirectory:eY(V.STRING,"".concat(ek," add ").concat(ec)),build:eY(V.STRING,"".concat(eR," run build")),pnpmInstallStandard:eY(V.STRING,"".concat(eR," install")),pnpmInstallLegacy:eY(V.STRING,"".concat(eR," install --legacy-peer-deps")),pnpmInstallForce:eY(V.STRING,"".concat(eR," install --force"))};var eJ=z.default,eH=eJ.lstatSync,e$=eJ.readdirSync,eV=eJ.mkdirSync,ez=eJ.readFileSync,eQ=eJ.unlinkSync,eX=eJ.statSync,eZ=z.default.readJsonSync;function e0(e,t,r){z.default.writeFileSync(e,t,r!==null&&r!==void 0?r:"utf-8")}E(e0,"writeFileSync");function e1(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return t.every(function(e){return z.default.pathExistsSync(e)})}E(e1,"pathExistsSync");var e2=F();function e3(e){var t=et(e2.CWD,ei);if(!e1(t))return!1;try{var r=eZ(t),n=r.name,o=r.dependencies,a=o===void 0?{}:o,c=r.devDependencies,i=c===void 0?{}:c,u=n===e,s=e in a,l=e in i;return u||s||l?{path:t,file:r,isCurrentProject:u,isDepend:s,isDevDepend:l}:!1}catch(e){return J.warn("Failed to read package.json: ".concat(e.message)),!1}}E(e3,"getPackage");function e4(e){return o(function(){var t,r,n,o;return p(this,function(a){switch(a.label){case 0:a.trys.push([0,3,,4]);return[4,(0,$.default)("https://registry.npmjs.org/".concat(e,"/latest"))];case 1:t=a.sent();if(!t.ok)throw new Error("Failed to fetch latest version: ".concat(t.status," ").concat(t.statusText));return[4,t.json()];case 2:r=a.sent(),n=r.version;return[2,n];case 3:o=a.sent();throw J.error('Failed to fetch version for "'.concat(e,'": ').concat(o.message)),o;case 4:return[2]}})})()}E(e4,"getLatestPackageVersion");function e5(e,t){return o(function(){var r,n,o,a,c,i,u,s,f,d,v,m,g,y,h,b,I,C,E,O,S;return p(this,function(p){switch(p.label){case 0:p.trys.push([0,4,,5]);r=e3(e);if(!r)return[2,l({},H)];u=r.path,s=r.file,f=r.isCurrentProject,d=r.isDepend,v=r.isDevDepend,m=(n=s.dependencies)!==null&&n!==void 0?n:{},g=(o=s.devDependencies)!==null&&o!==void 0?o:{},y=f?(a=s.version)!==null&&a!==void 0?a:"0.0.0":d?(c=m[e])!==null&&c!==void 0?c:"0.0.0":v?(i=g[e])!==null&&i!==void 0?i:"0.0.0":"0.0.0";if(!f)return[3,1];I=y;return[3,3];case 1:return[4,e4(e)];case 2:I=p.sent();p.label=3;case 3:h=I,b=f||y===h;if(!b&&(t===null||t===void 0?void 0:t.update)){;E=d?"dependencies":v?"devDependencies":null;E&&((C=s[E])===null||C===void 0?void 0:C[e])!==h&&(s[E]=(O=s[E])!==null&&O!==void 0?O:{},s[E][e]=h,e0(u,JSON.stringify(s,null,4)),J.info('Updated "'.concat(e,'" to version ').concat(h)))}return[2,{isCurrentProject:f,installedPath:u,file:s,isUpToDate:b}];case 4:S=p.sent();return[2,(J.error('Error checking package "'.concat(e,'": ').concat(S.message)),l({},H))];case 5:return[2]}})})()}E(e5,"checkPackage");function e6(){return o(function(){var e,t,r,n,o,a,c,i,u,s,l,f;return p(this,function(d){switch(d.label){case 0:e=[{command:E(function(){return eB.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:E(function(){return eB.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:E(function(){return eB.pnpmInstallForce()},"command"),message:"Retrying with force install"}];t=true,r=false,n=undefined;d.label=1;case 1:d.trys.push([1,9,10,11]);o=e[Symbol.iterator]();d.label=2;case 2:if(!!(t=(a=o.next()).done))return[3,8];c=a.value,i=c.command,u=c.message;d.label=3;case 3:d.trys.push([3,6,,7]);return[4,i()];case 4:s=d.sent();return[4,tp("".concat(u," using: ").concat(s),s)];case 5:d.sent();return[2];case 6:l=d.sent();J.warn("Installation attempt failed: ".concat(u)),J.error("Details: ".concat(l.message));return[3,7];case 7:t=true;return[3,2];case 8:return[3,11];case 9:f=d.sent();r=true;n=f;return[3,11];case 10:try{if(!t&&o.return!=null){o.return()}}finally{if(r){throw n}}return[7];case 11:throw new Error("All dependency installation strategies failed.")}})})()}E(e6,"installDependencies");function e8(e,t){return o(function(){var r,n,o,a,c,i,u,s,f,v,m;return p(this,function(p){switch(p.label){case 0:if(!e1(eW.PACKAGE_JSON)){J.error("package.json not found. Aborting setup.");return[2]}p.label=1;case 1:p.trys.push([1,13,,14]);r=d(new Set(e)).sort();return[4,Promise.all(r.map(function(e){return e5(e,l({},(t===null||t===void 0?void 0:t.update)&&{update:t.update}))}))];case 2:n=p.sent().every(function(e){return e.isUpToDate});if(n)return[3,4];return[4,e6()];case 3:n=p.sent();p.label=4;case 4:n;a=true,c=false,i=undefined;p.label=5;case 5:p.trys.push([5,10,11,12]);u=((o=t===null||t===void 0?void 0:t.postInstallActions)!==null&&o!==void 0?o:[])[Symbol.iterator]();p.label=6;case 6:if(!!(a=(s=u.next()).done))return[3,9];f=s.value;return[4,f()];case 7:p.sent();p.label=8;case 8:a=true;return[3,6];case 9:return[3,12];case 10:v=p.sent();c=true;i=v;return[3,12];case 11:try{if(!a&&u.return!=null){u.return()}}finally{if(c){throw i}}return[7];case 12:return[3,14];case 13:m=p.sent();throw J.error('Failed to setup "'.concat(e.join(", "),'": ').concat(m.message)),m;case 14:return[2]}})})()}E(e8,"setupPackages");var e7=w(require("node-persist"),1);var e9=F();function te(){return o(function(){var e;return p(this,function(t){switch(t.label){case 0:e=e7.default.defaultInstance;if(e)return[3,2];return[4,e7.default.init({dir:e9.CYBERSKILL_STORAGE_DIRECTORY,stringify:JSON.stringify,parse:JSON.parse,encoding:"utf8",logging:!1,forgiveParseErrors:!0})];case 1:e=t.sent();t.label=2;case 2:e;return[2]}})})()}E(te,"initNodePersist");var tt={get:function e(e){return o(function(){var t,r;return p(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,te()];case 1:n.sent();return[4,e7.default.getItem(e)];case 2:return[2,(t=n.sent())!==null&&t!==void 0?t:null];case 3:r=n.sent();return[2,(J.error('[Storage:get] Error getting key "'.concat(e,'":'),r),null)];case 4:return[2]}})})()},set:function e(e,t){return o(function(){var r;return p(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,te()];case 1:n.sent();return[4,e7.default.setItem(e,t)];case 2:n.sent();return[3,4];case 3:r=n.sent();J.error('[Storage:set] Error setting key "'.concat(e,'":'),r);return[3,4];case 4:return[2]}})})()},remove:function e(e){return o(function(){var t;return p(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,te()];case 1:r.sent();return[4,e7.default.removeItem(e)];case 2:r.sent();return[3,4];case 3:t=r.sent();J.error('[Storage:remove] Error removing key "'.concat(e,'":'),t);return[3,4];case 4:return[2]}})})()},keys:function e(){return o(function(){var e,t;return p(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,te()];case 1:r.sent();return[4,e7.default.keys()];case 2:e=r.sent();return[2,Array.isArray(e)?e:(J.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=r.sent();return[2,(J.error("[Storage:keys] Error getting keys:",t),[])];case 4:return[2]}})})()},getLogLink:function e(e){return o(function(){return p(this,function(t){try{return[2,"".concat(e9.CYBERSKILL_STORAGE_DIRECTORY," (key: ").concat(e,")")]}catch(e){return[2,(J.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var tr=F(),tn=N.promisify(G.exec);function to(e){return"error_list:".concat(e)}E(to,"getErrorListKey");function ta(e){return o(function(){var t,r,n;return p(this,function(a){switch(a.label){case 0:if(e.length===0)return[2];t=Date.now(),r=to(t);a.label=1;case 1:a.trys.push([1,3,,4]);return[4,tt.set(r,{errors:e,timestamp:t})];case 2:a.sent(),setTimeout(function(){return o(function(){var e;return p(this,function(t){switch(t.label){case 0:return[4,tt.getLogLink(r)];case 1:e=t.sent();e&&J.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})})()},10);return[3,4];case 3:n=a.sent();J.error("Failed to save errors: ".concat(n.message));return[3,4];case 4:return[2]}})})()}E(ta,"saveErrorListToStorage");function tc(){return o(function(){var e,t,r;return p(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,tt.keys()];case 1:e=n.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(function(e){return o(function(){var t;return p(this,function(r){switch(r.label){case 0:return[4,tt.get(e)];case 1:return[2,((t=r.sent())===null||t===void 0?void 0:t.errors)||[]]}})})()}))];case 2:return[2,n.sent().flat()];case 3:r=n.sent();return[2,(J.error("Failed to retrieve stored errors: ".concat(r.message)),[])];case 4:return[2]}})})()}E(tc,"getStoredErrorLists");function ti(){return o(function(){var e,t,r;return p(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,tt.keys()];case 1:e=n.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(function(e){return tt.remove(e)}))];case 2:n.sent();return[3,4];case 3:r=n.sent();J.error("Failed to clear error lists: ".concat(r.message));return[3,4];case 4:return[2]}})})()}E(ti,"clearAllErrorLists");function tu(e){var t=[],r=[],n="",o=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,a=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,c=/^✖\s+(.*?)\s+\[(.*?)\]$/;e.split("\n").forEach(function(e){if(e.startsWith("/"))n=e.trim();else{var i,u,s,l,f;var d=o.exec(e)||[],v=a.exec(e)||[],m=c.exec(e)||[];var p,g,y,h,b,I;d.length&&n?t.push({file:n,position:"".concat(d[1],":").concat(d[2]),type:d[3]===U.Error?U.Error:U.Warning,message:(p=d===null||d===void 0?void 0:(i=d[4])===null||i===void 0?void 0:i.trim())!==null&&p!==void 0?p:"",rule:(g=d===null||d===void 0?void 0:(u=d[5])===null||u===void 0?void 0:u.trim())!==null&&g!==void 0?g:""}):v.length?t.push({file:(y=v===null||v===void 0?void 0:v[1])!==null&&y!==void 0?y:"",position:"".concat(v[2],":").concat(v[3]),type:v[4]===U.Error?U.Error:U.Warning,message:(h=v===null||v===void 0?void 0:(s=v[5])===null||s===void 0?void 0:s.trim())!==null&&h!==void 0?h:""}):m.length?t.push({file:"commitlint",type:U.Error,message:(b=m===null||m===void 0?void 0:(l=m[1])===null||l===void 0?void 0:l.trim())!==null&&b!==void 0?b:"",rule:(I=m===null||m===void 0?void 0:(f=m[2])===null||f===void 0?void 0:f.trim())!==null&&I!==void 0?I:""}):r.push(e.trim())}}),t.length&&ta(t),tr.DEBUG&&r.length&&(J.warn("Unmatched lines:"),r.forEach(function(e){return J.info(" ".concat(e))}))}E(tu,"parseTextErrors");function ts(e){try{var t=JSON.parse(e),r=[];t.forEach(function(e){var t=e.filePath,n=e.messages;n.forEach(function(e){var n=e.severity,o=e.line,a=e.column,c=e.ruleId,i=e.message;r.push({type:n===2?U.Error:U.Warning,file:t,position:"".concat(o,":").concat(a),rule:c,message:i})})}),r.length&&ta(r)}catch(t){tu(e)}}E(ts,"parseCommandOutput");function tl(e){return o(function(e){var t,r,n,o,a,c,i,u,s;var l=arguments;return p(this,function(f){switch(f.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:ts;r=new AbortController;L.default.on("SIGINT",function(){J.warn("Process interrupted. Terminating..."),r.abort(),L.default.exit()});f.label=1;case 1:f.trys.push([1,4,,5]);if(!(typeof e=="string"))return[3,3];return[4,tn(e,{maxBuffer:0x6400000,signal:r.signal})];case 2:n=f.sent(),o=n.stdout,a=n.stderr;[o,a].forEach(function(e){return e&&t(e)});f.label=3;case 3:return[3,5];case 4:c=f.sent();i=c.stdout,u=c.stderr,s=c.message;[i,u].forEach(function(e){return e&&t(e)}),!u&&!i&&J.error("Command failed: ".concat(s));return[3,5];case 5:return[2]}})}).apply(this,arguments)}E(tl,"executeCommand");function tf(e){return{raw:!0,cmd:e}}E(tf,"rawCommand");function td(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(ej," ").concat(eo," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(ej," ").concat(eN," ").concat(eh," ").concat(e):"".concat(ej," ").concat(ey," ").concat(e)}E(td,"formatCLI");function tv(e,t){return typeof e=="function"?td(e(t),t):(typeof e==="undefined"?"undefined":v(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?td(e,t):e}E(tv,"formatCommand");function tm(e){return o(function(e){var t,r,n,o,a,c,i;var u=arguments;return p(this,function(s){switch(s.label){case 0:t=u.length>1&&u[1]!==void 0?u[1]:{};n=(r=t===null||t===void 0?void 0:t.isRemote)!==null&&r!==void 0?r:!1;if(!n)return[3,1];i=!1;return[3,3];case 1:return[4,e5(eo)];case 2:i=s.sent().isCurrentProject;s.label=3;case 3:o=i,a={isRemote:n,isCurrentProject:o},c=typeof e=="function"?e(a):e;return[2,Object.fromEntries(Object.entries(c).map(function(e){var t=f(e,2),r=t[0],n=t[1];return[r,tv(n,a)]}))]}})}).apply(this,arguments)}E(tm,"resolveCommands");function tp(e,t){return o(function(){var r;return p(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);J.start("".concat(e)),tr.DEBUG&&J.info("→ ".concat(t));return[4,tl(t)];case 1:n.sent(),J.success("".concat(e," done."));return[3,3];case 2:r=n.sent();throw J.error("".concat(e," failed: ").concat(r.message)),r;case 3:return[2]}})})()}E(tp,"runCommand");0&&(module.exports={clearAllErrorLists:clearAllErrorLists,formatCommand:formatCommand,getStoredErrorLists:getStoredErrorLists,rawCommand:rawCommand,resolveCommands:resolveCommands,runCommand:runCommand});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function t(e){if(Array.isArray(e))return e}function r(t){if(Array.isArray(t))return e(t)}function n(e,t,r,n,o,a,c){try{var i=e[a](c);var s=i.value}catch(e){r(e);return}if(i.done){t(s)}else{Promise.resolve(s).then(n,o)}}function o(e){return function(){var t=this,r=arguments;return new Promise(function(o,a){var c=e.apply(t,r);function i(e){n(c,o,a,i,s,"next",e)}function s(e){n(c,o,a,i,s,"throw",e)}i(undefined)})}}function a(e,t,r){if(t in e){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true})}else{e[t]=r}return e}function c(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function i(e,t){var r=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r==null)return;var n=[];var o=true;var a=false;var c,i;try{for(r=r.call(e);!(o=(c=r.next()).done);o=true){n.push(c.value);if(t&&n.length===t)break}}catch(e){a=true;i=e}finally{try{if(!o&&r["return"]!=null)r["return"]()}finally{if(a)throw i}}return n}function s(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};var n=Object.keys(r);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))}n.forEach(function(t){a(e,t,r[t])})}return e}function f(e,r){return t(e)||i(e,r)||p(e,r)||s()}function d(e){return r(e)||c(e)||p(e)||u()}function m(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function p(t,r){if(!t)return;if(typeof t==="string")return e(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor)n=t.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,r)}function v(e,t){var r,n,o,a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},c=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return c.next=i(0),c["throw"]=i(1),c["return"]=i(2),typeof Symbol==="function"&&(c[Symbol.iterator]=function(){return this}),c;function i(e){return function(t){return s([e,t])}}function s(i){if(r)throw new TypeError("Generator is already executing.");while(c&&(c=0,i[0]&&(a=0)),a)try{if(r=1,n&&(o=i[0]&2?n["return"]:i[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;if(n=0,o)i=[i[0]&2,o.value];switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:false};case 5:a.label++;n=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(i[0]===6||i[0]===2)){a=0;continue}if(i[0]===3&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(i[0]===6&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}if(o[2])a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e];n=0}finally{r=o=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}}var g=Object.defineProperty;var h=function(e,t){return g(e,"name",{value:t,configurable:!0})};import{exec as y}from"node:child_process";import I from"node:process";import*as b from"node:util";var E=".cyberskill-storage";import C from"@dotenvx/dotenvx";import{bool as S,cleanEnv as O,str as w}from"envalid";import T from"node:os";import G from"node:path";import _ from"node:process";var L=!1;function N(){L||(C.config(),L=!0)}h(N,"loadEnvFile");function k(){N();var e=O(_.env,{CWD:w({default:_.cwd()}),DEBUG:S({default:!1}),CYBERSKILL_STORAGE_DIRECTORY:w({default:G.join(T.homedir(),E)})});return{CWD:e.CWD,DEBUG:e.DEBUG,CYBERSKILL_STORAGE_DIRECTORY:e.CYBERSKILL_STORAGE_DIRECTORY}}h(k,"getEnv");var R=function(e){return e.Error="error",e.Warning="warning",e}({});import D from"chalk";import A from"consola";import{GraphQLError as j}from"graphql";var P=k();P.DEBUG||(A.level=4);function x(e){var t=D[e];return typeof t=="function"?t:D.green}h(x,"chalkKeyword");var F={silent:A.silent,level:A.level,fatal:A.fatal,error:A.error,warn:A.warn,log:A.log,info:A.info,success:A.success,ready:A.ready,start:A.start,box:A.box,debug:A.debug,trace:A.trace,verbose:A.verbose,printBoxedLog:function e(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(t===null||t===void 0?void 0:t.length)){A.box(D.green(e));return}t.forEach(function(e){var t=e.file,n=e.position,o=e.rule,a=e.message;A.log("".concat(D.gray("File:")," ").concat(D.blue("".concat(t).concat(n?":".concat(n):"")))),o&&A.log(" ".concat(x(r)("Rule:")," ").concat(o)),A.log(" ".concat(x(r)("Message:")," ").concat(a))}),A.box(x(r)("".concat(e," : ").concat(t.length))),A.log(D.gray("─".repeat(40)))}};var M={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};import U from"node-fetch";var K=function(e){return e.CLI="CLI",e.STRING="STRING",e.FUNCTION="FUNCTION",e}({});import W from"fs-extra";import B from"node:path";var Y=k(),J=B;function H(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}var n;return(n=J).resolve.apply(n,[Y.CWD].concat(d(t)))}h(H,"resolveWorkingPath");function $(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}var n;return(n=J).join.apply(n,d(t))}h($,"join");var q=k(),Q=q.CWD,V="@cyberskill/shared",z="node_modules",X="dist",Z="package.json",ee="package-lock.json",et="tsconfig.json",er=".gitignore",en=".simple-git-hooks.json",eo="pnpm-lock.yaml",ea=".git/hooks/",ec=".git/COMMIT_EDITMSG",ei=".migrate-mongo.config.js",es=$(Q,z,V,X),eu="cyberskill",el="src/nodejs/cli/index.ts",ef="eslint",ed="eslint",em="vitest",ep="playwright",ev="vitest",eg="@commitlint/cli",eh="commitlint",ey="lint-staged",eI="lint-staged",eb="typescript",eE="tsc",eC="tsx",eS="git",eO="pnpm",ew="pnpm exec",eT="simple-git-hooks",eG="simple-git-hooks",e_="@eslint/config-inspector",eL="eslint-config-inspector",eN="node-modules-inspector",ek="node-modules-inspector",eR="migrate-mongo",eD="./node_modules/migrate-mongo/bin/migrate-mongo",eA={CYBERSKILL_DIRECTORY:es,WORKING_DIRECTORY:Q,TS_CONFIG:H(et),GIT_IGNORE:H(er),GIT_HOOK:H(ea),GIT_COMMIT_MSG:H(ec),SIMPLE_GIT_HOOKS_JSON:H(en),PACKAGE_JSON:H(Z),PACKAGE_LOCK_JSON:H(ee),PNPM_LOCK_YAML:H(eo),NODE_MODULES:H(z),MIGRATE_MONGO_CONFIG:H(ei),LINT_STAGED_CONFIG:H("".concat(es,"/configs/lint-staged/index.js")),COMMITLINT_CONFIG:H("".concat(es,"/configs/commitlint/index.js")),UNIT_TEST_CONFIG:H("".concat(es,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:H("".concat(es,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:H("".concat(es,"/react/vitest/vitest.e2e.js"))};function ej(e,t,r){return o(function(){return v(this,function(n){switch(n.label){case 0:if(!t)throw new Error("'first' argument is undefined");switch(e){case K.CLI:return[3,1];case K.STRING:return[3,3]}return[3,4];case 1:return[4,eX(t.split(" "),{update:!0})];case 2:return[2,(n.sent(),to(tr("".concat(ew," ").concat(r))))];case 3:return[2,to(tr(t))];case 4:throw new Error("Unsupported command type");case 5:return[2]}})})()}h(ej,"buildCommand");function eP(e,t,r){return function(){return o(function(){return v(this,function(n){return[2,ej(e,t,r)]})})()}}h(eP,"commandFactory");var ex={simpleGitHooks:eP(K.CLI,eT,eG),eslintInspect:eP(K.CLI,e_,eL),nodeModulesInspect:eP(K.CLI,eN,ek),eslintCheck:eP(K.CLI,ef,"".concat(ed," ").concat(eA.WORKING_DIRECTORY," --no-cache")),eslintFix:eP(K.CLI,ef,"".concat(ed," ").concat(eA.WORKING_DIRECTORY," --fix --no-cache")),typescriptCheck:eP(K.CLI,eb,"".concat(eE," -p ").concat(eA.TS_CONFIG," --noEmit")),configureGitHook:eP(K.STRING,"".concat(eS," config core.hooksPath ").concat(eA.GIT_HOOK)),testUnit:eP(K.CLI,em,"".concat(ev," --config ").concat(eA.UNIT_TEST_CONFIG)),testE2e:eP(K.CLI,"".concat(em," ").concat(ep),"".concat(ev," --config ").concat(eA.E2E_TEST_CONFIG)),mongoMigrateCreate:h(function(e){return eP(K.CLI,eR,"".concat(eC," ").concat(eD," create ").concat(e," -f ").concat(eA.MIGRATE_MONGO_CONFIG))()},"mongoMigrateCreate"),mongoMigrateUp:eP(K.CLI,eR,"".concat(eC," ").concat(eD," up -f ").concat(eA.MIGRATE_MONGO_CONFIG)),mongoMigrateDown:eP(K.CLI,eR,"".concat(eC," ").concat(eD," down -f ").concat(eA.MIGRATE_MONGO_CONFIG)),commitLint:eP(K.CLI,eg,"".concat(eh," --edit ").concat(eA.GIT_COMMIT_MSG," --config ").concat(eA.COMMITLINT_CONFIG)),lintStaged:eP(K.CLI,ey,"".concat(eI," --config ").concat(eA.LINT_STAGED_CONFIG)),stageBuildDirectory:eP(K.STRING,"".concat(eS," add ").concat(X)),build:eP(K.STRING,"".concat(eO," run build")),pnpmInstallStandard:eP(K.STRING,"".concat(eO," install")),pnpmInstallLegacy:eP(K.STRING,"".concat(eO," install --legacy-peer-deps")),pnpmInstallForce:eP(K.STRING,"".concat(eO," install --force"))};var eF=W.lstatSync,eM=W.readdirSync,eU=W.mkdirSync,eK=W.readFileSync,eW=W.unlinkSync,eB=W.statSync,eY=W.readJsonSync;function eJ(e,t,r){W.writeFileSync(e,t,r!==null&&r!==void 0?r:"utf-8")}h(eJ,"writeFileSync");function eH(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return t.every(function(e){return W.pathExistsSync(e)})}h(eH,"pathExistsSync");var e$=k();function eq(e){var t=$(e$.CWD,Z);if(!eH(t))return!1;try{var r=eY(t),n=r.name,o=r.dependencies,a=o===void 0?{}:o,c=r.devDependencies,i=c===void 0?{}:c,s=n===e,u=e in a,l=e in i;return s||u||l?{path:t,file:r,isCurrentProject:s,isDepend:u,isDevDepend:l}:!1}catch(e){return F.warn("Failed to read package.json: ".concat(e.message)),!1}}h(eq,"getPackage");function eQ(e){return o(function(){var t,r,n,o;return v(this,function(a){switch(a.label){case 0:a.trys.push([0,3,,4]);return[4,U("https://registry.npmjs.org/".concat(e,"/latest"))];case 1:t=a.sent();if(!t.ok)throw new Error("Failed to fetch latest version: ".concat(t.status," ").concat(t.statusText));return[4,t.json()];case 2:r=a.sent(),n=r.version;return[2,n];case 3:o=a.sent();throw F.error('Failed to fetch version for "'.concat(e,'": ').concat(o.message)),o;case 4:return[2]}})})()}h(eQ,"getLatestPackageVersion");function eV(e,t){return o(function(){var r,n,o,a,c,i,s,u,f,d,m,p,g,h,y,I,b,E,C,S,O;return v(this,function(v){switch(v.label){case 0:v.trys.push([0,4,,5]);r=eq(e);if(!r)return[2,l({},M)];s=r.path,u=r.file,f=r.isCurrentProject,d=r.isDepend,m=r.isDevDepend,p=(n=u.dependencies)!==null&&n!==void 0?n:{},g=(o=u.devDependencies)!==null&&o!==void 0?o:{},h=f?(a=u.version)!==null&&a!==void 0?a:"0.0.0":d?(c=p[e])!==null&&c!==void 0?c:"0.0.0":m?(i=g[e])!==null&&i!==void 0?i:"0.0.0":"0.0.0";if(!f)return[3,1];b=h;return[3,3];case 1:return[4,eQ(e)];case 2:b=v.sent();v.label=3;case 3:y=b,I=f||h===y;if(!I&&(t===null||t===void 0?void 0:t.update)){;C=d?"dependencies":m?"devDependencies":null;C&&((E=u[C])===null||E===void 0?void 0:E[e])!==y&&(u[C]=(S=u[C])!==null&&S!==void 0?S:{},u[C][e]=y,eJ(s,JSON.stringify(u,null,4)),F.info('Updated "'.concat(e,'" to version ').concat(y)))}return[2,{isCurrentProject:f,installedPath:s,file:u,isUpToDate:I}];case 4:O=v.sent();return[2,(F.error('Error checking package "'.concat(e,'": ').concat(O.message)),l({},M))];case 5:return[2]}})})()}h(eV,"checkPackage");function ez(){return o(function(){var e,t,r,n,o,a,c,i,s,u,l,f;return v(this,function(d){switch(d.label){case 0:e=[{command:h(function(){return ex.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:h(function(){return ex.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:h(function(){return ex.pnpmInstallForce()},"command"),message:"Retrying with force install"}];t=true,r=false,n=undefined;d.label=1;case 1:d.trys.push([1,9,10,11]);o=e[Symbol.iterator]();d.label=2;case 2:if(!!(t=(a=o.next()).done))return[3,8];c=a.value,i=c.command,s=c.message;d.label=3;case 3:d.trys.push([3,6,,7]);return[4,i()];case 4:u=d.sent();return[4,tc("".concat(s," using: ").concat(u),u)];case 5:d.sent();return[2];case 6:l=d.sent();F.warn("Installation attempt failed: ".concat(s)),F.error("Details: ".concat(l.message));return[3,7];case 7:t=true;return[3,2];case 8:return[3,11];case 9:f=d.sent();r=true;n=f;return[3,11];case 10:try{if(!t&&o.return!=null){o.return()}}finally{if(r){throw n}}return[7];case 11:throw new Error("All dependency installation strategies failed.")}})})()}h(ez,"installDependencies");function eX(e,t){return o(function(){var r,n,o,a,c,i,s,u,f,m,p;return v(this,function(v){switch(v.label){case 0:if(!eH(eA.PACKAGE_JSON)){F.error("package.json not found. Aborting setup.");return[2]}v.label=1;case 1:v.trys.push([1,13,,14]);r=d(new Set(e)).sort();return[4,Promise.all(r.map(function(e){return eV(e,l({},(t===null||t===void 0?void 0:t.update)&&{update:t.update}))}))];case 2:n=v.sent().every(function(e){return e.isUpToDate});if(n)return[3,4];return[4,ez()];case 3:n=v.sent();v.label=4;case 4:n;a=true,c=false,i=undefined;v.label=5;case 5:v.trys.push([5,10,11,12]);s=((o=t===null||t===void 0?void 0:t.postInstallActions)!==null&&o!==void 0?o:[])[Symbol.iterator]();v.label=6;case 6:if(!!(a=(u=s.next()).done))return[3,9];f=u.value;return[4,f()];case 7:v.sent();v.label=8;case 8:a=true;return[3,6];case 9:return[3,12];case 10:m=v.sent();c=true;i=m;return[3,12];case 11:try{if(!a&&s.return!=null){s.return()}}finally{if(c){throw i}}return[7];case 12:return[3,14];case 13:p=v.sent();throw F.error('Failed to setup "'.concat(e.join(", "),'": ').concat(p.message)),p;case 14:return[2]}})})()}h(eX,"setupPackages");import eZ from"node-persist";var e0=k();function e1(){return o(function(){var e;return v(this,function(t){switch(t.label){case 0:e=eZ.defaultInstance;if(e)return[3,2];return[4,eZ.init({dir:e0.CYBERSKILL_STORAGE_DIRECTORY,stringify:JSON.stringify,parse:JSON.parse,encoding:"utf8",logging:!1,forgiveParseErrors:!0})];case 1:e=t.sent();t.label=2;case 2:e;return[2]}})})()}h(e1,"initNodePersist");var e2={get:function e(e){return o(function(){var t,r;return v(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,e1()];case 1:n.sent();return[4,eZ.getItem(e)];case 2:return[2,(t=n.sent())!==null&&t!==void 0?t:null];case 3:r=n.sent();return[2,(F.error('[Storage:get] Error getting key "'.concat(e,'":'),r),null)];case 4:return[2]}})})()},set:function e(e,t){return o(function(){var r;return v(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,e1()];case 1:n.sent();return[4,eZ.setItem(e,t)];case 2:n.sent();return[3,4];case 3:r=n.sent();F.error('[Storage:set] Error setting key "'.concat(e,'":'),r);return[3,4];case 4:return[2]}})})()},remove:function e(e){return o(function(){var t;return v(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,e1()];case 1:r.sent();return[4,eZ.removeItem(e)];case 2:r.sent();return[3,4];case 3:t=r.sent();F.error('[Storage:remove] Error removing key "'.concat(e,'":'),t);return[3,4];case 4:return[2]}})})()},keys:function e(){return o(function(){var e,t;return v(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,e1()];case 1:r.sent();return[4,eZ.keys()];case 2:e=r.sent();return[2,Array.isArray(e)?e:(F.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=r.sent();return[2,(F.error("[Storage:keys] Error getting keys:",t),[])];case 4:return[2]}})})()},getLogLink:function e(e){return o(function(){return v(this,function(t){try{return[2,"".concat(e0.CYBERSKILL_STORAGE_DIRECTORY," (key: ").concat(e,")")]}catch(e){return[2,(F.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var e3=k(),e4=b.promisify(y);function e5(e){return"error_list:".concat(e)}h(e5,"getErrorListKey");function e6(e){return o(function(){var t,r,n;return v(this,function(a){switch(a.label){case 0:if(e.length===0)return[2];t=Date.now(),r=e5(t);a.label=1;case 1:a.trys.push([1,3,,4]);return[4,e2.set(r,{errors:e,timestamp:t})];case 2:a.sent(),setTimeout(function(){return o(function(){var e;return v(this,function(t){switch(t.label){case 0:return[4,e2.getLogLink(r)];case 1:e=t.sent();e&&F.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})})()},10);return[3,4];case 3:n=a.sent();F.error("Failed to save errors: ".concat(n.message));return[3,4];case 4:return[2]}})})()}h(e6,"saveErrorListToStorage");function e8(){return o(function(){var e,t,r;return v(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,e2.keys()];case 1:e=n.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(function(e){return o(function(){var t;return v(this,function(r){switch(r.label){case 0:return[4,e2.get(e)];case 1:return[2,((t=r.sent())===null||t===void 0?void 0:t.errors)||[]]}})})()}))];case 2:return[2,n.sent().flat()];case 3:r=n.sent();return[2,(F.error("Failed to retrieve stored errors: ".concat(r.message)),[])];case 4:return[2]}})})()}h(e8,"getStoredErrorLists");function e7(){return o(function(){var e,t,r;return v(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,e2.keys()];case 1:e=n.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(function(e){return e2.remove(e)}))];case 2:n.sent();return[3,4];case 3:r=n.sent();F.error("Failed to clear error lists: ".concat(r.message));return[3,4];case 4:return[2]}})})()}h(e7,"clearAllErrorLists");function e9(e){var t=[],r=[],n="",o=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,a=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,c=/^✖\s+(.*?)\s+\[(.*?)\]$/;e.split("\n").forEach(function(e){if(e.startsWith("/"))n=e.trim();else{var i,s,u,l,f;var d=o.exec(e)||[],m=a.exec(e)||[],p=c.exec(e)||[];var v,g,h,y,I,b;d.length&&n?t.push({file:n,position:"".concat(d[1],":").concat(d[2]),type:d[3]===R.Error?R.Error:R.Warning,message:(v=d===null||d===void 0?void 0:(i=d[4])===null||i===void 0?void 0:i.trim())!==null&&v!==void 0?v:"",rule:(g=d===null||d===void 0?void 0:(s=d[5])===null||s===void 0?void 0:s.trim())!==null&&g!==void 0?g:""}):m.length?t.push({file:(h=m===null||m===void 0?void 0:m[1])!==null&&h!==void 0?h:"",position:"".concat(m[2],":").concat(m[3]),type:m[4]===R.Error?R.Error:R.Warning,message:(y=m===null||m===void 0?void 0:(u=m[5])===null||u===void 0?void 0:u.trim())!==null&&y!==void 0?y:""}):p.length?t.push({file:"commitlint",type:R.Error,message:(I=p===null||p===void 0?void 0:(l=p[1])===null||l===void 0?void 0:l.trim())!==null&&I!==void 0?I:"",rule:(b=p===null||p===void 0?void 0:(f=p[2])===null||f===void 0?void 0:f.trim())!==null&&b!==void 0?b:""}):r.push(e.trim())}}),t.length&&e6(t),e3.DEBUG&&r.length&&(F.warn("Unmatched lines:"),r.forEach(function(e){return F.info(" ".concat(e))}))}h(e9,"parseTextErrors");function te(e){try{var t=JSON.parse(e),r=[];t.forEach(function(e){var t=e.filePath,n=e.messages;n.forEach(function(e){var n=e.severity,o=e.line,a=e.column,c=e.ruleId,i=e.message;r.push({type:n===2?R.Error:R.Warning,file:t,position:"".concat(o,":").concat(a),rule:c,message:i})})}),r.length&&e6(r)}catch(t){e9(e)}}h(te,"parseCommandOutput");function tt(e){return o(function(e){var t,r,n,o,a,c,i,s,u;var l=arguments;return v(this,function(f){switch(f.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:te;r=new AbortController;I.on("SIGINT",function(){F.warn("Process interrupted. Terminating..."),r.abort(),I.exit()});f.label=1;case 1:f.trys.push([1,4,,5]);if(!(typeof e=="string"))return[3,3];return[4,e4(e,{maxBuffer:0x6400000,signal:r.signal})];case 2:n=f.sent(),o=n.stdout,a=n.stderr;[o,a].forEach(function(e){return e&&t(e)});f.label=3;case 3:return[3,5];case 4:c=f.sent();i=c.stdout,s=c.stderr,u=c.message;[i,s].forEach(function(e){return e&&t(e)}),!s&&!i&&F.error("Command failed: ".concat(u));return[3,5];case 5:return[2]}})}).apply(this,arguments)}h(tt,"executeCommand");function tr(e){return{raw:!0,cmd:e}}h(tr,"rawCommand");function tn(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(ew," ").concat(V," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(ew," ").concat(eC," ").concat(el," ").concat(e):"".concat(ew," ").concat(eu," ").concat(e)}h(tn,"formatCLI");function to(e,t){return typeof e=="function"?tn(e(t),t):(typeof e==="undefined"?"undefined":m(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?tn(e,t):e}h(to,"formatCommand");function ta(e){return o(function(e){var t,r,n,o,a,c,i;var s=arguments;return v(this,function(u){switch(u.label){case 0:t=s.length>1&&s[1]!==void 0?s[1]:{};n=(r=t===null||t===void 0?void 0:t.isRemote)!==null&&r!==void 0?r:!1;if(!n)return[3,1];i=!1;return[3,3];case 1:return[4,eV(V)];case 2:i=u.sent().isCurrentProject;u.label=3;case 3:o=i,a={isRemote:n,isCurrentProject:o},c=typeof e=="function"?e(a):e;return[2,Object.fromEntries(Object.entries(c).map(function(e){var t=f(e,2),r=t[0],n=t[1];return[r,to(n,a)]}))]}})}).apply(this,arguments)}h(ta,"resolveCommands");function tc(e,t){return o(function(){var r;return v(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);F.start("".concat(e)),e3.DEBUG&&F.info("→ ".concat(t));return[4,tt(t)];case 1:n.sent(),F.success("".concat(e," done."));return[3,3];case 2:r=n.sent();throw F.error("".concat(e," failed: ").concat(r.message)),r;case 3:return[2]}})})()}h(tc,"runCommand");export{e7 as clearAllErrorLists,to as formatCommand,e8 as getStoredErrorLists,tr as rawCommand,ta as resolveCommands,tc as runCommand};
|