-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make serve default command #1638
Conversation
095fd50
to
6706a4c
Compare
0957992
to
0bd0d79
Compare
6706a4c
to
3b801d0
Compare
bin/cli
Outdated
console.warn('Warning: It looks like you may have run the command `npm start` locally') | ||
console.warn('if you are using the kit on a personal machine you should use `npm run dev`') | ||
console.warn() | ||
console.warn('If you are seeing this warning in production, it may indicate that your') | ||
console.warn('hosting service needs further configuration.') | ||
console.warn() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@NoraGDS to review this content.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whats the current logic to display this message?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joelanman I've added comments to the lines above to try and make the logic clearer, does that help?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Paired with @NoraGDS on the message, our suggested revision to content:
console.warn('Warning: It looks like you may have run the command `npm start` locally') | |
console.warn('if you are using the kit on a personal machine you should use `npm run dev`') | |
console.warn() | |
console.warn('If you are seeing this warning in production, it may indicate that your') | |
console.warn('hosting service needs further configuration.') | |
console.warn() | |
console.warn('Warning: It looks like you may have run the command `npm start` locally.') | |
console.warn('try running `npm run dev`') | |
console.warn() | |
console.warn('If you see the above warning when trying to host your prototype online,') | |
console.warn('it may be that your hosting service needs further configuration.') | |
console.warn() |
We still want more time to think about it though, ideally npm run dev
would be the last thing the user sees, but swapping the order of the paragraphs around doesn't work either :/
3b801d0
to
41401ea
Compare
Tech side looks good to me. I also agree with the interface, I'd like confirmation from @joelanman on the approach:
|
I agree I'm still not sure about |
a point on management pages - we havent yet looked at that design in detail, and production/online will need access to Clear data (and Password, which is also in Manage) |
Is the main concern the word
I think we can we keep management pages out of scope for this PR, should be possible to fix later. |
41401ea
to
7400451
Compare
I'm nervous about using the default command ( There's such a standard or a) @joelanman shall we catch up tomorrow about it? |
7400451
to
aae71c7
Compare
We want to make sure that whatever service a user might be running their prototype on online, they use the production scripts and configuration. Unfortunately, there isn't a standard way to detect whether a project is running in production or not; not all services set NODE_ENV [[1]], not all services will read a Procfile, etc. The only surefire way we can think of is to make it so that running `npm start` in a prototype runs the production code by default. [1]: #1202
We want to catch what we suspect will be a common case, where the user runs `npm start` having been used to that from before, and then ends up with a prototype that isn't working and no idea why. In those circumstances we should give the users a heads-up by outputting something to the terminal. While we can't be certain of when this might have happened, we can make a reasonable guess, and the downside of logging to a hosting services console erroneously is negligible.
good to discuss all this, agree that:
is the new local command to run the kit, and
is now reserved for running 'in production' - with a password |
aae71c7
to
f7a924d
Compare
We want to make sure that whatever service a user might be running their prototype online, they use the production scripts and configuration. Unfortunately, there isn't a standard way to detect whether a project is running in production or not; not all services set NODE_ENV [1], not all services will read a Procfile, etc. The only surefire way we can think of is to make it so that running
npm start
in a prototype runs the production code by default.Unfortunately, this is a breaking change, as previously we told users to run
npm start
. We want to catch what we suspect will be a common case, where the user runsnpm start
having been used to that from before, and then ends up with a prototype that isn't working and no idea why. In those circumstances we should give the users a heads-up by outputting something to the terminal. While we can't be certain of when this might have happened, we can make a reasonable guess, and the downside of logging to a hosting services console erroneously is negligible.Resolves #1202.