Skip to content

Commit

Permalink
docs: update CHANGELOG; chore: lint index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
js2me committed Jul 13, 2023
1 parent 9af7d5d commit 76e5920
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
9 changes: 5 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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 <string>` 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 {
Expand Down
19 changes: 10 additions & 9 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,10 @@ const program = cli({
default: codeGenBaseConfig.sortRoutes,
},
{
flags: "--custom-config <string>",
description: "custom config: primitiveTypeConstructs, hooks, ... ",
flags: '--custom-config <string>',
description: 'custom config: primitiveTypeConstructs, hooks, ... ',
default: '',
}
},
],
});

Expand Down Expand Up @@ -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 {
Expand All @@ -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,
Expand Down

0 comments on commit 76e5920

Please sign in to comment.