@basaldev/blocks-order-service
v2.4.2
Published
<p align="center"><img width="200px" src="docs/logo.png" /></p> <h1 align="center" >blocks-order-service</h1> <p align="center">ποΈ</p>
Keywords
Readme
blocks-order-service
Overview
Order service, wrap the business logic of manage orders. Interact with the following Microservices:
- blocks-user-service
- blocks-organization-service
- blocks-catalog-service
Getting started
Make sure global yarn is installed (nvm use && npm install -g yarn)
Open project folder use VSCode
Disable prettier if it cause some error (you can watch in right bottom of your VSCode if any reds, image below). You can use Shift + Command + X and search for it and disable
Open ./.vscode/blocks-order-service.code-workspace file, click the
Open workspacebutton in the right bottom place (also see image below)Open project files and you should be able to see all errors resolved
Some common used commands:
- yarn build
- yarn typecheck
- yarn test
- yarn spell-check
π Project Structure
.
βββ .github
βββ .husky # husky settings - @basaldev/lint-staged-config
βββ .vscode # vscode settings
βββ .yarn # yarn binary, config and project dependencies
βββ coverage * # jest coverage report
βββ dist *
βββ docs
β βββ assets # documentation related assets
β βββ reference # api docs
βββ src
β βββ adapter
β βββ test
β βββ index.ts
βββ .eslintignore
βββ .eslintrc.js # @basaldev/eslint-config
βββ .gitignore
βββ .nvmrc
βββ .pnp.cjs # yarn config
βββ .pnp.loader.mjs # yarn config
βββ .prettierignore
βββ .prettierrc.json # @basaldev/prettier-config
βββ .yarnrc.yml # yarn config
βββ cspell.config.js # @basaldev/cspell-config
βββ .yarnrc.yml # yarn config
βββ jest.config.js # @basaldev/jest-preset
βββ package.json
βββ README.md
βββ tsconfig.json # @basaldev/tsconfig
βββ yarn.lock
* Not tracked by gitπ° Setup
Create a Github Personal Auth Token
- Go toΒ Github Developer Settings > Personal TokensΒ > Generate new token
- Click 'Generate Token'
- Input a name for your token.
- Select
repocheckbox - Select
write:packages - Add to your local environment -
.zshrc.bashrcetc
export BASALDEV_AUTH_TOKEN=__INSERT_YOUR_TOKEN_HERE__Install NVM
Install Yarn (Global)
Yarn must be installed globally for the project's NodeJS version. This should be done so using the command below.
nvm use && npm install -g yarnInstall Husky πΊ
yarn husky installβ οΈ IMPORTANT: Only use the yarn command install or run scripts. Do not use npm run xxx
πͺ Usage
Run typescript compiler
yarn startRun debug server on default port: 9339.
- Requires
yarn startto be running in a separate session - Port should be updated to avoid conflicts with other projects
package.json > scripts > debug
yarn debugRun unit tests
docker compose up
yarn testInstalling packages
yarn add <package> | yarn add <package> -Dβ‘οΈ Special Notes for VSCode Users
π Required Extensions
Please ensure the following extensions are installed:
- arcanis.vscode-zipfs
- dbaeumer.vscode-eslint
- seatonjiang.gitmoji-vscode
- henrynguyen5-vsc.vsc-nvm (optional)
π Workspaces
The kit uses vscode workspaces for vscode project settings:
- All common vscode project settings should be specified in the
.vscode/${project_name}-workspacefile. - Personal user settings should be added to
.vscode/settings.json(gitignored) - β οΈ You must open this project as a workspace in vscode This can be done by clicking the workspace file while in vscode, or by using
File > Open workspace from file.
πͺ TypeScript
When prompted asking which typescript VSCode should use, it's very important that you choose the local project version located at .yarn/sdks/typescript/...
π Prettier
If you have the prettier extension installed, please disable it for this project. ts-kit uses eslint to execute prettier, so having prettier enabled in vscode will cause conflicts and strange behavior.
π€ Format on Save (optional)
Add the following code to your .vscode/settings.json will automatically fix all eslint errors whenever you save a file.
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}π Package Deployment
This library uses github registry to publish private npm package. For detailed instructions see here
π‘ Note: that npm is used for version & publish commands
1. Bump version
npm version ${VERSION}2. Build Package
yarn build3. Publish Package
npm publish --tag=latest | experimentalThen go to github https://github.com/basaldev/backend-sdk/packages to check published packages.
