Skip to content
This repository has been archived by the owner on Jul 27, 2020. It is now read-only.

Add a yoga eject command #81

Closed
Weakky opened this issue Feb 26, 2019 · 2 comments
Closed

Add a yoga eject command #81

Weakky opened this issue Feb 26, 2019 · 2 comments

Comments

@Weakky
Copy link
Contributor

Weakky commented Feb 26, 2019

Motivation

Currently, ejecting needs the three following steps:

  • Creating a server.ts file and instantiating nexus + the GraphQL Server
  • Adding all the imports to the context, the types, the prisma-client etc etc
  • Adding an index.ts file in the graphql folder to export all the types exported within the folder

Description

Yoga has the knowledge of all the paths necessary to scaffold all the necessary files to eject.

In fact, as part of the build command, we already need to scaffold all these files to make a yoga project runnable by node, which means:

  • Creating a server.ts file containing all the server + nexus configurations
  • Properly scaffolding the imports
  • Adding an index.ts file in the graphql folder

Unlike create-react-app or other frameworks, ejecting WOULD NOT be a one-time irreversible step. Reverting could simply be done by deleting the scaffolded files and everything would still work.

I believe that would ease a lot ejecting from yoga!

@DevanB
Copy link
Contributor

DevanB commented Feb 26, 2019

Unlike create-react-app or other frameworks, ejecting WOULD NOT be a one-time irreversible step. Reverting could simply be done by deleting the scaffolded files and everything would still work.

Yes! I employ maintainers to keep this statement true. I didn’t know this before, but now I’m not “scared” to eject. I am willing to bet that others will have the same sentiment as me once they understand ejecting isn't a irreversible action. 💯

@Weakky Weakky mentioned this issue Mar 5, 2019
9 tasks
@Weakky
Copy link
Contributor Author

Weakky commented Mar 15, 2019

Implemented by #104, released under yoga@0.0.17

@Weakky Weakky closed this as completed Mar 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants