Skip to content

feat: ✨ introduce json output for cf pages deployment list#8318

Merged
petebacondarwin merged 3 commits intocloudflare:mainfrom
gnekich:feat/introduce-json-output-for-pages-deployments-list
Aug 11, 2025
Merged

feat: ✨ introduce json output for cf pages deployment list#8318
petebacondarwin merged 3 commits intocloudflare:mainfrom
gnekich:feat/introduce-json-output-for-pages-deployments-list

Conversation

@gnekich
Copy link
Copy Markdown
Contributor

@gnekich gnekich commented Mar 1, 2025

…as it enables other tools like jq to parse the data, also fixes [#2437]
It also introduces Id of the deployment to the output

Fixes #2437 .

added --json flag to the wrangler pages deployment list

This enables scripts like this to work:

#!/bin/bash

# List all deployments and get their IDs
deployments=$(npx wrangler pages deployment list --json | jq -r '.[].Id')

# Get the last deployment ID
last_deployment=$(echo "$deployments" | head -n 1)

# Loop through all deployments and delete each one except the last
for deployment in $deployments; do
  if [ "$deployment" != "$last_deployment" ]; then
    echo "Deleting deployment $deployment ..."
    npx wrangler pages deployment delete $deployment
  fi
done

  • Tests
    • TODO (before merge)
    • Tests included
    • Tests not necessary because:
  • Wrangler E2E Tests CI Job required? (Use "e2e" label or ask maintainer to run separately)
    • I don't know
    • Required
    • Not required because: covered by non-e2e tests
  • Public documentation

@gnekich gnekich requested review from a team as code owners March 1, 2025 18:50
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 1, 2025

🦋 Changeset detected

Latest commit: 9f6c6b4

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

This PR includes changesets to release 3 packages
Name Type
wrangler Minor
@cloudflare/vite-plugin Major
@cloudflare/vitest-pool-workers 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
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 1, 2025

A wrangler prerelease is available for testing. You can install this latest build in your project with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13641985438/npm-package-wrangler-8318

You can reference the automatically updated head of this PR with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/8318/npm-package-wrangler-8318

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13641985438/npm-package-wrangler-8318 dev path/to/script.js
Additional artifacts:

cloudflare-workers-bindings-extension:

wget https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13641985438/npm-package-cloudflare-workers-bindings-extension-8318 -O ./cloudflare-workers-bindings-extension.0.0.0-v577ad398c.vsix && code --install-extension ./cloudflare-workers-bindings-extension.0.0.0-v577ad398c.vsix

create-cloudflare:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13641985438/npm-package-create-cloudflare-8318 --no-auto-update

@cloudflare/kv-asset-handler:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13641985438/npm-package-cloudflare-kv-asset-handler-8318

miniflare:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13641985438/npm-package-miniflare-8318

@cloudflare/pages-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13641985438/npm-package-cloudflare-pages-shared-8318

@cloudflare/unenv-preset:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13641985438/npm-package-cloudflare-unenv-preset-8318

@cloudflare/vite-plugin:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13641985438/npm-package-cloudflare-vite-plugin-8318

@cloudflare/vitest-pool-workers:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13641985438/npm-package-cloudflare-vitest-pool-workers-8318

@cloudflare/workers-editor-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13641985438/npm-package-cloudflare-workers-editor-shared-8318

@cloudflare/workers-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13641985438/npm-package-cloudflare-workers-shared-8318

@cloudflare/workflows-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13641985438/npm-package-cloudflare-workflows-shared-8318

Note that these links will no longer work once the GitHub Actions artifact expires.


wrangler@3.111.0 includes the following runtime dependencies:

Package Constraint Resolved
miniflare workspace:* 3.20250214.1
workerd 1.20250214.0 1.20250214.0
workerd --version 1.20250214.0 2025-02-14

Please ensure constraints are pinned, and miniflare/workerd minor versions match.

@petebacondarwin
Copy link
Copy Markdown
Contributor

Thanks for this contribution @gnekich - it seems like a reasonable additional feature. In order to land this it will need tests see packages/wrangler/src/__tests__/pages/deployment-list.test.ts and a changeset. Would you be able to add those?

@gnekich
Copy link
Copy Markdown
Contributor Author

gnekich commented Mar 3, 2025

Thanks for the review, @petebacondarwin! I've added the tests and a changeset as requested.

Copy link
Copy Markdown
Contributor

@petebacondarwin petebacondarwin left a comment

Choose a reason for hiding this comment

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

This looks good. Please can you update the changeset type?

Comment thread .changeset/young-mammals-spend.md Outdated
@github-project-automation github-project-automation Bot moved this from Untriaged to In Review in workers-sdk Apr 2, 2025
@petebacondarwin petebacondarwin self-assigned this Jul 21, 2025
@petebacondarwin petebacondarwin force-pushed the feat/introduce-json-output-for-pages-deployments-list branch from d4a8ccf to 43d1d66 Compare July 21, 2025 13:37
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Jul 21, 2025

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@8318

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@8318

miniflare

npm i https://pkg.pr.new/miniflare@8318

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@8318

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@8318

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@8318

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@8318

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@8318

wrangler

npm i https://pkg.pr.new/wrangler@8318

commit: 9f6c6b4

@github-project-automation github-project-automation Bot moved this from In Review to Approved in workers-sdk Jul 21, 2025
@petebacondarwin petebacondarwin added skip-v3-pr skip-pr-description-validation Skip validation of the required PR description format labels Jul 21, 2025
petebacondarwin added a commit to cloudflare/cloudflare-docs that referenced this pull request Jul 30, 2025
@petebacondarwin petebacondarwin merged commit 8cf47f9 into cloudflare:main Aug 11, 2025
48 of 56 checks passed
@github-project-automation github-project-automation Bot moved this from Approved to Done in workers-sdk Aug 11, 2025
@workers-devprod workers-devprod added the contribution [Holopin] Recognizes an open-source contribution, big or small label Aug 11, 2025
@holopin-bot
Copy link
Copy Markdown

holopin-bot Bot commented Aug 11, 2025

Congratulations @gnekich, the maintainer of this repository has issued you a holobyte! Here it is: https://holopin.io/holobyte/cme6swqin446007ldcwkxnhaa

This badge can only be claimed by you, so make sure that your GitHub account is linked to your Holopin account. You can manage those preferences here: https://holopin.io/account.
Or if you're new to Holopin, you can simply sign up with GitHub, which will do the trick!

thomasgauvin pushed a commit to cloudflare/cloudflare-docs that referenced this pull request Aug 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contribution [Holopin] Recognizes an open-source contribution, big or small skip-pr-description-validation Skip validation of the required PR description format

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

🚀 Feature Request: Support JSON output on pages cli functions

4 participants