jycouet / kitql

A set of standalone tools to SpeedRun WebApps!
https://kitql.dev
MIT License
401 stars 37 forks source link

Parameters<typeof path> Windows \ escaping #643

Closed PudottaPommin closed 4 months ago

PudottaPommin commented 4 months ago

Describe the bug

When on windows, I get parameter type like Parameters<typeof import('..\..\params/locale.ts').match>[0], which causes type error Cannot find module '....params/locale.ts' or its corresponding type declarations.

Fix should be easy enough, which is to change L686 to posix.relative. I can create PR, but file is using relative from @kit/internals, so I'm not sure, if it's better to change just plugin.ts or do change inside @kit/internals.

Severity

annoyance

Steps to Reproduce the Bug

  1. install vite-plugin-kit-routes on windows
  2. use param matcher in route
  3. open ROUTES.ts

Reproduction

No response

jycouet commented 4 months ago

Hello, Thx for reporting & well spotted.

What do you think about exporting posixRelative from @kitql/internals ?

I can probably do it in a few hours, but if you wanna do it... it's perfect for me too 👍 When I have time and I will start, I'll look here to see if you want to do the PR or not. (I'll write here)

jycouet commented 4 months ago

Nahhh, posix is already here... Let's use it directly! I'll do it now

jycouet commented 4 months ago

@all-contributors please add @PudottaPommin for code

allcontributors[bot] commented 4 months ago

@jycouet

I've put up a pull request to add @PudottaPommin! :tada:

jycouet commented 4 months ago

Should be available in vite-plugin-kit-routes@0.6.2 I let you close the issue if this one is fixed. Thx for your help

PudottaPommin commented 4 months ago

thanks! @jycouet it's working like a charm