-
Notifications
You must be signed in to change notification settings - Fork 778
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
feat: implement a basic wrangler delete
#2045
Conversation
🦋 Changeset detectedLatest commit: eedf371 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
cd0c62c
to
92f410d
Compare
A wrangler prerelease is available for testing. You can install this latest build in your project with: npm install --save-dev https://prerelease-registry.developers.workers.dev/runs/3275008068/npm-package-wrangler-2045 You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.developers.workers.dev/prs/2045/npm-package-wrangler-2045 Or you can use npx https://prerelease-registry.developers.workers.dev/runs/3275008068/npm-package-wrangler-2045 dev path/to/script.js Additional artifacts:npm install https://prerelease-registry.developers.workers.dev/runs/3275008068/npm-package-cloudflare-pages-shared-2045 |
92f410d
to
fc77c35
Compare
Codecov Report
@@ Coverage Diff @@
## main #2045 +/- ##
==========================================
+ Coverage 72.53% 72.64% +0.11%
==========================================
Files 123 124 +1
Lines 8399 8430 +31
Branches 2202 2208 +6
==========================================
+ Hits 6092 6124 +32
+ Misses 2307 2306 -1
|
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.
👀
// delete | ||
wrangler.command( | ||
"delete [script]", | ||
"🗑 Delete your Worker from Cloudflare.", |
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.
❤️
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.
🧡
This PR adds a simple (but useful!) implementation for `wrangler delete`. Of note, it'll delete a given service, including all it's bindings. It uses the same api as the dashboard.
fc77c35
to
eedf371
Compare
await fetchResult( | ||
`/accounts/${accountId}/workers/services/${scriptName}`, | ||
{ method: "DELETE" }, | ||
new URLSearchParams({ force: "true" }) |
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.
Should the force
be added as a CLI option?
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 considered it, but honestly it's the only way that it's actually useful (which is why it's added by default on the dashboard too).
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.
Looks good to me, welcome to the team
This PR adds a simple (but useful!) implementation for
wrangler delete
. Of note, it'll delete a given service, including all it's bindings. It uses the same api as the dashboard.