Skip to content

Commit 9ab0f22

Browse files
committed
Remove --json arg from cloudchamber and containers commands
This is a relic from an earlier time. The only command for which this is useful is the "cloudchamber curl" subcommand, in which case it should just be the default and non-configurable anyway.
1 parent 8acaf43 commit 9ab0f22

File tree

29 files changed

+308
-518
lines changed

29 files changed

+308
-518
lines changed

.changeset/tender-cups-grin.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"wrangler": patch
3+
---
4+
5+
Remove --json flag from containers and cloudchamber commands

packages/wrangler/src/__tests__/cloudchamber/apply.test.ts

Lines changed: 22 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ describe("cloudchamber apply", () => {
103103
});
104104
mockGetApplications([]);
105105
mockCreateApplication({ id: "abc" } as Application);
106-
await runWrangler("cloudchamber apply --json");
106+
await runWrangler("cloudchamber apply");
107107
/* eslint-disable */
108108
expect(std.stderr).toMatchInlineSnapshot(`""`);
109109
expect(std.stdout).toMatchInlineSnapshot(`
@@ -176,7 +176,7 @@ describe("cloudchamber apply", () => {
176176
},
177177
]);
178178
const applicationReqBodyPromise = mockModifyApplication();
179-
await runWrangler("cloudchamber apply --json");
179+
await runWrangler("cloudchamber apply");
180180
/* eslint-disable */
181181
expect(std.stdout).toMatchInlineSnapshot(`
182182
"╭ Deploy a container application deploy changes to your application
@@ -194,8 +194,6 @@ describe("cloudchamber apply", () => {
194194
│ - tier = 3
195195
│ + tier = 2
196196
197-
├ Loading
198-
199197
200198
│  SUCCESS  Modified application my-container-app
201199
@@ -256,7 +254,7 @@ describe("cloudchamber apply", () => {
256254
]);
257255
const res = mockModifyApplication();
258256
mockCreateApplication({ id: "abc" } as Application);
259-
await runWrangler("cloudchamber apply --json");
257+
await runWrangler("cloudchamber apply");
260258
const body = await res;
261259
expect(body).not.toHaveProperty("instances");
262260
/* eslint-disable */
@@ -287,8 +285,6 @@ describe("cloudchamber apply", () => {
287285
│ [containers.constraints]
288286
│ tier = 1
289287
290-
├ Loading
291-
292288
293289
│  SUCCESS  Modified application my-container-app
294290
@@ -348,7 +344,7 @@ describe("cloudchamber apply", () => {
348344
},
349345
]);
350346
mockCreateApplication({ id: "abc" } as Application);
351-
await runWrangler("cloudchamber apply --json");
347+
await runWrangler("cloudchamber apply");
352348

353349
/* eslint-disable */
354350
expect(std.stdout).toMatchInlineSnapshot(`
@@ -434,7 +430,7 @@ describe("cloudchamber apply", () => {
434430
]);
435431
const res = mockModifyApplication();
436432
mockCreateApplication({ id: "abc" } as Application);
437-
await runWrangler("cloudchamber apply --json");
433+
await runWrangler("cloudchamber apply");
438434
await res;
439435
/* eslint-disable */
440436
expect(std.stdout).toMatchInlineSnapshot(`
@@ -463,8 +459,6 @@ describe("cloudchamber apply", () => {
463459
│ [containers.constraints]
464460
│ tier = 1
465461
466-
├ Loading
467-
468462
469463
│  SUCCESS  Modified application my-container-app
470464
@@ -572,7 +566,7 @@ describe("cloudchamber apply", () => {
572566
},
573567
]);
574568
const res = mockModifyApplication();
575-
await runWrangler("cloudchamber apply --json");
569+
await runWrangler("cloudchamber apply");
576570
await res;
577571
/* eslint-disable */
578572
expect(std.stdout).toMatchInlineSnapshot(`
@@ -602,8 +596,6 @@ describe("cloudchamber apply", () => {
602596
│ - [[containers.configuration.secrets]]
603597
│ name = \\"MY_SECRET_2\\"
604598
605-
├ Loading
606-
607599
608600
│  SUCCESS  Modified application my-container-app
609601
@@ -709,7 +701,7 @@ describe("cloudchamber apply", () => {
709701
},
710702
},
711703
]);
712-
await runWrangler("cloudchamber apply --json");
704+
await runWrangler("cloudchamber apply");
713705
/* eslint-disable */
714706
expect(std.stdout).toMatchInlineSnapshot(`
715707
"╭ Deploy a container application deploy changes to your application
@@ -823,7 +815,7 @@ describe("cloudchamber apply", () => {
823815
{ ...completeApp, version: 1 },
824816
{ ...completeApp, version: 1, name: "my-container-app-2", id: "abc2" },
825817
]);
826-
await runWrangler("cloudchamber apply --json");
818+
await runWrangler("cloudchamber apply");
827819
/* eslint-disable */
828820
expect(std.stdout).toMatchInlineSnapshot(`
829821
"╭ Deploy a container application deploy changes to your application
@@ -936,7 +928,7 @@ describe("cloudchamber apply", () => {
936928
},
937929
},
938930
]);
939-
await runWrangler("cloudchamber apply --json");
931+
await runWrangler("cloudchamber apply");
940932
/* eslint-disable */
941933
expect(std.stdout).toMatchInlineSnapshot(`
942934
"╭ Deploy a container application deploy changes to your application
@@ -1050,7 +1042,7 @@ describe("cloudchamber apply", () => {
10501042
{ ...completeApp, version: 1 },
10511043
{ ...completeApp, version: 1, name: "my-container-app-2", id: "abc2" },
10521044
]);
1053-
await runWrangler("cloudchamber apply --json");
1045+
await runWrangler("cloudchamber apply");
10541046
/* eslint-disable */
10551047
expect(std.stdout).toMatchInlineSnapshot(`
10561048
"╭ Deploy a container application deploy changes to your application
@@ -1108,7 +1100,7 @@ describe("cloudchamber apply", () => {
11081100
},
11091101
]);
11101102
const applicationReqBodyPromise = mockModifyApplication();
1111-
await runWrangler("cloudchamber apply --json");
1103+
await runWrangler("cloudchamber apply");
11121104
/* eslint-disable */
11131105
expect(std.stdout).toMatchInlineSnapshot(`
11141106
"╭ Deploy a container application deploy changes to your application
@@ -1127,8 +1119,6 @@ describe("cloudchamber apply", () => {
11271119
│ [containers.constraints]
11281120
│ ...
11291121
1130-
├ Loading
1131-
11321122
11331123
│  SUCCESS  Modified application my-container-app
11341124
@@ -1182,7 +1172,7 @@ describe("cloudchamber apply", () => {
11821172
},
11831173
]);
11841174
const applicationReqBodyPromise = mockModifyApplication();
1185-
await runWrangler("cloudchamber apply --json");
1175+
await runWrangler("cloudchamber apply");
11861176
/* eslint-disable */
11871177
expect(std.stdout).toMatchInlineSnapshot(`
11881178
"╭ Deploy a container application deploy changes to your application
@@ -1201,8 +1191,6 @@ describe("cloudchamber apply", () => {
12011191
│ [containers.constraints]
12021192
│ ...
12031193
1204-
├ Loading
1205-
12061194
12071195
│  SUCCESS  Modified application my-container-app
12081196
@@ -1261,7 +1249,7 @@ describe("cloudchamber apply", () => {
12611249
},
12621250
]);
12631251
const applicationReqBodyPromise = mockModifyApplication();
1264-
await runWrangler("cloudchamber apply --json");
1252+
await runWrangler("cloudchamber apply");
12651253
/* eslint-disable */
12661254
expect(std.stdout).toMatchInlineSnapshot(`
12671255
"╭ Deploy a container application deploy changes to your application
@@ -1277,8 +1265,6 @@ describe("cloudchamber apply", () => {
12771265
│ [containers.constraints]
12781266
│ ...
12791267
1280-
├ Loading
1281-
12821268
12831269
│  SUCCESS  Modified application my-container-app
12841270
@@ -1337,7 +1323,7 @@ describe("cloudchamber apply", () => {
13371323
},
13381324
]);
13391325
const applicationReqBodyPromise = mockModifyApplication();
1340-
await runWrangler("cloudchamber apply --json");
1326+
await runWrangler("cloudchamber apply");
13411327
/* eslint-disable */
13421328
expect(std.stdout).toMatchInlineSnapshot(`
13431329
"╭ Deploy a container application deploy changes to your application
@@ -1353,8 +1339,6 @@ describe("cloudchamber apply", () => {
13531339
│ [containers.constraints]
13541340
│ ...
13551341
1356-
├ Loading
1357-
13581342
13591343
│  SUCCESS  Modified application my-container-app
13601344
@@ -1412,7 +1396,7 @@ describe("cloudchamber apply", () => {
14121396
},
14131397
]);
14141398
const applicationReqBodyPromise = mockModifyApplication();
1415-
await runWrangler("cloudchamber apply --json");
1399+
await runWrangler("cloudchamber apply");
14161400
/* eslint-disable */
14171401
expect(std.stdout).toMatchInlineSnapshot(`
14181402
"╭ Deploy a container application deploy changes to your application
@@ -1428,8 +1412,6 @@ describe("cloudchamber apply", () => {
14281412
│ [containers.constraints]
14291413
│ ...
14301414
1431-
├ Loading
1432-
14331415
14341416
│  SUCCESS  Modified application my-container-app
14351417
@@ -1490,7 +1472,7 @@ describe("cloudchamber apply", () => {
14901472
},
14911473
]);
14921474
const applicationReqBodyPromise = mockModifyApplication();
1493-
await runWrangler("cloudchamber apply --json");
1475+
await runWrangler("cloudchamber apply");
14941476
/* eslint-disable */
14951477
expect(std.stdout).toMatchInlineSnapshot(`
14961478
"╭ Deploy a container application deploy changes to your application
@@ -1506,8 +1488,6 @@ describe("cloudchamber apply", () => {
15061488
│ [containers.constraints]
15071489
│ ...
15081490
1509-
├ Loading
1510-
15111491
15121492
│  SUCCESS  Modified application my-container-app
15131493
@@ -1568,7 +1548,7 @@ describe("cloudchamber apply", () => {
15681548
},
15691549
},
15701550
]);
1571-
await runWrangler("cloudchamber apply --json");
1551+
await runWrangler("cloudchamber apply");
15721552
/* eslint-disable */
15731553
expect(std.stdout).toMatchInlineSnapshot(`
15741554
"╭ Deploy a container application deploy changes to your application
@@ -1622,7 +1602,7 @@ describe("cloudchamber apply", () => {
16221602
},
16231603
},
16241604
]);
1625-
await runWrangler("cloudchamber apply --json");
1605+
await runWrangler("cloudchamber apply");
16261606
/* eslint-disable */
16271607
expect(std.stdout).toMatchInlineSnapshot(`
16281608
"╭ Deploy a container application deploy changes to your application
@@ -1684,7 +1664,7 @@ describe("cloudchamber apply", () => {
16841664
},
16851665
},
16861666
]);
1687-
await runWrangler("cloudchamber apply --json");
1667+
await runWrangler("cloudchamber apply");
16881668
/* eslint-disable */
16891669
expect(std.stdout).toMatchInlineSnapshot(`
16901670
"╭ Deploy a container application deploy changes to your application
@@ -1720,7 +1700,7 @@ describe("cloudchamber apply", () => {
17201700
});
17211701
mockGetApplications([]);
17221702
mockCreateApplication({ id: "abc" } as Application);
1723-
await runWrangler("cloudchamber apply --json");
1703+
await runWrangler("cloudchamber apply");
17241704
/* eslint-disable */
17251705
expect(std.stdout).toMatchInlineSnapshot(`
17261706
"╭ Deploy a container application deploy changes to your application
@@ -1794,7 +1774,7 @@ describe("cloudchamber apply", () => {
17941774
},
17951775
]);
17961776
const applicationReqBodyPromise = mockModifyApplication();
1797-
await runWrangler("cloudchamber apply --json");
1777+
await runWrangler("cloudchamber apply");
17981778
/* eslint-disable */
17991779
expect(std.stdout).toMatchInlineSnapshot(`
18001780
"╭ Deploy a container application deploy changes to your application
@@ -1818,8 +1798,6 @@ describe("cloudchamber apply", () => {
18181798
│ - tier = 3
18191799
│ + tier = 2
18201800
1821-
├ Loading
1822-
18231801
18241802
│  SUCCESS  Modified application my-container-app
18251803
@@ -1874,7 +1852,7 @@ describe("cloudchamber apply", () => {
18741852
},
18751853
]);
18761854
const applicationReqBodyPromise = mockModifyApplication();
1877-
await runWrangler("cloudchamber apply --json");
1855+
await runWrangler("cloudchamber apply");
18781856
/* eslint-disable */
18791857
expect(std.stdout).toMatchInlineSnapshot(`
18801858
"╭ Deploy a container application deploy changes to your application
@@ -1898,8 +1876,6 @@ describe("cloudchamber apply", () => {
18981876
│ - tier = 3
18991877
│ + tier = 2
19001878
1901-
├ Loading
1902-
19031879
19041880
│  SUCCESS  Modified application my-container-app
19051881

packages/wrangler/src/__tests__/cloudchamber/create.test.ts

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ describe("cloudchamber create", () => {
112112
-v, --version Show version number [boolean]
113113
114114
OPTIONS
115-
--json Return output as clean JSON [boolean] [default: false]
116115
--image Image to use for your deployment [string]
117116
--location Location on Cloudflare's network where your deployment will run [string]
118117
--var Container environment variables [array]
@@ -218,28 +217,6 @@ describe("cloudchamber create", () => {
218217
);
219218
});
220219

221-
it("should fail with a nice message when parameters are missing (json)", async () => {
222-
setIsTTY(false);
223-
setWranglerConfig({});
224-
await runWrangler("cloudchamber create --image hello:world --json");
225-
expect(std.out).toMatchInlineSnapshot(
226-
`"{\\"error\\":\\"location is required but it's not passed as an argument\\"}"`
227-
);
228-
expect(std.err).toMatchInlineSnapshot(`""`);
229-
});
230-
231-
it("should fail with a nice message when instance type is set with memory (json)", async () => {
232-
setIsTTY(false);
233-
setWranglerConfig({});
234-
await runWrangler(
235-
"cloudchamber create --image hello:world --location sfo06 --instance-type dev --memory 400GB --json"
236-
);
237-
expect(std.out).toMatchInlineSnapshot(
238-
`"{\\"error\\":\\"Field /\\"instance_type/\\" is mutually exclusive with /\\"memory/\\" and /\\"vcpu/\\". These fields cannot be set together.\\"}"`
239-
);
240-
expect(std.err).toMatchInlineSnapshot(`""`);
241-
});
242-
243220
it("should create deployment (detects no interactivity)", async () => {
244221
setIsTTY(false);
245222
setWranglerConfig({});

0 commit comments

Comments
 (0)