-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
add a new flag with --open for the dev and the preview #6578
Conversation
🦋 Changeset detectedLatest commit: 5feafad The changes in this PR will be included in the next version bump. 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 |
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.
I think we also need to document the CLI flags for --help
:
astro/packages/astro/src/core/dev/dev.ts
Lines 44 to 47 in da0cfeb
['--port', `Specify which port to run on. Defaults to 3000.`], | |
['--host', `Listen on all addresses, including LAN and public addresses.`], | |
['--host <custom-address>', `Expose on a network IP address at <custom-address>`], | |
['--help (-h)', 'See all available flags.'], |
Flags: [['--help (-h)', 'See all available flags.']], |
I tried running this locally, but I'm not sure it's working. I needed to handle the open
option here to work:
astro/packages/astro/src/core/config/config.ts
Lines 94 to 105 in da0cfeb
return { | |
root: typeof flags.root === 'string' ? flags.root : undefined, | |
site: typeof flags.site === 'string' ? flags.site : undefined, | |
base: typeof flags.base === 'string' ? flags.base : undefined, | |
port: typeof flags.port === 'number' ? flags.port : undefined, | |
config: typeof flags.config === 'string' ? flags.config : undefined, | |
host: | |
typeof flags.host === 'string' || typeof flags.host === 'boolean' ? flags.host : undefined, | |
drafts: typeof flags.drafts === 'boolean' ? flags.drafts : undefined, | |
experimentalAssets: | |
typeof flags.experimentalAssets === 'boolean' ? flags.experimentalAssets : undefined, | |
}; |
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.
We need to add this new option to the help command
@withastro/maintainers-docs could you please double check the description of the new argument? |
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.
@wulinsheng123 I could suggest an option for testing:
- share the link to the vite option that we leverage
- share a video/gif that shows the new argument in action
What can I do without Astro including a new feature with the property of open? |
Let me try to record a video |
I apologized. |
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.
Updated the flag name slightly. LGTM. Thanks for implementing this!
Changes
fix bug : #6578
I have added a new flag with --open for the dev and the preview.
And have extended the config of the schema with a property of open.
I didn't find any good method to test this property of open.
Testing
Docs