Alexandre-Fernandez / astro-i18n

A TypeScript-first internationalization library for Astro.
https://www.npmjs.com/package/astro-i18n
MIT License
249 stars 10 forks source link

Astro-i18n in NX monorepo #80

Open EtienneDeneuve opened 8 months ago

EtienneDeneuve commented 8 months ago

Describe the bug When using NX and Astro i18n the method for detecting the root is not working. With nx, we don't have a local "dependencies" in the package.json.

I tried to change some undocumented variables from the config but it failed.

Can't we add param or a setting (args or env var) to specify :

I'm ready to make a PR

Alexandre-Fernandez commented 8 months ago

Did you try adding the config absolute path as an argument for useAstroI18n ?

EtienneDeneuve commented 8 months ago

Yes,

But the issue is when you change the root, even passing a resolved path, it breaks the detection from the package.json deps as it's 3 folders up.

I'll try to find some time to propose a fix for it, if you agree on it.

Alexandre-Fernandez commented 8 months ago

You can make a PR as long as it doesn't break anything

EtienneDeneuve commented 8 months ago

J'espère bien :)

Do you have some kind of template for contributions ?

Alexandre-Fernandez commented 8 months ago

No templates at the moment, send the PR I'll review it and merge it if everything looks good.

luchillo17 commented 7 months ago

I think I just ran into this, with an Nx monorepo, the package.json is in the root but the actual project is in apps/portfolio/, and unless you're using a package-based monorepo, the install command will run on the root rather than the project folder: image