README
Doppler Feature Toggle JavaScript Client
JavaScript client of our simple feature toggle system based on a JSON file over HTTP.
I am doing this project as part of Making Sense's Self Training Program.
The objective of this training is refreshing my knowledge on several technologies (TypeScript, Node, ES Modules) but mainly in the way to work with them to create a library (builds, tests, versions, continuous integration, packages, CDN).
See more details in CAP-215.
Usage
Nothing useful to use yet.
Development
Yarn scripts
yarn run test
: Run test suiteyarn run test:watch
: Run test suite in interactive watch modeyarn run test:prod
: Run tests, code format validator, lint analysis and generate coverageyarn run build
: Generate bundles and typings, create docsyarn run start
: Run build in watch modeyarn run lint
: Run lint analysis with TSLintyarn run prettier
: Run Prettier code formatter
Using with Docker
sh ./build-w-docker.sh
: Executeyarn run test:prod
into a Docker Node container.
Architecture and other decisions
It is based on TypeScript library starter, but in place of using it as it is, the project has been created from the scratch and taking different decisions.
TypeScript library starter resources
- Write a library using TypeScript library starter by @alexjoverm
- 📺 Create a TypeScript Library using typescript-library-starter by @alexjoverm
- Introducing TypeScript Library Starter Lite by @tonysneed
Other resources
- https://github.com/tonysneed/typescript-library-starter-lite
- https://github.com/Hotell/typescript-lib-starter
- https://www.tsmean.com/articles/how-to-write-a-typescript-library/
- https://github.com/bersling/typescript-library-starter
- https://github.com/ospatil/generator-node-typescript
- https://github.com/bitjson/typescript-starter
- https://codeburst.io/https-chidume-nnamdi-com-npm-module-in-typescript-12b3b22f0724
Thanks to @joaquinicolas and @matiasbeckerle for sharing some of these links with me.
Yarn vs NPM
TypeScript library starter was using NPM. It is more advanced than the last version that I used before. For example it has a lock file like Yarn.
But some experiments gave me some issues in Travis running npm ci, so I prefer trying with Yarn.
Commit messages
I will use Angular's Commit Message Guidelines in order to generate release notes automatically using semantic release.
I like using rebase and merge, without squashing commits, I am not sure if it will work fine with semantic release, let's try.
Thanks to @stirelli for helping me with it.
Bundles and distribution
TypeScript library starter has building UMD and ES5 bundles out of the box, but I also want to use my library by linking the script file from a CDN source and Rollup is ready for that.
I have configured it using the convention described by Axel Rauschmayer