From fe92b8bbf0506a94a779259a9c6a01e56c572b76 Mon Sep 17 00:00:00 2001 From: Maxim Mazurok Date: Mon, 26 Dec 2022 12:21:36 +1100 Subject: [PATCH] Move @types/http-cache-semantics from dev to deps --- package.json | 5 ++++- test/dependencies.test.ts | 13 +++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 test/dependencies.test.ts diff --git a/package.json b/package.json index 3ecd04c..37f6fb6 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,11 @@ "7234", "compliant" ], + "dependenciesComments": { + "@types/http-cache-semantics": "It needs to be in the dependencies list and not devDependencies because otherwise projects that use this one will be getting `Could not find a declaration file for module 'http-cache-semantics'` error when running `tsc`, see https://github.com/jaredwray/cacheable-request/issues/194 for details" + }, "dependencies": { + "@types/http-cache-semantics": "^4.0.1", "get-stream": "^6.0.1", "http-cache-semantics": "^4.1.0", "keyv": "^4.5.2", @@ -42,7 +46,6 @@ }, "devDependencies": { "@keyv/sqlite": "^3.6.4", - "@types/http-cache-semantics": "^4.0.1", "@types/delay": "^3.1.0", "@types/get-stream": "^3.0.2", "@types/jest": "^29.2.4", diff --git a/test/dependencies.test.ts b/test/dependencies.test.ts new file mode 100644 index 0000000..a90bf57 --- /dev/null +++ b/test/dependencies.test.ts @@ -0,0 +1,13 @@ +import {readFileSync} from 'node:fs'; + +test('@types/http-cache-semantics is a regular (not dev) dependency', () => { + // Required to avoid `Could not find a declaration file for module 'http-cache-semantics'` error from `tsc` when using this package in other projects + + // Arrange + const packageJsonContents = JSON.parse( + readFileSync(new URL('../package.json', import.meta.url), 'utf8'), + ); + + // Assert + expect(packageJsonContents).toHaveProperty('dependencies.@types/http-cache-semantics'); +});