sandulat / routes-gen

Framework agnostic routes typings generator. Remix ☑️ SolidStart ☑️
MIT License
281 stars 12 forks source link

Command failed: remix routes --json | tee in Windows Powershell #24

Closed xHomu closed 2 years ago

xHomu commented 2 years ago

Describe the bug

Followed the instructions up to this line yarn routes-gen -d @routes-gen/remix and received the following error:

image

I believe this occurs because on Windows it defaults to use command prompt instead of Powershell, where the command would have worked.

Your Example Website or App

n/a

Steps to Reproduce the Bug or Issue

  1. Open existing remix repo on VSCode Windows
  2. yarn add routes-gen @routes-gen/remix
  3. yarn routes-gen -d @routes-gen/remix

Expected behavior

It will parse and export the routes, based on the driver that you've provided.

Screenshots or Videos

No response

Platform

Additional context

No response

sandulat commented 2 years ago

@homumado I do not have a Windows myself. Do you have any ideas on how we could approach this?

sandulat commented 2 years ago

I've added tee to get the full output of remix routes --json. The output can be very long when you have many routes, and without tee, it gets truncated. Not sure if there's a cross-platform alternative to tee.

sandulat commented 2 years ago

@homumado I think a solution might be ditching exec in favour of using Remix internal utils for reading the routes.

Pros:

Cons:

I'm still researching for the best approach.

sandulat commented 2 years ago

@homumado This was fixed in @routes-gen/remix 0.3.4. You can upgrade with yarn add @routes-gen/remix@latest. Feel free to re-open this issue or another one, if you still encounter any issues after upgrading.

xHomu commented 2 years ago

Yey it works! Thanks for kicking ass, @sandulat !

image

sandulat commented 2 years ago

Awesome! Glad it works!

sandulat commented 2 years ago

@xHomu This was actually affecting another package as well: https://github.com/sandulat/remix-docs-gen

It's now fixed there as well. Thanks once again for pointing this one out!