create-cloudflare 2.74.4 → 2.74.6

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 CHANGED
@@ -98328,7 +98328,7 @@ function formatZodError(error62) {
98328
98328
  }
98329
98329
  __name(formatZodError, "formatZodError");
98330
98330
 
98331
- // ../workers-utils/dist/chunk-2HLTAS5V.mjs
98331
+ // ../workers-utils/dist/chunk-AAQI36FL.mjs
98332
98332
  var import_node_module6 = require("node:module");
98333
98333
 
98334
98334
  // ../workers-utils/dist/chunk-M3RITKR3.mjs
@@ -98377,7 +98377,7 @@ function dedent(templ) {
98377
98377
  __name(dedent, "dedent");
98378
98378
  var esm_default = dedent;
98379
98379
 
98380
- // ../workers-utils/dist/chunk-2HLTAS5V.mjs
98380
+ // ../workers-utils/dist/chunk-AAQI36FL.mjs
98381
98381
  init_chunk_U6NEESU5();
98382
98382
  var import_node_fs = require("node:fs");
98383
98383
  var import_node_path = __toESM(require("node:path"), 1);
@@ -98561,7 +98561,7 @@ function validateDurableObjectContainerApplications(config50, containers = getDu
98561
98561
  { telemetryMessage: "no DO defined that matches container class_name" }
98562
98562
  );
98563
98563
  }
