mirror of
https://github.com/wharfkit/msigs.git
synced 2026-07-21 16:33:30 +00:00
60 lines
1.8 KiB
Makefile
60 lines
1.8 KiB
Makefile
SRC_FILES := $(shell find src -name '*.ts')
|
|
TEST_FILES := $(wildcard test/*.ts)
|
|
BIN := ./node_modules/.bin
|
|
MOCHA_OPTS := -u tdd -r ts-node/register -r tsconfig-paths/register --extension ts
|
|
|
|
lib: ${SRC_FILES} package.json tsconfig.json node_modules rollup.config.mjs
|
|
@${BIN}/rollup -c && touch lib
|
|
|
|
.PHONY: test
|
|
test: lib node_modules
|
|
@TS_NODE_PROJECT='./test/tsconfig.json' MOCK_DIR='./test/data' \
|
|
${BIN}/mocha ${MOCHA_OPTS} test/*.ts --grep '$(grep)'
|
|
|
|
.PHONY: test-local
|
|
test-local: lib node_modules
|
|
@TS_NODE_PROJECT='./test/tsconfig.json' MOCK_DIR='./test/data' \
|
|
MOCK_SOCKET='../../roborovski/testing/tmp/msigs.sock' MOCK=overwrite \
|
|
${BIN}/mocha ${MOCHA_OPTS} test/*.ts --grep '$(grep)'
|
|
|
|
.PHONY: test-coverage
|
|
test-coverage: lib node_modules
|
|
@TS_NODE_PROJECT='./test/tsconfig.json' MOCK_DIR='./test/data' \
|
|
${BIN}/nyc --reporter=html \
|
|
${BIN}/mocha ${MOCHA_OPTS} -R nyan test/*.ts
|
|
|
|
.PHONY: coverage
|
|
coverage: test-coverage
|
|
@open coverage/index.html
|
|
|
|
.PHONY: ci-test
|
|
ci-test: lib node_modules
|
|
@TS_NODE_PROJECT='./test/tsconfig.json' MOCK_DIR='./test/data' \
|
|
${BIN}/nyc --reporter=text \
|
|
${BIN}/mocha ${MOCHA_OPTS} -R list test/*.ts
|
|
|
|
.PHONY: check
|
|
check: node_modules
|
|
@${BIN}/eslint src --ext .ts --max-warnings 0 --format unix && echo "Ok"
|
|
|
|
.PHONY: format
|
|
format: node_modules
|
|
@${BIN}/eslint src --ext .ts --fix
|
|
|
|
node_modules:
|
|
yarn install --non-interactive --frozen-lockfile --ignore-scripts
|
|
|
|
.PHONY: publish
|
|
publish: | distclean node_modules
|
|
@git diff-index --quiet HEAD || (echo "Uncommitted changes, please commit first" && exit 1)
|
|
@yarn config set version-tag-prefix "" && yarn config set version-git-message "Version %s"
|
|
@yarn publish && git push && git push --tags
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
rm -rf lib/ coverage/
|
|
|
|
.PHONY: distclean
|
|
distclean: clean
|
|
rm -rf node_modules/
|