babel-plugin-inline-dotenv icon indicating copy to clipboard operation
babel-plugin-inline-dotenv copied to clipboard

Relative paths

Open blackxored opened this issue 8 years ago • 7 comments

This seems to be a common issue with babel plugins, we're doing relative reads (or dotenv ends up doing relative read), so a path with something like '../../.env' (lerna setup, I know :() starts failing. Solved in a fork but wondering how to handle or whether to relay upstream.

blackxored avatar Sep 07 '17 23:09 blackxored

Thanks for the heads up, you can always open a PR with WIP in the title and we can discuss. In the meantime I will look at your branch and think about it.

brysgo avatar Sep 08 '17 18:09 brysgo

Just looked at your patch, I will merge it if you submit a PR.

brysgo avatar Sep 10 '17 15:09 brysgo

My branch is definitely not ready. It solves my own case (having a path like “../../.env”) but it doesn’t take into account others. We also have to factor in whether this breaks other Babel plugins.

-- Best Regards,

Adrian Perez https://adrianperez.codes

On September 10, 2017 at 5:18:11 PM, Bryan Goldstein ( [email protected]) wrote:

Just looked at your patch, I will merge it if you submit a PR.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/brysgo/babel-plugin-inline-dotenv/issues/2#issuecomment-328349380, or mute the thread https://github.com/notifications/unsubscribe-auth/AAIIvDNAmTNlzEwNerreBQIQ64kHiWC1ks5sg_2zgaJpZM4PQgVY .

blackxored avatar Sep 10 '17 15:09 blackxored

Not sure I understand the scenario you are thinking of. If I recall correctly, what you've done is check for .. in the path and resolve it using the node API if it has dots. Did I miss read your solution?

brysgo avatar Sep 11 '17 13:09 brysgo

No. That’s exactly what it does. I’m just worried it hasn’t gone through enough testing to make it mergeable but maybe that’s just me ;)

-- Best Regards,

Adrian Perez https://adrianperez.codes

On September 11, 2017 at 3:17:34 PM, Bryan Goldstein ( [email protected]) wrote:

Not sure I understand the scenario you are thinking of. If I recall correctly, what you've done is check for .. in the path and resolve it using the node API if it has dots. Did I miss read your solution?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/brysgo/babel-plugin-inline-dotenv/issues/2#issuecomment-328525878, or mute the thread https://github.com/notifications/unsubscribe-auth/AAIIvLrFvTMdPedG1ftSHZG1U3g3Exgxks5shTLugaJpZM4PQgVY .

blackxored avatar Sep 12 '17 08:09 blackxored

You are right, I made some faulty assumptions about the adoption of this package. If you think it is a broader question of babel plugins, it may be worth asking @hzoo.

brysgo avatar Sep 12 '17 17:09 brysgo

@blackxored - I just added a test suite with a simple test, obviously it will need more test cases, but now at least it is there and running in CI. You made me realize this has wider adoption than I thought, so I am going to put a little effort into cleaning it up a bit.

brysgo avatar Sep 16 '17 14:09 brysgo