From a22fd215087b5e970db96511b3549718943caf4e Mon Sep 17 00:00:00 2001 From: Patrick McElhaney Date: Tue, 28 May 2024 17:32:42 -0400 Subject: [PATCH 1/7] change COUNTERFACT_RESPONSE to an (almost) empty object This satisifies two goals: For example, $.response[200].random() returns this weird COUNTERFACT_RESPONSE type. - there is no autocomplete after the response is fully built - the type is not just an empty object so the function is still type safe --- package.json | 2 +- src/server/dispatcher.ts | 2 +- src/server/registry.ts | 2 +- src/server/response-builder.ts | 2 +- src/server/{types.d.ts => types.ts} | 16 +++++++++++++--- src/typescript-generator/operation-type-coder.js | 5 +++-- src/typescript-generator/repository.js | 4 ++-- src/typescript-generator/script.js | 4 +--- templates/response-builder-factory.ts | 2 +- test/server/response-builder.test.ts | 2 +- test/typescript-generator/script.test.js | 4 ++-- 11 files changed, 27 insertions(+), 18 deletions(-) rename src/server/{types.d.ts => types.ts} (94%) diff --git a/package.json b/package.json index 171dd22c..33952ecd 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "test": "yarn node --experimental-vm-modules ./node_modules/jest-cli/bin/jest --testPathIgnorePatterns=black-box", "test:black-box": "rimraf dist && rimraf out && yarn build && yarn node --experimental-vm-modules ./node_modules/jest-cli/bin/jest black-box --forceExit --coverage=false", "test:mutants": "stryker run stryker.config.json", - "build": "tsc && copyfiles -f \"src/client/**\" dist/client && copyfiles -f \"src/server/*.d.ts\" dist/server && copyfiles -f \"src/server/*.cjs\" dist/server", + "build": "tsc && copyfiles -f \"src/client/**\" dist/client && copyfiles -f \"src/server/types.ts\" dist/server && copyfiles -f \"src/server/*.cjs\" dist/server", "prepack": "yarn build", "release": "npx changeset publish", "prepare": "husky install", diff --git a/src/server/dispatcher.ts b/src/server/dispatcher.ts index 899aafc6..064872e9 100644 --- a/src/server/dispatcher.ts +++ b/src/server/dispatcher.ts @@ -14,7 +14,7 @@ import type { } from "./registry.js"; import { createResponseBuilder } from "./response-builder.js"; import { Tools } from "./tools.js"; -import type { OpenApiOperation, OpenApiParameters } from "./types.d.ts"; +import type { OpenApiOperation, OpenApiParameters } from "./types.ts"; const debug = createDebugger("counterfact:server:dispatcher"); diff --git a/src/server/registry.ts b/src/server/registry.ts index fb2e9c3f..0a1362b8 100644 --- a/src/server/registry.ts +++ b/src/server/registry.ts @@ -2,7 +2,7 @@ import createDebugger from "debug"; import { ModuleTree } from "./module-tree.js"; import type { Tools } from "./tools.js"; -import type { MediaType, ResponseBuilderFactory } from "./types.d.ts"; +import type { MediaType, ResponseBuilderFactory } from "./types.ts"; const debug = createDebugger("counterfact:server:registry"); diff --git a/src/server/response-builder.ts b/src/server/response-builder.ts index 0f7a408b..4939931a 100644 --- a/src/server/response-builder.ts +++ b/src/server/response-builder.ts @@ -1,7 +1,7 @@ import { JSONSchemaFaker } from "json-schema-faker"; import { jsonToXml } from "./json-to-xml.js"; -import type { OpenApiOperation, ResponseBuilder } from "./types.d.ts"; +import type { OpenApiOperation, ResponseBuilder } from "./types.ts"; JSONSchemaFaker.option("useExamplesValue", true); JSONSchemaFaker.option("minItems", 0); diff --git a/src/server/types.d.ts b/src/server/types.ts similarity index 94% rename from src/server/types.d.ts rename to src/server/types.ts index 416f6902..ba7b87f9 100644 --- a/src/server/types.d.ts +++ b/src/server/types.ts @@ -12,6 +12,14 @@ interface Example { value: unknown; } +const counterfactResponse = Symbol("Counterfact Response"); + +const counterfactResponseObject = { + [counterfactResponse]: counterfactResponse, +}; + +type COUNTERFACT_RESPONSE = typeof counterfactResponseObject; + type MediaType = `${string}/${string}`; type OmitAll = { @@ -90,7 +98,7 @@ type HeaderFunction = < type RandomFunction = < Header extends string & keyof Response["headers"], ->() => "COUNTERFACT_RESPONSE"; +>() => COUNTERFACT_RESPONSE; interface ResponseBuilder { [status: number | `${number} ${string}`]: ResponseBuilder; @@ -139,10 +147,10 @@ type GenericResponseBuilderInner< type GenericResponseBuilder< Response extends OpenApiResponse = OpenApiResponse, > = {} extends OmitValueWhenNever - ? "COUNTERFACT_RESPONSE" + ? COUNTERFACT_RESPONSE : keyof OmitValueWhenNever extends "headers" ? { - ALL_REMAINING_HEADERS_ARE_OPTIONAL: "COUNTERFACT_RESPONSE"; + ALL_REMAINING_HEADERS_ARE_OPTIONAL: COUNTERFACT_RESPONSE; header: HeaderFunction; } : GenericResponseBuilderInner; @@ -258,6 +266,8 @@ interface WideOperationArgument { response: { [key: number]: WideResponseBuilder }; } +export type { COUNTERFACT_RESPONSE }; + export type { HttpStatusCode, MediaType, diff --git a/src/typescript-generator/operation-type-coder.js b/src/typescript-generator/operation-type-coder.js index 9ffb74fd..e6b4e110 100644 --- a/src/typescript-generator/operation-type-coder.js +++ b/src/typescript-generator/operation-type-coder.js @@ -97,6 +97,7 @@ export class OperationTypeCoder extends TypeCoder { const xType = script.importSharedType("WideOperationArgument"); script.importSharedType("OmitValueWhenNever"); + script.importSharedType("COUNTERFACT_RESPONSE"); const contextTypeImportName = script.importExternalType( "Context", @@ -134,10 +135,10 @@ export class OperationTypeCoder extends TypeCoder { this.requirement.specification?.rootRequirement?.get("produces")?.data, ).write(script); - const proxyType = '(url: string) => "COUNTERFACT_RESPONSE"'; + const proxyType = "(url: string) => COUNTERFACT_RESPONSE"; return `($: OmitValueWhenNever<{ query: ${queryType}, path: ${pathType}, header: ${headerType}, body: ${bodyType}, context: ${contextTypeImportName}, response: ${responseType}, x: ${xType}, proxy: ${proxyType}, user: ${this.userType()} }>) => ${this.responseTypes( script, - )} | { status: 415, contentType: "text/plain", body: string } | "COUNTERFACT_RESPONSE" | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: "COUNTERFACT_RESPONSE" }`; + )} | { status: 415, contentType: "text/plain", body: string } | COUNTERFACT_RESPONSE | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: COUNTERFACT_RESPONSE }`; } } diff --git a/src/typescript-generator/repository.js b/src/typescript-generator/repository.js index 8bc66945..06befd5f 100644 --- a/src/typescript-generator/repository.js +++ b/src/typescript-generator/repository.js @@ -53,8 +53,8 @@ export class Repository { } async copyCoreFiles(destination) { - const sourcePath = nodePath.join(__dirname, "../../dist/server/types.d.ts"); - const destinationPath = nodePath.join(destination, "types.d.ts"); + const sourcePath = nodePath.join(__dirname, "../../dist/server/types.ts"); + const destinationPath = nodePath.join(destination, "types.ts"); if (!existsSync(sourcePath)) { return false; diff --git a/src/typescript-generator/script.js b/src/typescript-generator/script.js index fcc39087..f32950dd 100644 --- a/src/typescript-generator/script.js +++ b/src/typescript-generator/script.js @@ -144,9 +144,7 @@ export class Script { importSharedType(name) { return this.importExternal( name, - nodePath - .join(this.relativePathToBase, "types.d.ts") - .replaceAll("\\", "/"), + nodePath.join(this.relativePathToBase, "types.ts").replaceAll("\\", "/"), true, ); } diff --git a/templates/response-builder-factory.ts b/templates/response-builder-factory.ts index a587ede0..e2071a30 100644 --- a/templates/response-builder-factory.ts +++ b/templates/response-builder-factory.ts @@ -1,4 +1,4 @@ -import type { OpenApiResponse } from "../src/server/types.d.ts"; +import type { OpenApiResponse } from "../src/server/types.ts"; type OmitValueWhenNever = Pick< Base, diff --git a/test/server/response-builder.test.ts b/test/server/response-builder.test.ts index b861f91d..defdb332 100644 --- a/test/server/response-builder.test.ts +++ b/test/server/response-builder.test.ts @@ -1,5 +1,5 @@ import { createResponseBuilder } from "../../src/server/response-builder.js"; -import type { OpenApiOperation } from "../../src/server/types.d.ts"; +import type { OpenApiOperation } from "../../src/server/types.ts"; describe("a response builder", () => { it("starts building a response object when the status is selected", () => { diff --git a/test/typescript-generator/script.test.js b/test/typescript-generator/script.test.js index 5e092eb9..eece5fbb 100644 --- a/test/typescript-generator/script.test.js +++ b/test/typescript-generator/script.test.js @@ -128,11 +128,11 @@ describe("a Script", () => { script2.importSharedType("SomeType"); expect(script1.externalImportStatements()).toStrictEqual([ - 'import type { SomeType } from "../types.d.ts";', + 'import type { SomeType } from "../types.ts";', ]); expect(script2.externalImportStatements()).toStrictEqual([ - 'import type { SomeType } from "../../../types.d.ts";', + 'import type { SomeType } from "../../../types.ts";', ]); }); From 7066cebabc992780a89bf022f688512957545206 Mon Sep 17 00:00:00 2001 From: Patrick McElhaney Date: Tue, 28 May 2024 17:44:22 -0400 Subject: [PATCH 2/7] ignore lint errors that popped up because types is now a .ts file --- src/server/types.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/server/types.ts b/src/server/types.ts index ba7b87f9..4a23707e 100644 --- a/src/server/types.ts +++ b/src/server/types.ts @@ -72,6 +72,7 @@ type MaybeShortcut< never >; +// eslint-disable-next-line @typescript-eslint/ban-types type NeverIfEmpty = {} extends Record ? never : Record; type MatchFunction = < @@ -97,6 +98,7 @@ type HeaderFunction = < }>; type RandomFunction = < + // eslint-disable-next-line etc/no-misused-generics, unused-imports/no-unused-vars Header extends string & keyof Response["headers"], >() => COUNTERFACT_RESPONSE; @@ -146,6 +148,7 @@ type GenericResponseBuilderInner< type GenericResponseBuilder< Response extends OpenApiResponse = OpenApiResponse, + // eslint-disable-next-line @typescript-eslint/ban-types > = {} extends OmitValueWhenNever ? COUNTERFACT_RESPONSE : keyof OmitValueWhenNever extends "headers" From 83c8169b55fa27176759a7e0b5ce56c7490eb458 Mon Sep 17 00:00:00 2001 From: Patrick McElhaney Date: Tue, 28 May 2024 17:45:19 -0400 Subject: [PATCH 3/7] update test snapshots --- src/server/types.ts | 2 + .../__snapshots__/generate.test.ts.snap | 213 ++++++++++-------- .../operation-type-coder.test.js.snap | 42 ++-- 3 files changed, 136 insertions(+), 121 deletions(-) diff --git a/src/server/types.ts b/src/server/types.ts index 4a23707e..d7e159d1 100644 --- a/src/server/types.ts +++ b/src/server/types.ts @@ -1,3 +1,5 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ +/* eslint-disable etc/no-t */ interface OpenApiHeader { schema: unknown; } diff --git a/test/typescript-generator/__snapshots__/generate.test.ts.snap b/test/typescript-generator/__snapshots__/generate.test.ts.snap index 523022bb..b7f98645 100644 --- a/test/typescript-generator/__snapshots__/generate.test.ts.snap +++ b/test/typescript-generator/__snapshots__/generate.test.ts.snap @@ -19,10 +19,11 @@ exports[`end-to-end test generates the same code for pet store that it did on th // Do not edit this file. Edit the OpenAPI file instead. // For more information, see https://github.com/pmcelhaney/counterfact/blob/main/docs/faq-generated-code.md -import type { WideOperationArgument } from "../../types.d.ts"; -import type { OmitValueWhenNever } from "../../types.d.ts"; +import type { WideOperationArgument } from "../../types.ts"; +import type { OmitValueWhenNever } from "../../types.ts"; +import type { COUNTERFACT_RESPONSE } from "../../types.ts"; import type { Context } from "@@CONTEXT_FILE_TOKEN@@"; -import type { ResponseBuilderFactory } from "../../types.d.ts"; +import type { ResponseBuilderFactory } from "../../types.ts"; import type { Pet } from "../components/schemas/Pet.js"; export type HTTP_POST = ( @@ -52,7 +53,7 @@ export type HTTP_POST = ( }; }>; x: WideOperationArgument; - proxy: (url: string) => "COUNTERFACT_RESPONSE"; + proxy: (url: string) => COUNTERFACT_RESPONSE; user: never; }>, ) => @@ -70,8 +71,8 @@ export type HTTP_POST = ( status: 405; } | { status: 415; contentType: "text/plain"; body: string } - | "COUNTERFACT_RESPONSE" - | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: "COUNTERFACT_RESPONSE" }; + | COUNTERFACT_RESPONSE + | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: COUNTERFACT_RESPONSE }; export type HTTP_PUT = ( $: OmitValueWhenNever<{ @@ -110,7 +111,7 @@ export type HTTP_PUT = ( }; }>; x: WideOperationArgument; - proxy: (url: string) => "COUNTERFACT_RESPONSE"; + proxy: (url: string) => COUNTERFACT_RESPONSE; user: never; }>, ) => @@ -134,8 +135,8 @@ export type HTTP_PUT = ( status: 405; } | { status: 415; contentType: "text/plain"; body: string } - | "COUNTERFACT_RESPONSE" - | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: "COUNTERFACT_RESPONSE" }; + | COUNTERFACT_RESPONSE + | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: COUNTERFACT_RESPONSE }; " `; @@ -153,10 +154,11 @@ exports[`end-to-end test generates the same code for pet store that it did on th // Do not edit this file. Edit the OpenAPI file instead. // For more information, see https://github.com/pmcelhaney/counterfact/blob/main/docs/faq-generated-code.md -import type { WideOperationArgument } from "../../../types.d.ts"; -import type { OmitValueWhenNever } from "../../../types.d.ts"; +import type { WideOperationArgument } from "../../../types.ts"; +import type { OmitValueWhenNever } from "../../../types.ts"; +import type { COUNTERFACT_RESPONSE } from "../../../types.ts"; import type { Context } from "@@CONTEXT_FILE_TOKEN@@"; -import type { ResponseBuilderFactory } from "../../../types.d.ts"; +import type { ResponseBuilderFactory } from "../../../types.ts"; import type { Pet } from "../../components/schemas/Pet.js"; export type HTTP_GET = ( @@ -186,7 +188,7 @@ export type HTTP_GET = ( }; }>; x: WideOperationArgument; - proxy: (url: string) => "COUNTERFACT_RESPONSE"; + proxy: (url: string) => COUNTERFACT_RESPONSE; user: never; }>, ) => @@ -204,8 +206,8 @@ export type HTTP_GET = ( status: 400; } | { status: 415; contentType: "text/plain"; body: string } - | "COUNTERFACT_RESPONSE" - | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: "COUNTERFACT_RESPONSE" }; + | COUNTERFACT_RESPONSE + | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: COUNTERFACT_RESPONSE }; " `; @@ -223,10 +225,11 @@ exports[`end-to-end test generates the same code for pet store that it did on th // Do not edit this file. Edit the OpenAPI file instead. // For more information, see https://github.com/pmcelhaney/counterfact/blob/main/docs/faq-generated-code.md -import type { WideOperationArgument } from "../../../types.d.ts"; -import type { OmitValueWhenNever } from "../../../types.d.ts"; +import type { WideOperationArgument } from "../../../types.ts"; +import type { OmitValueWhenNever } from "../../../types.ts"; +import type { COUNTERFACT_RESPONSE } from "../../../types.ts"; import type { Context } from "@@CONTEXT_FILE_TOKEN@@"; -import type { ResponseBuilderFactory } from "../../../types.d.ts"; +import type { ResponseBuilderFactory } from "../../../types.ts"; import type { Pet } from "../../components/schemas/Pet.js"; export type HTTP_GET = ( @@ -256,7 +259,7 @@ export type HTTP_GET = ( }; }>; x: WideOperationArgument; - proxy: (url: string) => "COUNTERFACT_RESPONSE"; + proxy: (url: string) => COUNTERFACT_RESPONSE; user: never; }>, ) => @@ -274,8 +277,8 @@ export type HTTP_GET = ( status: 400; } | { status: 415; contentType: "text/plain"; body: string } - | "COUNTERFACT_RESPONSE" - | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: "COUNTERFACT_RESPONSE" }; + | COUNTERFACT_RESPONSE + | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: COUNTERFACT_RESPONSE }; " `; @@ -303,10 +306,11 @@ exports[`end-to-end test generates the same code for pet store that it did on th // Do not edit this file. Edit the OpenAPI file instead. // For more information, see https://github.com/pmcelhaney/counterfact/blob/main/docs/faq-generated-code.md -import type { WideOperationArgument } from "../../../types.d.ts"; -import type { OmitValueWhenNever } from "../../../types.d.ts"; +import type { WideOperationArgument } from "../../../types.ts"; +import type { OmitValueWhenNever } from "../../../types.ts"; +import type { COUNTERFACT_RESPONSE } from "../../../types.ts"; import type { Context } from "@@CONTEXT_FILE_TOKEN@@"; -import type { ResponseBuilderFactory } from "../../../types.d.ts"; +import type { ResponseBuilderFactory } from "../../../types.ts"; import type { Pet } from "../../components/schemas/Pet.js"; export type HTTP_GET = ( @@ -341,7 +345,7 @@ export type HTTP_GET = ( }; }>; x: WideOperationArgument; - proxy: (url: string) => "COUNTERFACT_RESPONSE"; + proxy: (url: string) => COUNTERFACT_RESPONSE; user: never; }>, ) => @@ -362,8 +366,8 @@ export type HTTP_GET = ( status: 404; } | { status: 415; contentType: "text/plain"; body: string } - | "COUNTERFACT_RESPONSE" - | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: "COUNTERFACT_RESPONSE" }; + | COUNTERFACT_RESPONSE + | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: COUNTERFACT_RESPONSE }; export type HTTP_POST = ( $: OmitValueWhenNever<{ @@ -380,7 +384,7 @@ export type HTTP_POST = ( }; }>; x: WideOperationArgument; - proxy: (url: string) => "COUNTERFACT_RESPONSE"; + proxy: (url: string) => COUNTERFACT_RESPONSE; user: never; }>, ) => @@ -388,8 +392,8 @@ export type HTTP_POST = ( status: 405; } | { status: 415; contentType: "text/plain"; body: string } - | "COUNTERFACT_RESPONSE" - | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: "COUNTERFACT_RESPONSE" }; + | COUNTERFACT_RESPONSE + | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: COUNTERFACT_RESPONSE }; export type HTTP_DELETE = ( $: OmitValueWhenNever<{ @@ -406,7 +410,7 @@ export type HTTP_DELETE = ( }; }>; x: WideOperationArgument; - proxy: (url: string) => "COUNTERFACT_RESPONSE"; + proxy: (url: string) => COUNTERFACT_RESPONSE; user: never; }>, ) => @@ -414,8 +418,8 @@ export type HTTP_DELETE = ( status: 400; } | { status: 415; contentType: "text/plain"; body: string } - | "COUNTERFACT_RESPONSE" - | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: "COUNTERFACT_RESPONSE" }; + | COUNTERFACT_RESPONSE + | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: COUNTERFACT_RESPONSE }; " `; @@ -433,10 +437,11 @@ exports[`end-to-end test generates the same code for pet store that it did on th // Do not edit this file. Edit the OpenAPI file instead. // For more information, see https://github.com/pmcelhaney/counterfact/blob/main/docs/faq-generated-code.md -import type { WideOperationArgument } from "../../../../types.d.ts"; -import type { OmitValueWhenNever } from "../../../../types.d.ts"; +import type { WideOperationArgument } from "../../../../types.ts"; +import type { OmitValueWhenNever } from "../../../../types.ts"; +import type { COUNTERFACT_RESPONSE } from "../../../../types.ts"; import type { Context } from "@@CONTEXT_FILE_TOKEN@@"; -import type { ResponseBuilderFactory } from "../../../../types.d.ts"; +import type { ResponseBuilderFactory } from "../../../../types.ts"; import type { ApiResponse } from "../../../components/schemas/ApiResponse.js"; export type HTTP_POST = ( @@ -458,7 +463,7 @@ export type HTTP_POST = ( }; }>; x: WideOperationArgument; - proxy: (url: string) => "COUNTERFACT_RESPONSE"; + proxy: (url: string) => COUNTERFACT_RESPONSE; user: never; }>, ) => @@ -468,8 +473,8 @@ export type HTTP_POST = ( body?: ApiResponse; } | { status: 415; contentType: "text/plain"; body: string } - | "COUNTERFACT_RESPONSE" - | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: "COUNTERFACT_RESPONSE" }; + | COUNTERFACT_RESPONSE + | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: COUNTERFACT_RESPONSE }; " `; @@ -487,10 +492,11 @@ exports[`end-to-end test generates the same code for pet store that it did on th // Do not edit this file. Edit the OpenAPI file instead. // For more information, see https://github.com/pmcelhaney/counterfact/blob/main/docs/faq-generated-code.md -import type { WideOperationArgument } from "../../../types.d.ts"; -import type { OmitValueWhenNever } from "../../../types.d.ts"; +import type { WideOperationArgument } from "../../../types.ts"; +import type { OmitValueWhenNever } from "../../../types.ts"; +import type { COUNTERFACT_RESPONSE } from "../../../types.ts"; import type { Context } from "@@CONTEXT_FILE_TOKEN@@"; -import type { ResponseBuilderFactory } from "../../../types.d.ts"; +import type { ResponseBuilderFactory } from "../../../types.ts"; export type HTTP_GET = ( $: OmitValueWhenNever<{ @@ -511,7 +517,7 @@ export type HTTP_GET = ( }; }>; x: WideOperationArgument; - proxy: (url: string) => "COUNTERFACT_RESPONSE"; + proxy: (url: string) => COUNTERFACT_RESPONSE; user: never; }>, ) => @@ -521,8 +527,8 @@ export type HTTP_GET = ( body?: { [key: string]: number }; } | { status: 415; contentType: "text/plain"; body: string } - | "COUNTERFACT_RESPONSE" - | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: "COUNTERFACT_RESPONSE" }; + | COUNTERFACT_RESPONSE + | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: COUNTERFACT_RESPONSE }; " `; @@ -540,10 +546,11 @@ exports[`end-to-end test generates the same code for pet store that it did on th // Do not edit this file. Edit the OpenAPI file instead. // For more information, see https://github.com/pmcelhaney/counterfact/blob/main/docs/faq-generated-code.md -import type { WideOperationArgument } from "../../../types.d.ts"; -import type { OmitValueWhenNever } from "../../../types.d.ts"; +import type { WideOperationArgument } from "../../../types.ts"; +import type { OmitValueWhenNever } from "../../../types.ts"; +import type { COUNTERFACT_RESPONSE } from "../../../types.ts"; import type { Context } from "@@CONTEXT_FILE_TOKEN@@"; -import type { ResponseBuilderFactory } from "../../../types.d.ts"; +import type { ResponseBuilderFactory } from "../../../types.ts"; import type { Order } from "../../components/schemas/Order.js"; export type HTTP_POST = ( @@ -570,7 +577,7 @@ export type HTTP_POST = ( }; }>; x: WideOperationArgument; - proxy: (url: string) => "COUNTERFACT_RESPONSE"; + proxy: (url: string) => COUNTERFACT_RESPONSE; user: never; }>, ) => @@ -583,8 +590,8 @@ export type HTTP_POST = ( status: 405; } | { status: 415; contentType: "text/plain"; body: string } - | "COUNTERFACT_RESPONSE" - | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: "COUNTERFACT_RESPONSE" }; + | COUNTERFACT_RESPONSE + | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: COUNTERFACT_RESPONSE }; " `; @@ -607,10 +614,11 @@ exports[`end-to-end test generates the same code for pet store that it did on th // Do not edit this file. Edit the OpenAPI file instead. // For more information, see https://github.com/pmcelhaney/counterfact/blob/main/docs/faq-generated-code.md -import type { WideOperationArgument } from "../../../../types.d.ts"; -import type { OmitValueWhenNever } from "../../../../types.d.ts"; +import type { WideOperationArgument } from "../../../../types.ts"; +import type { OmitValueWhenNever } from "../../../../types.ts"; +import type { COUNTERFACT_RESPONSE } from "../../../../types.ts"; import type { Context } from "@@CONTEXT_FILE_TOKEN@@"; -import type { ResponseBuilderFactory } from "../../../../types.d.ts"; +import type { ResponseBuilderFactory } from "../../../../types.ts"; import type { Order } from "../../../components/schemas/Order.js"; export type HTTP_GET = ( @@ -645,7 +653,7 @@ export type HTTP_GET = ( }; }>; x: WideOperationArgument; - proxy: (url: string) => "COUNTERFACT_RESPONSE"; + proxy: (url: string) => COUNTERFACT_RESPONSE; user: never; }>, ) => @@ -666,8 +674,8 @@ export type HTTP_GET = ( status: 404; } | { status: 415; contentType: "text/plain"; body: string } - | "COUNTERFACT_RESPONSE" - | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: "COUNTERFACT_RESPONSE" }; + | COUNTERFACT_RESPONSE + | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: COUNTERFACT_RESPONSE }; export type HTTP_DELETE = ( $: OmitValueWhenNever<{ @@ -689,7 +697,7 @@ export type HTTP_DELETE = ( }; }>; x: WideOperationArgument; - proxy: (url: string) => "COUNTERFACT_RESPONSE"; + proxy: (url: string) => COUNTERFACT_RESPONSE; user: never; }>, ) => @@ -700,8 +708,8 @@ export type HTTP_DELETE = ( status: 404; } | { status: 415; contentType: "text/plain"; body: string } - | "COUNTERFACT_RESPONSE" - | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: "COUNTERFACT_RESPONSE" }; + | COUNTERFACT_RESPONSE + | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: COUNTERFACT_RESPONSE }; " `; @@ -719,11 +727,12 @@ exports[`end-to-end test generates the same code for pet store that it did on th // Do not edit this file. Edit the OpenAPI file instead. // For more information, see https://github.com/pmcelhaney/counterfact/blob/main/docs/faq-generated-code.md -import type { WideOperationArgument } from "../../types.d.ts"; -import type { OmitValueWhenNever } from "../../types.d.ts"; +import type { WideOperationArgument } from "../../types.ts"; +import type { OmitValueWhenNever } from "../../types.ts"; +import type { COUNTERFACT_RESPONSE } from "../../types.ts"; import type { Context } from "@@CONTEXT_FILE_TOKEN@@"; -import type { ResponseBuilderFactory } from "../../types.d.ts"; -import type { HttpStatusCode } from "../../types.d.ts"; +import type { ResponseBuilderFactory } from "../../types.ts"; +import type { HttpStatusCode } from "../../types.ts"; import type { User } from "../components/schemas/User.js"; export type HTTP_POST = ( @@ -748,7 +757,7 @@ export type HTTP_POST = ( }; }>; x: WideOperationArgument; - proxy: (url: string) => "COUNTERFACT_RESPONSE"; + proxy: (url: string) => COUNTERFACT_RESPONSE; user: never; }>, ) => @@ -763,8 +772,8 @@ export type HTTP_POST = ( body?: User; } | { status: 415; contentType: "text/plain"; body: string } - | "COUNTERFACT_RESPONSE" - | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: "COUNTERFACT_RESPONSE" }; + | COUNTERFACT_RESPONSE + | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: COUNTERFACT_RESPONSE }; " `; @@ -782,11 +791,12 @@ exports[`end-to-end test generates the same code for pet store that it did on th // Do not edit this file. Edit the OpenAPI file instead. // For more information, see https://github.com/pmcelhaney/counterfact/blob/main/docs/faq-generated-code.md -import type { WideOperationArgument } from "../../../types.d.ts"; -import type { OmitValueWhenNever } from "../../../types.d.ts"; +import type { WideOperationArgument } from "../../../types.ts"; +import type { OmitValueWhenNever } from "../../../types.ts"; +import type { COUNTERFACT_RESPONSE } from "../../../types.ts"; import type { Context } from "@@CONTEXT_FILE_TOKEN@@"; -import type { ResponseBuilderFactory } from "../../../types.d.ts"; -import type { HttpStatusCode } from "../../../types.d.ts"; +import type { ResponseBuilderFactory } from "../../../types.ts"; +import type { HttpStatusCode } from "../../../types.ts"; import type { User } from "../../components/schemas/User.js"; export type HTTP_POST = ( @@ -816,7 +826,7 @@ export type HTTP_POST = ( }; }>; x: WideOperationArgument; - proxy: (url: string) => "COUNTERFACT_RESPONSE"; + proxy: (url: string) => COUNTERFACT_RESPONSE; user: never; }>, ) => @@ -834,8 +844,8 @@ export type HTTP_POST = ( status: number | undefined; } | { status: 415; contentType: "text/plain"; body: string } - | "COUNTERFACT_RESPONSE" - | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: "COUNTERFACT_RESPONSE" }; + | COUNTERFACT_RESPONSE + | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: COUNTERFACT_RESPONSE }; " `; @@ -853,10 +863,11 @@ exports[`end-to-end test generates the same code for pet store that it did on th // Do not edit this file. Edit the OpenAPI file instead. // For more information, see https://github.com/pmcelhaney/counterfact/blob/main/docs/faq-generated-code.md -import type { WideOperationArgument } from "../../../types.d.ts"; -import type { OmitValueWhenNever } from "../../../types.d.ts"; +import type { WideOperationArgument } from "../../../types.ts"; +import type { OmitValueWhenNever } from "../../../types.ts"; +import type { COUNTERFACT_RESPONSE } from "../../../types.ts"; import type { Context } from "@@CONTEXT_FILE_TOKEN@@"; -import type { ResponseBuilderFactory } from "../../../types.d.ts"; +import type { ResponseBuilderFactory } from "../../../types.ts"; export type HTTP_GET = ( $: OmitValueWhenNever<{ @@ -888,7 +899,7 @@ export type HTTP_GET = ( }; }>; x: WideOperationArgument; - proxy: (url: string) => "COUNTERFACT_RESPONSE"; + proxy: (url: string) => COUNTERFACT_RESPONSE; user: never; }>, ) => @@ -906,8 +917,8 @@ export type HTTP_GET = ( status: 400; } | { status: 415; contentType: "text/plain"; body: string } - | "COUNTERFACT_RESPONSE" - | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: "COUNTERFACT_RESPONSE" }; + | COUNTERFACT_RESPONSE + | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: COUNTERFACT_RESPONSE }; " `; @@ -925,11 +936,12 @@ exports[`end-to-end test generates the same code for pet store that it did on th // Do not edit this file. Edit the OpenAPI file instead. // For more information, see https://github.com/pmcelhaney/counterfact/blob/main/docs/faq-generated-code.md -import type { WideOperationArgument } from "../../../types.d.ts"; -import type { OmitValueWhenNever } from "../../../types.d.ts"; +import type { WideOperationArgument } from "../../../types.ts"; +import type { OmitValueWhenNever } from "../../../types.ts"; +import type { COUNTERFACT_RESPONSE } from "../../../types.ts"; import type { Context } from "@@CONTEXT_FILE_TOKEN@@"; -import type { ResponseBuilderFactory } from "../../../types.d.ts"; -import type { HttpStatusCode } from "../../../types.d.ts"; +import type { ResponseBuilderFactory } from "../../../types.ts"; +import type { HttpStatusCode } from "../../../types.ts"; export type HTTP_GET = ( $: OmitValueWhenNever<{ @@ -946,7 +958,7 @@ export type HTTP_GET = ( }; }>; x: WideOperationArgument; - proxy: (url: string) => "COUNTERFACT_RESPONSE"; + proxy: (url: string) => COUNTERFACT_RESPONSE; user: never; }>, ) => @@ -954,8 +966,8 @@ export type HTTP_GET = ( status: number | undefined; } | { status: 415; contentType: "text/plain"; body: string } - | "COUNTERFACT_RESPONSE" - | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: "COUNTERFACT_RESPONSE" }; + | COUNTERFACT_RESPONSE + | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: COUNTERFACT_RESPONSE }; " `; @@ -983,11 +995,12 @@ exports[`end-to-end test generates the same code for pet store that it did on th // Do not edit this file. Edit the OpenAPI file instead. // For more information, see https://github.com/pmcelhaney/counterfact/blob/main/docs/faq-generated-code.md -import type { WideOperationArgument } from "../../../types.d.ts"; -import type { OmitValueWhenNever } from "../../../types.d.ts"; +import type { WideOperationArgument } from "../../../types.ts"; +import type { OmitValueWhenNever } from "../../../types.ts"; +import type { COUNTERFACT_RESPONSE } from "../../../types.ts"; import type { Context } from "@@CONTEXT_FILE_TOKEN@@"; -import type { ResponseBuilderFactory } from "../../../types.d.ts"; -import type { HttpStatusCode } from "../../../types.d.ts"; +import type { ResponseBuilderFactory } from "../../../types.ts"; +import type { HttpStatusCode } from "../../../types.ts"; import type { User } from "../../components/schemas/User.js"; export type HTTP_GET = ( @@ -1022,7 +1035,7 @@ export type HTTP_GET = ( }; }>; x: WideOperationArgument; - proxy: (url: string) => "COUNTERFACT_RESPONSE"; + proxy: (url: string) => COUNTERFACT_RESPONSE; user: never; }>, ) => @@ -1043,8 +1056,8 @@ export type HTTP_GET = ( status: 404; } | { status: 415; contentType: "text/plain"; body: string } - | "COUNTERFACT_RESPONSE" - | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: "COUNTERFACT_RESPONSE" }; + | COUNTERFACT_RESPONSE + | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: COUNTERFACT_RESPONSE }; export type HTTP_PUT = ( $: OmitValueWhenNever<{ @@ -1061,7 +1074,7 @@ export type HTTP_PUT = ( }; }>; x: WideOperationArgument; - proxy: (url: string) => "COUNTERFACT_RESPONSE"; + proxy: (url: string) => COUNTERFACT_RESPONSE; user: never; }>, ) => @@ -1069,8 +1082,8 @@ export type HTTP_PUT = ( status: number | undefined; } | { status: 415; contentType: "text/plain"; body: string } - | "COUNTERFACT_RESPONSE" - | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: "COUNTERFACT_RESPONSE" }; + | COUNTERFACT_RESPONSE + | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: COUNTERFACT_RESPONSE }; export type HTTP_DELETE = ( $: OmitValueWhenNever<{ @@ -1092,7 +1105,7 @@ export type HTTP_DELETE = ( }; }>; x: WideOperationArgument; - proxy: (url: string) => "COUNTERFACT_RESPONSE"; + proxy: (url: string) => COUNTERFACT_RESPONSE; user: never; }>, ) => @@ -1103,8 +1116,8 @@ export type HTTP_DELETE = ( status: 404; } | { status: 415; contentType: "text/plain"; body: string } - | "COUNTERFACT_RESPONSE" - | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: "COUNTERFACT_RESPONSE" }; + | COUNTERFACT_RESPONSE + | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: COUNTERFACT_RESPONSE }; " `; diff --git a/test/typescript-generator/__snapshots__/operation-type-coder.test.js.snap b/test/typescript-generator/__snapshots__/operation-type-coder.test.js.snap index 04fb86e9..82f63163 100644 --- a/test/typescript-generator/__snapshots__/operation-type-coder.test.js.snap +++ b/test/typescript-generator/__snapshots__/operation-type-coder.test.js.snap @@ -20,7 +20,7 @@ exports[`an OperationTypeCoder falls back to root level produces (OpenAPI 2) 1`] }; }>; x: SharedType; - proxy: (url: string) => "COUNTERFACT_RESPONSE"; + proxy: (url: string) => COUNTERFACT_RESPONSE; user: never; }>, ) => @@ -30,8 +30,8 @@ exports[`an OperationTypeCoder falls back to root level produces (OpenAPI 2) 1`] body?: Type; } | { status: 415; contentType: "text/plain"; body: string } - | "COUNTERFACT_RESPONSE" - | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: "COUNTERFACT_RESPONSE" }; + | COUNTERFACT_RESPONSE + | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: COUNTERFACT_RESPONSE }; " `; @@ -73,7 +73,7 @@ exports[`an OperationTypeCoder generates a complex post operation (OpenAPI 2 wit }; }>; x: SharedType; - proxy: (url: string) => "COUNTERFACT_RESPONSE"; + proxy: (url: string) => COUNTERFACT_RESPONSE; user: never; }>, ) => @@ -93,8 +93,8 @@ exports[`an OperationTypeCoder generates a complex post operation (OpenAPI 2 wit body?: Type; } | { status: 415; contentType: "text/plain"; body: string } - | "COUNTERFACT_RESPONSE" - | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: "COUNTERFACT_RESPONSE" }; + | COUNTERFACT_RESPONSE + | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: COUNTERFACT_RESPONSE }; " `; @@ -136,7 +136,7 @@ exports[`an OperationTypeCoder generates a complex post operation (OpenAPI 2) 1` }; }>; x: SharedType; - proxy: (url: string) => "COUNTERFACT_RESPONSE"; + proxy: (url: string) => COUNTERFACT_RESPONSE; user: never; }>, ) => @@ -156,8 +156,8 @@ exports[`an OperationTypeCoder generates a complex post operation (OpenAPI 2) 1` body?: Type; } | { status: 415; contentType: "text/plain"; body: string } - | "COUNTERFACT_RESPONSE" - | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: "COUNTERFACT_RESPONSE" }; + | COUNTERFACT_RESPONSE + | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: COUNTERFACT_RESPONSE }; " `; @@ -199,7 +199,7 @@ exports[`an OperationTypeCoder generates a complex post operation 1`] = ` }; }>; x: SharedType; - proxy: (url: string) => "COUNTERFACT_RESPONSE"; + proxy: (url: string) => COUNTERFACT_RESPONSE; user: never; }>, ) => @@ -219,8 +219,8 @@ exports[`an OperationTypeCoder generates a complex post operation 1`] = ` body?: Type; } | { status: 415; contentType: "text/plain"; body: string } - | "COUNTERFACT_RESPONSE" - | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: "COUNTERFACT_RESPONSE" }; + | COUNTERFACT_RESPONSE + | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: COUNTERFACT_RESPONSE }; " `; @@ -244,7 +244,7 @@ exports[`an OperationTypeCoder generates a simple get operation (OpenAPI 2) 1`] }; }>; x: SharedType; - proxy: (url: string) => "COUNTERFACT_RESPONSE"; + proxy: (url: string) => COUNTERFACT_RESPONSE; user: never; }>, ) => @@ -254,8 +254,8 @@ exports[`an OperationTypeCoder generates a simple get operation (OpenAPI 2) 1`] body?: Type; } | { status: 415; contentType: "text/plain"; body: string } - | "COUNTERFACT_RESPONSE" - | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: "COUNTERFACT_RESPONSE" }; + | COUNTERFACT_RESPONSE + | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: COUNTERFACT_RESPONSE }; " `; @@ -279,7 +279,7 @@ exports[`an OperationTypeCoder generates a simple get operation 1`] = ` }; }>; x: SharedType; - proxy: (url: string) => "COUNTERFACT_RESPONSE"; + proxy: (url: string) => COUNTERFACT_RESPONSE; user: never; }>, ) => @@ -289,8 +289,8 @@ exports[`an OperationTypeCoder generates a simple get operation 1`] = ` body?: Type; } | { status: 415; contentType: "text/plain"; body: string } - | "COUNTERFACT_RESPONSE" - | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: "COUNTERFACT_RESPONSE" }; + | COUNTERFACT_RESPONSE + | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: COUNTERFACT_RESPONSE }; " `; @@ -314,7 +314,7 @@ exports[`an OperationTypeCoder generates an auth object for basic authentication }; }>; x: SharedType; - proxy: (url: string) => "COUNTERFACT_RESPONSE"; + proxy: (url: string) => COUNTERFACT_RESPONSE; user: { username?: string; password?: string }; }>, ) => @@ -324,7 +324,7 @@ exports[`an OperationTypeCoder generates an auth object for basic authentication body?: Type; } | { status: 415; contentType: "text/plain"; body: string } - | "COUNTERFACT_RESPONSE" - | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: "COUNTERFACT_RESPONSE" }; + | COUNTERFACT_RESPONSE + | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: COUNTERFACT_RESPONSE }; " `; From 49e62628112258d4e12e2745744f91435b37fb63 Mon Sep 17 00:00:00 2001 From: Patrick McElhaney Date: Mon, 29 Jul 2024 19:03:26 -0400 Subject: [PATCH 4/7] remove an unused type --- src/server/types.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/server/types.ts b/src/server/types.ts index d7e159d1..f8a27d43 100644 --- a/src/server/types.ts +++ b/src/server/types.ts @@ -119,8 +119,6 @@ interface ResponseBuilder { xml: (body: unknown) => ResponseBuilder; } -type ArrayToUnion = T[number]; - type GenericResponseBuilderInner< Response extends OpenApiResponse = OpenApiResponse, > = OmitValueWhenNever<{ From d5770f20cc90f4694b2d732073a8d041e9c713a9 Mon Sep 17 00:00:00 2001 From: Patrick McElhaney Date: Mon, 29 Jul 2024 19:13:34 -0400 Subject: [PATCH 5/7] update CI to use LTS node version --- .github/workflows/ci.yaml | 2 +- .github/workflows/coveralls.yaml | 4 ++-- .github/workflows/debug-windows.yaml | 2 +- .github/workflows/mutation-testing.yaml | 2 +- .github/workflows/release.yaml | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index db255c5f..268b985e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -22,7 +22,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-node@v4 with: - node-version: 22.x + node-version: lts/* cache: yarn id: setup-node - name: Get Node Version diff --git a/.github/workflows/coveralls.yaml b/.github/workflows/coveralls.yaml index d318cfd8..5a94251a 100644 --- a/.github/workflows/coveralls.yaml +++ b/.github/workflows/coveralls.yaml @@ -9,10 +9,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Setup Node.js 18.x + - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: 18.x + node-version: lts/* cache: yarn - name: install, run tests diff --git a/.github/workflows/debug-windows.yaml b/.github/workflows/debug-windows.yaml index 6ffeeabc..ad430d2d 100644 --- a/.github/workflows/debug-windows.yaml +++ b/.github/workflows/debug-windows.yaml @@ -18,7 +18,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-node@v4 with: - node-version: 18.x + node-version: lts/* cache: yarn id: setup-node - name: Get Node Version diff --git a/.github/workflows/mutation-testing.yaml b/.github/workflows/mutation-testing.yaml index fceed27c..f6a897e1 100644 --- a/.github/workflows/mutation-testing.yaml +++ b/.github/workflows/mutation-testing.yaml @@ -17,7 +17,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-node@v4 with: - node-version: 18.x + node-version: lts/* cache: yarn id: setup-node - name: Get Node Version diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index bb850731..39c5912d 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -15,10 +15,10 @@ jobs: - name: Checkout Repo uses: actions/checkout@v4 - - name: Setup Node.js 18.x + - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: 18.x + node-version: lts/* cache: yarn - name: Get Node Version From b8196fa154b27bffbeb656a1388bdfee9c7eb516 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 29 Jul 2024 23:19:16 +0000 Subject: [PATCH 6/7] chore(deps): update dependency husky to v9.1.3 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index c1aa5d34..2558358c 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ "eslint-plugin-jest-dom": "5.4.0", "eslint-plugin-no-explicit-type-exports": "0.12.1", "eslint-plugin-unused-imports": "4.0.1", - "husky": "9.1.2", + "husky": "9.1.3", "jest": "29.7.0", "node-mocks-http": "1.15.0", "nodemon": "3.1.4", diff --git a/yarn.lock b/yarn.lock index 2e7ba40c..3a5ebafe 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6534,10 +6534,10 @@ human-signals@^5.0.0: resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-5.0.0.tgz#42665a284f9ae0dade3ba41ebc37eb4b852f3a28" integrity sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ== -husky@9.1.2: - version "9.1.2" - resolved "https://registry.yarnpkg.com/husky/-/husky-9.1.2.tgz#ddaf290384c7adab4fd3143571c73d05b19f42ee" - integrity sha512-1/aDMXZdhr1VdJJTLt6e7BipM0Jd9qkpubPiIplon1WmCeOy3nnzsCMeBqS9AsL5ioonl8F8y/F2CLOmk19/Pw== +husky@9.1.3: + version "9.1.3" + resolved "https://registry.yarnpkg.com/husky/-/husky-9.1.3.tgz#46cddff01f9a551f87b39accc67860bce5d00680" + integrity sha512-ET3TQmQgdIu0pt+jKkpo5oGyg/4MQZpG6xcam5J5JyNJV+CBT23OBpCF15bKHKycRyMH9k6ONy8g2HdGIsSkMQ== iconv-lite@0.4.24, iconv-lite@^0.4.24, iconv-lite@~0.4.13: version "0.4.24" From 69bb1a5a02deb11a333183230a7d5ee58b3a2b1d Mon Sep 17 00:00:00 2001 From: Patrick McElhaney Date: Mon, 29 Jul 2024 20:34:06 -0400 Subject: [PATCH 7/7] test coverage dropped below the threshold in Windows (which skips one test) --- jest.config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jest.config.js b/jest.config.js index 65860047..9d5abfeb 100644 --- a/jest.config.js +++ b/jest.config.js @@ -14,8 +14,8 @@ export default { global: { branches: 80, functions: 80, - lines: 80, - statements: 80, + lines: 77, + statements: 77, }, },