create-cloudflare 2.62.3 → 2.62.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
@@ -76650,6 +76650,8 @@ var defaultWranglerConfig = {
76650
76650
  // the default of 8787 is set at runtime
76651
76651
  inspector_port: void 0,
76652
76652
  // the default of 9229 is set at runtime
76653
+ inspector_ip: void 0,
76654
+ // the default of 127.0.0.1 is set at runtime
76653
76655
  local_protocol: "http",
76654
76656
  upstream_protocol: "http",
76655
76657
  host: void 0,
@@ -77151,6 +77153,10 @@ var getCloudflareEnv = getEnvironmentVariableFactory({
77151
77153
  var getOpenNextDeployFromEnv = getEnvironmentVariableFactory({
77152
77154
  variableName: "OPEN_NEXT_DEPLOY"
77153
77155
  });
77156
+ var getLocalExplorerFromEnv = getBooleanEnvironmentVariableFactory({
77157
+ variableName: "X_LOCAL_EXPLORER",
77158
+ defaultValue: false
77159
+ });
77154
77160
  var Diagnostics = class {
77155
77161
  /**
77156
77162
  * Create a new Diagnostics object.
@@ -77920,6 +77926,7 @@ function normalizeAndValidateDev(diagnostics, rawDev, args) {
77920
77926
  ip = process.platform === "win32" ? "127.0.0.1" : "localhost",
77921
77927
  port,
77922
77928
  inspector_port,
77929
+ inspector_ip,
77923
77930
  local_protocol = localProtocolArg ?? "http",
77924
77931
  // In remote mode upstream_protocol must be https, otherwise it defaults to local_protocol.
77925
77932
  upstream_protocol = upstreamProtocolArg ?? remoteArg ? "https" : local_protocol,
@@ -77939,6 +77946,13 @@ function normalizeAndValidateDev(diagnostics, rawDev, args) {
77939
77946
  inspector_port,
77940
77947
  "number"
77941
77948
  );
77949
+ validateOptionalProperty(
77950
+ diagnostics,
77951
+ "dev",
77952
+ "inspector_ip",
77953
+ inspector_ip,
77954
+ "string"
77955
+ );
77942
77956
  validateOptionalProperty(
77943
77957
  diagnostics,
77944
77958
  "dev",
@@ -77981,6 +77995,7 @@ function normalizeAndValidateDev(diagnostics, rawDev, args) {
77981
77995
  ip,
77982
77996
  port,
77983
77997
  inspector_port,
77998
+ inspector_ip,
77984
77999
  local_protocol,
77985
78000
  upstream_protocol,
77986
78001
  host,
@@ -88162,7 +88177,7 @@ var Yargs = YargsFactory(esm_default2);
88162
88177
  var yargs_default = Yargs;
88163
88178
 
88164
88179
  // package.json
88165
- var version = "2.62.3";
88180
+ var version = "2.62.4";
88166
88181
 
88167
88182
  // src/metrics.ts
88168
88183
  var import_node_async_hooks = require("node:async_hooks");
@@ -89782,14 +89797,14 @@ var package_default = {
89782
89797
  "create-qwik": "1.18.0",
89783
89798
  "create-vite": "7.1.1",
89784
89799
  "create-rwsdk": "3.1.3",
89785
- "create-react-router": "7.12.0",
89800
+ "create-react-router": "7.13.0",
89786
89801
  "create-solid": "0.6.11",
89787
- "create-vike": "0.0.564",
89788
- "create-vue": "3.18.5",
89802
+ "create-vike": "0.0.566",
89803
+ "create-vue": "3.19.0",
89789
89804
  "create-waku": "0.12.5-1.0.0-alpha.2-0",
89790
89805
  "@tanstack/create-start": "0.40.0",
89791
89806
  gatsby: "5.15.0",
89792
- sv: "0.11.2",
89807
+ sv: "0.11.3",
89793
89808
  nuxi: "3.30.0"
89794
89809
  }
89795
89810
  };
@@ -90746,7 +90761,8 @@ var c3_default23 = config21;
90746
90761
 
90747
90762
  // templates/next/c3.ts
90748
90763
  var generate12 = async (ctx) => {
90749
- const repoUrl = "https://github.com/opennextjs/opennextjs-cloudflare/tree/main/create-cloudflare/next";
90764
+ const branch = "main";
90765
+ const repoUrl = `github:opennextjs/opennextjs-cloudflare/create-cloudflare/next#${branch}`;
90750
90766
  await downloadRemoteTemplate(repoUrl, {
90751
90767
  intoFolder: ctx.project.path
90752
90768
  });
@@ -92249,7 +92265,7 @@ var experimental_c3_default3 = config48;
92249
92265
  var import_node_assert6 = __toESM(require("node:assert"));
92250
92266
 
92251
92267
  // ../wrangler/package.json
92252
- var version2 = "4.59.3";
92268
+ var version2 = "4.61.0";
92253
92269
 
92254
92270
  // src/git.ts
92255
92271
  var offerGit = async (ctx) => {
@@ -93026,10 +93042,27 @@ var inferCopyFilesDefinition = (path) => {
93026
93042
  return copyFiles;
93027
93043
  };
93028
93044
  async function downloadRemoteTemplate(src, options = {}) {
93045
+ const ghRegex = /^https:\/\/github\.com\/(?<user>[\w-]+)\/(?<repo>[\w.-]+)(?:\/(?<path>.*))?$/;
93046
+ let errorMessage = `Failed to clone remote template: ${src}`;
93029
93047
  try {
93030
93048
  updateStatus(`Cloning template from: ${blue(src)}`);
93031
- if (src.startsWith("https://github.com/") && src.includes("/tree/main/")) {
93032
- src = src.replace("https://github.com/", "github:").replace("/tree/main/", "/");
93049
+ if (src.startsWith("https://github.com/")) {
93050
+ const match = src.match(ghRegex);
93051
+ if (match?.groups) {
93052
+ const { user, repo, path } = match.groups;
93053
+ const pathSegments = (path ?? "").split("/").filter((s) => s !== "");
93054
+ let branch = "";
93055
+ if (pathSegments[0] === "tree" && pathSegments.length >= 2) {
93056
+ branch = pathSegments[1];
93057
+ if (branch !== "main") {
93058
+ errorMessage += `
93059
+ Use the format "github:<owner>/<repo>/sub/directory[#<branch>]" to clone a specific branch other than 'main'`;
93060
+ throw new Error("Unsupported format");
93061
+ }
93062
+ pathSegments.splice(0, 2);
93063
+ }
93064
+ src = `github:${user}/${repo}${pathSegments.length > 0 ? `/${pathSegments.join("/")}` : ""}${branch ? `#${branch}` : ""}`;
93065
+ }
93033
93066
  }
93034
93067
  const emitter = (0, import_degit.default)(src, {
93035
93068
  cache: false,
@@ -93042,7 +93075,7 @@ async function downloadRemoteTemplate(src, options = {}) {
93042
93075
  return tmpDir;
93043
93076
  } catch {
93044
93077
  updateStatus(`${brandColor("template")} ${dim("failed")}`);
93045
- throw new Error(`Failed to clone remote template: ${src}`);
93078
+ throw new Error(errorMessage);
93046
93079
  }
93047
93080
  }
93048
93081
  function updatePythonPackageName(path, projectName) {
@@ -95853,6 +95886,9 @@ async function updateTsConfig(ctx, { usesNodeCompat }) {
95853
95886
  const tsconfig = readFile(tsconfigPath);
95854
95887
  try {
95855
95888
  const config49 = parse9(tsconfig);
95889
+ if (hasProjectReferences(config49)) {
95890
+ return;
95891
+ }
95856
95892
  const currentTypes = config49.compilerOptions?.types ?? [];
95857
95893
  let newTypes = new Set(currentTypes);
95858
95894
  if (ctx.template.workersTypes === "installed") {
@@ -95901,6 +95937,13 @@ async function updateTsConfig(ctx, { usesNodeCompat }) {
95901
95937
  warn("Failed to update `tsconfig.json`.");
95902
95938
  }
95903
95939
  }
95940
+ function hasProjectReferences(config49) {
95941
+ if (typeof config49 !== "object" || config49 === null) {
95942
+ return false;
95943
+ }
95944
+ const tsconfig = config49;
95945
+ return Array.isArray(tsconfig.references) && tsconfig.references.length > 0;
95946
+ }
95904
95947
  async function installWorkersTypes(npm25) {
95905
95948
  await installPackages(["@cloudflare/workers-types"], {
95906
95949
  dev: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-cloudflare",
3
- "version": "2.62.3",
3
+ "version": "2.62.4",
4
4
  "description": "A CLI for creating and deploying new applications to Cloudflare.",
5
5
  "keywords": [
6
6
  "cloudflare",
@@ -30,7 +30,7 @@
30
30
  "@babel/parser": "^7.21.3",
31
31
  "@babel/types": "^7.21.4",
32
32
  "@clack/prompts": "^0.6.3",
33
- "@cloudflare/workers-types": "^4.20260116.0",
33
+ "@cloudflare/workers-types": "^4.20260124.0",
34
34
  "@types/command-exists": "^1.2.0",
35
35
  "@types/cross-spawn": "^6.0.2",
36
36
  "@types/deepmerge": "^2.2.0",
@@ -72,13 +72,13 @@
72
72
  "wrap-ansi": "^9.0.0",
73
73
  "xdg-app-paths": "^8.3.0",
74
74
  "yargs": "^17.7.2",
75
- "@cloudflare/workers-utils": "0.7.1",
76
- "@cloudflare/eslint-config-shared": "1.1.0",
75
+ "@cloudflare/workers-utils": "0.8.0",
77
76
  "@cloudflare/cli": "1.2.1",
77
+ "@cloudflare/eslint-config-shared": "1.2.0",
78
78
  "@cloudflare/mock-npm-registry": "0.0.0",
79
- "@cloudflare/vite-plugin": "1.21.1",
79
+ "@cloudflare/vite-plugin": "1.22.0",
80
80
  "@cloudflare/workers-tsconfig": "0.0.0",
81
- "wrangler": "4.59.3"
81
+ "wrangler": "4.61.0"
82
82
  },
83
83
  "engines": {
84
84
  "node": ">=18.14.1"
@@ -3,8 +3,10 @@ import type { TemplateConfig } from "../../src/templates";
3
3
  import type { C3Context } from "types";
4
4
 
5
5
  const generate = async (ctx: C3Context) => {
6
- const repoUrl =
7
- "https://github.com/opennextjs/opennextjs-cloudflare/tree/main/create-cloudflare/next";
6
+ // Easy way to switch branch for local testing
7
+ const branch = "main";
8
+
9
+ const repoUrl = `github:opennextjs/opennextjs-cloudflare/create-cloudflare/next#${branch}`;
8
10
 
9
11
  await downloadRemoteTemplate(repoUrl, {
10
12
  intoFolder: ctx.project.path,
@@ -4,5 +4,5 @@
4
4
  "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.worker.tsbuildinfo",
5
5
  "types": ["./worker-configuration.d.ts", "vite/client"],
6
6
  },
7
- "include": ["./worker-configuration.d.ts", "./worker"]
7
+ "include": ["worker"]
8
8
  }