Merge alpha 0.0.5 to master #54

Merged
niggl merged 292 commits from dev into main 2020-12-23 17:05:35 +00:00
2 changed files with 3 additions and 9 deletions
Showing only changes of commit ec69f6caf3 - Show all commits

View File

@ -71,9 +71,7 @@
"test:watch": "jest --watchAll",
"test:ci": "start-server-and-test dev http://localhost:4010/api/openapi.json test",
"seed": "ts-node ./node_modules/typeorm/cli.js schema:sync && ts-node ./node_modules/typeorm-seeding/dist/cli.js seed",
"openapi:export": "ts-node src/openapi_export.ts",
"lib": "rimraf ./lib && npm run openapi:export && npm run lib:generate",
"lib:generate": "npx openapi-typescript-codegen --input ./lib/openapi.json --output ./lib/dist"
"openapi:export": "ts-node src/openapi_export.ts"
},
"nodemonConfig": {
"ignore": [

View File

@ -48,13 +48,9 @@ const spec = routingControllersToSpec(
}
);
if (!fs.existsSync("./lib")) {
fs.mkdirSync("./lib");
}
try {
fs.writeFileSync("./lib/openapi.json", JSON.stringify(spec), { encoding: "utf-8" });
consola.success("Exported openapi spec to lib/openapi.json");
fs.writeFileSync("./openapi.json", JSON.stringify(spec), { encoding: "utf-8" });
consola.success("Exported openapi spec to openapi.json");
} catch (error) {
consola.error("Couldn't export the openapi spec");
}