Skip to content

Commit

Permalink
chore: 使用未發佈的 ts-node 支援 TS 5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rileychh committed Aug 27, 2023
1 parent 6a34d74 commit 30d99af
Show file tree
Hide file tree
Showing 4 changed files with 380 additions and 381 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@
/dist/
/.env
/compose.yaml
/tsconfig.ts-node.json
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@
[typescript]: https://www.typescriptlang.org/
[prisma]: https://www.prisma.io/

### TS-Node 錯誤臨時解方

使用 `ts-node-dev` 開發工具時因為會遇到 [這個問題][ts-node#2000] 無法執行 `pnpm dev`。繞過這個錯誤的臨時解方是先執行 `pnpm ts-node-workaround` 再執行 `pnpm dev`。記得在修改 `tsconfig.json` 後重新執行這個臨時解方,變更才會生效。

[ts-node#2000]: https://github.com/TypeStrong/ts-node/issues/2000

### 斜線指令

所有斜線指令位於 `src/commands``index.ts``types.ts` 除外)。要增加斜線指令,請在 `src/commands` 新增一個預設匯出 `Command` 型別的檔案。`Command` 型別可以在 `src/commands/types.ts` 找到。
Expand Down
25 changes: 12 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,30 @@
"version": "1.0.0",
"description": "",
"scripts": {
"ts-node-workaround": "tsc --showConfig > tsconfig.ts-node.json",
"start": "prisma migrate deploy && cp .env dist && cd dist && node --require dotenv/config main.js",
"dev": "nodemon --ext js,ts,env --exec ts-node-esm --swc --project tsconfig.ts-node.json --require dotenv/config src/main.ts",
"dev": "nodemon --ext js,ts,env --exec ts-node-esm --swc --require dotenv/config src/main.ts",
"build": "rm -rf dist; tsc",
"type-check": "tsc --noEmit",
"lint": "eslint . --ext .js,.ts",
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
"@prisma/client": "5.0.0",
"discord.js": "^14.12.1",
"discord.js": "^14.13.0",
"dotenv": "^16.3.1",
"prisma": "^5.1.1"
"prisma": "^5.2.0"
},
"devDependencies": {
"@antfu/eslint-config": "^0.40.2",
"@swc/core": "^1.3.74",
"@tsconfig/node-lts": "^18.12.3",
"@antfu/eslint-config": "^0.40.3",
"@swc/core": "^1.3.80",
"@tsconfig/node-lts": "^18.12.4",
"@tsconfig/strictest": "^2.0.1",
"@types/node": "^20.4.7",
"@typescript-eslint/eslint-plugin": "^6.2.1",
"@typescript-eslint/parser": "^6.2.1",
"eslint": "^8.46.0",
"@types/node": "^20.5.6",
"@typescript-eslint/eslint-plugin": "^6.4.1",
"@typescript-eslint/parser": "^6.4.1",
"eslint": "^8.48.0",
"nodemon": "^3.0.1",
"ts-node": "^10.9.1",
"typescript": "^5.1.6"
"ts-node": "github:TypeStrong/ts-node#main",
"typescript": "^5.2.2"
}
}
Loading

0 comments on commit 30d99af

Please sign in to comment.