create-cloudflare 2.21.6 → 2.21.8

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-cloudflare",
3
- "version": "2.21.6",
3
+ "version": "2.21.8",
4
4
  "description": "A CLI for creating and deploying new applications to Cloudflare.",
5
5
  "keywords": [
6
6
  "cloudflare",
@@ -37,12 +37,12 @@
37
37
  "@types/degit": "^2.8.6",
38
38
  "@types/dns2": "^2.0.3",
39
39
  "@types/esprima": "^4.0.3",
40
- "@types/node": "^18.15.3",
40
+ "@types/node": "20.8.3",
41
41
  "@types/semver": "^7.5.1",
42
42
  "@types/which-pm-runs": "^1.0.0",
43
43
  "@types/yargs": "^17.0.22",
44
- "@typescript-eslint/eslint-plugin": "^5.55.0",
45
- "@typescript-eslint/parser": "^5.55.0",
44
+ "@typescript-eslint/eslint-plugin": "^6.9.0",
45
+ "@typescript-eslint/parser": "^6.9.0",
46
46
  "chalk": "^5.2.0",
47
47
  "command-exists": "^1.2.9",
48
48
  "cross-spawn": "^7.0.3",
@@ -50,7 +50,7 @@
50
50
  "degit": "^2.8.4",
51
51
  "dns2": "^2.1.0",
52
52
  "dotenv": "^16.0.0",
53
- "esbuild": "^0.17.12",
53
+ "esbuild": "0.17.19",
54
54
  "execa": "^7.1.1",
55
55
  "glob": "^10.3.3",
56
56
  "haikunator": "^2.1.2",
@@ -59,15 +59,15 @@
59
59
  "open": "^8.4.0",
60
60
  "recast": "^0.22.0",
61
61
  "semver": "^7.5.1",
62
- "undici": "5.28.4",
62
+ "undici": "^5.28.4",
63
63
  "vite-tsconfig-paths": "^4.0.8",
64
64
  "which-pm-runs": "^1.1.0",
65
65
  "wrap-ansi": "^9.0.0",
66
- "yargs": "^17.7.1",
66
+ "yargs": "^17.7.2",
67
67
  "@cloudflare/cli": "1.1.1",
68
68
  "@cloudflare/eslint-config-worker": "1.1.0",
69
69
  "@cloudflare/workers-tsconfig": "0.0.0",
70
- "wrangler": "3.60.1"
70
+ "wrangler": "3.61.0"
71
71
  },
72
72
  "engines": {
73
73
  "node": ">=18.14.1"
@@ -89,9 +89,9 @@
89
89
  "test:e2e:pnpm": "pnpm run build && cross-env TEST_PM=pnpm vitest run --config ./vitest-e2e.config.ts",
90
90
  "test:e2e:bun": "pnpm run build && cross-env TEST_PM=bun vitest run --config ./vitest-e2e.config.ts",
91
91
  "test:e2e:yarn": "pnpm run build && cross-env TEST_PM=yarn vitest run --config ./vitest-e2e.config.ts",
92
- "test:unit": "vitest run --config ./vitest.config.ts",
93
- "test:unit:watch": "vitest --config ./vitest.config.ts",
92
+ "test:unit": "vitest run --config ./vitest.config.mts",
93
+ "test:unit:watch": "vitest --config ./vitest.config.mts",
94
94
  "watch": "node -r esbuild-register scripts/build.ts --watch",
95
- "test:ci": "vitest run --config ./vitest.config.ts"
95
+ "test:ci": "vitest run --config ./vitest.config.mts"
96
96
  }
97
97
  }
@@ -9,6 +9,6 @@
9
9
  },
10
10
  "devDependencies": {
11
11
  "itty-router": "^3.0.12",
12
- "wrangler": "^3.0.0"
12
+ "wrangler": "^3.60.3"
13
13
  }
14
14
  }
@@ -10,7 +10,7 @@
10
10
  },
11
11
  "devDependencies": {
12
12
  "itty-router": "^3.0.12",
13
- "typescript": "^5.0.4",
14
- "wrangler": "^3.0.0"
13
+ "typescript": "^5.4.5",
14
+ "wrangler": "^3.60.3"
15
15
  }
16
16
  }
@@ -6,7 +6,7 @@ const EXPERIMENTS = [
6
6
  ];
7
7
 
