krishnaacharyaa / wanderlust

WanderLust is a MERN travel blog website 🚀 This project is aimed to help people to contribute in open source, upskill in react and master git.
https://wanderlust-beta.vercel.app/
MIT License
174 stars 826 forks source link

fix-#3: refactored-backend-with-typescript #408

Open vamsidhar-914 opened 3 weeks ago

vamsidhar-914 commented 3 weeks ago

Summary

refactored backend with typescript

Description

migrated all js files to ts files with all the types.

Issue(s) Addressed

Closes #3

Prerequisites

vercel[bot] commented 3 weeks ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
wanderlust ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 8, 2024 2:14pm
wanderlust-backend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 8, 2024 2:14pm
github-actions[bot] commented 3 weeks ago

Hey @vamsidhar-914! Thanks for sticking to the guidelines! High five! 🙌🏻

vamsidhar-914 commented 3 weeks ago

@krishnaacharyaa check it out....tell me if any mistakes to be taken care of..

for tests I might need some help.I didnt touched tests for refactoring

vamsidhar-914 commented 3 weeks ago

hi @krishnaacharyaa

1.) when i use default Request type for req. it throws me error req.user is not found.so i declared index.d.ts file extended Request type with user field. but again it throws me the same error

Screenshot (218)

so i created a new type for Request and replaced it with that type , and it works fine Screenshot (219)

2.) when i use the type 'module' in package.json it throws this error, Screenshot (215)

these are the errors

krishnaacharyaa commented 3 weeks ago

@vamsidhar-914 please google these, it will be available.

  1. might be because Request is a wrong import
  2. because you have to change the tsconfig.json even, we can't change it from module to commonjs, no going back.

And the request type as discussed would not be actually required, try to come up with alternative

krishnaacharyaa commented 2 weeks ago

@vamsidhar-914 Hi, Are we good or blocked? Let's have a call and get this in, It is a important feature we need this in, early it is, better it is :)

vamsidhar-914 commented 2 weeks ago

@krishnaacharyaa sorry! been busy lately.....everything is done except for the type module issue...searched google but couldn't find it.

krishnaacharyaa commented 2 weeks ago

No worries can we arrange a call we'll debug

vamsidhar-914 commented 2 weeks ago

can we connect tomorrow morning?

krishnaacharyaa commented 2 weeks ago

Nights or sat Sun I have office other times

vamsidhar-914 commented 2 weeks ago

sure....lets connect on sunday

krishnaacharyaa commented 2 weeks ago

@vamsidhar-914 the earlier we get this, better it is :) Now we have conflicts, it will increase as the time progresses