To work on the SDK generator you need to do the following:
- Clone this repo using git, you need to have nodejs installed.
- Run
npm installin the cloned directory. - Run
npm run build:watch. - Run
npm run cli:<browser|node>to build the SDK from env. You might want to check out sdk for the locally built SDK.
During development, the SDK will be generated, bundled and stored in the sdk folder. In production the root folder will be used.
As of v1.9.0 this repository uses conventional commit messages.
The project uses Vitest as its test framework. Tests are colocated with their source files in the src/ directory. Each test file is named <module>.spec.ts and placed next to the module it tests.
# Run all tests once
$ npm run test
# Run tests with coverage report
$ npm run test:coverageTest files should be placed next to the source file they test, within the src/ directory. Each test file should be named <module>.spec.ts.
The path aliases from tsconfig.node.json (e.g. @ts/, @utils/) are available in test files via vitest.config.ts.
Example (src/utils/myModule.spec.ts):
import { describe, expect, it } from 'vitest';
import { myFunction } from '@utils/myModule';
describe('myFunction', () => {
it('should return the expected result', () => {
expect(myFunction('input')).toBe('expected output');
});
});- Switch to master branch
- To make a new version use script
npm run releasein local terminal- For patch
npm run release -- --release-as patch - For minor
npm run release -- --release-as minor - For major
npm run release -- --release-as major
- For patch
- The new tag is generated, CHANGELOG.md updated and changes committed
- Push to master (don't forget to push tag as well, e.g
git push --follow-tags origin master)