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: Configure dev server port with dev.server.port #577

Merged
merged 4 commits into from
Mar 29, 2024

Conversation

zizhengtai
Copy link
Contributor

Added the dev.port field to InlineConfig to allow configuring the dev server port.

Copy link

netlify bot commented Mar 29, 2024

Deploy Preview for creative-fairy-df92c4 ready!

Name Link
🔨 Latest commit d8ffc30
🔍 Latest deploy log https://app.netlify.com/sites/creative-fairy-df92c4/deploys/660655a2fb90160009cd7cc6
😎 Deploy Preview https://deploy-preview-577--creative-fairy-df92c4.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@aklinker1
Copy link
Collaborator

Thanks for the PR! But I forgot, it's not that easy lol...

inlineConfig comes from the CLI, so as it is now, unless we add a --port CLI flag, inlineConfig.dev.port is always undefined.

All config is merged and default values are applied inside resolveConfig, then we use the resolved config everywhere (accessible via wxt.config). So we should also add the port to the ResolvedConfig type and grab it from there. BUT to resolve the config, we need the server, and to create the server, we need the port. So there's kind of a dependency loop there.

Let me refactor a little and break that loop, and I'll commit my changes to this PR.

Copy link

codecov bot commented Mar 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.38%. Comparing base (c9c5d72) to head (d8ffc30).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #577      +/-   ##
==========================================
+ Coverage   86.22%   86.38%   +0.15%     
==========================================
  Files         111      111              
  Lines        8909     8937      +28     
  Branches      886      892       +6     
==========================================
+ Hits         7682     7720      +38     
+ Misses       1213     1203      -10     
  Partials       14       14              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@aklinker1
Copy link
Collaborator

Alright, fixed that issue and merged your PR with the latest. I ended up putting the config under dev.server.port, instead of just dev.port.

@aklinker1 aklinker1 changed the title Add dev server port option feat: Configure dev server port with dev.server.port Mar 29, 2024
@aklinker1 aklinker1 merged commit 5a3b42a into wxt-dev:main Mar 29, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants