question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Generate a component in specific path/subfolder

See original GitHub issue

how can i generate a component or other with generate in a specific folder? My project is split into several sub folders and is not flat like the boilerplate. I tried ignite generate component path1/path2/Name but do not work

Thank you

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:7
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jamonholmgrencommented, Oct 22, 2021

Another good option would be to support frontmatter to our template files. We already have a PR in-flight for this.

https://github.com/infinitered/ignite/pull/1630

1reaction
jamonholmgrencommented, Oct 22, 2021

This is how we could approach it.

Here, we need to have an option to pass through the specified path (will need to add a field to GeneratorOptions too):

https://github.com/infinitered/ignite/blob/ef5810aac792794ee9102e4e563862145d098ea0/src/tools/generators.ts#L116-L117

We would need to pass that through here:

https://github.com/infinitered/ignite/blob/ef5810aac792794ee9102e4e563862145d098ea0/src/commands/generate.ts#L78-L81

And of course we need to be able to pass that through. That would happen somewhere around here:

https://github.com/infinitered/ignite/blob/ef5810aac792794ee9102e4e563862145d098ea0/src/commands/generate.ts#L58-L74

Various ideas:

npx ignite-cli generate component MyButton --folder=app/buttons

You’d pull this from parameters.options.folder (or maybe dest or path?)

We could also just use the third parameter.

npx ignite-cli generate component MyButton app/buttons

This would be parameters.third.

Thoughts?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to generate components in a specific folder with ...
Right click on the folder in which you want to create component. Select option Open in Integrated Terminal or Open in Command Prompt...
Read more >
How to generate component in subdirectory or specific folder ...
Here are the steps to generate component in a specific folder in Angular. Open terminal at Angular project root directory. Pass the relative ......
Read more >
How to generate components in a specific folder using ...
Generating components. To generate components into a specific folder, we can use the ng g c command followed by the folder path. Example:....
Read more >
Generate Angular components in specific folders ... - webtutpro
This command will generate a home component inside the app/buttons/home folder. Please note that if the buttons folder doesn't exist Angular CLI ...
Read more >
How to generate components in a specific folder
but i want to create into different folder by using same command. example: ng g c test. src >> app>>newfolder>> test>>test.component.ts.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found