Project Layout

The HaTs project structure boosts productivity, promotes good habits, and it just works.

File System

Each time you bootstrap a project, the HaTs CLI shallow copies our TypeScript template repo on GitHub. Below is the default architecture generated.

📦project
┣ 📂src
┃ ┣ 📜index.test.ts
┃ ┗ 📜index.ts
┣ 📂tests
┃ ┗ 📜global.tests.ts
┣ 📜.eslintignore
┣ 📜.eslintrc.json
┣ 📜.gitignore
┣ 📜.prettierignore
┣ 📜LICENSE
┣ 📜README.md
┣ 📜package-lock.json
┣ 📜package.json
┣ 📜tsconfig-build.json
┗ 📜tsconfig.json

Customizaton

During the bootstrapping process, the HaTs CLI customizes each file and directory for your project.

Take for example the raw contents of the tsconfig-build.json file from the default HaTs template project:

{
"compilerOptions": {
"rootDir": "HATS_PATHS_TS_BUILD_ROOT_DIR_PATH"
},
"exclude": HATS_PATHS_TS_BUILD_EXLUDE_PATHS,
"extends": "./tsconfig.json"
}

Customizable values in template files are identifiable by the prefix 'HATS_' and written in all caps. The HaTs CLI identifies these placeholders and injects the appropriate values into your project.

Below is what your final tsconfig-build.json file may look like:

{
"compilerOptions": {
"rootDir": "src/"
},
"exclude": ["tests", "src/**/*.test.ts"],
"extends": "./tsconfig.json"
}
Edit this page on GitHub

Happy TypeScript
©2022 👨🏾‍💻 Kamar Mack