@cyberskill/shared 2.28.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 +25 -33
- 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.d.ts +4 -0
- package/dist/config/eslint/index.js +5 -12
- package/dist/config/eslint/index.js.map +1 -0
- package/dist/config/graphql-codegen/graphql-codegen.util.js +29 -33
- 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 +11 -13
- 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 +2 -1
- package/dist/config/vitest/vitest.e2e.js.map +1 -0
- package/dist/config/vitest/vitest.unit.js +20 -8
- package/dist/config/vitest/vitest.unit.js.map +1 -0
- package/dist/constant/common.js +2 -1
- 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 +22 -48
- 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 +110 -165
- 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 +142 -169
- 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 +56 -71
- 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 +46 -60
- 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 +30 -30
- 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 +111 -409
- 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 +197 -226
- package/dist/node/package/package.util.js.map +1 -0
- package/dist/node/path/index.js +27 -25
- package/dist/node/path/index.js.map +1 -0
- package/dist/node/path/path.constant.d.ts +2 -0
- package/dist/node/path/path.constant.js +131 -150
- 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 +111 -158
- 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 +120 -150
- 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/ws.util.js +46 -0
- package/dist/node/ws/ws.util.js.map +1 -0
- package/dist/node_modules/.pnpm/{vitest@4.0.18_@types_node@25.3.0_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.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 +5 -4
- 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 +52 -58
- 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 +72 -74
- 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 +12 -18
- 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 +62 -23
- 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 +7 -6
- 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.test.unit.d.ts +1 -0
- package/dist/react/apollo-error/apollo-error.util.js +7 -6
- 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 +31 -46
- 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 +5 -4
- 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 +14 -22
- 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 +8 -7
- 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 +44 -59
- 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 +29 -53
- 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 +19 -42
- package/dist/react/userback/userback.component.js.map +1 -0
- package/dist/style.css +1 -1
- 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.d.ts +2 -0
- package/dist/util/common/common.util.js +30 -37
- 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 +11 -9
- 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 +73 -76
- 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 +5 -3
- package/dist/util/string/index.js.map +1 -0
- package/dist/util/string/string.util.d.ts +12 -0
- package/dist/util/string/string.util.js +64 -44
- 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 +76 -96
- package/public/tsconfig.base.json +7 -3
- package/README.md +0 -470
- 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 -956
- 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/ws/ts.util.js +0 -68
- package/dist/node_modules/.pnpm/vitest@4.0.18_@types_node@25.3.0_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":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
package/dist/node/cli/index.js
CHANGED
|
@@ -1,180 +1,125 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import
|
|
3
|
-
import { hideBin as
|
|
4
|
-
import
|
|
5
|
-
import { runCommand as
|
|
6
|
-
import { getPackage as
|
|
7
|
-
import { pathExistsSync as
|
|
8
|
-
import { resolve as
|
|
9
|
-
import { CYBERSKILL_CLI as
|
|
10
|
-
import { log as
|
|
11
|
-
import { E_IssueType as
|
|
12
|
-
|
|
13
|
-
var T = (c) => {
|
|
14
|
-
try {
|
|
15
|
-
y(o.next(c));
|
|
16
|
-
} catch (p) {
|
|
17
|
-
f(p);
|
|
18
|
-
}
|
|
19
|
-
}, D = (c) => {
|
|
20
|
-
try {
|
|
21
|
-
y(o.throw(c));
|
|
22
|
-
} catch (p) {
|
|
23
|
-
f(p);
|
|
24
|
-
}
|
|
25
|
-
}, y = (c) => c.done ? l(c.value) : Promise.resolve(c.value).then(T, D);
|
|
26
|
-
y((o = o.apply(n, r)).next());
|
|
27
|
-
});
|
|
28
|
-
function $() {
|
|
2
|
+
import m from "node:process";
|
|
3
|
+
import { hideBin as M } from "yargs/helpers";
|
|
4
|
+
import _ from "yargs/yargs";
|
|
5
|
+
import { runCommand as n, clearAllErrorLists as g, getStoredErrorLists as L, resolveCommands as b } from "../command/command.util.js";
|
|
6
|
+
import { getPackage as T, installDependencies as w } from "../package/package.util.js";
|
|
7
|
+
import { pathExistsSync as y, addGitIgnoreEntry as f, removeSync as k, readFileSync as v, writeFileSync as D } from "../fs/fs.util.js";
|
|
8
|
+
import { resolve as O } from "../path/path.util.js";
|
|
9
|
+
import { CYBERSKILL_CLI as G, command as i, CYBERSKILL_PACKAGE_NAME as p, PATH as o, SIMPLE_GIT_HOOK_JSON as R, createGitHooksConfig as A, AG_KIT_PACKAGE_NAME as c, DOT_AGENT as B } from "../path/path.constant.js";
|
|
10
|
+
import { log as s, catchError as E } from "../log/log.util.js";
|
|
11
|
+
import { E_IssueType as d } from "../log/log.type.js";
|
|
12
|
+
function N() {
|
|
29
13
|
try {
|
|
30
14
|
return JSON.parse(
|
|
31
|
-
|
|
15
|
+
v(O(__dirname, "../../../package.json"), "utf-8")
|
|
32
16
|
).version;
|
|
33
|
-
} catch
|
|
17
|
+
} catch {
|
|
34
18
|
return "1.0.0";
|
|
35
19
|
}
|
|
36
20
|
}
|
|
37
|
-
function
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
function E(n, r) {
|
|
53
|
-
if (!r.length)
|
|
21
|
+
async function S() {
|
|
22
|
+
y(o.TS_CONFIG) ? await n("Performing TypeScript validation", await i.typescriptCheck()) : s.warn("No TypeScript configuration found. Skipping type check.");
|
|
23
|
+
}
|
|
24
|
+
async function h(t = !1) {
|
|
25
|
+
const a = t ? await i.eslintFix() : await i.eslintCheck(), r = t ? "Running ESLint with auto-fix" : "Running ESLint check";
|
|
26
|
+
try {
|
|
27
|
+
await n(r, a, { timeout: 6e4, throwOnError: !0 });
|
|
28
|
+
} catch (e) {
|
|
29
|
+
e.code === "ETIMEDOUT" || e.killed || e.signal === "SIGTERM" ? (s.warn("Lint check timed out. Retrying with debug mode enabled..."), m.env.DEBUG = "true", await n(`${r} (Debug Mode)`, a)) : E(e);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
function u(t, a) {
|
|
33
|
+
if (!a.length)
|
|
54
34
|
return;
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
function
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
function
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
function
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
}
|
|
119
|
-
function
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
function X() {
|
|
130
|
-
return i(this, null, function* () {
|
|
131
|
-
yield e("Running unit tests", yield t.testUnit());
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
function Z() {
|
|
135
|
-
return i(this, null, function* () {
|
|
136
|
-
yield e("Running end-to-end tests", yield t.testE2e());
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
function nn(n) {
|
|
140
|
-
return i(this, null, function* () {
|
|
141
|
-
yield e("Creating MongoDB migration", yield t.mongoMigrateCreate(n));
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
function en() {
|
|
145
|
-
return i(this, null, function* () {
|
|
146
|
-
yield e("Running MongoDB migrations", yield t.mongoMigrateUp());
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
function tn() {
|
|
150
|
-
return i(this, null, function* () {
|
|
151
|
-
yield e("Rolling back MongoDB migration", yield t.mongoMigrateDown());
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
function on() {
|
|
155
|
-
return i(this, null, function* () {
|
|
156
|
-
yield e("Starting Storybook development server", yield t.storybookDev());
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
function rn() {
|
|
160
|
-
return i(this, null, function* () {
|
|
161
|
-
yield e("Building Storybook", yield t.storybookBuild());
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
i(null, null, function* () {
|
|
35
|
+
const r = t === "Errors" ? "red" : "yellow";
|
|
36
|
+
s.printBoxedLog(t === "Errors" ? "✖ Errors" : "⚠ Warnings", a, r);
|
|
37
|
+
}
|
|
38
|
+
async function l() {
|
|
39
|
+
setTimeout(async () => {
|
|
40
|
+
const t = await L() || [], a = t.filter((e) => e.type === d.Error), r = t.filter((e) => e.type === d.Warning);
|
|
41
|
+
!a.length && !r.length ? s.printBoxedLog("✔ NO ISSUES FOUND", [], "green") : (u("Warnings", r), u("Errors", a), a.length > 0 && m.exit(1));
|
|
42
|
+
}, 0);
|
|
43
|
+
}
|
|
44
|
+
async function P() {
|
|
45
|
+
await g();
|
|
46
|
+
const t = await T({ name: p });
|
|
47
|
+
if (!t.success) {
|
|
48
|
+
s.error("Failed to retrieve package information. Aborting lint-staged.");
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
t.result.isCurrentProject && await n(`Building package: ${p}`, await i.build()), await n("Executing lint-staged", await i.lintStaged()), l();
|
|
52
|
+
}
|
|
53
|
+
async function U() {
|
|
54
|
+
await n("Inspecting ESLint configuration", await i.eslintInspect());
|
|
55
|
+
}
|
|
56
|
+
async function x() {
|
|
57
|
+
await g(), await S(), await h(), l();
|
|
58
|
+
}
|
|
59
|
+
async function K() {
|
|
60
|
+
await g(), await S(), await h(!0), l();
|
|
61
|
+
}
|
|
62
|
+
async function F() {
|
|
63
|
+
await g(), await n("Validating commit message", await i.commitLint()), l();
|
|
64
|
+
}
|
|
65
|
+
async function I() {
|
|
66
|
+
await n("Configuring Git hooks", await i.configureGitHook()), k(o.GIT_HOOK);
|
|
67
|
+
const t = await b(A);
|
|
68
|
+
D(o.SIMPLE_GIT_HOOKS_JSON, JSON.stringify(t, null, 4)), f(o.GIT_IGNORE, R), await n("Setting up simple-git-hooks", await i.simpleGitHooks());
|
|
69
|
+
}
|
|
70
|
+
async function C() {
|
|
71
|
+
try {
|
|
72
|
+
await n(`Checking for ${c}`, `pnpm list -g ${c}`);
|
|
73
|
+
} catch {
|
|
74
|
+
await n(`Installing ${c} globally`, `pnpm i -g ${c}`);
|
|
75
|
+
}
|
|
76
|
+
y(o.DOT_AGENT) ? await n("Updating AI agent", "ag-kit update -y") : await n("Initializing AI agent", "ag-kit init"), f(o.GIT_EXCLUDE, B);
|
|
77
|
+
}
|
|
78
|
+
async function H() {
|
|
79
|
+
await w(), await I();
|
|
80
|
+
}
|
|
81
|
+
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
|
+
await n("Inspecting project dependencies", await i.nodeModulesInspect());
|
|
86
|
+
}
|
|
87
|
+
async function J() {
|
|
88
|
+
await n("Running unit tests", await i.testUnit());
|
|
89
|
+
}
|
|
90
|
+
async function V() {
|
|
91
|
+
await n("Running end-to-end tests", await i.testE2e());
|
|
92
|
+
}
|
|
93
|
+
async function z(t) {
|
|
94
|
+
await n("Creating MongoDB migration", await i.mongoMigrateCreate(t));
|
|
95
|
+
}
|
|
96
|
+
async function W() {
|
|
97
|
+
await n("Running MongoDB migrations", await i.mongoMigrateUp());
|
|
98
|
+
}
|
|
99
|
+
async function Y() {
|
|
100
|
+
await n("Rolling back MongoDB migration", await i.mongoMigrateDown());
|
|
101
|
+
}
|
|
102
|
+
async function q() {
|
|
103
|
+
await n("Starting Storybook development server", await i.storybookDev());
|
|
104
|
+
}
|
|
105
|
+
async function X() {
|
|
106
|
+
await n("Building Storybook", await i.storybookBuild());
|
|
107
|
+
}
|
|
108
|
+
(async () => {
|
|
165
109
|
try {
|
|
166
|
-
|
|
110
|
+
await _(M(m.argv)).scriptName(G).usage("$0 <command> [options]").command("ai:setup", "Setup AI agent environment", C).command("lint", "Check code for linting issues", x).command("lint:fix", "Fix linting issues automatically", K).command("lint:inspect", "View active ESLint configuration", U).command("lint-staged", "Run lint checks on staged files", P).command("commitlint", "Validate commit message format", F).command("ready", "Initialize project and dependencies", H).command("reset", "Reset the project and reinstall dependencies", $).command("inspect", "Analyze installed project dependencies", j).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", {
|
|
167
111
|
describe: "Migration name",
|
|
168
112
|
type: "string"
|
|
169
|
-
}), (
|
|
170
|
-
if (!
|
|
171
|
-
|
|
113
|
+
}), async (t) => {
|
|
114
|
+
if (!t.name) {
|
|
115
|
+
s.error("Migration name is required.");
|
|
172
116
|
return;
|
|
173
117
|
}
|
|
174
|
-
|
|
175
|
-
})
|
|
118
|
+
await z(t.name);
|
|
119
|
+
}).command("mongo:migrate:up", "Apply all MongoDB migrations", W).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
|
|
176
120
|
`).parse();
|
|
177
|
-
} catch (
|
|
178
|
-
|
|
121
|
+
} catch (t) {
|
|
122
|
+
E(t), m.exit(1);
|
|
179
123
|
}
|
|
180
|
-
});
|
|
124
|
+
})();
|
|
125
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -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,uBAAuB,GAAG,OAAO;AAAA,IAAA,EAE1D;AAAA,EACf,QACM;AACF,WAAO;AAAA,EAC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AAY,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;"}
|