SamagraX-Stencil / stencil

NestJS on steroids 💪
https://stencil.samagra.io
MIT License
28 stars 28 forks source link

[vsc-extension] [C4GT] Stencil VSCode extension #7

Open techsavvyash opened 7 months ago

techsavvyash commented 7 months ago

Create VSCode Extension for Stencil - Data Verification Feature

Description

The goal is to develop the first version of a VSCode extension for Stencil, aiming to enhance the Developer Experience (DX). The primary feature for this initial release is to verify data intended for seeding in the database against the model generated by the Prisma client. This verification will be conducted using CSV or JSON files.

Goals

  1. VSCode Extension Setup: Establish the basic structure and setup for the VSCode extension tailored for Stencil.

  2. Data Verification Feature: Implement the feature that allows users to verify data from CSV/JSON files against the Prisma client-generated model.

Acceptance Criteria

  1. Extension Setup: Successfully set up the VSCode extension project with Stencil integration.

  2. Data Verification Functionality: Implement functionality within the extension that verifies data present in CSV/JSON files against the Prisma client-generated model.

  3. User Interface (UI): Develop a simple and user-friendly UI within VSCode to facilitate the data verification process.

  4. Testing: Ensure the data verification feature works as intended and is capable of identifying inconsistencies between the provided data and the Prisma model.

  5. Documentation: Provide clear documentation on how to use the VSCode extension, specifically focusing on the steps for data verification and any relevant considerations. Include your docs as a ReadME.md in your PR. The docs will be pushed to official stencil documentation after successful merging of your PR.

Checklist (To be filled by the developer)

Product Name

Stencil

Organisation Name

SamagraX

Tech Skills Needed

TypeScript

Mentors

@RyanWalker277

Complexity

Hard

Domain

Category

Miscellaneous

Sub Category

VsCode Extensions

Apurv428 commented 4 months ago

Hello @RyanWalker277, I'm keen on taking up this issue. I would like more information, particularly regarding step 2, which involves implementing the data verification feature. This feature aims to enable users to validate data from CSV/JSON files against the Prisma client-generated model. Can you provide more guidance to help me proceed with this task?

RyanWalker277 commented 4 months ago

Hey @Apurv428, so basically the VS-Code extension should be able to seed the data in the db. The user will provide a CSV including the data to be seeded. It should then verify if the CSV is according to our prisma model. If the validation succeeds, then it should seed the csv data into the database in the appropriate table.

Apurv428 commented 4 months ago

Thanks for the explanation. So, according to my understanding The user uploads a CSV, we validate its compatibility with our Prisma model, and if it aligns correctly, we insert it into the necessary database table.

Please correct me if I am wrong.

Do you have any recommendations on how to begin with this? Also, could you share the database format to get acquainted with it?

RyanWalker277 commented 4 months ago

Yes the understanding is correct. You can refer to this to begin:

https://www.freecodecamp.org/news/making-vscode-extension/

The database format is provided along with the code in the schema.prisma

Apurv428 commented 4 months ago

Thank you for providing the reference. If I have any questions, I'll reach out to you.

Apurv428 commented 4 months ago

Hi @RyanWalker277 Could you please provide more details on the first point of the acceptance criteria, specifically regarding the extension setup? Are you referring to a basic setup similar to configuring a VSCode extension, or does it involve additional steps or considerations?

RyanWalker277 commented 4 months ago

Hey @Apurv428, in the first iteration it should be a basic extension which provides the functionality to seed db from csv data. There would be more features and enhancements after this feature is initialised. Let me know when you are ready to create a pull request, I'll create a separate repository for the extension. You'll have to create a PR on that.

Apurv428 commented 4 months ago

Okay, I have created a basic extension and am working on the upload functionality. Thank you!

Apurv428 commented 4 months ago

Hi @RyanWalker277 , how can I get the format of database? Is it same as the Role model?

techsavvyash commented 4 months ago

Hey @Apurv428 , The database schema would be dynamic, we'll need to parse the schema.prisma file to figure that out. The Role schema is just for reference.

Apurv428 commented 4 months ago

So, similar to Role model, there may be other models mentioned in that file? Can there be more than 1?

techsavvyash commented 4 months ago

Yes

Apurv428 commented 4 months ago

I've implemented the CSV validation part. Could you please create a repository for it so that I can make a pull request?"

And for the second part about database seeding:

Where should we retrieve the database details from? Are they obtained in the same way from Prisma? Could you share the env variable values related to the database? Additionally, will the table names correspond to the model names?

techsavvyash commented 4 months ago

Hey @Apurv428, That is super! Please create a new folder named vsc-extension in the root of the repository and raise a PR for the same.

Apurv428 commented 4 months ago

Sure!

Apurv428 commented 4 months ago

Hi, Could y'll provide the following details about database seeding?

Where should we retrieve the database details from? Are they obtained in the same way from Prisma? Could you share the env variable values related to the database? Additionally, will the table names correspond to the model names?

techsavvyash commented 4 months ago

Hey @Apurv428, Database seeding is still something we are figuring out how to implement into stencil, we can add that as a part of this extension once it has been discussed and a seeding strategy has been agreed upon.

Apurv428 commented 4 months ago

Okay, thank you!

Yash-Sajwan24 commented 3 months ago

@techsavvyash I understand the problem, and I believe I have the necessary skills. Could I have the opportunity to work on this?

Abhi-0001 commented 3 months ago

is it still available to work on ? Can I start work on it? If yes, then what is the current status of extension?

techsavvyash commented 3 months ago

@Abhi-0001 the first version of the vs code extension was very generously contributed by @Apurv428. The issue is still open to work on by adding more functionality enhancing the developer experience.

Abhi-0001 commented 3 months ago

Thanks @techsavvyash, so Can you give me instructions about setting the code up in my machine (as this is my first time in vscode extension development, though I know typescript) and the requirements I would have to full fill for next version.

techsavvyash commented 3 months ago

Refer #78

thekavikumar commented 2 months ago

@techsavvyash by adding some more features, will I be getting the points?

techsavvyash commented 2 months ago

yes @thekavikumar