Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various typescript fixes, updated all dependencies, package.json cleanup #49

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.vscode
dist
node_modules
typings
/npm-debug.log
.DS_Store
/yarn-error.log
41 changes: 23 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,21 @@
"url": "https://github.com/mikestead/openapi-client/issues"
},
"engines": {
"node": ">=4.0.0",
"npm": ">=2.14.2"
"node": ">=4.0.0"
},
"main": "dist/index.js",
"bin": {
"openapi": "dist/cli.js"
},
"scripts": {
"setup": "typings install",
"prebuild": "npm run init",
"prebuild": "yarn run init",
"build": "tsc",
"predev": "npm run init",
"predev": "yarn run init",
"dev": "tsc -w",
"init": "npm run clean && npm run copy:template",
"init": "yarn run clean && yarn run copy:template",
"client": "ts-node --files src/cli.ts",
"clean": "shx rm -rf ./dist",
"copy:template": "shx mkdir -p ./dist/gen/js && npm run copy:service-ts && npm run copy:service-js",
"copy:template": "shx mkdir -p ./dist/gen/js && yarn run copy:service-ts && yarn run copy:service-js",
"copy:service-ts": "shx cp ./src/gen/js/service.ts.template ./dist/gen/js/service.ts.template",
"copy:service-js": "shx cp ./src/gen/js/service.js.template ./dist/gen/js/service.js.template"
},
Expand All @@ -48,20 +47,26 @@
"codegen"
],
"dependencies": {
"chalk": "^1.1.3",
"commander": "^2.9.0",
"chalk": "^2.4.1",
"commander": "2.19.0",
"isomorphic-fetch": "^2.2.1",
"js-yaml": "^3.6.1",
"js-yaml": "^3.12.0",
"mkdirp": "^0.5.1",
"mustache": "^2.2.1"
"mustache": "^3.0.0"
},
"devDependencies": {
"cross-env": "^1.0.7",
"expect": "^1.20.1",
"mocha": "^2.5.3",
"shx": "^0.1.2",
"tslint": "^3.10.2",
"typescript": "^1.8.10",
"typings": "^1.0.5"
"@types/expect": "^1.20.3",
"@types/isomorphic-fetch": "^0.0.34",
"@types/js-yaml": "^3.11.2",
"@types/mkdirp": "^0.5.2",
"@types/mocha": "^5.2.5",
"@types/node": "^10.12.0",
"cross-env": "^5.2.0",
"expect": "^23.6.0",
"mocha": "^5.2.0",
"shx": "^0.3.2",
"ts-node": "^7.0.1",
"tslint": "^5.11.0",
"typescript": "^3.1.3"
}
}
2 changes: 1 addition & 1 deletion src/cli.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env node

import * as program from 'commander'
import * as chalk from 'chalk'
import chalk from 'chalk'
import { genCode } from './index'

const args: any = program
Expand Down
2 changes: 1 addition & 1 deletion src/spec/spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function resolveSpec(src: string | Object, options?: SpecOptions): Promis
}
}

function loadJson(src: string): Promise<ApiSpec> {
function loadJson(src: string): Promise<ApiSpec | any> {
if (/^https?:\/\//im.test(src)) {
return fetch(src)
.then(response => response.json())
Expand Down
5 changes: 3 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
"rootDir": "./src",
"target": "es6",
"module": "commonjs",
"removeComments": false
"removeComments": false,
"skipLibCheck": true
},
"exclude": [
"node_modules",
"dist",
"test",
"sdk"
]
}
}
9 changes: 6 additions & 3 deletions tslint.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"linterOptions": {
"exclude": ["node_modules/**"]
},
"rules": {
"semicolon": [true, "never"],
"variable-name": [true, "ban-keywords", "check-format"]
"semicolon": [true, "never"],
"variable-name": [true, "ban-keywords", "check-format"]
}
}
}
Loading