@cyberskill/shared 2.27.0 → 3.0.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/config/config.util.cjs +1 -1
- package/dist/config/config.util.js +24 -33
- package/dist/config/eslint/index.cjs +1 -1
- package/dist/config/eslint/index.d.ts +6 -0
- package/dist/config/eslint/index.js +4 -12
- package/dist/config/graphql-codegen/graphql-codegen.util.cjs +1 -1
- package/dist/config/graphql-codegen/graphql-codegen.util.js +28 -33
- package/dist/config/storybook/storybook.preview.cjs +1 -1
- package/dist/config/storybook/storybook.preview.js +10 -13
- package/dist/config/vitest/vitest.e2e.cjs +1 -1
- package/dist/config/vitest/vitest.e2e.js +1 -1
- package/dist/config/vitest/vitest.unit.cjs +1 -1
- package/dist/config/vitest/vitest.unit.js +19 -8
- package/dist/constant/common.cjs +1 -1
- package/dist/constant/common.js +1 -1
- package/dist/node/apollo-server/apollo-server.util.cjs +1 -1
- package/dist/node/apollo-server/apollo-server.util.js +21 -48
- package/dist/node/cli/index.cjs +2 -5
- package/dist/node/cli/index.js +109 -170
- package/dist/node/command/command.util.cjs +2 -2
- package/dist/node/command/command.util.js +135 -170
- package/dist/node/express/express.util.cjs +1 -1
- package/dist/node/express/express.util.js +39 -72
- package/dist/node/fs/fs.util.cjs +4 -1
- package/dist/node/fs/fs.util.d.ts +8 -0
- package/dist/node/fs/fs.util.js +46 -53
- package/dist/node/fs/index.cjs +1 -1
- package/dist/node/fs/index.js +13 -12
- package/dist/node/log/log.util.cjs +1 -1
- package/dist/node/log/log.util.js +29 -30
- package/dist/node/mongo/mongo.controller.cjs +1 -1
- package/dist/node/mongo/mongo.controller.js +531 -629
- package/dist/node/mongo/mongo.type.js +3 -3
- package/dist/node/mongo/mongo.util.cjs +2 -5
- package/dist/node/mongo/mongo.util.js +308 -354
- package/dist/node/package/package.util.cjs +1 -1
- package/dist/node/package/package.util.js +197 -226
- package/dist/node/path/index.cjs +1 -1
- package/dist/node/path/index.js +26 -25
- package/dist/node/path/path.constant.cjs +1 -1
- package/dist/node/path/path.constant.d.ts +2 -0
- package/dist/node/path/path.constant.js +130 -150
- package/dist/node/storage/storage.util.cjs +1 -1
- package/dist/node/storage/storage.util.js +110 -158
- package/dist/node/upload/upload.util.cjs +1 -1
- package/dist/node/upload/upload.util.js +119 -150
- package/dist/node/ws/ts.util.cjs +1 -1
- package/dist/node/ws/ts.util.js +31 -54
- package/dist/react/apollo-client/apollo-client.component.cjs +1 -1
- package/dist/react/apollo-client/apollo-client.component.js +4 -4
- package/dist/react/apollo-client/apollo-client.util.cjs +1 -1
- package/dist/react/apollo-client/apollo-client.util.js +51 -58
- package/dist/react/apollo-client/links/upload.cjs +1 -1
- package/dist/react/apollo-client/links/upload.js +71 -74
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.util.cjs +1 -1
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.util.js +11 -18
- package/dist/react/apollo-error/apollo-error.component.cjs +1 -1
- package/dist/react/apollo-error/apollo-error.component.js +61 -23
- package/dist/react/apollo-error/apollo-error.module.scss.cjs +1 -1
- package/dist/react/apollo-error/apollo-error.module.scss.js +6 -6
- package/dist/react/apollo-error/apollo-error.test.unit.d.ts +1 -0
- package/dist/react/apollo-error/apollo-error.util.cjs +1 -1
- package/dist/react/apollo-error/apollo-error.util.js +6 -6
- package/dist/react/loading/loading.component.cjs +2 -2
- package/dist/react/loading/loading.component.js +30 -46
- package/dist/react/log/log.util.cjs +1 -1
- package/dist/react/log/log.util.js +4 -4
- package/dist/react/next-intl/next-intl.hoc.cjs +1 -1
- package/dist/react/next-intl/next-intl.hoc.js +13 -22
- package/dist/react/next-intl/next-intl.provider.cjs +1 -1
- package/dist/react/next-intl/next-intl.provider.js +7 -7
- package/dist/react/storage/storage.hook.cjs +1 -1
- package/dist/react/storage/storage.hook.js +43 -59
- package/dist/react/storage/storage.util.cjs +1 -1
- package/dist/react/storage/storage.util.js +28 -53
- package/dist/react/userback/userback.component.cjs +1 -1
- package/dist/react/userback/userback.component.js +18 -42
- package/dist/style.css +1 -1
- package/dist/util/common/common.util.cjs +1 -1
- package/dist/util/common/common.util.d.ts +11 -0
- package/dist/util/common/common.util.js +33 -37
- package/dist/util/common/index.cjs +1 -1
- package/dist/util/common/index.js +6 -5
- package/dist/util/index.cjs +1 -1
- package/dist/util/index.js +22 -20
- package/dist/util/object/object.util.cjs +1 -1
- package/dist/util/object/object.util.js +70 -70
- package/dist/util/string/index.cjs +1 -1
- package/dist/util/string/index.js +4 -3
- package/dist/util/string/string.util.cjs +1 -1
- package/dist/util/string/string.util.d.ts +12 -0
- package/dist/util/string/string.util.js +63 -44
- package/package.json +53 -44
- package/public/tsconfig.base.json +7 -3
- package/README.md +0 -470
- package/dist/node/mongo/mongo.util.d.ts +0 -1040
- /package/dist/node_modules/.pnpm/{vitest@4.0.17_@types_node@25.0.9_jiti@2.6.1_jsdom@27.4.0_@noble_hashes@1.8.0__sass@1.97.2_tsx@4.21.0_yaml@2.8.2 → vitest@4.0.18_@types_node@25.3.3_jiti@2.6.1_jsdom@28.1.0_@noble_hashes@1.8.0__sass@1.97.3_tsx@4.21.0_yaml@2.8.2}/node_modules/vitest/dist/config.cjs +0 -0
- /package/dist/node_modules/.pnpm/{vitest@4.0.17_@types_node@25.0.9_jiti@2.6.1_jsdom@27.4.0_@noble_hashes@1.8.0__sass@1.97.2_tsx@4.21.0_yaml@2.8.2 → vitest@4.0.18_@types_node@25.3.3_jiti@2.6.1_jsdom@28.1.0_@noble_hashes@1.8.0__sass@1.97.3_tsx@4.21.0_yaml@2.8.2}/node_modules/vitest/dist/config.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("@antfu/eslint-config"),n=require("./config.type.cjs"),i=require("./eslint/index.cjs"),f=require("./vitest/vitest.e2e.cjs"),g=require("./vitest/vitest.unit.cjs"),o=require("../util/object/object.util.cjs"),T=(...e)=>{const t=o.deepMerge(...Array.isArray(i.default)?i.default:[i.default],...e),{ignores:r,...s}=t;return u({stylistic:{semi:!0,indent:4},formatters:!0,yaml:!1,react:!0},s,...Array.isArray(r)?[{ignores:r}]:[])},a={[n.E_ConfigType.ESLINT]:e=>T(e),[n.E_ConfigType.COMMITLINT]:e=>o.deepMerge(e),[n.E_ConfigType.LINT_STAGED]:e=>o.deepMerge(e),[n.E_ConfigType.VITEST_REACT_UNIT]:e=>g.vitestUnit(e),[n.E_ConfigType.VITEST_REACT_E2E]:e=>f.vitestE2E(e)};function E(e,...t){const r=a[e];if(!t||t.length===0)return r({});if(!r)throw new Error(`Unknown config type: ${e}`);return r(...t)}exports.mergeConfigs=E;
|
|
@@ -1,24 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { E_ConfigType as
|
|
3
|
-
import
|
|
4
|
-
import { vitestE2E as
|
|
5
|
-
import { vitestUnit as
|
|
6
|
-
import { deepMerge as
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
l.call(r, t) && n.indexOf(t) < 0 && (e[t] = r[t]);
|
|
11
|
-
if (r != null && f)
|
|
12
|
-
for (var t of f(r))
|
|
13
|
-
n.indexOf(t) < 0 && E.call(r, t) && (e[t] = r[t]);
|
|
14
|
-
return e;
|
|
15
|
-
};
|
|
16
|
-
const y = (...r) => {
|
|
17
|
-
const e = a(
|
|
18
|
-
...Array.isArray(i) ? i : [i],
|
|
1
|
+
import f from "@antfu/eslint-config";
|
|
2
|
+
import { E_ConfigType as n } from "./config.type.js";
|
|
3
|
+
import o from "./eslint/index.js";
|
|
4
|
+
import { vitestE2E as m } from "./vitest/vitest.e2e.js";
|
|
5
|
+
import { vitestUnit as a } from "./vitest/vitest.unit.js";
|
|
6
|
+
import { deepMerge as i } from "../util/object/object.util.js";
|
|
7
|
+
const E = (...r) => {
|
|
8
|
+
const e = i(
|
|
9
|
+
...Array.isArray(o) ? o : [o],
|
|
19
10
|
...r
|
|
20
|
-
), { ignores: t } = e
|
|
21
|
-
return
|
|
11
|
+
), { ignores: t, ...s } = e;
|
|
12
|
+
return f(
|
|
22
13
|
{
|
|
23
14
|
stylistic: {
|
|
24
15
|
semi: !0,
|
|
@@ -28,24 +19,24 @@ const y = (...r) => {
|
|
|
28
19
|
yaml: !1,
|
|
29
20
|
react: !0
|
|
30
21
|
},
|
|
31
|
-
|
|
22
|
+
s,
|
|
32
23
|
...Array.isArray(t) ? [{ ignores: t }] : []
|
|
33
24
|
);
|
|
34
25
|
}, T = {
|
|
35
|
-
[
|
|
36
|
-
[
|
|
37
|
-
[
|
|
38
|
-
[
|
|
39
|
-
[
|
|
26
|
+
[n.ESLINT]: (r) => E(r),
|
|
27
|
+
[n.COMMITLINT]: (r) => i(r),
|
|
28
|
+
[n.LINT_STAGED]: (r) => i(r),
|
|
29
|
+
[n.VITEST_REACT_UNIT]: (r) => a(r),
|
|
30
|
+
[n.VITEST_REACT_E2E]: (r) => m(r)
|
|
40
31
|
};
|
|
41
|
-
function
|
|
42
|
-
const
|
|
43
|
-
if (!
|
|
44
|
-
return
|
|
45
|
-
if (!
|
|
32
|
+
function y(r, ...e) {
|
|
33
|
+
const t = T[r];
|
|
34
|
+
if (!e || e.length === 0)
|
|
35
|
+
return t({});
|
|
36
|
+
if (!t)
|
|
46
37
|
throw new Error(`Unknown config type: ${r}`);
|
|
47
|
-
return
|
|
38
|
+
return t(...e);
|
|
48
39
|
}
|
|
49
40
|
export {
|
|
50
|
-
|
|
41
|
+
y as mergeConfigs
|
|
51
42
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("globals");function s(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const r=s(l),a=[{languageOptions:{globals:{...r.node,...r.browser}},rules:{"perfectionist/sort-imports":["error",{internalPattern:["^#.*","^@/.*"]}],"dot-notation":"off"},ignores:["**/node_modules/**","**/.git/**","build","dist",".agent"]}];exports.default=a;
|
|
@@ -113,6 +113,8 @@ declare const _default: {
|
|
|
113
113
|
CookieStore: false;
|
|
114
114
|
CookieStoreManager: false;
|
|
115
115
|
CountQueuingStrategy: false;
|
|
116
|
+
crashReport: false;
|
|
117
|
+
CrashReportContext: false;
|
|
116
118
|
createImageBitmap: false;
|
|
117
119
|
CreateMonitor: false;
|
|
118
120
|
Credential: false;
|
|
@@ -373,6 +375,7 @@ declare const _default: {
|
|
|
373
375
|
HTMLFormElement: false;
|
|
374
376
|
HTMLFrameElement: false;
|
|
375
377
|
HTMLFrameSetElement: false;
|
|
378
|
+
HTMLGeolocationElement: false;
|
|
376
379
|
HTMLHeadElement: false;
|
|
377
380
|
HTMLHeadingElement: false;
|
|
378
381
|
HTMLHRElement: false;
|
|
@@ -700,6 +703,7 @@ declare const _default: {
|
|
|
700
703
|
Option: false;
|
|
701
704
|
OrientationSensor: false;
|
|
702
705
|
origin: false;
|
|
706
|
+
Origin: false;
|
|
703
707
|
originAgentCluster: false;
|
|
704
708
|
OscillatorNode: false;
|
|
705
709
|
OTPCredential: false;
|
|
@@ -739,6 +743,7 @@ declare const _default: {
|
|
|
739
743
|
PerformanceScriptTiming: false;
|
|
740
744
|
PerformanceServerTiming: false;
|
|
741
745
|
PerformanceTiming: false;
|
|
746
|
+
PerformanceTimingConfidence: false;
|
|
742
747
|
PeriodicSyncManager: false;
|
|
743
748
|
PeriodicWave: false;
|
|
744
749
|
Permissions: false;
|
|
@@ -1165,6 +1170,7 @@ declare const _default: {
|
|
|
1165
1170
|
XRView: false;
|
|
1166
1171
|
XRViewerPose: false;
|
|
1167
1172
|
XRViewport: false;
|
|
1173
|
+
XRVisibilityMaskChangeEvent: false;
|
|
1168
1174
|
XRWebGLBinding: false;
|
|
1169
1175
|
XRWebGLDepthInformation: false;
|
|
1170
1176
|
XRWebGLLayer: false;
|
|
@@ -1,16 +1,8 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
|
|
3
|
-
for (var e in r || (r = {}))
|
|
4
|
-
i.call(r, e) && n(o, e, r[e]);
|
|
5
|
-
if (a)
|
|
6
|
-
for (var e of a(r))
|
|
7
|
-
p.call(r, e) && n(o, e, r[e]);
|
|
8
|
-
return o;
|
|
9
|
-
};
|
|
10
|
-
const f = [
|
|
1
|
+
import * as o from "globals";
|
|
2
|
+
const t = [
|
|
11
3
|
{
|
|
12
4
|
languageOptions: {
|
|
13
|
-
globals:
|
|
5
|
+
globals: { ...o.node, ...o.browser }
|
|
14
6
|
},
|
|
15
7
|
rules: {
|
|
16
8
|
"perfectionist/sort-imports": ["error", {
|
|
@@ -22,5 +14,5 @@ const f = [
|
|
|
22
14
|
}
|
|
23
15
|
];
|
|
24
16
|
export {
|
|
25
|
-
|
|
17
|
+
t as default
|
|
26
18
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@eddeee888/gcg-typescript-resolver-files"),c=require("../env/env.util.cjs");c.loadEnvFile();function u({uri:t,from:i,to:e,target:n="client"}){const r=n==="client",o=n==="server";return{schema:t,ignoreNoDocuments:!0,overwrite:!0,...r&&{documents:[i]},generates:{...r&&{[e]:{preset:"client",presetConfig:{fragmentMasking:!1,persistedDocuments:!0},config:{useTypeImports:!0,namingConvention:"keep"}}},...o&&{[e]:s.defineConfig()}}}}exports.createGraphqlCodegenConfig=u;
|
|
@@ -1,43 +1,38 @@
|
|
|
1
|
-
import { defineConfig as
|
|
2
|
-
import { loadEnvFile as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
m.call(e, r) && p(t, r, e[r]);
|
|
6
|
-
if (i)
|
|
7
|
-
for (var r of i(e))
|
|
8
|
-
v.call(e, r) && p(t, r, e[r]);
|
|
9
|
-
return t;
|
|
10
|
-
}, g = (t, e) => u(t, _(e));
|
|
11
|
-
f();
|
|
12
|
-
function P({
|
|
1
|
+
import { defineConfig as s } from "@eddeee888/gcg-typescript-resolver-files";
|
|
2
|
+
import { loadEnvFile as c } from "../env/env.util.js";
|
|
3
|
+
c();
|
|
4
|
+
function p({
|
|
13
5
|
uri: t,
|
|
14
|
-
from:
|
|
15
|
-
to:
|
|
6
|
+
from: o,
|
|
7
|
+
to: e,
|
|
16
8
|
target: n = "client"
|
|
17
9
|
}) {
|
|
18
|
-
const
|
|
19
|
-
return
|
|
10
|
+
const r = n === "client", i = n === "server";
|
|
11
|
+
return {
|
|
20
12
|
schema: t,
|
|
21
13
|
ignoreNoDocuments: !0,
|
|
22
|
-
overwrite: !0
|
|
23
|
-
|
|
24
|
-
generates:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
14
|
+
overwrite: !0,
|
|
15
|
+
...r && { documents: [o] },
|
|
16
|
+
generates: {
|
|
17
|
+
...r && {
|
|
18
|
+
[e]: {
|
|
19
|
+
preset: "client",
|
|
20
|
+
presetConfig: {
|
|
21
|
+
fragmentMasking: !1,
|
|
22
|
+
persistedDocuments: !0
|
|
23
|
+
},
|
|
24
|
+
config: {
|
|
25
|
+
useTypeImports: !0,
|
|
26
|
+
namingConvention: "keep"
|
|
27
|
+
}
|
|
34
28
|
}
|
|
29
|
+
},
|
|
30
|
+
...i && {
|
|
31
|
+
[e]: s()
|
|
35
32
|
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
})
|
|
39
|
-
});
|
|
33
|
+
}
|
|
34
|
+
};
|
|
40
35
|
}
|
|
41
36
|
export {
|
|
42
|
-
|
|
37
|
+
p as createGraphqlCodegenConfig
|
|
43
38
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function a(e){const r={parameters:{controls:{matchers:{color:/(background|color)$/i,date:/Date$/i}},backgrounds:{default:"light",values:[{name:"light",value:"#ffffff"},{name:"dark",value:"#333333"}]}}};return{...r,...e,parameters:{...r.parameters,...e?.parameters}}}exports.storybookPreview=a;
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
for (var a in r || (r = {}))
|
|
3
|
-
f.call(r, a) && p(e, a, r[a]);
|
|
4
|
-
if (o)
|
|
5
|
-
for (var a of o(r))
|
|
6
|
-
c.call(r, a) && p(e, a, r[a]);
|
|
7
|
-
return e;
|
|
8
|
-
}, _ = (e, r) => n(e, l(r));
|
|
9
|
-
function i(e) {
|
|
1
|
+
function a(e) {
|
|
10
2
|
const r = {
|
|
11
3
|
parameters: {
|
|
12
4
|
controls: {
|
|
@@ -30,10 +22,15 @@ function i(e) {
|
|
|
30
22
|
}
|
|
31
23
|
}
|
|
32
24
|
};
|
|
33
|
-
return
|
|
34
|
-
|
|
35
|
-
|
|
25
|
+
return {
|
|
26
|
+
...r,
|
|
27
|
+
...e,
|
|
28
|
+
parameters: {
|
|
29
|
+
...r.parameters,
|
|
30
|
+
...e?.parameters
|
|
31
|
+
}
|
|
32
|
+
};
|
|
36
33
|
}
|
|
37
34
|
export {
|
|
38
|
-
|
|
35
|
+
a as storybookPreview
|
|
39
36
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@vitejs/plugin-react-swc"),i=require("../../node_modules/.pnpm/vitest@4.0.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@vitejs/plugin-react-swc"),i=require("../../node_modules/.pnpm/vitest@4.0.18_@types_node@25.3.3_jiti@2.6.1_jsdom@28.1.0_@noble_hashes@1.8.0__sass@1.97.3_tsx@4.21.0_yaml@2.8.2/node_modules/vitest/dist/config.cjs"),o=require("../../util/object/object.util.cjs");function n(e){const r={plugins:[t()],test:{include:["**/*.test.e2e.?(c|m)[jt]s?(x)"],browser:{enabled:!0,provider:"playwright",instances:[{browser:"chromium"},{browser:"firefox"},{browser:"webkit"}]}}};return i.defineConfig(o.deepMerge(r,e))}exports.vitestE2E=n;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import t from "@vitejs/plugin-react-swc";
|
|
2
|
-
import { defineConfig as o } from "../../node_modules/.pnpm/vitest@4.0.
|
|
2
|
+
import { defineConfig as o } from "../../node_modules/.pnpm/vitest@4.0.18_@types_node@25.3.3_jiti@2.6.1_jsdom@28.1.0_@noble_hashes@1.8.0__sass@1.97.3_tsx@4.21.0_yaml@2.8.2/node_modules/vitest/dist/config.js";
|
|
3
3
|
import { deepMerge as i } from "../../util/object/object.util.js";
|
|
4
4
|
function m(e) {
|
|
5
5
|
const r = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("@vitejs/plugin-react-swc"),i=require("../../node_modules/.pnpm/vitest@4.0.18_@types_node@25.3.3_jiti@2.6.1_jsdom@28.1.0_@noble_hashes@1.8.0__sass@1.97.3_tsx@4.21.0_yaml@2.8.2/node_modules/vitest/dist/config.cjs"),s=require("../../util/object/object.util.cjs");function n(e){const t={plugins:[r()],test:{globals:!0,environment:"jsdom",pool:"vmThreads",include:["**/*.test.unit.?(c|m)[jt]s?(x)"],setupFiles:["./vitest.unit.setup.ts"],coverage:{provider:"istanbul",reporter:["text","lcov"],reportsDirectory:"./coverage",thresholds:{statements:80,branches:80,functions:80,lines:80}}}};return i.defineConfig(s.deepMerge(t,e))}exports.vitestUnit=n;
|
|
@@ -1,18 +1,29 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { defineConfig as o } from "../../node_modules/.pnpm/vitest@4.0.
|
|
3
|
-
import { deepMerge as
|
|
4
|
-
function p(
|
|
5
|
-
const
|
|
6
|
-
plugins: [
|
|
1
|
+
import r from "@vitejs/plugin-react-swc";
|
|
2
|
+
import { defineConfig as o } from "../../node_modules/.pnpm/vitest@4.0.18_@types_node@25.3.3_jiti@2.6.1_jsdom@28.1.0_@noble_hashes@1.8.0__sass@1.97.3_tsx@4.21.0_yaml@2.8.2/node_modules/vitest/dist/config.js";
|
|
3
|
+
import { deepMerge as s } from "../../util/object/object.util.js";
|
|
4
|
+
function p(e) {
|
|
5
|
+
const t = {
|
|
6
|
+
plugins: [r()],
|
|
7
7
|
test: {
|
|
8
8
|
globals: !0,
|
|
9
9
|
environment: "jsdom",
|
|
10
10
|
pool: "vmThreads",
|
|
11
11
|
include: ["**/*.test.unit.?(c|m)[jt]s?(x)"],
|
|
12
|
-
setupFiles: ["./vitest.unit.setup.ts"]
|
|
12
|
+
setupFiles: ["./vitest.unit.setup.ts"],
|
|
13
|
+
coverage: {
|
|
14
|
+
provider: "istanbul",
|
|
15
|
+
reporter: ["text", "lcov"],
|
|
16
|
+
reportsDirectory: "./coverage",
|
|
17
|
+
thresholds: {
|
|
18
|
+
statements: 80,
|
|
19
|
+
branches: 80,
|
|
20
|
+
functions: 80,
|
|
21
|
+
lines: 80
|
|
22
|
+
}
|
|
23
|
+
}
|
|
13
24
|
}
|
|
14
25
|
};
|
|
15
|
-
return o(
|
|
26
|
+
return o(s(t, e));
|
|
16
27
|
}
|
|
17
28
|
export {
|
|
18
29
|
p as vitestUnit
|
package/dist/constant/common.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=typeof window
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=typeof window<"u";exports.IS_BROWSER=e;
|
package/dist/constant/common.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("@apollo/server"),a=require("@apollo/server/plugin/drainHttpServer"),r=require("@apollo/server/plugin/landingPage/default"),n=require("../log/log.util.cjs");function t(e){return new l.ApolloServer({schema:e.schema,plugins:[e.isDev?r.ApolloServerPluginLandingPageLocalDefault():r.ApolloServerPluginLandingPageProductionDefault(),a.ApolloServerPluginDrainHttpServer({httpServer:e.server}),...e.drainServer?[{async serverWillStart(){return{async drainServer(){e.drainServer?.(),n.log.info("Apollo Server drainServer hook called")}}}}]:[]],...e.isDev&&{introspection:!0,includeStacktraceInErrorResponses:!0}})}exports.createApolloServer=t;
|
|
@@ -1,56 +1,29 @@
|
|
|
1
|
-
import { ApolloServer as
|
|
2
|
-
import { ApolloServerPluginDrainHttpServer as
|
|
3
|
-
import { ApolloServerPluginLandingPageLocalDefault as
|
|
4
|
-
import { log as
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
h.call(e, l) && u(r, l, e[l]);
|
|
8
|
-
if (i)
|
|
9
|
-
for (var l of i(e))
|
|
10
|
-
y.call(e, l) && u(r, l, e[l]);
|
|
11
|
-
return r;
|
|
12
|
-
}, v = (r, e, l) => new Promise((p, o) => {
|
|
13
|
-
var c = (t) => {
|
|
14
|
-
try {
|
|
15
|
-
a(l.next(t));
|
|
16
|
-
} catch (n) {
|
|
17
|
-
o(n);
|
|
18
|
-
}
|
|
19
|
-
}, f = (t) => {
|
|
20
|
-
try {
|
|
21
|
-
a(l.throw(t));
|
|
22
|
-
} catch (n) {
|
|
23
|
-
o(n);
|
|
24
|
-
}
|
|
25
|
-
}, a = (t) => t.done ? p(t.value) : Promise.resolve(t.value).then(c, f);
|
|
26
|
-
a((l = l.apply(r, e)).next());
|
|
27
|
-
});
|
|
28
|
-
function E(r) {
|
|
29
|
-
return new s(g({
|
|
1
|
+
import { ApolloServer as e } from "@apollo/server";
|
|
2
|
+
import { ApolloServerPluginDrainHttpServer as l } from "@apollo/server/plugin/drainHttpServer";
|
|
3
|
+
import { ApolloServerPluginLandingPageLocalDefault as o, ApolloServerPluginLandingPageProductionDefault as n } from "@apollo/server/plugin/landingPage/default";
|
|
4
|
+
import { log as a } from "../log/log.util.js";
|
|
5
|
+
function c(r) {
|
|
6
|
+
return new e({
|
|
30
7
|
schema: r.schema,
|
|
31
8
|
plugins: [
|
|
32
|
-
r.isDev ?
|
|
33
|
-
|
|
9
|
+
r.isDev ? o() : n(),
|
|
10
|
+
l({ httpServer: r.server }),
|
|
34
11
|
...r.drainServer ? [{
|
|
35
|
-
serverWillStart() {
|
|
36
|
-
return
|
|
37
|
-
|
|
38
|
-
drainServer()
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
(e = r.drainServer) == null || e.call(r), P.info("Apollo Server drainServer hook called");
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
});
|
|
12
|
+
async serverWillStart() {
|
|
13
|
+
return {
|
|
14
|
+
async drainServer() {
|
|
15
|
+
r.drainServer?.(), a.info("Apollo Server drainServer hook called");
|
|
16
|
+
}
|
|
17
|
+
};
|
|
46
18
|
}
|
|
47
19
|
}] : []
|
|
48
|
-
]
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
20
|
+
],
|
|
21
|
+
...r.isDev && {
|
|
22
|
+
introspection: !0,
|
|
23
|
+
includeStacktraceInErrorResponses: !0
|
|
24
|
+
}
|
|
25
|
+
});
|
|
53
26
|
}
|
|
54
27
|
export {
|
|
55
|
-
|
|
28
|
+
c as createApolloServer
|
|
56
29
|
};
|
package/dist/node/cli/index.cjs
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";const s=require("node:process"),
|
|
3
|
-
|
|
4
|
-
`;a.pathExistsSync(n.PATH.GIT_IGNORE)?a.readFileSync(n.PATH.GIT_IGNORE,"utf-8").split(`
|
|
5
|
-
`).includes(n.SIMPLE_GIT_HOOK_JSON)||a.appendFileSync(n.PATH.GIT_IGNORE,o):a.writeFileSync(n.PATH.GIT_IGNORE,o),yield e.runCommand("Setting up simple-git-hooks",yield n.command.simpleGitHooks())})}function R(){return t(this,null,function*(){yield y.installDependencies(),yield S()})}function b(){return t(this,null,function*(){a.removeSync(n.PATH.NODE_MODULES,n.PATH.PNPM_LOCK_YAML),yield e.runCommand("Pruning pnpm store",yield n.command.pnpmPruneStore()),yield e.runCommand("Clearing pnpm cache",yield n.command.pnpmCleanCache()),yield y.installDependencies(),yield S(),yield _()})}function D(){return t(this,null,function*(){yield e.runCommand("Inspecting project dependencies",yield n.command.nodeModulesInspect())})}function B(){return t(this,null,function*(){yield e.runCommand("Running unit tests",yield n.command.testUnit())})}function H(){return t(this,null,function*(){yield e.runCommand("Running end-to-end tests",yield n.command.testE2e())})}function K(i){return t(this,null,function*(){yield e.runCommand("Creating MongoDB migration",yield n.command.mongoMigrateCreate(i))})}function w(){return t(this,null,function*(){yield e.runCommand("Running MongoDB migrations",yield n.command.mongoMigrateUp())})}function x(){return t(this,null,function*(){yield e.runCommand("Rolling back MongoDB migration",yield n.command.mongoMigrateDown())})}function q(){return t(this,null,function*(){yield e.runCommand("Starting Storybook development server",yield n.command.storybookDev())})}function F(){return t(this,null,function*(){yield e.runCommand("Building Storybook",yield n.command.storybookBuild())})}function _(){return t(this,null,function*(){try{yield e.runCommand(`Checking for ${n.AG_KIT_PACKAGE_NAME}`,`pnpm list -g ${n.AG_KIT_PACKAGE_NAME}`)}catch(i){yield e.runCommand(`Installing ${n.AG_KIT_PACKAGE_NAME} globally`,`pnpm i -g ${n.AG_KIT_PACKAGE_NAME}`)}a.pathExistsSync(n.PATH.DOT_AGENT)?yield e.runCommand("Updating AI agent","ag-kit update"):yield e.runCommand("Initializing AI agent","ag-kit init")})}t(null,null,function*(){try{yield T(I.hideBin(s.argv)).scriptName(n.CYBERSKILL_CLI).usage("$0 <command> [options]").command("ai:setup","Setup AI agent environment",_).command("lint","Check code for linting issues",L).command("lint:fix","Fix linting issues automatically",O).command("lint:inspect","View active ESLint configuration",P).command("lint-staged","Run lint checks on staged files",v).command("commitlint","Validate commit message format",N).command("ready","Initialize project and dependencies",R).command("reset","Reset the project and reinstall dependencies",b).command("inspect","Analyze installed project dependencies",D).command("test:unit","Run unit test suite",B).command("test:e2e","Run end-to-end test suite",H).command("mongo:migrate:create <name>","Create a MongoDB migration",i=>i.positional("name",{describe:"Migration name",type:"string"}),i=>t(null,null,function*(){if(!i.name){c.log.error("Migration name is required.");return}yield K(i.name)})).command("mongo:migrate:up","Apply all MongoDB migrations",w).command("mongo:migrate:down","Rollback last MongoDB migration",x).command("storybook:dev","Start Storybook development server",q).command("storybook:build","Build Storybook for production",F).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(M()).epilog(`💡 Tip: Use "--help" with any command to see options
|
|
6
|
-
`).parse()}catch(i){c.catchError(i),s.exit(1)}});
|
|
2
|
+
"use strict";const s=require("node:process"),E=require("yargs/helpers"),C=require("yargs/yargs"),a=require("../command/command.util.cjs"),d=require("../package/package.util.cjs"),o=require("../fs/fs.util.cjs"),f=require("../path/path.util.cjs"),n=require("../path/path.constant.cjs"),r=require("../log/log.util.cjs"),u=require("../log/log.type.cjs");function h(){try{return JSON.parse(o.readFileSync(f.resolve(__dirname,"../../../package.json"),"utf-8")).version}catch{return"1.0.0"}}async function g(){o.pathExistsSync(n.PATH.TS_CONFIG)?await a.runCommand("Performing TypeScript validation",await n.command.typescriptCheck()):r.log.warn("No TypeScript configuration found. Skipping type check.")}async function p(t=!1){const i=t?await n.command.eslintFix():await n.command.eslintCheck(),c=t?"Running ESLint with auto-fix":"Running ESLint check";try{await a.runCommand(c,i,{timeout:6e4,throwOnError:!0})}catch(e){e.code==="ETIMEDOUT"||e.killed||e.signal==="SIGTERM"?(r.log.warn("Lint check timed out. Retrying with debug mode enabled..."),s.env.DEBUG="true",await a.runCommand(`${c} (Debug Mode)`,i)):r.catchError(e)}}function l(t,i){if(!i.length)return;const c=t==="Errors"?"red":"yellow";r.log.printBoxedLog(t==="Errors"?"✖ Errors":"⚠ Warnings",i,c)}async function m(){setTimeout(async()=>{const t=await a.getStoredErrorLists()||[],i=t.filter(e=>e.type===u.E_IssueType.Error),c=t.filter(e=>e.type===u.E_IssueType.Warning);!i.length&&!c.length?r.log.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(l("Warnings",c),l("Errors",i),i.length>0&&s.exit(1))},0)}async function k(){await a.clearAllErrorLists();const t=await d.getPackage({name:n.CYBERSKILL_PACKAGE_NAME});if(!t.success){r.log.error("Failed to retrieve package information. Aborting lint-staged.");return}t.result.isCurrentProject&&await a.runCommand(`Building package: ${n.CYBERSKILL_PACKAGE_NAME}`,await n.command.build()),await a.runCommand("Executing lint-staged",await n.command.lintStaged()),m()}async function A(){await a.runCommand("Inspecting ESLint configuration",await n.command.eslintInspect())}async function S(){await a.clearAllErrorLists(),await g(),await p(),m()}async function _(){await a.clearAllErrorLists(),await g(),await p(!0),m()}async function I(){await a.clearAllErrorLists(),await a.runCommand("Validating commit message",await n.command.commitLint()),m()}async function w(){await a.runCommand("Configuring Git hooks",await n.command.configureGitHook()),o.removeSync(n.PATH.GIT_HOOK);const t=await a.resolveCommands(n.createGitHooksConfig);o.writeFileSync(n.PATH.SIMPLE_GIT_HOOKS_JSON,JSON.stringify(t,null,4)),o.addGitIgnoreEntry(n.PATH.GIT_IGNORE,n.SIMPLE_GIT_HOOK_JSON),await a.runCommand("Setting up simple-git-hooks",await n.command.simpleGitHooks())}async function y(){try{await a.runCommand(`Checking for ${n.AG_KIT_PACKAGE_NAME}`,`pnpm list -g ${n.AG_KIT_PACKAGE_NAME}`)}catch{await a.runCommand(`Installing ${n.AG_KIT_PACKAGE_NAME} globally`,`pnpm i -g ${n.AG_KIT_PACKAGE_NAME}`)}o.pathExistsSync(n.PATH.DOT_AGENT)?await a.runCommand("Updating AI agent","ag-kit update -y"):await a.runCommand("Initializing AI agent","ag-kit init"),o.addGitIgnoreEntry(n.PATH.GIT_EXCLUDE,n.DOT_AGENT)}async function T(){await d.installDependencies(),await w()}async function M(){o.removeSync(n.PATH.NODE_MODULES,n.PATH.PNPM_LOCK_YAML),await a.runCommand("Pruning pnpm store",await n.command.pnpmPruneStore()),await a.runCommand("Clearing pnpm cache",await n.command.pnpmCleanCache()),await d.installDependencies(),await w(),await y()}async function L(){await a.runCommand("Inspecting project dependencies",await n.command.nodeModulesInspect())}async function G(){await a.runCommand("Running unit tests",await n.command.testUnit())}async function P(){await a.runCommand("Running end-to-end tests",await n.command.testE2e())}async function b(t){await a.runCommand("Creating MongoDB migration",await n.command.mongoMigrateCreate(t))}async function v(){await a.runCommand("Running MongoDB migrations",await n.command.mongoMigrateUp())}async function D(){await a.runCommand("Rolling back MongoDB migration",await n.command.mongoMigrateDown())}async function O(){await a.runCommand("Starting Storybook development server",await n.command.storybookDev())}async function N(){await a.runCommand("Building Storybook",await n.command.storybookBuild())}(async()=>{try{await C(E.hideBin(s.argv)).scriptName(n.CYBERSKILL_CLI).usage("$0 <command> [options]").command("ai:setup","Setup AI agent environment",y).command("lint","Check code for linting issues",S).command("lint:fix","Fix linting issues automatically",_).command("lint:inspect","View active ESLint configuration",A).command("lint-staged","Run lint checks on staged files",k).command("commitlint","Validate commit message format",I).command("ready","Initialize project and dependencies",T).command("reset","Reset the project and reinstall dependencies",M).command("inspect","Analyze installed project dependencies",L).command("test:unit","Run unit test suite",G).command("test:e2e","Run end-to-end test suite",P).command("mongo:migrate:create <name>","Create a MongoDB migration",t=>t.positional("name",{describe:"Migration name",type:"string"}),async t=>{if(!t.name){r.log.error("Migration name is required.");return}await b(t.name)}).command("mongo:migrate:up","Apply all MongoDB migrations",v).command("mongo:migrate:down","Rollback last MongoDB migration",D).command("storybook:dev","Start Storybook development server",O).command("storybook:build","Build Storybook for production",N).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(h()).epilog(`💡 Tip: Use "--help" with any command to see options
|
|
3
|
+
`).parse()}catch(t){r.catchError(t),s.exit(1)}})();
|