diff --git a/package.json b/package.json index d70caee..acdce5f 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,8 @@ "version": "0.3.5", "description": "Generates models for TypeORM from existing databases.", "bin": "bin/typeorm-model-generator", + "main": "./dist/src/library.js", + "types": "./dist/src/library.d.ts", "scripts": { "start": "ts-node ./src/index.ts", "build": "npm run clean && tsc && ncp src/templates/ dist/src/templates/ && ncp package.json dist/package.json", diff --git a/src/library.ts b/src/library.ts new file mode 100644 index 0000000..cc700ea --- /dev/null +++ b/src/library.ts @@ -0,0 +1,19 @@ +import { Column } from "./models/Column"; +import { Entity } from "./models/Entity"; +import { Index } from "./models/Index"; +import { Relation } from "./models/Relation"; +import { RelationId } from "./models/RelationId"; + +// models exports - there may be a more succinct way to export default classes, +// but this was the only one I could find that seemed happy +export type Column = Column; +export type Entity = Entity; +export type Index = Index; +export type Relation = Relation; +export type RelationId = RelationId; + +export * from "./Engine"; +export * from "./IConnectionOptions"; +export * from "./IGenerationOptions"; +export * from "./NamingStrategy"; +export * from "./Utils"; diff --git a/tsconfig.json b/tsconfig.json index 93cff05..f141ecc 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,7 +6,7 @@ "emitDecoratorMetadata": true, "experimentalDecorators": true, "sourceMap": true, - "declaration": false, + "declaration": true, "noFallthroughCasesInSwitch": true, "noImplicitReturns": true, "stripInternal": true,