create-cloudflare 2.37.3 → 2.37.4

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
@@ -73294,7 +73294,7 @@ var Yargs = YargsFactory(esm_default);
73294
73294
  var yargs_default = Yargs;
73295
73295
 
73296
73296
  // package.json
73297
- var version = "2.37.3";
73297
+ var version = "2.37.4";
73298
73298
 
73299
73299
  // src/metrics.ts
73300
73300
  var import_node_async_hooks = require("node:async_hooks");
@@ -75364,7 +75364,7 @@ var package_default = {
75364
75364
  "create-analog": "1.8.1",
75365
75365
  "@angular/create": "19.1.2",
75366
75366
  "create-docusaurus": "3.7.0",
75367
- "create-hono": "0.14.3",
75367
+ "create-hono": "0.15.2",
75368
75368
  "create-next-app": "15.1.5",
75369
75369
  "create-qwik": "1.12.0",
75370
75370
  "create-vite": "6.1.1",
@@ -75819,7 +75819,7 @@ var generate6 = async (ctx) => {
75819
75819
  };
75820
75820
  var configure3 = async () => {
75821
75821
  const packages = [
75822
- "@opennextjs/cloudflare@0.3.x",
75822
+ "@opennextjs/cloudflare@0.4.x",
75823
75823
  "@cloudflare/workers-types"
75824
75824
  ];
75825
75825
  await installPackages(packages, {
@@ -75827,6 +75827,20 @@ var configure3 = async () => {
75827
75827
  startText: "Adding the Cloudflare adapter",
75828
75828
  doneText: `${brandColor(`installed`)} ${dim(packages.join(", "))}`
75829
75829
  });
75830
+ updateNextConfig();
75831
+ };
75832
+ var updateNextConfig = () => {
75833
+ const s = spinner();
75834
+ const configFile = "next.config.mjs";
75835
+ s.start(`Updating \`${configFile}\``);
75836
+ const configContent = readFile(configFile);
75837
+ const updatedConfigFile = configContent + `
75838
+ // added by create cloudflare to enable calling \`getCloudflareContext()\` in \`next dev\`
75839
+ import { initOpenNextCloudflareForDev } from '@opennextjs/cloudflare';
75840
+ initOpenNextCloudflareForDev();
75841
+ `.replace(/\n\t*/g, "\n");
75842
+ writeFile2(configFile, updatedConfigFile);
75843
+ s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
75830
75844
  };
75831
75845
  var c3_default9 = {
75832
75846
  configVersion: 1,
@@ -76811,7 +76825,7 @@ var generate19 = async (ctx) => {
76811
76825
  writeFile2((0, import_path10.join)(ctx.project.path, "wrangler.json"), wranglerConfig);
76812
76826
  updateStatus("Created wrangler.json file");
76813
76827
  };
76814
- var updateNextConfig = (usesTs) => {
76828
+ var updateNextConfig2 = (usesTs) => {
76815
76829
  const s = spinner();
76816
76830
  const configFile = `next.config.${usesTs ? "ts" : "mjs"}`;
76817
76831
  s.start(`Updating \`${configFile}\``);
@@ -76854,7 +76868,7 @@ var configure13 = async (ctx) => {
76854
76868
  if (installEslintPlugin) {
76855
76869
  await writeEslintrc(ctx);
76856
76870
  }
76857
- updateNextConfig(usesTs);
76871
+ updateNextConfig2(usesTs);
76858
76872
  copyFile(
76859
76873
  (0, import_path10.join)(getTemplatePath(ctx), "README.md"),
76860
76874
  (0, import_path10.join)(projectPath, "README.md")
@@ -77722,7 +77736,7 @@ var config26 = {
77722
77736
  var c3_default36 = config26;
77723
77737
 
77724
77738
  // ../wrangler/package.json
77725
- var version2 = "3.105.1";
77739
+ var version2 = "3.107.0";
77726
77740
 
77727
77741
  // src/git.ts
77728
77742
  var offerGit = async (ctx) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-cloudflare",
3
- "version": "2.37.3",
3
+ "version": "2.37.4",
4
4
  "description": "A CLI for creating and deploying new applications to Cloudflare.",
5
5
  "keywords": [
6
6
  "cloudflare",
@@ -38,7 +38,7 @@
38
38
  "@types/degit": "^2.8.6",
39
39
  "@types/dns2": "^2.0.3",
40
40
  "@types/esprima": "^4.0.3",
41
- "@types/node": "^18.19.59",
41
+ "@types/node": "^18.19.71",
42
42
  "@types/semver": "^7.5.1",
43
43
  "@types/which-pm-runs": "^1.0.0",
44
44
  "@types/yargs": "^17.0.22",
@@ -60,7 +60,7 @@
60
60
  "open": "^8.4.0",
61
61
  "recast": "^0.22.0",
62
62
  "semver": "^7.5.1",
63
- "typescript": "~5.6.3",
63
+ "typescript": "^5.7.2",
64
64
  "undici": "^5.28.4",
65
65
  "vite": "^5.0.12",
66
66
  "vite-tsconfig-paths": "^4.0.8",
@@ -70,9 +70,9 @@
70
70
  "xdg-app-paths": "^8.3.0",
71
71
  "yargs": "^17.7.2",
72
72
  "@cloudflare/cli": "1.1.1",
73
- "@cloudflare/eslint-config-worker": "1.1.0",
74
73
  "@cloudflare/workers-tsconfig": "0.0.0",
75
- "wrangler": "3.105.1"
74
+ "wrangler": "3.107.0",
75
+ "@cloudflare/eslint-config-worker": "1.1.0"
76
76
  },
77
77
  "engines": {
78
78
  "node": ">=18.14.1"
@@ -1,5 +1,7 @@
1
1
  import { brandColor, dim } from "@cloudflare/cli/colors";
2
+ import { spinner } from "@cloudflare/cli/interactive";
2
3
  import { runFrameworkGenerator } from "frameworks/index";
4
+ import { readFile, writeFile } from "helpers/files";
3
5
  import { installPackages } from "helpers/packages";
4
6
  import type { TemplateConfig } from "../../src/templates";
5
7
  import type { C3Context } from "types";
@@ -19,7 +21,7 @@ const generate = async (ctx: C3Context) => {
19
21
 
20
22
  const configure = async () => {
21
23
  const packages = [
22
- "@opennextjs/cloudflare@0.3.x",
24
+ "@opennextjs/cloudflare@0.4.x",
23
25
  "@cloudflare/workers-types",
24
26
  ];
25
27
  await installPackages(packages, {
@@ -27,6 +29,29 @@ const configure = async () => {
27
29
  startText: "Adding the Cloudflare adapter",
28
30
  doneText: `${brandColor(`installed`)} ${dim(packages.join(", "))}`,
29
31
  });
32
+
33
+ updateNextConfig();
34
+ };
35
+
36
+ const updateNextConfig = () => {
37
+ const s = spinner();
38
+
39
+ const configFile = "next.config.mjs";
40
+ s.start(`Updating \`${configFile}\``);
41
+
42
+ const configContent = readFile(configFile);
43
+
44
+ const updatedConfigFile =
45
+ configContent +
46
+ `
47
+ // added by create cloudflare to enable calling \`getCloudflareContext()\` in \`next dev\`
48
+ import { initOpenNextCloudflareForDev } from '@opennextjs/cloudflare';
49
+ initOpenNextCloudflareForDev();
50
+ `.replace(/\n\t*/g, "\n");
51
+
52
+ writeFile(configFile, updatedConfigFile);
53
+
54
+ s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
30
55
  };
31
56
 
32
57
  export default {