From ec69f6caf3a9ba9e72720b1046e2ce4a30291a96 Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Sun, 13 Dec 2020 19:20:36 +0100 Subject: [PATCH] removed the lib generation part --- package.json | 4 +--- src/openapi_export.ts | 8 ++------ 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 862ee11..61ecdd4 100644 --- a/package.json +++ b/package.json @@ -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": [ diff --git a/src/openapi_export.ts b/src/openapi_export.ts index 21e9106..8c866be 100644 --- a/src/openapi_export.ts +++ b/src/openapi_export.ts @@ -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"); }