From 76e59201aa77bc3989e18a80af15f4d91cbff2ab Mon Sep 17 00:00:00 2001 From: Sergey Volkov Date: Fri, 14 Jul 2023 00:44:33 +0300 Subject: [PATCH] docs: update CHANGELOG; chore: lint index.js --- CHANGELOG.md | 9 +++++---- index.js | 19 ++++++++++--------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d54bbc74..58b5deef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,16 +1,17 @@ # next release BREAKING_CHANGE: change swagger-typescript-api NodeJS "generateApi" function return type -internal: remove redundant internal scripts +BREAKING_CHANGE: remove `rawModelTypes` from output api configuration +feat: `--custom-config ` option (#503) +feat: `--sort-routes` option, ability to sort routes; fix: critical bugs based with extract types and enums fix: sort types option (sort was not correctly work with nested or extracted types) fix: problems based with extracting enums; -feat: ability to sort routes; chore: refactoring the axios imports fix: non-object custom spec extensions (#500) -internal: change process with using custom templates fix(docs): input instead of output in readme -BREAKING_CHANGE: remove `rawModelTypes` from output api configuration +internal: remove redundant internal scripts +internal: change process with using custom templates ```diff interface GenerateApiOutput { diff --git a/index.js b/index.js index f47155e2..5f382e89 100644 --- a/index.js +++ b/index.js @@ -239,10 +239,10 @@ const program = cli({ default: codeGenBaseConfig.sortRoutes, }, { - flags: "--custom-config ", - description: "custom config: primitiveTypeConstructs, hooks, ... ", + flags: '--custom-config ', + description: 'custom config: primitiveTypeConstructs, hooks, ... ', default: '', - } + }, ], }); @@ -297,14 +297,16 @@ program.addCommand({ const main = async () => { const { command, options } = await program.execute({ args: process.argv }); - let customConfig = null + let customConfig = null; if (options.customConfig) { try { - const customConfigPath = resolve(process.cwd(), options.customConfig) - console.log(`✨ found custom config at: ${customConfigPath}`) - customConfig = require(customConfigPath) - } catch (e) {} + const customConfigPath = resolve(process.cwd(), options.customConfig); + console.log(`✨ found custom config at: ${customConfigPath}`); + customConfig = require(customConfigPath); + } catch (e) { + /* empty */ + } } try { @@ -317,7 +319,6 @@ const main = async () => { generateRouteTypes: options.routeTypes, generateClient: !!(options.axios || options.client), httpClientType: options.axios ? HTTP_CLIENT.AXIOS : HTTP_CLIENT.FETCH, - url: options.path, input: resolve(process.cwd(), options.path), output: resolve(process.cwd(), options.output || '.'), ...customConfig,