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

Option to vendor binding files in top-level app?.. #67

Open
busticated opened this issue May 17, 2020 · 0 comments
Open

Option to vendor binding files in top-level app?.. #67

busticated opened this issue May 17, 2020 · 0 comments

Comments

@busticated
Copy link

busticated commented May 17, 2020

hey there 👋

thanks for the super-helpful lib 🙏

i'm looking for a way to "vendor" the binding files for my app such that dependencies (e.g. @serialport/bindings) use the vendor'ed bindings files provided by the root app instead of their module-local default. i don't see a way to do this - am i just missing it?

very roughly, you could:

  1. determine the app_root (perhaps via app-root-path)
  2. determine module_name (the package.json name field for the module - e.g. @serialport/bindings)
  3. add a lookup entry to the list here which is resolved first and attempts to load from a path like:
['app_root', 'vendor', 'module_name',  `abi-v${process.versions.modules}`, 'platform', 'arch', 'bindings']

...does that make sense and fit with your goals for this lib? happy to create a PR if so!

related: serialport/node-serialport#2044

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