@cyberskill/shared 3.0.0 → 3.1.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 +1 -0
- package/dist/config/commitlint/index.js.map +1 -0
- package/dist/config/config.test.unit.d.ts +1 -0
- package/dist/config/config.type.js +1 -0
- package/dist/config/config.type.js.map +1 -0
- package/dist/config/config.type.test.unit.d.ts +1 -0
- package/dist/config/config.util.js +1 -0
- package/dist/config/config.util.js.map +1 -0
- package/dist/config/env/env.constant.js +1 -0
- package/dist/config/env/env.constant.js.map +1 -0
- package/dist/config/env/env.util.js +1 -0
- package/dist/config/env/env.util.js.map +1 -0
- package/dist/config/env/index.js +1 -0
- package/dist/config/env/index.js.map +1 -0
- package/dist/config/eslint/index.js +1 -0
- package/dist/config/eslint/index.js.map +1 -0
- package/dist/config/graphql-codegen/graphql-codegen.util.js +1 -0
- package/dist/config/graphql-codegen/graphql-codegen.util.js.map +1 -0
- package/dist/config/graphql-codegen/index.js +1 -0
- package/dist/config/graphql-codegen/index.js.map +1 -0
- package/dist/config/index.js +1 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/lint-staged/index.js +1 -0
- package/dist/config/lint-staged/index.js.map +1 -0
- package/dist/config/storybook/index.js +1 -0
- package/dist/config/storybook/index.js.map +1 -0
- package/dist/config/storybook/storybook.main.js +1 -0
- package/dist/config/storybook/storybook.main.js.map +1 -0
- package/dist/config/storybook/storybook.preview.js +1 -0
- package/dist/config/storybook/storybook.preview.js.map +1 -0
- package/dist/config/vitest/index.js +1 -0
- package/dist/config/vitest/index.js.map +1 -0
- package/dist/config/vitest/vitest.e2e.js +1 -0
- package/dist/config/vitest/vitest.e2e.js.map +1 -0
- package/dist/config/vitest/vitest.unit.js +1 -0
- package/dist/config/vitest/vitest.unit.js.map +1 -0
- package/dist/constant/common.js +1 -0
- package/dist/constant/common.js.map +1 -0
- package/dist/constant/constant.test.unit.d.ts +1 -0
- package/dist/constant/index.js +1 -0
- package/dist/constant/index.js.map +1 -0
- package/dist/constant/response-status.js +1 -0
- package/dist/constant/response-status.js.map +1 -0
- package/dist/node/apollo-server/apollo-server.util.js +1 -0
- package/dist/node/apollo-server/apollo-server.util.js.map +1 -0
- package/dist/node/apollo-server/index.js +1 -0
- package/dist/node/apollo-server/index.js.map +1 -0
- package/dist/node/cli/index.js +1 -0
- package/dist/node/cli/index.js.map +1 -0
- package/dist/node/command/command.test.unit.d.ts +1 -0
- package/dist/node/command/command.type.js +1 -0
- package/dist/node/command/command.type.js.map +1 -0
- package/dist/node/command/command.util.js +110 -102
- package/dist/node/command/command.util.js.map +1 -0
- package/dist/node/command/index.js +1 -0
- package/dist/node/command/index.js.map +1 -0
- package/dist/node/express/express.type.d.ts +4 -0
- package/dist/node/express/express.util.js +53 -35
- package/dist/node/express/express.util.js.map +1 -0
- package/dist/node/express/index.js +1 -0
- package/dist/node/express/index.js.map +1 -0
- package/dist/node/fs/fs.test.unit.d.ts +1 -0
- package/dist/node/fs/fs.util.js +1 -0
- package/dist/node/fs/fs.util.js.map +1 -0
- package/dist/node/fs/index.js +1 -0
- package/dist/node/fs/index.js.map +1 -0
- package/dist/node/log/index.js +1 -0
- package/dist/node/log/index.js.map +1 -0
- package/dist/node/log/log.test.unit.d.ts +1 -0
- package/dist/node/log/log.type.js +1 -0
- package/dist/node/log/log.type.js.map +1 -0
- package/dist/node/log/log.util.js +1 -0
- package/dist/node/log/log.util.js.map +1 -0
- package/dist/node/mongo/index.d.ts +2 -0
- package/dist/node/mongo/index.js +21 -12
- package/dist/node/mongo/index.js.map +1 -0
- package/dist/node/mongo/mongo.constant.js +1 -0
- package/dist/node/mongo/mongo.constant.js.map +1 -0
- package/dist/node/mongo/mongo.controller.d.ts +5 -315
- package/dist/node/mongo/mongo.controller.mongoose.d.ts +234 -0
- package/dist/node/mongo/mongo.controller.mongoose.js +468 -0
- package/dist/node/mongo/mongo.controller.mongoose.js.map +1 -0
- package/dist/node/mongo/mongo.controller.native.d.ts +84 -0
- package/dist/node/mongo/mongo.controller.native.js +214 -0
- package/dist/node/mongo/mongo.controller.native.js.map +1 -0
- package/dist/node/mongo/mongo.dynamic-populate.d.ts +61 -0
- package/dist/node/mongo/mongo.dynamic-populate.js +197 -0
- package/dist/node/mongo/mongo.dynamic-populate.js.map +1 -0
- package/dist/node/mongo/mongo.populate.d.ts +15 -0
- package/dist/node/mongo/mongo.populate.js +269 -0
- package/dist/node/mongo/mongo.populate.js.map +1 -0
- package/dist/node/mongo/mongo.type.js +1 -0
- package/dist/node/mongo/mongo.type.js.map +1 -0
- package/dist/node/mongo/mongo.util.d.ts +52 -0
- package/dist/node/mongo/mongo.util.js +106 -363
- package/dist/node/mongo/mongo.util.js.map +1 -0
- package/dist/node/package/index.js +1 -0
- package/dist/node/package/index.js.map +1 -0
- package/dist/node/package/package.test.unit.d.ts +1 -0
- package/dist/node/package/package.type.js +1 -0
- package/dist/node/package/package.type.js.map +1 -0
- package/dist/node/package/package.util.js +20 -20
- package/dist/node/package/package.util.js.map +1 -0
- package/dist/node/path/index.js +1 -0
- package/dist/node/path/index.js.map +1 -0
- package/dist/node/path/path.constant.js +1 -0
- package/dist/node/path/path.constant.js.map +1 -0
- package/dist/node/path/path.util.js +1 -0
- package/dist/node/path/path.util.js.map +1 -0
- package/dist/node/storage/index.js +1 -0
- package/dist/node/storage/index.js.map +1 -0
- package/dist/node/storage/storage.constant.js +1 -0
- package/dist/node/storage/storage.constant.js.map +1 -0
- package/dist/node/storage/storage.util.js +1 -0
- package/dist/node/storage/storage.util.js.map +1 -0
- package/dist/node/upload/index.js +1 -0
- package/dist/node/upload/index.js.map +1 -0
- package/dist/node/upload/upload.constant.js +1 -0
- package/dist/node/upload/upload.constant.js.map +1 -0
- package/dist/node/upload/upload.type.js +1 -0
- package/dist/node/upload/upload.type.js.map +1 -0
- package/dist/node/upload/upload.util.js +1 -0
- package/dist/node/upload/upload.util.js.map +1 -0
- package/dist/node/ws/index.d.ts +1 -1
- package/dist/node/ws/index.js +2 -1
- package/dist/node/ws/index.js.map +1 -0
- package/dist/node/ws/{ts.util.js → ws.util.js} +1 -0
- package/dist/node/ws/ws.util.js.map +1 -0
- package/dist/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 +1 -0
- package/dist/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.map +1 -0
- package/dist/react/apollo-client/apollo-client.component.js +1 -0
- package/dist/react/apollo-client/apollo-client.component.js.map +1 -0
- package/dist/react/apollo-client/apollo-client.constant.js +1 -0
- package/dist/react/apollo-client/apollo-client.constant.js.map +1 -0
- package/dist/react/apollo-client/apollo-client.context.js +1 -0
- package/dist/react/apollo-client/apollo-client.context.js.map +1 -0
- package/dist/react/apollo-client/apollo-client.module.scss.js +1 -0
- package/dist/react/apollo-client/apollo-client.module.scss.js.map +1 -0
- package/dist/react/apollo-client/apollo-client.util.js +1 -0
- package/dist/react/apollo-client/apollo-client.util.js.map +1 -0
- package/dist/react/apollo-client/index.js +1 -0
- package/dist/react/apollo-client/index.js.map +1 -0
- package/dist/react/apollo-client/links/index.js +1 -0
- package/dist/react/apollo-client/links/index.js.map +1 -0
- package/dist/react/apollo-client/links/upload.js +1 -0
- package/dist/react/apollo-client/links/upload.js.map +1 -0
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.component.js +1 -0
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.component.js.map +1 -0
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.rsc.js +1 -0
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.rsc.js.map +1 -0
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.util.js +1 -0
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.util.js.map +1 -0
- package/dist/react/apollo-client-nextjs/index.js +1 -0
- package/dist/react/apollo-client-nextjs/index.js.map +1 -0
- package/dist/react/apollo-error/apollo-error.component.js +1 -0
- package/dist/react/apollo-error/apollo-error.component.js.map +1 -0
- package/dist/react/apollo-error/apollo-error.context.js +1 -0
- package/dist/react/apollo-error/apollo-error.context.js.map +1 -0
- package/dist/react/apollo-error/apollo-error.hook.js +1 -0
- package/dist/react/apollo-error/apollo-error.hook.js.map +1 -0
- package/dist/react/apollo-error/apollo-error.module.scss.js +1 -0
- package/dist/react/apollo-error/apollo-error.module.scss.js.map +1 -0
- package/dist/react/apollo-error/apollo-error.provider.js +1 -0
- package/dist/react/apollo-error/apollo-error.provider.js.map +1 -0
- package/dist/react/apollo-error/apollo-error.util.js +1 -0
- package/dist/react/apollo-error/apollo-error.util.js.map +1 -0
- package/dist/react/apollo-error/index.js +1 -0
- package/dist/react/apollo-error/index.js.map +1 -0
- package/dist/react/i18next/i18next.hook.js +1 -0
- package/dist/react/i18next/i18next.hook.js.map +1 -0
- package/dist/react/i18next/i18next.util.js +1 -0
- package/dist/react/i18next/i18next.util.js.map +1 -0
- package/dist/react/i18next/index.js +1 -0
- package/dist/react/i18next/index.js.map +1 -0
- package/dist/react/loading/index.js +1 -0
- package/dist/react/loading/index.js.map +1 -0
- package/dist/react/loading/loading.component.js +1 -0
- package/dist/react/loading/loading.component.js.map +1 -0
- package/dist/react/loading/loading.context.js +1 -0
- package/dist/react/loading/loading.context.js.map +1 -0
- package/dist/react/loading/loading.hook.js +1 -0
- package/dist/react/loading/loading.hook.js.map +1 -0
- package/dist/react/loading/loading.module.scss.js +1 -0
- package/dist/react/loading/loading.module.scss.js.map +1 -0
- package/dist/react/loading/loading.provider.js +1 -0
- package/dist/react/loading/loading.provider.js.map +1 -0
- package/dist/react/log/index.js +1 -0
- package/dist/react/log/index.js.map +1 -0
- package/dist/react/log/log.util.js +1 -0
- package/dist/react/log/log.util.js.map +1 -0
- package/dist/react/next-intl/index.js +1 -0
- package/dist/react/next-intl/index.js.map +1 -0
- package/dist/react/next-intl/next-intl.constant.js +1 -0
- package/dist/react/next-intl/next-intl.constant.js.map +1 -0
- package/dist/react/next-intl/next-intl.context.js +1 -0
- package/dist/react/next-intl/next-intl.context.js.map +1 -0
- package/dist/react/next-intl/next-intl.hoc.js +1 -0
- package/dist/react/next-intl/next-intl.hoc.js.map +1 -0
- package/dist/react/next-intl/next-intl.hook.js +1 -0
- package/dist/react/next-intl/next-intl.hook.js.map +1 -0
- package/dist/react/next-intl/next-intl.provider.js +1 -0
- package/dist/react/next-intl/next-intl.provider.js.map +1 -0
- package/dist/react/storage/index.js +1 -0
- package/dist/react/storage/index.js.map +1 -0
- package/dist/react/storage/storage.hook.js +1 -0
- package/dist/react/storage/storage.hook.js.map +1 -0
- package/dist/react/storage/storage.test.unit.d.ts +1 -0
- package/dist/react/storage/storage.util.js +1 -0
- package/dist/react/storage/storage.util.js.map +1 -0
- package/dist/react/toast/index.js +1 -0
- package/dist/react/toast/index.js.map +1 -0
- package/dist/react/userback/index.js +1 -0
- package/dist/react/userback/index.js.map +1 -0
- package/dist/react/userback/userback.component.js +1 -0
- package/dist/react/userback/userback.component.js.map +1 -0
- package/dist/typescript/common.type.js +1 -0
- package/dist/typescript/common.type.js.map +1 -0
- package/dist/typescript/index.js +1 -0
- package/dist/typescript/index.js.map +1 -0
- package/dist/typescript/typescript.test.unit.d.ts +1 -0
- package/dist/util/common/common.util.js +1 -0
- package/dist/util/common/common.util.js.map +1 -0
- package/dist/util/common/index.js +1 -0
- package/dist/util/common/index.js.map +1 -0
- package/dist/util/index.js +1 -0
- package/dist/util/index.js.map +1 -0
- package/dist/util/object/index.js +1 -0
- package/dist/util/object/index.js.map +1 -0
- package/dist/util/object/object.util.js +1 -0
- package/dist/util/object/object.util.js.map +1 -0
- package/dist/util/serializer/index.js +1 -0
- package/dist/util/serializer/index.js.map +1 -0
- package/dist/util/serializer/serializer.util.js +1 -0
- package/dist/util/serializer/serializer.util.js.map +1 -0
- package/dist/util/string/index.js +1 -0
- package/dist/util/string/index.js.map +1 -0
- package/dist/util/string/string.util.js +1 -0
- package/dist/util/string/string.util.js.map +1 -0
- package/dist/util/validate/index.js +1 -0
- package/dist/util/validate/index.js.map +1 -0
- package/dist/util/validate/validate.util.js +1 -0
- package/dist/util/validate/validate.util.js.map +1 -0
- package/package.json +58 -87
- package/dist/config/commitlint/index.cjs +0 -1
- package/dist/config/config.type.cjs +0 -1
- package/dist/config/config.util.cjs +0 -1
- package/dist/config/env/env.constant.cjs +0 -1
- package/dist/config/env/env.util.cjs +0 -1
- package/dist/config/env/index.cjs +0 -1
- package/dist/config/eslint/index.cjs +0 -1
- package/dist/config/graphql-codegen/graphql-codegen.util.cjs +0 -1
- package/dist/config/graphql-codegen/index.cjs +0 -1
- package/dist/config/index.cjs +0 -1
- package/dist/config/lint-staged/index.cjs +0 -1
- package/dist/config/storybook/index.cjs +0 -1
- package/dist/config/storybook/storybook.main.cjs +0 -1
- package/dist/config/storybook/storybook.preview.cjs +0 -1
- package/dist/config/vitest/index.cjs +0 -1
- package/dist/config/vitest/vitest.e2e.cjs +0 -1
- package/dist/config/vitest/vitest.unit.cjs +0 -1
- package/dist/constant/common.cjs +0 -1
- package/dist/constant/index.cjs +0 -1
- package/dist/constant/response-status.cjs +0 -1
- package/dist/node/apollo-server/apollo-server.util.cjs +0 -1
- package/dist/node/apollo-server/index.cjs +0 -1
- package/dist/node/cli/index.cjs +0 -3
- package/dist/node/command/command.type.cjs +0 -1
- package/dist/node/command/command.util.cjs +0 -2
- package/dist/node/command/index.cjs +0 -1
- package/dist/node/express/express.util.cjs +0 -1
- package/dist/node/express/index.cjs +0 -1
- package/dist/node/fs/fs.util.cjs +0 -4
- package/dist/node/fs/index.cjs +0 -1
- package/dist/node/log/index.cjs +0 -1
- package/dist/node/log/log.type.cjs +0 -1
- package/dist/node/log/log.util.cjs +0 -1
- package/dist/node/mongo/index.cjs +0 -1
- package/dist/node/mongo/mongo.constant.cjs +0 -1
- package/dist/node/mongo/mongo.controller.cjs +0 -1
- package/dist/node/mongo/mongo.controller.js +0 -858
- package/dist/node/mongo/mongo.type.cjs +0 -1
- package/dist/node/mongo/mongo.util.cjs +0 -2
- package/dist/node/package/index.cjs +0 -1
- package/dist/node/package/package.type.cjs +0 -1
- package/dist/node/package/package.util.cjs +0 -1
- package/dist/node/path/index.cjs +0 -1
- package/dist/node/path/path.constant.cjs +0 -1
- package/dist/node/path/path.util.cjs +0 -1
- package/dist/node/storage/index.cjs +0 -1
- package/dist/node/storage/storage.constant.cjs +0 -1
- package/dist/node/storage/storage.util.cjs +0 -1
- package/dist/node/upload/index.cjs +0 -1
- package/dist/node/upload/upload.constant.cjs +0 -1
- package/dist/node/upload/upload.type.cjs +0 -1
- package/dist/node/upload/upload.util.cjs +0 -1
- package/dist/node/ws/index.cjs +0 -1
- package/dist/node/ws/ts.util.cjs +0 -1
- package/dist/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 +0 -1
- package/dist/react/apollo-client/apollo-client.component.cjs +0 -1
- package/dist/react/apollo-client/apollo-client.constant.cjs +0 -1
- package/dist/react/apollo-client/apollo-client.context.cjs +0 -1
- package/dist/react/apollo-client/apollo-client.module.scss.cjs +0 -1
- package/dist/react/apollo-client/apollo-client.util.cjs +0 -1
- package/dist/react/apollo-client/index.cjs +0 -1
- package/dist/react/apollo-client/links/index.cjs +0 -1
- package/dist/react/apollo-client/links/upload.cjs +0 -1
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.component.cjs +0 -1
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.rsc.cjs +0 -1
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.util.cjs +0 -1
- package/dist/react/apollo-client-nextjs/index.cjs +0 -1
- package/dist/react/apollo-error/apollo-error.component.cjs +0 -1
- package/dist/react/apollo-error/apollo-error.context.cjs +0 -1
- package/dist/react/apollo-error/apollo-error.hook.cjs +0 -1
- package/dist/react/apollo-error/apollo-error.module.scss.cjs +0 -1
- package/dist/react/apollo-error/apollo-error.provider.cjs +0 -1
- package/dist/react/apollo-error/apollo-error.util.cjs +0 -1
- package/dist/react/apollo-error/index.cjs +0 -1
- package/dist/react/i18next/i18next.hook.cjs +0 -1
- package/dist/react/i18next/i18next.util.cjs +0 -1
- package/dist/react/i18next/index.cjs +0 -1
- package/dist/react/loading/index.cjs +0 -1
- package/dist/react/loading/loading.component.cjs +0 -6
- package/dist/react/loading/loading.context.cjs +0 -1
- package/dist/react/loading/loading.hook.cjs +0 -1
- package/dist/react/loading/loading.module.scss.cjs +0 -1
- package/dist/react/loading/loading.provider.cjs +0 -1
- package/dist/react/log/index.cjs +0 -1
- package/dist/react/log/log.util.cjs +0 -1
- package/dist/react/next-intl/index.cjs +0 -1
- package/dist/react/next-intl/next-intl.constant.cjs +0 -1
- package/dist/react/next-intl/next-intl.context.cjs +0 -1
- package/dist/react/next-intl/next-intl.hoc.cjs +0 -1
- package/dist/react/next-intl/next-intl.hook.cjs +0 -1
- package/dist/react/next-intl/next-intl.provider.cjs +0 -1
- package/dist/react/storage/index.cjs +0 -1
- package/dist/react/storage/storage.hook.cjs +0 -1
- package/dist/react/storage/storage.util.cjs +0 -1
- package/dist/react/toast/index.cjs +0 -1
- package/dist/react/userback/index.cjs +0 -1
- package/dist/react/userback/userback.component.cjs +0 -1
- package/dist/typescript/common.type.cjs +0 -1
- package/dist/typescript/index.cjs +0 -1
- package/dist/util/common/common.util.cjs +0 -1
- package/dist/util/common/index.cjs +0 -1
- package/dist/util/index.cjs +0 -1
- package/dist/util/object/index.cjs +0 -1
- package/dist/util/object/object.util.cjs +0 -1
- package/dist/util/serializer/index.cjs +0 -1
- package/dist/util/serializer/serializer.util.cjs +0 -1
- package/dist/util/string/index.cjs +0 -1
- package/dist/util/string/string.util.cjs +0 -1
- package/dist/util/validate/index.cjs +0 -1
- package/dist/util/validate/validate.util.cjs +0 -1
- /package/dist/node/ws/{ts.util.d.ts → ws.util.d.ts} +0 -0
|
@@ -0,0 +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"],"names":["index","message"],"mappings":"AAAA,MAAAA,IAAe;AAAA,EACX,SAAS,CAAC,iCAAiC;AAAA,EAC3C,SAAS;AAAA,IACL,CAACC,MAAoBA,EAAQ,SAAS,kBAAkB;AAAA,EAAA;AAEhE;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +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"],"names":["E_ConfigType"],"mappings":"AAEO,IAAKA,sBAAAA,OACRA,EAAA,SAAS,UACTA,EAAA,aAAa,cACbA,EAAA,cAAc,eACdA,EAAA,mBAAmB,oBACnBA,EAAA,oBAAoB,qBALZA,IAAAA,KAAA,CAAA,CAAA;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +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 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 (!config || config.length === 0) {\n return handler({});\n }\n\n if (!handler) {\n throw new Error(`Unknown config type: ${type}`);\n }\n\n return handler(...config);\n}\n"],"names":["antfu","E_ConfigType","eslintBaseConfig","vitestE2E","vitestUnit","deepMerge","handleESLint","config","mergedConfig","ignores","restConfig","configHandlers","mergeConfigs","type","handler"],"mappings":"AA2BA,OAAAA,OAAA;AAAA,SAAA,gBAAAC,SAAA;AAAA,OAAAC,OAAA;AAAA,SAAA,aAAAC,SAAA;AAAA,SAAA,cAAAC,SAAA;AAAA,SAAA,aAAAC,SAAA;AAAA,MAAMC,IAAgC,IAAIC,MAAW;AACjD,QAAMC,IAAeH;AAAA,IACjB,GAAI,MAAM,QAAQH,CAAgB,IAAIA,IAAmB,CAACA,CAAgB;AAAA,IAC1E,GAAGK;AAAA,EAAA,GAGD,EAAE,SAAAE,GAAS,GAAGC,EAAA,IAAeF;AAEnC,SAAOR;AAAA,IACH;AAAA,MACI,WAAW;AAAA,QACP,MAAM;AAAA,QACN,QAAQ;AAAA,MAAA;AAAA,MAEZ,YAAY;AAAA,MACZ,MAAM;AAAA,MACN,OAAO;AAAA,IAAA;AAAA,IAEXU;AAAA,IACA,GAAI,MAAM,QAAQD,CAAO,IAAI,CAAC,EAAE,SAAAA,EAAA,CAAS,IAAI,CAAA;AAAA,EAAC;AAEtD,GAQME,IAAwD;AAAA,EAC1D,CAACV,EAAa,MAAM,GAAG,CAAAM,MAAUD,EAAaC,CAAM;AAAA,EACpD,CAACN,EAAa,UAAU,GAAG,CAAAM,MAAUF,EAAUE,CAAM;AAAA,EACrD,CAACN,EAAa,WAAW,GAAG,CAAAM,MAAUF,EAAUE,CAAM;AAAA,EACtD,CAACN,EAAa,iBAAiB,GAAG,CAAAM,MAAUH,EAAWG,CAAM;AAAA,EAC7D,CAACN,EAAa,gBAAgB,GAAG,CAAAM,MAAUJ,EAAUI,CAAM;AAC/D;AAmBO,SAASK,EAAaC,MAAuBN,GAAoB;AACpE,QAAMO,IAAUH,EAAeE,CAAI;AAEnC,MAAI,CAACN,KAAUA,EAAO,WAAW;AAC7B,WAAOO,EAAQ,CAAA,CAAE;AAGrB,MAAI,CAACA;AACD,UAAM,IAAI,MAAM,wBAAwBD,CAAI,EAAE;AAGlD,SAAOC,EAAQ,GAAGP,CAAM;AAC5B;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env.constant.js","sources":["../../../src/config/env/env.constant.ts"],"sourcesContent":["export const CYBERSKILL_STORAGE_DIRECTORY = '.cyberskill-storage';\n"],"names":["CYBERSKILL_STORAGE_DIRECTORY"],"mappings":"AAAO,MAAMA,IAA+B;"}
|
|
@@ -0,0 +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"],"names":["isEnvFileLoaded","debugValidator","makeValidator","input","loadEnvFile","process","E_Environment","dotenvx","getEnv","cleanedEnv","cleanEnv","str","path","os","CYBERSKILL_STORAGE_DIRECTORY"],"mappings":";;;;;;;AAkBA,IAAIA,IAAkB;AAWtB,MAAMC,IAAiBC,EAAc,CAACC,MAC9B,OAAOA,KAAU,YACVA,IAEP,OAAOA,KAAU,QAKxB;AAcM,SAASC,IAAc;AAE1B,EAAIC,EAAQ,IAAI,aAAaC,EAAc,cAAc,CAACN,MACtDO,EAAQ,OAAA,GACRP,IAAkB;AAE1B;AAgBO,SAASQ,IAAwB;AACpC,EAAAJ,EAAA;AAEA,QAAMK,IAAaC,EAASL,EAAQ,KAAK;AAAA,IACrC,KAAKM,EAAI,EAAE,SAASN,EAAQ,IAAA,GAAO;AAAA,IACnC,OAAOJ,EAAe,EAAE,SAAS,IAAO;AAAA,IACxC,8BAA8BU,EAAI,EAAE,SAASC,EAAK,KAAKC,EAAG,WAAWC,CAA4B,EAAA,CAAG;AAAA,EAAA,CACvG;AAQD,SANY;AAAA,IACR,KAAKL,EAAW;AAAA,IAChB,OAAOA,EAAW;AAAA,IAClB,8BAA8BA,EAAW;AAAA,EAAA;AAIjD;"}
|
package/dist/config/env/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -0,0 +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"],"names":["eslintBaseConfig","globals"],"mappings":";AAMA,MAAAA,IAAe;AAAA,EACX;AAAA,IACI,iBAAiB;AAAA,MACb,SAAS,EAAE,GAAGC,EAAQ,MAAM,GAAGA,EAAQ,QAAA;AAAA,IAAQ;AAAA,IAEnD,OAAO;AAAA,MACH,8BAA8B,CAAC,SAAS;AAAA,QACpC,iBAAiB,CAAC,QAAQ,OAAO;AAAA,MAAA,CACpC;AAAA,MACD,gBAAgB;AAAA,IAAA;AAAA,IAEpB,SAAS,CAAC,sBAAsB,cAAc,SAAS,QAAQ,QAAQ;AAAA,EAAA;AAE/E;"}
|
|
@@ -0,0 +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"],"names":["defineConfig","loadEnvFile","createGraphqlCodegenConfig","uri","from","to","target","isClient","isServer"],"mappings":"AAQA,SAAA,gBAAAA,SAAA;AAAA,SAAA,eAAAC,SAAA;AAAAA,EAAA;AAyBO,SAASC,EAA2B;AAAA,EACvC,KAAAC;AAAA,EACA,MAAAC;AAAA,EACA,IAAAC;AAAA,EACA,QAAAC,IAAS;AACb,GAA0C;AACtC,QAAMC,IAAWD,MAAW,UACtBE,IAAWF,MAAW;AAE5B,SAAO;AAAA,IACH,QAAQH;AAAA,IACR,mBAAmB;AAAA,IACnB,WAAW;AAAA,IACX,GAAII,KAAY,EAAE,WAAW,CAACH,CAAI,EAAA;AAAA,IAClC,WAAW;AAAA,MACP,GAAIG,KAAY;AAAA,QACZ,CAACF,CAAE,GAAG;AAAA,UACF,QAAQ;AAAA,UACR,cAAc;AAAA,YACV,iBAAiB;AAAA,YACjB,oBAAoB;AAAA,UAAA;AAAA,UAExB,QAAQ;AAAA,YACJ,gBAAgB;AAAA,YAChB,kBAAkB;AAAA,UAAA;AAAA,QACtB;AAAA,MACJ;AAAA,MAEJ,GAAIG,KAAY;AAAA,QACZ,CAACH,CAAE,GAAGL,EAAA;AAAA,MAAa;AAAA,IACvB;AAAA,EACJ;AAER;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/dist/config/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -0,0 +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"],"names":["index"],"mappings":"AAAA,MAAAA,IAAe;AAAA,EACX,QAAQ,MAAM;AAAA,EACd,KAAK,CAAC,yBAAyB;AACnC;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -0,0 +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"],"names":["storybookMain","options","deepMerge"],"mappings":";AAmBO,SAASA,EAAcC,GAAqD;AAc/E,SAAOC,EAbyB;AAAA,IAC5B,SAAS,CAAC,8CAA8C;AAAA,IACxD,QAAQ;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,IAEJ,WAAW;AAAA,MACP,MAAM;AAAA,MACN,SAAS,CAAA;AAAA,IAAC;AAAA,EACd,GAGqBD,CAAO;AACpC;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storybook.preview.js","sources":["../../../src/config/storybook/storybook.preview.ts"],"sourcesContent":["import type { Preview } from '@storybook/react';\n\n/**\n * Creates a Storybook preview configuration for React projects.\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: /(background|color)$/i,\n date: /Date$/i,\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"],"names":["storybookPreview","options","preview"],"mappings":"AAkBO,SAASA,EAAiBC,GAAqC;AAClE,QAAMC,IAAmB;AAAA,IACrB,YAAY;AAAA,MACR,UAAU;AAAA,QACN,UAAU;AAAA,UACN,OAAO;AAAA,UACP,MAAM;AAAA,QAAA;AAAA,MACV;AAAA,MAEJ,aAAa;AAAA,QACT,SAAS;AAAA,QACT,QAAQ;AAAA,UACJ;AAAA,YACI,MAAM;AAAA,YACN,OAAO;AAAA,UAAA;AAAA,UAEX;AAAA,YACI,MAAM;AAAA,YACN,OAAO;AAAA,UAAA;AAAA,QACX;AAAA,MACJ;AAAA,IACJ;AAAA,EACJ;AAGJ,SAAO;AAAA,IACH,GAAGA;AAAA,IACH,GAAGD;AAAA,IACH,YAAY;AAAA,MACR,GAAGC,EAAQ;AAAA,MACX,GAAGD,GAAS;AAAA,IAAA;AAAA,EAChB;AAER;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vitest.e2e.js","sources":["../../../src/config/vitest/vitest.e2e.ts"],"sourcesContent":["import type { UserConfig } from 'vite';\n\nimport react from '@vitejs/plugin-react-swc';\nimport { defineConfig } from 'vitest/config';\n\nimport { deepMerge } from '../../util/object/index.js';\n\n/**\n * Creates a Vitest configuration for end-to-end testing with browser automation.\n * This function generates a Vitest configuration specifically designed for E2E testing\n * using Playwright with multiple browser instances. It includes React support and\n * browser automation capabilities for comprehensive end-to-end testing.\n *\n * The configuration includes:\n * - React SWC plugin for fast React compilation\n * - Browser automation with Playwright provider\n * - Multiple browser instances (Chromium, Firefox, WebKit)\n * - E2E test file pattern matching\n * - Configurable options merging\n *\n * @param options - Additional Vite configuration options to merge with the E2E config.\n * @returns A Vitest configuration object optimized for end-to-end testing with browser automation.\n */\nexport function vitestE2E(options: UserConfig) {\n const config = {\n plugins: [react()],\n test: {\n include: ['**/*.test.e2e.?(c|m)[jt]s?(x)'],\n browser: {\n enabled: true,\n provider: 'playwright',\n instances: [\n { browser: 'chromium' },\n { browser: 'firefox' },\n { browser: 'webkit' },\n ],\n },\n },\n };\n\n return defineConfig(deepMerge(config as any, options as any) as UserConfig);\n}\n"],"names":["vitestE2E","options","config","react","defineConfig","deepMerge"],"mappings":";;;AAuBO,SAASA,EAAUC,GAAqB;AAC3C,QAAMC,IAAS;AAAA,IACX,SAAS,CAACC,GAAO;AAAA,IACjB,MAAM;AAAA,MACF,SAAS,CAAC,+BAA+B;AAAA,MACzC,SAAS;AAAA,QACL,SAAS;AAAA,QACT,UAAU;AAAA,QACV,WAAW;AAAA,UACP,EAAE,SAAS,WAAA;AAAA,UACX,EAAE,SAAS,UAAA;AAAA,UACX,EAAE,SAAS,SAAA;AAAA,QAAS;AAAA,MACxB;AAAA,IACJ;AAAA,EACJ;AAGJ,SAAOC,EAAaC,EAAUH,GAAeD,CAAc,CAAe;AAC9E;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vitest.unit.js","sources":["../../../src/config/vitest/vitest.unit.ts"],"sourcesContent":["import type { UserConfig } from 'vite';\n\nimport react from '@vitejs/plugin-react-swc';\nimport { defineConfig } from 'vitest/config';\n\nimport { deepMerge } from '../../util/object/index.js';\n\n/**\n * Creates a Vitest configuration for unit testing with React support.\n * This function generates a Vitest configuration specifically designed for unit testing\n * React components and JavaScript/TypeScript modules. It includes JSDOM environment\n * for DOM simulation and comprehensive testing setup.\n *\n * The configuration includes:\n * - React SWC plugin for fast React compilation\n * - JSDOM environment for DOM simulation\n * - Global test functions availability\n * - VM threads pool for parallel test execution\n * - Unit test file pattern matching\n * - Setup files for testing library configuration\n * - Configurable options merging\n *\n * @param options - Additional Vite configuration options to merge with the unit test config.\n * @returns A Vitest configuration object optimized for unit testing with React and DOM support.\n */\nexport function vitestUnit(options: UserConfig) {\n const config = {\n plugins: [react()],\n test: {\n globals: true,\n environment: 'jsdom',\n pool: 'vmThreads',\n include: ['**/*.test.unit.?(c|m)[jt]s?(x)'],\n setupFiles: ['./vitest.unit.setup.ts'],\n coverage: {\n provider: 'istanbul',\n reporter: ['text', 'lcov'],\n reportsDirectory: './coverage',\n thresholds: {\n statements: 80,\n branches: 80,\n functions: 80,\n lines: 80,\n },\n },\n },\n };\n\n return defineConfig(deepMerge(config as any, options as any) as UserConfig);\n}\n"],"names":["vitestUnit","options","config","react","defineConfig","deepMerge"],"mappings":";;;AAyBO,SAASA,EAAWC,GAAqB;AAC5C,QAAMC,IAAS;AAAA,IACX,SAAS,CAACC,GAAO;AAAA,IACjB,MAAM;AAAA,MACF,SAAS;AAAA,MACT,aAAa;AAAA,MACb,MAAM;AAAA,MACN,SAAS,CAAC,gCAAgC;AAAA,MAC1C,YAAY,CAAC,wBAAwB;AAAA,MACrC,UAAU;AAAA,QACN,UAAU;AAAA,QACV,UAAU,CAAC,QAAQ,MAAM;AAAA,QACzB,kBAAkB;AAAA,QAClB,YAAY;AAAA,UACR,YAAY;AAAA,UACZ,UAAU;AAAA,UACV,WAAW;AAAA,UACX,OAAO;AAAA,QAAA;AAAA,MACX;AAAA,IACJ;AAAA,EACJ;AAGJ,SAAOC,EAAaC,EAAUH,GAAeD,CAAc,CAAe;AAC9E;"}
|
package/dist/constant/common.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.js","sources":["../../src/constant/common.ts"],"sourcesContent":["/**\n * Indicates if the current environment is a browser (as opposed to Node.js).\n * This constant is true if the global `window` object is defined, false otherwise.\n */\nexport const IS_BROWSER = typeof window !== 'undefined';\n"],"names":["IS_BROWSER"],"mappings":"AAIO,MAAMA,IAAa,OAAO,SAAW;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/constant/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response-status.js","sources":["../../src/constant/response-status.ts"],"sourcesContent":["export const RESPONSE_STATUS = {\n GRAPHQL_PARSE_FAILED: {\n CODE: 'GRAPHQL_PARSE_FAILED',\n MESSAGE: 'The GraphQL operation string contains a syntax error.',\n },\n GRAPHQL_VALIDATION_FAILED: {\n CODE: 'GRAPHQL_VALIDATION_FAILED',\n MESSAGE: `The GraphQL operation is not valid against the server's schema.`,\n },\n BAD_USER_INPUT: {\n CODE: 'BAD_USER_INPUT',\n MESSAGE:\n 'The GraphQL operation includes an invalid value for a field argument.',\n },\n PERSISTED_QUERY_NOT_FOUND: {\n CODE: 'PERSISTED_QUERY_NOT_FOUND',\n MESSAGE:\n 'A client sent the hash of a query string to execute via automatic persisted queries, but the query was not in the APQ cache.',\n },\n PERSISTED_QUERY_NOT_SUPPORTED: {\n CODE: 'PERSISTED_QUERY_NOT_SUPPORTED',\n MESSAGE:\n 'A client sent the hash of a query string to execute via automatic persisted queries, but the server has disabled APQ.',\n },\n OPERATION_RESOLUTION_FAILURE: {\n CODE: 'OPERATION_RESOLUTION_FAILURE',\n MESSAGE: `The request was parsed successfully and is valid against the server's schema, but the server couldn't resolve which operation to run. This occurs when a request containing multiple named operations doesn't specify which operation to run (i.e.,operationName), or if the named operation isn't included in the request.`,\n },\n CONTINUE: {\n CODE: 100,\n MESSAGE: 'Continue',\n },\n SWITCHING_PROTOCOLS: {\n CODE: 101,\n MESSAGE: 'Switching Protocols',\n },\n PROCESSING: {\n CODE: 102,\n MESSAGE: 'Processing',\n },\n OK: {\n CODE: 200,\n MESSAGE: 'OK',\n },\n CREATED: {\n CODE: 201,\n MESSAGE: 'Created',\n },\n ACCEPTED: {\n CODE: 202,\n MESSAGE: 'Accepted',\n },\n NON_AUTHORITATIVE_INFORMATION: {\n CODE: 203,\n MESSAGE: 'Non Authoritative Information',\n },\n NO_CONTENT: {\n CODE: 204,\n MESSAGE: 'No Content',\n },\n RESET_CONTENT: {\n CODE: 205,\n MESSAGE: 'Reset Content',\n },\n PARTIAL_CONTENT: {\n CODE: 206,\n MESSAGE: 'Partial Content',\n },\n MULTI_STATUS: {\n CODE: 207,\n MESSAGE: 'Multi-Status',\n },\n MULTIPLE_CHOICES: {\n CODE: 300,\n MESSAGE: 'Multiple Choices',\n },\n MOVED_PERMANENTLY: {\n CODE: 301,\n MESSAGE: 'Moved Permanently',\n },\n MOVED_TEMPORARILY: {\n CODE: 302,\n MESSAGE: 'Moved Temporarily',\n },\n SEE_OTHER: {\n CODE: 303,\n MESSAGE: 'See Other',\n },\n NOT_MODIFIED: {\n CODE: 304,\n MESSAGE: 'Not Modified',\n },\n USE_PROXY: {\n CODE: 305,\n MESSAGE: 'Use Proxy',\n },\n TEMPORARY_REDIRECT: {\n CODE: 307,\n MESSAGE: 'Temporary Redirect',\n },\n PERMANENT_REDIRECT: {\n CODE: 308,\n MESSAGE: 'Permanent Redirect',\n },\n BAD_REQUEST: {\n CODE: 400,\n MESSAGE: 'Bad Request',\n },\n UNAUTHORIZED: {\n CODE: 401,\n MESSAGE: 'Unauthorized',\n },\n PAYMENT_REQUIRED: {\n CODE: 402,\n MESSAGE: 'Payment Required',\n },\n FORBIDDEN: {\n CODE: 403,\n MESSAGE: 'Forbidden',\n },\n NOT_FOUND: {\n CODE: 404,\n MESSAGE: 'Not Found',\n },\n METHOD_NOT_ALLOWED: {\n CODE: 405,\n MESSAGE: 'Method Not Allowed',\n },\n NOT_ACCEPTABLE: {\n CODE: 406,\n MESSAGE: 'Not Acceptable',\n },\n PROXY_AUTHENTICATION_REQUIRED: {\n CODE: 407,\n MESSAGE: 'Proxy Authentication Required',\n },\n REQUEST_TIMEOUT: {\n CODE: 408,\n MESSAGE: 'Request Timeout',\n },\n CONFLICT: {\n CODE: 409,\n MESSAGE: 'Conflict',\n },\n GONE: {\n CODE: 410,\n MESSAGE: 'Gone',\n },\n LENGTH_REQUIRED: {\n CODE: 411,\n MESSAGE: 'Length Required',\n },\n PRECONDITION_FAILED: {\n CODE: 412,\n MESSAGE: 'Precondition Failed',\n },\n REQUEST_TOO_LONG: {\n CODE: 413,\n MESSAGE: 'Request Entity Too Large',\n },\n REQUEST_URI_TOO_LONG: {\n CODE: 414,\n MESSAGE: 'Request-URI Too Long',\n },\n UNSUPPORTED_MEDIA_TYPE: {\n CODE: 415,\n MESSAGE: 'Unsupported Media Type',\n },\n REQUESTED_RANGE_NOT_SATISFIABLE: {\n CODE: 416,\n MESSAGE: 'Requested Range Not Satisfiable',\n },\n EXPECTATION_FAILED: {\n CODE: 417,\n MESSAGE: 'Expectation Failed',\n },\n IM_A_TEAPOT: {\n CODE: 418,\n MESSAGE: 'I\\'m a teapot',\n },\n INSUFFICIENT_SPACE_ON_RESOURCE: {\n CODE: 419,\n MESSAGE: 'Insufficient Space on Resource',\n },\n METHOD_FAILURE: {\n CODE: 420,\n MESSAGE: 'Method Failure',\n },\n MISDIRECTED_REQUEST: {\n CODE: 421,\n MESSAGE: 'Misdirected Request',\n },\n UNPROCESSABLE_ENTITY: {\n CODE: 422,\n MESSAGE: 'Unprocessable Entity',\n },\n LOCKED: {\n CODE: 423,\n MESSAGE: 'Locked',\n },\n FAILED_DEPENDENCY: {\n CODE: 424,\n MESSAGE: 'Failed Dependency',\n },\n PRECONDITION_REQUIRED: {\n CODE: 428,\n MESSAGE: 'Precondition Required',\n },\n TOO_MANY_REQUESTS: {\n CODE: 429,\n MESSAGE: 'Too Many Requests',\n },\n REQUEST_HEADER_FIELDS_TOO_LARGE: {\n CODE: 431,\n MESSAGE: 'Request Header Fields Too Large',\n },\n UNAVAILABLE_FOR_LEGAL_REASONS: {\n CODE: 451,\n MESSAGE: 'Unavailable For Legal Reasons',\n },\n INTERNAL_SERVER_ERROR: {\n CODE: 500,\n MESSAGE: 'Internal Server Error',\n },\n NOT_IMPLEMENTED: {\n CODE: 501,\n MESSAGE: 'Not Implemented',\n },\n BAD_GATEWAY: {\n CODE: 502,\n MESSAGE: 'Bad Gateway',\n },\n SERVICE_UNAVAILABLE: {\n CODE: 503,\n MESSAGE: 'Service Unavailable',\n },\n GATEWAY_TIMEOUT: {\n CODE: 504,\n MESSAGE: 'Gateway Timeout',\n },\n HTTP_VERSION_NOT_SUPPORTED: {\n CODE: 505,\n MESSAGE: 'HTTP Version Not Supported',\n },\n INSUFFICIENT_STORAGE: {\n CODE: 507,\n MESSAGE: 'Insufficient Storage',\n },\n NETWORK_AUTHENTICATION_REQUIRED: {\n CODE: 511,\n MESSAGE: 'Network Authentication Required',\n },\n};\n"],"names":["RESPONSE_STATUS"],"mappings":"AAAO,MAAMA,IAAkB;AAAA,EAC3B,sBAAsB;AAAA,IAClB,MAAM;AAAA,IACN,SAAS;AAAA,EAAA;AAAA,EAEb,2BAA2B;AAAA,IACvB,MAAM;AAAA,IACN,SAAS;AAAA,EAAA;AAAA,EAEb,gBAAgB;AAAA,IACZ,MAAM;AAAA,IACN,SACI;AAAA,EAAA;AAAA,EAER,2BAA2B;AAAA,IACvB,MAAM;AAAA,IACN,SACI;AAAA,EAAA;AAAA,EAER,+BAA+B;AAAA,IAC3B,MAAM;AAAA,IACN,SACI;AAAA,EAAA;AAAA,EAER,8BAA8B;AAAA,IAC1B,MAAM;AAAA,IACN,SAAS;AAAA,EAAA;AAAA,EAEb,UAAU;AAAA,IACN,MAAM;AAAA,IACN,S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
{"version":3,"file":"apollo-server.util.js","sources":["../../../src/node/apollo-server/apollo-server.util.ts"],"sourcesContent":["import { ApolloServer } from '@apollo/server';\nimport { ApolloServerPluginDrainHttpServer } from '@apollo/server/plugin/drainHttpServer';\nimport {\n ApolloServerPluginLandingPageLocalDefault,\n ApolloServerPluginLandingPageProductionDefault,\n} from '@apollo/server/plugin/landingPage/default';\nimport { expressMiddleware } from '@as-integrations/express5';\n\nimport type { I_ApolloServerOptions } from './apollo-server.type.js';\n\nimport { log } from '../log/index.js';\n\n/**\n * Creates and configures an Apollo Server instance with appropriate plugins and settings.\n * This function sets up an Apollo Server with development or production landing pages,\n * HTTP server draining capabilities, and optional custom drain server hooks.\n *\n * The server is configured with:\n * - Development or production landing page based on the isDev flag\n * - HTTP server draining plugin for graceful shutdowns\n * - Optional custom drain server hook for additional cleanup\n * - Development-specific settings (introspection and stack traces) when isDev is true\n *\n * @param options - Configuration options for the Apollo Server including server instance, schema, and environment settings.\n * @returns A configured Apollo Server instance ready to be started.\n */\nexport function createApolloServer(options: I_ApolloServerOptions): ApolloServer {\n return new ApolloServer({\n schema: options.schema,\n plugins: [\n options.isDev\n ? ApolloServerPluginLandingPageLocalDefault()\n : ApolloServerPluginLandingPageProductionDefault(),\n ApolloServerPluginDrainHttpServer({ httpServer: options.server }),\n ...(options.drainServer\n ? [{\n async serverWillStart() {\n return {\n async drainServer() {\n options.drainServer?.();\n log.info('Apollo Server drainServer hook called');\n },\n };\n },\n }]\n : []),\n ],\n ...(options.isDev && {\n introspection: true,\n includeStacktraceInErrorResponses: true,\n }),\n });\n}\n\nexport { expressMiddleware };\n"],"names":["createApolloServer","options","ApolloServer","ApolloServerPluginLandingPageLocalDefault","ApolloServerPluginLandingPageProductionDefault","ApolloServerPluginDrainHttpServer","log"],"mappings":";;;;AA0BO,SAASA,EAAmBC,GAA8C;AAC7E,SAAO,IAAIC,EAAa;AAAA,IACpB,QAAQD,EAAQ;AAAA,IAChB,SAAS;AAAA,MACLA,EAAQ,QACFE,EAAA,IACAC,EAAA;AAAA,MACNC,EAAkC,EAAE,YAAYJ,EAAQ,QAAQ;AAAA,MAChE,GAAIA,EAAQ,cACN,CAAC;AAAA,QACK,MAAM,kBAAkB;AACpB,iBAAO;AAAA,YACH,MAAM,cAAc;AAChB,cAAAA,EAAQ,cAAA,GACRK,EAAI,KAAK,uCAAuC;AAAA,YACpD;AAAA,UAAA;AAAA,QAER;AAAA,MAAA,CACH,IACH,CAAA;AAAA,IAAC;AAAA,IAEX,GAAIL,EAAQ,SAAS;AAAA,MACjB,eAAe;AAAA,MACf,mCAAmC;AAAA,IAAA;AAAA,EACvC,CACH;AACL;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
package/dist/node/cli/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/node/cli/index.ts"],"sourcesContent":["#!/usr/bin/env node\nimport process from 'node:process';\nimport { hideBin } from 'yargs/helpers';\nimport yargs from 'yargs/yargs';\n\nimport type { I_IssueEntry } from '../log/index.js';\n\nimport { clearAllErrorLists, getStoredErrorLists, resolveCommands, runCommand } from '../command/index.js';\nimport { addGitIgnoreEntry, pathExistsSync, readFileSync, removeSync, writeFileSync } from '../fs/index.js';\nimport { catchError, E_IssueType, log } from '../log/index.js';\nimport { getPackage, installDependencies } from '../package/index.js';\nimport { AG_KIT_PACKAGE_NAME, command, createGitHooksConfig, CYBERSKILL_CLI, CYBERSKILL_PACKAGE_NAME, DOT_AGENT, PATH, resolve, SIMPLE_GIT_HOOK_JSON } from '../path/index.js';\n\n/**\n * Retrieves the version from the package.json file.\n * This function reads the package.json file and extracts the version number.\n * If the file cannot be read or parsed, it returns a default version of '1.0.0'.\n *\n * @returns The version string from package.json or '1.0.0' as fallback.\n */\nfunction getVersion(): string {\n try {\n const pkg = JSON.parse(\n readFileSync(resolve(__dirname, '../../../package.json'), 'utf-8'),\n );\n return pkg.version;\n }\n catch {\n return '1.0.0';\n }\n}\n\n/**\n * Performs TypeScript validation if a TypeScript configuration file exists.\n * This function checks for the presence of a TypeScript configuration file\n * and runs TypeScript validation if found. If no configuration is found,\n * it logs a warning and skips the type check.\n *\n * @returns A promise that resolves when the TypeScript validation is complete.\n */\nasync function checkTypescript() {\n if (pathExistsSync(PATH.TS_CONFIG)) {\n await runCommand('Performing TypeScript validation', await command.typescriptCheck());\n }\n else {\n log.warn('No TypeScript configuration found. Skipping type check.');\n }\n}\n\n/**\n * Performs ESLint checking with optional auto-fix functionality.\n * This function runs ESLint checks on the codebase and optionally applies\n * automatic fixes to resolve linting issues.\n *\n * @param fix - Whether to apply automatic fixes to linting issues (default: false).\n * @returns A promise that resolves when the ESLint check is complete.\n */\nasync function checkEslint(fix = false) {\n const commandToRun = fix ? await command.eslintFix() : await command.eslintCheck();\n const label = fix ? 'Running ESLint with auto-fix' : 'Running ESLint check';\n\n try {\n await runCommand(label, commandToRun, { timeout: 60000, throwOnError: true });\n }\n catch (error: any) {\n if (error.code === 'ETIMEDOUT' || error.killed || error.signal === 'SIGTERM') {\n log.warn('Lint check timed out. Retrying with debug mode enabled...');\n process.env['DEBUG'] = 'true';\n await runCommand(`${label} (Debug Mode)`, commandToRun);\n }\n else {\n catchError(error);\n }\n }\n}\n\n/**\n * Prints a formatted list of issues (errors or warnings) to the console.\n * This function displays issues in a boxed format with appropriate color coding\n * based on the issue type. It only displays issues if the list is not empty.\n *\n * @param type - The type of issues to display ('Errors' or 'Warnings').\n * @param list - An array of issue entries to display.\n */\nfunction printIssues(type: 'Errors' | 'Warnings', list: I_IssueEntry[]) {\n if (!list.length) {\n return;\n }\n\n const color = type === 'Errors' ? 'red' : 'yellow';\n log.printBoxedLog(type === 'Errors' ? '✖ Errors' : '⚠ Warnings', list, color);\n}\n\n/**\n * Displays the final check results after all validation processes.\n * This function retrieves stored error lists and displays them in a formatted manner.\n * If no errors or warnings are found, it displays a success message. If errors are found,\n * it exits the process with code 1 to indicate failure.\n *\n * @returns A promise that resolves when the results are displayed.\n */\nasync function showCheckResult() {\n setTimeout(async () => {\n const allResults = (await getStoredErrorLists()) || [];\n const errors = allResults.filter(e => e.type === E_IssueType.Error);\n const warnings = allResults.filter(e => e.type === E_IssueType.Warning);\n\n if (!errors.length && !warnings.length) {\n log.printBoxedLog('✔ NO ISSUES FOUND', [], 'green');\n }\n else {\n printIssues('Warnings', warnings);\n printIssues('Errors', errors);\n\n if (errors.length > 0) {\n process.exit(1);\n }\n }\n }, 0);\n}\n\n/**\n * Executes lint-staged to check only staged files.\n * This function runs lint-staged which executes linting tools only on files\n * that are staged for commit. It includes building the package if it's the current project\n * and displays the results after completion.\n *\n * @returns A promise that resolves when lint-staged execution is complete.\n */\nasync function lintStaged() {\n await clearAllErrorLists();\n const packageData = await getPackage({ name: CYBERSKILL_PACKAGE_NAME });\n\n if (!packageData.success) {\n log.error('Failed to retrieve package information. Aborting lint-staged.');\n return;\n }\n\n if (packageData.result.isCurrentProject) {\n await runCommand(`Building package: ${CYBERSKILL_PACKAGE_NAME}`, await command.build());\n }\n\n await runCommand('Executing lint-staged', await command.lintStaged());\n showCheckResult();\n}\n\n/**\n * Inspects the ESLint configuration to show active rules and settings.\n * This function runs ESLint inspection to display the current configuration,\n * including which rules are active and their settings.\n *\n * @returns A promise that resolves when the ESLint inspection is complete.\n */\nasync function inspectLint() {\n await runCommand('Inspecting ESLint configuration', await command.eslintInspect());\n}\n\n/**\n * Performs comprehensive linting checks including TypeScript and ESLint.\n * This function runs both TypeScript validation and ESLint checks in parallel,\n * then displays the combined results.\n *\n * @returns A promise that resolves when all linting checks are complete.\n */\nasync function lintCheck() {\n await clearAllErrorLists();\n await checkTypescript();\n await checkEslint();\n showCheckResult();\n}\n\n/**\n * Performs comprehensive linting checks with automatic fixes.\n * This function runs both TypeScript validation and ESLint checks with auto-fix\n * in parallel, then displays the combined results.\n *\n * @returns A promise that resolves when all linting checks with fixes are complete.\n */\nasync function lintFix() {\n await clearAllErrorLists();\n await checkTypescript();\n await checkEslint(true);\n showCheckResult();\n}\n\n/**\n * Validates commit message format using commitlint.\n * This function runs commitlint to check if the current commit message\n * follows the conventional commit format and displays the results.\n *\n * @returns A promise that resolves when commit message validation is complete.\n */\nasync function commitLint() {\n await clearAllErrorLists();\n await runCommand('Validating commit message', await command.commitLint());\n showCheckResult();\n}\n\n/**\n * Sets up Git hooks for automated code quality checks.\n * This function configures Git hooks using simple-git-hooks, creates the necessary\n * configuration files, and updates .gitignore to exclude hook configuration files.\n * It also sets up the hooks to run linting and commit validation automatically.\n *\n * @returns A promise that resolves when Git hook setup is complete.\n */\nasync function gitHookSetup() {\n await runCommand('Configuring Git hooks', await command.configureGitHook());\n\n removeSync(PATH.GIT_HOOK);\n\n const hooks = await resolveCommands(createGitHooksConfig);\n\n writeFileSync(PATH.SIMPLE_GIT_HOOKS_JSON, JSON.stringify(hooks, null, 4));\n\n addGitIgnoreEntry(PATH.GIT_IGNORE, SIMPLE_GIT_HOOK_JSON);\n\n await runCommand('Setting up simple-git-hooks', await command.simpleGitHooks());\n}\n\n/**\n * Sets up the AI agent environment.\n * This function ensures the ag-kit package is installed globally, initializes\n * or updates the AI agent configuration, and adds the agent directory\n * to .gitignore to exclude it from version control.\n *\n * @returns A promise that resolves when the AI agent setup is complete.\n */\nasync function aiSetup() {\n try {\n await runCommand(`Checking for ${AG_KIT_PACKAGE_NAME}`, `pnpm list -g ${AG_KIT_PACKAGE_NAME}`);\n }\n catch {\n await runCommand(`Installing ${AG_KIT_PACKAGE_NAME} globally`, `pnpm i -g ${AG_KIT_PACKAGE_NAME}`);\n }\n\n if (pathExistsSync(PATH.DOT_AGENT)) {\n await runCommand('Updating AI agent', 'ag-kit update -y');\n }\n else {\n await runCommand('Initializing AI agent', 'ag-kit init');\n }\n\n addGitIgnoreEntry(PATH.GIT_EXCLUDE, DOT_AGENT);\n}\n\n/**\n * Initializes the project with dependencies and Git hooks.\n * This function installs project dependencies and sets up Git hooks for\n * automated code quality checks. It's typically run when setting up a new project.\n *\n * @returns A promise that resolves when project initialization is complete.\n */\nasync function ready() {\n await installDependencies();\n await gitHookSetup();\n}\n\n/**\n * Resets the project by removing dependencies and reinstalling them.\n * This function removes node_modules and lock files, cleans the package manager cache,\n * reinstalls dependencies, and sets up Git hooks. It's useful for resolving\n * dependency-related issues.\n *\n * @returns A promise that resolves when project reset is complete.\n */\nasync function reset() {\n removeSync(PATH.NODE_MODULES, PATH.PNPM_LOCK_YAML);\n await runCommand('Pruning pnpm store', await command.pnpmPruneStore());\n await runCommand('Clearing pnpm cache', await command.pnpmCleanCache());\n await installDependencies();\n await gitHookSetup();\n await aiSetup();\n}\n\n/**\n * Inspects project dependencies to analyze their status.\n * This function runs dependency inspection to check for outdated packages,\n * security vulnerabilities, and other dependency-related issues.\n *\n * @returns A promise that resolves when dependency inspection is complete.\n */\nasync function inspect() {\n await runCommand('Inspecting project dependencies', await command.nodeModulesInspect());\n}\n\n/**\n * Runs the unit test suite.\n * This function executes unit tests using the configured test runner\n * and displays the test results.\n *\n * @returns A promise that resolves when unit tests are complete.\n */\nasync function testUnit() {\n await runCommand('Running unit tests', await command.testUnit());\n}\n\n/**\n * Runs the end-to-end test suite.\n * This function executes end-to-end tests using the configured test runner\n * and displays the test results.\n *\n * @returns A promise that resolves when end-to-end tests are complete.\n */\nasync function testE2E() {\n await runCommand('Running end-to-end tests', await command.testE2e());\n}\n\n/**\n * Creates a new MongoDB migration file.\n * This function creates a new migration file with the specified name\n * for database schema changes.\n *\n * @param migrationName - The name for the new migration file.\n * @returns A promise that resolves when the migration file is created.\n */\nasync function mongoMigrateCreate(migrationName: string) {\n await runCommand('Creating MongoDB migration', await command.mongoMigrateCreate(migrationName));\n}\n\n/**\n * Applies all pending MongoDB migrations.\n * This function runs all pending database migrations to update the database schema\n * to the latest version.\n *\n * @returns A promise that resolves when all migrations are applied.\n */\nasync function mongoMigrateUp() {\n await runCommand('Running MongoDB migrations', await command.mongoMigrateUp());\n}\n\n/**\n * Rolls back the last applied MongoDB migration.\n * This function reverts the most recent database migration, undoing\n * the last schema change.\n *\n * @returns A promise that resolves when the migration is rolled back.\n */\nasync function mongoMigrateDown() {\n await runCommand('Rolling back MongoDB migration', await command.mongoMigrateDown());\n}\n\n/**\n * Starts the Storybook development server.\n * This function runs Storybook in development mode, allowing you to\n * view and interact with your component stories in a browser.\n *\n * @returns A promise that resolves when the Storybook dev server is started.\n */\nasync function storybookDev() {\n await runCommand('Starting Storybook development server', await command.storybookDev());\n}\n\n/**\n * Builds Storybook for production deployment.\n * This function creates a static build of Storybook that can be\n * deployed to a web server or hosting service.\n *\n * @returns A promise that resolves when the Storybook build is complete.\n */\nasync function storybookBuild() {\n await runCommand('Building Storybook', await command.storybookBuild());\n}\n\n(async () => {\n try {\n await yargs(hideBin(process.argv))\n .scriptName(CYBERSKILL_CLI)\n .usage('$0 <command> [options]')\n .command('ai:setup', 'Setup AI agent environment', aiSetup)\n .command('lint', 'Check code for linting issues', lintCheck)\n .command('lint:fix', 'Fix linting issues automatically', lintFix)\n .command('lint:inspect', 'View active ESLint configuration', inspectLint)\n .command('lint-staged', 'Run lint checks on staged files', lintStaged)\n .command('commitlint', 'Validate commit message format', commitLint)\n .command('ready', 'Initialize project and dependencies', ready)\n .command('reset', 'Reset the project and reinstall dependencies', reset)\n .command('inspect', 'Analyze installed project dependencies', inspect)\n .command('test:unit', 'Run unit test suite', testUnit)\n .command('test:e2e', 'Run end-to-end test suite', testE2E)\n .command('mongo:migrate:create <name>', 'Create a MongoDB migration', y =>\n y.positional('name', {\n describe: 'Migration name',\n type: 'string',\n }), async (argv) => {\n if (!argv.name) {\n log.error('Migration name is required.');\n\n return;\n }\n\n await mongoMigrateCreate(argv.name);\n })\n .command('mongo:migrate:up', 'Apply all MongoDB migrations', mongoMigrateUp)\n .command('mongo:migrate:down', 'Rollback last MongoDB migration', mongoMigrateDown)\n .command('storybook:dev', 'Start Storybook development server', storybookDev)\n .command('storybook:build', 'Build Storybook for production', storybookBuild)\n .demandCommand(1, 'Please specify a valid command.')\n .strict()\n .help()\n .alias('h', 'help')\n .alias('v', 'version')\n .version(getVersion())\n .epilog('💡 Tip: Use \"--help\" with any command to see options\\n')\n .parse();\n }\n catch (error) {\n catchError(error);\n process.exit(1);\n }\n})();\n"],"names":["process","hideBin","yargs","runCommand","clearAllErrorLists","getStoredErrorLists","resolveCommands","getPackage","installDependencies","pathExistsSync","addGitIgnoreEntry","removeSync","readFileSync","writeFileSync","resolve","CYBERSKILL_CLI","command","CYBERSKILL_PACKAGE_NAME","PATH","SIMPLE_GIT_HOOK_JSON","createGitHooksConfig","AG_KIT_PACKAGE_NAME","DOT_AGENT","log","catchError","E_IssueType","getVersion","checkTypescript","checkEslint","fix","commandToRun","label","error","printIssues","type","list","color","showCheckResult","allResults","errors","warnings","lintStaged","packageData","inspectLint","lintCheck","lintFix","commitLint","gitHookSetup","hooks","aiSetup","ready","reset","inspect","testUnit","testE2E","mongoMigrateCreate","migrationName","mongoMigrateUp","mongoMigrateDown","storybookDev","storybookBuild","y","argv"],"mappings":";AAoBA,OAAAA,OAAA;AAAA,SAAA,WAAAC,SAAA;AAAA,OAAAC,OAAA;AAAA,SAAA,cAAAC,GAAA,sBAAAC,GAAA,uBAAAC,GAAA,mBAAAC,SAAA;AAAA,SAAA,cAAAC,GAAA,uBAAAC,SAAA;AAAA,SAAA,kBAAAC,GAAA,qBAAAC,GAAA,cAAAC,GAAA,gBAAAC,GAAA,iBAAAC,SAAA;AAAA,SAAA,WAAAC,SAAA;AAAA,SAAA,kBAAAC,GAAA,WAAAC,GAAA,2BAAAC,GAAA,QAAAC,GAAA,wBAAAC,GAAA,wBAAAC,GAAA,uBAAAC,GAAA,aAAAC,SAAA;AAAA,SAAA,OAAAC,GAAA,cAAAC,SAAA;AAAA,SAAA,eAAAC,SAAA;AAAA,SAASC,IAAqB;AAC1B,MAAI;AAIA,WAHY,KAAK;AAAA,MACbd,EAAaE,EAAQ,WAAW,uBAAu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8BAA8BkC,CAAO,EACzD,QAAQ,QAAQ,iCAAiCL,CAAS,EAC1D,QAAQ,YAAY,oCAAoCC,CAAO,EAC/D,QAAQ,gBAAgB,oCAAoCF,CAAW,EACvE,QAAQ,eAAe,mCAAmCF,CAAU,EACpE,QAAQ,cAAc,kCAAkCK,CAAU,EAClE,QAAQ,SAAS,uCAAuCI,CAAK,EAC7D,QAAQ,SAAS,gDAAgDC,CAAK,EACtE,QAAQ,WAAW,0CAA0CC,CAAO,EACpE,QAAQ,aAAa,uBAAuBC,CAAQ,EACpD,QAAQ,YAAY,6BAA6BC,CAAO,EACxD,QAAQ,+BAA+B,8BAA8B,CAAAO,MAClEA,EAAE,WAAW,QAAQ;AAAA,MACjB,UAAU;AAAA,MACV,MAAM;AAAA,IAAA,CACT,GAAG,OAAOC,MAAS;AAChB,UAAI,CAACA,EAAK,MAAM;AACZ,QAAAvC,EAAI,MAAM,6BAA6B;AAEvC;AAAA,MACJ;AAEA,YAAMgC,EAAmBO,EAAK,IAAI;AAAA,IACtC,CAAC,EACJ,QAAQ,oBAAoB,gCAAgCL,CAAc,EAC1E,QAAQ,sBAAsB,mCAAmCC,CAAgB,EACjF,QAAQ,iBAAiB,sCAAsCC,CAAY,EAC3E,QAAQ,mBAAmB,kCAAkCC,CAAc,EAC3E,cAAc,GAAG,iCAAiC,EAClD,OAAA,EACA,OACA,MAAM,KAAK,MAAM,EACjB,MAAM,KAAK,SAAS,EACpB,QAAQlC,EAAA,CAAY,EACpB,OAAO;AAAA,CAAwD,EAC/D,MAAA;AAAA,EACT,SACOM,GAAO;AACV,IAAAR,EAAWQ,CAAK,GAChBhC,EAAQ,KAAK,CAAC;AAAA,EAClB;AACJ,GAAA;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command.type.js","sources":["../../../src/node/command/command.type.ts"],"sourcesContent":["/**\n * Interface representing an ESLint error structure.\n */\nexport interface I_EslintError {\n filePath: string;\n messages: Array<{\n ruleId: string;\n severity: number;\n message: string;\n line: number;\n column: number;\n }>;\n}\n\n/**\n * Interface representing the command execution context.\n */\nexport interface I_CommandContext {\n isCurrentProject: boolean;\n}\n\n/**\n * Interface representing a command with raw flag and command string.\n */\nexport interface I_Command { raw: boolean; cmd: string }\n\n/**\n * Type for a function that generates a command string based on context.\n */\nexport type T_CommandFunction = (context?: I_CommandContext) => string;\n\n/**\n * Type for a command, which can be a string, function that returns a string, or a raw command object.\n */\nexport type T_Command = string | T_CommandFunction | I_Command;\n\n/**\n * Type for a command map input, which can be a record or a function returning a record.\n */\nexport type T_CommandMapInput = Record<string, T_Command> | ((context: I_CommandContext) => Record<string, T_Command>);\n\n/**\n * Enum for command types: CLI, STRING, or FUNCTION.\n */\nexport enum E_CommandType {\n CLI = 'CLI',\n STRING = 'STRING',\n FUNCTION = 'FUNCTION',\n}\n"],"names":["E_CommandType"],"mappings":"AA4CO,IAAKA,sBAAAA,OACRA,EAAA,MAAM,OACNA,EAAA,SAAS,UACTA,EAAA,WAAW,YAHHA,IAAAA,KAAA,CAAA,CAAA;"}
|