98564
- if (maybeBoundDO?.script_name !== void 0) {
98564
+ if (maybeBoundDO?.script_name !== void 0 && maybeBoundDO.script_name !== config50.name) {
98565
98565
  throw new UserError(
98566
98566
  `The container ${container.name} is referencing the durable object ${container.class_name}, which appears to be defined on the ${maybeBoundDO.script_name} Worker instead (via the 'script_name' field). You cannot configure a container on a Durable Object that is defined in another Worker.`,
98567
98567
  {
@@ -108224,8 +108224,12 @@ var validateAnalyticsEngineBinding = /* @__PURE__ */ __name((diagnostics, field,
108224
108224
  }
108225
108225
  validateAdditionalProperties(diagnostics, field, Object.keys(value), [
108226
108226
  "binding",
108227
- "dataset"
108227
+ "dataset",
108228
+ "remote"
108228
108229
  ]);
108230
+ if (!isRemoteValid(value, field, diagnostics)) {
108231
+ isValid = false;
108232
+ }
108229
108233
  return isValid;
108230
108234
  }, "validateAnalyticsEngineBinding");
108231
108235
  var validateWorkerNamespaceBinding = /* @__PURE__ */ __name((diagnostics, field, value) => {
@@ -110280,7 +110284,6 @@ var BINDING_LOCAL_SUPPORT = {
110280
110284
  unsafe_hello_world: "local-only",
110281
110285
  durable_object_namespace: "local-only",
110282
110286
  fetcher: "local-only",
110283
- analytics_engine: "local-only",
110284
110287
  secrets_store_secret: "local-only",
110285
110288
  ratelimit: "local-only",
110286
110289
  worker_loader: "local-only",
@@ -110298,6 +110301,7 @@ var BINDING_LOCAL_SUPPORT = {
110298
110301
  // TODO: Miniflare currently ignores `remote: true` on queues, tracked in #13727.
110299
110302
  queue: "local-and-remote",
110300
110303
  flagship: "local-and-remote",
110304
+ analytics_engine: "local-and-remote",
110301
110305
  vectorize: "remote",
110302
110306
  mtls_certificate: "remote",
110303
110307
  dispatch_namespace: "remote",
@@ -110999,7 +111003,7 @@ function mapWorkerMetadataBindings(bindings) {
110999
111003
  }, {});
111000
111004
  }
111001
111005
  __name(mapWorkerMetadataBindings, "mapWorkerMetadataBindings");
111002
- var DEFAULT_COMPAT_DATE = "2026-10-23";
111006
+ var DEFAULT_COMPAT_DATE = "2026-11-01";
111003
111007
  function constructWranglerConfig(config50) {
111004
111008
  const mappedBindings = mapWorkerMetadataBindings(config50.bindings);
111005
111009
  const durableObjectClassNames = config50.bindings.filter(
@@ -111841,12 +111845,14 @@ function printBindings(bindings, options) {
111841
111845
  }
111842
111846
  if (analytics_engine_datasets.length > 0) {
111843
111847
  output2.push(
111844
- ...analytics_engine_datasets.map(({ binding, dataset }) => {
111848
+ ...analytics_engine_datasets.map(({ binding, dataset, remote }) => {
111845
111849
  return {
111846
111850
  name: binding,
111847
111851
  type: getBindingTypeFriendlyName("analytics_engine"),
111848
111852
  value: dataset ?? binding,
111849
- mode: getMode({ isSimulatedLocally: true })
111853
+ mode: getMode({
111854
+ isSimulatedLocally: context.remoteBindingsDisabled || !remote
111855
+ })
111850
111856
  };
111851
111857
  })
111852
111858
  );
@@ -114425,7 +114431,7 @@ function leadingMigrationNumber(relativePath) {
114425
114431
  __name(leadingMigrationNumber, "leadingMigrationNumber");
114426
114432
 
114427
114433
  // ../cli/dist/gitignore.mjs
114428
- function maybeAppendWranglerToGitIgnoreLikeFile(filePath) {
114434
+ function maybeAppendWranglerToGitIgnoreLikeFile(filePath, { additionalEntries = [], requireEnvWildcard = false } = {}) {
114429
114435
  const filePreExisted = (0, import_node_fs5.existsSync)(filePath);
114430
114436
  if (!filePreExisted) (0, import_node_fs5.writeFileSync)(filePath, "");
114431
114437
  const existingGitIgnoreContent = readFileSync(filePath);
@@ -114434,8 +114440,10 @@ function maybeAppendWranglerToGitIgnoreLikeFile(filePath) {
114434
114440
  if (!hasDotWrangler) wranglerGitIgnoreFilesToAdd.push(".wrangler");
114435
114441
  if (!existingGitIgnoreContent.match(/^\/?\.dev\.vars\*(\s|$)/m)) wranglerGitIgnoreFilesToAdd.push(".dev.vars*");
114436
114442
  if (!existingGitIgnoreContent.match(/^!\/?\.dev\.vars\.example(\s|$)/m)) wranglerGitIgnoreFilesToAdd.push("!.dev.vars.example");
114437
- if (!existingGitIgnoreContent.match(/^\/?\.env\*?(\..*?)?(\s|$)/m)) wranglerGitIgnoreFilesToAdd.push(".env*");
114443
+ if (!existingGitIgnoreContent.match(requireEnvWildcard ? /^\.env\*(\s|$)/m : /^\/?\.env\*?(\..*?)?(\s|$)/m)) wranglerGitIgnoreFilesToAdd.push(".env*");
114438
114444
  if (!existingGitIgnoreContent.match(/^!\/?\.env\.example(\s|$)/m)) wranglerGitIgnoreFilesToAdd.push("!.env.example");
114445
+ const existingLines = new Set(existingGitIgnoreContent.split(/\r?\n/).map((line) => line.trim()));
114446
+ for (const entry of additionalEntries) if (!existingLines.has(entry) && !wranglerGitIgnoreFilesToAdd.includes(entry)) wranglerGitIgnoreFilesToAdd.push(entry);
114439
114447
  if (wranglerGitIgnoreFilesToAdd.length === 0) return;
114440
114448
  const s = spinner();
114441
114449
  s.start(`Adding Wrangler files to the ${(0, import_node_path6.basename)(filePath)} file`);
@@ -119314,7 +119322,7 @@ var Yargs = YargsFactory(esm_default2);
119314
119322
  var yargs_default = Yargs;
119315
119323
 
119316
119324
  // package.json
119317
- var version2 = "2.74.4";
119325
+ var version2 = "2.74.6";
119318
119326
 
119319
119327
  // src/metrics.ts
119320
119328
  var import_node_async_hooks = require("node:async_hooks");
@@ -123378,7 +123386,7 @@ async function isLoggedIn() {
123378
123386
  }
123379
123387
  async function listAccounts() {
123380
123388
  const { accounts = [] } = await cfWhoami();
123381
- return Object.fromEntries(accounts.map(({ name: name3, id }) => [name3, id]));
123389
+ return accounts;
123382
123390
  }
123383
123391
  async function login() {
123384
123392
  const { npx: npx6 } = detectPackageManager();
@@ -123394,7 +123402,7 @@ async function login() {
123394
123402
  }
123395
123403
 
123396
123404
  // src/wrangler/accounts.ts
123397
- var chooseAccount = async (ctx) => {
123405
+ async function chooseAccount(ctx) {
123398
123406
  const accountIdFromEnv = process.env.CLOUDFLARE_ACCOUNT_ID;
123399
123407
  if (accountIdFromEnv) {
123400
123408
  updateStatus(`Using CLOUDFLARE_ACCOUNT_ID from the environment`);
@@ -123404,39 +123412,38 @@ var chooseAccount = async (ctx) => {
123404
123412
  const s = spinner();
123405
123413
  s.start(`Selecting Cloudflare account ${dim("retrieving accounts")}`);
123406
123414
  const accounts = usesCfCli(ctx.project.path) ? await listAccounts() : await listAccounts2();
123407
- let accountId;
123408
- const numAccounts = Object.keys(accounts).length;
123409
- if (numAccounts === 0) {
123415
+ if (accounts.length === 0) {
123410
123416
  throw new Error(
123411
123417
  "Unable to find any accounts to deploy to! Please ensure you're logged in as a user that can deploy Workers."
123412
123418
  );
123413
- } else if (numAccounts === 1) {
123414
- const accountName2 = Object.keys(accounts)[0];
123415
- accountId = accounts[accountName2];
123416
- s.stop(`${brandColor("account")} ${dim(accountName2)}`);
123419
+ }
123420
+ let account;
123421
+ if (accounts.length === 1) {
123422
+ account = accounts[0];
123423
+ s.stop(`${brandColor("account")} ${dim(account.name)}`);
123417
123424
  } else {
123418
123425
  s.stop(
123419
123426
  `${brandColor("account")} ${dim("more than one account available")}`
123420
123427
  );
123421
- const accountOptions = Object.entries(accounts).map(
123422
- ([accountName2, id]) => ({
123423
- label: accountName2,
123424
- value: id
123425
- })
123426
- );
123427
- accountId = await inputPrompt({
123428
+ const accountOptions = accounts.map(({ name: name3, id }) => ({
123429
+ label: `${name3} (${id})`,
123430
+ value: id
123431
+ }));
123432
+ const accountId = await inputPrompt({
123428
123433
  type: "select",
123429
123434
  question: "Which account do you want to use?",
123430
123435
  options: accountOptions,
123431
123436
  label: "account",
123432
123437
  defaultValue: accountOptions[0].value
123433
123438
  });
123439
+ const selectedAccount = accounts.find(({ id }) => id === accountId);
123440
+ if (!selectedAccount) {
123441
+ throw new Error("Unable to find the selected Cloudflare account.");
123442
+ }
123443
+ account = selectedAccount;
123434
123444
  }
123435
- const accountName = Object.keys(accounts).find(
123436
- (account) => accounts[account] == accountId
123437
- );
123438
- ctx.account = { id: accountId, name: accountName };
123439
- };
123445
+ ctx.account = account;
123446
+ }
123440
123447
  var login2 = async (ctx) => {
123441
123448
  return reporter.collectAsyncMetrics({
123442
123449
  eventPrefix: "c3 login",
@@ -123478,20 +123485,20 @@ var login2 = async (ctx) => {
123478
123485
  }
123479
123486
  });
123480
123487
  };
123481
- var listAccounts2 = async () => {
123488
+ async function listAccounts2() {
123482
123489
  const { npx: npx6 } = detectPackageManager();
123483
123490
  const output2 = await runWranglerCommand([npx6, "wrangler", "whoami"], {
123484
123491
  silent: true
123485
123492
  });
123486
- const accounts = {};
123493
+ const accounts = [];
123487
123494
  output2.split("\n").forEach((line) => {
123488
123495
  const match = line.match(/│\s+(.+)\s+│\s+(\w{32})\s+│/);
123489
123496
  if (match) {
123490
- accounts[match[1].trim()] = match[2].trim();
123497
+ accounts.push({ name: match[1].trim(), id: match[2].trim() });
123491
123498
  }
123492
123499
  });
123493
123500
  return accounts;
123494
- };
123501
+ }
123495
123502
  var isLoggedIn2 = async () => {
123496
123503
  const { npx: npx6 } = detectPackageManager();
123497
123504
  try {
@@ -124811,7 +124818,7 @@ If the application uses Durable Objects or Workflows, refer to the relevant best
124811
124818
  var import_node_assert7 = __toESM(require("node:assert"));
124812
124819
 
124813
124820
  // ../wrangler/package.json
124814
- var version3 = "4.153.0";
124821
+ var version3 = "4.156.1";
124815
124822
 
124816
124823
  // src/git.ts
124817
124824
  var offerGit = async (ctx) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-cloudflare",
3
- "version": "2.74.4",
3
+ "version": "2.74.6",
4
4
  "description": "A CLI for creating and deploying new applications to Cloudflare.",
5
5
  "keywords": [
6
6
  "cloudflare",
@@ -32,7 +32,7 @@
32
32
  "@babel/types": "^7.21.4",
33
33
  "@clack/prompts": "^1.2.0",
34
34
  "@cloudflare/vite-plugin": "npm:@cloudflare/vite-plugin@1.63.2",
35
- "@cloudflare/workers-types": "^5.20261023.1",
35
+ "@cloudflare/workers-types": "^5.20261101.1",
36
36
  "@types/command-exists": "^1.2.0",
37
37
  "@types/cross-spawn": "^6.0.2",
38
38
  "@types/deepmerge": "^2.2.0",
@@ -71,12 +71,12 @@
71
71
  "which-pm-runs": "^1.1.0",
72
72
  "wrap-ansi": "^9.0.0",
73
73
  "yargs": "^17.7.2",
74
+ "@cloudflare/cli-shared-helpers": "0.3.1",
75
+ "@cloudflare/mock-npm-registry": "0.0.0",
74
76
  "@cloudflare/shared-ast-primitives": "1.1.0",
77
+ "wrangler": "4.156.1",
75
78
  "@cloudflare/workers-tsconfig": "0.0.0",
76
- "@cloudflare/mock-npm-registry": "0.0.0",
77
- "@cloudflare/cli-shared-helpers": "0.2.9",
78
- "@cloudflare/workers-utils": "0.49.0",
79
- "wrangler": "4.153.0"
79
+ "@cloudflare/workers-utils": "0.50.2"
80
80
  },
81
81
  "engines": {
82
82
  "node": ">=22.0.0"
@@ -0,0 +1,167 @@
1
+ # Logs
2
+
3
+ logs
4
+ _.log
5
+ npm-debug.log_
6
+ yarn-debug.log*
7
+ yarn-error.log*
8
+ lerna-debug.log*
9
+ .pnpm-debug.log*
10
+
11
+ # Diagnostic reports (https://nodejs.org/api/report.html)
12
+
13
+ report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
14
+
15
+ # Runtime data
16
+
17
+ pids
18
+ _.pid
19
+ _.seed
20
+ \*.pid.lock
21
+
22
+ # Directory for instrumented libs generated by jscoverage/JSCover
23
+
24
+ lib-cov
25
+
26
+ # Coverage directory used by tools like istanbul
27
+
28
+ coverage
29
+ \*.lcov
30
+
31
+ # nyc test coverage
32
+
33
+ .nyc_output
34
+
35
+ # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
36
+
37
+ .grunt
38
+
39
+ # Bower dependency directory (https://bower.io/)
40
+
41
+ bower_components
42
+
43
+ # node-waf configuration
44
+
45
+ .lock-wscript
46
+
47
+ # Compiled binary addons (https://nodejs.org/api/addons.html)
48
+
49
+ build/Release
50
+
51
+ # Dependency directories
52
+
53
+ node_modules/
54
+ jspm_packages/
55
+
56
+ # Snowpack dependency directory (https://snowpack.dev/)
57
+
58
+ web_modules/
59
+
60
+ # TypeScript cache
61
+
62
+ \*.tsbuildinfo
63
+
64
+ # Optional npm cache directory
65
+
66
+ .npm
67
+
68
+ # Optional eslint cache
69
+
70
+ .eslintcache
71
+
72
+ # Optional stylelint cache
73
+
74
+ .stylelintcache
75
+
76
+ # Microbundle cache
77
+
78
+ .rpt2_cache/
79
+ .rts2_cache_cjs/
80
+ .rts2_cache_es/
81
+ .rts2_cache_umd/
82
+
83
+ # Optional REPL history
84
+
85
+ .node_repl_history
86
+
87
+ # Output of 'npm pack'
88
+
89
+ \*.tgz
90
+
91
+ # Yarn Integrity file
92
+
93
+ .yarn-integrity
94
+
95
+ # parcel-bundler cache (https://parceljs.org/)
96
+
97
+ .cache
98
+ .parcel-cache
99
+
100
+ # Next.js build output
101
+
102
+ .next
103
+ out
104
+
105
+ # Nuxt.js build / generate output
106
+
107
+ .nuxt
108
+ dist
109
+
110
+ # Gatsby files
111
+
112
+ .cache/
113
+
114
+ # Comment in the public line in if your project uses Gatsby and not Next.js
115
+
116
+ # https://nextjs.org/blog/next-9-1#public-directory-support
117
+
118
+ # public
119
+
120
+ # vuepress build output
121
+
122
+ .vuepress/dist
123
+
124
+ # vuepress v2.x temp and cache directory
125
+
126
+ .temp
127
+ .cache
128
+
129
+ # Docusaurus cache and generated files
130
+
131
+ .docusaurus
132
+
133
+ # Serverless directories
134
+
135
+ .serverless/
136
+
137
+ # FuseBox cache
138
+
139
+ .fusebox/
140
+
141
+ # DynamoDB Local files
142
+
143
+ .dynamodb/
144
+
145
+ # TernJS port file
146
+
147
+ .tern-port
148
+
149
+ # Stores VSCode versions used for testing VSCode extensions
150
+
151
+ .vscode-test
152
+
153
+ # yarn v2
154
+
155
+ .yarn/cache
156
+ .yarn/unplugged
157
+ .yarn/build-state.yml
158
+ .yarn/install-state.gz
159
+ .pnp.\*
160
+
161
+ # wrangler project
162
+
163
+ .dev.vars*
164
+ !.dev.vars.example
165
+ .env*
166
+ !.env.example
167
+ .wrangler/
@@ -0,0 +1,167 @@
1
+ # Logs
2
+
3
+ logs
4
+ _.log
5
+ npm-debug.log_
6
+ yarn-debug.log*
7
+ yarn-error.log*
8
+ lerna-debug.log*
9
+ .pnpm-debug.log*
10
+
11
+ # Diagnostic reports (https://nodejs.org/api/report.html)
12
+
13
+ report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
14
+
15
+ # Runtime data
16
+
17
+ pids
18
+ _.pid
19
+ _.seed
20
+ \*.pid.lock
21
+
22
+ # Directory for instrumented libs generated by jscoverage/JSCover
23
+
24
+ lib-cov
25
+
26
+ # Coverage directory used by tools like istanbul
27
+
28
+ coverage
29
+ \*.lcov
30
+
31
+ # nyc test coverage
32
+
33
+ .nyc_output
34
+
35
+ # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
36
+
37
+ .grunt
38
+
39
+ # Bower dependency directory (https://bower.io/)
40
+
41
+ bower_components
42
+
43
+ # node-waf configuration
44
+
45
+ .lock-wscript
46
+
47
+ # Compiled binary addons (https://nodejs.org/api/addons.html)
48
+
49
+ build/Release
50
+
51
+ # Dependency directories
52
+
53
+ node_modules/
54
+ jspm_packages/
55
+
56
+ # Snowpack dependency directory (https://snowpack.dev/)
57
+
58
+ web_modules/
59
+
60
+ # TypeScript cache
61
+
62
+ \*.tsbuildinfo
63
+
64
+ # Optional npm cache directory
65
+
66
+ .npm
67
+
68
+ # Optional eslint cache
69
+
70
+ .eslintcache
71
+
72
+ # Optional stylelint cache
73
+
74
+ .stylelintcache
75
+
76
+ # Microbundle cache
77
+
78
+ .rpt2_cache/
79
+ .rts2_cache_cjs/
80
+ .rts2_cache_es/
81
+ .rts2_cache_umd/
82
+
83
+ # Optional REPL history
84
+
85
+ .node_repl_history
86
+
87
+ # Output of 'npm pack'
88
+
89
+ \*.tgz
90
+
91
+ # Yarn Integrity file
92
+
93
+ .yarn-integrity
94
+
95
+ # parcel-bundler cache (https://parceljs.org/)
96
+
97
+ .cache
98
+ .parcel-cache
99
+
100
+ # Next.js build output
101
+
102
+ .next
103
+ out
104
+
105
+ # Nuxt.js build / generate output
106
+
107
+ .nuxt
108
+ dist
109
+
110
+ # Gatsby files
111
+
112
+ .cache/
113
+
114
+ # Comment in the public line in if your project uses Gatsby and not Next.js
115
+
116
+ # https://nextjs.org/blog/next-9-1#public-directory-support
117
+
118
+ # public
119
+
120
+ # vuepress build output
121
+
122
+ .vuepress/dist
123
+
124
+ # vuepress v2.x temp and cache directory
125
+
126
+ .temp
127
+ .cache
128
+
129
+ # Docusaurus cache and generated files
130
+
131
+ .docusaurus
132
+
133
+ # Serverless directories
134
+
135
+ .serverless/
136
+
137
+ # FuseBox cache
138
+
139
+ .fusebox/
140
+
141
+ # DynamoDB Local files
142
+
143
+ .dynamodb/
144
+
145
+ # TernJS port file
146
+
147
+ .tern-port
148
+
149
+ # Stores VSCode versions used for testing VSCode extensions
150
+
151
+ .vscode-test
152
+
153
+ # yarn v2
154
+
155
+ .yarn/cache
156
+ .yarn/unplugged
157
+ .yarn/build-state.yml
158
+ .yarn/install-state.gz
159
+ .pnp.\*
160
+
161
+ # wrangler project
162
+
163
+ .dev.vars*
164
+ !.dev.vars.example
165
+ .env*
166
+ !.env.example
167
+ .wrangler/