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

refactor: restructure cli commands to support different frameworks templates #618

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from

Conversation

MuhammadM1998
Copy link
Contributor

@MuhammadM1998 MuhammadM1998 commented Jun 18, 2024

πŸ”— Linked issue

#570

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

POC of #570. This PR just extracts the vue-specific code init, add, diff commands into their respective commands in commands/frameworks/vue folder and update the imports accordingly. No other changes were made for easier reviewing.

Remarks:

  • getConfig has been extracted to its separate file too because in the Nuxt module we'd read the config differently (think reading components config from nuxt.config instead of components.json). Hence it's extracted to a reusable function to be used in all commands when needed.
  • We export the same vue commands for nuxt to ensure everything works as expected. Next step is creating nuxt-specific commands and use those instead.

πŸ“Έ Screenshots (if appropriate)

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@MuhammadM1998
Copy link
Contributor Author

@sadeghbarati Tests are passing but can you help confirming everything works as expected πŸ™

@sadeghbarati
Copy link
Collaborator

Sure, I appreciate the effort you put into ❀️‍πŸ”₯

Will test tomorrow πŸ™Œ

@sadeghbarati
Copy link
Collaborator

https://stackblitz.com/edit/vitejs-vite-1fjqkm?file=package.json

@MuhammadM1998 Sry for the late test, I tested the CLI the seems to have problem with the add command
init command is working well but add command still repeat the init command even though the component.json is exists

image

@MuhammadM1998
Copy link
Contributor Author

Thanks for testing πŸ™ I'll see whats wrong and retest

@MuhammadM1998 MuhammadM1998 force-pushed the refactor/cli-templates branch from 4796504 to b271e1e Compare June 24, 2024 09:17
@MuhammadM1998
Copy link
Contributor Author

@sadeghbarati It was always running promptForConfig which should only run in init. It's fixed now and running as expected.
Screenshot 2024-06-24 124609

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

Successfully merging this pull request may close these issues.

2 participants