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

Add support for --base CLI argument #4917

Merged
merged 6 commits into from
Oct 26, 2022
Merged

Add support for --base CLI argument #4917

merged 6 commits into from
Oct 26, 2022

Conversation

natemoo-re
Copy link
Member

@natemoo-re natemoo-re commented Sep 29, 2022

Changes

  • Astro currently allows --site and --root and a few other CLI arguments.
  • This PR adds support for --base as well
  • Why? Sometimes CLI arguments are very handy, like if you're building an official GitHub Action (withastro/action) and want to automatically pass in the --site and --base that GitHub already knows.

See also actions/configure-pages#30

Testing

Tested manually because we don't have equivalent tests for --site or other arguments

Docs

withastro/docs#1646
/cc @withastro/maintainers-docs

@natemoo-re natemoo-re requested a review from a team as a code owner September 29, 2022 15:46
@changeset-bot
Copy link

changeset-bot bot commented Sep 29, 2022

🦋 Changeset detected

Latest commit: a59becb

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

@github-actions github-actions bot added pkg: astro Related to the core `astro` package (scope) pkg: example Related to an example package (scope) labels Sep 29, 2022
Copy link
Contributor

@tony-sull tony-sull left a comment

Choose a reason for hiding this comment

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

Nice! Might be worth adding a CLI log that could be checked by a test as well if the CLI tests are in a decent spot for it, but not 100% necessary 👍

@sarah11918
Copy link
Member

Removing the docs-maintainers review, as the changes to @types/astro.ts won't affect docs!

@jasikpark
Copy link
Contributor

jasikpark commented Sep 29, 2022

can you update astro help for these?

❯ npx astro build --help

   astro  v1.4.0 Build faster websites.

  astro [command] [...flags]

   Commands 
              add  Add an integration.
            build  Build your project and write it to disk.
            check  Check your project for errors.
              dev  Start the development server.
             docs  Open documentation in your web browser.
          preview  Preview your build locally.
        telemetry  Configure telemetry settings.

   Global Flags 
  --config <path>  Specify your config file.
    --root <path>  Specify your project root folder.
        --verbose  Enable verbose logging.
         --silent  Disable all logging.
        --version  Show the version number and exit.
           --help  Show this help message.


interesting that astro build -h doesn't print help & just builds
i would have expected that you can drill into build-specific flags w/ astro help build or astro build --help

@natemoo-re
Copy link
Member Author

Thanks @jasikpark! Updated the help command output. Would you mind opening a new issue for tracking astro build --help?

@jasikpark
Copy link
Contributor

does this classify as a bug report? since that's the only type of issue in "new issue" that creates an actual issue?

@jasikpark
Copy link
Contributor

Thanks @jasikpark! Updated the help command output. Would you mind opening a new issue for tracking astro build --help?

#4935

@@ -0,0 +1,5 @@
---
'astro': patch
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like this should be a minor

Copy link
Contributor

@matthewp matthewp left a comment

Choose a reason for hiding this comment

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

Think this is a minor change.

@github-actions github-actions bot added the semver: minor Change triggers a `minor` release label Oct 4, 2022
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This PR is blocked because it contains a minor changeset. A reviewer will merge this at the next release if approved.

Copy link
Contributor

@matthewp matthewp left a comment

Choose a reason for hiding this comment

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

lgtm for next minor

@matthewp
Copy link
Contributor

matthewp commented Oct 7, 2022

@natemoo-re can you fill out the changeset a bit more? Something like a paragraph, maybe a code example, so that this could be copy/pasted into a blog post. Thank you!

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This PR is blocked because it contains a minor changeset. A reviewer will merge this at the next release if approved.

@natemoo-re natemoo-re merged commit ddf2f83 into main Oct 26, 2022
@natemoo-re natemoo-re deleted the fix/cli-base branch October 26, 2022 15:13
@astrobot-houston astrobot-houston mentioned this pull request Oct 26, 2022
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) pkg: example Related to an example package (scope) semver: minor Change triggers a `minor` release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants