wrangler 0.0.0-e6c9c5c0 → 0.0.0-e6e1daba

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/README.md +3 -3
  2. package/miniflare-dist/index.mjs +22 -18
  3. package/package.json +12 -12
  4. package/src/__tests__/configuration.test.ts +70 -0
  5. package/src/__tests__/d1/d1.test.ts +13 -58
  6. package/src/__tests__/d1/execute.test.ts +64 -0
  7. package/src/__tests__/d1/migrate.test.ts +155 -0
  8. package/src/__tests__/deployments.test.ts +40 -16
  9. package/src/__tests__/dev.test.tsx +8 -7
  10. package/src/__tests__/generate.test.ts +1 -1
  11. package/src/__tests__/guess-worker-format.test.ts +35 -0
  12. package/src/__tests__/helpers/end-event-loop.ts +6 -0
  13. package/src/__tests__/helpers/mock-get-pages-upload-token.ts +25 -0
  14. package/src/__tests__/helpers/mock-set-timeout.ts +16 -0
  15. package/src/__tests__/helpers/msw/handlers/deployments.ts +40 -16
  16. package/src/__tests__/helpers/string-dynamic-values-matcher.ts +28 -0
  17. package/src/__tests__/index.test.ts +38 -32
  18. package/src/__tests__/init.test.ts +1 -1
  19. package/src/__tests__/kv.test.ts +63 -52
  20. package/src/__tests__/middleware.test.ts +65 -0
  21. package/src/__tests__/mtls-certificates.test.ts +585 -0
  22. package/src/__tests__/pages/deployment-list.test.ts +78 -0
  23. package/src/__tests__/pages/functions-build.test.ts +402 -0
  24. package/src/__tests__/pages/pages.test.ts +81 -0
  25. package/src/__tests__/pages/project-create.test.ts +63 -0
  26. package/src/__tests__/pages/project-list.test.ts +108 -0
  27. package/src/__tests__/pages/project-upload.test.ts +481 -0
  28. package/src/__tests__/pages/publish.test.ts +2745 -0
  29. package/src/__tests__/parse.test.ts +106 -0
  30. package/src/__tests__/publish.test.ts +80 -30
  31. package/src/__tests__/pubsub.test.ts +15 -12
  32. package/src/__tests__/queues.test.ts +37 -30
  33. package/src/__tests__/r2.test.ts +25 -20
  34. package/src/__tests__/secret.test.ts +4 -4
  35. package/src/__tests__/tsconfig.tsbuildinfo +1 -1
  36. package/src/__tests__/user.test.ts +1 -1
  37. package/src/__tests__/whoami.test.tsx +1 -1
  38. package/src/__tests__/worker-namespace.test.ts +26 -21
  39. package/src/api/dev.ts +80 -11
  40. package/src/api/index.ts +8 -0
  41. package/src/api/mtls-certificate.ts +148 -0
  42. package/src/api/pages/create-worker-bundle-contents.ts +75 -0
  43. package/src/api/pages/publish.tsx +59 -12
  44. package/src/bundle.ts +9 -7
  45. package/src/config/config.ts +14 -7
  46. package/src/config/environment.ts +9 -2
  47. package/src/config/index.ts +37 -20
  48. package/src/config/validation.ts +50 -3
  49. package/src/create-worker-preview.ts +19 -8
  50. package/src/create-worker-upload-form.ts +9 -0
  51. package/src/d1/backups.tsx +20 -24
  52. package/src/d1/create.tsx +6 -5
  53. package/src/d1/delete.ts +7 -10
  54. package/src/d1/execute.tsx +174 -143
  55. package/src/d1/index.ts +5 -6
  56. package/src/d1/list.tsx +21 -9
  57. package/src/d1/migrations/apply.tsx +42 -33
  58. package/src/d1/migrations/create.tsx +16 -17
  59. package/src/d1/migrations/helpers.ts +63 -38
  60. package/src/d1/migrations/list.tsx +37 -24
  61. package/src/d1/migrations/options.ts +7 -2
  62. package/src/d1/options.ts +3 -3
  63. package/src/d1/types.ts +1 -0
  64. package/src/d1/utils.ts +2 -1
  65. package/src/delete.ts +5 -8
  66. package/src/deployments.ts +62 -39
  67. package/src/deprecated/index.ts +7 -8
  68. package/src/dev/dev.tsx +1 -15
  69. package/src/dev/local.tsx +5 -6
  70. package/src/dev/remote.tsx +2 -2
  71. package/src/dev.tsx +51 -86
  72. package/src/dispatch-namespace.ts +20 -16
  73. package/src/docs/index.ts +7 -8
  74. package/src/entry.ts +1 -2
  75. package/src/generate/index.ts +6 -8
  76. package/src/index.ts +37 -26
  77. package/src/init.ts +5 -7
  78. package/src/inspect.ts +16 -1
  79. package/src/kv/index.ts +15 -17
  80. package/src/miniflare-cli/assets.ts +9 -8
  81. package/src/miniflare-cli/tsconfig.tsbuildinfo +1 -1
  82. package/src/mtls-certificate/cli.ts +155 -0
  83. package/src/pages/build.ts +109 -27
  84. package/src/pages/buildFunctions.ts +32 -31
  85. package/src/pages/deployment-tails.ts +7 -10
  86. package/src/pages/deployments.tsx +6 -4
  87. package/src/pages/dev.ts +19 -19
  88. package/src/pages/functions/tsconfig.tsbuildinfo +1 -1
  89. package/src/pages/functions.ts +8 -4
  90. package/src/pages/index.ts +3 -3
  91. package/src/pages/projects.tsx +7 -12
  92. package/src/pages/publish.tsx +18 -5
  93. package/src/pages/types.ts +5 -0
  94. package/src/pages/upload.tsx +6 -4
  95. package/src/pages/utils.ts +1 -1
  96. package/src/parse.ts +23 -1
  97. package/src/publish/index.ts +19 -15
  98. package/src/publish/publish.ts +5 -4
  99. package/src/pubsub/pubsub-commands.ts +18 -19
  100. package/src/queues/cli/commands/consumer/add.ts +18 -24
  101. package/src/queues/cli/commands/consumer/index.ts +3 -6
  102. package/src/queues/cli/commands/consumer/remove.ts +11 -18
  103. package/src/queues/cli/commands/create.ts +8 -8
  104. package/src/queues/cli/commands/delete.ts +8 -8
  105. package/src/queues/cli/commands/index.ts +3 -4
  106. package/src/queues/cli/commands/list.ts +8 -8
  107. package/src/r2/helpers.ts +1 -0
  108. package/src/r2/index.ts +28 -28
  109. package/src/secret/index.ts +10 -14
  110. package/src/sites.ts +1 -1
  111. package/src/tail/filters.ts +1 -1
  112. package/src/tail/index.ts +6 -8
  113. package/src/user/user.ts +4 -3
  114. package/src/worker.ts +6 -0
  115. package/src/yargs-types.ts +18 -5
  116. package/templates/checked-fetch.js +9 -1
  117. package/templates/format-dev-errors.ts +1 -0
  118. package/templates/new-worker.ts +3 -0
  119. package/templates/pages-template-plugin.ts +7 -3
  120. package/templates/serve-static-assets.ts +1 -0
  121. package/templates/service-bindings-module-facade.js +1 -0
  122. package/templates/tsconfig.init.json +1 -1
  123. package/templates/tsconfig.tsbuildinfo +1 -1
  124. package/wrangler-dist/cli.d.ts +596 -3
  125. package/wrangler-dist/cli.js +14276 -6748
  126. package/src/__tests__/pages.test.ts +0 -2898
@@ -39,10 +39,11 @@ describe("r2", () => {
39
39
  wrangler r2 bucket delete <name> Delete an R2 bucket
40
40
 
41
41
  Flags:
42
- -c, --config Path to .toml configuration file [string]
43
- -e, --env Environment to use for operations and .env files [string]
44
- -h, --help Show help [boolean]
45
- -v, --version Show version number [boolean]"
42
+ -j, --experimental-json-config Experimental: Support wrangler.json [boolean]
43
+ -c, --config Path to .toml configuration file [string]
44
+ -e, --env Environment to use for operations and .env files [string]
45
+ -h, --help Show help [boolean]
46
+ -v, --version Show version number [boolean]"
46
47
  `);
47
48
  });
48
49
 
@@ -103,10 +104,11 @@ describe("r2", () => {
103
104
  name The name of the new bucket [string] [required]
104
105
 
105
106
  Flags:
106
- -c, --config Path to .toml configuration file [string]
107
- -e, --env Environment to use for operations and .env files [string]
108
- -h, --help Show help [boolean]
109
- -v, --version Show version number [boolean]"
107
+ -j, --experimental-json-config Experimental: Support wrangler.json [boolean]
108
+ -c, --config Path to .toml configuration file [string]
109
+ -e, --env Environment to use for operations and .env files [string]
110
+ -h, --help Show help [boolean]
111
+ -v, --version Show version number [boolean]"
110
112
  `);
111
113
  expect(std.err).toMatchInlineSnapshot(`
112
114
  "X [ERROR] Not enough non-option arguments: got 0, need at least 1
@@ -131,10 +133,11 @@ describe("r2", () => {
131
133
  name The name of the new bucket [string] [required]
132
134
 
133
135
  Flags:
134
- -c, --config Path to .toml configuration file [string]
135
- -e, --env Environment to use for operations and .env files [string]
136
- -h, --help Show help [boolean]
137
- -v, --version Show version number [boolean]"
136
+ -j, --experimental-json-config Experimental: Support wrangler.json [boolean]
137
+ -c, --config Path to .toml configuration file [string]
138
+ -e, --env Environment to use for operations and .env files [string]
139
+ -h, --help Show help [boolean]
140
+ -v, --version Show version number [boolean]"
138
141
  `);
139
142
  expect(std.err).toMatchInlineSnapshot(`
140
143
  "X [ERROR] Unknown arguments: def, ghi
@@ -180,10 +183,11 @@ describe("r2", () => {
180
183
  name The name of the bucket to delete [string] [required]
181
184
 
182
185
  Flags:
183
- -c, --config Path to .toml configuration file [string]
184
- -e, --env Environment to use for operations and .env files [string]
185
- -h, --help Show help [boolean]
186
- -v, --version Show version number [boolean]"
186
+ -j, --experimental-json-config Experimental: Support wrangler.json [boolean]
187
+ -c, --config Path to .toml configuration file [string]
188
+ -e, --env Environment to use for operations and .env files [string]
189
+ -h, --help Show help [boolean]
190
+ -v, --version Show version number [boolean]"
187
191
  `);
188
192
  expect(std.err).toMatchInlineSnapshot(`
189
193
  "X [ERROR] Not enough non-option arguments: got 0, need at least 1
@@ -208,10 +212,11 @@ describe("r2", () => {
208
212
  name The name of the bucket to delete [string] [required]
209
213
 
210
214
  Flags:
211
- -c, --config Path to .toml configuration file [string]
212
- -e, --env Environment to use for operations and .env files [string]
213
- -h, --help Show help [boolean]
214
- -v, --version Show version number [boolean]"
215
+ -j, --experimental-json-config Experimental: Support wrangler.json [boolean]
216
+ -c, --config Path to .toml configuration file [string]
217
+ -e, --env Environment to use for operations and .env files [string]
218
+ -h, --help Show help [boolean]
219
+ -v, --version Show version number [boolean]"
215
220
  `);
216
221
  expect(std.err).toMatchInlineSnapshot(`
217
222
  "X [ERROR] Unknown arguments: def, ghi
@@ -340,7 +340,7 @@ describe("wrangler secret", () => {
340
340
  }
341
341
  expect(std.out).toMatchInlineSnapshot(`
342
342
  "
343
- If you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose"
343
+ If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose"
344
344
  `);
345
345
  expect(std.err).toMatchInlineSnapshot(`
346
346
  "X [ERROR] Required Worker name missing. Please specify the Worker name in wrangler.toml, or pass it as an argument with \`--name <worker-name>\`
@@ -401,7 +401,7 @@ describe("wrangler secret", () => {
401
401
 
402
402
  expect(std.out).toMatchInlineSnapshot(`
403
403
  "
404
- If you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose"
404
+ If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose"
405
405
  `);
406
406
  expect(std.warn).toMatchInlineSnapshot(`""`);
407
407
  });
@@ -572,7 +572,7 @@ describe("wrangler secret", () => {
572
572
  }
573
573
  expect(std.out).toMatchInlineSnapshot(`
574
574
  "
575
- If you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose"
575
+ If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose"
576
576
  `);
577
577
  expect(std.err).toMatchInlineSnapshot(`
578
578
  "X [ERROR] Required Worker name missing. Please specify the Worker name in wrangler.toml, or pass it as an argument with \`--name <worker-name>\`
@@ -678,7 +678,7 @@ describe("wrangler secret", () => {
678
678
  }
679
679
  expect(std.out).toMatchInlineSnapshot(`
680
680
  "
681
- If you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose"
681
+ If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose"
682
682
  `);
683
683
  expect(std.err).toMatchInlineSnapshot(`
684
684
  "X [ERROR] Required Worker name missing. Please specify the Worker name in wrangler.toml, or pass it as an argument with \`--name <worker-name>\`