Skip to content

Commit

Permalink
fix: bump deps and update tests (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
Coobaha authored Aug 21, 2023
1 parent 2aa0ce6 commit 486dae2
Show file tree
Hide file tree
Showing 5 changed files with 373 additions and 332 deletions.
17 changes: 10 additions & 7 deletions generator/gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import type { TsConfigJson } from 'type-fest';
import traverse from 'json-schema-traverse';
import mergeAllOf from 'json-schema-merge-allof';
import type { JSONSchema7 } from 'json-schema';
import { JSONSchema7Definition } from 'json-schema';

const revision = '__v' + require('../package.json').version; // + Date.now();

Expand Down Expand Up @@ -114,7 +115,6 @@ export default async (params: { files: string[] }) => {
diagnostics: false,
checkJs: true,
skipLibCheck: true,
skipDefaultLibCheck: true,
strict: true,
};

Expand Down Expand Up @@ -191,12 +191,15 @@ export default async (params: { files: string[] }) => {
if (typeof schema.response === 'boolean') continue;
if (typeof schema.response?.properties?.content === 'boolean') continue;

const response = Object.entries(schema.response?.properties ?? {}).reduce((acc, [status, response]) => {
if (typeof response !== 'boolean' && response?.properties?.content) {
acc[status] = response.properties.content;
}
return acc;
}, {} as Record<string, TJS.DefinitionOrBoolean>);
const response = Object.entries(schema.response?.properties ?? {}).reduce(
(acc, [status, response]) => {
if (typeof response !== 'boolean' && response?.properties?.content) {
acc[status] = response.properties.content;
}
return acc;
},
{} as Record<string, JSONSchema7Definition>,
);
fastify[key] = {
// @ts-ignore
security: schema.security ? true : undefined,
Expand Down
30 changes: 15 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,38 +7,38 @@
"typed-fastify-schema": "bin/gen.bin.js"
},
"dependencies": {
"@types/json-schema": "^7.0.11",
"@types/json-schema": "^7.0.12",
"crypto-js": "^4.1.1",
"glob": "^10.2.5",
"glob": "^10.3.3",
"json-schema-merge-allof": "^0.8.1",
"json-schema-traverse": "^1.0.0",
"typescript-json-schema": "^0.56.0",
"typescript-json-schema": "^0.59.0",
"yargs": "^17.7.2"
},
"devDependencies": {
"@fastify/swagger": "^8.4.0",
"@fastify/swagger-ui": "^1.8.1",
"@fastify/swagger": "^8.9.0",
"@fastify/swagger-ui": "^1.9.3",
"@types/crypto-js": "^4.1.1",
"@types/glob": "^8.1.0",
"@types/json-schema-merge-allof": "^0.6.1",
"@types/node": "^20.2.1",
"@types/prettier": "^2.7.2",
"@types/lint-staged": "^13.2.0",
"@types/node": "^20.5.1",
"@types/split2": "^4.2.0",
"@types/tap": "^15.0.8",
"@types/yargs": "^17.0.24",
"fastify": "^4.17.0",
"fastify": "^4.21.0",
"husky": "^8.0.3",
"lint-staged": "^13.2.2",
"pino-pretty": "^10.0.0",
"lint-staged": "^14.0.1",
"pino-pretty": "^10.2.0",
"pinst": "^3.0.0",
"prettier": "^2.8.8",
"prettier": "^3.0.2",
"split2": "^4.2.0",
"syncpack": "^9.8.6",
"tap": "^16.3.4",
"syncpack": "^11.2.1",
"tap": "^16.3.8",
"ts-node-dev": "^2.0.0",
"tsd": "^0.28.1",
"type-fest": "^3.10.0",
"typescript": "^5.0.4"
"type-fest": "^4.2.0",
"typescript": "^5.1.6"
},
"directories": {
"test": "test/",
Expand Down
Loading

0 comments on commit 486dae2

Please sign in to comment.