Open Onurfesci opened 12 months ago
This seems like a bug, I would also expect that generator names do not have to be unique across an entire monorepo. Thanks for the report!
Also, it takes significant time for turbo to show up the option to select the generator. Why is it so? Even if turbo is searching for generator in all the files in the project (except the node_modules and build files), it shouldn't take so much time.
What version of Turborepo are you using?
1.10.14
What package manager are you using / does the bug impact?
pnpm
What operating system are you using?
Mac
Describe the Bug
Not sure if this is a bug, but it is unexpected behavior to me so I'd like to report it anyway.
When I have configs under different packages in the monorepo with the same generator name, only one of the packages shows up in the CLI output.
For example, I have a
component
generator underwebapp-customer
, andui-kit
. When I runturbo gen
, I see this output:If I change the generator name in
config.ts
in thewebapp-customer
package to something else, likewebapp-component
, and I runturbo gen
:Is this the expected behavior? Do generator names have to be unique across the monorepo?
Expected Behavior
I would expect all generators to show up as options, even if they have the same name within different packages in the monorepo. I feel like there may be unique
component
, or any type of generators, that have the same name but generate differently depending on the context of the package they are in.To Reproduce
turbo/generators/config.ts
in separate packages in the monorepoplop.setGenerator('component')
in both packagesturbo gen
Reproduction Repo
No response