Releases: yosua-kristianto/typescript-expressjs
beta-release-2.1.0
Alpha-2.1.0
This release notes contains update regarding the stability of 2.1.0. This version has been tested, and I'm personally pretty much happy with the result. I've received tons of feedback since the first alpha release, and finally releasing the 2.1.0 as current stable version.
What's new?
1. Multiple databases connection
Single database connection support within the previous version, leads users to configure the core database slave file directly. This update make database connection support easier by adding dynamic database connection within /src/main/config/Config.ts
file below database
section.
2. Knex ORM support
There is a feedback to add Knex ORM support for the database connection instead of Sequelize. In the Config.ts
file, under the database
option, notice there is an "orm_driver"
option within. You can place it either "sequelize"
or "knex"
now.
3. Added Sequelize CLI migration
I removed the ability to do auto DDL engine for Sequelize, and changing it to Sequelize CLI migration system.
Please find the documentation in this link.
4. Added Swagger support
I've added Swagger support within the framework.
5. Major project structure changes
Notice that the folder structure has been changed into more modular approach instead of previously Controller. Now the controller handles routing, and the business logic must be handled within handler. This fixing the route file optimization, so instead of registering all links in the single file, the routes management file now only handle the registration of the controller.
6. Fastify engine
I've added Fastify engine. You can see the configuration within the /src/main/Index.ts
file.
Footnote
I'm planning to separate the core logic from the framework. Until that happen, feel free to give me some feedback regarding the optimization, or maybe some bug reports that I may not anticipated with.
Thank you
alpha-release-1.2
Release 1.2
I make this release note based on my own perspective on using this boilerplate code.
This release focus on behavioral and standards that are built in this code.
What's fixed?
1. File NamingConvention
I'm having a hard time coding Express JS Typescript when using the kebab-case
naming convention in every single IDE.
Many trials and errors are done for keeping these kebab-case
naming conventions, but I saw that my IDE(s) just not getting along well with this.
-
JetBrains Webstorm
This IDE can adapt withkebab-case
. The auto-import work, and IntelliSense work. Unfortunately, since custom snippet code use Apache Velocity, and I'm still learning it, kind of getting a hard time on working with it when forcingkebab-case
naming convention. -
Visual Studio Code
In my opinion, I can fastly adapt thekebab-case
naming convention with this IDE.
For the snippet code, I'm using Snippet by Devon Ray.
The auto-import working well with this IDE too. -
Visual Studio
When using this IDE, I've ended up getting bugs when using auto-import. In many cases, the imported variable naming turns intokebab-case
instead of parsed intocamelCase
orPascalCase
.
2. Eliminating Possible Try-Catch Hell in Controller
When working on a project using this boilerplate, I found myself in try-catch hell when dealing with the controller. What I meant with try-catch hell is, every time you code a new REST function, you need try-catch. All these just because you don't wanna deal with Unhandled Promise Rejection exception.
However, this problem was solved by adding the express-async-errors
dependency in index.ts
.
3. Logging Naming Convention
To make the log file more sort-able, I've shifted the log file naming convention to Y-m-d
(was d-m-Y
).
4. Exception Logging
I've added stack trace on Exception Logging. (Feel free to critic and do pull requests on this. I still suck on logging things.)
5. dist
Folder Now Added With .gitignore
in Repository
What's new?
1. Updated How I Modeling Model
2. Arrow Functions Practice
I've updated some functions in Controller and Repository to make 'em shorter with the arrow function.
3. Added Request Validator
Check out ExampleController
or it's docs on how to use Request Validator!
4. ES2020
I've updated the tsconfig
file so the compile target will be ES2020. (I need insight into this. Feel free to giving me insight about the best compile target or critics about this.)
Prerequisites
-
Node JS v14 or higher with npm v6 or higher.
Node JS Link: https://nodejs.org/en/ -
TypeScript 4 or higher
Link: https://www.typescriptlang.org/download
I can see how far from perfect is this boilerplate code. Feel free to give insight, inputs, and critic about this boilerplate code.
Enjoy trying this boilerplate code!