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

defaultCollection is relative to where cmd is run not angular.json #23136

Closed
1 of 15 tasks
kvart714 opened this issue May 15, 2022 · 3 comments · Fixed by #23138
Closed
1 of 15 tasks

defaultCollection is relative to where cmd is run not angular.json #23136

kvart714 opened this issue May 15, 2022 · 3 comments · Fixed by #23138
Labels
area: @angular/cli freq1: low Only reported by a handful of users who observe it rarely severity3: broken type: bug/fix
Milestone

Comments

@kvart714
Copy link

kvart714 commented May 15, 2022

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • extract-i18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

No, it's is duplicate of #15014

Description

angular json - ng-g-c-bug - Visual Studio Code

🔬 Minimal Reproduction

Repo example: https://github.com/kvart714/ng-g-c-bug

It includes custom schematic.
Command ng g c works in project folder, but not works in nested folders due to relative path.

@alan-agius4 alan-agius4 added type: bug/fix freq1: low Only reported by a handful of users who observe it rarely severity3: broken area: @angular/cli labels May 16, 2022
@ngbot ngbot bot added this to the Backlog milestone May 16, 2022
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue May 16, 2022
…teas of current working directory

Relative schematics referenced in `angular.json` `schematicCollections` and `defaultCollection` were always resolved from the current working directory, which is not correct and caused the collection not to be resolved when the this is different from the location of the workspace config.

Closes angular#23136
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue May 16, 2022
…tead of current working directory

Relative schematics referenced in `angular.json` `schematicCollections` and `defaultCollection` were always resolved from the current working directory, which is not correct and caused the collection not to be resolved when the this is different from the location of the workspace config.

Closes angular#23136
dgp1130 pushed a commit that referenced this issue May 17, 2022
…tead of current working directory

Relative schematics referenced in `angular.json` `schematicCollections` and `defaultCollection` were always resolved from the current working directory, which is not correct and caused the collection not to be resolved when the this is different from the location of the workspace config.

Closes #23136
dgp1130 pushed a commit that referenced this issue May 17, 2022
…tead of current working directory

Relative schematics referenced in `angular.json` `schematicCollections` and `defaultCollection` were always resolved from the current working directory, which is not correct and caused the collection not to be resolved when the this is different from the location of the workspace config.

Closes #23136

(cherry picked from commit c71832f)
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue May 18, 2022
…tead of current working directory

Relative schematics referenced in `angular.json` `schematicCollections` and `defaultCollection` were always resolved from the current working directory, which is not correct and caused the collection not to be resolved when the this is different from the location of the workspace config.

Closes angular#23136
clydin pushed a commit that referenced this issue May 18, 2022
…tead of current working directory

Relative schematics referenced in `angular.json` `schematicCollections` and `defaultCollection` were always resolved from the current working directory, which is not correct and caused the collection not to be resolved when the this is different from the location of the workspace config.

Closes #23136
@kvart714
Copy link
Author

kvart714 commented May 21, 2022

@alan-agius4 I tried your fix. Now it works, but it works differently between default and custom schematics. This ignores any subfolders now.

In the screenshot, I ran the command twice from the same folder, but the components were created in different folders:
image

I commit example: https://github.com/kvart714/ng-g-c-bug

@alan-agius4
Copy link
Collaborator

Hi @kvart714,
I have a PR in flight to address the above issue #23198

For next time, it would be great if you could open a separate issue. Thanks.

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: @angular/cli freq1: low Only reported by a handful of users who observe it rarely severity3: broken type: bug/fix
Projects
None yet
2 participants