diff --git a/.gitignore b/.gitignore index f9ba736..2b0c653 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules .pls_cache/ .perl-version +pnpm-lock.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..a9f1019 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,20 @@ +default_stages: + - merge-commit + - push + +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.3.0 + hooks: + - id: end-of-file-fixer + stages: [merge-commit, push] + - id: trailing-whitespace + stages: [merge-commit, push] + - id: check-merge-conflict + - repo: local + hooks: + - id: lint + name: lint + entry: task lint:fix -- + language: system + files: "" diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..6da48a6 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,2 @@ +.gitignore +input diff --git a/2022/Taskfile.yaml b/2022/Taskfile.yaml deleted file mode 100644 index 51b2a82..0000000 --- a/2022/Taskfile.yaml +++ /dev/null @@ -1,12 +0,0 @@ -# https://taskfile.dev - -version: '3' - -vars: - GREETING: Hello, World! - -tasks: - default: - cmds: - - echo "{{.GREETING}}" - silent: true diff --git a/Taskfile.yaml b/Taskfile.yaml new file mode 100644 index 0000000..ba044cb --- /dev/null +++ b/Taskfile.yaml @@ -0,0 +1,24 @@ +# https://taskfile.dev + +version: "3" + +vars: + GREETING: Hello, World! + +tasks: + "precommit:init": pre-commit install -t pre-merge-commit -t pre-push + + integrate: + cmds: + - git is-clean + - git co main + - git weld - + + lint:fix: + cmds: + - npx prettier --write {{.CLI_ARGS | default "." }} + + default: + cmds: + - echo "{{.GREETING}}" + silent: true diff --git a/package.json b/package.json new file mode 100644 index 0000000..c1baac4 --- /dev/null +++ b/package.json @@ -0,0 +1,19 @@ +{ + "name": "2022", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "Yanick Champoux (http://techblog.babyl.ca/)", + "license": "ISC", + "dependencies": { + "debug": "^4.3.4", + "fs-extra": "^11.1.0", + "prettier": "^2.8.0", + "remeda": "^1.3.0", + "vitest": "^0.25.3" + } +} diff --git a/vitest.config.js b/vitest.config.js new file mode 100644 index 0000000..aca2fa2 --- /dev/null +++ b/vitest.config.js @@ -0,0 +1,9 @@ +/// +import { defineConfig } from "vite"; + +export default defineConfig({ + test: { + include: ["**/*test.js"], + // ... + }, +});