From 2537291c88e5802b98fb8648382adf55b6cb2819 Mon Sep 17 00:00:00 2001 From: Tyler Hall Date: Fri, 1 Dec 2023 15:32:45 +0000 Subject: [PATCH] chore: use husky and lint-staged to enforce checks --- .gitpod.yml | 4 ++++ .husky/pre-commit | 4 ++++ .lintstagedrc.json | 7 +++++++ README.md | 14 +++++++++++++- deno.jsonc | 4 ++++ 5 files changed, 32 insertions(+), 1 deletion(-) create mode 100755 .husky/pre-commit create mode 100644 .lintstagedrc.json diff --git a/.gitpod.yml b/.gitpod.yml index 527c76d3..40710038 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -1,2 +1,6 @@ image: file: .gitpod.Dockerfile + +tasks: + - name: Setup Git Hooks + init: deno task prepare diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 00000000..fc21999a --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +deno task staged diff --git a/.lintstagedrc.json b/.lintstagedrc.json new file mode 100644 index 00000000..76478762 --- /dev/null +++ b/.lintstagedrc.json @@ -0,0 +1,7 @@ +{ + "**/*.{md,json,js,ts}": ["deno fmt"], + "**/README.md": [ + "deno run -A --no-lock npm:markdown-toc-gen@1 insert", + "deno fmt" + ] +} diff --git a/README.md b/README.md index 4ecc4203..41843103 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,18 @@ What's New

+ + +- [Introduction](#introduction) +- [Status](#status) +- [Running Locally](#running-locally) +- [Documentation](#documentation) +- [Contributions](#contributions) +- [Developer Setup](#developer-setup) +- [Thank you](#thank-you) + + + ## Introduction 👋 Hey 👋 @@ -63,7 +75,7 @@ Alternatively, if you're using `node`, you can run `npx hyper-nano` This `nano` version of hyper implements the following ports and adapters: -- `data` (powered by [PouchDB](https://github.com/hyper63/hyper-adapter-pouchdb)) +- `data` (powered by [In-Memory MongoDB](https://github.com/hyper63/hyper-adapter-mongodb)) - `cache` (powered by [Sqlite](https://github.com/hyper63/hyper-adapter-sqlite)) - `storage` (powered by your local [file system](https://github.com/hyper63/hyper-adapter-fs)) - `search` (powered by [Sqlite and Minisearch](https://github.com/hyper63/hyper-adapter-minisearch)) diff --git a/deno.jsonc b/deno.jsonc index 96854fb3..73920f3f 100644 --- a/deno.jsonc +++ b/deno.jsonc @@ -1,4 +1,8 @@ { + "tasks": { + "prepare": "deno run -A --no-lock npm:husky@^8 install", + "staged": "deno run -A --no-lock npm:lint-staged@^15" + }, "fmt": { "include": ["./"], "exclude": ["./**/CHANGELOG.md"],