diff --git a/.editorconfig b/.editorconfig index 5d47c21..f48867c 100644 --- a/.editorconfig +++ b/.editorconfig @@ -5,8 +5,12 @@ root = true [*] indent_style = space -indent_size = 2 +indent_size = 4 end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true + +[Makefile] +indent_style = tab +indent_size = 2 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 44a89e6..f15d028 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,6 @@ jobs: build: runs-on: ubuntu-latest - needs: eslint steps: - uses: actions/checkout@v2 - uses: oven-sh/setup-bun@v2 diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..0430bad --- /dev/null +++ b/Makefile @@ -0,0 +1,40 @@ +ifeq ($(shell which bun &>/dev/null && echo 1 || echo 0), 1) + NPM ?= bun +endif + +NPM ?= npm + +.PHONY: help +help: ## show this message + @echo "Usage: make [target1] (target2) ..." + @echo "" + @echo "Commands/Targets:" + @grep -E '(^[a-zA-Z0-9_%-]+:.*?##.*$$)|(^##)' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}{printf "\033[32m%-20s\033[0m %s\n", $$1, $$2}' | sed -e 's/\[32m##/[33m/' + @echo "" + @echo "Environment:" + @grep -E '^[a-zA-Z0-9_-]+\s*[?:]?=.*$$' $(MAKEFILE_LIST) | grep -Eo '^[a-zA-Z0-9_-]+' | xargs -I {} make -s print-{} + +.PHONY: print-% +print-%: + @echo -e '\033[32m$*\033[0m = $($*)' + +build: ## build static site in "dist" + @$(NPM) run build + +.PHONY: run +def: ## run dev version of static site + @$(NPM) run dev + +lint: ## lint code + @$(NPM) run lint + +fix: ## fix and reformat code + @$(NPM) run format + @$(NPM) run lint-fix + +update-template: ## update code from template + @(git remote | grep template &>/dev/null) || git remote add template https://github.com/klemek/vue-boilerplate.git + git fetch template + git merge template/master --allow-unrelated-histories + + diff --git a/package.json b/package.json index 6f8c938..ba07e14 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "build-only": "vite build", "type-check": "vue-tsc --build", "lint": "eslint . --cache", - "fix": "eslint . --fix --cache", + "lint-fix": "eslint . --fix --cache", "format": "prettier --write --experimental-cli src/" }, "dependencies": { diff --git a/src/App.vue b/src/App.vue index 53edc8b..94477f1 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,70 +1,70 @@ diff --git a/src/components/CustomButton.vue b/src/components/CustomButton.vue index b308652..974bfa4 100644 --- a/src/components/CustomButton.vue +++ b/src/components/CustomButton.vue @@ -1,36 +1,36 @@ diff --git a/src/components/LucideIcon.vue b/src/components/LucideIcon.vue index d469112..a880720 100644 --- a/src/components/LucideIcon.vue +++ b/src/components/LucideIcon.vue @@ -3,27 +3,30 @@ import { computed, onMounted } from "vue"; import * as icons from "lucide-vue-next"; interface Props { - name: string; - color?: string; - strokeWidth?: string; - defaultClass?: string; + name: string; + color?: string; + strokeWidth?: string; + defaultClass?: string; } const props = withDefaults(defineProps(), { - color: "currentColor", - strokeWidth: "2", - defaultClass: "lucide", + color: "currentColor", + strokeWidth: "2", + defaultClass: "lucide", }); function kebab2camel(kebab: string): string { - return kebab - .split("-") - .map((item) => item.charAt(0).toUpperCase() + item.slice(1).toLowerCase()) - .join(""); + return kebab + .split("-") + .map( + (item) => + item.charAt(0).toUpperCase() + item.slice(1).toLowerCase(), + ) + .join(""); } onMounted(() => { - console.log(kebab2camel(props.name)); + console.log(kebab2camel(props.name)); }); // @ts-expect-error: cannot infer type of all exported data @@ -31,10 +34,10 @@ const icon = computed(() => icons[kebab2camel(props.name)]);