platformsh / platformify

Get your project ready to be deployed in Platform.sh
MIT License
2 stars 8 forks source link

Consider altering the generic start command #207

Open gilzow opened 6 months ago

gilzow commented 6 months ago

Was working with a client recently who was frustrated with trying to get their application working after using the project:init command. What tripped them up was the generic start command we place when we don't know which start command the app needs.

Given they were unfamiliar with how our system works, they took the command literally

start: "echo 'Put your web server command in here! You need to listen to \"$PORT\" port. Read more about it here: https://docs.platform.sh/create-apps/app-reference.html#web-commands'; sleep 60"

replacing it with:

start: "echo 'npm run start'; sleep 60"

Given the generated config file, they assumed our system required the echo and the sleep 60. They were then further frustrated and confused since they could "see" npm run start being "executed" in the logs.

I know the intention of including this echo was so that someone who didnt read the generated config file and deployed their app would then hopefully see the message in the log, but in this case we have the opposite problem.

I'm not sure what the best course of action is here. My first thought is we should probably prompt the user for the start command if we don't know for sure which one to use, and not put anything in there for them that isn't a real start command. If the user doesn't give us anything (or maybe let them select an 'unsure' option) warn them and open their browser to the docs page on start commands.

gilzow commented 6 months ago

FWIW, I know there have been a couple of times where project:init detected parts of what I had in the directory but did NOT warn me that it was going to not include a valid start command. I then spent more than a few minutes trying to figure out what was wrong before I saw the logs.