8
8
  export default {
9
- async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise<Response> {
9
+ async fetch(request, env, ctx): Promise<Response> {
10
10
  const fingerprint = [request.headers.get('cf-connecting-ip'), request.cf?.postalCode]; // add any values you want considered as a fingerprint
11
11
  const activeExperiments = await getActiveExperiments(fingerprint, EXPERIMENTS);
12
12
 
@@ -22,7 +22,7 @@ export default {
22
22
 
23
23
  return rewriter.transform(res);
24
24
  },
25
- };
25
+ } satisfies ExportedHandler<Env>;
26
26
 
27
27
  // Get active experiments by hashing a fingerprint
28
28
  async function getActiveExperiments(fingerprint: unknown, experiments: Array<{ name: string; threshold: number }>) {
@@ -19,7 +19,7 @@ import apiRouter from './router';
19
19
  export default {
20
20
  // The fetch handler is invoked when this worker receives a HTTP(S) request
21
21
  // and should return a Response (optionally wrapped in a Promise)
22
- async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise<Response> {
22
+ async fetch(request, env, ctx): Promise<Response> {
23
23
  // You'll find it helpful to parse the request.url string into a URL object. Learn more at https://developer.mozilla.org/en-US/docs/Web/API/URL
24
24
  const url = new URL(request.url);
25
25
 
@@ -46,4 +46,4 @@ export default {
46
46
  { headers: { 'Content-Type': 'text/html' } }
47
47
  );
48
48
  },
49
- };
49
+ } satisfies ExportedHandler<Env>;
@@ -1,5 +1,5 @@
1
1
  export default {
2
- async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise<Response> {
2
+ async fetch(request, env, ctx): Promise<Response> {
3
3
  const url = new URL(request.url);
4
4
 
5
5
  const proxyUrl = url.searchParams.get('proxyUrl'); // get a query param value (?proxyUrl=...)
@@ -20,4 +20,4 @@ export default {
20
20
 
21
21
  return res;
22
22
  },
23
- };
23
+ } satisfies ExportedHandler<Env>;
@@ -1,5 +1,5 @@
1
1
  export default {
2
- async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise<Response> {
2
+ async fetch(request, env, ctx): Promise<Response> {
3
3
  const url = new URL(request.url);
4
4
  const redirectUrl = url.searchParams.get('redirectUrl'); // get a query param value (?redirectUrl=...)
5
5
 
@@ -10,4 +10,4 @@ export default {
10
10
  // The Response class has static methods to create common Response objects as a convenience
11
11
  return Response.redirect(redirectUrl);
12
12
  },
13
- };
13
+ } satisfies ExportedHandler<Env>;
@@ -9,8 +9,8 @@
9
9
  "test": "vitest"
10
10
  },
11
11
  "devDependencies": {
12
- "wrangler": "^3.0.0",
13
- "vitest": "1.3.0",
14
- "@cloudflare/vitest-pool-workers": "^0.1.0"
12
+ "@cloudflare/vitest-pool-workers": "^0.4.5",
13
+ "wrangler": "^3.60.3",
14
+ "vitest": "1.5.0"
15
15
  }
16
16
  }
@@ -10,9 +10,9 @@
10
10
  "cf-typegen": "wrangler types"
11
11
  },
12
12
  "devDependencies": {
13
- "typescript": "^5.0.4",
14
- "wrangler": "^3.0.0",
15
- "vitest": "1.3.0",
16
- "@cloudflare/vitest-pool-workers": "^0.1.0"
13
+ "@cloudflare/vitest-pool-workers": "^0.4.5",
14
+ "typescript": "^5.4.5",
15
+ "vitest": "1.5.0",
16
+ "wrangler": "^3.60.3"
17
17
  }
18
18
  }
@@ -12,7 +12,7 @@
12
12
  */
13
13
 
14
14
  export default {
15
- async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise<Response> {
15
+ async fetch(request, env, ctx): Promise<Response> {
16
16
  return new Response('Hello World!');
17
17
  },
18
- };
18
+ } satisfies ExportedHandler<Env>;
@@ -8,6 +8,6 @@
8
8
  "start": "wrangler dev"
9
9
  },
10
10
  "devDependencies": {
11
- "wrangler": "^3.0.0"
11
+ "wrangler": "^3.60.3"
12
12
  }
13
13
  }
@@ -9,7 +9,7 @@
9
9
  "cf-typegen": "wrangler types"
10
10
  },
11
11
  "devDependencies": {
12
- "typescript": "^5.0.4",
13
- "wrangler": "^3.0.0"
12
+ "typescript": "^5.4.5",
13
+ "wrangler": "^3.60.3"
14
14
  }
15
15
  }
@@ -68,7 +68,7 @@ export default {
68
68
  * @param ctx - The execution context of the Worker
69
69
  * @returns The response to be sent back to the client
70
70
  */
71
- async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise<Response> {
71
+ async fetch(request, env, ctx): Promise<Response> {
72
72
  // We will create a `DurableObjectId` using the pathname from the Worker request
73
73
  // This id refers to a unique instance of our 'MyDurableObject' class above
74
74
  let id: DurableObjectId = env.MY_DURABLE_OBJECT.idFromName(new URL(request.url).pathname);
@@ -83,4 +83,4 @@ export default {
83
83
 
84
84
  return new Response(greeting);
85
85
  },
86
- };
86
+ } satisfies ExportedHandler<Env>;
@@ -8,6 +8,6 @@
8
8
  "start": "wrangler dev"
9
9
  },
10
10
  "devDependencies": {
11
- "wrangler": "^3.0.0"
11
+ "wrangler": "^3.60.3"
12
12
  }
13
13
  }
@@ -12,8 +12,8 @@
12
12
  "@cloudflare/itty-router-openapi": "^1.0.1"
13
13
  },
14
14
  "devDependencies": {
15
- "@types/node": "^20.5.7",
15
+ "@types/node": "20.8.3",
16
16
  "@types/service-worker-mock": "^2.0.1",
17
- "wrangler": "^3.0.0"
17
+ "wrangler": "^3.60.3"
18
18
  }
19
19
  }
@@ -26,4 +26,4 @@ router.all("*", () =>
26
26
 
27
27
  export default {
28
28
  fetch: router.handle,
29
- };
29
+ } satisfies ExportedHandler;
@@ -8,6 +8,6 @@
8
8
  "start": "wrangler dev"
9
9
  },
10
10
  "devDependencies": {
11
- "wrangler": "^3.0.0"
11
+ "wrangler": "^3.60.3"
12
12
  }
13
13
  }
@@ -8,6 +8,6 @@
8
8
  "start": "wrangler dev"
9
9
  },
10
10
  "devDependencies": {
11
- "wrangler": "^3.0.0"
11
+ "wrangler": "^3.60.3"
12
12
  }
13
13
  }
@@ -9,7 +9,7 @@
9
9
  "cf-typegen": "wrangler types"
10
10
  },
11
11
  "devDependencies": {
12
- "typescript": "^5.0.4",
13
- "wrangler": "^3.0.0"
12
+ "typescript": "^5.4.5",
13
+ "wrangler": "^3.60.3"
14
14
  }
15
15
  }
@@ -18,7 +18,7 @@ export default {
18
18
  // Our fetch handler is invoked on a HTTP request: we can send a message to a queue
19
19
  // during (or after) a request.
20
20
  // https://developers.cloudflare.com/queues/platform/javascript-apis/#producer
21
- async fetch(req: Request, env: Env, ctx: ExecutionContext): Promise<Response> {
21
+ async fetch(req, env, ctx): Promise<Response> {
22
22
  // To send a message on a queue, we need to create the queue first
23
23
  // https://developers.cloudflare.com/queues/get-started/#3-create-a-queue
24
24
  await env.MY_QUEUE.send({
@@ -30,7 +30,7 @@ export default {
30
30
  },
31
31
  // The queue handler is invoked when a batch of messages is ready to be delivered
32
32
  // https://developers.cloudflare.com/queues/platform/javascript-apis/#messagebatch
33
- async queue(batch: MessageBatch<Error>, env: Env): Promise<void> {
33
+ async queue(batch, env): Promise<void> {
34
34
  // A queue consumer can make requests to other endpoints on the Internet,
35
35
  // write to R2 object storage, query a D1 Database, and much more.
36
36
  for (let message of batch.messages) {
@@ -38,4 +38,4 @@ export default {
38
38
  console.log(`message ${message.id} processed: ${JSON.stringify(message.body)}`);
39
39
  }
40
40
  },
41
- };
41
+ } satisfies ExportedHandler<Env, Error>;
@@ -8,6 +8,6 @@
8
8
  "start": "wrangler dev --test-scheduled"
9
9
  },
10
10
  "devDependencies": {
11
- "wrangler": "^3.0.0"
11
+ "wrangler": "^3.60.3"
12
12
  }
13
13
  }
@@ -9,7 +9,7 @@
9
9
  "cf-typegen": "wrangler types"
10
10
  },
11
11
  "devDependencies": {
12
- "typescript": "^5.0.4",
13
- "wrangler": "^3.0.0"
12
+ "typescript": "^5.4.5",
13
+ "wrangler": "^3.60.3"
14
14
  }
15
15
  }
@@ -18,7 +18,7 @@
18
18
  export default {
19
19
  // The scheduled handler is invoked at the interval set in our wrangler.toml's
20
20
  // [[triggers]] configuration.
21
- async scheduled(event: ScheduledEvent, env: Env, ctx: ExecutionContext): Promise<void> {
21
+ async scheduled(event, env, ctx): Promise<void> {
22
22
  // A Cron Trigger can make requests to other endpoints on the Internet,
23
23
  // publish to a Queue, query a D1 Database, and much more.
24
24
  //
@@ -30,4 +30,4 @@ export default {
30
30
  // In this template, we'll just log the result:
31
31
  console.log(`trigger fired at ${event.cron}: ${wasSuccessful}`);
32
32
  },
33
- };
33
+ } satisfies ExportedHandler<Env>;