wrangler 0.0.0-e3990bbf → 0.0.0-e39a45ffa

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 (42) hide show
  1. package/README.md +30 -38
  2. package/bin/wrangler.js +8 -37
  3. package/config-schema.json +2447 -0
  4. package/package.json +84 -102
  5. package/templates/checked-fetch.js +1 -1
  6. package/templates/facade.d.ts +7 -5
  7. package/templates/gitignore +2 -4
  8. package/templates/init-tests/test-vitest-new-worker.js +1 -1
  9. package/templates/init-tests/test-vitest-new-worker.ts +3 -3
  10. package/templates/middleware/loader-modules.ts +92 -95
  11. package/templates/middleware/loader-sw.ts +4 -3
  12. package/templates/middleware/middleware-ensure-req-body-drained.ts +18 -0
  13. package/templates/middleware/middleware-miniflare3-json-error.ts +0 -1
  14. package/templates/middleware/middleware-patch-console-prefix.d.ts +3 -0
  15. package/templates/middleware/middleware-patch-console-prefix.ts +21 -0
  16. package/templates/middleware/middleware-scheduled.ts +15 -1
  17. package/templates/mixedMode/proxyServerWorker/index.ts +40 -0
  18. package/templates/mixedMode/proxyServerWorker/wrangler.jsonc +4 -0
  19. package/templates/modules-watch-stub.js +4 -0
  20. package/templates/pages-dev-pipeline.ts +5 -3
  21. package/templates/pages-template-plugin.ts +2 -2
  22. package/templates/pages-template-worker.ts +1 -1
  23. package/templates/startDevWorker/InspectorProxyWorker.ts +679 -0
  24. package/templates/startDevWorker/ProxyWorker.ts +336 -0
  25. package/templates/strip-cf-connecting-ip-header.js +13 -0
  26. package/templates/tsconfig.init.json +4 -87
  27. package/templates/tsconfig.json +8 -1
  28. package/templates/tsconfig.tsbuildinfo +1 -0
  29. package/wrangler-dist/InspectorProxyWorker.js +471 -0
  30. package/wrangler-dist/InspectorProxyWorker.js.map +6 -0
  31. package/wrangler-dist/ProxyWorker.js +238 -0
  32. package/wrangler-dist/ProxyWorker.js.map +6 -0
  33. package/wrangler-dist/cli.d.ts +25509 -354
  34. package/wrangler-dist/cli.js +173014 -146858
  35. package/wrangler-dist/cli.js.map +7 -0
  36. package/Cloudflare_CA.pem +0 -18
  37. package/templates/middleware/middleware-d1-beta.d.ts +0 -3
  38. package/templates/middleware/middleware-multiworker-dev.d.ts +0 -4
  39. package/templates/middleware/middleware-multiworker-dev.ts +0 -59
  40. package/templates/middleware/middleware-serve-static-assets.d.ts +0 -6
  41. package/templates/middleware/middleware-serve-static-assets.ts +0 -56
  42. package/wrangler-dist/wasm-sync.wasm +0 -0
@@ -0,0 +1,4 @@
1
+ {
2
+ "main": "./index.ts",
3
+ "compatibility_date": "2025-04-28",
4
+ }
@@ -0,0 +1,4 @@
1
+ // `esbuild` doesn't support returning `watch*` options from `onStart()`
2
+ // plugin callbacks. Instead, we define an empty virtual module that is
3
+ // imported by this injected file. Importing the module registers watchers.
4
+ import "wrangler:modules-watch";
@@ -1,8 +1,9 @@
1
1
  // @ts-ignore entry point will get replaced
2
2
  import worker from "__ENTRY_POINT__";
3
+ import { isRoutingRuleMatch } from "./pages-dev-util";
4
+
3
5
  // @ts-ignore entry point will get replaced
4
6
  export * from "__ENTRY_POINT__";
5
- import { isRoutingRuleMatch } from "./pages-dev-util";
6
7
 
7
8
  // @ts-ignore routes are injected
8
9
  const routes = __ROUTES__;
@@ -19,10 +20,11 @@ export default <ExportedHandler<{ ASSETS: Fetcher }>>{
19
20
 
20
21
  for (const include of routes.include) {
21
22
  if (isRoutingRuleMatch(pathname, include)) {
22
- if (worker.fetch === undefined) {
23
+ const workerAsHandler = worker as ExportedHandler;
24
+ if (workerAsHandler.fetch === undefined) {
23
25
  throw new TypeError("Entry point missing `fetch` handler");
24
26
  }
25
- return worker.fetch(request, env, context);
27
+ return workerAsHandler.fetch(request, env, context);
26
28
  }
27
29
  }
28
30
 
@@ -41,14 +41,14 @@ type EventPluginContext<Env, P extends string, Data, PluginArgs> = {
41
41
  declare type PagesFunction<
42
42
  Env = unknown,
43
43
  P extends string = string,
44
- Data extends Record<string, unknown> = Record<string, unknown>
44
+ Data extends Record<string, unknown> = Record<string, unknown>,
45
45
  > = (context: EventContext<Env, P, Data>) => Response | Promise<Response>;
46
46
 
47
47
  declare type PagesPluginFunction<
48
48
  Env = unknown,
49
49
  P extends string = string,
50
50
  Data extends Record<string, unknown> = Record<string, unknown>,
51
- PluginArgs = unknown
51
+ PluginArgs = unknown,
52
52
  > = (
53
53
  context: EventPluginContext<Env, P, Data, PluginArgs>
54
54
  ) => Response | Promise<Response>;
@@ -29,7 +29,7 @@ type EventContext<Env, P extends string, Data> = {
29
29
  declare type PagesFunction<
30
30
  Env = unknown,
31
31
  P extends string = string,
32
- Data extends Record<string, unknown> = Record<string, unknown>
32
+ Data extends Record<string, unknown> = Record<string, unknown>,
33
33
  > = (context: EventContext<Env, P, Data>) => Response | Promise<Response>;
34
34
  /* end @cloudflare/workers-types */
35
35