Development flows
momocow opened this issue · comments
Scripts
Clean
Clean all files that match src/**/*.d.ts
and src/**/*.js
and the .dist
folder (which contains local builds).
npm run clean
Commit
Following semantic commit message via commitizen
.
npm run commit
Lint
- Coding style: StandardJS
- Linter:
tslint
+tslint-config-standard
npm run lint
Build
Compile all .ts files in place.
Since the main
field in package.json
is configured to be src/index
, either typescript or javascript projects can find their corresponding entry files.
- Compiler:
tsc
npm run build
Webpack
Generate the cq-websocket.min.js
and cq-websocket.kaomojified.js
as the legacy work did. The output directory is dist
on CI servers and .dist
at local.
- Compiler:
webpack
npm run webpack
Release
Run semantic-release
.
This will do actual release if it is master branch and there is any commit that causes version changed.
npm run release
Test
Run tests with AVA with ts-node/register enabled.
For nyc
to correctly report the coverage, in tsconfig.json
inlineSourceMap
is set to true
and source-map-support
is installed.
npm test
Coverage
Coverage will be reported to coveralls.
npm run coverage
Docs
API references are generated using Typedoc with typedoc-plugin-external-module-name under /docs/api
folder.
npm run docs
Update CQHTTP version in comment blocks
Parse all tsdoc comment blocks under src
folder and update CQHTTP version in the CQHTTP document URL according to the minimal version specified by engines.cqhttp
field in package.json
.
gulp docs:update-cqhttp-version