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

Make output directory relative to the config file #1043

Open
comp615 opened this issue Aug 5, 2024 · 0 comments
Open

Make output directory relative to the config file #1043

comp615 opened this issue Aug 5, 2024 · 0 comments

Comments

@comp615
Copy link

comp615 commented Aug 5, 2024

🚀 Feature Proposal

output directory should be relative to the config file (when used) just like input is.

Motivation

I'm evaluating using this tool in a large monorepo where we would ideally extract i18n tags for each project independently, and due to how we need our files to work in git, it would co-locate the i18n files.

Currently, I was imagining putting a i18next-parser.config.js at each package root, and in CI having it just run each of those against the ci.

It makes sense that input is local to the config, as this allows each package to specify it's processed files. But they lose control over where their files go currently. In my singular CI setup, either the CI tool would need to put them all in one place, or it'd have to figure out the dir for each config and manually set the output path.

I think there are two different styles:

  • Co-locate output (described here)
  • Glob all inputs into a root dir

As a bonus, we could maintain functionality for both use cases (and enable more flexible usage) by adding a $CWD variable too. Config files could specify this to namespace themselves relative to where the script was run too.

Example

output: '$CWD/locales/myspecialpackage/$LOCALE/$NAMESPACE.json'

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