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

Behave more similarly to Angular's schematics #91

Open
1 of 7 tasks
NatoBoram opened this issue Jan 14, 2020 · 2 comments
Open
1 of 7 tasks

Behave more similarly to Angular's schematics #91

NatoBoram opened this issue Jan 14, 2020 · 2 comments

Comments

@NatoBoram
Copy link

NatoBoram commented Jan 14, 2020

I'm submitting a...

Current behavior

ng g @ngxs/schematics:state states/test
CREATE src/states/test/test.state.spec.ts (685 bytes)
CREATE src/states/test/test.state.ts (337 bytes)

Expected behavior

ng g @ngxs/schematics:state states/test
CREATE src/app/states/test.state.spec.ts (146 bytes)
CREATE src/app/states/test.state.ts (22 bytes)

What is the motivation / use case for changing the behavior?

I'd like to be able to use NGXS' schematics the same way I use Angular's schematics. Right now, if I want the same result, I have to run a command like this :

ng g @ngxs/schematics:actions --name logout --sourceRoot src/app --path actions --spec true

With Angular's schematics, the commands looks like this :

ng g class classes/test
@DaSchTour
Copy link

Additionaly I hope, that it also will behave more like angular schematics when using in IntelliJ. When I generate components they are generated inside the folder I want them to be created. When I to the same with ngxs/schematics I get the full path from root generated in the folder I want the files to be placed in. So from the example above when trying to generate files in src/app/states I get the files in src/app/states/src/app/states/test.

@Drol
Copy link

Drol commented Aug 12, 2020

I added schematics configuration to angular.json and it partially solves the problem.

"@ngxs/schematics:action": {
	"spec": false,
	"sourceRoot": "src/app"
},
"@ngxs/schematics:store": {
	"spec": false,
	"sourceRoot": "src/app"
},
"@ngxs/schematics:state": {
	"spec": false,
	"sourceRoot": "src/app"
},
"@ngxs/schematics:actions": {
	"spec": false,
	"sourceRoot": "src/app"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants