Skip to content

Commit

Permalink
refactor: make now prints target commands
Browse files Browse the repository at this point in the history
  • Loading branch information
lquixada committed Apr 23, 2023
1 parent 50a233d commit 5e3d301
Showing 1 changed file with 58 additions and 24 deletions.
82 changes: 58 additions & 24 deletions Makefile
Expand Up @@ -4,10 +4,12 @@ node_modules: package.json
npm install && /usr/bin/touch node_modules

build:
npx rollup -c --bundleConfigAsCjs
@echo ""
@echo "=> make $@"
@npx rollup -c --bundleConfigAsCjs

browser:
./bin/server --exec "npx open-cli http://localhost:8000/test/fetch-api/browser/"
@./bin/server --exec "npx open-cli http://localhost:8000/test/fetch-api/browser/"

commit:
npx cz
Expand All @@ -16,13 +18,17 @@ commitlint: node_modules
npx commitlint --from origin/main --to HEAD --verbose

compile: test/fetch-api/api.spec.ts
npx tsc
@echo ""
@echo "=> make $@"
@npx tsc

cov:
npx nyc report --reporter=text-lcov > .reports/coverage.lcov && npx codecov

lint:
npx standard
@echo ""
@echo "=> make $@"
@npx standard

release:
npx standard-version
Expand All @@ -31,39 +37,67 @@ release-alpha:
npx standard-version --prerelease alpha

secure:
npx snyk test
@echo ""
@echo "=> make $@"
@npx snyk test

test: compile test-fetch test-module

test-fetch: test-fetch-browser test-fetch-whatwg test-fetch-node

test-fetch-browser: build
./test/fetch-api/browser/run.sh

test-fetch-whatwg: build
./test/fetch-api/whatwg/run.sh

test-fetch-node: build
./test/fetch-api/node/run.sh

test-module: test-module-web-cjs test-module-web-esm test-module-node-cjs test-module-node-esm test-module-react-native
test-fetch: \
test-fetch-browser-native \
test-fetch-browser-whatwg \
test-fetch-node-fetch

test-fetch-browser-native: build
@echo ""
@echo "=> make $@"
@./test/fetch-api/browser/run.sh

test-fetch-browser-whatwg: build
@echo ""
@echo "=> make $@"
@./test/fetch-api/whatwg/run.sh

test-fetch-node-fetch: build
@echo ""
@echo "=> make $@"
@./test/fetch-api/node/run.sh

test-module: \
test-module-web-cjs \
test-module-web-esm \
test-module-node-cjs \
test-module-node-esm \
test-module-react-native

test-module-web-cjs: build
./test/module-system/web.cjs/run.sh
@echo ""
@echo "=> make $@"
@./test/module-system/web.cjs/run.sh

test-module-web-esm: build
./test/module-system/web.esm/run.sh
@echo ""
@echo "=> make $@"
@./test/module-system/web.esm/run.sh

test-module-node-cjs: build
./test/module-system/node.cjs/run.sh
@echo ""
@echo "=> make $@"
@./test/module-system/node.cjs/run.sh

test-module-node-esm: build
./test/module-system/node.esm/run.sh
@echo ""
@echo "=> make $@"
@./test/module-system/node.esm/run.sh

test-module-react-native: build
./test/module-system/react-native/run.sh
@echo ""
@echo "=> make $@"
@./test/module-system/react-native/run.sh

typecheck:
npx tsc --lib ES6 --noEmit index.d.ts ./test/fetch-api/api.spec.ts
@echo ""
@echo "=> make $@"
@npx tsc --lib ES6 --noEmit index.d.ts ./test/fetch-api/api.spec.ts

.PHONY: all build deploy lint test test-fetch test-fetch-browser test-fetch-whatwg test-fetch-node test-module test-module-web-cjs test-module-web-esm test-module-node-cjs test-module-node-esm test-module-react-native typecheck
.PHONY: all build deploy lint test test-fetch test-fetch-browser-native test-fetch-browser-whatwg test-fetch-node-fetch test-module test-module-web-cjs test-module-web-esm test-module-node-cjs test-module-node-esm test-module-react-native typecheck

0 comments on commit 5e3d301

Please sign in to comment.