From eb609001ee5f6329df7266a0bdcd29fc69a913ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Quixada=CC=81?= Date: Sun, 23 Apr 2023 16:03:09 -0400 Subject: [PATCH] refactor: make now prints target commands --- Makefile | 82 ++++++++++++++++++++++++++++++++++++++---------------- bin/server | 2 +- 2 files changed, 59 insertions(+), 25 deletions(-) diff --git a/Makefile b/Makefile index 08d6d3c..01a81b4 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ -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 @@ -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 diff --git a/bin/server b/bin/server index 37dccb9..29e5de3 100755 --- a/bin/server +++ b/bin/server @@ -56,7 +56,7 @@ const port = 8000 const { argv } = yargs(process.argv.slice(2)) const server = app.listen(port, hostname, () => { - console.log(`Test server listening at http://localhost:${port}`) + console.log(`=> Test server listening at http://localhost:${port}`) if (argv.exec) { const args = processFileUrl(argv.exec.split(' '))