fresh
fresh copied to clipboard
#475 Add warnings to terminal for possible route conflicts.
Hi All.
I'm new to Deno and Fresh so please go easy on me ! This is my first attempt and contributing to this project. As it is quite new I was not able to find a comprehensive guide to contributing (I could help with that too if there are plans?) so I might have got quite a bit wrong. For example I've not written any tests.
This is my first attempt at solving issue/475 and I might have completely missed the point completely.
I'm looking for feedback and help on how to improve what I've done.
What it does do
- in a function called
routeWarnings
indev/mod.ts
it looks at all the routes from the manifest - if there is a dynamic route and a static route in the same directory it adds them to a list
- then
console.logs
in red the following message from the list we've built up.

- if there are conflicts in a number of places it lists these out
I realise some things will need changing and improving (like I've used any
as a type on line 153)
(totals: any, p) => ({ ...totals, [p.dir]: (totals[p.dir] || 0) + 1 }),
But I was hoping for some feedback in terms of if I'm in the right direction etc?
Also I have these questions
- Why is there no .gitignore ?
- Are there any plans or style guide / design system for the docs ?
- Is there a contributors guide that I'm missing?
- Why is my prettier working differently ? It has formatted a few exisiting things differently? Dont we need a prettier config file in the root of Fresh?
Thank you all feedback welcomed.
@xstevenyung - Thank you so much for taking the time to answer my questions. I will fix this up some more. Makes a lot of sense about custom formatter etc, it just didnt cross my mind.