Closed kesne closed 3 years ago
Link Height tasks by mentioning a task ID in the pull request title or description, commit messages, or comments.
đź’ˇTip: You can also use "Close T-X" to automatically close a task when the pull request is merged.
đź‘Ť to this change. what's holding this back?
Thank you for opening this pr, but unfortunately it doesn't seem to work right.
The goal is in the install.ts
script to tell dotenv
to read .env
file in the parent project folder.
process.cwd()
will return the path to the npm package project folder.
Needed result: /apps/streamline/streamlinehq/docs/latest/example-app/node_modules/@streamlinehq/streamlinehq/build/../../../..
Result from process.cwd()
: /apps/streamline/streamlinehq/docs/latest/example-app/node_modules/@streamlinehq/streamlinehq
I wish there was a function which would return /apps/streamline/streamlinehq/docs/latest/example-app
when called from the install script inside the npm package, but this doesn't seem to exist. Looks like the solution here is to set the path via an env var which is set outside of .env
file
Interestingly, this seemed to work fine for me. I wonder if different package managers (npm vs yarn vs pnpm) have different behavior around this? I unfortunately don’t have time to work on or debug this so I’ll just going to close this out.
Please check out my implementation of this https://github.com/webalys-hq/streamlinehq-npm/pull/45. Maybe there is a cleaner way?
Hey, please check if this release solves your problem https://github.com/webalys-hq/streamlinehq-npm/releases/tag/3.0.4
This changes to resolve the project root through
process.cwd()
, which is a much more reliable way to resolve it. I tested locally and this seems to work. This should also fix #20 and #22.