@cyberskill/shared 3.0.0 → 3.2.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.type.js +1 -0
- package/dist/config/config.type.js.map +1 -0
- package/dist/config/config.util.js +4 -2
- 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.d.ts +1 -1
- package/dist/config/storybook/storybook.preview.js +6 -4
- 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.d.ts +2 -0
- package/dist/config/vitest/vitest.e2e.js +12 -18
- package/dist/config/vitest/vitest.e2e.js.map +1 -0
- package/dist/config/vitest/vitest.unit.d.ts +2 -0
- package/dist/config/vitest/vitest.unit.js +8 -5
- 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/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 +56 -45
- package/dist/node/cli/index.js.map +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 +107 -99
- 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 +49 -31
- 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.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.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.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 +10 -9
- 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 → 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 +1 -0
- 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 +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 +14 -13
- 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 +23 -21
- 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.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/util/common/common.util.js +27 -25
- 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 +50 -49
- 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 +13 -12
- 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 +30 -28
- 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.d.ts +0 -4
- package/dist/util/validate/validate.util.js +4 -3
- package/dist/util/validate/validate.util.js.map +1 -0
- package/package.json +68 -95
- package/public/tsconfig.base.json +1 -1
- 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.controller.test.unit.d.ts +0 -1
- package/dist/node/mongo/mongo.type.cjs +0 -1
- package/dist/node/mongo/mongo.util.cjs +0 -2
- package/dist/node/mongo/mongo.util.test.unit.d.ts +0 -1
- 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.test.unit.d.ts +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.test.unit.d.ts +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/loading/loading.test.unit.d.ts +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.test.unit.d.ts +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.test.unit.d.ts +0 -1
- package/dist/util/object/object.util.cjs +0 -1
- package/dist/util/serializer/index.cjs +0 -1
- package/dist/util/serializer/serializer.test.unit.d.ts +0 -1
- package/dist/util/serializer/serializer.util.cjs +0 -1
- package/dist/util/string/index.cjs +0 -1
- package/dist/util/string/string.test.unit.d.ts +0 -1
- package/dist/util/string/string.util.cjs +0 -1
- package/dist/util/validate/index.cjs +0 -1
- package/dist/util/validate/validate.test.unit.d.ts +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
|
+
{"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;"}
|
|
@@ -17,6 +17,7 @@ const E = (...r) => {
|
|
|
17
17
|
},
|
|
18
18
|
formatters: !0,
|
|
19
19
|
yaml: !1,
|
|
20
|
+
markdown: !1,
|
|
20
21
|
react: !0
|
|
21
22
|
},
|
|
22
23
|
s,
|
|
@@ -29,7 +30,7 @@ const E = (...r) => {
|
|
|
29
30
|
[n.VITEST_REACT_UNIT]: (r) => a(r),
|
|
30
31
|
[n.VITEST_REACT_E2E]: (r) => m(r)
|
|
31
32
|
};
|
|
32
|
-
function
|
|
33
|
+
function d(r, ...e) {
|
|
33
34
|
const t = T[r];
|
|
34
35
|
if (!e || e.length === 0)
|
|
35
36
|
return t({});
|
|
@@ -38,5 +39,6 @@ function y(r, ...e) {
|
|
|
38
39
|
return t(...e);
|
|
39
40
|
}
|
|
40
41
|
export {
|
|
41
|
-
|
|
42
|
+
d as mergeConfigs
|
|
42
43
|
};
|
|
44
|
+
//# sourceMappingURL=config.util.js.map
|
|
@@ -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 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 (!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","configH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,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;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Preview } from '@storybook/react';
|
|
2
2
|
/**
|
|
3
|
-
* Creates a Storybook preview configuration
|
|
3
|
+
* Creates a Storybook preview configuration with preconfigured controls and background settings.
|
|
4
4
|
* This function generates a preview configuration that provides default parameters
|
|
5
5
|
* and decorators for Storybook stories. It sets up common controls, backgrounds,
|
|
6
6
|
* and viewport settings for consistent story rendering.
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
const a = /(background|color)$/i, t = /Date$/i;
|
|
2
|
+
function o(e) {
|
|
2
3
|
const r = {
|
|
3
4
|
parameters: {
|
|
4
5
|
controls: {
|
|
5
6
|
matchers: {
|
|
6
|
-
color:
|
|
7
|
-
date:
|
|
7
|
+
color: a,
|
|
8
|
+
date: t
|
|
8
9
|
}
|
|
9
10
|
},
|
|
10
11
|
backgrounds: {
|
|
@@ -32,5 +33,6 @@ function a(e) {
|
|
|
32
33
|
};
|
|
33
34
|
}
|
|
34
35
|
export {
|
|
35
|
-
|
|
36
|
+
o as storybookPreview
|
|
36
37
|
};
|
|
38
|
+
//# sourceMappingURL=storybook.preview.js.map
|
|
@@ -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\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"],"names":["RE_COLOR_MATCHER","RE_DATE_MATCHER","storybookPreview","options","preview"],"mappings":"AAEA,MAAMA,IAAmB,wBACnBC,IAAkB;AAkBjB,SAASC,EAAiBC,GAAqC;AAClE,QAAMC,IAAmB;AAAA,IACrB,YAAY;AAAA,MACR,UAAU;AAAA,QACN,UAAU;AAAA,UACN,OAAOJ;AAAA,UACP,MAAMC;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,GAAGG;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":";;"}
|
|
@@ -16,3 +16,5 @@ import { UserConfig } from 'vite';
|
|
|
16
16
|
* @returns A Vitest configuration object optimized for end-to-end testing with browser automation.
|
|
17
17
|
*/
|
|
18
18
|
export declare function vitestE2E(options: UserConfig): UserConfig;
|
|
19
|
+
declare const _default: UserConfig;
|
|
20
|
+
export default _default;
|
|
@@ -1,24 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { defineConfig as
|
|
3
|
-
import { deepMerge as
|
|
4
|
-
function
|
|
5
|
-
const
|
|
6
|
-
plugins: [
|
|
1
|
+
import o from "@vitejs/plugin-react-swc";
|
|
2
|
+
import { defineConfig as i } from "../../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";
|
|
3
|
+
import { deepMerge as r } from "../../util/object/object.util.js";
|
|
4
|
+
function n(e) {
|
|
5
|
+
const t = {
|
|
6
|
+
plugins: [o()],
|
|
7
7
|
test: {
|
|
8
|
-
include: ["**/*.test.e2e.?(c|m)[jt]s?(x)"]
|
|
9
|
-
browser: {
|
|
10
|
-
enabled: !0,
|
|
11
|
-
provider: "playwright",
|
|
12
|
-
instances: [
|
|
13
|
-
{ browser: "chromium" },
|
|
14
|
-
{ browser: "firefox" },
|
|
15
|
-
{ browser: "webkit" }
|
|
16
|
-
]
|
|
17
|
-
}
|
|
8
|
+
include: ["**/*.test.e2e.?(c|m)[jt]s?(x)"]
|
|
18
9
|
}
|
|
19
10
|
};
|
|
20
|
-
return
|
|
11
|
+
return i(r(t, e));
|
|
21
12
|
}
|
|
13
|
+
const m = n({});
|
|
22
14
|
export {
|
|
23
|
-
m as
|
|
15
|
+
m as default,
|
|
16
|
+
n as vitestE2E
|
|
24
17
|
};
|
|
18
|
+
//# sourceMappingURL=vitest.e2e.js.map
|
|
@@ -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 },\n };\n\n return defineConfig(deepMerge(config as any, options as any) as UserConfig);\n}\n\nexport default vitestE2E({});\n"],"names":["vitestE2E","options","config","react","defineConfig","deepMerge","vitest_e2e"],"mappings":";;;AAuBO,SAASA,EAAUC,GAAqB;AAC3C,QAAMC,IAAS;AAAA,IACX,SAAS,CAACC,GAAO;AAAA,IACjB,MAAM;AAAA,MACF,SAAS,CAAC,+BAA+B;AAAA,IAAA;AAAA,EAC7C;AAGJ,SAAOC,EAAaC,EAAUH,GAAeD,CAAc,CAAe;AAC9E;AAEA,MAAAK,IAAeN,EAAU,CAAA,CAAE;"}
|
|
@@ -18,3 +18,5 @@ import { UserConfig } from 'vite';
|
|
|
18
18
|
* @returns A Vitest configuration object optimized for unit testing with React and DOM support.
|
|
19
19
|
*/
|
|
20
20
|
export declare function vitestUnit(options: UserConfig): UserConfig;
|
|
21
|
+
declare const _default: UserConfig;
|
|
22
|
+
export default _default;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import r from "@vitejs/plugin-react-swc";
|
|
2
|
-
import { defineConfig as o } from "../../node_modules/.pnpm/vitest@4.0.18_@types_node@25.3.
|
|
2
|
+
import { defineConfig as o } from "../../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";
|
|
3
3
|
import { deepMerge as s } from "../../util/object/object.util.js";
|
|
4
|
-
function
|
|
5
|
-
const
|
|
4
|
+
function i(t) {
|
|
5
|
+
const e = {
|
|
6
6
|
plugins: [r()],
|
|
7
7
|
test: {
|
|
8
8
|
globals: !0,
|
|
@@ -23,8 +23,11 @@ function p(e) {
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
|
-
return o(s(
|
|
26
|
+
return o(s(e, t));
|
|
27
27
|
}
|
|
28
|
+
const p = i({});
|
|
28
29
|
export {
|
|
29
|
-
p as
|
|
30
|
+
p as default,
|
|
31
|
+
i as vitestUnit
|
|
30
32
|
};
|
|
33
|
+
//# sourceMappingURL=vitest.unit.js.map
|
|
@@ -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\nexport default vitestUnit({});\n"],"names":["vitestUnit","options","config","react","defineConfig","deepMerge","vitest_unit"],"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;AAEA,MAAAK,IAAeN,EAAW,CAAA,CAAE;"}
|
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;"}
|
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,SAAS;AAAA,EAAA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o-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
|
@@ -1,99 +1,109 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import
|
|
2
|
+
import s from "node:process";
|
|
3
3
|
import { hideBin as M } from "yargs/helpers";
|
|
4
4
|
import _ from "yargs/yargs";
|
|
5
|
-
import { runCommand as n, clearAllErrorLists as
|
|
6
|
-
import { getPackage as
|
|
7
|
-
import { pathExistsSync as
|
|
8
|
-
import { resolve as
|
|
9
|
-
import { CYBERSKILL_CLI as G, command as i, CYBERSKILL_PACKAGE_NAME as
|
|
10
|
-
import { log as
|
|
5
|
+
import { runCommand as n, clearAllErrorLists as l, getStoredErrorLists as D, resolveCommands as L } from "../command/command.util.js";
|
|
6
|
+
import { getPackage as p, installDependencies as y } from "../package/package.util.js";
|
|
7
|
+
import { pathExistsSync as f, addGitIgnoreEntry as h, removeSync as k, readFileSync as O, writeFileSync as T } from "../fs/fs.util.js";
|
|
8
|
+
import { resolve as b } from "../path/path.util.js";
|
|
9
|
+
import { CYBERSKILL_CLI as G, command as i, CYBERSKILL_PACKAGE_NAME as g, PATH as o, SIMPLE_GIT_HOOK_JSON as R, createGitHooksConfig as A, AG_KIT_PACKAGE_NAME as m, DOT_AGENT as B } from "../path/path.constant.js";
|
|
10
|
+
import { log as c, catchError as E } from "../log/log.util.js";
|
|
11
11
|
import { E_IssueType as d } from "../log/log.type.js";
|
|
12
12
|
function N() {
|
|
13
13
|
try {
|
|
14
14
|
return JSON.parse(
|
|
15
|
-
|
|
15
|
+
O(b(__dirname, "../../../package.json"), "utf-8")
|
|
16
16
|
).version;
|
|
17
17
|
} catch {
|
|
18
18
|
return "1.0.0";
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
async function S() {
|
|
22
|
-
|
|
22
|
+
f(o.TS_CONFIG) ? await n("Performing TypeScript validation", await i.typescriptCheck()) : c.warn("No TypeScript configuration found. Skipping type check.");
|
|
23
23
|
}
|
|
24
|
-
async function
|
|
24
|
+
async function C(t = !1) {
|
|
25
25
|
const a = t ? await i.eslintFix() : await i.eslintCheck(), r = t ? "Running ESLint with auto-fix" : "Running ESLint check";
|
|
26
26
|
try {
|
|
27
27
|
await n(r, a, { timeout: 6e4, throwOnError: !0 });
|
|
28
28
|
} catch (e) {
|
|
29
|
-
e.code === "ETIMEDOUT" || e.killed || e.signal === "SIGTERM" ? (
|
|
29
|
+
e.code === "ETIMEDOUT" || e.killed || e.signal === "SIGTERM" ? (c.warn("Lint check timed out. Retrying with debug mode enabled..."), s.env.DEBUG = "true", await n(`${r} (Debug Mode)`, a)) : E(e);
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function w(t, a) {
|
|
33
33
|
if (!a.length)
|
|
34
34
|
return;
|
|
35
35
|
const r = t === "Errors" ? "red" : "yellow";
|
|
36
|
-
|
|
36
|
+
c.printBoxedLog(t === "Errors" ? "✖ Errors" : "⚠ Warnings", a, r);
|
|
37
37
|
}
|
|
38
|
-
async function
|
|
38
|
+
async function u() {
|
|
39
39
|
setTimeout(async () => {
|
|
40
|
-
const t = await
|
|
41
|
-
!a.length && !r.length ?
|
|
40
|
+
const t = await D() || [], a = t.filter((e) => e.type === d.Error), r = t.filter((e) => e.type === d.Warning);
|
|
41
|
+
!a.length && !r.length ? c.printBoxedLog("✔ NO ISSUES FOUND", [], "green") : (w("Warnings", r), w("Errors", a), a.length > 0 && s.exit(1));
|
|
42
42
|
}, 0);
|
|
43
43
|
}
|
|
44
44
|
async function P() {
|
|
45
|
-
await
|
|
46
|
-
const t = await
|
|
45
|
+
await l();
|
|
46
|
+
const t = await p({ name: g });
|
|
47
47
|
if (!t.success) {
|
|
48
|
-
|
|
48
|
+
c.error("Failed to retrieve package information. Aborting lint-staged.");
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
|
-
t.result.isCurrentProject && await n(`Building package: ${
|
|
51
|
+
t.result.isCurrentProject && await n(`Building package: ${g}`, await i.build()), await n("Executing lint-staged", await i.lintStaged()), u();
|
|
52
52
|
}
|
|
53
|
-
async function
|
|
53
|
+
async function x() {
|
|
54
54
|
await n("Inspecting ESLint configuration", await i.eslintInspect());
|
|
55
55
|
}
|
|
56
|
-
async function
|
|
57
|
-
await
|
|
56
|
+
async function U() {
|
|
57
|
+
await l(), await S(), await C(), u();
|
|
58
58
|
}
|
|
59
59
|
async function K() {
|
|
60
|
-
await
|
|
60
|
+
await l(), await S(), await C(!0), u();
|
|
61
61
|
}
|
|
62
|
-
async function
|
|
63
|
-
await
|
|
62
|
+
async function j() {
|
|
63
|
+
await l(), await n("Validating commit message", await i.commitLint()), u();
|
|
64
64
|
}
|
|
65
65
|
async function I() {
|
|
66
66
|
await n("Configuring Git hooks", await i.configureGitHook()), k(o.GIT_HOOK);
|
|
67
|
-
const t = await
|
|
68
|
-
|
|
67
|
+
const t = await L(A);
|
|
68
|
+
T(o.SIMPLE_GIT_HOOKS_JSON, JSON.stringify(t, null, 4)), h(o.GIT_IGNORE, R), await n("Setting up simple-git-hooks", await i.simpleGitHooks());
|
|
69
69
|
}
|
|
70
|
-
async function
|
|
70
|
+
async function v() {
|
|
71
71
|
try {
|
|
72
|
-
await n(`Checking for ${
|
|
72
|
+
await n(`Checking for ${m}`, `pnpm list -g ${m}`);
|
|
73
73
|
} catch {
|
|
74
|
-
await n(`Installing ${
|
|
74
|
+
await n(`Installing ${m} globally`, `pnpm i -g ${m}`);
|
|
75
75
|
}
|
|
76
|
-
|
|
76
|
+
f(o.DOT_AGENT) ? await n("Updating AI agent", "echo y | ag-kit update") : await n("Initializing AI agent", "ag-kit init"), h(o.GIT_EXCLUDE, B);
|
|
77
|
+
}
|
|
78
|
+
async function F() {
|
|
79
|
+
await y(), await I();
|
|
77
80
|
}
|
|
78
81
|
async function H() {
|
|
79
|
-
await
|
|
82
|
+
k(o.NODE_MODULES, o.PNPM_LOCK_YAML), await n("Pruning pnpm store", await i.pnpmPruneStore()), await n("Clearing pnpm cache", await i.pnpmCleanCache()), await y(), await I(), await v();
|
|
80
83
|
}
|
|
81
84
|
async function $() {
|
|
82
|
-
k(o.NODE_MODULES, o.PNPM_LOCK_YAML), await n("Pruning pnpm store", await i.pnpmPruneStore()), await n("Clearing pnpm cache", await i.pnpmCleanCache()), await w(), await I(), await C();
|
|
83
|
-
}
|
|
84
|
-
async function j() {
|
|
85
85
|
await n("Inspecting project dependencies", await i.nodeModulesInspect());
|
|
86
86
|
}
|
|
87
87
|
async function J() {
|
|
88
|
-
|
|
88
|
+
try {
|
|
89
|
+
const t = await p({ name: g }), a = t.success && t.result.isCurrentProject ? "pnpm exec vitest run" : await i.testUnit();
|
|
90
|
+
await n("Running unit tests", a, { throwOnError: !0 });
|
|
91
|
+
} catch {
|
|
92
|
+
s.exit(1);
|
|
93
|
+
}
|
|
89
94
|
}
|
|
90
95
|
async function V() {
|
|
91
|
-
|
|
96
|
+
try {
|
|
97
|
+
const t = await p({ name: g }), a = t.success && t.result.isCurrentProject ? "pnpm exec vitest run --passWithNoTests --config src/config/vitest/vitest.e2e.ts" : await i.testE2e();
|
|
98
|
+
await n("Running end-to-end tests", a, { throwOnError: !0 });
|
|
99
|
+
} catch {
|
|
100
|
+
s.exit(1);
|
|
101
|
+
}
|
|
92
102
|
}
|
|
93
|
-
async function
|
|
103
|
+
async function W(t) {
|
|
94
104
|
await n("Creating MongoDB migration", await i.mongoMigrateCreate(t));
|
|
95
105
|
}
|
|
96
|
-
async function
|
|
106
|
+
async function z() {
|
|
97
107
|
await n("Running MongoDB migrations", await i.mongoMigrateUp());
|
|
98
108
|
}
|
|
99
109
|
async function Y() {
|
|
@@ -107,18 +117,19 @@ async function X() {
|
|
|
107
117
|
}
|
|
108
118
|
(async () => {
|
|
109
119
|
try {
|
|
110
|
-
await _(M(
|
|
120
|
+
await _(M(s.argv)).scriptName(G).usage("$0 <command> [options]").command("ai:setup", "Setup AI agent environment", v).command("lint", "Check code for linting issues", U).command("lint:fix", "Fix linting issues automatically", K).command("lint:inspect", "View active ESLint configuration", x).command("lint-staged", "Run lint checks on staged files", P).command("commitlint", "Validate commit message format", j).command("ready", "Initialize project and dependencies", F).command("reset", "Reset the project and reinstall dependencies", H).command("inspect", "Analyze installed project dependencies", $).command("test:unit", "Run unit test suite", J).command("test:e2e", "Run end-to-end test suite", V).command("mongo:migrate:create <name>", "Create a MongoDB migration", (t) => t.positional("name", {
|
|
111
121
|
describe: "Migration name",
|
|
112
122
|
type: "string"
|
|
113
123
|
}), async (t) => {
|
|
114
124
|
if (!t.name) {
|
|
115
|
-
|
|
125
|
+
c.error("Migration name is required.");
|
|
116
126
|
return;
|
|
117
127
|
}
|
|
118
|
-
await
|
|
119
|
-
}).command("mongo:migrate:up", "Apply all MongoDB migrations",
|
|
128
|
+
await W(t.name);
|
|
129
|
+
}).command("mongo:migrate:up", "Apply all MongoDB migrations", z).command("mongo:migrate:down", "Rollback last MongoDB migration", Y).command("storybook:dev", "Start Storybook development server", q).command("storybook:build", "Build Storybook for production", X).demandCommand(1, "Please specify a valid command.").strict().help().alias("h", "help").alias("v", "version").version(N()).epilog(`💡 Tip: Use "--help" with any command to see options
|
|
120
130
|
`).parse();
|
|
121
131
|
} catch (t) {
|
|
122
|
-
E(t),
|
|
132
|
+
E(t), s.exit(1);
|
|
123
133
|
}
|
|
124
134
|
})();
|
|
135
|
+
//# sourceMappingURL=index.js.map
|