create-cloudflare 2.21.6 → 2.21.7
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/dist/cli.js +13 -12
- package/package.json +3 -3
- package/templates/common/ts/src/ab-test.ts +2 -2
- package/templates/common/ts/src/index.ts +2 -2
- package/templates/common/ts/src/proxy.ts +2 -2
- package/templates/common/ts/src/redirect.ts +2 -2
- package/templates/hello-world/ts/src/index.ts +2 -2
- package/templates/hello-world-durable-object/ts/src/index.ts +2 -2
- package/templates/openapi/ts/src/index.ts +1 -1
- package/templates/queues/ts/src/index.ts +3 -3
- package/templates/scheduled/ts/src/index.ts +2 -2
package/dist/cli.js
CHANGED
|
@@ -1715,16 +1715,17 @@ var init_cli = __esm({
|
|
|
1715
1715
|
// current default for backcompat -- TODO: change default to shapes.bar once all callees have been updated
|
|
1716
1716
|
shape = shapes.corners.bl,
|
|
1717
1717
|
// current default for backcompat -- TODO: change default to true once all callees have been updated
|
|
1718
|
-
multiline = false
|
|
1718
|
+
multiline = false,
|
|
1719
|
+
newlineBefore = true
|
|
1719
1720
|
} = {}) => {
|
|
1720
1721
|
logRaw(
|
|
1721
1722
|
format(msg, {
|
|
1722
1723
|
firstLinePrefix: gray(shape) + space() + status.warning,
|
|
1723
1724
|
linePrefix: gray(shapes.bar),
|
|
1724
|
-
newlineBefore: true,
|
|
1725
1725
|
formatLine: (line) => dim(line),
|
|
1726
1726
|
// for backcompat but it's not ideal for this to be "dim"
|
|
1727
|
-
multiline
|
|
1727
|
+
multiline,
|
|
1728
|
+
newlineBefore
|
|
1728
1729
|
})
|
|
1729
1730
|
);
|
|
1730
1731
|
};
|
|
@@ -3902,7 +3903,7 @@ var init_args = __esm({
|
|
|
3902
3903
|
var version;
|
|
3903
3904
|
var init_package = __esm({
|
|
3904
3905
|
"package.json"() {
|
|
3905
|
-
version = "2.21.
|
|
3906
|
+
version = "2.21.7";
|
|
3906
3907
|
}
|
|
3907
3908
|
});
|
|
3908
3909
|
|
|
@@ -24716,18 +24717,18 @@ var init_package2 = __esm({
|
|
|
24716
24717
|
dependencies: {
|
|
24717
24718
|
"create-astro": "4.8.0",
|
|
24718
24719
|
"create-analog": "1.3.1",
|
|
24719
|
-
"@angular/create": "
|
|
24720
|
-
"create-docusaurus": "3.
|
|
24721
|
-
"create-hono": "0.
|
|
24720
|
+
"@angular/create": "18.0.3",
|
|
24721
|
+
"create-docusaurus": "3.4.0",
|
|
24722
|
+
"create-hono": "0.8.1",
|
|
24722
24723
|
"create-next-app": "14.1.0",
|
|
24723
|
-
"create-qwik": "1.5.
|
|
24724
|
+
"create-qwik": "1.5.7",
|
|
24724
24725
|
"create-react-app": "5.0.1",
|
|
24725
24726
|
"create-remix": "2.9.2",
|
|
24726
24727
|
"create-solid": "0.5.11",
|
|
24727
24728
|
"create-svelte": "6.3.0",
|
|
24728
|
-
"create-vue": "3.10.
|
|
24729
|
-
gatsby: "5.13.
|
|
24730
|
-
nuxi: "3.
|
|
24729
|
+
"create-vue": "3.10.3",
|
|
24730
|
+
gatsby: "5.13.6",
|
|
24731
|
+
nuxi: "3.12.0"
|
|
24731
24732
|
},
|
|
24732
24733
|
frameworkCliMap: {
|
|
24733
24734
|
analog: "create-analog",
|
|
@@ -24803,7 +24804,7 @@ var init_frameworks = __esm({
|
|
|
24803
24804
|
var version2;
|
|
24804
24805
|
var init_package3 = __esm({
|
|
24805
24806
|
"../wrangler/package.json"() {
|
|
24806
|
-
version2 = "3.60.
|
|
24807
|
+
version2 = "3.60.3";
|
|
24807
24808
|
}
|
|
24808
24809
|
});
|
|
24809
24810
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-cloudflare",
|
|
3
|
-
"version": "2.21.
|
|
3
|
+
"version": "2.21.7",
|
|
4
4
|
"description": "A CLI for creating and deploying new applications to Cloudflare.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
@@ -65,9 +65,9 @@
|
|
|
65
65
|
"wrap-ansi": "^9.0.0",
|
|
66
66
|
"yargs": "^17.7.1",
|
|
67
67
|
"@cloudflare/cli": "1.1.1",
|
|
68
|
-
"@cloudflare/eslint-config-worker": "1.1.0",
|
|
69
68
|
"@cloudflare/workers-tsconfig": "0.0.0",
|
|
70
|
-
"
|
|
69
|
+
"@cloudflare/eslint-config-worker": "1.1.0",
|
|
70
|
+
"wrangler": "3.60.3"
|
|
71
71
|
},
|
|
72
72
|
"engines": {
|
|
73
73
|
"node": ">=18.14.1"
|
|
@@ -6,7 +6,7 @@ const EXPERIMENTS = [
|
|
|
6
6
|
];
|
|
7
7
|
|
|
8
8
|
export default {
|
|
9
|
-
async fetch(request
|
|
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
|
|
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
|
|
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
|
|
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>;
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
export default {
|
|
15
|
-
async fetch(request
|
|
15
|
+
async fetch(request, env, ctx): Promise<Response> {
|
|
16
16
|
return new Response('Hello World!');
|
|
17
17
|
},
|
|
18
|
-
}
|
|
18
|
+
} satisfies ExportedHandler<Env>;
|
|
@@ -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
|
|
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>;
|
|
@@ -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
|
|
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
|
|
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>;
|
|
@@ -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
|
|
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>;
|