Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

Commit

Permalink
Update typescript and parser version
Browse files Browse the repository at this point in the history
  • Loading branch information
nachoesmite committed Apr 16, 2018
1 parent 23084d9 commit 6bb0646
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { Promise } from 'es6-promise'

export interface Options {
rejectOnErrors?: boolean
}
Expand Down
3 changes: 3 additions & 0 deletions custom_typings/thenify/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
declare module "thenify" {

}
15 changes: 9 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"test-cov": "istanbul cover --print none -x \"*.spec.js\" blue-tape \"dist/**/*.spec.js\" | tap-spec",
"test-scene": "node test/index.js",
"test": "npm run lint && npm run build && npm run test-cov && npm run test-scene",
"prepublish": "typings install && npm run build"
"prepublish": "npm run build"
},
"repository": {
"type": "git",
Expand All @@ -42,15 +42,18 @@
"blue-tape": "^0.2.0",
"istanbul": "^0.4.2",
"tap-spec": "^4.1.1",
"tslint": "^3.2.0",
"typescript": "^1.8.9",
"typings": "^0.7.9"
"tslint": "^5.9.1",
"typescript": "^2.8.1"
},
"dependencies": {
"any-promise": "^1.1.0",
"@types/blue-tape": "^0.1.31",
"@types/mkdirp": "^0.5.2",
"@types/node": "^9.6.5",
"@types/parse-json": "^4.0.0",
"@types/yargs": "^11.0.0",
"mkdirp": "^0.5.0",
"parse-json": "^2.2.0",
"raml-1-parser": "^1.1",
"raml-1-parser": "^1.1.41",
"thenify": "^3.2.0",
"yargs": "^4.1.0"
}
Expand Down
9 changes: 4 additions & 5 deletions src/bin.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import Promise = require('any-promise')
import thenify = require('thenify')
import { dirname, resolve } from 'path'
import { loadApi } from 'raml-1-parser'
Expand Down Expand Up @@ -44,7 +43,7 @@ export function bin (generator: Generator, pkg: Pkg, argv: string[]): Promise<vo
.array('include')
.alias('i', 'include')
.describe('i', 'Include additional RAML files (E.g. extensions)')
.parse<Args>(argv)
.parse(argv)

return loadApi(args._[2], args.include || [], { rejectOnErrors: true })
.then(function (api: any) {
Expand All @@ -57,8 +56,8 @@ export function bin (generator: Generator, pkg: Pkg, argv: string[]): Promise<vo
const path = resolve(cwd, args.data)

return readFile(path, 'utf8')
.then(contents => parseJson(contents, null, path))
.then(data => generator(json, data))
.then((contents: any) => parseJson(contents, null, path))
.then((data: any) => generator(json, data))
})
.then(function (output: GeneratorResult) {
return objectToFs(resolve(cwd, args.out), output.files)
Expand Down Expand Up @@ -96,6 +95,6 @@ function objectToFs (path: string, object: Files) {
return writeFile(filename, content)
})
},
mkdirp(path).then(() => undefined)
mkdirp(path).then((): any => undefined)
)
}
8 changes: 4 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"compilerOptions": {
"target": "es5",
"target": "es6",
"outDir": "dist/",
"module": "commonjs",
"declaration": true,
"noImplicitAny": true,
"removeComments": true,
"sourceMap": true,
"newLine": "LF"
"newLine": "LF",
"typeRoots": ["node_modules/@types", "custom_typings"]
},
"files": [
"src/index.ts",
"src/index.spec.ts",
"src/bin.ts",
"typings/main.d.ts"
"src/bin.ts"
]
}

0 comments on commit 6bb0646

Please sign in to comment.