Repository navigation
Description
Command
generate
Description
In large monorepos (such as google3), it is often common to want to edit files in multiple directories from a schematic. Java paths in particular run into this in google3, where users might want to generate foo/bar/baz.ts, java/com/corp/foo/bar/baz.java, and javatests/com/corp/foo/bar/baz.java.
Schematics currently restricts users to the current directory, so this use case doesn't work intuitively.
Describe the solution you'd like
I'm not sure about the proper solution to this problem. I do agree with the current behavior that schematics should be scoped to a particular directory and prevent accesses outside of that, both for security and usability reasons. That said, I think this monorepo issue is a very real problem, so it would be nice to have some kind of support for it.
Some strawman ideas for a solution:
- Let schematics "
cd" into a different directory and use that as the root. So even if it's run infoo/bar/, it could use../../as its root and access the whole monorepo. - Let schematics declare the root directory in their schema relative to the project root:
{ "root": "../../" }. - Prompt users to give access to directories outside the default one in a permissions model. This is probably the safest but also the most annoying to use.
Describe alternatives you've considered
Best alternative is to run the schematic in the monorepo root, but this can be awkward for users who cd in to their particular project directory.
I think you can also edit external files via a Task, but then you're throwing away a lot of the ergonomics of schematics, so that's not a great escape hatch. I guess you could schedule a Task which reruns the schematic in a different directory?
Activity
angular-robot commentedon Dec 1, 2022
This feature request is now candidate for our backlog! In the next phase, the community has 60 days to upvote. If the request receives more than 20 upvotes, we'll move it to our consideration list.
You can find more details about the feature request process in our documentation.
angular-robot commentedon Jan 10, 2023
Just a heads up that we kicked off a community voting process for your feature request. There are 20 days until the voting process ends.
Find more details about Angular's feature request process in our documentation.
angular-robot commentedon Jan 30, 2023
Thank you for submitting your feature request! Looks like during the polling process it didn't collect a sufficient number of votes to move to the next stage.
We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular's scope, we'd encourage you to collaborate with the community on publishing it as an open source package.
You can find more details about the feature request process in our documentation.
Hyperxq commentedon Jul 9, 2024
I am not sure if that will help you until Angular schematics team is implementing this feature but you can execute schematics with pbuilder no matter the workspace, this is the link.
alan-agius4 commentedon Oct 17, 2025
Closing this request as it is not currently planned. We will reconsider if we see significant community interest.
angular-automatic-lock-bot commentedon Nov 17, 2025
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.