kii-gateway-agent for node modules written in TypeScript.
DX & minimizing tech-debt
This package take an opinioned view on the Developer-Experience with an eye towards minimizing tech-debt. There are two operations that will be part of a developer experience:
npm build: cleans, lints, builds and tests with coverage metrics.
npm build:dist: generates distribution artifacts
The process is meant to serve as an early-warning mechanism to catch issues that will cause potentially expensive mishaps or re-work later in the project life-cycle.
Since "lean"-ness is a primary goal, npm is used as a build tool.
The run-scripts used: aside: To help with these, we recommend npm-completion?
src directory structure of a typical project:
├── KiiHelper │ ├── KiiBase.ts │ ├── KiiHelper.ts │ ├── KiiMqttHelper.ts │ └── index.ts ├── model │ ├── App.ts │ ├── EndNode.ts │ ├── Gateway.ts │ ├── User.ts │ └── index.ts ├── mqtt │ ├── mqttws31.d.ts │ └── mqttws31.js ├── index.ts └── test.ts
├── coverage ├── dist └── build
Why are there two tsconfig*.json files?
TypeScript compiler configuration, tsconfig.json does not support multiple build targets. To create separate builds then, one has to use multiple config files and invoke atleast one of them explicitly like we do.
Further, our opinioned preferences is to keep source and associated tests together in the source tree. This requires to compile time configurations - a regular build that includes
Bugs, PRs, comments, suggestions welcomed!