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

Allow "bubbling" for .phrase.yml #100

Open
dunklesToast opened this issue Mar 8, 2022 · 3 comments
Open

Allow "bubbling" for .phrase.yml #100

dunklesToast opened this issue Mar 8, 2022 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@dunklesToast
Copy link

Currently the Phrase CLI seems to only search for the .phrase.yml in the current working dir. It'd be great if the CLI would bubble up the working tree until it finds a config. This comes in handy for Monorepos where the config is at the repos root but you're currently working on a specific package.

.
└── monorepo/
    ├── package1/
    │   ├── src
    │   ├── package.json
    │   └── tsconfig.json
    ├── package2/
    │   └── src/
    │       └── i18n
    └── .phrase.yml

With bubbling the CLI would use the .phrase.yml even if I am in package1 or package2. The CLI should use the .phrase.yml location as cwd to resolve filepaths.

@theSoenke
Copy link
Collaborator

Hey, I know that many popular tools allow this merging based on the directory structure. For the CLI config, it could be a bit more problematic as it is not just a simple flat key-value config but has multiple nestings. While merging multiple configs would be possible it could get somewhat confusing how the final used configuration is looking like with which configuration options. For now, we do not have plans to add this to the CLI but we might revisit this in the future

To use a config in a specific path it's also possible to use the --config <path> parameter to use a different config than in the current directory

@dunklesToast
Copy link
Author

I wouldn't require merging multiple configs. I'd be happy if the CLI would just traverse the filetree up and search for the first config that it finds and uses that. Would that be possible?

@theSoenke
Copy link
Collaborator

Ah thanks for the clarification. That also sounds like something that could come in quite handy. That should also be definitely doable to implement. I don't think we can add it right away though as we're currently working on some other improvements for the CLI but this is something we might pick up after that. Also feel free to take a look at the code yourself and open a PR if you like. The code in this repo is generated here https://github.com/phrase/openapi/tree/master/clients/cli

@theSoenke theSoenke added the enhancement New feature or request label Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants