From 6ff685cfa57631e7754005a13e7846d33aab1b3e Mon Sep 17 00:00:00 2001 From: Sine Jespersen Date: Wed, 27 Aug 2025 21:06:03 +0200 Subject: [PATCH 01/10] 5289: taskfile added --- Taskfile.yml | 154 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 154 insertions(+) create mode 100644 Taskfile.yml diff --git a/Taskfile.yml b/Taskfile.yml new file mode 100644 index 00000000..7c34fdaf --- /dev/null +++ b/Taskfile.yml @@ -0,0 +1,154 @@ +version: "3" + +# https://taskfile.dev/usage/#env-files +dotenv: [".env.local", ".env"] + +vars: + # https://taskfile.dev/reference/templating/ + BASE_URL: "{{.TASK_BASE_URL | default .COMPOSE_SERVER_DOMAIN | default .COMPOSE_DOMAIN }}" + DOCKER_COMPOSE: '{{ .TASK_DOCKER_COMPOSE | default "itkdev-docker-compose" }}' + +tasks: + default: + desc: "List all tasks" + cmds: + - task --list-all + silent: true + + compose: + desc: "Run `docker compose` command. Example: task compose -- up --detach." + cmds: + - "{{ .DOCKER_COMPOSE }} {{ .CLI_ARGS }}" + + site-install: + prompt: "This will reset your setup. Continue?" + desc: "Install new os2display" + cmds: + - task compose -- down + - task compose -- pull + - task compose-up + - task composer-install + - task npm-install + - task db:migrate --yes + - task fixtures:load --yes + - task site-open + silent: true + + site-open: + desc: "Opens admin, docs and client." + cmds: + - task site-open:admin + - task site-open:client + - task site-open:docs + silent: true + + site-open:admin: + desc: "Opens admin site." + cmds: + - open http://{{ .BASE_URL }} + + site-open:client: + desc: "Opens client site." + cmds: + - open http://{{ .BASE_URL }}/client + + site-open:docs: + desc: "Opens docs site." + cmds: + - open http://{{ .BASE_URL }}/docs + + npm-install: + desc: "Installs node dependencies with npm." + cmds: + - docker compose run --rm --volume "$PWD:/md" node npm install + + composer: + desc: "Runs `composer` command. Example task composer -- install." + cmds: + - task compose -- exec phpfpm composer {{.CLI_ARGS}} + silent: true + + compose-up: + desc: "Runs docker compose up." + cmds: + - task compose -- up --detach --remove-orphans + silent: true + + composer-install: + desc: "Installs dependencies with composer." + cmds: + - task composer -- install {{.COMPOSER_INSTALL_ARGUMENTS}} {{.CLI_ARGS}} + silent: true + + coding-standards:check: + desc: "Check coding standards" + cmds: + - task coding-standards:assets:check + - task coding-standards:php:check + - task coding-standards:markdown:check + + coding-standards:apply: + desc: "Check coding standards" + cmds: + - task coding-standards:assets:apply + - task coding-standards:php:apply + - task coding-standards:markdown:apply + silent: true + + coding-standards:assets:apply: + desc: Apply coding standards for assets + cmds: + - docker compose run --rm --volume "$PWD:/md" prettier 'assets/**/*.{css,scss}' --write + - docker compose run --rm --volume "$PWD:/md" prettier 'assets/**/*.{js,jsx}' --write + + coding-standards:assets:check: + desc: Apply and check coding standards for assets + cmds: + - task coding-standards:assets:apply + - docker compose run --rm --volume "$PWD:/md" prettier 'assets/**/*.{css,scss}' --check + - docker compose run --rm --volume "$PWD:/md" prettier 'assets/**/*.{js,jsx}' --check + + coding-standards:markdown:apply: + desc: "Apply coding standards for Markdown" + cmds: + - docker compose run --rm --volume "$PWD:/md" markdownlint markdownlint --ignore '**/node_modules/**' --ignore '**/vendor/**' '*.md' 'documentation/*.md' --fix + + coding-standards:markdown:check: + desc: "Apply and check coding standards for Markdown" + cmds: + - task coding-standards:markdown:apply + - docker compose run --rm --volume "$PWD:/md" markdownlint markdownlint --ignore '**/node_modules/**' --ignore '**/vendor/**' '*.md' 'documentation/*.md' + + coding-standards:php:apply: + desc: "Apply coding standards for PHP" + cmds: + - task compose -- exec phpfpm vendor/bin/php-cs-fixer fix --diff + silent: true + + coding-standards:php:check: + desc: "Apply and check coding standards for PHP" + cmds: + - task coding-standards:php:apply + - task compose -- exec phpfpm vendor/bin/php-cs-fixer fix --dry-run --diff + silent: true + + code-analysis: + desc: "Runs code analysis." + cmds: + - task composer -- code-analysis + + fixtures:load: + prompt: "This will reset your content. Continue?" + desc: Apply fixtures + cmds: + - task compose -- exec phpfpm bin/console hautelook:fixtures:load --no-interaction + - task compose-up + silent: true + + db:migrate: + prompt: "This will perform migrations on your db. Continue?" + desc: Run database migrations + cmds: + - task compose -- exec phpfpm bin/console doctrine:migrations:migrate --no-interaction + - task compose-up + silent: true From 1079927f25872644523d3e5b2c8652bf63313ea4 Mon Sep 17 00:00:00 2001 From: Sine Jespersen Date: Wed, 27 Aug 2025 21:20:13 +0200 Subject: [PATCH 02/10] 5289: yaml added to taskfile --- Taskfile.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Taskfile.yml b/Taskfile.yml index 7c34fdaf..d6eb33cb 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -35,7 +35,7 @@ tasks: silent: true site-open: - desc: "Opens admin, docs and client." + desc: "Opens admin, docs and client." cmds: - task site-open:admin - task site-open:client @@ -86,6 +86,7 @@ tasks: - task coding-standards:assets:check - task coding-standards:php:check - task coding-standards:markdown:check + - task coding-standards:yml:check coding-standards:apply: desc: "Check coding standards" @@ -93,8 +94,20 @@ tasks: - task coding-standards:assets:apply - task coding-standards:php:apply - task coding-standards:markdown:apply + - task coding-standards:yml:apply silent: true + coding-standards:yml:apply: + desc: Apply coding standards for yml + cmds: + - docker compose run --rm --volume "$PWD:/md" prettier '**/*.{yml,yaml}' --write + + coding-standards:yml:check: + desc: Apply coding standards for yml + cmds: + - docker compose run --rm --volume "$PWD:/md" prettier '**/*.{yml,yaml}' --write + - docker compose run --rm --volume "$PWD:/md" prettier '**/*.{yml,yaml}' --check + coding-standards:assets:apply: desc: Apply coding standards for assets cmds: From 98d36bc9d1f319b102e25ce7b32f06e8e3f2289b Mon Sep 17 00:00:00 2001 From: Sine Jespersen Date: Wed, 27 Aug 2025 21:20:23 +0200 Subject: [PATCH 03/10] 5289: add code analysis to composer --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index f2eb1e47..a4096142 100644 --- a/composer.json +++ b/composer.json @@ -150,6 +150,7 @@ "update-api-spec": [ "bin/console api:openapi:export --output=public/api-spec-v2.yaml --yaml --no-interaction", "bin/console api:openapi:export --output=public/api-spec-v2.json --no-interaction" - ] + ], + "code-analysis": "vendor/bin/psalm" } } From bb0fff9c91945fac38cda3f39c5554074b51f587 Mon Sep 17 00:00:00 2001 From: Sine Jespersen Date: Wed, 27 Aug 2025 21:20:33 +0200 Subject: [PATCH 04/10] 5289: changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d0afb89c..0c2777af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ All notable changes to this project will be documented in this file. * Removed propTypes. * Upgraded redux-toolkit and how api slices are generated. * Fixed redux-toolkit cache handling. +* Add Taskfile ### NB! Prior to 3.x the project was split into separate repositories From 46e0ad2f62d5c14745606fa621726c4048f49760 Mon Sep 17 00:00:00 2001 From: Sine Jespersen Date: Thu, 28 Aug 2025 08:56:25 +0200 Subject: [PATCH 05/10] 5289: add forgotten site open templates --- Taskfile.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Taskfile.yml b/Taskfile.yml index d6eb33cb..86b1e1cb 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -40,6 +40,7 @@ tasks: - task site-open:admin - task site-open:client - task site-open:docs + - task site-open:templates silent: true site-open:admin: @@ -56,6 +57,11 @@ tasks: desc: "Opens docs site." cmds: - open http://{{ .BASE_URL }}/docs + + site-open:templates: + desc: "Opens templates site." + cmds: + - open http://{{ .BASE_URL }}/template npm-install: desc: "Installs node dependencies with npm." From f2030a290935fdd287789f5a898e95a6e1de19b0 Mon Sep 17 00:00:00 2001 From: Sine Jespersen Date: Thu, 28 Aug 2025 08:59:30 +0200 Subject: [PATCH 06/10] 5289 npm install before up --- Taskfile.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Taskfile.yml b/Taskfile.yml index 86b1e1cb..df16a1c5 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -26,9 +26,9 @@ tasks: cmds: - task compose -- down - task compose -- pull + - task npm-install - task compose-up - task composer-install - - task npm-install - task db:migrate --yes - task fixtures:load --yes - task site-open From f6404853465da8eec95f2a14b68ac4394db91539 Mon Sep 17 00:00:00 2001 From: Sine Jespersen Date: Thu, 28 Aug 2025 08:59:51 +0200 Subject: [PATCH 07/10] 5289: change desc on open api docs --- Taskfile.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Taskfile.yml b/Taskfile.yml index df16a1c5..4a177019 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -54,7 +54,7 @@ tasks: - open http://{{ .BASE_URL }}/client site-open:docs: - desc: "Opens docs site." + desc: "Opens API docs page" cmds: - open http://{{ .BASE_URL }}/docs From e6e74e302f7d0e7b6d00c0b18c37269c63ff73ab Mon Sep 17 00:00:00 2001 From: Sine Jespersen Date: Thu, 28 Aug 2025 09:01:38 +0200 Subject: [PATCH 08/10] 5289 remove check and apply, only check --- Taskfile.yml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/Taskfile.yml b/Taskfile.yml index 4a177019..2e488eea 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -95,7 +95,7 @@ tasks: - task coding-standards:yml:check coding-standards:apply: - desc: "Check coding standards" + desc: "Apply coding standards" cmds: - task coding-standards:assets:apply - task coding-standards:php:apply @@ -109,9 +109,8 @@ tasks: - docker compose run --rm --volume "$PWD:/md" prettier '**/*.{yml,yaml}' --write coding-standards:yml:check: - desc: Apply coding standards for yml + desc: Check coding standards for yml cmds: - - docker compose run --rm --volume "$PWD:/md" prettier '**/*.{yml,yaml}' --write - docker compose run --rm --volume "$PWD:/md" prettier '**/*.{yml,yaml}' --check coding-standards:assets:apply: @@ -121,9 +120,8 @@ tasks: - docker compose run --rm --volume "$PWD:/md" prettier 'assets/**/*.{js,jsx}' --write coding-standards:assets:check: - desc: Apply and check coding standards for assets + desc: Check coding standards for assets cmds: - - task coding-standards:assets:apply - docker compose run --rm --volume "$PWD:/md" prettier 'assets/**/*.{css,scss}' --check - docker compose run --rm --volume "$PWD:/md" prettier 'assets/**/*.{js,jsx}' --check @@ -133,9 +131,8 @@ tasks: - docker compose run --rm --volume "$PWD:/md" markdownlint markdownlint --ignore '**/node_modules/**' --ignore '**/vendor/**' '*.md' 'documentation/*.md' --fix coding-standards:markdown:check: - desc: "Apply and check coding standards for Markdown" + desc: "Check coding standards for Markdown" cmds: - - task coding-standards:markdown:apply - docker compose run --rm --volume "$PWD:/md" markdownlint markdownlint --ignore '**/node_modules/**' --ignore '**/vendor/**' '*.md' 'documentation/*.md' coding-standards:php:apply: @@ -145,9 +142,8 @@ tasks: silent: true coding-standards:php:check: - desc: "Apply and check coding standards for PHP" + desc: "Check coding standards for PHP" cmds: - - task coding-standards:php:apply - task compose -- exec phpfpm vendor/bin/php-cs-fixer fix --dry-run --diff silent: true From 58700d130987f2dee126ee74c3621bb063fbeb2c Mon Sep 17 00:00:00 2001 From: Sine Jespersen Date: Thu, 28 Aug 2025 09:03:39 +0200 Subject: [PATCH 09/10] 5189: remove whitespace --- Taskfile.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Taskfile.yml b/Taskfile.yml index 2e488eea..f0fd1574 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -57,7 +57,7 @@ tasks: desc: "Opens API docs page" cmds: - open http://{{ .BASE_URL }}/docs - + site-open:templates: desc: "Opens templates site." cmds: From d2124175679e1e2858101cbfcb4031c709e25131 Mon Sep 17 00:00:00 2001 From: Sine Jespersen Date: Thu, 28 Aug 2025 09:07:56 +0200 Subject: [PATCH 10/10] 5289: normalize composer --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index a4096142..4fcee8da 100644 --- a/composer.json +++ b/composer.json @@ -121,6 +121,7 @@ "cache:clear": "symfony-cmd", "assets:install %PUBLIC_DIR%": "symfony-cmd" }, + "code-analysis": "vendor/bin/psalm", "coding-standards-apply": [ "vendor/bin/php-cs-fixer fix" ], @@ -150,7 +151,6 @@ "update-api-spec": [ "bin/console api:openapi:export --output=public/api-spec-v2.yaml --yaml --no-interaction", "bin/console api:openapi:export --output=public/api-spec-v2.json --no-interaction" - ], - "code-analysis": "vendor/bin/psalm" + ] } }