Skip to content

[wip] support --json flag for pages publish #2927

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

Closed

Conversation

tjenkinson
Copy link

@tjenkinson tjenkinson commented Mar 20, 2023

Fixes #2437

What this PR solves / how to test:

Adds a --json flag to pages publish command, that outputs the URL to the deployment.

This is still WIP but would be great to get some feedback on the approach here. The idea is to put the logger into a mode where it will not use stdout, and then any log messages that would have gone to stdout will be redirected to stderr instead, just leaving stdout for the json.

  • I wonder if the logger should become instance based and passed through to things that need it?
  • Or should we have a global --json flag that constructs the logger in a mode with stdout disabled to prevent any chance of something getting through before it's configured?
  • Should we stop using stdout and reserve that just for machine readable messages?

I noticed there's one other place already that already respects a --json flag in the cli.

Associated docs issue(s)/PR(s):

  • [insert associated docs issue(s)/PR(s)]

Author has included the following, where applicable:

Reviewer has performed the following, where applicable:

  • Checked for inclusion of relevant tests
  • Checked for inclusion of a relevant changeset
  • Checked for creation of associated docs updates
  • Manually pulled down the changes and spot-tested

@changeset-bot
Copy link

changeset-bot bot commented Mar 20, 2023

⚠️ No Changeset found

Latest commit: 5bc6a9c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@penalosa
Copy link
Contributor

penalosa commented Nov 5, 2024

Thanks for this PR! Apologies for the delay here, but in the meantime we implemented a different way to do what this PR proposes. Setting the WRANGLER_OUTPUT_FILE_PATH env var to a file path will trigger Wrangler to write JSON-NL metadata about what it's doing to that file, including the Pages deployment URL. Because of that I'm going to close this PR for now, but feel free to open a new issue if that doesn't fully address your use-case.

@penalosa penalosa closed this Nov 5, 2024
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.

🚀 Feature Request: Support JSON output on pages cli functions
2 participants