|
| 1 | +# node-typescript-boilerplate |
| 2 | + |
| 3 | +[![TypeScript version][ts-badge]][typescript-4-3] |
| 4 | +[![Node.js version][nodejs-badge]][nodejs] |
| 5 | + |
| 6 | +👩🏻💻 Developer Ready: A comprehensive template for Typescript Express.Js projects. |
| 7 | + |
| 8 | +🏃🏽 Instant Value: All basic tools included and configured: |
| 9 | + |
| 10 | +- [TypeScript][typescript] [4.3][typescript-4-3] |
| 11 | +- [ESLint][eslint] with some initial rules recommendation |
| 12 | +- [Jest][jest] for fast unit testing and code coverage |
| 13 | +- Type definitions for Node.js and Jest |
| 14 | +- [Prettier][prettier] to enforce consistent code style |
| 15 | +- NPM [scripts](#available-scripts) for common operations |
| 16 | +- Simple example of TypeScript code and unit test |
| 17 | +- .editorconfig for consistent file format |
| 18 | + |
| 19 | +## Getting Started |
| 20 | + |
| 21 | +This project is intended to be used with the latest Active LTS release of [Node.js][nodejs]. |
| 22 | + |
| 23 | +### Using NPM |
| 24 | + |
| 25 | +This package is used to generate Typescript project, so I recommend to install it **globally**. Then run command to create new project whenever we want |
| 26 | + |
| 27 | +``` |
| 28 | +npm install -g typescript-maker |
| 29 | +
|
| 30 | +# Generate new project |
| 31 | +
|
| 32 | +typescript-maker init my-project |
| 33 | +``` |
| 34 | + |
| 35 | +### Available options |
| 36 | +``` |
| 37 | +- ioc : setup IOC container using [inversify](https://www.npmjs.com/package/inversify) (default: normal express) |
| 38 | +- p --pipeline <pipeline tool>: setup pipeline template (default: CircleCI) |
| 39 | +``` |
| 40 | + |
| 41 | +### Create pipeline template |
| 42 | +``` |
| 43 | +# currently it just supports 'circleci' or 'github' |
| 44 | +
|
| 45 | +typescript-maker create-pipeline circleci |
| 46 | +``` |
| 47 | + |
| 48 | +### Use as a repository template |
| 49 | + |
| 50 | +To start, just click the **[Use template][repo-template-action]** link (or the green button). Then, select which pipeline you gonna use by moving that one out of `pipeline` folder and removing `pipeline` folder. Start adding your code in the `src` and unit tests in the `__tests__` directories. |
| 51 | + |
| 52 | +### Clone repository |
| 53 | + |
| 54 | +To clone the repository, use the following commands: |
| 55 | + |
| 56 | +```sh |
| 57 | +git clone https://github.com/Maithanhdanh/express-typescript-biolerplate.git |
| 58 | +cd express-typescript-biolerplate |
| 59 | +npm install |
| 60 | +``` |
| 61 | + |
| 62 | +## Note |
| 63 | + |
| 64 | +- A new decorator `logGroup` is add to version `1.2.3`. |
| 65 | +- It will add called method to logger prefix by **modifying the definition of the class and method** |
| 66 | + |
| 67 | +## Changelog |
| 68 | +[ChangeLog](https://github.com/Maithanhdanh/express-typescript-boilerplate/blob/main/CHANGELOG.md) |
| 69 | + |
| 70 | +[ts-badge]: https://img.shields.io/badge/TypeScript-4.3-blue.svg |
| 71 | +[nodejs-badge]: https://img.shields.io/badge/Node.js->=%2014.16-blue.svg |
| 72 | +[nodejs]: https://nodejs.org/dist/latest-v14.x/docs/api/ |
| 73 | +[typescript]: https://www.typescriptlang.org/ |
| 74 | +[typescript-4-3]: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-3.html |
| 75 | +[jest]: https://facebook.github.io/jest/ |
| 76 | +[eslint]: https://github.com/eslint/eslint |
| 77 | +[prettier]: https://prettier.io |
| 78 | +[repo-template-action]: https://github.com/Maithanhdanh/express-typescript-biolerplate.git |
0 commit comments