Skip to content

Commit

Permalink
rework build process
Browse files Browse the repository at this point in the history
  • Loading branch information
EmeraldBlock committed Oct 3, 2021
1 parent 021acab commit ff0c20c
Show file tree
Hide file tree
Showing 14 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This bot is written in [TypeScript](https://www.typescriptlang.org/). It's prett
### DISCLAIMER: While these instructions are relatively generic, I am not guaranteeing that following them will not cause any damage to your computer. *Make sure you understand what you are doing!*
<br>

This bot requires [Node.js](https://nodejs.org/). I'm not sure the specific versions that work, but any 16.X should work fine.
This bot requires [Node.js](https://nodejs.org/). I'm not sure the specific versions that work, but any 16.7+ should work fine.

Make sure you've created an [application](https://discord.com/developers/applications) in the Discord Developer Portal and have added a bot. ([Tutorial](https://discordjs.guide/preparations/setting-up-a-bot-application.html) from the Discord.js Guide)

Expand Down
1 change: 0 additions & 1 deletion package-lock.json

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

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"description": "A Discord bot core.",
"license": "ISC",
"author": "EmeraldBlock",
"main": "./dist/index.js",
"main": "./dist/js/index.js",
"type": "module",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node --experimental-json-modules .",
"dev": "npx nodemon",
"lint": "npx eslint .",
"build": "npx rimraf ./dist/ && npx tsc"
"build": "node ./tools/clear-copy.js && npx tsc"
},
"dependencies": {
"chalk": "^4.1.1",
Expand All @@ -24,7 +24,6 @@
"eslint": "^7.26.0",
"eslint-plugin-jsdoc": "^34.2.0",
"nodemon": "^2.0.7",
"rimraf": "^3.0.2",
"ts-node": "^9.1.1",
"typescript": "^4.2.4"
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 11 additions & 0 deletions tools/clear-copy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import fs from "fs";

import chalk from "chalk";

fs.rmSync("./dist/", { recursive: true, force: true });
fs.mkdirSync("./dist/");
try {
fs.cpSync("./src/assets/", "./dist/assets/", { recursive: true });
} catch {
console.log(`No ${chalk.yellow("assets")} folder found.`);
}
7 changes: 4 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"rootDir": "./src/",
"outDir": "./dist/",
"rootDir": "./src/ts/",
"outDir": "./dist/js/",
"allowJs": true,
"module": "ESNext",
"target": "ESNext",
Expand All @@ -11,5 +11,6 @@
"resolveJsonModule": true,
"sourceMap": true,
"esModuleInterop": true
}
},
"include": ["./src/ts/**/*"]
}

0 comments on commit ff0c20c

Please sign in to comment.