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

Fix/2177/log missing local network ip #2732

Merged
merged 13 commits into from
Mar 8, 2022

Conversation

bholmesdev
Copy link
Contributor

Changes

Screen Shot 2022-03-08 at 2 07 36 PM

Testing

Manually tested with different --hostname arguments.

Docs

N/A

@changeset-bot
Copy link

changeset-bot bot commented Mar 8, 2022

🦋 Changeset detected

Latest commit: 8f4df75

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
astro Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Mar 8, 2022
Comment on lines +31 to +33
const { type = 'module', version, dependencies = {} } = await fs.readFile('./package.json').then((res) => JSON.parse(res.toString()));
// expose PACKAGE_VERSION on process.env for CLI utils
config.define = { 'process.env.PACKAGE_VERSION': JSON.stringify(version) };
Copy link
Member

Choose a reason for hiding this comment

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

We were already reading the local package.json file anyway, so we can inject whatever metadata we need during build

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great call!

@github-actions github-actions bot added the test label Mar 8, 2022
Copy link
Member

@natemoo-re natemoo-re left a comment

Choose a reason for hiding this comment

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

Nice! Looks good to merge once CI is all passing.

@bholmesdev bholmesdev merged commit 0ae96bb into main Mar 8, 2022
@bholmesdev bholmesdev deleted the fix/2177/log-missing-local-network-ip branch March 8, 2022 22:11
This was referenced Mar 8, 2022
SiriousHunter pushed a commit to SiriousHunter/astro that referenced this pull request Feb 3, 2023
* feat: show "localhost" for local network IPs

* refactor: remove timestamps from addr logs

* fix: hide timestamp on null types

* feat: add emoji OS helper

* feat: make logs 100% nicer

* refactor: extract isLocalHost to util

* feat: update preview logs to match

* chore: add changeset

* fix: pull pkg version from package.json

* refactor: remove 👉 guys

* fix: devStart return type

* feat: inject process.env.PACKAGE_VERSION at build time

* feat: update unit test for hostname checks

Co-authored-by: Nate Moore <nate@skypack.dev>
SiriousHunter pushed a commit to SiriousHunter/astro that referenced this pull request Feb 3, 2023
* feat: show "localhost" for local network IPs

* refactor: remove timestamps from addr logs

* fix: hide timestamp on null types

* feat: add emoji OS helper

* feat: make logs 100% nicer

* refactor: extract isLocalHost to util

* feat: update preview logs to match

* chore: add changeset

* fix: pull pkg version from package.json

* refactor: remove 👉 guys

* fix: devStart return type

* feat: inject process.env.PACKAGE_VERSION at build time

* feat: update unit test for hostname checks

Co-authored-by: Nate Moore <nate@skypack.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 BUG: Astro CLI Config devOptions.hostname not displaying local network IP.
2 participants