Package Exports
- typeorm-codebase-sync
- typeorm-codebase-sync/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (typeorm-codebase-sync) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
TypeORM Codebase Sync
Automatically update your codebase to add migrations, entities and subscribers to your data-source.ts file
Installation
- Install dependencies
npm install --save typeorm typescript ts-node- Install
typeorm-codebase-sync
npm install --save typeorm-codebase-sync- Add a script to
package.json
npm set-script "typeorm-sync" "typeorm-codebase-sync addReferences --dataSource ./src/db/data-source.ts --migrations ./src/db/migrations --entities ./src/db/entities --subscribers ./src/db/subscribers"- To automatically run
typeorm-syncafter using the typeorm CLI, editpackage.json:
npm set-script "posttypeorm" "npm run typeorm-sync"Given that your
package.jsoncontains a script calledtypeorm, After you runnpm run typeorm -- <params>, the scripttypeorm-syncwill automatically get called.
Documentation
addReferences command
Usage: typeorm-codebase-sync addReferences --dataSource <path> [options]
Required:
-d, --dataSource Path to a data-source.ts file [string] [required]
Files:
-m, --migrations Glob of migration files or folders containing migration files [array]
-e, --entities Glob of entity files or folders containing entity files [array]
-s, --subscribers Glob of subscriber files or folders containing subscriber files [array]
Options:
-h, --help Show help [boolean]
-v, --version Show version number [boolean] [boolean]