Provide main entrypoint and generated typings to use the core as a library
This commit is contained in:
parent
ff637721ed
commit
53da13e043
@ -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",
|
||||
|
19
src/library.ts
Normal file
19
src/library.ts
Normal file
@ -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";
|
@ -6,7 +6,7 @@
|
||||
"emitDecoratorMetadata": true,
|
||||
"experimentalDecorators": true,
|
||||
"sourceMap": true,
|
||||
"declaration": false,
|
||||
"declaration": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"noImplicitReturns": true,
|
||||
"stripInternal": true,
|
||||
|
Loading…
Reference in New Issue
Block a user