This is a TypeScript project template for TypeScript development in GDP Labs.
Please note that this is a general template. When you use TypeScript to start a project, you'll most likely use a more specific tech stack:
- For frontend, you'll probably use NextJS or Angular.
- For backend, you'll probably use NextJS, NestJS, or Express.
- For mobile, you'll probably use React Native.
Please apply the concept in this repo appropriately and adjust as necessary.
- Node version 18 or higher.
- Install NVM if you haven't already. NVM will allow you to switch Node version easily.
- There's a list of recommended extension in
.vscode/extensions.json
. Install it by following this documentation.- Open VSCode user settings and add the following settings for psioniq.psi-header extension. This will allow you to insert header comment by executing command
Header Insert
(Cmd+Shift+P then type> Header Insert
):
- Open VSCode user settings and add the following settings for psioniq.psi-header extension. This will allow you to insert header comment by executing command
"psi-header.variables": [
["author", "Your name"],
["authoremail", "Your email"],
["modifyauthor", "Your name"],
["modifyauthoremail", "Your email"]
],
"psi-header.templates": [
{
"language": "*",
"template": [
"<<filename>>",
"DEFAULT DESCRIPTION. EDIT OR DELETE THIS.",
"",
"Authors:",
" <<author>> (<<authoremail>>)",
"Created at: <<filecreated('MMMM Do YYYY')>>",
"-----",
"Last Modified: <<dateformat('MMMM Do YYYY')>>",
"Modified By: <<modifyauthor>> (<<modifyauthoremail>>)",
"-----",
"Reviewers:",
" ",
"---",
"References:",
" NONE",
"---",
"Copyright (c) <<year>> GDP LABS. All rights reserved."
]
}
],
"psi-header.changes-tracking": {
"isActive": true,
"modAuthor": "Modified By: ",
"modDate": "Last Modified: "
},
- Run
npm install
.
This project is meant to be a sample. It's not runnable. When you create a TypeScript project, you'll most likely use a more specific tech-stack/framework (like the ones described in the beginning of this README) and each of them will provide a way to run the project.
- If you use VSCode, the linting and formatting will be done automatically on save.
- If you need to run it programmatically, you can run the following scripts:
npm run prettier
: checking Prettier formatting.npm run prettier-fix
: checking and fix Prettier formatting.npm run lint
: checking lint using ESLint.npm run lint-fix
: checking and fix lint using ESLint.
- Run
npm test
. - If you want to generate coverage report, run
npm run test:coverage
.
Majority of CI/CD pipelines in GDP Labs will trigger CI/CD when there's a new push to the main
branch.
Specific to this sample project, there's no deployment.
These are short descriptions for each folder/file. Majority of individual files also contain header comments. Please check them out before trying to read the code.
Please note that this is a general template. View it as guideline and adjust accordingly to your project's needs.
.vscode
It contains VSCode settings. It's recommended to use VSCode as your IDE.
extensions.json
: contains recommended extensions. Install it by following this documentation.
settings.json
: this will set the VSCode formatter to Prettier and make it format the code on save.
src
Contains the source code for your project
tests
Contains test source code for your project
.eslintignore
Contains files and folders to be ignored by eslint configuration at ``.eslintrc.js`
.eslintrc.js
Contains linting configuration for eslint
.gitignore
Contains files & folders to be ignored by git.
- package-lock.json
Describes the dependency tree generated by installing dependencies in package.json
.
package.json
Various script and dependency list.
README.md
This file.
sonar-project.properties
Contains configuration for SonarQube, a sofware to analyze code quality.
tsconfig.json
TypeScript configuration file.
vitest.config.js
Configuration file for vitest
, a Unit Test library.
If you cannot access any of the references, please contact your manager or team lead.
For generating documentation using typedoc, you can run the following scripts:
npm run generate-docs