diff --git a/package.json b/package.json index 09f63c6..8f2e83e 100644 --- a/package.json +++ b/package.json @@ -2,13 +2,13 @@ "name": "readts", "version": "0.2.0", "description": "TypeScript exported definitions parser", - "main": "dist/readts.js", - "typings": "dist/readts.d.ts", + "main": "dist/index.js", + "typings": "dist/index.d.ts", "scripts": { "tsc": "tsc", "docts": "docts", "prepublish": "tsc", - "test": "node dist/readts.js" + "test": "node dist/index.js" }, "author": "Juha Järvi", "license": "MIT", @@ -22,7 +22,7 @@ "homepage": "https://github.com/charto/readts#readme", "devDependencies": { "@types/node": "^8.9.4", - "docts": "~0.1.0" + "docts": "~0.2.0" }, "dependencies": { "typescript": "^2.7.2" diff --git a/src/ClassSpec.ts b/src/ClassSpec.ts index 4d66fd3..c66e9b4 100644 --- a/src/ClassSpec.ts +++ b/src/ClassSpec.ts @@ -2,9 +2,9 @@ // Released under the MIT license, see LICENSE. import * as ts from 'typescript'; -import * as readts from './readts'; +import * as readts from './index'; -import {SymbolSpec} from './Parser'; +import { SymbolSpec } from './Parser'; /** Class or interface and its members. */ diff --git a/src/FunctionSpec.ts b/src/FunctionSpec.ts index 32e80e1..b9a423e 100644 --- a/src/FunctionSpec.ts +++ b/src/FunctionSpec.ts @@ -2,9 +2,9 @@ // Released under the MIT license, see LICENSE. import * as ts from 'typescript'; -import * as readts from './readts'; +import * as readts from './index'; -import {SymbolSpec} from './Parser'; +import { SymbolSpec } from './Parser'; /** Function or method with any number of overloaded signatures. */ diff --git a/src/IdentifierSpec.ts b/src/IdentifierSpec.ts index 2b1a1c9..92ad6cc 100644 --- a/src/IdentifierSpec.ts +++ b/src/IdentifierSpec.ts @@ -2,9 +2,9 @@ // Released under the MIT license, see LICENSE. import * as ts from 'typescript'; -import * as readts from './readts'; +import * as readts from './index'; -import {SymbolSpec} from './Parser'; +import { SymbolSpec } from './Parser'; /** Property, function / method parameter or variable. */ diff --git a/src/ModuleSpec.ts b/src/ModuleSpec.ts index 70c3777..d8de104 100644 --- a/src/ModuleSpec.ts +++ b/src/ModuleSpec.ts @@ -2,7 +2,7 @@ // Released under the MIT license, see LICENSE. import * as ts from 'typescript'; -import * as readts from './readts'; +import * as readts from './index'; /** Module or source file. */ diff --git a/src/Parser.ts b/src/Parser.ts index 0d126e1..cd26b89 100644 --- a/src/Parser.ts +++ b/src/Parser.ts @@ -1,9 +1,9 @@ // This file is part of readts, copyright (c) 2016 BusFaster Ltd. // Released under the MIT license, see LICENSE. -import * as ts from 'typescript'; -import * as readts from './readts'; import * as path from 'path'; +import * as ts from 'typescript'; +import * as readts from './index'; export interface SourcePos { sourcePath: string; diff --git a/src/SignatureSpec.ts b/src/SignatureSpec.ts index e97fe28..32b7e97 100644 --- a/src/SignatureSpec.ts +++ b/src/SignatureSpec.ts @@ -2,9 +2,9 @@ // Released under the MIT license, see LICENSE. import * as ts from 'typescript'; -import * as readts from './readts'; +import * as readts from './index'; -import {SymbolSpec} from './Parser'; +import { SymbolSpec } from './Parser'; /** Function or method signature defining input and output types. */ diff --git a/src/TypeSpec.ts b/src/TypeSpec.ts index 78657bb..03f427b 100644 --- a/src/TypeSpec.ts +++ b/src/TypeSpec.ts @@ -2,7 +2,7 @@ // Released under the MIT license, see LICENSE. import * as ts from 'typescript'; -import * as readts from './readts'; +import * as readts from './index'; export type FormatHook = (spec: TypeSpec, output?: string, hooks?: FormatHooks) => string; diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..6c97d15 --- /dev/null +++ b/src/index.ts @@ -0,0 +1,10 @@ +// This file is part of readts, copyright (c) 2016 BusFaster Ltd. +// Released under the MIT license, see LICENSE. + +export { IdentifierSpec } from './IdentifierSpec'; +export { SignatureSpec } from './SignatureSpec'; +export { FunctionSpec } from './FunctionSpec'; +export { ClassSpec } from './ClassSpec'; +export { ModuleSpec } from './ModuleSpec'; +export { TypeSpec, FormatHook, FormatHooks } from './TypeSpec'; +export { Parser, SourcePos, RefSpec } from './Parser'; diff --git a/src/readts.ts b/src/readts.ts deleted file mode 100644 index 46f7f41..0000000 --- a/src/readts.ts +++ /dev/null @@ -1,10 +0,0 @@ -// This file is part of readts, copyright (c) 2016 BusFaster Ltd. -// Released under the MIT license, see LICENSE. - -export {IdentifierSpec} from './IdentifierSpec'; -export {SignatureSpec} from './SignatureSpec'; -export {FunctionSpec} from './FunctionSpec'; -export {ClassSpec} from './ClassSpec'; -export {ModuleSpec} from './ModuleSpec'; -export {TypeSpec, FormatHook, FormatHooks} from './TypeSpec'; -export {Parser, SourcePos, RefSpec} from './Parser'; diff --git a/tsconfig.json b/tsconfig.json index b9dd6a1..6b0b93c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,15 +1,17 @@ { + "compileOnSave": true, "compilerOptions": { "declaration": true, "experimentalDecorators": true, "module": "commonjs", "moduleResolution": "node", "noImplicitAny": true, + "noImplicitThis": true, "outDir": "dist", "removeComments": false, "target": "es5" }, "files": [ - "src/readts.ts" + "src/index.ts" ] }