From ddd498e92b797fc880308fcbbd579e485fbdd67c Mon Sep 17 00:00:00 2001 From: Jef Roosens Date: Tue, 18 May 2021 15:55:36 +0200 Subject: [PATCH] Switched to Make commands for frontend ci --- .editorconfig | 3 +++ .woodpecker.yml | 6 ++---- Makefile | 44 +++++++++++++++++++++++++++++++++++++++----- web/yarn.lock | 15 +++++++++++---- 4 files changed, 55 insertions(+), 13 deletions(-) diff --git a/.editorconfig b/.editorconfig index f518704..3baa07e 100644 --- a/.editorconfig +++ b/.editorconfig @@ -5,3 +5,6 @@ end_of_line = lf insert_final_newline = false indent_style = space indent_size = 4 + +[Makefile] +indent_style = tab diff --git a/.woodpecker.yml b/.woodpecker.yml index 8544ea6..dc4c4fd 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -16,8 +16,7 @@ pipeline: pull: true group: test commands: - - cd web - - yarn build + - make fbuild when: event: push @@ -35,8 +34,7 @@ pipeline: image: node:16-alpine group: lint commands: - - cd web - - yarn run lint + - make flint when: event: push diff --git a/Makefile b/Makefile index 249362d..73ded87 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,18 @@ # =====CONFIG===== -PYTHON := python3 +PYTHON := python3 # This can't contain spaces (I think) -VENV := .venv +VENV := .venv # Minimum % coverage for tests to succeed MIN_COV := 0 +# Directory name for the frontend +WEB_DIR := web # By default, just create the venv when needed all: venv -# =====RECIPES===== +# =====BACKEND===== ## VENV ### Create the venv $(VENV)/bin/activate: setup.py setup.cfg @@ -43,9 +45,9 @@ test: venv ## Cleaning -# Remove the venv +### Remove the venv clean: - @ rm -rf '$(VENV)' + @ rm -rf '$(VENV)' '$(WEB_DIR)'/node_modules .PHONY: clean @@ -53,3 +55,35 @@ clean: ### Run the Quart server run: venv @ '$(VENV)'/bin/python app +.PHONY: run + + +# =====BACKEND===== +## node_modules +### Install dependencies +$(WEB_DIR)/yarn.lock: $(WEB_DIR)/package.json + @ cd web && yarn install + +# Convenient alias +lockfile: $(WEB_DIR)/yarn.lock +.PHONY: lockfile + + +## Formatting & linting +flint: lockfile + @ cd web && yarn run lint +.PHONY: flint + +fformat: lockfile + @ cd web && yarn run format +.PHONY: fformat + + +## Testing +# TODO add testing command + + +## Building +fbuild: lockfile + @ cd web && yarn build +.PHONY: fbuild diff --git a/web/yarn.lock b/web/yarn.lock index a83ce97..7c05fb4 100644 --- a/web/yarn.lock +++ b/web/yarn.lock @@ -422,6 +422,11 @@ "@vue/compiler-dom" "3.0.11" "@vue/shared" "3.0.11" +"@vue/devtools-api@^6.0.0-beta.10": + version "6.0.0-beta.10" + resolved "https://registry.yarnpkg.com/@vue/devtools-api/-/devtools-api-6.0.0-beta.10.tgz#f39da7618cee292e39c7274227c34163e30eb3ca" + integrity sha512-nktQYRnIFrh4DdXiCBjHnsHOMZXDIVcP9qlm/DMfxmjJMtpMGrSZCOKP8j7kDhObNHyqlicwoGLd+a4hf4x9ww== + "@vue/reactivity@3.0.11", "@vue/reactivity@^3.0.11": version "3.0.11" resolved "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.0.11.tgz" @@ -3637,10 +3642,12 @@ vue-eslint-parser@^7.6.0: esquery "^1.4.0" lodash "^4.17.15" -vue-router@^3.5.1: - version "3.5.1" - resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-3.5.1.tgz#edf3cf4907952d1e0583e079237220c5ff6eb6c9" - integrity sha512-RRQNLT8Mzr8z7eL4p7BtKvRaTSGdCbTy2+Mm5HTJvLGYSSeG9gDzNasJPP/yOYKLy+/cLG/ftrqq5fvkFwBJEw== +vue-router@^4.0.6: + version "4.0.8" + resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-4.0.8.tgz#55d4290a3122444edbc91a3cd2492bb1d0cef494" + integrity sha512-42mWSQaH7CCBQDspQTHv63f34VEnZC20g9QNK4WJ/zW8SdIUeT6TQ2i/78fjF/pVBUPLBWrGhvB7uDnaz7O/pA== + dependencies: + "@vue/devtools-api" "^6.0.0-beta.10" vue-tsc@^0.1.0: version "0.1.4"