ManuelGil / vscode-angular-generator

Angular File Generator is a Visual Studio Code extension that allows you to generate Angular files with a few clicks. It is based on the Angular CLI and uses the same schematics as the CLI. It also allows you to generate files from the terminal.
https://marketplace.visualstudio.com/items?itemName=imgildev.vscode-angular-generator
MIT License
4 stars 2 forks source link

Feature Request: Set Base Path of Angular Project #4

Open Kombuchelada opened 3 weeks ago

Kombuchelada commented 3 weeks ago

I'm trying to use this extension in a monorepo that has the client/angular code inside a subfolder, and I don't see a way to configure this extension to change the path from which it runs the generate commands. It'd be awesome if that were a feature! This extension is awesome!

This is the error I get when attempting to generate something:

ng g c client/test --style css --standalone true  
Error: This command is not available when running the Angular CLI outside a workspace.

this is run in a folder like "C:\myrepo\" when it needs to be run in "C:\myrepo\client\"

ManuelGil commented 3 weeks ago

Hello @Kombuchelada ,

Actually the error message is an Angular CLI message. This message occurs because the CLI is looking for the project to be an Angular project. In simpler words, it should run where the angular.json file is.

Because of the way the monorepo is built, the correct way to run the extension is by opening the “Client” folder in VSCode.

There is a research process behind that the extension has to go through before we know if it is possible or not to apply this request, so I ask for your patience.

As soon as I have a clear answer I will post it here.