diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 0000000..7607cef --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,3 @@ +npm run graphql-codegen +npm run lint +npm run type-check diff --git a/package-lock.json b/package-lock.json index 27cbd63..b235e21 100644 --- a/package-lock.json +++ b/package-lock.json @@ -64,8 +64,9 @@ "@typescript-eslint/parser": "^5.27.1", "eslint": "7.32.0", "eslint-config-next": "^13.3.0", + "husky": "^9.0.11", "ts-node": "^10.8.1", - "typescript": "^4.7.3" + "typescript": "^4.9.5" } }, "node_modules/@ampproject/remapping": { @@ -7033,6 +7034,21 @@ "node": ">= 6" } }, + "node_modules/husky": { + "version": "9.0.11", + "resolved": "https://registry.npmjs.org/husky/-/husky-9.0.11.tgz", + "integrity": "sha512-AB6lFlbwwyIqMdHYhwPe+kjOC3Oc5P3nThEoW/AaO2BX3vJDjWPFxYLxokUZOo6RNX20He3AaT8sESs9NJcmEw==", + "dev": true, + "bin": { + "husky": "bin.mjs" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/typicode" + } + }, "node_modules/iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -11289,9 +11305,9 @@ } }, "node_modules/typescript": { - "version": "4.9.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.3.tgz", - "integrity": "sha512-CIfGzTelbKNEnLpLdGFgdyKhG23CKdKgQPOBc+OUNrkJ2vr+KSzsSV5kq5iWhEQbok+quxgGzrAtGWCyU7tHnA==", + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -17351,6 +17367,12 @@ "debug": "4" } }, + "husky": { + "version": "9.0.11", + "resolved": "https://registry.npmjs.org/husky/-/husky-9.0.11.tgz", + "integrity": "sha512-AB6lFlbwwyIqMdHYhwPe+kjOC3Oc5P3nThEoW/AaO2BX3vJDjWPFxYLxokUZOo6RNX20He3AaT8sESs9NJcmEw==", + "dev": true + }, "iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -20309,9 +20331,9 @@ "dev": true }, "typescript": { - "version": "4.9.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.3.tgz", - "integrity": "sha512-CIfGzTelbKNEnLpLdGFgdyKhG23CKdKgQPOBc+OUNrkJ2vr+KSzsSV5kq5iWhEQbok+quxgGzrAtGWCyU7tHnA==", + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", "dev": true }, "ua-parser-js": { diff --git a/package.json b/package.json index 6ca1f2c..a6b2b6c 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,9 @@ "build": "next build", "start": "next start", "lint": "next lint", - "graphql-codegen": "graphql-codegen --config codegen.ts" + "type-check": "tsc", + "graphql-codegen": "graphql-codegen --config codegen.ts", + "prepare": "husky" }, "dependencies": { "@fortawesome/fontawesome-svg-core": "^6.1.1", @@ -66,7 +68,8 @@ "@typescript-eslint/parser": "^5.27.1", "eslint": "7.32.0", "eslint-config-next": "^13.3.0", + "husky": "^9.0.11", "ts-node": "^10.8.1", - "typescript": "^4.7.3" + "typescript": "^4.9.5" } } diff --git a/src/lib/client/search.ts b/src/lib/client/search.ts index ac1fb4d..5b7fd34 100644 --- a/src/lib/client/search.ts +++ b/src/lib/client/search.ts @@ -106,7 +106,7 @@ export const searchResolvers = { searchParams.append("fields[anime]", "name,slug,year,season"); searchParams.append("fields[animetheme]", "type,sequence,id"); searchParams.append("fields[group]", "name,slug"); - searchParams.append("fields[animethemeentry]", "version,episodes,spoiler,nsfw"); + searchParams.append("fields[animethemeentry]", "id,version,episodes,spoiler,nsfw"); searchParams.append("fields[video]", "id,tags,resolution,nc,subbed,lyrics,uncen,source,overlap,basename"); searchParams.append("fields[image]", "facet,link"); searchParams.append("fields[song]", "id,title");