From d20f0e3f3abd2603a0196ea7b2f588ded5dcc6d1 Mon Sep 17 00:00:00 2001 From: Someone Date: Mon, 28 Jun 2021 14:35:21 +0300 Subject: [PATCH] Release/migrate to idea (#160) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * parent 50dbf8b3780a0faf455af041add4cbb534b0b512 author dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 1622682428 +0000 committer SocketSomeone 1622764679 +0200 parent 50dbf8b3780a0faf455af041add4cbb534b0b512 author dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 1622682428 +0000 committer SocketSomeone 1622764676 +0200 🔼 Bump husky from 5.2.0 to 6.0.0 Bumps [husky](https://github.com/typicode/husky) from 5.2.0 to 6.0.0. - [Release notes](https://github.com/typicode/husky/releases) - [Commits](https://github.com/typicode/husky/compare/v5.2.0...v6.0.0) Signed-off-by: dependabot[bot] chore(deps):(deps-dev): bump @types/node from 14.14.35 to 15.9.0 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.35 to 15.9.0. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] 🔼 Bump @types/jest from 26.0.21 to 26.0.23 Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 26.0.21 to 26.0.23. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest) Signed-off-by: dependabot[bot] chore: deps chore(dependabot): fixed config chore(deps): bump actions/checkout from 2 to 2.3.4 Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 2.3.4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v2...v2.3.4) Signed-off-by: dependabot[bot] ?? * yarn.lock * feat(framework): rewrited framework to Nest JS Library, deleted tslog & tsyringe containers BREAKING CHANGE: Deleted Tsyringe & TSLog * chore(eslint): fixed no-inferrable-types rule * chore(eslint): fixed object rule * Revert * refactor: deleted spaces in comments & added no-operation to command * ... * test: fixed cache tests * chore(project): refactor all * chore(project): refactor all * chore(codestyle): change eol to lf * feat(git): hooks and lint-staged * feat(git): hooks and lint-staged * TEst * test * test * test * fix(hooks): commitlint & lint-staged * ci: changed config for sentry release Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .commitlintrc.json | 28 + .docker/docker-compose.yml | 2 +- .dockerignore | 3 +- .editorconfig | 18 + .eslintignore | 1 + .eslintrc.js | 165 +- .gitattributes | 3 + .github/husky/commit-msg | 4 + .github/husky/pre-commit | 4 + .github/husky/pre-push | 2 +- .github/semantic.yml | 5 - .../{CI.yml => continuous-integration.yml} | 22 +- .github/workflows/sentry-deployment.yml | 23 + .gitignore | 20 +- .idea/.gitignore | 5 + .idea/Miko.iml | 20 + .idea/codeStyles/Project.xml | 65 + .idea/codeStyles/codeStyleConfig.xml | 5 + .idea/discord.xml | 6 + .idea/inspectionProfiles/Project_Default.xml | 24 + .idea/jsLinters/eslint.xml | 7 + .idea/kubernetes-settings.xml | 6 + .idea/misc.xml | 7 + .idea/modules.xml | 8 + .idea/runConfigurations/_BOT__Start.xml | 16 + .idea/runConfigurations/_Project__Build.xml | 12 + .idea/runConfigurations/_Project__Tests.xml | 13 + .idea/runConfigurations/_Project__Update.xml | 31 + .idea/runConfigurations/_WEB__Start.xml | 25 + .idea/vagrant.xml | 7 + .idea/vcs.xml | 6 + .idea/webResources.xml | 18 + apps/api/nest-cli.json | 8 +- apps/api/package.json | 16 +- apps/api/src/app.module.ts | 6 +- apps/api/src/commands/commands.controller.ts | 13 - apps/api/src/commands/commands.module.ts | 10 - apps/api/src/commands/commands.service.ts | 13 - apps/api/src/commands/dto/commands.dot.ts | 6 - .../contributors/contributors.controller.ts | 15 - .../src/contributors/contributors.module.ts | 10 - .../src/contributors/contributors.service.ts | 13 - apps/api/src/core.module.ts | 12 +- .../guilds/dto/{guildDTO.ts => guild.dto.ts} | 0 apps/api/src/guilds/guilds.controller.ts | 2 +- apps/api/src/guilds/guilds.service.ts | 39 +- apps/api/src/index.ts | 18 +- apps/api/src/metrics/metrics.controller.ts | 19 - apps/api/src/metrics/metrics.module.ts | 16 - apps/api/src/metrics/metrics.service.ts | 11 - apps/api/tsconfig.build.json | 9 - apps/api/tsconfig.package.json | 3 - apps/bot/nest-cli.json | 8 + apps/bot/package.json | 6 +- apps/bot/src/app.module.ts | 44 + apps/bot/src/gateway/CommandsGet.ts | 22 - apps/bot/src/gateway/GuildInfo.ts | 16 - apps/bot/src/gateway/gateway.module.ts | 9 + apps/bot/src/gateway/index.ts | 8 - .../src/gateway/internal-command.gateway.ts | 72 + apps/bot/src/index.ts | 18 +- apps/bot/src/main.ts | 7 - .../bot/src/moderation/moderation.commands.ts | 12 + apps/bot/src/moderation/moderation.module.ts | 8 + apps/bot/src/modules/TempChannels/index.ts | 6 - apps/bot/src/modules/index.ts | 1 - apps/bot/src/utilities/utilities.commands.ts | 14 + apps/bot/src/utilities/utilities.module.ts | 8 + apps/bot/tsconfig.package.json | 3 - apps/web/app/.prettierrc.yaml | 19 - apps/web/app/components/Command.vue | 29 +- apps/web/app/components/Contributor.vue | 48 +- apps/web/app/components/Footer.vue | 2 +- apps/web/app/components/Header.vue | 50 +- .../components/{nav => navigation}/Bottom.vue | 0 .../components/{nav => navigation}/Menu.vue | 2 +- .../{nav => navigation}/Sidebar.vue | 0 apps/web/app/layouts/default.vue | 2 +- apps/web/app/layouts/error.vue | 7 +- apps/web/app/pages/admin/index.vue | 13 + apps/web/app/pages/commands.vue | 4 +- apps/web/app/pages/contributors.vue | 51 +- apps/web/app/pages/cookies.vue | 2 +- apps/web/app/pages/guilds/_guild.vue | 4 +- apps/web/app/pages/index.vue | 10 +- apps/web/app/pages/premium.vue | 13 - apps/web/app/pages/status.vue | 13 - apps/web/app/store/index.ts | 5 +- apps/web/package.json | 12 +- apps/web/src/config/build.ts | 5 + apps/web/src/config/head.ts | 16 +- apps/web/src/config/index.ts | 7 +- apps/web/tsconfig.json | 2 +- apps/web/tsconfig.package.json | 6 +- ormconfig.js | 16 + package.json | 111 +- packages/common/package.json | 24 +- packages/common/src/cache/index.ts | 2 - packages/common/src/common.module.ts | 22 + .../base/channel.base.ts} | 2 +- .../base/entity.base.ts} | 0 .../base/guild.base.ts} | 2 +- .../src/database/entities/base/index.ts | 4 + .../base/member.base.ts} | 2 +- .../base/user.base.ts} | 2 +- .../guild-config.entity.ts} | 4 +- .../common/src/database/entities/index.ts | 5 + .../Member.ts => entities/member.entity.ts} | 4 +- .../User.ts => entities/user.entity.ts} | 2 +- .../common/src/database/entity/Contributor.ts | 22 - .../common/src/database/entity/base/index.ts | 4 - packages/common/src/database/entity/index.ts | 6 - packages/common/src/database/index.ts | 6 +- .../base/channel.base.ts} | 2 +- .../base/guild.base.ts} | 2 +- .../src/database/repositories/base/index.ts | 4 + .../base/member.base.ts} | 2 +- .../base/user.base.ts} | 2 +- .../guildConfig.repository.ts} | 2 +- .../common/src/database/repositories/index.ts | 1 + .../repository/ContributorRepository.ts | 5 - .../src/database/repository/base/index.ts | 4 - .../common/src/database/repository/index.ts | 4 - packages/common/src/decorators/Autowired.ts | 19 - packages/common/src/decorators/Interval.ts | 16 - .../common/src/decorators/PostConstruct.ts | 6 - packages/common/src/decorators/Repository.ts | 19 - packages/common/src/decorators/Schedulable.ts | 13 - packages/common/src/decorators/index.ts | 7 - .../common/src/extensions/array.extension.ts | 0 .../string.extension.ts} | 0 .../index.ts => helpers/array.helper.ts} | 2 +- .../cache.ts => helpers/cache.helper.ts} | 6 +- packages/common/src/helpers/func.helper.ts | 22 + packages/common/src/helpers/index.ts | 3 + packages/common/src/index.ts | 11 +- .../src/interfaces/allow-array.interface.ts | 1 + .../src/interfaces/awaited.interface.ts | 1 + .../interfaces/cache/cache-entry.interface.ts | 6 + .../cache/cache-metadata.interface.ts} | 0 .../cache/cache-metrics.interface.ts} | 0 .../cache/cache-options.interface.ts | 10 + .../src/interfaces/constructor.interface.ts | 1 + .../function-parameter.interface.ts | 4 + packages/common/src/interfaces/index.ts | 9 + packages/common/src/models/cache/index.ts | 2 - .../src/models/gateway/CacheDeleteRequest.ts | 5 - .../src/models/gateway/CommandsGetRequest.ts | 4 - .../src/models/gateway/GatewayCallback.ts | 6 - .../src/models/gateway/GuildInfoRequest.ts | 7 - packages/common/src/models/gateway/index.ts | 12 - packages/common/src/models/index.ts | 2 - packages/common/src/services/ConfigService.ts | 25 - .../common/src/services/EmergencyService.ts | 57 - .../common/src/services/GatewayService.ts | 143 - .../common/src/services/SchedulerService.ts | 8 - .../common/src/services/base/BaseService.ts | 75 - .../src/services/base/domain-service.base.ts | 61 + packages/common/src/services/base/index.ts | 2 +- .../cache-manager.service.ts} | 10 +- .../src/services/guild-config.service.ts | 31 + packages/common/src/services/index.ts | 6 +- .../common/src/services/sentry.service.ts | 88 + packages/common/src/types.ts | 24 - .../test/{cache.test.ts => cache.spec.ts} | 22 +- packages/common/tsconfig.package.json | 6 +- packages/config/package.json | 12 - packages/config/src/CommonConfig.ts | 7 - packages/config/src/ScriptsConfig.ts | 16 - packages/config/src/apps/BOTConfig.ts | 7 - packages/config/src/apps/index.ts | 1 - packages/config/src/index.ts | 9 - packages/config/tsconfig.package.json | 17 - packages/framework/package.json | 17 +- .../src/arguments/BooleanArgument.ts | 24 - .../src/arguments/ChannelArgument.ts | 37 - .../framework/src/arguments/EnumArgument.ts | 33 - .../framework/src/arguments/MemberArgument.ts | 46 - .../framework/src/arguments/NumberArgument.ts | 39 - .../framework/src/arguments/RoleArgument.ts | 57 - .../framework/src/arguments/StringArgument.ts | 7 - packages/framework/src/arguments/index.ts | 2 - packages/framework/src/client.ts | 110 - packages/framework/src/decorators/Command.ts | 12 - .../src/decorators/command.decorator.ts | 13 + .../src/decorators/group.decorator.ts} | 0 packages/framework/src/decorators/index.ts | 4 +- .../framework/src/decorators/on.decorator.ts | 13 + .../src/decorators/once.decorator.ts | 13 + .../src/decorators/use-guards.decorator.ts} | 0 ...ument.ts => use-interceptors.decorator.ts} | 0 .../use-middlewares.decorator.ts} | 0 .../framework/src/discord-client.provider.ts | 79 + .../src/discord-metadata.accessor.ts | 23 + packages/framework/src/discord.constants.ts | 3 + packages/framework/src/discord.explorer.ts | 101 + packages/framework/src/discord.module.ts | 42 + .../framework/src/enums/embed-colors.enum.ts | 7 + .../framework/src/enums/event-type.enum.ts | 5 + packages/framework/src/enums/index.ts | 2 + .../exceptions/base/discord-exception.base.ts | 1 + .../src/exceptions/discord-guard.exception.ts | 0 .../discord-validation.exception.ts | 0 packages/framework/src/exceptions/index.ts | 0 .../src/helpers/command-context.helper.ts | 26 + .../src/helpers/command-info.helper.ts | 20 + .../src/helpers/command-parameter.helper.ts | 0 packages/framework/src/helpers/index.ts | 1 + packages/framework/src/index.ts | 7 +- .../interfaces/command-context.interface.ts | 13 + .../interfaces/command-options.interface.ts | 8 + .../interfaces/command-parameter.interface.ts | 7 + .../discord-module-options.interface.ts | 6 + .../src/interfaces/event-options.interface.ts | 7 + packages/framework/src/interfaces/index.ts | 5 + .../interfaces/translate-func.interface.ts | 1 + packages/framework/src/models/BaseArgument.ts | 11 - packages/framework/src/models/BaseCommand.ts | 43 - .../framework/src/models/BaseQueueListner.ts | 18 - .../framework/src/models/ModuleBuilder.ts | 24 - packages/framework/src/models/index.ts | 4 - .../src/readers/base/typereader.base.ts | 6 + .../src/readers/boolean.typereader.ts | 24 + .../src/readers/channel.typereader.ts | 0 packages/framework/src/readers/index.ts | 1 + .../src/readers/member.typereader.ts | 0 .../src/readers/number.typereader.ts | 0 .../framework/src/readers/role.typereader.ts | 0 .../src/readers/string.typereader.ts | 0 .../framework/src/readers/user.typereader.ts | 0 .../src/services/CommandHolderService.ts | 27 - .../src/services/InternalCommandService.ts | 70 - .../src/services/base/BaseCommandsService.ts | 120 - packages/framework/src/services/base/index.ts | 1 - .../framework/src/services/command.service.ts | 114 + .../discord-entity-accessor.service.ts | 31 + packages/framework/src/services/index.ts | 5 +- .../framework/src/services/message.service.ts | 40 + packages/framework/src/types.ts | 34 - packages/framework/tsconfig.package.json | 3 - scripts/update-languages.ts | 23 +- test/jest.config.json | 13 +- tsconfig.json | 3 - typescript/tsconfig.eslint.json | 4 +- typescript/tsconfig.project.json | 3 - yarn.lock | 2535 ++++++++++------- 246 files changed, 3424 insertions(+), 3017 deletions(-) create mode 100644 .commitlintrc.json create mode 100644 .editorconfig create mode 100644 .eslintignore create mode 100644 .gitattributes create mode 100644 .github/husky/commit-msg create mode 100644 .github/husky/pre-commit delete mode 100644 .github/semantic.yml rename .github/workflows/{CI.yml => continuous-integration.yml} (77%) create mode 100644 .github/workflows/sentry-deployment.yml create mode 100644 .idea/.gitignore create mode 100644 .idea/Miko.iml create mode 100644 .idea/codeStyles/Project.xml create mode 100644 .idea/codeStyles/codeStyleConfig.xml create mode 100644 .idea/discord.xml create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/jsLinters/eslint.xml create mode 100644 .idea/kubernetes-settings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/runConfigurations/_BOT__Start.xml create mode 100644 .idea/runConfigurations/_Project__Build.xml create mode 100644 .idea/runConfigurations/_Project__Tests.xml create mode 100644 .idea/runConfigurations/_Project__Update.xml create mode 100644 .idea/runConfigurations/_WEB__Start.xml create mode 100644 .idea/vagrant.xml create mode 100644 .idea/vcs.xml create mode 100644 .idea/webResources.xml delete mode 100644 apps/api/src/commands/commands.controller.ts delete mode 100644 apps/api/src/commands/commands.module.ts delete mode 100644 apps/api/src/commands/commands.service.ts delete mode 100644 apps/api/src/commands/dto/commands.dot.ts delete mode 100644 apps/api/src/contributors/contributors.controller.ts delete mode 100644 apps/api/src/contributors/contributors.module.ts delete mode 100644 apps/api/src/contributors/contributors.service.ts rename apps/api/src/guilds/dto/{guildDTO.ts => guild.dto.ts} (100%) delete mode 100644 apps/api/src/metrics/metrics.controller.ts delete mode 100644 apps/api/src/metrics/metrics.module.ts delete mode 100644 apps/api/src/metrics/metrics.service.ts delete mode 100644 apps/api/tsconfig.build.json create mode 100644 apps/bot/nest-cli.json create mode 100644 apps/bot/src/app.module.ts delete mode 100644 apps/bot/src/gateway/CommandsGet.ts delete mode 100644 apps/bot/src/gateway/GuildInfo.ts create mode 100644 apps/bot/src/gateway/gateway.module.ts delete mode 100644 apps/bot/src/gateway/index.ts create mode 100644 apps/bot/src/gateway/internal-command.gateway.ts delete mode 100644 apps/bot/src/main.ts create mode 100644 apps/bot/src/moderation/moderation.commands.ts create mode 100644 apps/bot/src/moderation/moderation.module.ts delete mode 100644 apps/bot/src/modules/TempChannels/index.ts delete mode 100644 apps/bot/src/modules/index.ts create mode 100644 apps/bot/src/utilities/utilities.commands.ts create mode 100644 apps/bot/src/utilities/utilities.module.ts delete mode 100644 apps/web/app/.prettierrc.yaml rename apps/web/app/components/{nav => navigation}/Bottom.vue (100%) rename apps/web/app/components/{nav => navigation}/Menu.vue (97%) rename apps/web/app/components/{nav => navigation}/Sidebar.vue (100%) create mode 100644 apps/web/app/pages/admin/index.vue delete mode 100644 apps/web/app/pages/premium.vue delete mode 100644 apps/web/app/pages/status.vue create mode 100644 ormconfig.js delete mode 100644 packages/common/src/cache/index.ts create mode 100644 packages/common/src/common.module.ts rename packages/common/src/database/{entity/base/ChannelEntity.ts => entities/base/channel.base.ts} (78%) rename packages/common/src/database/{entity/base/BaseEntity.ts => entities/base/entity.base.ts} (100%) rename packages/common/src/database/{entity/base/GuildEntity.ts => entities/base/guild.base.ts} (78%) create mode 100644 packages/common/src/database/entities/base/index.ts rename packages/common/src/database/{entity/base/MemberEntity.ts => entities/base/member.base.ts} (77%) rename packages/common/src/database/{entity/base/UserEntity.ts => entities/base/user.base.ts} (78%) rename packages/common/src/database/{entity/GuildConfig.ts => entities/guild-config.entity.ts} (78%) create mode 100644 packages/common/src/database/entities/index.ts rename packages/common/src/database/{entity/Member.ts => entities/member.entity.ts} (77%) rename packages/common/src/database/{entity/User.ts => entities/user.entity.ts} (82%) delete mode 100644 packages/common/src/database/entity/Contributor.ts delete mode 100644 packages/common/src/database/entity/base/index.ts delete mode 100644 packages/common/src/database/entity/index.ts rename packages/common/src/database/{repository/base/ChannelRepository.ts => repositories/base/channel.base.ts} (91%) rename packages/common/src/database/{repository/base/GuildRepository.ts => repositories/base/guild.base.ts} (90%) create mode 100644 packages/common/src/database/repositories/base/index.ts rename packages/common/src/database/{repository/base/MemberRepository.ts => repositories/base/member.base.ts} (92%) rename packages/common/src/database/{repository/base/UserRepository.ts => repositories/base/user.base.ts} (81%) rename packages/common/src/database/{repository/GuildConfigRepository.ts => repositories/guildConfig.repository.ts} (93%) create mode 100644 packages/common/src/database/repositories/index.ts delete mode 100644 packages/common/src/database/repository/ContributorRepository.ts delete mode 100644 packages/common/src/database/repository/base/index.ts delete mode 100644 packages/common/src/database/repository/index.ts delete mode 100644 packages/common/src/decorators/Autowired.ts delete mode 100644 packages/common/src/decorators/Interval.ts delete mode 100644 packages/common/src/decorators/PostConstruct.ts delete mode 100644 packages/common/src/decorators/Repository.ts delete mode 100644 packages/common/src/decorators/Schedulable.ts delete mode 100644 packages/common/src/decorators/index.ts rename apps/api/src/contributors/dto/contributor.ts => packages/common/src/extensions/array.extension.ts (100%) rename packages/common/src/{database/transformers/index.ts => extensions/string.extension.ts} (100%) rename packages/common/src/{utils/index.ts => helpers/array.helper.ts} (67%) rename packages/common/src/{cache/cache.ts => helpers/cache.helper.ts} (97%) create mode 100644 packages/common/src/helpers/func.helper.ts create mode 100644 packages/common/src/helpers/index.ts create mode 100644 packages/common/src/interfaces/allow-array.interface.ts create mode 100644 packages/common/src/interfaces/awaited.interface.ts create mode 100644 packages/common/src/interfaces/cache/cache-entry.interface.ts rename packages/common/src/{models/cache/metadata.ts => interfaces/cache/cache-metadata.interface.ts} (100%) rename packages/common/src/{models/cache/metrics.ts => interfaces/cache/cache-metrics.interface.ts} (100%) create mode 100644 packages/common/src/interfaces/cache/cache-options.interface.ts create mode 100644 packages/common/src/interfaces/constructor.interface.ts create mode 100644 packages/common/src/interfaces/function-parameter.interface.ts create mode 100644 packages/common/src/interfaces/index.ts delete mode 100644 packages/common/src/models/cache/index.ts delete mode 100644 packages/common/src/models/gateway/CacheDeleteRequest.ts delete mode 100644 packages/common/src/models/gateway/CommandsGetRequest.ts delete mode 100644 packages/common/src/models/gateway/GatewayCallback.ts delete mode 100644 packages/common/src/models/gateway/GuildInfoRequest.ts delete mode 100644 packages/common/src/models/gateway/index.ts delete mode 100644 packages/common/src/models/index.ts delete mode 100644 packages/common/src/services/ConfigService.ts delete mode 100644 packages/common/src/services/EmergencyService.ts delete mode 100644 packages/common/src/services/GatewayService.ts delete mode 100644 packages/common/src/services/SchedulerService.ts delete mode 100644 packages/common/src/services/base/BaseService.ts create mode 100644 packages/common/src/services/base/domain-service.base.ts rename packages/common/src/{cache/manager.ts => services/cache-manager.service.ts} (81%) create mode 100644 packages/common/src/services/guild-config.service.ts create mode 100644 packages/common/src/services/sentry.service.ts delete mode 100644 packages/common/src/types.ts rename packages/common/test/{cache.test.ts => cache.spec.ts} (71%) delete mode 100644 packages/config/package.json delete mode 100644 packages/config/src/CommonConfig.ts delete mode 100644 packages/config/src/ScriptsConfig.ts delete mode 100644 packages/config/src/apps/BOTConfig.ts delete mode 100644 packages/config/src/apps/index.ts delete mode 100644 packages/config/src/index.ts delete mode 100644 packages/config/tsconfig.package.json delete mode 100644 packages/framework/src/arguments/BooleanArgument.ts delete mode 100644 packages/framework/src/arguments/ChannelArgument.ts delete mode 100644 packages/framework/src/arguments/EnumArgument.ts delete mode 100644 packages/framework/src/arguments/MemberArgument.ts delete mode 100644 packages/framework/src/arguments/NumberArgument.ts delete mode 100644 packages/framework/src/arguments/RoleArgument.ts delete mode 100644 packages/framework/src/arguments/StringArgument.ts delete mode 100644 packages/framework/src/arguments/index.ts delete mode 100644 packages/framework/src/client.ts delete mode 100644 packages/framework/src/decorators/Command.ts create mode 100644 packages/framework/src/decorators/command.decorator.ts rename packages/{config/src/apps/APIConfig.ts => framework/src/decorators/group.decorator.ts} (100%) create mode 100644 packages/framework/src/decorators/on.decorator.ts create mode 100644 packages/framework/src/decorators/once.decorator.ts rename packages/{config/src/apps/WEBConfig.ts => framework/src/decorators/use-guards.decorator.ts} (100%) rename packages/framework/src/decorators/{Argument.ts => use-interceptors.decorator.ts} (100%) rename packages/framework/src/{jobs/base/BaseJob.ts => decorators/use-middlewares.decorator.ts} (100%) create mode 100644 packages/framework/src/discord-client.provider.ts create mode 100644 packages/framework/src/discord-metadata.accessor.ts create mode 100644 packages/framework/src/discord.constants.ts create mode 100644 packages/framework/src/discord.explorer.ts create mode 100644 packages/framework/src/discord.module.ts create mode 100644 packages/framework/src/enums/embed-colors.enum.ts create mode 100644 packages/framework/src/enums/event-type.enum.ts create mode 100644 packages/framework/src/enums/index.ts create mode 100644 packages/framework/src/exceptions/base/discord-exception.base.ts create mode 100644 packages/framework/src/exceptions/discord-guard.exception.ts create mode 100644 packages/framework/src/exceptions/discord-validation.exception.ts create mode 100644 packages/framework/src/exceptions/index.ts create mode 100644 packages/framework/src/helpers/command-context.helper.ts create mode 100644 packages/framework/src/helpers/command-info.helper.ts create mode 100644 packages/framework/src/helpers/command-parameter.helper.ts create mode 100644 packages/framework/src/helpers/index.ts create mode 100644 packages/framework/src/interfaces/command-context.interface.ts create mode 100644 packages/framework/src/interfaces/command-options.interface.ts create mode 100644 packages/framework/src/interfaces/command-parameter.interface.ts create mode 100644 packages/framework/src/interfaces/discord-module-options.interface.ts create mode 100644 packages/framework/src/interfaces/event-options.interface.ts create mode 100644 packages/framework/src/interfaces/index.ts create mode 100644 packages/framework/src/interfaces/translate-func.interface.ts delete mode 100644 packages/framework/src/models/BaseArgument.ts delete mode 100644 packages/framework/src/models/BaseCommand.ts delete mode 100644 packages/framework/src/models/BaseQueueListner.ts delete mode 100644 packages/framework/src/models/ModuleBuilder.ts delete mode 100644 packages/framework/src/models/index.ts create mode 100644 packages/framework/src/readers/base/typereader.base.ts create mode 100644 packages/framework/src/readers/boolean.typereader.ts create mode 100644 packages/framework/src/readers/channel.typereader.ts create mode 100644 packages/framework/src/readers/index.ts create mode 100644 packages/framework/src/readers/member.typereader.ts create mode 100644 packages/framework/src/readers/number.typereader.ts create mode 100644 packages/framework/src/readers/role.typereader.ts create mode 100644 packages/framework/src/readers/string.typereader.ts create mode 100644 packages/framework/src/readers/user.typereader.ts delete mode 100644 packages/framework/src/services/CommandHolderService.ts delete mode 100644 packages/framework/src/services/InternalCommandService.ts delete mode 100644 packages/framework/src/services/base/BaseCommandsService.ts delete mode 100644 packages/framework/src/services/base/index.ts create mode 100644 packages/framework/src/services/command.service.ts create mode 100644 packages/framework/src/services/discord-entity-accessor.service.ts create mode 100644 packages/framework/src/services/message.service.ts delete mode 100644 packages/framework/src/types.ts diff --git a/.commitlintrc.json b/.commitlintrc.json new file mode 100644 index 00000000..be41cebd --- /dev/null +++ b/.commitlintrc.json @@ -0,0 +1,28 @@ +{ + "extends": ["@commitlint/config-angular"], + "rules": { + "subject-case": [ + 2, + "always", + ["sentence-case", "start-case", "pascal-case", "upper-case", "lower-case"] + ], + "type-enum": [ + 2, + "always", + [ + "build", + "chore", + "ci", + "docs", + "feat", + "fix", + "perf", + "refactor", + "revert", + "style", + "test", + "sample" + ] + ] + } +} diff --git a/.docker/docker-compose.yml b/.docker/docker-compose.yml index 464954bf..7996ad76 100644 --- a/.docker/docker-compose.yml +++ b/.docker/docker-compose.yml @@ -1,4 +1,4 @@ -version: '3.7' +version: "3.7" services: nginx: image: nginx:1.21.0-alpine diff --git a/.dockerignore b/.dockerignore index 792bd1c6..d4196008 100644 --- a/.dockerignore +++ b/.dockerignore @@ -4,9 +4,10 @@ .github +.vscode + node_modules scripts test - diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..c4b7c77f --- /dev/null +++ b/.editorconfig @@ -0,0 +1,18 @@ +# editorconfig.org +root = true + +[*] +end_of_line = lf +indent_style = tab +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +indent_size = 4 + +[*.{yaml,yml}] +indent_style = space +indent_size = 2 + +[*.md] +indent_style = space +trim_trailing_whitespace = false diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 00000000..0979a6c0 --- /dev/null +++ b/.eslintignore @@ -0,0 +1 @@ +**/node_modules/** diff --git a/.eslintrc.js b/.eslintrc.js index dbd3c588..6e46d654 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,97 +1,116 @@ -/* eslint-disable */ module.exports = { root: true, env: { - node: true + node: true, + jest: true }, extends: [ - "airbnb-base", - "plugin:import/errors", - "plugin:import/warnings", - "plugin:import/typescript", - "plugin:@typescript-eslint/recommended", - "plugin:prettier/recommended" + 'airbnb-base', + 'plugin:import/errors', + 'plugin:import/warnings', + 'plugin:import/typescript', + 'plugin:@typescript-eslint/recommended', + 'plugin:prettier/recommended', + 'prettier' ], - parser: "@typescript-eslint/parser", + parser: '@typescript-eslint/parser', parserOptions: { project: ['./typescript/tsconfig.eslint.json'], - sourceType: "module", + sourceType: 'module', tsconfigRootDir: __dirname }, globals: { - Atomics: "readonly", - SharedArrayBuffer: "readonly" + Atomics: 'readonly', + SharedArrayBuffer: 'readonly' }, - plugins: [ - "import", - "@typescript-eslint", - "prettier" - ], + plugins: ['import', '@typescript-eslint', '@typescript-eslint/eslint-plugin', 'prettier'], rules: { - "@typescript-eslint/no-non-null-assertion": "off", - "@typescript-eslint/naming-convention": [ - "error", + '@typescript-eslint/no-non-null-assertion': 'off', + '@typescript-eslint/naming-convention': [ + 'error', + { + selector: 'interface', + format: ['PascalCase'], + prefix: ['I'] + } + ], + '@typescript-eslint/ban-ts-comment': [ + 'error', + { + 'ts-ignore': false + } + ], + '@typescript-eslint/ban-types': ['off'], + '@typescript-eslint/indent': ['error', 'tab'], + '@typescript-eslint/semi': ['error'], + '@typescript-eslint/consistent-type-imports': ['warn'], + '@typescript-eslint/no-inferrable-types': [ + 'error', + { + ignoreParameters: true + } + ], + 'import/extensions': [ + 'error', + 'ignorePackages', { - "selector": "interface", - "format": ["PascalCase"], - "prefix": ["I"] + js: 'never', + ts: 'never' } ], - "@typescript-eslint/ban-ts-comment": ["error", { - "ts-ignore": false - }], - "@typescript-eslint/ban-types": ["off"], - "@typescript-eslint/indent": ["error", "tab"], - "@typescript-eslint/semi": ["error"], - "@typescript-eslint/consistent-type-imports": ["warn"], - "import/extensions": ["error", "ignorePackages", { - "js": "never", - "ts": "never" - }], - "import/prefer-default-export": "off", - "import/no-extraneous-dependencies": ["off"], - "import/no-cycle": ["off"], - "no-restricted-syntax": ["error", "WithStatement"], - "class-methods-use-this": "off", - "linebreak-style": ["error", "unix"], - "comma-dangle": ["error", "never"], - "no-param-reassign": ["error", { - "props": false - }], - "no-dupe-class-members": "off", - "no-await-in-loop": "off", - "arrow-parens": "off", - "no-continue": "off", - "no-tabs": ["error", { - "allowIndentationTabs": true - }], - "indent": "off", - "eol-last": ["off"], - "max-len": ["error", { "code": 150 }], - "no-shadow": "off", - "function-paren-newline": "off", - "consistent-return": "off", - "no-useless-return": "off", - "no-useless-constructor": "off", - "prettier/prettier": ["error", { - "parser": "typescript", - "trailingComma": "none", - "printWidth": 120, - "useTabs": true, - "tabWidth": 2, - "bracketSpacing": true, - "singleQuote": true, - "semi": true, - "arrowParens": "avoid", - "endOfLine": "auto" - }] + 'import/prefer-default-export': 'off', + 'import/no-extraneous-dependencies': 'off', + 'import/no-cycle': ['off'], + 'no-restricted-syntax': ['error', 'WithStatement'], + 'class-methods-use-this': 'off', + 'linebreak-style': ['error', 'unix'], + 'comma-dangle': ['error', 'never'], + 'no-param-reassign': [ + 'error', + { + props: false + } + ], + 'no-dupe-class-members': 'off', + 'no-await-in-loop': 'off', + 'arrow-parens': 'off', + 'no-continue': 'off', + 'no-tabs': [ + 'error', + { + allowIndentationTabs: true + } + ], + indent: 'off', + 'eol-last': ['off'], + 'max-len': ['error', { code: 150 }], + 'no-shadow': 'off', + 'function-paren-newline': 'off', + 'consistent-return': 'off', + 'no-useless-return': 'off', + 'no-useless-constructor': 'off', + 'prettier/prettier': [ + 'error', + { + parser: 'typescript', + trailingComma: 'none', + printWidth: 120, + useTabs: true, + tabWidth: 2, + bracketSpacing: true, + singleQuote: true, + semi: true, + arrowParens: 'avoid', + endOfLine: 'auto' + } + ] }, overrides: [ { - files: ["{apps,packages}/*/test/**/*.test.ts"], + files: ['{apps,packages}/*/test/**/*.test.ts'], env: { jest: true } } ] -} +}; diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..65be1805 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,3 @@ +yarn.lock -diff -merge +yarn.lock linguist-generated=true +* text eol=lf diff --git a/.github/husky/commit-msg b/.github/husky/commit-msg new file mode 100644 index 00000000..90d2db91 --- /dev/null +++ b/.github/husky/commit-msg @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npx commitlint -c .commitlintrc.json --edit $HUSKY_GIT_PARAMS diff --git a/.github/husky/pre-commit b/.github/husky/pre-commit new file mode 100644 index 00000000..36af2198 --- /dev/null +++ b/.github/husky/pre-commit @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npx lint-staged diff --git a/.github/husky/pre-push b/.github/husky/pre-push index 65053c08..5f2360af 100644 --- a/.github/husky/pre-push +++ b/.github/husky/pre-push @@ -1,4 +1,4 @@ #!/bin/sh . "$(dirname "$0")/_/husky.sh" -yarn run test \ No newline at end of file +yarn run test diff --git a/.github/semantic.yml b/.github/semantic.yml deleted file mode 100644 index 40b69276..00000000 --- a/.github/semantic.yml +++ /dev/null @@ -1,5 +0,0 @@ -# Always validate the PR title AND all the commits -titleAndCommits: true -# Allows use of Merge commits (eg on github: "Merge branch 'master' into feature/ride-unicorns") -# this is only relevant when using commitsOnly: true (or titleAndCommits: true) -allowMergeCommits: true diff --git a/.github/workflows/CI.yml b/.github/workflows/continuous-integration.yml similarity index 77% rename from .github/workflows/CI.yml rename to .github/workflows/continuous-integration.yml index 5adc01ca..0eeacf7a 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/continuous-integration.yml @@ -1,17 +1,18 @@ -name: CI +name: Continuous Integration on: push: branches: - main - release/* + - develop paths-ignore: - - '.dockerignore' - - '.github/**' - - '.vscode/**' - - '.gitignore' - - 'LICENSE' - - '**.md' + - "**.md" + - ".github/**" + - ".vscode/**" + - .dockerignore + - .gitignore + - LICENSE pull_request: branches: - main @@ -57,6 +58,11 @@ jobs: run: | yarn yarn build - yarn test + yarn test --coverage env: CI: true + + - name: Coveralls + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/sentry-deployment.yml b/.github/workflows/sentry-deployment.yml new file mode 100644 index 00000000..1e4bfce4 --- /dev/null +++ b/.github/workflows/sentry-deployment.yml @@ -0,0 +1,23 @@ +name: Sentry Deployment + +on: + push: + branches: + - main + +jobs: + sentryDeploy: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Create a Sentry release + uses: getsentry/action-release@v1 + env: + SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} + SENTRY_ORG: ${{ secrets.SENTRY_ORG }} + SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} + with: + tagName: ${{ github.sha }} + environment: production diff --git a/.gitignore b/.gitignore index 3233cd1f..03ad5ed8 100644 --- a/.gitignore +++ b/.gitignore @@ -9,15 +9,14 @@ yarn-debug.log* yarn-error.log* lerna-debug.log* +# Tests +/coverage # Runtime data pids *.pid *.seed *.pid.lock -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - # Coverage directory used by tools like istanbul coverage @@ -26,6 +25,8 @@ report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json # Dependency directories node_modules/ +apps/*/node_modules/ +packages/*/node_modules/ jspm_packages/ .github/husky/_ @@ -44,10 +45,6 @@ jspm_packages/ # Yarn Integrity file .yarn-integrity -# dotenv environment variables file -.env -*.env - # TypeScript cache *.tsbuildinfo @@ -61,3 +58,12 @@ sw.* apps/*/lib packages/*/lib .nuxt + +# IDEs and editors +.project +.classpath +.c9/ +*.launch +.settings/ +*.sublime-workspace + diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 00000000..b58b603f --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,5 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/.idea/Miko.iml b/.idea/Miko.iml new file mode 100644 index 00000000..9953237a --- /dev/null +++ b/.idea/Miko.iml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 00000000..59947d94 --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,65 @@ + + + + \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 00000000..79ee123c --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/discord.xml b/.idea/discord.xml new file mode 100644 index 00000000..cd711a0e --- /dev/null +++ b/.idea/discord.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 00000000..ba54d02c --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,24 @@ + + + + \ No newline at end of file diff --git a/.idea/jsLinters/eslint.xml b/.idea/jsLinters/eslint.xml new file mode 100644 index 00000000..88b7ee8f --- /dev/null +++ b/.idea/jsLinters/eslint.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/.idea/kubernetes-settings.xml b/.idea/kubernetes-settings.xml new file mode 100644 index 00000000..c6f754aa --- /dev/null +++ b/.idea/kubernetes-settings.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 00000000..a39490e9 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 00000000..d926d452 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/_BOT__Start.xml b/.idea/runConfigurations/_BOT__Start.xml new file mode 100644 index 00000000..2bf6edeb --- /dev/null +++ b/.idea/runConfigurations/_BOT__Start.xml @@ -0,0 +1,16 @@ + + + + + + - diff --git a/apps/web/app/pages/commands.vue b/apps/web/app/pages/commands.vue index ec9a1a46..53a39b48 100644 --- a/apps/web/app/pages/commands.vue +++ b/apps/web/app/pages/commands.vue @@ -1,7 +1,7 @@