From 10d5bd1f65c001cd2fb2a664ffc160a25c2a95f0 Mon Sep 17 00:00:00 2001 From: Vitor Luiz Cavalcanti Date: Thu, 19 Sep 2024 22:44:20 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20rename=20one=20of=20the=20CIs'?= =?UTF-8?q?=20jobs=20and=20improve=20scripts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workflows/continuous-integrations.yaml | 2 +- run | 31 ++++++++++--------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/.github/workflows/continuous-integrations.yaml b/.github/workflows/continuous-integrations.yaml index 281a10c..144509c 100644 --- a/.github/workflows/continuous-integrations.yaml +++ b/.github/workflows/continuous-integrations.yaml @@ -6,7 +6,7 @@ on: jobs: lint: - name: 'Run ESLint and Prettier' + name: 'Run ESLint, Prettier and TS' runs-on: 'ubuntu-latest' steps: - name: 'Checkout the repository' diff --git a/run b/run index 36542fd..75f89ad 100644 --- a/run +++ b/run @@ -40,6 +40,12 @@ function cleanup() { npm install } +function execute() { + echo -e "▶ executing '$1' script…\n" + bash run $1 | sed 's/^/ /' + echo -e "\n✅ '$1' script was completed!" +} + function doc() { echo -e "🤖 generating documentation with Typedoc…\n" typedoc "./src/index.ts" @@ -55,13 +61,15 @@ function type-check() { tsc --project ./tsconfig.json --noEmit } -function check() { - echo -e "🔎 checking code style with ESLint…\n" +function lint() { + echo -e "🔎 linting code style with ESLint and Prettier…\n" eslint +} - echo -e "▶ executing 'type-check' command…\n" +function check() { + execute lint echo "" - bash run type-check + execute type-check } function autofix() { @@ -75,20 +83,13 @@ function bundle() { } function prepublish-only() { - echo -e "▶ executing 'doc' command…\n" - bash run doc - + execute doc echo "" - echo -e "▶ executing 'check' command…\n" - bash run check - + execute check echo "" - echo -e "▶ executing 'test' command…\n" - bash run test - + execute test echo "" - echo -e "▶ executing 'bundle' command…\n" - bash run bundle + execute bundle } eval "$@"