Project goal is to provide an easy-to-use tool for Angular engineers to check HTTP response schemas at run-time and to identify/handle schema errors.
- io-ts support: relevant sources available in
library/projects/typesafe-http-iotsdirectory - zod support: relevant sources available in
library/projects/typesafe-http-zoddirectory
- Angular CLI (v16+)
- Node.js, according to Angular version
Contributions are welcome! Please follow these high-level steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Commit your changes and push the branch.
- Submit a pull request.
- Create directory for major version in
./versiondirectory. Name must followngXXscheme whereXXis major version number of Angular. E.g. for supporting Angular 20, it'd beng20. - Add
./version/ngXX/package.root.json. File must contain all version specific part of final, distributablepackage.json. It must containdependenciesanddevDependenciessections with all Angular packages ususally added to a new Angular project. - Add
./version/ngXX/package.library.iots.jsonand./version/ngXX/package.library.zod.jsonfiles to this directory. Files must contain onlypeerDependenciessection with@angular/coreand@angular/commonpackage. Version definitions of both packages must follow>=XX.0.0 <YY.0.0pattern, whereXXis the current andYYis the next Angular version. E.g.>=20.0.0 <21.0.0. - Add relevant
prepws:ngXXscript to repository's./package.json - Update package version to next major version, both in
./package.jsonand./projects/typesafe-http-XXXXX/packege.base.json. Version numbers in these files must be kept in sync.
NOTE that version support removal must be applied to oldest version only and only 1 version is allowed to be removed in one shot!
- Remove relevant
prepws:ngXXscript from repository'spackage.json - Remove
ngXXdirectory and its content from./versionsdirectory - Update package version to next major version, both in
./package.jsonand./projects/typesafe-http-XXXXX/package.base.json. Version numbers in these files must be kept in sync.
- Apply your changes in library or libraries under
/library/projects/directory npm run lintnpm run test- Follow Manual testing of library for each supported version to discover discrepancies
- Update package version as follows, both in
./package.jsonand./projects/typesafe-http-XXXXX/package.base.json:- to next minor version, when:
- new feature added to all libraries
- new runtime-type-checker library support added
- to next build, when:
- any fix applied on at least one of the libraries
- to next minor version, when:
NOTE that proper Node.js version must be prepared before library build started. Please check table below for reference versions:
| Tagname | Node version |
|---|---|
ng16 |
18.16.1 |
ng17 |
18.16.1 |
ng18 |
18.20.8 |
ng19 |
18.20.8 |
ng20 |
20.19.0 |
Consider using NVM tool to smoothly switch from one version to another.
npm run prepws:nsXX
cd workspace
npm run build:lib
npm run publish:iots -- --tag ngXX
Minimalist sample apps included in repository, see /sample-apps directory.
Here's a full script to manually test library changes across all supported Angular versions:
npm run prepws:ngXX
cd workspace
npm run lint:lib
npm run test
npm run build:lib
rm -rf projects/sample-iots
rm -rf projects/sample-zod
npm run ng -- generate application sample-iots
npm run ng -- generate application sample-zod
rm -rf projects/sample-iots/src
rm -rf projects/sample-zod/src
cp -R ../sample-apps/iots/ projects/sample-iots
cp -R ../sample-apps/zod/ projects/sample-zod
npm run ng -- serve sample-iots
ctrl-c
npm run ng -- serve sample-zod
ctrl-c
cd ..Run this script above on all available versions.
No NPM publish recommended until all versions are checked and work as expected!
This project is licensed under the MIT License. See the LICENSE.md file for details.
For questions or support, please contact peppierre@gmail.com.