Closed elledienne closed 8 months ago
So, do you want the script to automatically include the +
suffix on every folder in the v1
route?
app/routes-v1
├── users
│ ├── $userId.edit.tsx
│ ├── $userId.tsx
│ └── index.tsx
└── users.tsx
app/routes-v2-current
├── users.$userId.tsx
├── users.$userId_.edit.tsx
├── users._index.tsx
└── users.tsx
app/routes-v2-hybrid
└── users+
├── $userId.tsx
├── $userId_.edit.tsx
├── _index.tsx
└── _layout.tsx <- routes/users.tsx v1 layout file
yeah, that's right! Ideally we want to migrate to v2 without actually changing the folder structure as we like the way it currently is
Ok, I'll see what I can do. Thanks for the confirmation.
I think I've got it working
app/old-routes/
├── $lang.$ref
│ ├── $.tsx
│ ├── index.tsx
│ └── test.edit.tsx
├── $lang.$ref.tsx
├── accounts.tsx
├── api
│ └── v1
│ ├── README.md
│ ├── experiments.tsx
│ ├── invoice
│ │ └── $invoiceId.tsx
│ └── invoice.tsx
├── dashboard.tsx
├── expenses.tsx
├── index.tsx
├── reports.tsx
├── sales
│ ├── customers.tsx
│ ├── deposits.tsx
│ ├── index.tsx
│ ├── invoices
│ │ ├── $invoiceId.edit.tsx
│ │ ├── $invoiceId.tsx
│ │ └── index.tsx
│ ├── invoices.tsx
│ └── subscriptions.tsx
├── sales.tsx
├── users
│ ├── $id.edit.tsx
│ ├── $id.tsx
│ └── index.tsx
└── users.tsx
app/hybrid-routes/
├── $lang.$ref+
│ ├── $.tsx
│ ├── _index.tsx
│ ├── _layout.tsx
│ └── test_.edit.tsx
├── _index.tsx
├── accounts.tsx
├── api+
│ └── v1+
│ ├── README.md
│ ├── experiments.tsx
│ └── invoice+
│ ├── $invoiceId.tsx
│ └── _layout.tsx
├── dashboard.tsx
├── expenses.tsx
├── reports.tsx
├── sales+
│ ├── _index.tsx
│ ├── _layout.tsx
│ ├── customers.tsx
│ ├── deposits.tsx
│ ├── invoices+
│ │ ├── $invoiceId.tsx
│ │ ├── $invoiceId_.edit.tsx
│ │ ├── _index.tsx
│ │ └── _layout.tsx
│ └── subscriptions.tsx
└── users+
├── $id.tsx
├── $id_.edit.tsx
├── _index.tsx
└── _layout.tsx
I like that hybrid routes move the sibling layout route into folder as _layout.tsx
We are in the process of migrating to the v2 routes convention but we really struggle to use the
flat-files/folders
conventions as we are working on a big project with tens, maybe hundreds of routes.We believe that "nested folders with flat-files" could be the best approach for us as - any chance we can use the migrate script to migrate our routes to "nested folders with flat-files"?
Thank you!