@chustasoft/cs-releasy-connector

JS connector library for ChustaSoft Releasy backend project, providing easy access to REST features


Keywords
chustasoft, releasy, changelog, changelog.md, release notes, release manager, versioning
License
GPL-3.0
Install
npm install @chustasoft/cs-releasy-connector@1.0.0

Documentation

Releasy

GitHub

Package Pipeline NuGet version Downloads
ChustaSoft.Releasy Build Status Nuget (with prereleases) Nuget
ChustaSoft.Releasy.FileParser Build Status Nuget (with prereleases) Nuget
ChustaSoft.Releasy.AspNet Build Status Nuget (with prereleases) Nuget
cs-releasy-connector Build Status npm npm

Description

Releasy is a tool for managing Release and versioning information for .Net Core applications.

It provides an abstract mechanims for retrieving information about Releases such as Version, Notes and Release Date

Target support:

  • .NET 6.0 onwards

Implementations:

  • File parsing (ChustaSoft.Releasy.FileParser)

    • Uses an internal changelog.md file (or specify another file name with same format) for manage Release information.
    • Implementation based on format documented by Keep a Changelog.
    • Allows easily to keep a changelog documented, independently from technical or functional members.
    • This mechanism allow the project to use the same changelog to be used as reference information inside the project, avoiding duplicity of information.
  • More new implementations would be welcome (SQL? Mongo? External provider?)

Getting started:

  1. Install the NuGet package for the required implementation, for example ChustaSoft.Releasy.FileParser

    • Install-Package ChustaSoft.Releasy.FileParser
  2. Place and manage a changelog.md file inside the solution, and mark the resource as "Copy always" inside VS Solution

    • Format reference here
  3. Configuration at startup

    • services.AddReleasy().FromFile(); By default, it will look for a changelog.md file placed in the same solution, if another name is required, could be added in the same extension method:
    • services.AddReleasy().FromFile("otherfilename.md");

4.1 Using Services:

  1. Inject IReleaseService contract where is required, it provides the following methods:
    • Task Get(string identifier);
    • Task<IEnumerable> GetAll();
    • Task<IEnumerable> GetFrom(DateTime dateFrom);
    • Task<IEnumerable> GetFrom(string identifierFrom);

4.2 Using AspNet package

  1. Install the AspNet package:

    • Install-Package ChustaSoft.Releasy.AspNet
  2. Once done, a REST controller will be added to the project giving the same functionalities described for the Service, using the same configured authentication in the project, with the following routes:

    • /api/Release: Provide all release versioning entries
    • /api/Release/{identifier}: Provide information for an speceific release version
    • /api/Release/from-identifier/{identifier}: Given a version, provide all release details about all newer versions
    • ​/api​/Release​/from-date​/{dateFrom}: Provide all the release details from an specific date
  3. Using frontend connector

Releasy provides an npm package that can be used in any front project, written in TypeScript. This connector only requires to implement an abstract services requiring the api endpoint, and the security headers (Perhaps you are using JWT Token, or Basic Authentication). Let's imagine that the project requires JWT:

  1. Install the npm package:

    • npm i @chustasoft/cs-releasy-connector
  2. Extend service, defining the Base Url, and implementing the required Auth Headers

    2.1: Basic Authentication example:

      import { Inject, Injectable } from '@angular/core';
      import { BasicAuthentication, JwtAuthentication } from '@chustasoft/cs-common';
      import { ReleaseInfoService } from '@chustasoft/cs-releasy-connector';
    
      @Injectable({
      	providedIn: 'root'
      })
      export class ReleaseService extends ReleaseInfoService {
    
      	getAuthentication(): JwtAuthentication | BasicAuthentication {
      		return new BasicAuthentication("username", "user-password");
      	}
    
      	constructor(@Inject('BASE_URL') baseUrl: string)
      	{
      		super(baseUrl + 'api');
      	}
      }

    2.2: JWT Authentication example:

      import { Inject, Injectable } from '@angular/core';
      import { BasicAuthentication, JwtAuthentication } from '@chustasoft/cs-common';
      import { ReleaseInfoService } from '@chustasoft/cs-releasy-connector';
    
      @Injectable({
      	providedIn: 'root'
      })
      export class ReleaseService extends ReleaseInfoService {
    
      	getAuthentication(): JwtAuthentication | BasicAuthentication {
      		return new JwtAuthentication("encrypted-token");
      	}
    
      	constructor(@Inject('BASE_URL') baseUrl: string)
      	{
      		super(baseUrl + 'api');
      	}
      }

Examples and testing

  • Do you still need an example? Here you can find it.
  • Swagger or Postman is recommended in development process, in order to facilitate seeing results, but not mandatory.

Thanks for using and contributing

Twitter Follow