A simple blockchain implementation used as demo and lab in clean code and testing courses
Clone, fork or use as a template repository for creating your next TypeScript project.
git clone https://github.com/LabsAdemy/blockchain.git
cd blockchain
npm install
While developing, make sure to install the recommended extensions for a better dev experience.
Run npm run test:watch it will run test after each change. Ideal for TDD or testing just in time.
To run your code without having to build it just execute npm run dev
To keep your dependencies up to date use npm run updates and it will check for updates. Then cherry pick what you want to update.
Run npm run test it will run all test once and stops. Default for CI/CD most common environments.
If you want also the coverage report then use npm run test:coverage .
If you want to tag your work as to keep track of your releases, then there is a script for you: npm run release. It will:
- update the version number
- update the change log file.
- push and tag changes
The standard npm start will run de build process before, so you can deploy the source code alone.
This way you can automate the deployment with the former release script.
Here you have a recap of the available scripts
"scripts": {
"start": "node ./dist/main.js",
"test": "jest",
"build": "tsc -p tsconfig.json",
"dev": "ts-node ./src/main.ts",
"test:dev": "jest --watch",
"test:coverage": "jest --coverage",
"ts-node": "ts-node",
"format": "prettier --write \"./**/*.{ts,json}\"",
"lint": "eslint src --ext .ts",
"lint:fix": "npm run lint -- --fix",
"prerelease": "standard-version ",
"release": "git push --follow-tags origin main",
"update": "ncu -u"
}Use GitHub issues for tracking User Stories and developer tasks.
- Use standard-version to produce a changelog file from Conventional Commits
- Installed and configured prettier
Recommended prettier extension
- Installed and configured eslint to work with prettier
Recommended esLint extension
- Installed and configured jest to run specs
- Configured to conform with eslint
- Uses
ts-jestto work natively with TypeScript
Use this snippets
.vscode\ts-snippets.jsonas an inspiration to create yours
Recommendations
- Better Comments
- Debugger for Chrome
- Editor Config
- EsLint
- GitHub Theme
- GitHub Pull Requests and Issues
- Material Icon Theme
- Live Server
- Prettier
See User and WorkSpace configurations at
.vscodefolder as an inspiration for yours See also.vscode\ts-snippets.jsonto use in your TypeScript snippets for easy testing
TOP 10
F1:command listCTRL+P: fileCTRL+T: search codeCTRL+K CTRL+Z: code commentCTRL+K CTRL+U: uncomment codeF12: go to definitionCTRL+Ñ: show hide terminalCTRL+B: show hide navigation barCTRL+K S: save al filesALT+up|dawn: move line