Creating the project

We have prepared the base skeleton of this new project for you. You can find it in the code samples folder, under Chapter04/mediaman-v1-initial. Copy that folder and open it in your favorite editor.

Next, install the necessary dependencies using npm install.

If you look at the package.json and index.html files, you'll notice some changes compared to what we did for TodoIt. You don't need to worry about those for now, as we will cover related subjects in later chapters. If you're really curious and/or impatient though, you can take a look at the documentation for Parcel.js (https://parceljs.org), which is the bundler and module loader that we have added to the project and with which we will now build it.

The scripts are mostly the same as before:

We'll keep the same high-level code organization as we did for the last project, that is, a single folder with a single TypeScript file and a single HTML file.

At this point, you might feel that putting everything into a single TypeScript file is far from ideal and you'd be totally right. As a matter of fact, in later chapters, we will learn about modules and other features of TypeScript that will help us to modularize our code.

For now, bear with us as we want to keep our attention on generics and enums.