You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi team. Turborepo is great, but there are some areas we could improve on.
One of the areas is how ports are attributed to nextjs repos inside the apps folder. I'm working on a monorepo with several applications (production and some prototypes) and its quite hard to find which port should I connect to because it changes every time I stop my dev process for whatever reason. I know we can hard code the ports on apps/my_app/package.json but I wonder if instead of assigning the ports randomly based on which process started first, they could be assigned alphabetically based of the apps folder. This way if you are working on localhost:3009 and you need to stop turbo dev to run some dependency install and then run turbo dev again at least your app is still on the same port and you dont have to go and try port 3000, 3001, 3002, etc until you find your app.
I understand that this might not be a out of the box feature, but it can be frustrating in a large monorepo with multiple applications always having to guess where your app is.
Describe the solution you'd like
I would like to call yarn dev --ports-sequence or someething to indicate to turborepo that each app needs to start in a sequence (alphabetical) and not cuncurrently.
Describe alternatives you've considered
I can manually go and assign a port to each application package.json but in my particular repo where prototypes are constantly added, its hard to see which ports are already assigned specially.
So for example if you think of an app looking like this
And you have to manually set the dev process inside each package.json individually next dev --port 3000.
And even if you are careful and make your ports assigned alphabetically and you add a new prototype then the port you manually have assigned to website will be incorrect. Or if you add a new app called docs then all of them are incorrect because docs comes before prototype... alphabetically.
So you either have to:
constantly update the ports manually to keep it alphabetically
start to assign ports that might not be alphabetically but incremented as you add more apps
On an application with 1-4 apps maybe this is nor relevant, but anything bigger than that it becomes quite frustrating to have to guess which port we need to go into.
Also considered running the apps with --filter so only 1 app runs + its dependencies.
Would it be possible to define ports for all apps in a single config file? For example in turbo.json. We have many apps in our monorepo and would like to be able to easily see what app is running under what port. Would make adding a new app and port easier as well.
+1 The ability to define ports for apps in a config file would be awesome.
We talked about this at the team meeting today, and we think this is ultimately part of #986 when we get to it. I'll leave this open since the scope is much narrower, but I think we'll want to think through it together.
In the meantime, hardcoding the port in each package.json is the best workaround I can think of
Which project is this feature idea for?
Turborepo
Describe the feature you'd like to request
Hi team. Turborepo is great, but there are some areas we could improve on.
One of the areas is how ports are attributed to nextjs repos inside the apps folder. I'm working on a monorepo with several applications (production and some prototypes) and its quite hard to find which port should I connect to because it changes every time I stop my dev process for whatever reason. I know we can hard code the ports on apps/my_app/package.json but I wonder if instead of assigning the ports randomly based on which process started first, they could be assigned alphabetically based of the apps folder. This way if you are working on localhost:3009 and you need to stop
turbo dev
to run some dependency install and then runturbo dev
again at least your app is still on the same port and you dont have to go and try port 3000, 3001, 3002, etc until you find your app.I understand that this might not be a out of the box feature, but it can be frustrating in a large monorepo with multiple applications always having to guess where your app is.
Describe the solution you'd like
I would like to call
yarn dev --ports-sequence
or someething to indicate to turborepo that each app needs to start in a sequence (alphabetical) and not cuncurrently.Describe alternatives you've considered
I can manually go and assign a port to each application package.json but in my particular repo where prototypes are constantly added, its hard to see which ports are already assigned specially.
So for example if you think of an app looking like this
And you have to manually set the
dev
process inside each package.json individuallynext dev --port 3000
.And even if you are careful and make your ports assigned alphabetically and you add a new prototype then the port you manually have assigned to
website
will be incorrect. Or if you add a new app calleddocs
then all of them are incorrect becausedocs
comes beforeprototype...
alphabetically.So you either have to:
On an application with 1-4 apps maybe this is nor relevant, but anything bigger than that it becomes quite frustrating to have to guess which port we need to go into.
Also considered running the apps with
--filter
so only 1 app runs + its dependencies.TURBO-1521
The text was updated successfully, but these errors were encountered: