@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
package/README.md
DELETED
|
@@ -1,470 +0,0 @@
|
|
|
1
|
-
<div align="center">
|
|
2
|
-
<img src="https://res.cloudinary.com/cyberskill/image/upload/v1742786793/cyberskill/favicon/favicon-96x96.png" width="96" height="96" alt="CyberSkill Logo">
|
|
3
|
-
|
|
4
|
-
# CyberSkill Shared
|
|
5
|
-
|
|
6
|
-
**Enterprise-grade utility library for consistent, scalable development across CyberSkill projects**
|
|
7
|
-
|
|
8
|
-
[](https://npmjs.com/package/@cyberskill/shared)
|
|
9
|
-
[](https://npmjs.com/package/@cyberskill/shared)
|
|
10
|
-
[](https://www.jsdocs.io/package/@cyberskill/shared)
|
|
11
|
-
[](LICENSE)
|
|
12
|
-
|
|
13
|
-
</div>
|
|
14
|
-
|
|
15
|
-
---
|
|
16
|
-
|
|
17
|
-
## 📋 Table of Contents
|
|
18
|
-
|
|
19
|
-
- [Overview](#-overview)
|
|
20
|
-
- [Key Features](#-key-features)
|
|
21
|
-
- [Architecture](#️-architecture)
|
|
22
|
-
- [Installation](#-installation)
|
|
23
|
-
- [Quick Start](#-quick-start)
|
|
24
|
-
- [API Reference](#-api-reference)
|
|
25
|
-
- [Development](#️-development)
|
|
26
|
-
- [Contributing](#-contributing)
|
|
27
|
-
- [Support](#-support)
|
|
28
|
-
- [License](#-license)
|
|
29
|
-
|
|
30
|
-
---
|
|
31
|
-
|
|
32
|
-
## 🎯 Overview
|
|
33
|
-
|
|
34
|
-
CyberSkill Shared is a comprehensive, enterprise-grade utility library designed to standardize development practices across CyberSkill projects. Built with TypeScript-first architecture, it provides a robust foundation of utilities, configurations, and components that ensure consistency, maintainability, and developer productivity at scale.
|
|
35
|
-
|
|
36
|
-
### 🏆 Why Choose CyberSkill Shared?
|
|
37
|
-
|
|
38
|
-
| Feature | Benefit |
|
|
39
|
-
| ---------------------- | ------------------------------------------------------- |
|
|
40
|
-
| **🔄 Consistency** | Standardized patterns and utilities across all projects |
|
|
41
|
-
| **⚡ Productivity** | Pre-built solutions for common development tasks |
|
|
42
|
-
| **🛡️ Reliability** | Type-safe implementations with comprehensive testing |
|
|
43
|
-
| **📈 Scalability** | Modular architecture that grows with your needs |
|
|
44
|
-
| **🔧 Maintainability** | Well-documented, clean, and extensible codebase |
|
|
45
|
-
| **🚀 Performance** | Optimized for production with minimal bundle impact |
|
|
46
|
-
| **🔒 Security** | Built-in security best practices and validation |
|
|
47
|
-
|
|
48
|
-
### 🎯 Target Use Cases
|
|
49
|
-
|
|
50
|
-
- **Enterprise Applications**: Large-scale applications requiring consistency and maintainability
|
|
51
|
-
- **Microservices**: Distributed systems needing shared utilities and configurations
|
|
52
|
-
- **Full-Stack Development**: Projects spanning frontend and backend with shared logic
|
|
53
|
-
- **Team Collaboration**: Development teams requiring standardized tooling and patterns
|
|
54
|
-
- **Rapid Prototyping**: Quick development with pre-built, tested components
|
|
55
|
-
|
|
56
|
-
---
|
|
57
|
-
|
|
58
|
-
## ✨ Key Features
|
|
59
|
-
|
|
60
|
-
### 🛠️ Core Utilities & Helpers
|
|
61
|
-
|
|
62
|
-
<details>
|
|
63
|
-
<summary><strong>🔧 Utility Functions</strong></summary>
|
|
64
|
-
|
|
65
|
-
- **Type-safe utilities** for common operations
|
|
66
|
-
- **Object manipulation** and validation helpers
|
|
67
|
-
- **String processing** and formatting functions
|
|
68
|
-
- **Serialization** and data transformation tools
|
|
69
|
-
- **Validation** frameworks with comprehensive error handling
|
|
70
|
-
|
|
71
|
-
</details>
|
|
72
|
-
|
|
73
|
-
<details>
|
|
74
|
-
<summary><strong>⚙️ Configuration Management</strong></summary>
|
|
75
|
-
|
|
76
|
-
- **Environment configuration** with type safety and validation
|
|
77
|
-
- **ESLint configurations** for consistent code quality across projects
|
|
78
|
-
- **Testing setups** for unit, integration, and e2e tests
|
|
79
|
-
- **Build tool configurations** optimized for performance and DX
|
|
80
|
-
- **Git hooks** and commit message validation
|
|
81
|
-
|
|
82
|
-
</details>
|
|
83
|
-
|
|
84
|
-
<details>
|
|
85
|
-
<summary><strong>🌐 Node.js Integration</strong></summary>
|
|
86
|
-
|
|
87
|
-
- **Express.js utilities** for API development with middleware support
|
|
88
|
-
- **MongoDB integration** with advanced query builders and validation
|
|
89
|
-
- **WebSocket management** tools for real-time applications
|
|
90
|
-
- **File system operations** with enhanced error handling and validation
|
|
91
|
-
- **CLI development** utilities for command-line applications
|
|
92
|
-
- **Package management** with dependency resolution and updates
|
|
93
|
-
|
|
94
|
-
</details>
|
|
95
|
-
|
|
96
|
-
<details>
|
|
97
|
-
<summary><strong>⚛️ React Ecosystem</strong></summary>
|
|
98
|
-
|
|
99
|
-
- **Apollo Client** integration with error handling and caching
|
|
100
|
-
- **Internationalization** (i18n) support for multi-language applications
|
|
101
|
-
- **Loading states** and user feedback components
|
|
102
|
-
- **Storage management** hooks and utilities for client-side persistence
|
|
103
|
-
- **Toast notifications** system with customizable themes
|
|
104
|
-
- **User feedback** integration for product improvement
|
|
105
|
-
|
|
106
|
-
</details>
|
|
107
|
-
|
|
108
|
-
<details>
|
|
109
|
-
<summary><strong>📝 TypeScript Excellence</strong></summary>
|
|
110
|
-
|
|
111
|
-
- **Comprehensive type definitions** for all utilities and components
|
|
112
|
-
- **React component types** with proper prop validation
|
|
113
|
-
- **Utility type helpers** for advanced TypeScript patterns
|
|
114
|
-
- **Style declaration files** for CSS-in-JS solutions
|
|
115
|
-
- **Generic type support** for flexible, reusable components
|
|
116
|
-
|
|
117
|
-
</details>
|
|
118
|
-
|
|
119
|
-
---
|
|
120
|
-
|
|
121
|
-
## 🏗️ Architecture
|
|
122
|
-
|
|
123
|
-
### 📁 Project Structure
|
|
124
|
-
|
|
125
|
-
```text
|
|
126
|
-
shared/
|
|
127
|
-
├── 📁 public/ # Static assets and configuration
|
|
128
|
-
│ ├── favicon/ # Application icons and manifest
|
|
129
|
-
│ └── tsconfig.base.json # Base TypeScript configuration
|
|
130
|
-
├── 📁 src/
|
|
131
|
-
│ ├── 📁 config/ # Application configuration
|
|
132
|
-
│ │ ├── commitlint/ # Git commit message validation
|
|
133
|
-
│ │ ├── eslint/ # Code quality and style rules
|
|
134
|
-
│ │ ├── env/ # Environment variable management
|
|
135
|
-
│ │ ├── graphql-codegen/ # GraphQL code generation setup
|
|
136
|
-
│ │ ├── lint-staged/ # Pre-commit code quality checks
|
|
137
|
-
│ │ └── vitest/ # Testing framework configuration
|
|
138
|
-
│ ├── 📁 constant/ # Shared constants and enums
|
|
139
|
-
│ ├── 📁 node/ # Node.js utilities and modules
|
|
140
|
-
│ │ ├── apollo-server/ # Apollo Server integration helpers
|
|
141
|
-
│ │ ├── cli/ # Command-line interface utilities
|
|
142
|
-
│ │ ├── command/ # Command execution and management
|
|
143
|
-
│ │ ├── express/ # Express.js framework utilities
|
|
144
|
-
│ │ ├── fs/ # File system operations
|
|
145
|
-
│ │ ├── log/ # Structured logging and error handling
|
|
146
|
-
│ │ ├── mongo/ # MongoDB ODM and query builders
|
|
147
|
-
│ │ ├── package/ # Package management and dependency resolution
|
|
148
|
-
│ │ ├── path/ # Path manipulation and resolution
|
|
149
|
-
│ │ ├── storage/ # Data persistence and caching
|
|
150
|
-
│ │ ├── upload/ # File upload handling and validation
|
|
151
|
-
│ │ └── ws/ # WebSocket connection management
|
|
152
|
-
│ ├── 📁 react/ # React utilities and components
|
|
153
|
-
│ │ ├── apollo-client/ # Apollo Client setup and configuration
|
|
154
|
-
│ │ ├── apollo-error/ # GraphQL error handling and display
|
|
155
|
-
│ │ ├── i18next/ # Internationalization framework
|
|
156
|
-
│ │ ├── loading/ # Loading state management and UI
|
|
157
|
-
│ │ ├── log/ # Client-side logging utilities
|
|
158
|
-
│ │ ├── next-intl/ # Next.js internationalization
|
|
159
|
-
│ │ ├── storage/ # Browser storage management
|
|
160
|
-
│ │ ├── toast/ # Toast notification system
|
|
161
|
-
│ │ └── userback/ # User feedback and analytics
|
|
162
|
-
│ ├── 📁 typescript/ # TypeScript type definitions
|
|
163
|
-
│ └── 📁 util/ # Utility functions and helpers
|
|
164
|
-
│ ├── common/ # Common utility types and functions
|
|
165
|
-
│ ├── object/ # Object manipulation and transformation
|
|
166
|
-
│ ├── serializer/ # Data serialization and deserialization
|
|
167
|
-
│ ├── string/ # String processing and formatting
|
|
168
|
-
│ └── validate/ # Data validation and sanitization
|
|
169
|
-
├── 📄 package.json # Project manifest and dependencies
|
|
170
|
-
├── 📄 tsconfig.json # TypeScript compiler configuration
|
|
171
|
-
├── 📄 eslint.config.js # ESLint configuration
|
|
172
|
-
├── 📄 vite.config.ts # Vite build tool configuration
|
|
173
|
-
└── 📄 README.md # Project documentation
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
---
|
|
177
|
-
|
|
178
|
-
## 🚀 Installation
|
|
179
|
-
|
|
180
|
-
### Prerequisites
|
|
181
|
-
|
|
182
|
-
- **Node.js**: 18.0.0 or higher
|
|
183
|
-
- **pnpm**: 8.0.0 or higher (recommended)
|
|
184
|
-
- **TypeScript**: 5.0.0 or higher
|
|
185
|
-
|
|
186
|
-
### Package Installation
|
|
187
|
-
|
|
188
|
-
```bash
|
|
189
|
-
# Using pnpm (recommended)
|
|
190
|
-
pnpm add @cyberskill/shared
|
|
191
|
-
|
|
192
|
-
# Using npm
|
|
193
|
-
npm install @cyberskill/shared
|
|
194
|
-
|
|
195
|
-
# Using yarn
|
|
196
|
-
yarn add @cyberskill/shared
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
### TypeScript Configuration
|
|
200
|
-
|
|
201
|
-
Add to your `tsconfig.json`:
|
|
202
|
-
|
|
203
|
-
```json
|
|
204
|
-
{
|
|
205
|
-
"compilerOptions": {
|
|
206
|
-
"baseUrl": ".",
|
|
207
|
-
"paths": {
|
|
208
|
-
"@cyberskill/shared/*": ["node_modules/@cyberskill/shared/src/*"]
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
```
|
|
213
|
-
|
|
214
|
-
---
|
|
215
|
-
|
|
216
|
-
## 🏃 Quick Start
|
|
217
|
-
|
|
218
|
-
### Basic Usage
|
|
219
|
-
|
|
220
|
-
```typescript
|
|
221
|
-
import {
|
|
222
|
-
catchError,
|
|
223
|
-
formatCurrency,
|
|
224
|
-
isEmpty,
|
|
225
|
-
validateEmail
|
|
226
|
-
} from '@cyberskill/shared';
|
|
227
|
-
|
|
228
|
-
// Email validation
|
|
229
|
-
const isValidEmail = validateEmail('user@example.com');
|
|
230
|
-
console.log(isValidEmail); // true
|
|
231
|
-
|
|
232
|
-
// Currency formatting
|
|
233
|
-
const formattedPrice = formatCurrency(1234.56, 'USD');
|
|
234
|
-
console.log(formattedPrice); // "$1,234.56"
|
|
235
|
-
|
|
236
|
-
// Empty value checking
|
|
237
|
-
const isEmptyValue = isEmpty(null); // true
|
|
238
|
-
const hasValue = isEmpty('hello'); // false
|
|
239
|
-
|
|
240
|
-
// Error handling
|
|
241
|
-
try {
|
|
242
|
-
// Your code here
|
|
243
|
-
}
|
|
244
|
-
catch (error) {
|
|
245
|
-
const handledError = catchError(error);
|
|
246
|
-
console.log(handledError.message);
|
|
247
|
-
}
|
|
248
|
-
```
|
|
249
|
-
|
|
250
|
-
### React Integration
|
|
251
|
-
|
|
252
|
-
```tsx
|
|
253
|
-
import {
|
|
254
|
-
ApolloProvider,
|
|
255
|
-
LoadingProvider,
|
|
256
|
-
useApolloError,
|
|
257
|
-
useLoading
|
|
258
|
-
} from '@cyberskill/shared';
|
|
259
|
-
import * as React from 'react';
|
|
260
|
-
|
|
261
|
-
// Main application wrapper
|
|
262
|
-
/**
|
|
263
|
-
*
|
|
264
|
-
*/
|
|
265
|
-
// eslint-disable-next-line react-refresh/only-export-components
|
|
266
|
-
function App() {
|
|
267
|
-
return (
|
|
268
|
-
<ApolloProvider options={{ uri: 'https://api.example.com/graphql' }}>
|
|
269
|
-
<LoadingProvider>
|
|
270
|
-
<MyApplication />
|
|
271
|
-
</LoadingProvider>
|
|
272
|
-
</ApolloProvider>
|
|
273
|
-
);
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
// Component with loading and error handling
|
|
277
|
-
/**
|
|
278
|
-
*
|
|
279
|
-
*/
|
|
280
|
-
// eslint-disable-next-line react-refresh/only-export-components
|
|
281
|
-
function MyComponent() {
|
|
282
|
-
const { showLoading, hideLoading } = useLoading();
|
|
283
|
-
const { showError } = useApolloError();
|
|
284
|
-
|
|
285
|
-
const handleAsyncOperation = async () => {
|
|
286
|
-
try {
|
|
287
|
-
showLoading();
|
|
288
|
-
// Your async operation
|
|
289
|
-
await someAsyncTask();
|
|
290
|
-
}
|
|
291
|
-
catch (error) {
|
|
292
|
-
showError(error);
|
|
293
|
-
}
|
|
294
|
-
finally {
|
|
295
|
-
hideLoading();
|
|
296
|
-
}
|
|
297
|
-
};
|
|
298
|
-
|
|
299
|
-
return (
|
|
300
|
-
<div>
|
|
301
|
-
<button type="button" onClick={handleAsyncOperation}>
|
|
302
|
-
Perform Operation
|
|
303
|
-
</button>
|
|
304
|
-
</div>
|
|
305
|
-
);
|
|
306
|
-
}
|
|
307
|
-
```
|
|
308
|
-
|
|
309
|
-
### Node.js Integration
|
|
310
|
-
|
|
311
|
-
```typescript
|
|
312
|
-
import {
|
|
313
|
-
createCorsOptions,
|
|
314
|
-
mongo,
|
|
315
|
-
RESPONSE_STATUS,
|
|
316
|
-
throwError
|
|
317
|
-
} from '@cyberskill/shared';
|
|
318
|
-
// Express.js setup with CORS
|
|
319
|
-
import express from 'express';
|
|
320
|
-
|
|
321
|
-
const app = express();
|
|
322
|
-
|
|
323
|
-
const corsOptions = createCorsOptions({
|
|
324
|
-
isDev: process.env.NODE_ENV === 'development',
|
|
325
|
-
whiteList: ['https://example.com', 'https://api.example.com']
|
|
326
|
-
});
|
|
327
|
-
|
|
328
|
-
app.use(cors(corsOptions));
|
|
329
|
-
|
|
330
|
-
// MongoDB integration
|
|
331
|
-
const mongoose = await mongo.connect({
|
|
332
|
-
uri: process.env.MONGODB_URI,
|
|
333
|
-
options: {
|
|
334
|
-
maxPoolSize: 10,
|
|
335
|
-
serverSelectionTimeoutMS: 5000
|
|
336
|
-
}
|
|
337
|
-
});
|
|
338
|
-
|
|
339
|
-
// Error handling
|
|
340
|
-
app.use('/api/users', (req, res, next) => {
|
|
341
|
-
try {
|
|
342
|
-
// Your route logic
|
|
343
|
-
}
|
|
344
|
-
catch (error) {
|
|
345
|
-
throwError({
|
|
346
|
-
message: 'User operation failed',
|
|
347
|
-
status: RESPONSE_STATUS.INTERNAL_SERVER_ERROR,
|
|
348
|
-
type: 'rest'
|
|
349
|
-
});
|
|
350
|
-
}
|
|
351
|
-
});
|
|
352
|
-
```
|
|
353
|
-
|
|
354
|
-
---
|
|
355
|
-
|
|
356
|
-
## 🛠️ Development
|
|
357
|
-
|
|
358
|
-
### Quick Setup
|
|
359
|
-
|
|
360
|
-
```bash
|
|
361
|
-
# Clone the repository
|
|
362
|
-
git clone https://github.com/cyberskill-world/shared.git
|
|
363
|
-
cd shared
|
|
364
|
-
|
|
365
|
-
# Install dependencies
|
|
366
|
-
pnpm install
|
|
367
|
-
|
|
368
|
-
# Build the project
|
|
369
|
-
pnpm run build
|
|
370
|
-
|
|
371
|
-
# Start development mode
|
|
372
|
-
pnpm run dev
|
|
373
|
-
```
|
|
374
|
-
|
|
375
|
-
### Available Scripts
|
|
376
|
-
|
|
377
|
-
| Command | Description | Usage |
|
|
378
|
-
| ------------------- | -------------------------------------- | ------------ |
|
|
379
|
-
| `pnpm run dev` | Start development mode with hot reload | Development |
|
|
380
|
-
| `pnpm run build` | Build for production | Production |
|
|
381
|
-
| `pnpm run lint` | Check for linting issues | Code Quality |
|
|
382
|
-
| `pnpm run lint:fix` | Fix linting issues automatically | Code Quality |
|
|
383
|
-
| `pnpm run test` | Run tests | Testing |
|
|
384
|
-
| `pnpm run inspect` | Inspect project dependencies | Analysis |
|
|
385
|
-
| `pnpm run reset` | Reset project state | Maintenance |
|
|
386
|
-
| `pnpm run ready` | Prepare project for development | Setup |
|
|
387
|
-
|
|
388
|
-
For detailed development guidelines, code standards, and contribution workflow, see our [Contributing Guide](CONTRIBUTING.md).
|
|
389
|
-
|
|
390
|
-
---
|
|
391
|
-
|
|
392
|
-
## 🤝 Contributing
|
|
393
|
-
|
|
394
|
-
We welcome contributions from the community! Please read our [Contributing Guide](CONTRIBUTING.md) for detailed information about our development process, code standards, and contribution workflow.
|
|
395
|
-
|
|
396
|
-
### Quick Start for Contributors
|
|
397
|
-
|
|
398
|
-
1. **Fork** the repository
|
|
399
|
-
2. **Create** a feature branch (`git checkout -b feature/amazing-feature`)
|
|
400
|
-
3. **Make** your changes following our standards
|
|
401
|
-
4. **Test** your changes thoroughly
|
|
402
|
-
5. **Commit** with conventional commit messages
|
|
403
|
-
6. **Push** to your branch and create a Pull Request
|
|
404
|
-
|
|
405
|
-
For complete guidelines, see [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
406
|
-
|
|
407
|
-
---
|
|
408
|
-
|
|
409
|
-
## 🆘 Support
|
|
410
|
-
|
|
411
|
-
### Getting Help
|
|
412
|
-
|
|
413
|
-
- **🐛 Issues**: [GitHub Issues](https://github.com/cyberskill-world/shared/issues)
|
|
414
|
-
- **💬 Discussions**: [GitHub Discussions](https://github.com/cyberskill-world/shared/discussions)
|
|
415
|
-
- **📧 Email**: [support@cyberskill.world](mailto:support@cyberskill.world)
|
|
416
|
-
|
|
417
|
-
### Community Resources
|
|
418
|
-
|
|
419
|
-
- **📚 API Reference**: [JSDocs](https://www.jsdocs.io/package/@cyberskill/shared)
|
|
420
|
-
|
|
421
|
-
### Migration Support
|
|
422
|
-
|
|
423
|
-
- **📋 Changelog**: [Release Notes](https://github.com/cyberskill-world/shared/releases)
|
|
424
|
-
|
|
425
|
-
---
|
|
426
|
-
|
|
427
|
-
## 📄 License
|
|
428
|
-
|
|
429
|
-
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
430
|
-
|
|
431
|
-
**MIT License Benefits:**
|
|
432
|
-
|
|
433
|
-
- ✅ Commercial use allowed
|
|
434
|
-
- ✅ Modification permitted
|
|
435
|
-
- ✅ Distribution allowed
|
|
436
|
-
- ✅ Private use allowed
|
|
437
|
-
- ✅ No warranty provided
|
|
438
|
-
- ✅ No liability for damages
|
|
439
|
-
|
|
440
|
-
---
|
|
441
|
-
|
|
442
|
-
## 🏢 About CyberSkill
|
|
443
|
-
|
|
444
|
-
CyberSkill JSC is a leading technology company focused on building innovative solutions for the cybersecurity industry. Our shared libraries and tools help developers create secure, scalable, and maintainable applications that meet enterprise-grade standards.
|
|
445
|
-
|
|
446
|
-
### Company Information
|
|
447
|
-
|
|
448
|
-
- **🌐 Website**: [https://cyberskill.world](https://cyberskill.world)
|
|
449
|
-
- **🐙 GitHub**: [https://github.com/cyberskill-world](https://github.com/cyberskill-world)
|
|
450
|
-
- **📧 Contact**: [hello@cyberskill.world](mailto:hello@cyberskill.world)
|
|
451
|
-
|
|
452
|
-
### Our Mission
|
|
453
|
-
|
|
454
|
-
To provide developers with the tools and utilities they need to build secure, scalable, and maintainable applications that protect users and organizations in an increasingly complex digital landscape.
|
|
455
|
-
|
|
456
|
-
---
|
|
457
|
-
|
|
458
|
-
<div align="center">
|
|
459
|
-
<p>Made with ❤️ by the <a href="https://github.com/cyberskill-world">CyberSkill Team</a></p>
|
|
460
|
-
|
|
461
|
-
<p>
|
|
462
|
-
<a href="https://cyberskill.world">Website</a>
|
|
463
|
-
<a href="https://github.com/cyberskill-world/shared/issues">Issues</a>
|
|
464
|
-
<a href="https://github.com/cyberskill-world/shared/discussions">Discussions</a>
|
|
465
|
-
</p>
|
|
466
|
-
|
|
467
|
-
<p>
|
|
468
|
-
<sub>If this project helps you, please consider giving us a ⭐ on GitHub!</sub>
|
|
469
|
-
</p>
|
|
470
|
-
</div>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t={extends:["@commitlint/config-conventional"],ignores:[e=>e.includes("[🚀 CI - Deploy]")]};exports.default=t;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});exports.E_ConfigType=(t=>(t.ESLINT="eslint",t.COMMITLINT="commitlint",t.LINT_STAGED="lint-staged",t.VITEST_REACT_E2E="vitest-react-e2e",t.VITEST_REACT_UNIT="vitest-react-unit",t))(exports.E_ConfigType||{});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@antfu/eslint-config"),i=require("./config.type.cjs"),o=require("./eslint/index.cjs"),_=require("./vitest/vitest.e2e.cjs"),l=require("./vitest/vitest.unit.cjs"),a=require("../util/object/object.util.cjs");var f=Object.getOwnPropertySymbols,y=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,E=(e,n)=>{var t={};for(var r in e)y.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&f)for(var r of f(e))n.indexOf(r)<0&&u.call(e,r)&&(t[r]=e[r]);return t};const p=(...e)=>{const t=a.deepMerge(...Array.isArray(o.default)?o.default:[o.default],...e),{ignores:r}=t,g=E(t,["ignores"]);return s({stylistic:{semi:!0,indent:4},formatters:!0,yaml:!1,react:!0},g,...Array.isArray(r)?[{ignores:r}]:[])},T={[i.E_ConfigType.ESLINT]:e=>p(e),[i.E_ConfigType.COMMITLINT]:e=>a.deepMerge(e),[i.E_ConfigType.LINT_STAGED]:e=>a.deepMerge(e),[i.E_ConfigType.VITEST_REACT_UNIT]:e=>l.vitestUnit(e),[i.E_ConfigType.VITEST_REACT_E2E]:e=>_.vitestE2E(e)};function d(e,...n){const t=T[e];if(!n||n.length===0)return t({});if(!t)throw new Error(`Unknown config type: ${e}`);return t(...n)}exports.mergeConfigs=d;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=".cyberskill-storage";exports.CYBERSKILL_STORAGE_DIRECTORY=e;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("@dotenvx/dotenvx"),n=require("envalid"),i=require("node:os"),a=require("node:path"),r=require("node:process"),l=require("./env.constant.cjs"),u=require("../../typescript/common.type.cjs");let t=!1;const d=n.makeValidator(e=>typeof e=="boolean"?e:typeof e=="string");function o(){r.env.NODE_ENV!==u.E_Environment.PRODUCTION&&!t&&(E.config(),t=!0)}function s(){o();const e=n.cleanEnv(r.env,{CWD:n.str({default:r.cwd()}),DEBUG:d({default:!1}),CYBERSKILL_STORAGE_DIRECTORY:n.str({default:a.join(i.homedir(),l.CYBERSKILL_STORAGE_DIRECTORY)})});return{CWD:e.CWD,DEBUG:e.DEBUG,CYBERSKILL_STORAGE_DIRECTORY:e.CYBERSKILL_STORAGE_DIRECTORY}}exports.getEnv=s;exports.loadEnvFile=o;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./env.constant.cjs"),e=require("./env.util.cjs");exports.CYBERSKILL_STORAGE_DIRECTORY=t.CYBERSKILL_STORAGE_DIRECTORY;exports.getEnv=e.getEnv;exports.loadEnvFile=e.loadEnvFile;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("globals");function u(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,o.get?o:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const n=u(i);var c=Object.defineProperty,a=Object.getOwnPropertySymbols,f=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,l=(t,e,r)=>e in t?c(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,s=(t,e)=>{for(var r in e||(e={}))f.call(e,r)&&l(t,r,e[r]);if(a)for(var r of a(e))p.call(e,r)&&l(t,r,e[r]);return t};const d=[{languageOptions:{globals:s(s({},n.node),n.browser)},rules:{"perfectionist/sort-imports":["error",{internalPattern:["^#.*","^@/.*"]}],"dot-notation":"off"},ignores:["**/node_modules/**","**/.git/**","build","dist",".agent"]}];exports.default=d;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("@eddeee888/gcg-typescript-resolver-files"),l=require("../env/env.util.cjs");var u=Object.defineProperty,f=Object.defineProperties,g=Object.getOwnPropertyDescriptors,i=Object.getOwnPropertySymbols,_=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable,a=(t,e,r)=>e in t?u(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,n=(t,e)=>{for(var r in e||(e={}))_.call(e,r)&&a(t,r,e[r]);if(i)for(var r of i(e))v.call(e,r)&&a(t,r,e[r]);return t},d=(t,e)=>f(t,g(e));l.loadEnvFile();function m({uri:t,from:e,to:r,target:o="client"}){const s=o==="client",p=o==="server";return d(n({schema:t,ignoreNoDocuments:!0,overwrite:!0},s&&{documents:[e]}),{generates:n(n({},s&&{[r]:{preset:"client",presetConfig:{fragmentMasking:!1,persistedDocuments:!0},config:{useTypeImports:!0,namingConvention:"keep"}}}),p&&{[r]:c.defineConfig()})})}exports.createGraphqlCodegenConfig=m;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./graphql-codegen.util.cjs");exports.createGraphqlCodegenConfig=e.createGraphqlCodegenConfig;
|
package/dist/config/index.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./config.type.cjs"),r=require("./config.util.cjs");Object.defineProperty(exports,"E_ConfigType",{enumerable:!0,get:()=>e.E_ConfigType});exports.mergeConfigs=r.mergeConfigs;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"*.ts":()=>"tsc --noEmit","*":["eslint --fix --no-cache"]};exports.default=e;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./storybook.main.cjs"),e=require("./storybook.preview.cjs");exports.storybookMain=o.storybookMain;exports.storybookPreview=e.storybookPreview;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../../util/object/object.util.cjs");function e(o){const t={stories:["../src/**/*.stories.@(js|jsx|mjs|ts|tsx|mdx)"],addons:["@storybook/addon-essentials","@storybook/addon-interactions","@storybook/addon-links"],framework:{name:"@storybook/react-vite",options:{}}};return s.deepMerge(t,o)}exports.storybookMain=e;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var l=Object.defineProperty,n=Object.defineProperties,p=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable,s=(e,r,t)=>r in e?l(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,a=(e,r)=>{for(var t in r||(r={}))c.call(r,t)&&s(e,t,r[t]);if(o)for(var t of o(r))f.call(r,t)&&s(e,t,r[t]);return e},i=(e,r)=>n(e,p(r));function u(e){const r={parameters:{controls:{matchers:{color:/(background|color)$/i,date:/Date$/i}},backgrounds:{default:"light",values:[{name:"light",value:"#ffffff"},{name:"dark",value:"#333333"}]}}};return i(a(a({},r),e),{parameters:a(a({},r.parameters),e==null?void 0:e.parameters)})}exports.storybookPreview=u;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./vitest.e2e.cjs"),e=require("./vitest.unit.cjs");exports.vitestE2E=t.vitestE2E;exports.vitestUnit=e.vitestUnit;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@vitejs/plugin-react-swc"),i=require("../../node_modules/.pnpm/vitest@4.0.18_@types_node@25.3.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"),o=require("../../util/object/object.util.cjs");function n(e){const r={plugins:[t()],test:{include:["**/*.test.e2e.?(c|m)[jt]s?(x)"],browser:{enabled:!0,provider:"playwright",instances:[{browser:"chromium"},{browser:"firefox"},{browser:"webkit"}]}}};return i.defineConfig(o.deepMerge(r,e))}exports.vitestE2E=n;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("@vitejs/plugin-react-swc"),n=require("../../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"),s=require("../../util/object/object.util.cjs");function r(e){const t={plugins:[i()],test:{globals:!0,environment:"jsdom",pool:"vmThreads",include:["**/*.test.unit.?(c|m)[jt]s?(x)"],setupFiles:["./vitest.unit.setup.ts"]}};return n.defineConfig(s.deepMerge(t,e))}exports.vitestUnit=r;
|
package/dist/constant/common.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=typeof window!="undefined";exports.IS_BROWSER=e;
|
package/dist/constant/index.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("./common.cjs"),e=require("./response-status.cjs");exports.IS_BROWSER=S.IS_BROWSER;exports.RESPONSE_STATUS=e.RESPONSE_STATUS;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E={GRAPHQL_PARSE_FAILED:{CODE:"GRAPHQL_PARSE_FAILED",MESSAGE:"The GraphQL operation string contains a syntax error."},GRAPHQL_VALIDATION_FAILED:{CODE:"GRAPHQL_VALIDATION_FAILED",MESSAGE:"The GraphQL operation is not valid against the server's schema."},BAD_USER_INPUT:{CODE:"BAD_USER_INPUT",MESSAGE:"The GraphQL operation includes an invalid value for a field argument."},PERSISTED_QUERY_NOT_FOUND:{CODE:"PERSISTED_QUERY_NOT_FOUND",MESSAGE:"A client sent the hash of a query string to execute via automatic persisted queries, but the query was not in the APQ cache."},PERSISTED_QUERY_NOT_SUPPORTED:{CODE:"PERSISTED_QUERY_NOT_SUPPORTED",MESSAGE:"A client sent the hash of a query string to execute via automatic persisted queries, but the server has disabled APQ."},OPERATION_RESOLUTION_FAILURE:{CODE:"OPERATION_RESOLUTION_FAILURE",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."},CONTINUE:{CODE:100,MESSAGE:"Continue"},SWITCHING_PROTOCOLS:{CODE:101,MESSAGE:"Switching Protocols"},PROCESSING:{CODE:102,MESSAGE:"Processing"},OK:{CODE:200,MESSAGE:"OK"},CREATED:{CODE:201,MESSAGE:"Created"},ACCEPTED:{CODE:202,MESSAGE:"Accepted"},NON_AUTHORITATIVE_INFORMATION:{CODE:203,MESSAGE:"Non Authoritative Information"},NO_CONTENT:{CODE:204,MESSAGE:"No Content"},RESET_CONTENT:{CODE:205,MESSAGE:"Reset Content"},PARTIAL_CONTENT:{CODE:206,MESSAGE:"Partial Content"},MULTI_STATUS:{CODE:207,MESSAGE:"Multi-Status"},MULTIPLE_CHOICES:{CODE:300,MESSAGE:"Multiple Choices"},MOVED_PERMANENTLY:{CODE:301,MESSAGE:"Moved Permanently"},MOVED_TEMPORARILY:{CODE:302,MESSAGE:"Moved Temporarily"},SEE_OTHER:{CODE:303,MESSAGE:"See Other"},NOT_MODIFIED:{CODE:304,MESSAGE:"Not Modified"},USE_PROXY:{CODE:305,MESSAGE:"Use Proxy"},TEMPORARY_REDIRECT:{CODE:307,MESSAGE:"Temporary Redirect"},PERMANENT_REDIRECT:{CODE:308,MESSAGE:"Permanent Redirect"},BAD_REQUEST:{CODE:400,MESSAGE:"Bad Request"},UNAUTHORIZED:{CODE:401,MESSAGE:"Unauthorized"},PAYMENT_REQUIRED:{CODE:402,MESSAGE:"Payment Required"},FORBIDDEN:{CODE:403,MESSAGE:"Forbidden"},NOT_FOUND:{CODE:404,MESSAGE:"Not Found"},METHOD_NOT_ALLOWED:{CODE:405,MESSAGE:"Method Not Allowed"},NOT_ACCEPTABLE:{CODE:406,MESSAGE:"Not Acceptable"},PROXY_AUTHENTICATION_REQUIRED:{CODE:407,MESSAGE:"Proxy Authentication Required"},REQUEST_TIMEOUT:{CODE:408,MESSAGE:"Request Timeout"},CONFLICT:{CODE:409,MESSAGE:"Conflict"},GONE:{CODE:410,MESSAGE:"Gone"},LENGTH_REQUIRED:{CODE:411,MESSAGE:"Length Required"},PRECONDITION_FAILED:{CODE:412,MESSAGE:"Precondition Failed"},REQUEST_TOO_LONG:{CODE:413,MESSAGE:"Request Entity Too Large"},REQUEST_URI_TOO_LONG:{CODE:414,MESSAGE:"Request-URI Too Long"},UNSUPPORTED_MEDIA_TYPE:{CODE:415,MESSAGE:"Unsupported Media Type"},REQUESTED_RANGE_NOT_SATISFIABLE:{CODE:416,MESSAGE:"Requested Range Not Satisfiable"},EXPECTATION_FAILED:{CODE:417,MESSAGE:"Expectation Failed"},IM_A_TEAPOT:{CODE:418,MESSAGE:"I'm a teapot"},INSUFFICIENT_SPACE_ON_RESOURCE:{CODE:419,MESSAGE:"Insufficient Space on Resource"},METHOD_FAILURE:{CODE:420,MESSAGE:"Method Failure"},MISDIRECTED_REQUEST:{CODE:421,MESSAGE:"Misdirected Request"},UNPROCESSABLE_ENTITY:{CODE:422,MESSAGE:"Unprocessable Entity"},LOCKED:{CODE:423,MESSAGE:"Locked"},FAILED_DEPENDENCY:{CODE:424,MESSAGE:"Failed Dependency"},PRECONDITION_REQUIRED:{CODE:428,MESSAGE:"Precondition Required"},TOO_MANY_REQUESTS:{CODE:429,MESSAGE:"Too Many Requests"},REQUEST_HEADER_FIELDS_TOO_LARGE:{CODE:431,MESSAGE:"Request Header Fields Too Large"},UNAVAILABLE_FOR_LEGAL_REASONS:{CODE:451,MESSAGE:"Unavailable For Legal Reasons"},INTERNAL_SERVER_ERROR:{CODE:500,MESSAGE:"Internal Server Error"},NOT_IMPLEMENTED:{CODE:501,MESSAGE:"Not Implemented"},BAD_GATEWAY:{CODE:502,MESSAGE:"Bad Gateway"},SERVICE_UNAVAILABLE:{CODE:503,MESSAGE:"Service Unavailable"},GATEWAY_TIMEOUT:{CODE:504,MESSAGE:"Gateway Timeout"},HTTP_VERSION_NOT_SUPPORTED:{CODE:505,MESSAGE:"HTTP Version Not Supported"},INSUFFICIENT_STORAGE:{CODE:507,MESSAGE:"Insufficient Storage"},NETWORK_AUTHENTICATION_REQUIRED:{CODE:511,MESSAGE:"Network Authentication Required"}};exports.RESPONSE_STATUS=E;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("@apollo/server"),S=require("@apollo/server/plugin/drainHttpServer"),u=require("@apollo/server/plugin/landingPage/default"),_=require("../log/log.util.cjs");var P=Object.defineProperty,i=Object.getOwnPropertySymbols,g=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable,v=(r,e,l)=>e in r?P(r,e,{enumerable:!0,configurable:!0,writable:!0,value:l}):r[e]=l,y=(r,e)=>{for(var l in e||(e={}))g.call(e,l)&&v(r,l,e[l]);if(i)for(var l of i(e))h.call(e,l)&&v(r,l,e[l]);return r},c=(r,e,l)=>new Promise((p,o)=>{var s=t=>{try{a(l.next(t))}catch(n){o(n)}},d=t=>{try{a(l.throw(t))}catch(n){o(n)}},a=t=>t.done?p(t.value):Promise.resolve(t.value).then(s,d);a((l=l.apply(r,e)).next())});function m(r){return new f.ApolloServer(y({schema:r.schema,plugins:[r.isDev?u.ApolloServerPluginLandingPageLocalDefault():u.ApolloServerPluginLandingPageProductionDefault(),S.ApolloServerPluginDrainHttpServer({httpServer:r.server}),...r.drainServer?[{serverWillStart(){return c(this,null,function*(){return{drainServer(){return c(this,null,function*(){var e;(e=r.drainServer)==null||e.call(r),_.log.info("Apollo Server drainServer hook called")})}}})}}]:[]]},r.isDev&&{introspection:!0,includeStacktraceInErrorResponses:!0}))}exports.createApolloServer=m;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./apollo-server.util.cjs"),r=require("@as-integrations/express5");exports.createApolloServer=e.createApolloServer;Object.defineProperty(exports,"expressMiddleware",{enumerable:!0,get:()=>r.expressMiddleware});
|
package/dist/node/cli/index.cjs
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";const d=require("node:process"),I=require("yargs/helpers"),T=require("yargs/yargs"),e=require("../command/command.util.cjs"),y=require("../package/package.util.cjs"),a=require("../fs/fs.util.cjs"),v=require("../path/path.util.cjs"),n=require("../path/path.constant.cjs"),u=require("../log/log.util.cjs"),f=require("../log/log.type.cjs");var t=(i,r,o)=>new Promise((l,p)=>{var A=c=>{try{m(o.next(c))}catch(g){p(g)}},S=c=>{try{m(o.throw(c))}catch(g){p(g)}},m=c=>c.done?l(c.value):Promise.resolve(c.value).then(A,S);m((o=o.apply(i,r)).next())});function M(){try{return JSON.parse(a.readFileSync(v.resolve(__dirname,"../../../package.json"),"utf-8")).version}catch(i){return"1.0.0"}}function E(){return t(this,null,function*(){a.pathExistsSync(n.PATH.TS_CONFIG)?yield e.runCommand("Performing TypeScript validation",yield n.command.typescriptCheck()):u.log.warn("No TypeScript configuration found. Skipping type check.")})}function C(i=!1){return t(this,null,function*(){const r=i?yield n.command.eslintFix():yield n.command.eslintCheck(),o=i?"Running ESLint with auto-fix":"Running ESLint check";try{yield e.runCommand(o,r,{timeout:6e4,throwOnError:!0})}catch(l){l.code==="ETIMEDOUT"||l.killed||l.signal==="SIGTERM"?(u.log.warn("Lint check timed out. Retrying with debug mode enabled..."),d.env.DEBUG="true",yield e.runCommand(`${o} (Debug Mode)`,r)):u.catchError(l)}})}function h(i,r){if(!r.length)return;const o=i==="Errors"?"red":"yellow";u.log.printBoxedLog(i==="Errors"?"✖ Errors":"⚠ Warnings",r,o)}function s(){return t(this,null,function*(){setTimeout(()=>t(null,null,function*(){const i=(yield e.getStoredErrorLists())||[],r=i.filter(l=>l.type===f.E_IssueType.Error),o=i.filter(l=>l.type===f.E_IssueType.Warning);!r.length&&!o.length?u.log.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(h("Warnings",o),h("Errors",r),r.length>0&&d.exit(1))}),0)})}function G(){return t(this,null,function*(){yield e.clearAllErrorLists();const i=yield y.getPackage({name:n.CYBERSKILL_PACKAGE_NAME});if(!i.success){u.log.error("Failed to retrieve package information. Aborting lint-staged.");return}i.result.isCurrentProject&&(yield e.runCommand(`Building package: ${n.CYBERSKILL_PACKAGE_NAME}`,yield n.command.build())),yield e.runCommand("Executing lint-staged",yield n.command.lintStaged()),s()})}function L(){return t(this,null,function*(){yield e.runCommand("Inspecting ESLint configuration",yield n.command.eslintInspect())})}function P(){return t(this,null,function*(){yield e.clearAllErrorLists(),yield E(),yield C(),s()})}function b(){return t(this,null,function*(){yield e.clearAllErrorLists(),yield E(),yield C(!0),s()})}function O(){return t(this,null,function*(){yield e.clearAllErrorLists(),yield e.runCommand("Validating commit message",yield n.command.commitLint()),s()})}function _(){return t(this,null,function*(){yield e.runCommand("Configuring Git hooks",yield n.command.configureGitHook()),a.removeSync(n.PATH.GIT_HOOK);const i=yield e.resolveCommands(n.createGitHooksConfig);a.writeFileSync(n.PATH.SIMPLE_GIT_HOOKS_JSON,JSON.stringify(i,null,4)),a.addGitIgnoreEntry(n.PATH.GIT_IGNORE,n.SIMPLE_GIT_HOOK_JSON),yield e.runCommand("Setting up simple-git-hooks",yield n.command.simpleGitHooks())})}function k(){return t(this,null,function*(){try{yield e.runCommand(`Checking for ${n.AG_KIT_PACKAGE_NAME}`,`pnpm list -g ${n.AG_KIT_PACKAGE_NAME}`)}catch(i){yield e.runCommand(`Installing ${n.AG_KIT_PACKAGE_NAME} globally`,`pnpm i -g ${n.AG_KIT_PACKAGE_NAME}`)}a.pathExistsSync(n.PATH.DOT_AGENT)?yield e.runCommand("Updating AI agent","ag-kit update -y"):yield e.runCommand("Initializing AI agent","ag-kit init"),a.addGitIgnoreEntry(n.PATH.GIT_IGNORE,n.DOT_AGENT)})}function D(){return t(this,null,function*(){yield y.installDependencies(),yield _()})}function N(){return t(this,null,function*(){a.removeSync(n.PATH.NODE_MODULES,n.PATH.PNPM_LOCK_YAML),yield e.runCommand("Pruning pnpm store",yield n.command.pnpmPruneStore()),yield e.runCommand("Clearing pnpm cache",yield n.command.pnpmCleanCache()),yield y.installDependencies(),yield _(),yield k()})}function R(){return t(this,null,function*(){yield e.runCommand("Inspecting project dependencies",yield n.command.nodeModulesInspect())})}function B(){return t(this,null,function*(){yield e.runCommand("Running unit tests",yield n.command.testUnit())})}function K(){return t(this,null,function*(){yield e.runCommand("Running end-to-end tests",yield n.command.testE2e())})}function w(i){return t(this,null,function*(){yield e.runCommand("Creating MongoDB migration",yield n.command.mongoMigrateCreate(i))})}function H(){return t(this,null,function*(){yield e.runCommand("Running MongoDB migrations",yield n.command.mongoMigrateUp())})}function q(){return t(this,null,function*(){yield e.runCommand("Rolling back MongoDB migration",yield n.command.mongoMigrateDown())})}function x(){return t(this,null,function*(){yield e.runCommand("Starting Storybook development server",yield n.command.storybookDev())})}function U(){return t(this,null,function*(){yield e.runCommand("Building Storybook",yield n.command.storybookBuild())})}t(null,null,function*(){try{yield T(I.hideBin(d.argv)).scriptName(n.CYBERSKILL_CLI).usage("$0 <command> [options]").command("ai:setup","Setup AI agent environment",k).command("lint","Check code for linting issues",P).command("lint:fix","Fix linting issues automatically",b).command("lint:inspect","View active ESLint configuration",L).command("lint-staged","Run lint checks on staged files",G).command("commitlint","Validate commit message format",O).command("ready","Initialize project and dependencies",D).command("reset","Reset the project and reinstall dependencies",N).command("inspect","Analyze installed project dependencies",R).command("test:unit","Run unit test suite",B).command("test:e2e","Run end-to-end test suite",K).command("mongo:migrate:create <name>","Create a MongoDB migration",i=>i.positional("name",{describe:"Migration name",type:"string"}),i=>t(null,null,function*(){if(!i.name){u.log.error("Migration name is required.");return}yield w(i.name)})).command("mongo:migrate:up","Apply all MongoDB migrations",H).command("mongo:migrate:down","Rollback last MongoDB migration",q).command("storybook:dev","Start Storybook development server",x).command("storybook:build","Build Storybook for production",U).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(M()).epilog(`💡 Tip: Use "--help" with any command to see options
|
|
3
|
-
`).parse()}catch(i){u.catchError(i),d.exit(1)}});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});exports.E_CommandType=(e=>(e.CLI="CLI",e.STRING="STRING",e.FUNCTION="FUNCTION",e))(exports.E_CommandType||{});
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const D=require("node:child_process"),p=require("node:process"),M=require("node:util"),E=require("../storage/storage.util.cjs"),b=require("../package/package.util.cjs"),h=require("../path/path.constant.cjs"),g=require("../log/log.type.cjs"),c=require("../log/log.util.cjs"),j=require("../../config/env/env.util.cjs");function B(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const A=B(M);var f=(e,r,t)=>new Promise((o,s)=>{var i=u=>{try{n(t.next(u))}catch(a){s(a)}},l=u=>{try{n(t.throw(u))}catch(a){s(a)}},n=u=>u.done?o(u.value):Promise.resolve(u.value).then(i,l);n((t=t.apply(e,r)).next())});const K=A.promisify(D.exec);function _(){return f(this,null,function*(){const e=yield b.getPackage();return e.success?e.result.name:Date.now().toString()})}function k(e){return f(this,null,function*(){if(e.length===0)return;const r=yield _();try{const o=[...yield O(),...e];yield E.storage.set(r,o),setTimeout(()=>f(null,null,function*(){const s=yield E.storage.getLogLink(r);s&&c.log.info(`📂 Open the error list manually: ${s}`)}),0)}catch(t){c.catchError(t)}})}function O(){return f(this,null,function*(){try{const e=yield _(),r=yield E.storage.get(e);return r!=null?r:[]}catch(e){return c.catchError(e,{returnValue:[]})}})}function R(){return f(this,null,function*(){try{const e=yield _();yield E.storage.remove(e)}catch(e){c.catchError(e)}})}function G(e){return f(this,null,function*(){const r=[],t=[];let o="";const s=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,i=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,l=/^✖\s+(.*?)\s+\[(.*?)\]$/;e.split(`
|
|
2
|
-
`).forEach(n=>{var u,a,v,C,$,I,P,L,w,T,S;if(n.startsWith("/"))o=n.trim();else{const d=s.exec(n)||[],m=i.exec(n)||[],y=l.exec(n)||[];d.length&&o?r.push({file:o,position:`${d[1]}:${d[2]}`,type:d[3]===g.E_IssueType.Error?g.E_IssueType.Error:g.E_IssueType.Warning,message:(a=(u=d==null?void 0:d[4])==null?void 0:u.trim())!=null?a:"",rule:(C=(v=d==null?void 0:d[5])==null?void 0:v.trim())!=null?C:""}):m.length?r.push({file:($=m==null?void 0:m[1])!=null?$:"",position:`${m[2]}:${m[3]}`,type:m[4]===g.E_IssueType.Error?g.E_IssueType.Error:g.E_IssueType.Warning,message:(P=(I=m==null?void 0:m[5])==null?void 0:I.trim())!=null?P:""}):y.length?r.push({file:"commitlint",type:g.E_IssueType.Error,message:(w=(L=y==null?void 0:y[1])==null?void 0:L.trim())!=null?w:"",rule:(S=(T=y==null?void 0:y[2])==null?void 0:T.trim())!=null?S:""}):t.push(n.trim())}}),r.length&&(yield k(r)),j.getEnv().DEBUG&&t.length&&(c.log.warn("Unmatched lines:"),t.forEach(n=>c.log.info(` ${n}`)))})}function N(e){return f(this,null,function*(){try{const r=JSON.parse(e),t=[];r.forEach(({filePath:o,messages:s})=>{s.forEach(({severity:i,line:l,column:n,ruleId:u,message:a})=>{t.push({type:i===2?g.E_IssueType.Error:g.E_IssueType.Warning,file:o,position:`${l}:${n}`,rule:u,message:a})})}),t.length&&(yield k(t))}catch(r){yield G(e)}})}function W(e){return f(this,arguments,function*(r,t=N,o={}){const s=new AbortController;p.on("SIGINT",()=>{c.log.warn("Process interrupted. Terminating..."),s.abort(),p.exit()});try{if(typeof r=="string"){const{stdout:i,stderr:l}=yield K(r,{maxBuffer:104857600,signal:s.signal,timeout:o.timeout});yield Promise.all([i,l].map(n=>n&&t(n)))}}catch(i){const{stdout:l,stderr:n,message:u}=i;yield Promise.all([l,n].map(a=>a&&t(a))),!n&&!l&&c.log.error(`Command failed: ${u}`)}})}function U(e){return{raw:!0,cmd:e}}function x(e,r){return r!=null&&r.isCurrentProject?`${h.PNPM_EXEC_CLI} ${h.TSX_CLI} ${h.CYBERSKILL_CLI_PATH} ${e}`:`${h.PNPM_EXEC_CLI} ${h.CYBERSKILL_CLI} ${e}`}function q(e,r){return typeof e=="function"?x(e(r),r):typeof e=="object"&&(e==null?void 0:e.raw)===!0?e.cmd:typeof e=="string"?x(e,r):e}function X(e){return f(this,null,function*(){const r=yield b.getPackage({name:h.CYBERSKILL_PACKAGE_NAME});if(r.success){const t={isCurrentProject:r.result.isCurrentProject},o=typeof e=="function"?e(t):e;return Object.fromEntries(Object.entries(o).map(([s,i])=>[s,q(i,t)]))}})}function Y(e,r){return f(this,arguments,function*(t,o,s={}){let i;try{const l=Date.now();c.log.start(`${t}`),j.getEnv().DEBUG?c.log.info(`→ ${o}`):i=setInterval(()=>{const n=Math.floor((Date.now()-l)/1e3);n>0&&p.stdout.write(`\r⏳ ${t}... ${n}s`)},100),yield W(o,N,s),i&&(clearInterval(i),p.stdout.write("\r\x1B[K")),c.log.success(`${t} done.`)}catch(l){if(i&&(clearInterval(i),p.stdout.write("\r\x1B[K")),s.throwOnError)throw l;c.catchError(l)}})}exports.clearAllErrorLists=R;exports.formatCommand=q;exports.getStoredErrorLists=O;exports.rawCommand=U;exports.resolveCommands=X;exports.runCommand=Y;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./command.type.cjs"),r=require("./command.util.cjs");Object.defineProperty(exports,"E_CommandType",{enumerable:!0,get:()=>e.E_CommandType});exports.clearAllErrorLists=r.clearAllErrorLists;exports.formatCommand=r.formatCommand;exports.getStoredErrorLists=r.getStoredErrorLists;exports.rawCommand=r.rawCommand;exports.resolveCommands=r.resolveCommands;exports.runCommand=r.runCommand;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("@nestjs/core"),m=require("compression"),h=require("cookie-parser"),w=require("cors"),c=require("express"),q=require("express-session"),x=require("express-useragent"),b=require("graphql-upload/graphqlUploadExpress.mjs"),g=require("helmet");var S=Object.defineProperty,u=Object.getOwnPropertySymbols,v=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,d=(e,r,t)=>r in e?S(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,E=(e,r)=>{for(var t in r||(r={}))v.call(r,t)&&d(e,t,r[t]);if(u)for(var t of u(r))p.call(r,t)&&d(e,t,r[t]);return e},C=(e,r)=>{var t={};for(var s in e)v.call(e,s)&&r.indexOf(s)<0&&(t[s]=e[s]);if(e!=null&&u)for(var s of u(e))r.indexOf(s)<0&&p.call(e,s)&&(t[s]=e[s]);return t},N=(e,r,t)=>new Promise((s,a)=>{var n=i=>{try{o(t.next(i))}catch(f){a(f)}},l=i=>{try{o(t.throw(i))}catch(f){a(f)}},o=i=>i.done?s(i.value):Promise.resolve(i.value).then(n,l);o((t=t.apply(e,r)).next())});function y(e){var r=e,{isDev:t,whiteList:s}=r,a=C(r,["isDev","whiteList"]);return E({origin:(n,l)=>{t||!n||s!=null&&s.includes(n!=null?n:"")?l(null,!0):l(new Error("Not allowed by CORS"),!1)},credentials:!0},a)}function j(e){return w(y(e))}function A(e){return q(e)}function _(e,r=!1){e.set("trust proxy",1),e.use(g({crossOriginEmbedderPolicy:r?!1:void 0,contentSecurityPolicy:r?!1:void 0})),e.use(h()),e.use(c.urlencoded({extended:!0})),e.use(m()),e.use(x.express())}function O(e,r){r&&(Array.isArray(r)?r:[r]).forEach(s=>{e.use(`/${s}`,c.static(s))})}function I(e){const r=c();return _(r,e==null?void 0:e.isDev),O(r,e==null?void 0:e.static),r.use(b()),r}function D(e){return N(this,null,function*(){const r=yield P.NestFactory.create(e.module);return _(r.getHttpAdapter().getInstance(),e.isDev),O(r.getHttpAdapter().getInstance(),e.static),e.filters&&r.useGlobalFilters(...e.filters),e.pipes&&r.useGlobalPipes(...e.pipes),r})}exports.express=c;exports.createCors=j;exports.createCorsOptions=y;exports.createExpress=I;exports.createNest=D;exports.createSession=A;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./express.util.cjs"),r=require("express"),t=require("body-parser");exports.createCors=e.createCors;exports.createCorsOptions=e.createCorsOptions;exports.createExpress=e.createExpress;exports.createNest=e.createNest;exports.createSession=e.createSession;Object.defineProperty(exports,"Router",{enumerable:!0,get:()=>r.Router});exports.express=r;exports.bodyParser=t;
|
package/dist/node/fs/fs.util.cjs
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("fs-extra"),m=require("node:path");var _=Object.defineProperty,c=Object.getOwnPropertySymbols,f=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable,l=(n,e,r)=>e in n?_(n,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[e]=r,O=(n,e)=>{for(var r in e||(e={}))f.call(e,r)&&l(n,r,e[r]);if(c)for(var r of c(e))S.call(e,r)&&l(n,r,e[r]);return n},g=(n,e)=>{var r={};for(var t in n)f.call(n,t)&&e.indexOf(t)<0&&(r[t]=n[t]);if(n!=null&&c)for(var t of c(n))e.indexOf(t)<0&&S.call(n,t)&&(r[t]=n[t]);return r};const E=i,{lstatSync:w,readdirSync:x,mkdirSync:F,readFileSync:s,unlinkSync:b,statSync:u,createWriteStream:j}=i,h=i.readJsonSync;function d(n,e,r){i.writeFileSync(n,e,r!=null?r:"utf-8")}function p(n,e,r){i.appendFileSync(n,e,r!=null?r:"utf-8")}function y(...n){return n.every(e=>i.pathExistsSync(e))}function J(...n){n.forEach(e=>{y(e)&&i.removeSync(e)})}function P(n,e,r={}){const t=r,{extensions:a}=t,v=g(t,["extensions"]);i.copySync(n,e,O({filter:o=>u(o).isDirectory()||!a||a.length===0?!0:a.includes(m.extname(o))},v))}function k(n,e){const r=`
|
|
2
|
-
${e}
|
|
3
|
-
`;y(n)?s(n,"utf-8").split(`
|
|
4
|
-
`).includes(e)||p(n,r):d(n,r)}exports.addGitIgnoreEntry=k;exports.appendFileSync=p;exports.copySync=P;exports.createWriteStream=j;exports.fs=E;exports.lstatSync=w;exports.mkdirSync=F;exports.pathExistsSync=y;exports.readFileSync=s;exports.readJsonSync=h;exports.readdirSync=x;exports.removeSync=J;exports.statSync=u;exports.unlinkSync=b;exports.writeFileSync=d;
|
package/dist/node/fs/index.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./fs.util.cjs");exports.addGitIgnoreEntry=e.addGitIgnoreEntry;exports.appendFileSync=e.appendFileSync;exports.copySync=e.copySync;exports.createWriteStream=e.createWriteStream;exports.fs=e.fs;exports.lstatSync=e.lstatSync;exports.mkdirSync=e.mkdirSync;exports.pathExistsSync=e.pathExistsSync;exports.readFileSync=e.readFileSync;exports.readJsonSync=e.readJsonSync;exports.readdirSync=e.readdirSync;exports.removeSync=e.removeSync;exports.statSync=e.statSync;exports.unlinkSync=e.unlinkSync;exports.writeFileSync=e.writeFileSync;
|
package/dist/node/log/index.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./log.type.cjs"),r=require("./log.util.cjs");Object.defineProperty(exports,"E_IssueType",{enumerable:!0,get:()=>e.E_IssueType});exports.catchError=r.catchError;exports.log=r.log;exports.throwError=r.throwError;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});exports.E_IssueType=(r=>(r.Error="error",r.Warning="warning",r))(exports.E_IssueType||{});
|