Skip to content

Commit f9732fc

Browse files
DanielJoyceDaniel Joyce
authored and
Daniel Joyce
committed
fix: Change ts-node dependency to peer dependency
The DB-Migrate typescript plugin lists ts-node as a sub dependency which causes it to be installed under its own node_modules directory Since node allows multiple versions of the same library to be installed and loaded at the same time, the ts-node installed under the plugin has no access to any dependencies installed in the parent project node_modules directory, even as cwd points to the proper place So compilation fails By moving the dependency to a peer dependency, the ts-node dependency (if not already installed) is installed in the project node_modules directory, and so now has access to all other typescript dependencies Signed-off-by: Daniel <[email protected]>
1 parent 715efe7 commit f9732fc

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ A TypeScript plugin for db-migrate.
66
Usage is very simple. Simply install this plugin via `npm install db-migrate-plugin-typescript`
77
or if using yarn: `yarn add db-migrate-plugin-typescript`
88

9+
This plugin has a peer dependency on ts-node as well. So you will need to install that as a dependency or dev-dependency as well, `npm install ts-node` or `yarn add ts-node` if using yarn.
10+
911
The plugin will automatically resolve and compile any `.ts` files in your migrations directory,
1012
using your regular `tsconfig.json`
1113

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "1.0.1",
44
"description": "A db-migrate plugin to enable TypeScript style migrations.",
55
"main": "index.js",
6-
"dependencies": {
6+
"peerDependencies": {
77
"ts-node": "^3.3.0"
88
},
99
"devDependencies": {},

0 commit comments

Comments
 (0)