Merge pull request #233 from arimus/next

Provide main entrypoint and generated typings to use the core as a li…
This commit is contained in:
Kononnable 2019-12-28 12:23:40 +01:00 committed by GitHub
commit 18b1bd6824
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 3 deletions

View File

@ -2,4 +2,5 @@
test/integration/defaultValues/**/*.ts
test/integration/entityTypes/**/*.ts
test/integration/examples/**/*.ts
test/integration/github-issues/**/*.ts
test/integration/github-issues/**/*.ts
dist/**/*.d.ts

View File

@ -3,13 +3,15 @@
"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",
"prepare": "npm run build",
"pretest": "tsc --noEmit",
"test": "nyc --reporter=lcov ts-node ./node_modules/mocha/bin/_mocha test/**/*.test.ts -- --bail",
"posttest": "eslint ./**/*.ts ./src/**/*.ts ./test/**/*.ts",
"posttest": "eslint ./src/**/*.ts ./test/**/*.ts",
"clean": "rimraf coverage output dist",
"prettier": "prettier --write ./src/*.ts ./src/**/*.ts"
},

18
src/library.ts Normal file
View File

@ -0,0 +1,18 @@
import * as Engine from "./Engine";
import * as IConnectionOptions from "./IConnectionOptions";
import * as IGenerationOptions from "./IGenerationOptions";
import * as NamingStrategy from "./NamingStrategy";
import * as Utils from "./Utils";
export { Column } from "./models/Column";
export { Entity } from "./models/Entity";
export { Index } from "./models/Index";
export { Relation } from "./models/Relation";
export { RelationId } from "./models/RelationId";
export {
Engine,
IConnectionOptions,
IGenerationOptions,
NamingStrategy,
Utils
};

View File

@ -6,7 +6,7 @@
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": true,
"declaration": false,
"declaration": true,
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"stripInternal": true,