From 088201dc69dab043c1e0ff9c37ad2f244bbf6e82 Mon Sep 17 00:00:00 2001 From: simon Date: Thu, 27 Jan 2022 06:46:37 +0000 Subject: [PATCH 1/6] Dry run canary --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d4db882..974a549 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "example": "hygen compeller new --directory example", "prepack": "yarn clean && yarn build", "prepare": "husky install", - "pub:canary": "release-it patch --preRelease=alpha --npm.tag=alpha", + "pub:canary": "release-it --preRelease=alpha --npm.tag=alpha", "pub:main": "release-it patch", "release": "release-it", "test": "jest" From a5468a519700368f16b1e95e59dd8a43a463f5d3 Mon Sep 17 00:00:00 2001 From: simon Date: Thu, 27 Jan 2022 06:49:31 +0000 Subject: [PATCH 2/6] Whats in a name man flow comes first --- README.md | 1 - assets/logo.drawio.svg | 31 ------------------------------- 2 files changed, 32 deletions(-) delete mode 100644 assets/logo.drawio.svg diff --git a/README.md b/README.md index f7af494..bc4fd4c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ -![Compeller basic logo](./assets/logo.drawio.svg) # Compeller A strong typescript binding for your OpenAPI Schema that doesn't need generation. diff --git a/assets/logo.drawio.svg b/assets/logo.drawio.svg deleted file mode 100644 index eec3aa6..0000000 --- a/assets/logo.drawio.svg +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - -
-
-
- Compeller -
-
-
-
- - Compeller - -
-
-
- - - - - Viewer does not support full SVG 1.1 - - - -
From 3d79468de3a0c83a24c7693a052794e8024fec61 Mon Sep 17 00:00:00 2001 From: simon Date: Thu, 27 Jan 2022 06:54:03 +0000 Subject: [PATCH 3/6] Strict typescript and better function documentation --- src/compeller.ts | 14 ++++++++++++++ tsconfig.json | 3 ++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/compeller.ts b/src/compeller.ts index bdc646e..aaf5da5 100644 --- a/src/compeller.ts +++ b/src/compeller.ts @@ -31,6 +31,14 @@ export const compeller = < ) => { const path = route as string; + /** + * + * @param statusCode The response code that the API returns + * @param body The JSON body for the API that is associated with that + * response code + * + * @returns + */ const response = < R extends keyof S, SC extends T['paths'][P][M]['responses'][R]['content'][U]['schema'] @@ -42,6 +50,12 @@ export const compeller = < body: JSON.stringify(body), }); + /** + * The request validator attaches request body validation to the request + * handler for a path. + * + * @returns Ajv validation function for the inferred schema + */ const validateRequestBody = < SC extends T['paths'][P][M]['requestBody']['content'][U]['schema'] >() => { diff --git a/tsconfig.json b/tsconfig.json index bb26ef9..b9d8e57 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,6 +3,7 @@ "include": ["src/**/*.ts"], "compilerOptions": { "outDir": "./dist", - "declaration": true + "declaration": true, + "strict": true } } From 5758b60f0c9349a90652a9d0585c326f8fb7db8a Mon Sep 17 00:00:00 2001 From: simon Date: Thu, 27 Jan 2022 06:55:14 +0000 Subject: [PATCH 4/6] Add incremental for faster builds in dev --- tsconfig.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index b9d8e57..5f20024 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,6 +4,7 @@ "compilerOptions": { "outDir": "./dist", "declaration": true, - "strict": true + "strict": true, + "incremental": true } } From 784b64456f548b444410515c7abaac58cdd26805 Mon Sep 17 00:00:00 2001 From: simon Date: Thu, 27 Jan 2022 06:57:16 +0000 Subject: [PATCH 5/6] Mark compeller as alpha --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index bc4fd4c..20808a0 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Compeller +🚨 Alpha software 🚨 + A strong typescript binding for your OpenAPI Schema that doesn't need generation. - [Compeller](#compeller) From 0d7233c44d5dc110b71452b32f3a662272f34df6 Mon Sep 17 00:00:00 2001 From: simon Date: Thu, 27 Jan 2022 07:00:23 +0000 Subject: [PATCH 6/6] Ignore incremental build cache --- .npmignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .npmignore diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..43370fa --- /dev/null +++ b/.npmignore @@ -0,0 +1 @@ +*.tsbuildinfo