Skip to content

Commit

Permalink
feat: Command option decorator unnecessary, mark as deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
fjodor-rybakov committed Jan 30, 2023
1 parent 5557097 commit 0b248f1
Show file tree
Hide file tree
Showing 17 changed files with 1,232 additions and 1,234 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Check your intent is passed to the `discordClientOptions` of the module. [More i
<summary>Click to expand</summary>

Set `useDefineForClassFields` to `true` in your `tsconfig.json`.
Also check that the `@CommandOptions` and `@InteractionEvent` decorators are set.
Also check that the `@InteractionEvent` decorators are set.

</details>

Expand Down
88 changes: 44 additions & 44 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
{
"name": "discord-nestjs",
"private": true,
"workspaces": [
"packages/*",
"packages/sample/*"
],
"repository": {
"type": "git",
"url": "https://github.com/fjodor-rybakov/discord-nestjs"
},
"homepage": "https://github.com/fjodor-rybakov/discord-nestjs#readme",
"scripts": {
"bootstrap": "lerna bootstrap",
"clean": "lerna clean",
"build": "lerna run build --no-private",
"format": "prettier --write \"packages/**/*.ts\" --ignore-path .gitignore",
"prepublish:release": "npm run build",
"postinstall": "npm run build",
"publish:release": "lerna publish -m \"chore: Publish release\" --no-private --conventional-commits --create-release github",
"publish:beta": "lerna publish --canary --preid beta -m \"chore: Publish beta release\" --no-private",
"lint": "eslint \"packages/{common,core}/src/**/*.ts\" --fix",
"prepare": "husky install",
"check-updates": "npx npm-check-updates --deep",
"update": "npx npm-check-updates --deep -u"
},
"devDependencies": {
"@trivago/prettier-plugin-sort-imports": "4.0.0",
"@typescript-eslint/eslint-plugin": "5.49.0",
"@typescript-eslint/parser": "5.49.0",
"eslint": "8.33.0",
"eslint-config-prettier": "8.6.0",
"eslint-plugin-prettier": "4.2.1",
"husky": "8.0.3",
"lerna": "6.4.1",
"lint-staged": "13.1.0",
"prettier": "2.8.3"
},
"lint-staged": {
"*.ts": [
"prettier --write"
]
}
}
{
"name": "discord-nestjs",
"private": true,
"workspaces": [
"packages/*",
"packages/sample/*"
],
"repository": {
"type": "git",
"url": "https://github.com/fjodor-rybakov/discord-nestjs"
},
"homepage": "https://github.com/fjodor-rybakov/discord-nestjs#readme",
"scripts": {
"bootstrap": "lerna bootstrap",
"clean": "lerna clean",
"build": "lerna run build --no-private",
"format": "prettier --write \"packages/**/*.ts\" --ignore-path .gitignore",
"prepublish:release": "npm run build",
"postinstall": "npm run build",
"publish:release": "lerna publish -m \"chore: Publish release\" --no-private --conventional-commits --create-release github",
"publish:beta": "lerna publish --canary --preid beta -m \"chore: Publish beta release\" --no-private",
"lint": "eslint \"packages/{common,core}/src/**/*.ts\" --fix",
"prepare": "husky install",
"check-updates": "npx npm-check-updates --deep",
"update": "npx npm-check-updates --deep -u"
},
"devDependencies": {
"@trivago/prettier-plugin-sort-imports": "4.0.0",
"@typescript-eslint/eslint-plugin": "5.49.0",
"@typescript-eslint/parser": "5.49.0",
"eslint": "8.33.0",
"eslint-config-prettier": "8.6.0",
"eslint-plugin-prettier": "4.2.1",
"husky": "8.0.3",
"lerna": "6.4.1",
"lint-staged": "13.1.0",
"prettier": "2.8.3"
},
"lint-staged": {
"*.ts": [
"prettier --write"
]
}
}
7 changes: 2 additions & 5 deletions packages/common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ For prefix command use `PrefixCommandPipe`.
/* registration-email.dto.ts */

import {City} from '../definitions/city';
import {Param, ParamType, Choice, CommandOptions} from '@discord-nestjs/core';
import {Param, ParamType, Choice} from '@discord-nestjs/core';

@CommandOptions()
export class RegistrationEmailDto {
@Param({
name: 'email',
Expand Down Expand Up @@ -85,10 +84,9 @@ Also, suitable for prefix commands.
```typescript
/* registration-email.dto.ts */

import {CommandOptions, Param, ParamType} from '@discord-nestjs/core';
import {Param, ParamType} from '@discord-nestjs/core';
import {IsEmail, Length, Max, Min} from 'class-validator';

@CommandOptions()
export class RegistrationEmailDto {
@IsEmail()
@Param({
Expand Down Expand Up @@ -166,7 +164,6 @@ class ResidencePlace {
import { DiscordIntersectionType } from '@discord-nestjs/common';

// Must have properties name, city and street
@CommandOptions()
class Profile extends DiscordIntersectionType(FullName, ResidencePlace) {
}
```
Loading

0 comments on commit 0b248f1

Please sign in to comment.