diff --git a/.gitignore b/.gitignore index 0cd9558..2a1e48f 100644 --- a/.gitignore +++ b/.gitignore @@ -71,10 +71,5 @@ dist spm_modules .vscode .idea -src/**/*.js -src/**/*.d.ts -test/**/*.js -lib/**/*.d.ts -test/**/*.d.ts -!test/mock/dist/*.d.ts -**/*.js.map \ No newline at end of file +**/*.js.map +lib \ No newline at end of file diff --git a/lib/ast.js b/lib/ast.js deleted file mode 100644 index c8ad2e5..0000000 --- a/lib/ast.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/package-lock.json b/package-lock.json index 63047b7..e6b360b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,9 +14,9 @@ } }, "@types/chai": { - "version": "3.5.1", - "resolved": "http://r.npm.sankuai.com/@types/chai/download/@types/chai-3.5.1.tgz", - "integrity": "sha1-m9d/4SUDrgBkiwlFs46rZmrf/i4=", + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-3.5.2.tgz", + "integrity": "sha1-wRzSgX06QBt7oPWkIPNcVhObHB4=", "dev": true }, "@types/events": { @@ -26,9 +26,9 @@ "dev": true }, "@types/glob": { - "version": "5.0.35", - "resolved": "https://registry.npmjs.org/@types/glob/-/glob-5.0.35.tgz", - "integrity": "sha512-wc+VveszMLyMWFvXLkloixT4n0harUIVZjnpzztaZ0nKLuul7Z32iMt2fUFGAaZ4y1XWjFRMtCI5ewvyh4aIeg==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.0.tgz", + "integrity": "sha512-k1M3Y8Ge0bOkG7U5IZObIhkrzZHMpuFpd5RJK9Gh8ekq0EhiezLLqv2ow14ylTKqXTHSqM6AMySbWEHRo+7qdQ==", "dev": true, "requires": { "@types/events": "*", @@ -43,21 +43,21 @@ "dev": true }, "@types/mocha": { - "version": "2.2.41", - "resolved": "http://r.npm.sankuai.com/@types/mocha/download/@types/mocha-2.2.41.tgz", - "integrity": "sha1-4nzwgXFT658nE7LT9saPHhw8pgg=", + "version": "2.2.48", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-2.2.48.tgz", + "integrity": "sha512-nlK/iyETgafGli8Zh9zJVCTicvU3iajSkRwOh3Hhiva598CMqNJ4NcVCGMTGKpGpTYj/9R8RLzS9NAykSSCqGw==", "dev": true }, "@types/node": { - "version": "7.0.13", - "resolved": "http://r.npm.sankuai.com/@types/node/download/@types/node-7.0.13.tgz", - "integrity": "sha1-GwpT/p75w6XQYbEmzJuRW8pDo/U=", + "version": "10.11.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.11.0.tgz", + "integrity": "sha512-R4Dvw6KjSYn/SpvjRchBOwXr14vVVcFXCtnM3f0aLvlJS8a599rrcEoihcP2/+Z/f75E5GNPd4aWM7j1yei9og==", "dev": true }, "@types/sinon": { - "version": "2.3.7", - "resolved": "http://r.npm.sankuai.com/@types/sinon/download/@types/sinon-2.3.7.tgz", - "integrity": "sha1-6Swv7TKX6uB4140doDKyZ4i0r4Y=", + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-4.3.3.tgz", + "integrity": "sha512-Tt7w/ylBS/OEAlSCwzB0Db1KbxnkycP/1UkQpbvKFYoUuRn4uYsC3xh5TRPrOjTy0i8TIkSz1JdNL4GPVdf3KQ==", "dev": true }, "ansi-regex": { @@ -72,16 +72,16 @@ "dev": true }, "balanced-match": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", - "integrity": "sha1-yz8+PHMtwPAe5wtAPzAuYddwmDg=" + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" }, "brace-expansion": { - "version": "1.1.7", - "resolved": "http://r.npm.sankuai.com/brace-expansion/download/brace-expansion-1.1.7.tgz", - "integrity": "sha1-Pv/DxQ4ABTH7cg6v+A8K6O8jz1k=", + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "requires": { - "balanced-match": "^0.4.1", + "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, @@ -129,7 +129,7 @@ }, "commander": { "version": "2.9.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", + "resolved": "http://registry.npmjs.org/commander/-/commander-2.9.0.tgz", "integrity": "sha1-nJkJQXbhIkDLItbFFGCYQA/g99Q=", "dev": true, "requires": { @@ -212,14 +212,14 @@ "integrity": "sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U=" }, "glob": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz", - "integrity": "sha1-gFIR3wT6rxxjo2ADBs31reULLsg=", + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", - "minimatch": "^3.0.2", + "minimatch": "^3.0.4", "once": "^1.3.0", "path-is-absolute": "^1.0.0" } @@ -422,11 +422,11 @@ "dev": true }, "minimatch": { - "version": "3.0.3", - "resolved": "http://r.npm.sankuai.com/minimatch/download/minimatch-3.0.3.tgz", - "integrity": "sha1-Kk5AkLlrLbBqnX3wEFWmKnfJt3Q=", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "requires": { - "brace-expansion": "^1.0.0" + "brace-expansion": "^1.1.7" } }, "minimist": { @@ -464,6 +464,20 @@ "supports-color": "3.1.2" }, "dependencies": { + "glob": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz", + "integrity": "sha1-gFIR3wT6rxxjo2ADBs31reULLsg=", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.2", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, "growl": { "version": "1.9.2", "resolved": "https://registry.npmjs.org/growl/-/growl-1.9.2.tgz", @@ -741,9 +755,9 @@ "dev": true }, "typescript": { - "version": "2.2.2", - "resolved": "http://r.npm.sankuai.com/typescript/download/typescript-2.2.2.tgz", - "integrity": "sha1-YGAiUIR5tV/6NotY/uljoD39eww=", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.0.3.tgz", + "integrity": "sha512-kk80vLW9iGtjMnIv11qyxLqZm20UklzuR2tL0QAnDIygIUIemcZMxlMWudl9OOt76H3ntVzcTiddQ1/pAAJMYg==", "dev": true }, "validate-npm-package-license": { diff --git a/package.json b/package.json index 863c2b1..0cf30a3 100644 --- a/package.json +++ b/package.json @@ -14,22 +14,22 @@ "author": "Eric Time", "license": "ISC", "devDependencies": { - "@types/chai": "^3.5.0", - "@types/glob": "^5.0.35", - "@types/mocha": "^2.2.40", - "@types/node": "^7.0.13", - "@types/sinon": "^2.3.7", + "@types/chai": "^3.5.2", + "@types/glob": "^7.1.0", + "@types/mocha": "^2.2.48", + "@types/node": "^10.11.0", + "@types/sinon": "^4.3.3", "chai": "^3.5.0", "mocha": "^3.5.3", - "growl": "~>1.10.0", - "sinon": "^4.1.1", - "typescript": "^2.2.2" + "growl": "^1.10.5", + "sinon": "^4.5.0", + "typescript": "^3.0.3" }, "bin": { "thrift-ts": "./bin/thrift-ts.js" }, "dependencies": { - "glob": "^7.1.1", + "glob": "^7.1.3", "thrift-parser": "^0.4.2", "yargs": "^7.1.0" } diff --git a/src/BaseCompiler.ts b/src/BaseCompiler.ts index 9b51288..e1a914a 100755 --- a/src/BaseCompiler.ts +++ b/src/BaseCompiler.ts @@ -18,7 +18,7 @@ import { Method, Service, MapType -} from '../lib/ast'; +} from './ast'; import { INTEND_MODE, SPACE, diff --git a/src/ServiceCompiler.ts b/src/ServiceCompiler.ts index a952f5e..3a73252 100644 --- a/src/ServiceCompiler.ts +++ b/src/ServiceCompiler.ts @@ -7,7 +7,7 @@ import { import { Includes, Service, -} from '../lib/ast'; +} from './ast'; export default class ServiceCompiler extends BaseCompiler { constructor( diff --git a/lib/ast.ts b/src/ast.ts similarity index 100% rename from lib/ast.ts rename to src/ast.ts diff --git a/src/index.ts b/src/index.ts index 5fd794e..d77afc4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,5 @@ import path = require('path'); -import thriftPraser = require('../lib/thriftParser'); +import thriftPraser = require('./thriftParser'); import BaseCompiler from './BaseCompiler'; import ServiceCompiler from './ServiceCompiler'; import { diff --git a/lib/thriftParser.d.ts b/src/thriftParser.d.ts similarity index 100% rename from lib/thriftParser.d.ts rename to src/thriftParser.d.ts diff --git a/lib/thriftParser.js b/src/thriftParser.js similarity index 100% rename from lib/thriftParser.js rename to src/thriftParser.js diff --git a/test/BaseCompiler.test.ts b/test/BaseCompiler.test.ts index 0a77a6c..6cd581b 100644 --- a/test/BaseCompiler.test.ts +++ b/test/BaseCompiler.test.ts @@ -1,9 +1,9 @@ import BaseCompiler from '../src/BaseCompiler'; -import thriftPraser = require('../lib/thriftParser'); +import thriftPraser = require('../src/thriftParser'); import * as sinon from 'sinon'; import * as chai from 'chai'; import * as fs from 'fs'; -import { JsonAST } from '../lib/ast'; +import { JsonAST } from '../src/ast'; import * as Path from 'path'; chai.should(); diff --git a/tsconfig.json b/tsconfig.json index 00623a1..ed0492e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,22 +9,10 @@ "noUnusedParameters": true, "sourceMap": false, "target": "ES6", - "lib": [ - "dom.iterable", - "scripthost", - "es2017" - ], - "typeRoots": [ - "./node_modules/@types/" - ], + "lib": ["es2015", "es2016", "es2017", "es2018", "scripthost"], "experimentalDecorators": true, - "declaration": true + "declaration": true, + "outDir": "lib" }, - "include": [ - "./src/**/*", - "./test/**/*" - ], - "exclude": [ - "./test/mock" - ] + "include": ["./src/**/*"] }