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

Schematics: add schematic for component store #2570

Closed
brandonroberts opened this issue Jun 8, 2020 · 11 comments · Fixed by #2886
Closed

Schematics: add schematic for component store #2570

brandonroberts opened this issue Jun 8, 2020 · 11 comments · Fixed by #2886
Labels

Comments

@brandonroberts
Copy link
Member

Add a new schematic to generate:

A service that extends ComponentStore
A spec file if requested
Maybe an inlined interface for the default type

Describe any alternatives/workarounds you're currently using

Other information:

If accepted, I would be willing to submit a PR for this feature

[ ] Yes (Assistance is provided if you need help submitting a pull request)
[ ] No

@brandonroberts brandonroberts added the Good First Issue Good issue for first-time contributor label Jun 10, 2020
@ilyaryabchinski
Copy link
Contributor

Wanted to grab this, but didn't find the way how to run schematics locally(not from node_modules) 😢

@santoshyadavdev
Copy link
Sponsor Contributor

Hey @ilyaryabchinski if you want to start I can help.

@ilyaryabchinski
Copy link
Contributor

Hey @santoshyadavdev! would be nice

So I am trying to run schematics directly from the repo, but get an error. What am I doing wrong?

image

@santoshyadavdev
Copy link
Sponsor Contributor

It's easy to write test for schematics and verify rather than trying to run it locally. You can see any existing test case. You can share the repo with me to check as well.

@timdeschryver
Copy link
Member

As @santoshyadavdev pointed out, the easiest way to test a schematic is via unit tests.
What I do if I want to test them out in a project is to build to project and use npx to to run the schematic.
The angular docs have a section that can help you with it (via npm link).
I hope this helps you a bit, if not feel free to ping us 🙂

@rovshenn
Copy link
Contributor

rovshenn commented Sep 6, 2020

I am planning to look into this as there seem to be no open PR :) I have had some schematics experience

@rovshenn
Copy link
Contributor

@brandonroberts @timdeschryver and @alex-okrushko
I am wondering what the template for the auto generated component store service should contain.
Where do you want to discuss it guys?

@rovshenn
Copy link
Contributor

rovshenn commented Sep 13, 2020

I am wondering if the component store should be provided for a specific component or a modal or shall we give both selections and let the user narrow down?

I will base my work based off of schematics for effects, as both effects and component store are services

@rovshenn
Copy link
Contributor

@timdeschryver @brandonroberts @alex-okrushko :) any thoughts on above?

@brandonroberts
Copy link
Member Author

Yes I think providing a path to a component should be an option.

@va-stefanek
Copy link
Contributor

va-stefanek commented Jan 11, 2021

@brandonroberts Would you prefer to support two ways of providing a store: module's path and component's path or just one of them (component)? In case of component should we also always inject component store to the constructor? Do we allow to not specify neither of them and generate component store with providedIn: 'root' then?

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

Successfully merging a pull request may close this issue.

7 participants