Skip to content

Commit d6f8cff

Browse files
committed
1 parent 71cd01b commit d6f8cff

File tree

3 files changed

+18
-17
lines changed

3 files changed

+18
-17
lines changed

.eslintrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"@typescript-eslint/no-explicit-any": 0,
1818
"@typescript-eslint/no-inferrable-types": 0,
1919
"@typescript-eslint/no-non-null-assertion": 0,
20+
"@typescript-eslint/no-var-requires": 0,
2021
"@typescript-eslint/ban-ts-ignore": 0,
2122
"@typescript-eslint/ban-ts-comment": 0,
2223
"@typescript-eslint/explicit-function-return-type": 0,

bin/index.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ const pkg = require('../package.json');
88

99
program
1010
.version(pkg.version)
11-
.option('--input [value]', 'Path to swagger specification', './spec.json')
12-
.option('--output [value]', 'Output directory', './generated')
13-
.option('--client [value]', 'HTTP client to generate [fetch, xhr]', 'fetch')
14-
.option('--useOptions', 'Use options vs arguments style functions', false)
15-
.option('--useUnionTypes', 'Use inclusive union types', false)
16-
.option('--exportCore', 'Generate core', true)
17-
.option('--exportServices', 'Generate services', true)
18-
.option('--exportModels', 'Generate models', true)
19-
.option('--exportSchemas', 'Generate schemas', false)
11+
.option('-i, --input <value>', 'Path to swagger specification', './spec.json')
12+
.option('-o, --output <value>', 'Output directory', './generated')
13+
.option('-c, --client <value>', 'HTTP client to generate [fetch, xhr]', 'fetch')
14+
.option('--useOptions', 'Use options vs arguments style functions')
15+
.option('--useUnionTypes', 'Use inclusive union types')
16+
.option('--exportCore <value>', 'Generate core', true)
17+
.option('--exportServices <value>', 'Generate services', true)
18+
.option('--exportModels <value>', 'Generate models', true)
19+
.option('--exportSchemas <value>', 'Generate schemas', false)
2020
.parse(process.argv);
2121

2222
const OpenAPI = require(path.resolve(__dirname, '../dist/index.js'));
@@ -28,10 +28,10 @@ if (OpenAPI) {
2828
httpClient: program.client,
2929
useOptions: program.useOptions,
3030
useUnionTypes: program.useUnionTypes,
31-
exportCore: program.exportCore,
32-
exportServices: program.exportServices,
33-
exportModels: program.exportModels,
34-
exportSchemas: program.exportSchemas,
31+
exportCore: JSON.parse(program.exportCore) === true,
32+
exportServices: JSON.parse(program.exportServices) === true,
33+
exportModels: JSON.parse(program.exportModels) === true,
34+
exportSchemas: JSON.parse(program.exportSchemas) === true,
3535
})
3636
.then(() => {
3737
process.exit(0);

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@
5050
"test:update": "jest --updateSnapshot",
5151
"test:watch": "jest --watch",
5252
"test:coverage": "jest --coverage",
53-
"eslint": "eslint \"./src/**/*.ts\"",
54-
"eslint:fix": "eslint \"./src/**/*.ts\" --fix",
55-
"prettier": "prettier \"./src/**/*.ts\" --check",
56-
"prettier:fix": "prettier \"./src/**/*.ts\" --write",
53+
"eslint": "eslint \"./src/**/*.ts\" \"./bin/index.js\"",
54+
"eslint:fix": "eslint \"./src/**/*.ts\" \"./bin/index.js\" --fix",
55+
"prettier": "prettier \"./src/**/*.ts\" \"./bin/index.js\" --check",
56+
"prettier:fix": "prettier \"./src/**/*.ts\" \"./bin/index.js\" --write",
5757
"codecov": "codecov --token=66c30c23-8954-4892-bef9-fbaed0a2e42b"
5858
},
5959
"dependencies": {

0 commit comments

Comments
 (0)