Skip to content
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

feat: add serve command #5351

Merged
merged 48 commits into from
Jan 10, 2023
Merged

feat: add serve command #5351

merged 48 commits into from
Jan 10, 2023

Conversation

eduardoboucas
Copy link
Member

@eduardoboucas eduardoboucas commented Jan 6, 2023

Summary

Builds on top of #5338 and moves the --prod flag into a separate serve command. I used this opportunity to move a bunch of logic our of the dev command file and into auxiliary files that can be included from multiple commands, so the diff looks much scarier than it actually is.

I tried to add some comments about which parts have moved around, and I'm happy to answer any questions about what changed.

@eduardoboucas eduardoboucas added the type: feature code contributing to the implementation of a feature and/or user facing functionality label Jan 6, 2023
@github-actions
Copy link

github-actions bot commented Jan 9, 2023

📊 Benchmark results

Comparing with 2b7045e

Package size: 259 MB

(no change)

^          259 MB  259 MB  259 MB  259 MB  259 MB  259 MB  259 MB  259 MB  259 MB  259 MB  259 MB  259 MB 
│  242 MB   ┌──┐    ┌──┐    ┌──┐    ┌──┐    ┌──┐    ┌──┐    ┌──┐    ┌──┐    ┌──┐    ┌──┐    ┌──┐    ┌──┐  
│   ┌──┐    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
└───┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴──>
    T-12    T-11    T-10    T-9     T-8     T-7     T-6     T-5     T-4     T-3     T-2     T-1      T    
Legend

@eduardoboucas eduardoboucas marked this pull request as ready for review January 9, 2023 15:47
@eduardoboucas eduardoboucas requested a review from a team January 9, 2023 15:47
@eduardoboucas eduardoboucas requested a review from a team as a code owner January 9, 2023 15:47
@eduardoboucas eduardoboucas changed the title feat: create separate serve command feat: create serve command Jan 9, 2023
@eduardoboucas eduardoboucas changed the title feat: create serve command feat: add serve command Jan 9, 2023
const { success } = await buildSite(buildSiteOptions)

if (!success) {
error('Could not start local server due to a build error')
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ascorbic This addresses a comment you made earlier.

@eduardoboucas
Copy link
Member Author

@ascorbic Could you give this another look?

Copy link
Member

@ascorbic ascorbic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I thought I'd already re-reviewed it! Can confirm I've been using this and it works great.

@eduardoboucas eduardoboucas merged commit 0d583d9 into main Jan 10, 2023
@eduardoboucas eduardoboucas deleted the feat/serve-command-2 branch January 10, 2023 13:53
@codebyuma
Copy link
Contributor

Hey @eduardoboucas, I was just starting to create the docs issue to add this to the Get Started with the CLI doc once this is no longer in beta and I went to refer to the CLI command reference docs that you link to from the readme, but it doesn't look like those were added (/docs/commands/serve.md) - are you still planning to add this (maybe in a separate PR)?

@eduardoboucas
Copy link
Member Author

Hmm, that's weird. That file should've been created automatically and deployed to the docs site, but for some reason it wasn't. I'll investigate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature code contributing to the implementation of a feature and/or user facing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants