@cyberskill/shared 1.53.0 → 1.54.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/dist/_tsup-dts-rollup.d.cts +1 -1
- package/dist/_tsup-dts-rollup.d.ts +1 -1
- package/dist/cli.cjs +1 -1
- package/dist/cli.js +1 -1
- package/dist/configs/graphql/graphql-codegen.cjs +1 -1
- package/dist/configs/graphql/graphql-codegen.js +1 -1
- package/dist/configs/graphql/index.cjs +1 -1
- package/dist/configs/graphql/index.js +1 -1
- package/dist/configs/vitest/react/unit.cjs +1 -1
- package/dist/configs/vitest/react/unit.js +1 -1
- package/dist/constants/index.cjs +1 -1
- package/dist/constants/index.js +1 -1
- package/dist/constants/path.cjs +1 -1
- package/dist/constants/path.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/utils/command.cjs +1 -1
- package/dist/utils/command.js +1 -1
- package/dist/utils/index-nodejs.cjs +1 -1
- package/dist/utils/index-nodejs.js +1 -1
- package/dist/utils/package.cjs +1 -1
- package/dist/utils/package.js +1 -1
- package/dist/utils/path.cjs +1 -1
- package/dist/utils/path.js +1 -1
- package/dist/utils/storage-server.cjs +1 -1
- package/dist/utils/storage-server.js +1 -1
- package/package.json +16 -18
|
@@ -1 +1 @@
|
|
|
1
|
-
function t(t,
|
|
1
|
+
function t(t,r){if(r==null||r>t.length)r=t.length;for(var n=0,e=new Array(r);n<r;n++)e[n]=t[n];return e}function r(t){if(Array.isArray(t))return t}function n(r){if(Array.isArray(r))return t(r)}function e(t,r,n,e,o,c,i){try{var a=t[c](i);var s=a.value}catch(t){n(t);return}if(a.done){r(s)}else{Promise.resolve(s).then(e,o)}}function o(t){return function(){var r=this,n=arguments;return new Promise(function(o,c){var i=t.apply(r,n);function a(t){e(i,o,c,a,s,"next",t)}function s(t){e(i,o,c,a,s,"throw",t)}a(undefined)})}}function c(t){if(typeof Symbol!=="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function i(t,r){var n=t==null?null:typeof Symbol!=="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(n==null)return;var e=[];var o=true;var c=false;var i,a;try{for(n=n.call(t);!(o=(i=n.next()).done);o=true){e.push(i.value);if(r&&e.length===r)break}}catch(t){c=true;a=t}finally{try{if(!o&&n["return"]!=null)n["return"]()}finally{if(c)throw a}}return e}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 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 u(t,n){return r(t)||i(t,n)||_(t,n)||a()}function l(t){return n(t)||c(t)||_(t)||s()}function f(t){"@swc/helpers - typeof";return t&&typeof Symbol!=="undefined"&&t.constructor===Symbol?"symbol":typeof t}function _(r,n){if(!r)return;if(typeof r==="string")return t(r,n);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor)e=r.constructor.name;if(e==="Map"||e==="Set")return Array.from(e);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return t(r,n)}function p(t,r){var n,e,o,c,i={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]};return c={next:a(0),"throw":a(1),"return":a(2)},typeof Symbol==="function"&&(c[Symbol.iterator]=function(){return this}),c;function a(t){return function(r){return s([t,r])}}function s(c){if(n)throw new TypeError("Generator is already executing.");while(i)try{if(n=1,e&&(o=c[0]&2?e["return"]:c[0]?e["throw"]||((o=e["return"])&&o.call(e),0):e.next)&&!(o=o.call(e,c[1])).done)return o;if(e=0,o)c=[c[0]&2,o.value];switch(c[0]){case 0:case 1:o=c;break;case 4:i.label++;return{value:c[1],done:false};case 5:i.label++;e=c[1];c=[0];continue;case 7:c=i.ops.pop();i.trys.pop();continue;default:if(!(o=i.trys,o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){i=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(c[0]===6&&i.label<o[1]){i.label=o[1];o=c;break}if(o&&i.label<o[2]){i.label=o[2];i.ops.push(c);break}if(o[2])i.ops.pop();i.trys.pop();continue}c=r.call(t,i)}catch(t){c=[6,t];e=0}finally{n=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}}import E from"node-persist";import y from"node:os";import I from"node:process";import m from"node:process";import g from"boxen";import d from"chalk";import{exec as N}from"node:child_process";import S from"node:process";import*as T from"node:util";import h from"node-fetch";import*as v from"node:path";function C(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++){r[n]=arguments[n]}var e;return(e=v).resolve.apply(e,[k].concat(l(r)))}function A(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++){r[n]=arguments[n]}var e;return(e=v).join.apply(e,l(r))}var O=24*60*60*1e3;var b=S.env.DEBUG==="true",D=T.promisify(N),P=d.gray,L=d.blue;function G(t){return{raw:!0,cmd:t}}function M(t,r){return(r===null||r===void 0?void 0:r.isRemote)?"".concat(ts," ").concat(w," ").concat(t):(r===null||r===void 0?void 0:r.isCurrentProject)?"".concat(ts," ").concat(tc," src/cli.ts ").concat(t):"".concat(ts," ").concat(q," ").concat(t)}function R(t,r){return typeof t=="function"?M(t(r),r):(typeof t==="undefined"?"undefined":f(t))=="object"&&(t===null||t===void 0?void 0:t.raw)===!0?t.cmd:typeof t=="string"?M(t,r):t}var k=m.env.INIT_CWD||m.cwd(),w="@cyberskill/shared",K=".cyberskill-storage",j="node_modules",Y="dist",F="package.json",X="package-lock.json",U="tsconfig.json",x=".gitignore",B=".simple-git-hooks.json",W="pnpm-lock.yaml",H=".git/hooks/",J=".git/COMMIT_EDITMSG",$=A(k,j,w,Y),q="cyberskill",z="eslint",Q="vitest",V="vitest",Z="@commitlint/cli",tt="commitlint",tr="lint-staged",tn="lint-staged",te="typescript",to="tsc",tc="tsx",ti="git",ta="pnpm",ts="pnpm exec",tu="simple-git-hooks",tl="simple-git-hooks",tf="@eslint/config-inspector",t_="eslint-config-inspector",tp="node-modules-inspector",tE="node-modules-inspector",ty={CYBERSKILL_DIRECTORY:$,WORKING_DIRECTORY:k,TS_CONFIG:C(U),GIT_IGNORE:C(x),GIT_HOOK:C(H),GIT_COMMIT_MSG:C(J),SIMPLE_GIT_HOOKS_JSON:C(B),PACKAGE_JSON:C(F),PACKAGE_LOCK_JSON:C(X),PNPM_LOCK_YAML:C(W),NODE_MODULES:C(j),CYBERSKILL:{LINT_STAGED_CONFIG:C("".concat($,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:C("".concat($,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:C("".concat($,"/configs/vitest/react/unit.js")),UNIT_TEST_SETUP_CONFIG:C("".concat($,"/configs/vitest/react/unit.setup.js")),E2E_TEST_CONFIG:C("".concat($,"/configs/vitest/react/e2e.js"))}};function tI(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),e=1;e<r;e++){n[e-1]=arguments[e]}var o=u(n,2),c=o[0],i=o[1];switch(t){case"PNPM_ADD_AND_EXEC":return R(G("".concat(ta," add -D ").concat(c," && ").concat(ts," ").concat(i)));case"PNPM_EXEC":return R(G("".concat(ts," ").concat(c," ").concat(i||"").trim()));case"RAW":return R(G(c))}}var tm={SIMPLE_GIT_HOOKS:tI("PNPM_ADD_AND_EXEC",tu,tl),ESLINT_INSPECT:tI("PNPM_ADD_AND_EXEC",tf,t_),NODE_MODULES_INSPECT:tI("PNPM_ADD_AND_EXEC",tp,tE),ESLINT_CHECK:tI("PNPM_EXEC",z,ty.WORKING_DIRECTORY),ESLINT_FIX:tI("PNPM_EXEC",z,"".concat(ty.WORKING_DIRECTORY," --fix")),TYPESCRIPT_CHECK:tI("PNPM_ADD_AND_EXEC",te,"".concat(to," -p ").concat(ty.TS_CONFIG," --noEmit")),CONFIGURE_GIT_HOOK:tI("RAW","".concat(ti," config core.hooksPath ").concat(ty.GIT_HOOK)),BUILD:tI("RAW","".concat(ta," run build")),STAGE_BUILD_DIRECTORY:tI("RAW","".concat(ti," add ").concat(Y)),PNPM_INSTALL_STANDARD:tI("RAW","".concat(ta," install")),PNPM_INSTALL_LEGACY:tI("RAW","".concat(ta," install --legacy-peer-deps")),PNPM_INSTALL_FORCE:tI("RAW","".concat(ta," install --force")),CYBERSKILL:{TEST_UNIT:tI("PNPM_ADD_AND_EXEC",Q,"".concat(V," --config ").concat(ty.CYBERSKILL.UNIT_TEST_CONFIG)),TEST_E2E:tI("PNPM_ADD_AND_EXEC",Q,"".concat(V," --config ").concat(ty.CYBERSKILL.E2E_TEST_CONFIG)),COMMIT_LINT:tI("PNPM_ADD_AND_EXEC",Z,"".concat(tt," --edit ").concat(ty.GIT_COMMIT_MSG," --config ").concat(ty.CYBERSKILL.COMMITLINT_CONFIG)),LINT_STAGED:tI("PNPM_ADD_AND_EXEC",tr,"".concat(tn," --config ").concat(ty.CYBERSKILL.LINT_STAGED_CONFIG))}};function tg(){return I.env.CYBERSKILL_STORAGE_DIR||A(y.homedir(),K)}function td(){return tN.apply(this,arguments)}function tN(){tN=o(function(){var t;return p(this,function(r){switch(r.label){case 0:t=E.defaultInstance;if(t)return[3,2];return[4,E.init({dir:tg(),stringify:JSON.stringify,parse:JSON.parse,encoding:"utf8",logging:!1,forgiveParseErrors:!0})];case 1:t=r.sent();r.label=2;case 2:t;return[2]}})});return tN.apply(this,arguments)}var tS={get:function t(t){return o(function(){var r,n;return p(this,function(e){switch(e.label){case 0:e.trys.push([0,3,,4]);return[4,td()];case 1:e.sent();return[4,E.getItem(t)];case 2:return[2,(r=e.sent())!==null&&r!==void 0?r:null];case 3:n=e.sent();return[2,(console.error('❌ [Storage:get] Error getting key "'.concat(t,'":'),n),null)];case 4:return[2]}})})()},set:function t(t,r){return o(function(){var n;return p(this,function(e){switch(e.label){case 0:e.trys.push([0,3,,4]);return[4,td()];case 1:e.sent();return[4,E.setItem(t,r)];case 2:e.sent();return[3,4];case 3:n=e.sent();console.error('❌ [Storage:set] Error setting key "'.concat(t,'":'),n);return[3,4];case 4:return[2]}})})()},remove:function t(t){return o(function(){var r;return p(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,td()];case 1:n.sent();return[4,E.removeItem(t)];case 2:n.sent();return[3,4];case 3:r=n.sent();console.error('❌ [Storage:remove] Error removing key "'.concat(t,'":'),r);return[3,4];case 4:return[2]}})})()},keys:function t(){return o(function(){var t,r;return p(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,td()];case 1:n.sent();return[4,E.keys()];case 2:t=n.sent();return[2,Array.isArray(t)?t:(console.warn("⚠️ [Storage:keys] Invalid keys response:",t),[])];case 3:r=n.sent();return[2,(console.error("❌ [Storage:keys] Error getting keys:",r),[])];case 4:return[2]}})})()},getLogLink:function t(t){return o(function(){return p(this,function(r){try{return[2,"".concat(tg()," (key: ").concat(t,")")]}catch(t){return[2,(console.error("❌ [Storage:getLogLink] Error getting log link:",t),null)]}return[2]})})()}};export{tg as getStorageDir,td as initNodePersist,tS as storageServer};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cyberskill/shared",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.54.0",
|
|
5
5
|
"description": "CyberSkill Shared",
|
|
6
6
|
"author": "Stephen Cheng",
|
|
7
7
|
"license": "MIT",
|
|
@@ -152,12 +152,12 @@
|
|
|
152
152
|
"scripts": {
|
|
153
153
|
"build": "tsup",
|
|
154
154
|
"dev": "tsup --watch",
|
|
155
|
-
"lint": "
|
|
156
|
-
"lint:fix": "
|
|
157
|
-
"lint:inspect": "
|
|
158
|
-
"reset": "
|
|
159
|
-
"setup": "
|
|
160
|
-
"inspect": "
|
|
155
|
+
"lint": "tsx src/cli.ts lint",
|
|
156
|
+
"lint:fix": "tsx src/cli.ts lint:fix",
|
|
157
|
+
"lint:inspect": "tsx src/cli.ts lint:inspect",
|
|
158
|
+
"reset": "tsx src/cli.ts reset",
|
|
159
|
+
"setup": "tsx src/cli.ts setup",
|
|
160
|
+
"inspect": "tsx src/cli.ts inspect"
|
|
161
161
|
},
|
|
162
162
|
"dependencies": {
|
|
163
163
|
"@antfu/eslint-config": "4.11.0",
|
|
@@ -171,14 +171,6 @@
|
|
|
171
171
|
"@swc/core": "1.11.16",
|
|
172
172
|
"@testing-library/jest-dom": "6.6.3",
|
|
173
173
|
"@testing-library/react": "16.3.0",
|
|
174
|
-
"@types/crypto-js": "4.2.2",
|
|
175
|
-
"@types/mongoose-aggregate-paginate-v2": "1.0.12",
|
|
176
|
-
"@types/node-persist": "3.1.8",
|
|
177
|
-
"@types/react": "19.1.0",
|
|
178
|
-
"@types/react-dom": "19.1.1",
|
|
179
|
-
"@types/unorm": "1.3.31",
|
|
180
|
-
"@types/uuid": "10.0.0",
|
|
181
|
-
"@types/yargs": "17.0.33",
|
|
182
174
|
"@vitejs/plugin-react-swc": "3.8.1",
|
|
183
175
|
"@vitest/browser": "3.1.1",
|
|
184
176
|
"boxen": "8.0.1",
|
|
@@ -206,7 +198,6 @@
|
|
|
206
198
|
"node-fetch": "3.3.2",
|
|
207
199
|
"node-persist": "4.0.4",
|
|
208
200
|
"ora": "8.2.0",
|
|
209
|
-
"playwright": "1.51.1",
|
|
210
201
|
"postcss-modules": "6.0.1",
|
|
211
202
|
"react": "19.1.0",
|
|
212
203
|
"react-dom": "19.1.0",
|
|
@@ -215,7 +206,6 @@
|
|
|
215
206
|
"slugify": "1.6.6",
|
|
216
207
|
"tsup": "8.4.0",
|
|
217
208
|
"tsx": "4.19.3",
|
|
218
|
-
"typescript": "5.8.2",
|
|
219
209
|
"unorm": "1.6.0",
|
|
220
210
|
"uuid": "11.1.0",
|
|
221
211
|
"vite": "6.2.5",
|
|
@@ -230,9 +220,17 @@
|
|
|
230
220
|
"devDependencies": {
|
|
231
221
|
"@commitlint/cli": "19.8.0",
|
|
232
222
|
"@eslint/config-inspector": "1.0.2",
|
|
223
|
+
"@types/crypto-js": "4.2.2",
|
|
224
|
+
"@types/mongoose-aggregate-paginate-v2": "1.0.12",
|
|
225
|
+
"@types/node-persist": "3.1.8",
|
|
226
|
+
"@types/react": "19.1.0",
|
|
227
|
+
"@types/react-dom": "19.1.1",
|
|
228
|
+
"@types/unorm": "1.3.31",
|
|
229
|
+
"@types/uuid": "10.0.0",
|
|
230
|
+
"@types/yargs": "17.0.33",
|
|
233
231
|
"lint-staged": "15.5.0",
|
|
234
232
|
"node-modules-inspector": "0.6.0",
|
|
235
233
|
"simple-git-hooks": "2.12.1",
|
|
236
|
-
"
|
|
234
|
+
"typescript": "5.8.2"
|
|
237
235
|
}
|
|
238
236
|
}
|