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

Astro-i18n in NX monorepo #80

Open
EtienneDeneuve opened this issue Feb 15, 2024 · 6 comments
Open

Astro-i18n in NX monorepo #80

EtienneDeneuve opened this issue Feb 15, 2024 · 6 comments
Assignees

Comments

@EtienneDeneuve
Copy link

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 :

  • base path (root folder of the astro website)
  • config file path (path of the astro-i18n config file)

I'm ready to make a PR

@Alexandre-Fernandez
Copy link
Owner

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

@EtienneDeneuve
Copy link
Author

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
Copy link
Owner

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

@EtienneDeneuve
Copy link
Author

J'espère bien :)

Do you have some kind of template for contributions ?

@Alexandre-Fernandez
Copy link
Owner

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

@luchillo17
Copy link

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

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

3 participants