diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..53630b95 --- /dev/null +++ b/.gitignore @@ -0,0 +1,13 @@ +# Logs +yarn-debug.log* +yarn-error.log* + +# Dependency directories +node_modules/ + +# Serverless directories +.serverless/ + +# Emacs +*~ +*# \ No newline at end of file diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..e69de29b diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 00000000..8d9df462 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,14 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +yarn pretty-quick --staged + +git submodule sync +git submodule update --init --recursive --remote + +for SUB_MODULE in `cat .gitmodules | grep path | cut -d= -f2` +do + echo "updating git submodule $SUB_MODULE" + git add $SUB_MODULE +done; + diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..656b7962 --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +.prettierignore \ No newline at end of file diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 00000000..0967ef42 --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1 @@ +{} diff --git a/README.md b/README.md new file mode 100644 index 00000000..203348c4 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# Typescript Repo Template + +Template for making typescript repos. diff --git a/__tests__/functional/example.test.ts b/__tests__/functional/example.test.ts new file mode 100644 index 00000000..57f5df09 --- /dev/null +++ b/__tests__/functional/example.test.ts @@ -0,0 +1,5 @@ +describe ("functional tests", () => { + it ("put funcitnoal tests here", () => { + + }); +}); diff --git a/__tests__/integration/example.test.ts b/__tests__/integration/example.test.ts new file mode 100644 index 00000000..2e8adc7a --- /dev/null +++ b/__tests__/integration/example.test.ts @@ -0,0 +1,5 @@ +describe ("integration tests", () => { + it ("put integration tests here", () => { + + }); +}); diff --git a/jest.config.js b/jest.config.js new file mode 100644 index 00000000..0d246aa8 --- /dev/null +++ b/jest.config.js @@ -0,0 +1,7 @@ +/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */ +module.exports = { + preset: "ts-jest", + testEnvironment: "node", + testPathIgnorePatterns: ["node_modules", "build"], + testMatch: ["**/__tests__/**/*.test.[jt]s?(x)"], +}; diff --git a/package.json b/package.json new file mode 100644 index 00000000..f186bbab --- /dev/null +++ b/package.json @@ -0,0 +1,29 @@ +{ + "name": "your repo name", + "version": "1.0.0", + "description": "your description", + "main": "index.js", + "repository": "your repo url", + "author": "Fauna", + "private": true, + "dependencies": { + }, + "devDependencies": { + "@tsconfig/node16-strictest": "^1.0.3", + "@types/jest": "^28.1.6", + "@types/node": "^18.6.3", + "husky": "^7.0.0", + "jest": "^28.1.3", + "prettier": "^2.7.1", + "pretty-quick": "^3.1.3", + "ts-jest": "^28.0.7", + "typescript": "^4.7.4" + }, + "scripts": { + "prepare": "husky install", + "build": "tsc --project ./", + "sync-submodules": "git submodule sync; git submodule update --init --recursive --remote", + "fauna-local": "docker start faunadb || docker run --rm -d --name faunadb -p 8443:8443 -p 8084:8084 fauna/faunadb:latest", + "test": "jest" + } +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000..69a7cb67 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "@tsconfig/node16-strictest/tsconfig.json" +}