Closed chriscurnow closed 2 months ago
Hi, I just tried to reproduce this but I was unable to.
That being said, the observation you made about false
being a string is correct and if you want you can create a PR for this.
It could be that this has an impact on the generate command, but I'm not 100% sure that it will fix the issue.
Is the nx generate @ngrx/schematics:feature [name]
command interactive for you (does it ask for some information first?).
As a workaround you can also try to pass the value to the command nx generate @ngrx/schematics:feature [name] --entity false|true
I'll try and reproduce it from my end in a vanilla Angular (rather than Nx Angular) app.
When I tried the change in the schematic schema.json
it did fix the issue.
It doesn't look like it's urgent but I will create a PR.
It did ask me some questions:
Should we generate and wire success and failure actions? (y/N)
What should be the prefix of the action, effect and reducer?
Should we use @ngrx/entity to create the reducer? (y/N)
To which module (path) should the effect be registered in? ·
Thanks in advance @chriscurnow !
Hey @chriscurnow not to rush you, but are you working on this or will you be working on this? Otherwise we'll add it to our v18 backlog.
Thanks for asking.I'm pretty shat out just now so perhaps just add it to the backlog.Sent from my iPadOn 24 Apr 2024, at 4:26 AM, Tim Deschryver @.***> wrote: Hey @chriscurnow not to rush you, but are you working on this or will you be working on this? Otherwise we'll add it to our v18 backlog.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>
If someone want to pick this one up, the fix is to update the following line.
false
shouldn't be a string value but a boolean value.
PR opened :)
PR opened :)
You fast guy 😅
Which @ngrx/* package(s) are the source of the bug?
schematics
Minimal reproduction of the bug/regression with instructions
I don't know how to issue a terminal command in StackBlitz.
But when I issue the terminal command
nx generate @ngrx/schematics:feature [name]
I get the error:Property 'entity' does not match the schema. 'false' should be a 'boolean'.
Expected behavior
When I issue the schematic
nx generate @ngrx/schematics:feature [name]
it should creat the feature.I am using Ngrx inside NX but I don't think that makes any difference.
Versions of NgRx, Angular, Node, affected browser(s) and operating system(s)
NgRx: 17.1.1
Other information
I think the issue is in line 74 of
schema.json
of the feature schematic.It currently reads:
"default": "false"
I think it should be
"default": false
That is, remove the quotation marks around
false
.It worked after I made this change.
I would be willing to submit a PR to fix this issue