Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat(#132): switching from swc to tsc #135

Merged
merged 1 commit into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .docker/app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ COPY src ./src
# and install dependencies for plugins (because postinstall script doesn't work in docker)
RUN npm ci

COPY .swcrc .
COPY tsconfig.json .

# Build project
Expand Down
56 changes: 0 additions & 56 deletions .swcrc

This file was deleted.

6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
"license": "MIT",
"main": "build/main.js",
"scripts": {
"build": "npm run build:clean && npm run build:compile && npm run build:plugins && npm run type:check",
"build:start": "npm run build && npm run start",
"build:compile": "swc src -d build -D && rimraf build/plugins/**/node_modules/",
"build": "npm run build:clean && npm run build:compile && npm run install:plugins",
"build:clean": "rimraf build/",
"build:plugins": "installoop --rootDir=./build/plugins",
"build:compile": "tsc --project tsconfig.json --skipLibCheck && npm run build:alias",
"build:alias": "tsc-alias -p tsconfig.json",
"build:start": "npm run build && npm run start",
"install:plugins": "installoop --rootDir=./build/plugins",
"type:check": "tsc --pretty --skipLibCheck --noEmit",
"start": "cross-env NODE_ENV=production node build/main.js",
"dev": "cross-env NODE_ENV=development nodemon --exec node -r @swc-node/register src/main.ts",
"dev:start": "cross-env NODE_ENV=production node -r @swc-node/register src/main.ts",
"dev:compile": "swc src -w -d build",
"dev": "cross-env NODE_ENV=development nodemon --exec node --loader ts-node/esm/transpile-only src/main.ts",
"dev:start": "cross-env NODE_ENV=production node --loader ts-node/esm/transpile-only src/main.ts",
"i18n": "typesafe-i18n",
"type:check": "tsc --pretty --skipLibCheck --noEmit",
"migration:create": "npx mikro-orm migration:create",
"migration:up": "npx mikro-orm migration:up",
"migration:down": "npx mikro-orm migration:down",
Expand Down
1 change: 1 addition & 0 deletions src/commands/General/info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { Guard } from "@guards"
import { Stats } from "@services"
import { getColor, getTscordVersion, isValidUrl, timeAgo } from "@utils/functions"

// @ts-ignore - because it is outside the `rootDir` of tsconfig
import packageJson from "../../../package.json"

const links = [
Expand Down
1 change: 1 addition & 0 deletions src/utils/functions/resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
Interaction,
} from "discord.js"

// @ts-ignore - because it is outside the `rootDir` of tsconfig
import packageJson from "../../../package.json"

const resolvers = {
Expand Down
8 changes: 4 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"target": "es2021",
"module": "commonjs",

"outDir": "./build",
"rootDir": ".",
"outDir": "build",
"rootDir": "src",
"strict": true,
"strictPropertyInitialization": false,
"moduleResolution": "node",
Expand Down Expand Up @@ -59,8 +59,8 @@
}
},

"include": ["src", "**/*.ts"],
"exclude": ["build", "node_modules", "tests"],
"include": ["src", "**/*.ts", "src/**/*.json"],
"exclude": ["build", "node_modules", "tests", "mikro-orm.config.ts", "package.json"],
"paths": ["node_modules/*", "src/utils/types/*", "src/plugins/*/utils/types/*"],

"ts-node": {
Expand Down