This is a skeleton app for people who want to use TypeScript. A docker-compose file is included for those who want to run it in a container.
You don't have to use the docker-compose file if you're fine with installing NodeJS and NPM locally. Feel free to delete it if that's the case.
- Clone this repository to your pc
- Make sure you have NodeJS installed (preferably the LTS version). This will also install
npm
. - Open a terminal window (command prompt, git bash, powershell)
- Check if NodeJS is installed by typing
node --version
into the terminal. It should print a line with something likev14.15.0
. - Check if NPM is installed by typing
npm --version
into the terminal. It should print a line with something like6.14.0
. - Install the dependencies by running
npm install
from the project directory. - Compile the project by running
npm run build
. If you want to run the build script everytime you make changes automatically, you can usenpm run watch
. To check out how this works, you can open thepackage.json
file and take a look at thescripts
section. - Open the
tsconfig.json
file in this project. - Search the TypeScript documentation and try to explain every line in the json file. Don't understand something? That's fine! Just don't copy stuff for the sake of filling up your answers.
If you're like me and you dislike NodeJS and NPM piling up heaps of folders on your pc, run TypeScript in Docker!
- Install Docker Desktop.
- Open a terminal window (Administrator Powershell on Windows, command prompt will not work).
- Clone this repository.
- Move to this folder inside the terminal.
- Run
docker-compose up
and open a new terminal OR rundocker-compose up -d
which allows you to work in the same terminal. - Follow the steps from Instructions from step 4, but prefix all the commands with
docker-compose exec ts-app
. - Close the docker container by pressing
ctrl
+c
ordocker-compose down
, respectively for step 5