Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Plugins fail to load in monorepo #826

Open
1 of 3 tasks
EinfachHans opened this issue Nov 14, 2023 · 0 comments
Open
1 of 3 tasks

bug: Plugins fail to load in monorepo #826

EinfachHans opened this issue Nov 14, 2023 · 0 comments

Comments

@EinfachHans
Copy link

I'm submitting a...

  • Bug report
  • Feature request
  • Question

Current behavior

I have a npm monorepo like:

- packages/
  - backend/
    - package.json
 - package.json 

The backend project contains all the pg-migrate stuff.
Npm defaultly installs all node_modules into the root project and only duplicates into the single project folders.

This makes the load of plugin fail if pg-migrate is started from within the backend project, because of this line:

var plugin = require(path.join(options.cwd, 'node_modules', plugins[i]));

Expected behavior

It should work in a monorepo context as well. Maybe by recursively looking into the node_modules folder until reached the root of the project.

Environment


db-migrate version: 0.11.14
plugins with versions: db-migrate-plugin-typescript (2.0.0)
db-migrate driver with versions: pg (1.5.2)

Additional information:
- Node version: 20.9.0
- Platform: Mac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant