create-cloudflare 2.29.0 → 2.29.2
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 +42 -30
- package/package.json +3 -3
- package/templates/docusaurus/c3.ts +2 -1
- package/templates/nuxt/templates/wrangler.toml +1 -0
- package/templates-experimental/hello-world-with-assets/js/test/index.spec.js +3 -3
- package/templates-experimental/hello-world-with-assets/ts/test/index.spec.ts +5 -5
package/dist/cli.js
CHANGED
|
@@ -74090,7 +74090,7 @@ var Yargs = YargsFactory(esm_default);
|
|
|
74090
74090
|
var yargs_default = Yargs;
|
|
74091
74091
|
|
|
74092
74092
|
// package.json
|
|
74093
|
-
var version = "2.29.
|
|
74093
|
+
var version = "2.29.2";
|
|
74094
74094
|
|
|
74095
74095
|
// src/metrics.ts
|
|
74096
74096
|
var import_node_async_hooks = require("node:async_hooks");
|
|
@@ -74381,18 +74381,24 @@ var SPARROW_URL = "https://sparrow.cloudflare.com";
|
|
|
74381
74381
|
function hasSparrowSourceKey() {
|
|
74382
74382
|
return SPARROW_SOURCE_KEY !== "";
|
|
74383
74383
|
}
|
|
74384
|
-
async function sendEvent(payload) {
|
|
74385
|
-
if (
|
|
74384
|
+
async function sendEvent(payload, enableLog) {
|
|
74385
|
+
if (enableLog) {
|
|
74386
74386
|
console.log("[telemetry]", JSON.stringify(payload, null, 2));
|
|
74387
74387
|
}
|
|
74388
|
-
|
|
74389
|
-
|
|
74390
|
-
|
|
74391
|
-
|
|
74392
|
-
|
|
74393
|
-
|
|
74394
|
-
|
|
74395
|
-
|
|
74388
|
+
try {
|
|
74389
|
+
await (0, import_undici.fetch)(`${SPARROW_URL}/api/v1/event`, {
|
|
74390
|
+
method: "POST",
|
|
74391
|
+
headers: {
|
|
74392
|
+
"Content-Type": "application/json",
|
|
74393
|
+
"Sparrow-Source-Key": SPARROW_SOURCE_KEY
|
|
74394
|
+
},
|
|
74395
|
+
body: JSON.stringify(payload)
|
|
74396
|
+
});
|
|
74397
|
+
} catch (error2) {
|
|
74398
|
+
if (enableLog) {
|
|
74399
|
+
console.log("[telemetry]", error2);
|
|
74400
|
+
}
|
|
74401
|
+
}
|
|
74396
74402
|
}
|
|
74397
74403
|
|
|
74398
74404
|
// src/metrics.ts
|
|
@@ -74431,25 +74437,29 @@ function createReporter() {
|
|
|
74431
74437
|
const packageManager = detectPackageManager();
|
|
74432
74438
|
const platform3 = getPlatform();
|
|
74433
74439
|
const amplitude_session_id = Date.now();
|
|
74440
|
+
const enableLog = process.env.CREATE_CLOUDFLARE_TELEMETRY_DEBUG === "1";
|
|
74434
74441
|
let amplitude_event_id = 0;
|
|
74435
74442
|
function sendEvent2(name, properties) {
|
|
74436
74443
|
if (!isEnabled) {
|
|
74437
74444
|
return;
|
|
74438
74445
|
}
|
|
74439
|
-
const request2 = sendEvent(
|
|
74440
|
-
|
|
74441
|
-
|
|
74442
|
-
|
|
74443
|
-
|
|
74444
|
-
|
|
74445
|
-
|
|
74446
|
-
|
|
74447
|
-
|
|
74448
|
-
|
|
74449
|
-
|
|
74450
|
-
|
|
74451
|
-
|
|
74452
|
-
|
|
74446
|
+
const request2 = sendEvent(
|
|
74447
|
+
{
|
|
74448
|
+
event: name,
|
|
74449
|
+
deviceId,
|
|
74450
|
+
timestamp: Date.now(),
|
|
74451
|
+
properties: {
|
|
74452
|
+
amplitude_session_id,
|
|
74453
|
+
amplitude_event_id: amplitude_event_id++,
|
|
74454
|
+
platform: platform3,
|
|
74455
|
+
c3Version: version,
|
|
74456
|
+
isFirstUsage,
|
|
74457
|
+
packageManager: packageManager.name,
|
|
74458
|
+
...properties
|
|
74459
|
+
}
|
|
74460
|
+
},
|
|
74461
|
+
enableLog
|
|
74462
|
+
);
|
|
74453
74463
|
events.push(request2);
|
|
74454
74464
|
}
|
|
74455
74465
|
function isTelemetryEnabled() {
|
|
@@ -74828,7 +74838,7 @@ var usesEslint = (ctx) => {
|
|
|
74828
74838
|
var import_node_path3 = require("node:path");
|
|
74829
74839
|
|
|
74830
74840
|
// ../wrangler/package.json
|
|
74831
|
-
var version2 = "3.
|
|
74841
|
+
var version2 = "3.80.0";
|
|
74832
74842
|
|
|
74833
74843
|
// src/git.ts
|
|
74834
74844
|
var offerGit = async (ctx) => {
|
|
@@ -75019,7 +75029,7 @@ var package_default = {
|
|
|
75019
75029
|
],
|
|
75020
75030
|
dependencies: {
|
|
75021
75031
|
"create-astro": "4.8.0",
|
|
75022
|
-
"create-analog": "1.
|
|
75032
|
+
"create-analog": "1.8.1",
|
|
75023
75033
|
"@angular/create": "18.2.0",
|
|
75024
75034
|
"create-docusaurus": "3.5.2",
|
|
75025
75035
|
"create-hono": "0.12.0",
|
|
@@ -76352,10 +76362,11 @@ var config16 = {
|
|
|
76352
76362
|
generate: generate15,
|
|
76353
76363
|
transformPackageJson: async () => ({
|
|
76354
76364
|
scripts: {
|
|
76365
|
+
preview: `${npm11} run build && wrangler pages dev ./build`,
|
|
76355
76366
|
deploy: `${npm11} run build && wrangler pages deploy ./build`
|
|
76356
76367
|
}
|
|
76357
76368
|
}),
|
|
76358
|
-
devScript: "
|
|
76369
|
+
devScript: "preview",
|
|
76359
76370
|
deployScript: "deploy"
|
|
76360
76371
|
};
|
|
76361
76372
|
var c3_default19 = config16;
|
|
@@ -77637,7 +77648,7 @@ var createContext = async (args, prevArgs) => {
|
|
|
77637
77648
|
description: "Select from a range of starter applications using various Cloudflare products"
|
|
77638
77649
|
},
|
|
77639
77650
|
{
|
|
77640
|
-
label: "Template from a
|
|
77651
|
+
label: "Template from a GitHub repo",
|
|
77641
77652
|
value: "remote-template",
|
|
77642
77653
|
description: "Start from an existing GitHub repo link"
|
|
77643
77654
|
},
|
|
@@ -77993,7 +78004,7 @@ var cliDefinition = {
|
|
|
77993
78004
|
{ name: "demo", description: "Application Starter" },
|
|
77994
78005
|
{
|
|
77995
78006
|
name: "remote-template",
|
|
77996
|
-
description: "Template from a
|
|
78007
|
+
description: "Template from a GitHub repo"
|
|
77997
78008
|
}
|
|
77998
78009
|
];
|
|
77999
78010
|
}
|
|
@@ -80020,6 +80031,7 @@ var retry = async (config26, fn) => {
|
|
|
80020
80031
|
if (config26.exitCondition?.(e)) {
|
|
80021
80032
|
break;
|
|
80022
80033
|
}
|
|
80034
|
+
await sleep(config26.sleepMs ?? 1e3);
|
|
80023
80035
|
}
|
|
80024
80036
|
}
|
|
80025
80037
|
throw error2;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-cloudflare",
|
|
3
|
-
"version": "2.29.
|
|
3
|
+
"version": "2.29.2",
|
|
4
4
|
"description": "A CLI for creating and deploying new applications to Cloudflare.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
@@ -67,9 +67,9 @@
|
|
|
67
67
|
"xdg-app-paths": "^8.3.0",
|
|
68
68
|
"yargs": "^17.7.2",
|
|
69
69
|
"@cloudflare/cli": "1.1.1",
|
|
70
|
-
"@cloudflare/workers-tsconfig": "0.0.0",
|
|
71
70
|
"@cloudflare/eslint-config-worker": "1.1.0",
|
|
72
|
-
"
|
|
71
|
+
"@cloudflare/workers-tsconfig": "0.0.0",
|
|
72
|
+
"wrangler": "3.80.0"
|
|
73
73
|
},
|
|
74
74
|
"engines": {
|
|
75
75
|
"node": ">=18.14.1"
|
|
@@ -18,10 +18,11 @@ const config: TemplateConfig = {
|
|
|
18
18
|
generate,
|
|
19
19
|
transformPackageJson: async () => ({
|
|
20
20
|
scripts: {
|
|
21
|
+
preview: `${npm} run build && wrangler pages dev ./build`,
|
|
21
22
|
deploy: `${npm} run build && wrangler pages deploy ./build`,
|
|
22
23
|
},
|
|
23
24
|
}),
|
|
24
|
-
devScript: "
|
|
25
|
+
devScript: "preview",
|
|
25
26
|
deployScript: "deploy",
|
|
26
27
|
};
|
|
27
28
|
export default config;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { env,
|
|
1
|
+
import { env, createExecutionContext, waitOnExecutionContext, SELF } from 'cloudflare:test';
|
|
2
2
|
import { describe, it, expect } from 'vitest';
|
|
3
3
|
import worker from '../src';
|
|
4
4
|
|
|
@@ -16,7 +16,7 @@ describe('Hello World user worker', () => {
|
|
|
16
16
|
|
|
17
17
|
it('responds with "Hello, World!" (integration style)', async () => {
|
|
18
18
|
const request = new Request('http://example.com/message');
|
|
19
|
-
const response = await SELF.fetch(request
|
|
19
|
+
const response = await SELF.fetch(request);
|
|
20
20
|
expect(await response.text()).toMatchInlineSnapshot(`"Hello, World!"`);
|
|
21
21
|
});
|
|
22
22
|
});
|
|
@@ -34,7 +34,7 @@ describe('Hello World user worker', () => {
|
|
|
34
34
|
|
|
35
35
|
it('responds with a random UUID (integration style)', async () => {
|
|
36
36
|
const request = new Request('http://example.com/random');
|
|
37
|
-
const response = await SELF.fetch(request
|
|
37
|
+
const response = await SELF.fetch(request);
|
|
38
38
|
expect(await response.text()).toMatch(/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/);
|
|
39
39
|
});
|
|
40
40
|
});
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { env,
|
|
1
|
+
import { env, createExecutionContext, waitOnExecutionContext, SELF } from 'cloudflare:test';
|
|
2
2
|
import { describe, it, expect } from 'vitest';
|
|
3
3
|
import worker from '../src';
|
|
4
4
|
|
|
5
5
|
describe('Hello World user worker', () => {
|
|
6
6
|
describe('request for /message', () => {
|
|
7
7
|
it('/ responds with "Hello, World!" (unit style)', async () => {
|
|
8
|
-
const request = new Request('http://example.com/message');
|
|
8
|
+
const request = new Request<unknown, IncomingRequestCfProperties>('http://example.com/message');
|
|
9
9
|
// Create an empty context to pass to `worker.fetch()`.
|
|
10
10
|
const ctx = createExecutionContext();
|
|
11
11
|
const response = await worker.fetch(request, env, ctx);
|
|
@@ -16,14 +16,14 @@ describe('Hello World user worker', () => {
|
|
|
16
16
|
|
|
17
17
|
it('responds with "Hello, World!" (integration style)', async () => {
|
|
18
18
|
const request = new Request('http://example.com/message');
|
|
19
|
-
const response = await SELF.fetch(request
|
|
19
|
+
const response = await SELF.fetch(request);
|
|
20
20
|
expect(await response.text()).toMatchInlineSnapshot(`"Hello, World!"`);
|
|
21
21
|
});
|
|
22
22
|
});
|
|
23
23
|
|
|
24
24
|
describe('request for /random', () => {
|
|
25
25
|
it('/ responds with a random UUID (unit style)', async () => {
|
|
26
|
-
const request = new Request('http://example.com/random');
|
|
26
|
+
const request = new Request<unknown, IncomingRequestCfProperties>('http://example.com/random');
|
|
27
27
|
// Create an empty context to pass to `worker.fetch()`.
|
|
28
28
|
const ctx = createExecutionContext();
|
|
29
29
|
const response = await worker.fetch(request, env, ctx);
|
|
@@ -34,7 +34,7 @@ describe('Hello World user worker', () => {
|
|
|
34
34
|
|
|
35
35
|
it('responds with a random UUID (integration style)', async () => {
|
|
36
36
|
const request = new Request('http://example.com/random');
|
|
37
|
-
const response = await SELF.fetch(request
|
|
37
|
+
const response = await SELF.fetch(request);
|
|
38
38
|
expect(await response.text()).toMatch(/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/);
|
|
39
39
|
});
|
|
40
40
|
});
|