isp-nestjs-sdk
v0.0.2
Published
SDK containing common NestJS modules for the Home Internet ecosystem
Downloads
2
Readme
ISP NestJS SDK
The ISP NestJS SDK is a centralized repository of common modules for the Home Internet ecosystem. It is published to the NPM registry as a package and then imported into projects as a Node.js dependency via package.json.
Instead of having multiple libraries that need to be updated and import it was discussed and decided that this SDK would be a storehouse for all common NestJS code for ISP projects. Initially, this repo will be focused on supporting the HINT services.
Project inclusion
To include the SDK in your Node.js project, update package.json to have a depencency:
"@tmo-isp/isp-nestjs-sdk":"<version>"
SDK inclusions
Logging
Health
Guards
Interceptors
Error Handling
Initial setup
- Git
- NodeJS (v8.12+)
- NVM or NVM for Windows. n is a good choice as well.
Installation
Clone repo
$ git clone [email protected]:tmobile/isp/libs/isp-nestjs-sdk.git
Navigate to repo
$ cd path/to/cloned/repo
Set NodeJS version
$ nvm install <node version specified>
$ nvm use <node version specified>
Install Yarn
$ npm i -g yarn
Install project dependencies
$ cd path/to/project/root
$ yarn install
Run tests
$ yarn test
Developer Settings
Install the VSCode plugin ESLint by Dirk Baeumer (dbaeumer.vscode-eslint).
Publishing to NPM
After a successful code merge, the NPM registry should be updated with the latest artifact for inclusion into projects. The publish to the registry:
- Obtain an Auth token with
Publish
permissions from the NPM settings page for your account (e.g. https://www.npmjs.com/settings//tokens). - Paste that token into the
.npmrc
file at the root of this project OR create an environment variable namedNPM_TOKEN
with its value. - Up the version in
package.json
. You cannot publish with the same version twice. - Use npm publish to publish to the NPM registry
- Verify the latest package with your version appears here.
At this point, the latest version is available for inclusion into projects.