@cyberskill/shared 3.2.0 → 3.3.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/commitlint/index.js +8 -9
- package/dist/config/commitlint/index.js.map +1 -1
- package/dist/config/config.type.js +8 -5
- package/dist/config/config.type.js.map +1 -1
- package/dist/config/config.util.js +33 -42
- package/dist/config/config.util.js.map +1 -1
- package/dist/config/env/env.constant.js +6 -5
- package/dist/config/env/env.constant.js.map +1 -1
- package/dist/config/env/env.util.js +26 -27
- package/dist/config/env/env.util.js.map +1 -1
- package/dist/config/env/index.js +2 -7
- package/dist/config/eslint/index.js +23 -19
- package/dist/config/eslint/index.js.map +1 -1
- package/dist/config/graphql-codegen/graphql-codegen.util.js +30 -38
- package/dist/config/graphql-codegen/graphql-codegen.util.js.map +1 -1
- package/dist/config/graphql-codegen/index.js +2 -5
- package/dist/config/index.js +3 -7
- package/dist/config/lint-staged/index.js +8 -7
- package/dist/config/lint-staged/index.js.map +1 -1
- package/dist/config/storybook/index.js +2 -6
- package/dist/config/storybook/storybook.main.js +19 -18
- package/dist/config/storybook/storybook.main.js.map +1 -1
- package/dist/config/storybook/storybook.preview.js +31 -37
- package/dist/config/storybook/storybook.preview.js.map +1 -1
- package/dist/config/vitest/index.js +3 -7
- package/dist/config/vitest/vitest.e2e.js +14 -17
- package/dist/config/vitest/vitest.e2e.js.map +1 -1
- package/dist/config/vitest/vitest.unit.js +31 -32
- package/dist/config/vitest/vitest.unit.js.map +1 -1
- package/dist/constant/common.js +6 -5
- package/dist/constant/common.js.map +1 -1
- package/dist/constant/index.js +3 -7
- package/dist/constant/response-status.d.ts +186 -186
- package/dist/constant/response-status.js +254 -253
- package/dist/constant/response-status.js.map +1 -1
- package/dist/node/apollo-server/apollo-server.util.js +27 -29
- package/dist/node/apollo-server/apollo-server.util.js.map +1 -1
- package/dist/node/apollo-server/index.js +2 -7
- package/dist/node/cli/index.js +112 -113
- package/dist/node/cli/index.js.map +1 -1
- package/dist/node/command/command.type.js +8 -5
- package/dist/node/command/command.type.js.map +1 -1
- package/dist/node/command/command.util.js +136 -149
- package/dist/node/command/command.util.js.map +1 -1
- package/dist/node/command/index.js +3 -12
- package/dist/node/express/express.type.d.ts +11 -0
- package/dist/node/express/express.type.js +2 -0
- package/dist/node/express/express.util.js +74 -65
- package/dist/node/express/express.util.js.map +1 -1
- package/dist/node/express/index.js +3 -14
- package/dist/node/fs/fs.util.js +27 -51
- package/dist/node/fs/fs.util.js.map +1 -1
- package/dist/node/fs/index.js +2 -19
- package/dist/node/log/index.js +2 -8
- package/dist/node/log/log.type.js +8 -5
- package/dist/node/log/log.type.js.map +1 -1
- package/dist/node/log/log.util.js +51 -68
- package/dist/node/log/log.util.js.map +1 -1
- package/dist/node/mongo/index.js +8 -26
- package/dist/node/mongo/mongo.constant.js +6 -6
- package/dist/node/mongo/mongo.constant.js.map +1 -1
- package/dist/node/mongo/mongo.controller.mongoose.d.ts +6 -1
- package/dist/node/mongo/mongo.controller.mongoose.js +333 -467
- package/dist/node/mongo/mongo.controller.mongoose.js.map +1 -1
- package/dist/node/mongo/mongo.controller.native.js +153 -212
- package/dist/node/mongo/mongo.controller.native.js.map +1 -1
- package/dist/node/mongo/mongo.dynamic-populate.js +164 -192
- package/dist/node/mongo/mongo.dynamic-populate.js.map +1 -1
- package/dist/node/mongo/mongo.populate.js +229 -262
- package/dist/node/mongo/mongo.populate.js.map +1 -1
- package/dist/node/mongo/mongo.type.js +8 -17
- package/dist/node/mongo/mongo.type.js.map +1 -1
- package/dist/node/mongo/mongo.util.js +134 -293
- package/dist/node/mongo/mongo.util.js.map +1 -1
- package/dist/node/package/index.js +3 -11
- package/dist/node/package/package.type.js +8 -5
- package/dist/node/package/package.type.js.map +1 -1
- package/dist/node/package/package.util.js +216 -225
- package/dist/node/package/package.util.js.map +1 -1
- package/dist/node/path/index.js +3 -58
- package/dist/node/path/path.constant.js +211 -298
- package/dist/node/path/path.constant.js.map +1 -1
- package/dist/node/path/path.util.js +13 -16
- package/dist/node/path/path.util.js.map +1 -1
- package/dist/node/storage/index.js +3 -10
- package/dist/node/storage/storage.constant.js +6 -8
- package/dist/node/storage/storage.constant.js.map +1 -1
- package/dist/node/storage/storage.util.js +127 -178
- package/dist/node/storage/storage.util.js.map +1 -1
- package/dist/node/upload/index.js +4 -16
- package/dist/node/upload/upload.constant.js +58 -32
- package/dist/node/upload/upload.constant.js.map +1 -1
- package/dist/node/upload/upload.type.js +8 -5
- package/dist/node/upload/upload.type.js.map +1 -1
- package/dist/node/upload/upload.util.js +125 -137
- package/dist/node/upload/upload.util.js.map +1 -1
- package/dist/node/ws/index.js +2 -6
- package/dist/node/ws/ws.type.d.ts +7 -8
- package/dist/node/ws/ws.util.js +46 -44
- package/dist/node/ws/ws.util.js.map +1 -1
- package/dist/node_modules/.pnpm/vitest@4.1.0_@types_node@25.5.0_jsdom@29.0.0_@noble_hashes@1.8.0__vite@8.0.0_@types_nod_53aa4254f295b3c40bb8f17b6ab226b5/node_modules/vitest/dist/config.js +8 -0
- package/dist/node_modules/.pnpm/vitest@4.1.0_@types_node@25.5.0_jsdom@29.0.0_@noble_hashes@1.8.0__vite@8.0.0_@types_nod_53aa4254f295b3c40bb8f17b6ab226b5/node_modules/vitest/dist/config.js.map +1 -0
- package/dist/react/apollo-client/apollo-client.component.js +16 -18
- package/dist/react/apollo-client/apollo-client.component.js.map +1 -1
- package/dist/react/apollo-client/apollo-client.constant.js +6 -5
- package/dist/react/apollo-client/apollo-client.constant.js.map +1 -1
- package/dist/react/apollo-client/apollo-client.context.js +10 -13
- package/dist/react/apollo-client/apollo-client.context.js.map +1 -1
- package/dist/react/apollo-client/apollo-client.module.scss.js +8 -7
- package/dist/react/apollo-client/apollo-client.module.scss.js.map +1 -1
- package/dist/react/apollo-client/apollo-client.util.js +57 -75
- package/dist/react/apollo-client/apollo-client.util.js.map +1 -1
- package/dist/react/apollo-client/index.js +7 -30
- package/dist/react/apollo-client/links/index.js +2 -5
- package/dist/react/apollo-client/links/upload.js +63 -107
- package/dist/react/apollo-client/links/upload.js.map +1 -1
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.component.js +14 -16
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.component.js.map +1 -1
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.rsc.js +8 -7
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.rsc.js.map +1 -1
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.util.js +14 -14
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.util.js.map +1 -1
- package/dist/react/apollo-client-nextjs/index.js +3 -7
- package/dist/react/apollo-error/apollo-error.component.js +57 -69
- package/dist/react/apollo-error/apollo-error.component.js.map +1 -1
- package/dist/react/apollo-error/apollo-error.context.js +7 -6
- package/dist/react/apollo-error/apollo-error.context.js.map +1 -1
- package/dist/react/apollo-error/apollo-error.hook.js +10 -10
- package/dist/react/apollo-error/apollo-error.hook.js.map +1 -1
- package/dist/react/apollo-error/apollo-error.module.scss.js +15 -11
- package/dist/react/apollo-error/apollo-error.module.scss.js.map +1 -1
- package/dist/react/apollo-error/apollo-error.provider.js +31 -25
- package/dist/react/apollo-error/apollo-error.provider.js.map +1 -1
- package/dist/react/apollo-error/apollo-error.util.js +14 -16
- package/dist/react/apollo-error/apollo-error.util.js.map +1 -1
- package/dist/react/apollo-error/index.js +5 -15
- package/dist/react/i18next/i18next.hook.js +7 -6
- package/dist/react/i18next/i18next.hook.js.map +1 -1
- package/dist/react/i18next/i18next.util.js +9 -8
- package/dist/react/i18next/i18next.util.js.map +1 -1
- package/dist/react/i18next/index.js +3 -7
- package/dist/react/loading/index.js +3 -9
- package/dist/react/loading/loading.component.js +47 -48
- package/dist/react/loading/loading.component.js.map +1 -1
- package/dist/react/loading/loading.context.js +7 -6
- package/dist/react/loading/loading.context.js.map +1 -1
- package/dist/react/loading/loading.hook.js +11 -11
- package/dist/react/loading/loading.hook.js.map +1 -1
- package/dist/react/loading/loading.module.scss.js +18 -15
- package/dist/react/loading/loading.module.scss.js.map +1 -1
- package/dist/react/loading/loading.provider.js +26 -18
- package/dist/react/loading/loading.provider.js.map +1 -1
- package/dist/react/log/index.js +2 -6
- package/dist/react/log/log.util.d.ts +8 -0
- package/dist/react/log/log.util.js +33 -29
- package/dist/react/log/log.util.js.map +1 -1
- package/dist/react/next-intl/index.js +6 -14
- package/dist/react/next-intl/next-intl.constant.js +16 -15
- package/dist/react/next-intl/next-intl.constant.js.map +1 -1
- package/dist/react/next-intl/next-intl.context.js +7 -6
- package/dist/react/next-intl/next-intl.context.js.map +1 -1
- package/dist/react/next-intl/next-intl.hoc.js +20 -23
- package/dist/react/next-intl/next-intl.hoc.js.map +1 -1
- package/dist/react/next-intl/next-intl.hook.js +13 -14
- package/dist/react/next-intl/next-intl.hook.js.map +1 -1
- package/dist/react/next-intl/next-intl.provider.js +28 -23
- package/dist/react/next-intl/next-intl.provider.js.map +1 -1
- package/dist/react/storage/index.js +3 -7
- package/dist/react/storage/storage.hook.js +61 -58
- package/dist/react/storage/storage.hook.js.map +1 -1
- package/dist/react/storage/storage.util.js +36 -68
- package/dist/react/storage/storage.util.js.map +1 -1
- package/dist/react/toast/index.js +2 -6
- package/dist/react/userback/index.js +2 -5
- package/dist/react/userback/userback.component.js +27 -27
- package/dist/react/userback/userback.component.js.map +1 -1
- package/dist/style.css +2 -1
- package/dist/typescript/common.type.js +8 -5
- package/dist/typescript/common.type.js.map +1 -1
- package/dist/typescript/index.js +2 -5
- package/dist/util/common/common.util.js +119 -48
- package/dist/util/common/common.util.js.map +1 -1
- package/dist/util/common/index.js +2 -9
- package/dist/util/index.js +6 -27
- package/dist/util/object/index.d.ts +3 -0
- package/dist/util/object/index.js +2 -10
- package/dist/util/object/object.util.js +94 -128
- package/dist/util/object/object.util.js.map +1 -1
- package/dist/util/serializer/index.js +2 -5
- package/dist/util/serializer/serializer.util.js +73 -78
- package/dist/util/serializer/serializer.util.js.map +1 -1
- package/dist/util/string/index.d.ts +3 -0
- package/dist/util/string/index.js +2 -10
- package/dist/util/string/string.util.js +59 -71
- package/dist/util/string/string.util.js.map +1 -1
- package/dist/util/validate/index.d.ts +3 -0
- package/dist/util/validate/index.js +2 -5
- package/dist/util/validate/validate.util.js +13 -39
- package/dist/util/validate/validate.util.js.map +1 -1
- package/package.json +29 -27
- package/dist/config/env/index.js.map +0 -1
- package/dist/config/graphql-codegen/index.js.map +0 -1
- package/dist/config/index.js.map +0 -1
- package/dist/config/storybook/index.js.map +0 -1
- package/dist/config/vitest/index.js.map +0 -1
- package/dist/constant/index.js.map +0 -1
- package/dist/node/apollo-server/index.js.map +0 -1
- package/dist/node/command/index.js.map +0 -1
- package/dist/node/express/index.js.map +0 -1
- package/dist/node/fs/index.js.map +0 -1
- package/dist/node/log/index.js.map +0 -1
- package/dist/node/mongo/index.js.map +0 -1
- package/dist/node/package/index.js.map +0 -1
- package/dist/node/path/index.js.map +0 -1
- package/dist/node/storage/index.js.map +0 -1
- package/dist/node/upload/index.js.map +0 -1
- package/dist/node/ws/index.js.map +0 -1
- package/dist/node_modules/.pnpm/vitest@4.0.18_@types_node@25.3.5_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 -7
- package/dist/node_modules/.pnpm/vitest@4.0.18_@types_node@25.3.5_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.map +0 -1
- package/dist/react/apollo-client/index.js.map +0 -1
- package/dist/react/apollo-client/links/index.js.map +0 -1
- package/dist/react/apollo-client-nextjs/index.js.map +0 -1
- package/dist/react/apollo-error/index.js.map +0 -1
- package/dist/react/i18next/index.js.map +0 -1
- package/dist/react/loading/index.js.map +0 -1
- package/dist/react/log/index.js.map +0 -1
- package/dist/react/next-intl/index.js.map +0 -1
- package/dist/react/storage/index.js.map +0 -1
- package/dist/react/toast/index.js.map +0 -1
- package/dist/react/userback/index.js.map +0 -1
- package/dist/typescript/index.js.map +0 -1
- package/dist/util/common/index.js.map +0 -1
- package/dist/util/index.js.map +0 -1
- package/dist/util/object/index.js.map +0 -1
- package/dist/util/serializer/index.js.map +0 -1
- package/dist/util/string/index.js.map +0 -1
- package/dist/util/validate/index.js.map +0 -1
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
]
|
|
1
|
+
//#region src/config/commitlint/index.ts
|
|
2
|
+
var e = {
|
|
3
|
+
extends: ["@commitlint/config-conventional"],
|
|
4
|
+
ignores: [(e) => e.includes("[🚀 CI - Deploy]")]
|
|
6
5
|
};
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
//# sourceMappingURL=index.js.map
|
|
6
|
+
//#endregion
|
|
7
|
+
export { e as default };
|
|
8
|
+
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/config/commitlint/index.ts"],"sourcesContent":["export default {\n extends: ['@commitlint/config-conventional'],\n ignores: [\n (message: string) => message.includes('[🚀 CI - Deploy]'),\n ],\n};\n"],"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/config/commitlint/index.ts"],"sourcesContent":["export default {\n extends: ['@commitlint/config-conventional'],\n ignores: [\n (message: string) => message.includes('[🚀 CI - Deploy]'),\n ],\n};\n"],"mappings":";AAAA,IAAA,IAAe;CACX,SAAS,CAAC,kCAAkC;CAC5C,SAAS,EACJ,MAAoB,EAAQ,SAAS,mBAAmB,CAC5D;CACJ"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
//#
|
|
1
|
+
//#region src/config/config.type.ts
|
|
2
|
+
var e = /* @__PURE__ */ function(e) {
|
|
3
|
+
return e.ESLINT = "eslint", e.COMMITLINT = "commitlint", e.LINT_STAGED = "lint-staged", e.VITEST_REACT_E2E = "vitest-react-e2e", e.VITEST_REACT_UNIT = "vitest-react-unit", e;
|
|
4
|
+
}({});
|
|
5
|
+
//#endregion
|
|
6
|
+
export { e as E_ConfigType };
|
|
7
|
+
|
|
8
|
+
//# sourceMappingURL=config.type.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.type.js","sources":["../../src/config/config.type.ts"],"sourcesContent":["import type { T_Object } from '#typescript/index.js';\n\nexport enum E_ConfigType {\n ESLINT = 'eslint',\n COMMITLINT = 'commitlint',\n LINT_STAGED = 'lint-staged',\n VITEST_REACT_E2E = 'vitest-react-e2e',\n VITEST_REACT_UNIT = 'vitest-react-unit',\n}\n\nexport type T_ConfigType = `${E_ConfigType}`;\n\nexport type T_ConfigHandler = (...config: T_Object[]) => T_Object;\n"],"
|
|
1
|
+
{"version":3,"file":"config.type.js","names":[],"sources":["../../src/config/config.type.ts"],"sourcesContent":["import type { T_Object } from '#typescript/index.js';\n\nexport enum E_ConfigType {\n ESLINT = 'eslint',\n COMMITLINT = 'commitlint',\n LINT_STAGED = 'lint-staged',\n VITEST_REACT_E2E = 'vitest-react-e2e',\n VITEST_REACT_UNIT = 'vitest-react-unit',\n}\n\nexport type T_ConfigType = `${E_ConfigType}`;\n\nexport type T_ConfigHandler = (...config: T_Object[]) => T_Object;\n"],"mappings":";AAEA,IAAY,IAAL,yBAAA,GAAA;QACH,EAAA,SAAA,UACA,EAAA,aAAA,cACA,EAAA,cAAA,eACA,EAAA,mBAAA,oBACA,EAAA,oBAAA;KACH"}
|
|
@@ -1,44 +1,35 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { E_ConfigType as
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}, T = {
|
|
27
|
-
[n.ESLINT]: (r) => E(r),
|
|
28
|
-
[n.COMMITLINT]: (r) => i(r),
|
|
29
|
-
[n.LINT_STAGED]: (r) => i(r),
|
|
30
|
-
[n.VITEST_REACT_UNIT]: (r) => a(r),
|
|
31
|
-
[n.VITEST_REACT_E2E]: (r) => m(r)
|
|
1
|
+
import { deepMerge as e } from "../util/object/object.util.js";
|
|
2
|
+
import { E_ConfigType as t } from "./config.type.js";
|
|
3
|
+
import { vitestE2E as n } from "./vitest/vitest.e2e.js";
|
|
4
|
+
import { vitestUnit as r } from "./vitest/vitest.unit.js";
|
|
5
|
+
import i from "./eslint/index.js";
|
|
6
|
+
import a from "@antfu/eslint-config";
|
|
7
|
+
//#region src/config/config.util.ts
|
|
8
|
+
var o = (...t) => {
|
|
9
|
+
let { ignores: n, ...r } = e(...Array.isArray(i) ? i : [i], ...t);
|
|
10
|
+
return a({
|
|
11
|
+
stylistic: {
|
|
12
|
+
semi: !0,
|
|
13
|
+
indent: 4
|
|
14
|
+
},
|
|
15
|
+
formatters: !0,
|
|
16
|
+
yaml: !1,
|
|
17
|
+
markdown: !1,
|
|
18
|
+
react: !0
|
|
19
|
+
}, r, ...Array.isArray(n) ? [{ ignores: n }] : []);
|
|
20
|
+
}, s = {
|
|
21
|
+
[t.ESLINT]: (e) => o(e),
|
|
22
|
+
[t.COMMITLINT]: (t) => e(t),
|
|
23
|
+
[t.LINT_STAGED]: (t) => e(t),
|
|
24
|
+
[t.VITEST_REACT_UNIT]: (e) => r(e),
|
|
25
|
+
[t.VITEST_REACT_E2E]: (e) => n(e)
|
|
32
26
|
};
|
|
33
|
-
function
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if (!t)
|
|
38
|
-
throw new Error(`Unknown config type: ${r}`);
|
|
39
|
-
return t(...e);
|
|
27
|
+
function c(e, ...t) {
|
|
28
|
+
let n = s[e];
|
|
29
|
+
if (!n) throw Error(`Unknown config type: ${e}`);
|
|
30
|
+
return !t || t.length === 0 ? n({}) : n(...t);
|
|
40
31
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
//# sourceMappingURL=config.util.js.map
|
|
32
|
+
//#endregion
|
|
33
|
+
export { c as mergeConfigs };
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=config.util.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.util.js","sources":["../../src/config/config.util.ts"],"sourcesContent":["import antfu from '@antfu/eslint-config';\n\nimport type { T_Object } from '#typescript/index.js';\n\nimport { vitestE2E, vitestUnit } from '#config/vitest/index.js';\nimport { deepMerge } from '#util/index.js';\n\nimport type { T_ConfigHandler, T_ConfigType } from './config.type.js';\n\nimport { E_ConfigType } from './config.type.js';\nimport eslintBaseConfig from './eslint/index.js';\n\n/**\n * Handles ESLint configuration merging and processing.\n * This function merges the base ESLint configuration with additional configs\n * and applies the Antfu ESLint preset with specific styling and formatting rules.\n * It processes ignores separately and applies them as a final configuration layer.\n *\n * The function configures:\n * - Stylistic rules (semicolons, indentation, quotes)\n * - Formatters for CSS, HTML, and Markdown\n * - React support\n * - Custom ignore patterns\n *\n * @param config - Additional ESLint configuration objects to merge with the base config.\n * @returns A processed ESLint configuration object ready for use.\n */\nconst handleESLint: T_ConfigHandler = (...config) => {\n const mergedConfig = deepMerge(\n ...(Array.isArray(eslintBaseConfig) ? eslintBaseConfig : [eslintBaseConfig]),\n ...config,\n );\n\n const { ignores, ...restConfig } = mergedConfig;\n\n return antfu(\n {\n stylistic: {\n semi: true,\n indent: 4,\n },\n formatters: true,\n yaml: false,\n markdown: false,\n react: true,\n },\n restConfig,\n ...(Array.isArray(ignores) ? [{ ignores }] : []),\n ) as unknown as T_Object;\n};\n\n/**\n * Configuration handlers for different config types.\n * This object maps configuration types to their respective handler functions,\n * providing a centralized way to process different types of configurations\n * with appropriate merging and processing logic.\n */\nconst configHandlers: Record<E_ConfigType, T_ConfigHandler> = {\n [E_ConfigType.ESLINT]: config => handleESLint(config),\n [E_ConfigType.COMMITLINT]: config => deepMerge(config),\n [E_ConfigType.LINT_STAGED]: config => deepMerge(config),\n [E_ConfigType.VITEST_REACT_UNIT]: config => vitestUnit(config) as T_Object,\n [E_ConfigType.VITEST_REACT_E2E]: config => vitestE2E(config) as T_Object,\n};\n\n/**\n * Merges configurations based on the specified type.\n * This function provides a unified interface for merging different types of\n * configurations using their respective handlers. It supports ESLint, commitlint,\n * lint-staged, and Vitest configurations with appropriate processing for each type.\n *\n * The function automatically:\n * - Selects the appropriate handler for the config type\n * - Merges multiple configuration objects\n * - Handles empty configuration arrays gracefully\n * - Provides error handling for unknown config types\n *\n * @param type - The type of configuration to merge (ESLint, commitlint, lint-staged, or Vitest).\n * @param config - Configuration objects to merge, can be empty for default handling.\n * @returns A merged configuration object processed according to the specified type.\n * @throws {Error} When an unknown configuration type is provided.\n */\nexport function mergeConfigs(type: T_ConfigType, ...config: T_Object[]) {\n const handler = configHandlers[type];\n\n if (!
|
|
1
|
+
{"version":3,"file":"config.util.js","names":[],"sources":["../../src/config/config.util.ts"],"sourcesContent":["import antfu from '@antfu/eslint-config';\n\nimport type { T_Object } from '#typescript/index.js';\n\nimport { vitestE2E, vitestUnit } from '#config/vitest/index.js';\nimport { deepMerge } from '#util/index.js';\n\nimport type { T_ConfigHandler, T_ConfigType } from './config.type.js';\n\nimport { E_ConfigType } from './config.type.js';\nimport eslintBaseConfig from './eslint/index.js';\n\n/**\n * Handles ESLint configuration merging and processing.\n * This function merges the base ESLint configuration with additional configs\n * and applies the Antfu ESLint preset with specific styling and formatting rules.\n * It processes ignores separately and applies them as a final configuration layer.\n *\n * The function configures:\n * - Stylistic rules (semicolons, indentation, quotes)\n * - Formatters for CSS, HTML, and Markdown\n * - React support\n * - Custom ignore patterns\n *\n * @param config - Additional ESLint configuration objects to merge with the base config.\n * @returns A processed ESLint configuration object ready for use.\n */\nconst handleESLint: T_ConfigHandler = (...config) => {\n const mergedConfig = deepMerge(\n ...(Array.isArray(eslintBaseConfig) ? eslintBaseConfig : [eslintBaseConfig]),\n ...config,\n );\n\n const { ignores, ...restConfig } = mergedConfig;\n\n return antfu(\n {\n stylistic: {\n semi: true,\n indent: 4,\n },\n formatters: true,\n yaml: false,\n markdown: false,\n react: true,\n },\n restConfig,\n ...(Array.isArray(ignores) ? [{ ignores }] : []),\n ) as unknown as T_Object;\n};\n\n/**\n * Configuration handlers for different config types.\n * This object maps configuration types to their respective handler functions,\n * providing a centralized way to process different types of configurations\n * with appropriate merging and processing logic.\n */\nconst configHandlers: Record<E_ConfigType, T_ConfigHandler> = {\n [E_ConfigType.ESLINT]: config => handleESLint(config),\n [E_ConfigType.COMMITLINT]: config => deepMerge(config),\n [E_ConfigType.LINT_STAGED]: config => deepMerge(config),\n [E_ConfigType.VITEST_REACT_UNIT]: config => vitestUnit(config) as T_Object,\n [E_ConfigType.VITEST_REACT_E2E]: config => vitestE2E(config) as T_Object,\n};\n\n/**\n * Merges configurations based on the specified type.\n * This function provides a unified interface for merging different types of\n * configurations using their respective handlers. It supports ESLint, commitlint,\n * lint-staged, and Vitest configurations with appropriate processing for each type.\n *\n * The function automatically:\n * - Selects the appropriate handler for the config type\n * - Merges multiple configuration objects\n * - Handles empty configuration arrays gracefully\n * - Provides error handling for unknown config types\n *\n * @param type - The type of configuration to merge (ESLint, commitlint, lint-staged, or Vitest).\n * @param config - Configuration objects to merge, can be empty for default handling.\n * @returns A merged configuration object processed according to the specified type.\n * @throws {Error} When an unknown configuration type is provided.\n */\nexport function mergeConfigs(type: T_ConfigType, ...config: T_Object[]) {\n const handler = configHandlers[type];\n\n if (!handler) {\n throw new Error(`Unknown config type: ${type}`);\n }\n\n if (!config || config.length === 0) {\n return handler({});\n }\n\n return handler(...config);\n}\n"],"mappings":";;;;;;;AA2BA,IAAM,KAAiC,GAAG,MAAW;CAMjD,IAAM,EAAE,YAAS,GAAG,MALC,EACjB,GAAI,MAAM,QAAQ,EAAiB,GAAG,IAAmB,CAAC,EAAiB,EAC3E,GAAG,EACN;AAID,QAAO,EACH;EACI,WAAW;GACP,MAAM;GACN,QAAQ;GACX;EACD,YAAY;EACZ,MAAM;EACN,UAAU;EACV,OAAO;EACV,EACD,GACA,GAAI,MAAM,QAAQ,EAAQ,GAAG,CAAC,EAAE,YAAS,CAAC,GAAG,EAAE,CAClD;GASC,IAAwD;EACzD,EAAa,UAAS,MAAU,EAAa,EAAO;EACpD,EAAa,cAAa,MAAU,EAAU,EAAO;EACrD,EAAa,eAAc,MAAU,EAAU,EAAO;EACtD,EAAa,qBAAoB,MAAU,EAAW,EAAO;EAC7D,EAAa,oBAAmB,MAAU,EAAU,EAAO;CAC/D;AAmBD,SAAgB,EAAa,GAAoB,GAAG,GAAoB;CACpE,IAAM,IAAU,EAAe;AAE/B,KAAI,CAAC,EACD,OAAU,MAAM,wBAAwB,IAAO;AAOnD,QAJI,CAAC,KAAU,EAAO,WAAW,IACtB,EAAQ,EAAE,CAAC,GAGf,EAAQ,GAAG,EAAO"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
1
|
+
//#region src/config/env/env.constant.ts
|
|
2
|
+
var e = ".cyberskill-storage";
|
|
3
|
+
//#endregion
|
|
4
|
+
export { e as CYBERSKILL_STORAGE_DIRECTORY };
|
|
5
|
+
|
|
6
|
+
//# sourceMappingURL=env.constant.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.constant.js","sources":["../../../src/config/env/env.constant.ts"],"sourcesContent":["export const CYBERSKILL_STORAGE_DIRECTORY = '.cyberskill-storage';\n"],"
|
|
1
|
+
{"version":3,"file":"env.constant.js","names":[],"sources":["../../../src/config/env/env.constant.ts"],"sourcesContent":["export const CYBERSKILL_STORAGE_DIRECTORY = '.cyberskill-storage';\n"],"mappings":";AAAA,IAAa,IAA+B"}
|
|
@@ -1,30 +1,29 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import o from "
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { E_Environment as e } from "../../typescript/common.type.js";
|
|
2
|
+
import { CYBERSKILL_STORAGE_DIRECTORY as t } from "./env.constant.js";
|
|
3
|
+
import n from "node:path";
|
|
4
|
+
import r from "@dotenvx/dotenvx";
|
|
5
|
+
import { cleanEnv as i, makeValidator as a, str as o } from "envalid";
|
|
6
|
+
import s from "node:os";
|
|
7
|
+
import c from "node:process";
|
|
8
|
+
//#region src/config/env/env.util.ts
|
|
9
|
+
var l = !1, u = a((e) => typeof e == "boolean" ? e : typeof e == "string");
|
|
10
10
|
function d() {
|
|
11
|
-
|
|
11
|
+
c.env.NODE_ENV !== e.PRODUCTION && !l && (r.config(), l = !0);
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
13
|
+
function f() {
|
|
14
|
+
d();
|
|
15
|
+
let e = i(c.env, {
|
|
16
|
+
CWD: o({ default: c.cwd() }),
|
|
17
|
+
DEBUG: u({ default: !1 }),
|
|
18
|
+
CYBERSKILL_STORAGE_DIRECTORY: o({ default: n.join(s.homedir(), t) })
|
|
19
|
+
});
|
|
20
|
+
return {
|
|
21
|
+
CWD: e.CWD,
|
|
22
|
+
DEBUG: e.DEBUG,
|
|
23
|
+
CYBERSKILL_STORAGE_DIRECTORY: e.CYBERSKILL_STORAGE_DIRECTORY
|
|
24
|
+
};
|
|
25
25
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
//# sourceMappingURL=env.util.js.map
|
|
26
|
+
//#endregion
|
|
27
|
+
export { f as getEnv, d as loadEnvFile };
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=env.util.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.util.js","sources":["../../../src/config/env/env.util.ts"],"sourcesContent":["import dotenvx from '@dotenvx/dotenvx';\nimport { cleanEnv, makeValidator, str } from 'envalid';\nimport os from 'node:os';\nimport path from 'node:path';\nimport process from 'node:process';\n\nimport { E_Environment } from '#typescript/index.js';\n\nimport type { I_Environment } from './env.type.js';\n\nimport { CYBERSKILL_STORAGE_DIRECTORY } from './env.constant.js';\n\n/**\n * Flag to track whether environment file has been loaded.\n * This variable prevents multiple loading of environment files during\n * the application lifecycle, ensuring environment variables are only\n * loaded once per session.\n */\nlet isEnvFileLoaded = false;\n\n/**\n * Custom validator for debug environment variable.\n * This validator accepts boolean values directly and converts string values\n * to true, providing flexible debug configuration options. It handles\n * both explicit boolean settings and string-based flags.\n *\n * @param input - The input value to validate (boolean or string).\n * @returns True if the input is a valid debug setting, false otherwise.\n */\nconst debugValidator = makeValidator((input) => {\n if (typeof input === 'boolean') {\n return input;\n }\n if (typeof input === 'string') {\n return true;\n }\n\n return false;\n});\n\n/**\n * Loads environment variables from .env files.\n * This function loads environment variables from .env files using dotenvx,\n * but only in non-production environments. It includes a safety mechanism\n * to prevent multiple loading of the same environment file.\n *\n * The function:\n * - Checks if the current environment is not production\n * - Loads environment variables from .env files\n * - Prevents duplicate loading with a flag mechanism\n * - Uses dotenvx for enhanced environment file support\n */\nexport function loadEnvFile() {\n // @ts-expect-error ignore type error\n if (process.env.NODE_ENV !== E_Environment.PRODUCTION && !isEnvFileLoaded) {\n dotenvx.config();\n isEnvFileLoaded = true;\n }\n}\n\n/**\n * Retrieves and validates the application environment configuration.\n * This function loads environment variables, validates them using envalid,\n * and returns a typed environment object with default values for missing\n * variables. It ensures all required environment variables are present\n * and properly typed.\n *\n * The function validates:\n * - CWD: Current working directory (defaults to process.cwd())\n * - DEBUG: Debug mode flag (defaults to false)\n * - CYBERSKILL_STORAGE_DIRECTORY: Storage directory path (defaults to user home directory)\n *\n * @returns A validated environment object with all required configuration values.\n */\nexport function getEnv(): I_Environment {\n loadEnvFile();\n\n const cleanedEnv = cleanEnv(process.env, {\n CWD: str({ default: process.cwd() }),\n DEBUG: debugValidator({ default: false }),\n CYBERSKILL_STORAGE_DIRECTORY: str({ default: path.join(os.homedir(), CYBERSKILL_STORAGE_DIRECTORY) }),\n });\n\n const env = {\n CWD: cleanedEnv.CWD,\n DEBUG: cleanedEnv.DEBUG,\n CYBERSKILL_STORAGE_DIRECTORY: cleanedEnv.CYBERSKILL_STORAGE_DIRECTORY,\n };\n\n return env;\n}\n"],"
|
|
1
|
+
{"version":3,"file":"env.util.js","names":[],"sources":["../../../src/config/env/env.util.ts"],"sourcesContent":["import dotenvx from '@dotenvx/dotenvx';\nimport { cleanEnv, makeValidator, str } from 'envalid';\nimport os from 'node:os';\nimport path from 'node:path';\nimport process from 'node:process';\n\nimport { E_Environment } from '#typescript/index.js';\n\nimport type { I_Environment } from './env.type.js';\n\nimport { CYBERSKILL_STORAGE_DIRECTORY } from './env.constant.js';\n\n/**\n * Flag to track whether environment file has been loaded.\n * This variable prevents multiple loading of environment files during\n * the application lifecycle, ensuring environment variables are only\n * loaded once per session.\n */\nlet isEnvFileLoaded = false;\n\n/**\n * Custom validator for debug environment variable.\n * This validator accepts boolean values directly and converts string values\n * to true, providing flexible debug configuration options. It handles\n * both explicit boolean settings and string-based flags.\n *\n * @param input - The input value to validate (boolean or string).\n * @returns True if the input is a valid debug setting, false otherwise.\n */\nconst debugValidator = makeValidator((input) => {\n if (typeof input === 'boolean') {\n return input;\n }\n if (typeof input === 'string') {\n return true;\n }\n\n return false;\n});\n\n/**\n * Loads environment variables from .env files.\n * This function loads environment variables from .env files using dotenvx,\n * but only in non-production environments. It includes a safety mechanism\n * to prevent multiple loading of the same environment file.\n *\n * The function:\n * - Checks if the current environment is not production\n * - Loads environment variables from .env files\n * - Prevents duplicate loading with a flag mechanism\n * - Uses dotenvx for enhanced environment file support\n */\nexport function loadEnvFile() {\n // @ts-expect-error ignore type error\n if (process.env.NODE_ENV !== E_Environment.PRODUCTION && !isEnvFileLoaded) {\n dotenvx.config();\n isEnvFileLoaded = true;\n }\n}\n\n/**\n * Retrieves and validates the application environment configuration.\n * This function loads environment variables, validates them using envalid,\n * and returns a typed environment object with default values for missing\n * variables. It ensures all required environment variables are present\n * and properly typed.\n *\n * The function validates:\n * - CWD: Current working directory (defaults to process.cwd())\n * - DEBUG: Debug mode flag (defaults to false)\n * - CYBERSKILL_STORAGE_DIRECTORY: Storage directory path (defaults to user home directory)\n *\n * @returns A validated environment object with all required configuration values.\n */\nexport function getEnv(): I_Environment {\n loadEnvFile();\n\n const cleanedEnv = cleanEnv(process.env, {\n CWD: str({ default: process.cwd() }),\n DEBUG: debugValidator({ default: false }),\n CYBERSKILL_STORAGE_DIRECTORY: str({ default: path.join(os.homedir(), CYBERSKILL_STORAGE_DIRECTORY) }),\n });\n\n const env = {\n CWD: cleanedEnv.CWD,\n DEBUG: cleanedEnv.DEBUG,\n CYBERSKILL_STORAGE_DIRECTORY: cleanedEnv.CYBERSKILL_STORAGE_DIRECTORY,\n };\n\n return env;\n}\n"],"mappings":";;;;;;;;AAkBA,IAAI,IAAkB,IAWhB,IAAiB,GAAe,MAC9B,OAAO,KAAU,YACV,IAEP,OAAO,KAAU,SAKvB;AAcF,SAAgB,IAAc;AAE1B,CAAI,EAAQ,IAAI,aAAa,EAAc,cAAc,CAAC,MACtD,EAAQ,QAAQ,EAChB,IAAkB;;AAkB1B,SAAgB,IAAwB;AACpC,IAAa;CAEb,IAAM,IAAa,EAAS,EAAQ,KAAK;EACrC,KAAK,EAAI,EAAE,SAAS,EAAQ,KAAK,EAAE,CAAC;EACpC,OAAO,EAAe,EAAE,SAAS,IAAO,CAAC;EACzC,8BAA8B,EAAI,EAAE,SAAS,EAAK,KAAK,EAAG,SAAS,EAAE,EAA6B,EAAE,CAAC;EACxG,CAAC;AAQF,QANY;EACR,KAAK,EAAW;EAChB,OAAO,EAAW;EAClB,8BAA8B,EAAW;EAC5C"}
|
package/dist/config/env/index.js
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
1
|
import { CYBERSKILL_STORAGE_DIRECTORY as e } from "./env.constant.js";
|
|
2
|
-
import { getEnv as
|
|
3
|
-
export {
|
|
4
|
-
e as CYBERSKILL_STORAGE_DIRECTORY,
|
|
5
|
-
R as getEnv,
|
|
6
|
-
t as loadEnvFile
|
|
7
|
-
};
|
|
8
|
-
//# sourceMappingURL=index.js.map
|
|
2
|
+
import { getEnv as t, loadEnvFile as n } from "./env.util.js";
|
|
3
|
+
export { e as CYBERSKILL_STORAGE_DIRECTORY, t as getEnv, n as loadEnvFile };
|
|
@@ -1,19 +1,23 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import * as e from "globals";
|
|
2
|
+
//#region src/config/eslint/index.ts
|
|
3
|
+
var t = [{
|
|
4
|
+
languageOptions: { globals: {
|
|
5
|
+
...e.node,
|
|
6
|
+
...e.browser
|
|
7
|
+
} },
|
|
8
|
+
rules: {
|
|
9
|
+
"perfectionist/sort-imports": ["error", { internalPattern: ["^#.*", "^@/.*"] }],
|
|
10
|
+
"dot-notation": "off"
|
|
11
|
+
},
|
|
12
|
+
ignores: [
|
|
13
|
+
"**/node_modules/**",
|
|
14
|
+
"**/.git/**",
|
|
15
|
+
"build",
|
|
16
|
+
"dist",
|
|
17
|
+
".agent"
|
|
18
|
+
]
|
|
19
|
+
}];
|
|
20
|
+
//#endregion
|
|
21
|
+
export { t as default };
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/config/eslint/index.ts"],"sourcesContent":["import * as globals from 'globals';\n\n/**\n * Base ESLint configuration.\n * This config provides the foundation for ESLint rules.\n */\nexport default [\n {\n languageOptions: {\n globals: { ...globals.node, ...globals.browser },\n },\n rules: {\n 'perfectionist/sort-imports': ['error', {\n internalPattern: ['^#.*', '^@/.*'],\n }],\n 'dot-notation': 'off',\n },\n ignores: ['**/node_modules/**', '**/.git/**', 'build', 'dist', '.agent'],\n },\n];\n"],"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/config/eslint/index.ts"],"sourcesContent":["import * as globals from 'globals';\n\n/**\n * Base ESLint configuration.\n * This config provides the foundation for ESLint rules.\n */\nexport default [\n {\n languageOptions: {\n globals: { ...globals.node, ...globals.browser },\n },\n rules: {\n 'perfectionist/sort-imports': ['error', {\n internalPattern: ['^#.*', '^@/.*'],\n }],\n 'dot-notation': 'off',\n },\n ignores: ['**/node_modules/**', '**/.git/**', 'build', 'dist', '.agent'],\n },\n];\n"],"mappings":";;AAMA,IAAA,IAAe,CACX;CACI,iBAAiB,EACb,SAAS;EAAE,GAAG,EAAQ;EAAM,GAAG,EAAQ;EAAS,EACnD;CACD,OAAO;EACH,8BAA8B,CAAC,SAAS,EACpC,iBAAiB,CAAC,QAAQ,QAAQ,EACrC,CAAC;EACF,gBAAgB;EACnB;CACD,SAAS;EAAC;EAAsB;EAAc;EAAS;EAAQ;EAAS;CAC3E,CACJ"}
|
|
@@ -1,39 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
...i && {
|
|
31
|
-
[e]: s()
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
};
|
|
1
|
+
import { loadEnvFile as e } from "../env/env.util.js";
|
|
2
|
+
import { defineConfig as t } from "@eddeee888/gcg-typescript-resolver-files";
|
|
3
|
+
//#region src/config/graphql-codegen/graphql-codegen.util.ts
|
|
4
|
+
e();
|
|
5
|
+
function n({ uri: e, from: n, to: r, target: i = "client" }) {
|
|
6
|
+
let a = i === "client", o = i === "server";
|
|
7
|
+
return {
|
|
8
|
+
schema: e,
|
|
9
|
+
ignoreNoDocuments: !0,
|
|
10
|
+
overwrite: !0,
|
|
11
|
+
...a && { documents: [n] },
|
|
12
|
+
generates: {
|
|
13
|
+
...a && { [r]: {
|
|
14
|
+
preset: "client",
|
|
15
|
+
presetConfig: {
|
|
16
|
+
fragmentMasking: !1,
|
|
17
|
+
persistedDocuments: !0
|
|
18
|
+
},
|
|
19
|
+
config: {
|
|
20
|
+
useTypeImports: !0,
|
|
21
|
+
namingConvention: "keep"
|
|
22
|
+
}
|
|
23
|
+
} },
|
|
24
|
+
...o && { [r]: t() }
|
|
25
|
+
}
|
|
26
|
+
};
|
|
35
27
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
//# sourceMappingURL=graphql-codegen.util.js.map
|
|
28
|
+
//#endregion
|
|
29
|
+
export { n as createGraphqlCodegenConfig };
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=graphql-codegen.util.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql-codegen.util.js","sources":["../../../src/config/graphql-codegen/graphql-codegen.util.ts"],"sourcesContent":["import type { CodegenConfig } from '@graphql-codegen/cli';\n\nimport { defineConfig } from '@eddeee888/gcg-typescript-resolver-files';\n\nimport type { I_GraphqlCodegenConfig } from './graphql-codegen.type.js';\n\nimport { loadEnvFile } from '../env/env.util.js';\n\nloadEnvFile();\n\n/**\n * Creates a GraphQL Code Generator configuration for client or server code generation.\n * This function generates a complete GraphQL Code Generator configuration based on\n * the specified target (client or server) with appropriate presets and settings.\n *\n * For client targets, it configures:\n * - Client preset with fragment masking disabled\n * - Persisted documents support\n * - Type imports and naming convention settings\n * - Document processing from specified source\n *\n * For server targets, it configures:\n * - TypeScript resolver files generation\n * - Server-side GraphQL type definitions\n * - Resolver function generation\n *\n * @param options - Configuration object containing uri, from, to, and target properties.\n * @param options.uri - The GraphQL schema URI to generate types from.\n * @param options.from - The source path for GraphQL documents (used for client generation).\n * @param options.to - The output path for generated files.\n * @param options.target - The generation target ('client' for frontend, 'server' for backend).\n * @returns A complete GraphQL Code Generator configuration object.\n */\nexport function createGraphqlCodegenConfig({\n uri,\n from,\n to,\n target = 'client',\n}: I_GraphqlCodegenConfig): CodegenConfig {\n const isClient = target === 'client';\n const isServer = target === 'server';\n\n return {\n schema: uri,\n ignoreNoDocuments: true,\n overwrite: true,\n ...(isClient && { documents: [from] }),\n generates: {\n ...(isClient && {\n [to]: {\n preset: 'client',\n presetConfig: {\n fragmentMasking: false,\n persistedDocuments: true,\n },\n config: {\n useTypeImports: true,\n namingConvention: 'keep',\n },\n },\n }),\n ...(isServer && {\n [to]: defineConfig(),\n }),\n },\n };\n}\n"],"
|
|
1
|
+
{"version":3,"file":"graphql-codegen.util.js","names":[],"sources":["../../../src/config/graphql-codegen/graphql-codegen.util.ts"],"sourcesContent":["import type { CodegenConfig } from '@graphql-codegen/cli';\n\nimport { defineConfig } from '@eddeee888/gcg-typescript-resolver-files';\n\nimport type { I_GraphqlCodegenConfig } from './graphql-codegen.type.js';\n\nimport { loadEnvFile } from '../env/env.util.js';\n\nloadEnvFile();\n\n/**\n * Creates a GraphQL Code Generator configuration for client or server code generation.\n * This function generates a complete GraphQL Code Generator configuration based on\n * the specified target (client or server) with appropriate presets and settings.\n *\n * For client targets, it configures:\n * - Client preset with fragment masking disabled\n * - Persisted documents support\n * - Type imports and naming convention settings\n * - Document processing from specified source\n *\n * For server targets, it configures:\n * - TypeScript resolver files generation\n * - Server-side GraphQL type definitions\n * - Resolver function generation\n *\n * @param options - Configuration object containing uri, from, to, and target properties.\n * @param options.uri - The GraphQL schema URI to generate types from.\n * @param options.from - The source path for GraphQL documents (used for client generation).\n * @param options.to - The output path for generated files.\n * @param options.target - The generation target ('client' for frontend, 'server' for backend).\n * @returns A complete GraphQL Code Generator configuration object.\n */\nexport function createGraphqlCodegenConfig({\n uri,\n from,\n to,\n target = 'client',\n}: I_GraphqlCodegenConfig): CodegenConfig {\n const isClient = target === 'client';\n const isServer = target === 'server';\n\n return {\n schema: uri,\n ignoreNoDocuments: true,\n overwrite: true,\n ...(isClient && { documents: [from] }),\n generates: {\n ...(isClient && {\n [to]: {\n preset: 'client',\n presetConfig: {\n fragmentMasking: false,\n persistedDocuments: true,\n },\n config: {\n useTypeImports: true,\n namingConvention: 'keep',\n },\n },\n }),\n ...(isServer && {\n [to]: defineConfig(),\n }),\n },\n };\n}\n"],"mappings":";;;AAQA,GAAa;AAyBb,SAAgB,EAA2B,EACvC,QACA,SACA,OACA,YAAS,YAC6B;CACtC,IAAM,IAAW,MAAW,UACtB,IAAW,MAAW;AAE5B,QAAO;EACH,QAAQ;EACR,mBAAmB;EACnB,WAAW;EACX,GAAI,KAAY,EAAE,WAAW,CAAC,EAAK,EAAE;EACrC,WAAW;GACP,GAAI,KAAY,GACX,IAAK;IACF,QAAQ;IACR,cAAc;KACV,iBAAiB;KACjB,oBAAoB;KACvB;IACD,QAAQ;KACJ,gBAAgB;KAChB,kBAAkB;KACrB;IACJ,EACJ;GACD,GAAI,KAAY,GACX,IAAK,GAAc,EACvB;GACJ;EACJ"}
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
import { createGraphqlCodegenConfig as
|
|
2
|
-
export {
|
|
3
|
-
r as createGraphqlCodegenConfig
|
|
4
|
-
};
|
|
5
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import { createGraphqlCodegenConfig as e } from "./graphql-codegen.util.js";
|
|
2
|
+
export { e as createGraphqlCodegenConfig };
|
package/dist/config/index.js
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import { E_ConfigType as
|
|
2
|
-
import { mergeConfigs as
|
|
3
|
-
export {
|
|
4
|
-
r as E_ConfigType,
|
|
5
|
-
g as mergeConfigs
|
|
6
|
-
};
|
|
7
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import { E_ConfigType as e } from "./config.type.js";
|
|
2
|
+
import { mergeConfigs as t } from "./config.util.js";
|
|
3
|
+
export { e as E_ConfigType, t as mergeConfigs };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
//#region src/config/lint-staged/index.ts
|
|
2
|
+
var e = {
|
|
3
|
+
"*.ts": () => "tsc --noEmit",
|
|
4
|
+
"*": ["eslint --fix --no-cache"]
|
|
4
5
|
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
//# sourceMappingURL=index.js.map
|
|
6
|
+
//#endregion
|
|
7
|
+
export { e as default };
|
|
8
|
+
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/config/lint-staged/index.ts"],"sourcesContent":["export default {\n '*.ts': () => 'tsc --noEmit',\n '*': ['eslint --fix --no-cache'],\n};\n"],"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/config/lint-staged/index.ts"],"sourcesContent":["export default {\n '*.ts': () => 'tsc --noEmit',\n '*': ['eslint --fix --no-cache'],\n};\n"],"mappings":";AAAA,IAAA,IAAe;CACX,cAAc;CACd,KAAK,CAAC,0BAA0B;CACnC"}
|
|
@@ -1,7 +1,3 @@
|
|
|
1
1
|
import { storybookMain as e } from "./storybook.main.js";
|
|
2
|
-
import { storybookPreview as
|
|
3
|
-
export {
|
|
4
|
-
e as storybookMain,
|
|
5
|
-
b as storybookPreview
|
|
6
|
-
};
|
|
7
|
-
//# sourceMappingURL=index.js.map
|
|
2
|
+
import { storybookPreview as t } from "./storybook.preview.js";
|
|
3
|
+
export { e as storybookMain, t as storybookPreview };
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import { deepMerge as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { deepMerge as e } from "../../util/object/object.util.js";
|
|
2
|
+
//#region src/config/storybook/storybook.main.ts
|
|
3
|
+
function t(t) {
|
|
4
|
+
return e({
|
|
5
|
+
stories: ["../src/**/*.stories.@(js|jsx|mjs|ts|tsx|mdx)"],
|
|
6
|
+
addons: [
|
|
7
|
+
"@storybook/addon-essentials",
|
|
8
|
+
"@storybook/addon-interactions",
|
|
9
|
+
"@storybook/addon-links"
|
|
10
|
+
],
|
|
11
|
+
framework: {
|
|
12
|
+
name: "@storybook/react-vite",
|
|
13
|
+
options: {}
|
|
14
|
+
}
|
|
15
|
+
}, t);
|
|
15
16
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
//# sourceMappingURL=storybook.main.js.map
|
|
17
|
+
//#endregion
|
|
18
|
+
export { t as storybookMain };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=storybook.main.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storybook.main.js","sources":["../../../src/config/storybook/storybook.main.ts"],"sourcesContent":["import type { StorybookConfig } from '@storybook/react-vite';\n\nimport { deepMerge } from '../../util/object/index.js';\n\n/**\n * Creates a Storybook main configuration for React projects using Vite.\n * This function generates a Storybook configuration specifically designed for React applications\n * with Vite as the build tool. It includes essential addons and framework settings.\n *\n * The configuration includes:\n * - React Vite framework integration\n * - Essential Storybook addons (docs, controls, actions, viewport, backgrounds)\n * - Story file pattern matching\n * - Vite configuration support\n * - Configurable options merging\n *\n * @param options - Additional Storybook configuration options to merge with the base config.\n * @returns A Storybook configuration object optimized for React with Vite.\n */\nexport function storybookMain(options?: Partial<StorybookConfig>): StorybookConfig {\n const config: StorybookConfig = {\n stories: ['../src/**/*.stories.@(js|jsx|mjs|ts|tsx|mdx)'],\n addons: [\n '@storybook/addon-essentials',\n '@storybook/addon-interactions',\n '@storybook/addon-links',\n ],\n framework: {\n name: '@storybook/react-vite',\n options: {},\n },\n };\n\n return deepMerge(config, options) as StorybookConfig;\n}\n"],"
|
|
1
|
+
{"version":3,"file":"storybook.main.js","names":[],"sources":["../../../src/config/storybook/storybook.main.ts"],"sourcesContent":["import type { StorybookConfig } from '@storybook/react-vite';\n\nimport { deepMerge } from '../../util/object/index.js';\n\n/**\n * Creates a Storybook main configuration for React projects using Vite.\n * This function generates a Storybook configuration specifically designed for React applications\n * with Vite as the build tool. It includes essential addons and framework settings.\n *\n * The configuration includes:\n * - React Vite framework integration\n * - Essential Storybook addons (docs, controls, actions, viewport, backgrounds)\n * - Story file pattern matching\n * - Vite configuration support\n * - Configurable options merging\n *\n * @param options - Additional Storybook configuration options to merge with the base config.\n * @returns A Storybook configuration object optimized for React with Vite.\n */\nexport function storybookMain(options?: Partial<StorybookConfig>): StorybookConfig {\n const config: StorybookConfig = {\n stories: ['../src/**/*.stories.@(js|jsx|mjs|ts|tsx|mdx)'],\n addons: [\n '@storybook/addon-essentials',\n '@storybook/addon-interactions',\n '@storybook/addon-links',\n ],\n framework: {\n name: '@storybook/react-vite',\n options: {},\n },\n };\n\n return deepMerge(config, options) as StorybookConfig;\n}\n"],"mappings":";;AAmBA,SAAgB,EAAc,GAAqD;AAc/E,QAAO,EAbyB;EAC5B,SAAS,CAAC,+CAA+C;EACzD,QAAQ;GACJ;GACA;GACA;GACH;EACD,WAAW;GACP,MAAM;GACN,SAAS,EAAE;GACd;EACJ,EAEwB,EAAQ"}
|
|
@@ -1,38 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
...e,
|
|
29
|
-
parameters: {
|
|
30
|
-
...r.parameters,
|
|
31
|
-
...e?.parameters
|
|
32
|
-
}
|
|
33
|
-
};
|
|
1
|
+
//#region src/config/storybook/storybook.preview.ts
|
|
2
|
+
var e = /(background|color)$/i, t = /Date$/i;
|
|
3
|
+
function n(n) {
|
|
4
|
+
let r = { parameters: {
|
|
5
|
+
controls: { matchers: {
|
|
6
|
+
color: e,
|
|
7
|
+
date: t
|
|
8
|
+
} },
|
|
9
|
+
backgrounds: {
|
|
10
|
+
default: "light",
|
|
11
|
+
values: [{
|
|
12
|
+
name: "light",
|
|
13
|
+
value: "#ffffff"
|
|
14
|
+
}, {
|
|
15
|
+
name: "dark",
|
|
16
|
+
value: "#333333"
|
|
17
|
+
}]
|
|
18
|
+
}
|
|
19
|
+
} };
|
|
20
|
+
return {
|
|
21
|
+
...r,
|
|
22
|
+
...n,
|
|
23
|
+
parameters: {
|
|
24
|
+
...r.parameters,
|
|
25
|
+
...n?.parameters
|
|
26
|
+
}
|
|
27
|
+
};
|
|
34
28
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
//# sourceMappingURL=storybook.preview.js.map
|
|
29
|
+
//#endregion
|
|
30
|
+
export { n as storybookPreview };
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=storybook.preview.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storybook.preview.js","sources":["../../../src/config/storybook/storybook.preview.ts"],"sourcesContent":["import type { Preview } from '@storybook/react';\n\nconst RE_COLOR_MATCHER = /(background|color)$/i;\nconst RE_DATE_MATCHER = /Date$/i;\n\n/**\n * Creates a Storybook preview configuration with preconfigured controls and background settings.\n * This function generates a preview configuration that provides default parameters\n * and decorators for Storybook stories. It sets up common controls, backgrounds,\n * and viewport settings for consistent story rendering.\n *\n * The configuration includes:\n * - Default control parameters for common props\n * - Background color options\n * - Viewport presets for responsive testing\n * - Actions configuration for event handlers\n * - Configurable options merging\n *\n * @param options - Additional preview configuration options to merge with the base config.\n * @returns A Storybook preview configuration object.\n */\nexport function storybookPreview(options?: Partial<Preview>): Preview {\n const preview: Preview = {\n parameters: {\n controls: {\n matchers: {\n color: RE_COLOR_MATCHER,\n date: RE_DATE_MATCHER,\n },\n },\n backgrounds: {\n default: 'light',\n values: [\n {\n name: 'light',\n value: '#ffffff',\n },\n {\n name: 'dark',\n value: '#333333',\n },\n ],\n },\n },\n };\n\n return {\n ...preview,\n ...options,\n parameters: {\n ...preview.parameters,\n ...options?.parameters,\n },\n };\n}\n"],"
|
|
1
|
+
{"version":3,"file":"storybook.preview.js","names":[],"sources":["../../../src/config/storybook/storybook.preview.ts"],"sourcesContent":["import type { Preview } from '@storybook/react';\n\nconst RE_COLOR_MATCHER = /(background|color)$/i;\nconst RE_DATE_MATCHER = /Date$/i;\n\n/**\n * Creates a Storybook preview configuration with preconfigured controls and background settings.\n * This function generates a preview configuration that provides default parameters\n * and decorators for Storybook stories. It sets up common controls, backgrounds,\n * and viewport settings for consistent story rendering.\n *\n * The configuration includes:\n * - Default control parameters for common props\n * - Background color options\n * - Viewport presets for responsive testing\n * - Actions configuration for event handlers\n * - Configurable options merging\n *\n * @param options - Additional preview configuration options to merge with the base config.\n * @returns A Storybook preview configuration object.\n */\nexport function storybookPreview(options?: Partial<Preview>): Preview {\n const preview: Preview = {\n parameters: {\n controls: {\n matchers: {\n color: RE_COLOR_MATCHER,\n date: RE_DATE_MATCHER,\n },\n },\n backgrounds: {\n default: 'light',\n values: [\n {\n name: 'light',\n value: '#ffffff',\n },\n {\n name: 'dark',\n value: '#333333',\n },\n ],\n },\n },\n };\n\n return {\n ...preview,\n ...options,\n parameters: {\n ...preview.parameters,\n ...options?.parameters,\n },\n };\n}\n"],"mappings":";AAEA,IAAM,IAAmB,wBACnB,IAAkB;AAkBxB,SAAgB,EAAiB,GAAqC;CAClE,IAAM,IAAmB,EACrB,YAAY;EACR,UAAU,EACN,UAAU;GACN,OAAO;GACP,MAAM;GACT,EACJ;EACD,aAAa;GACT,SAAS;GACT,QAAQ,CACJ;IACI,MAAM;IACN,OAAO;IACV,EACD;IACI,MAAM;IACN,OAAO;IACV,CACJ;GACJ;EACJ,EACJ;AAED,QAAO;EACH,GAAG;EACH,GAAG;EACH,YAAY;GACR,GAAG,EAAQ;GACX,GAAG,GAAS;GACf;EACJ"}
|