Particular / ServiceControl

Backend for ServiceInsight and ServicePulse
https://docs.particular.net/servicecontrol/
Other
51 stars 47 forks source link

Generate ServiceControl API Typescript type definitions as an npm package #4276

Open cquirosj opened 3 months ago

cquirosj commented 3 months ago

Describe the suggested improvement

Is your improvement related to a problem? Please describe.

ServicePulse has type definitions for ServiceControl API in the /src/frontend/src/resources folder. If ServiceControl API changes its DTOs schema, the corresponding type must also be updated in the ServicePulse codebase.

Describe the suggested solution

Automatically generate a ServiceControlAPI.d.ts file in the ServiceControl build and push it as an NPM package.

Make ServicePulse reference the NPM package with the ServiceControl API typescript types. This will automatically make Dependabot create a PR in the ServicePulse repo to update the NPM package whenever a new version of ServiceContrl API types is released.

Note: When this issue was created, ServicePulse had a series of types that extended the ServiceControl API types with properties used by the UI components. This has to be considered when estimating the effort needed to address the idea this issue proposes.

Describe alternatives you've considered

Do nothing and continue manually maintaining the ServiceControl API types in the ServicePulse repo.

Additional Context

No response

danielmarbach commented 3 months ago

Would something like pactflow also be an option?