kiliman / remix-flat-routes

Remix package to define routes using the flat-routes convention
MIT License
695 stars 24 forks source link

Add a way to ignore DS_Store files #101

Open adaboese opened 8 months ago

adaboese commented 8 months ago

My app keeps crashing with an error:

Cannot add empty string to PrefixLookupTrie

This is due to DS_Store being created in the routes directory by the OS.

find . -name '.DS_Store' -type f -delete

Temporarily fixes the issue, but I would rather have an option to just ignore these files.

kiliman commented 8 months ago

Update your config and pass ignoredRouteFiles in options to ignore files starting with ..

routes: async defineRoutes => {
  return flatRoutes('routes',
    defineRoutes,
    { ignoredRouteFiles: ['**/.*'] },
  )},

https://github.com/kiliman/remix-flat-routes#%EF%B8%8F-configuration

kenn commented 8 months ago

I think this should be addressed somewhere (either in the code or README), because the first step you convert route files would be batch-renaming files (to remove _auth. prefix) and many likely do it using the macOS's feature, which generates .DS_Store files.

https://stackoverflow.com/questions/44223988/how-to-rename-multiple-files-in-vscode-visual-studio-code

This is a major onboarding / migration issue that could make people give up using this incredibly useful library.