create-cloudflare 2.31.2 → 2.32.1
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 +36 -36
- package/package.json +5 -5
- package/templates/svelte/c3.ts +1 -1
- package/templates-experimental/remix/c3.ts +1 -26
- package/templates-experimental/remix/templates/public/.assetsignore +0 -4
- package/templates-experimental/remix/templates/wrangler.toml +1 -1
- package/templates-experimental/svelte/c3.ts +1 -1
package/dist/cli.js
CHANGED
|
@@ -24815,8 +24815,8 @@ var require_index_688c5d50 = __commonJS({
|
|
|
24815
24815
|
var pathReservations = () => {
|
|
24816
24816
|
const queues = /* @__PURE__ */ new Map();
|
|
24817
24817
|
const reservations = /* @__PURE__ */ new Map();
|
|
24818
|
-
const { join:
|
|
24819
|
-
const getDirs = (path7) =>
|
|
24818
|
+
const { join: join8 } = path__default["default"];
|
|
24819
|
+
const getDirs = (path7) => join8(path7).split(/[\\/]/).slice(0, -1).reduce((set, path8) => set.length ? set.concat(join8(set[set.length - 1], path8)) : [path8], []);
|
|
24820
24820
|
const running = /* @__PURE__ */ new Set();
|
|
24821
24821
|
const getQueues = (fn) => {
|
|
24822
24822
|
const res = reservations.get(fn);
|
|
@@ -38609,7 +38609,7 @@ var require_util8 = __commonJS({
|
|
|
38609
38609
|
return path6;
|
|
38610
38610
|
}
|
|
38611
38611
|
exports2.normalize = normalize2;
|
|
38612
|
-
function
|
|
38612
|
+
function join8(aRoot, aPath) {
|
|
38613
38613
|
if (aRoot === "") {
|
|
38614
38614
|
aRoot = ".";
|
|
38615
38615
|
}
|
|
@@ -38641,7 +38641,7 @@ var require_util8 = __commonJS({
|
|
|
38641
38641
|
}
|
|
38642
38642
|
return joined;
|
|
38643
38643
|
}
|
|
38644
|
-
exports2.join =
|
|
38644
|
+
exports2.join = join8;
|
|
38645
38645
|
exports2.isAbsolute = function(aPath) {
|
|
38646
38646
|
return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
|
|
38647
38647
|
};
|
|
@@ -38814,7 +38814,7 @@ var require_util8 = __commonJS({
|
|
|
38814
38814
|
parsed.path = parsed.path.substring(0, index + 1);
|
|
38815
38815
|
}
|
|
38816
38816
|
}
|
|
38817
|
-
sourceURL =
|
|
38817
|
+
sourceURL = join8(urlGenerate(parsed), sourceURL);
|
|
38818
38818
|
}
|
|
38819
38819
|
return normalize2(sourceURL);
|
|
38820
38820
|
}
|
|
@@ -73719,7 +73719,7 @@ var Yargs = YargsFactory(esm_default);
|
|
|
73719
73719
|
var yargs_default = Yargs;
|
|
73720
73720
|
|
|
73721
73721
|
// package.json
|
|
73722
|
-
var version = "2.
|
|
73722
|
+
var version = "2.32.1";
|
|
73723
73723
|
|
|
73724
73724
|
// src/metrics.ts
|
|
73725
73725
|
var import_node_async_hooks = require("node:async_hooks");
|
|
@@ -74477,15 +74477,15 @@ var package_default = {
|
|
|
74477
74477
|
"create-astro": "4.10.0",
|
|
74478
74478
|
"create-analog": "1.8.1",
|
|
74479
74479
|
"@angular/create": "18.2.11",
|
|
74480
|
-
"create-docusaurus": "3.
|
|
74480
|
+
"create-docusaurus": "3.6.1",
|
|
74481
74481
|
"create-hono": "0.14.2",
|
|
74482
74482
|
"create-next-app": "14.2.5",
|
|
74483
74483
|
"create-qwik": "1.9.1",
|
|
74484
74484
|
"create-vite": "5.5.5",
|
|
74485
|
-
"create-remix": "2.
|
|
74485
|
+
"create-remix": "2.14.0",
|
|
74486
74486
|
"create-solid": "0.5.13",
|
|
74487
|
-
"create-vue": "3.12.
|
|
74488
|
-
gatsby: "5.
|
|
74487
|
+
"create-vue": "3.12.1",
|
|
74488
|
+
gatsby: "5.14.0",
|
|
74489
74489
|
nuxi: "3.15.0",
|
|
74490
74490
|
sv: "0.6.1"
|
|
74491
74491
|
}
|
|
@@ -75227,7 +75227,7 @@ var generate9 = async (ctx) => {
|
|
|
75227
75227
|
await runFrameworkGenerator(ctx, [
|
|
75228
75228
|
ctx.project.name,
|
|
75229
75229
|
"--template",
|
|
75230
|
-
"https://github.com/remix-run/remix/tree/main/templates/cloudflare"
|
|
75230
|
+
"https://github.com/remix-run/remix/tree/main/templates/cloudflare-workers"
|
|
75231
75231
|
]);
|
|
75232
75232
|
logRaw("");
|
|
75233
75233
|
};
|
|
@@ -75237,19 +75237,6 @@ var configure6 = async () => {
|
|
|
75237
75237
|
startText: "Updating the Wrangler version",
|
|
75238
75238
|
doneText: `${brandColor(`updated`)} ${dim("wrangler@latest")}`
|
|
75239
75239
|
});
|
|
75240
|
-
const typeDefsPath = "load-context.ts";
|
|
75241
|
-
const s = spinner();
|
|
75242
|
-
s.start(`Updating \`${typeDefsPath}\``);
|
|
75243
|
-
transformFile(typeDefsPath, {
|
|
75244
|
-
visitTSInterfaceDeclaration(n2) {
|
|
75245
|
-
if (n2.node.id.type === "Identifier" && n2.node.id.name !== "Env") {
|
|
75246
|
-
return this.traverse(n2);
|
|
75247
|
-
}
|
|
75248
|
-
n2.replace();
|
|
75249
|
-
return false;
|
|
75250
|
-
}
|
|
75251
|
-
});
|
|
75252
|
-
s.stop(`${brandColor("updated")} \`${dim(typeDefsPath)}\``);
|
|
75253
75240
|
};
|
|
75254
75241
|
var config10 = {
|
|
75255
75242
|
configVersion: 1,
|
|
@@ -75265,7 +75252,6 @@ var config10 = {
|
|
|
75265
75252
|
configure: configure6,
|
|
75266
75253
|
transformPackageJson: async () => ({
|
|
75267
75254
|
scripts: {
|
|
75268
|
-
build: "remix vite:build && wrangler pages functions build --outdir build/worker",
|
|
75269
75255
|
deploy: `${npm6} run build && wrangler deploy`,
|
|
75270
75256
|
preview: `${npm6} run build && wrangler dev`,
|
|
75271
75257
|
"cf-typegen": `wrangler types`
|
|
@@ -75466,7 +75452,7 @@ var config12 = {
|
|
|
75466
75452
|
configVersion: 1,
|
|
75467
75453
|
id: "svelte",
|
|
75468
75454
|
frameworkCli: "sv",
|
|
75469
|
-
displayName: "
|
|
75455
|
+
displayName: "SvelteKit",
|
|
75470
75456
|
platform: "workers",
|
|
75471
75457
|
copyFiles: {
|
|
75472
75458
|
variants: {
|
|
@@ -76790,7 +76776,7 @@ var config24 = {
|
|
|
76790
76776
|
configVersion: 1,
|
|
76791
76777
|
id: "svelte",
|
|
76792
76778
|
frameworkCli: "sv",
|
|
76793
|
-
displayName: "
|
|
76779
|
+
displayName: "SvelteKit",
|
|
76794
76780
|
platform: "pages",
|
|
76795
76781
|
copyFiles: {
|
|
76796
76782
|
variants: {
|
|
@@ -76845,7 +76831,7 @@ var config25 = {
|
|
|
76845
76831
|
var c3_default35 = config25;
|
|
76846
76832
|
|
|
76847
76833
|
// ../wrangler/package.json
|
|
76848
|
-
var version2 = "3.
|
|
76834
|
+
var version2 = "3.86.1";
|
|
76849
76835
|
|
|
76850
76836
|
// src/git.ts
|
|
76851
76837
|
var offerGit = async (ctx) => {
|
|
@@ -77934,6 +77920,9 @@ var processArgument = async (args, key, promptConfig) => {
|
|
|
77934
77920
|
};
|
|
77935
77921
|
|
|
77936
77922
|
// src/deploy.ts
|
|
77923
|
+
var import_promises4 = require("node:fs/promises");
|
|
77924
|
+
var import_node_os5 = require("node:os");
|
|
77925
|
+
var import_node_path5 = require("node:path");
|
|
77937
77926
|
var import_toml2 = __toESM(require_toml());
|
|
77938
77927
|
|
|
77939
77928
|
// src/helpers/poll.ts
|
|
@@ -79252,23 +79241,34 @@ var runDeploy = async (ctx) => {
|
|
|
79252
79241
|
JSON.stringify(ctx.commitMessage)
|
|
79253
79242
|
] : []
|
|
79254
79243
|
];
|
|
79255
|
-
const
|
|
79256
|
-
|
|
79244
|
+
const outputFile = (0, import_node_path5.join)(
|
|
79245
|
+
await (0, import_promises4.mkdtemp)((0, import_node_path5.join)((0, import_node_os5.tmpdir)(), "c3-wrangler-deploy-")),
|
|
79246
|
+
"output.json"
|
|
79247
|
+
);
|
|
79248
|
+
await runCommand(deployCmd, {
|
|
79257
79249
|
cwd: ctx.project.path,
|
|
79258
79250
|
env: {
|
|
79259
79251
|
CLOUDFLARE_ACCOUNT_ID: ctx.account.id,
|
|
79260
|
-
NODE_ENV: "production"
|
|
79252
|
+
NODE_ENV: "production",
|
|
79253
|
+
WRANGLER_OUTPUT_FILE_PATH: outputFile
|
|
79261
79254
|
},
|
|
79262
79255
|
startText: "Deploying your application",
|
|
79263
79256
|
doneText: `${brandColor("deployed")} ${dim(
|
|
79264
79257
|
`via \`${quoteShellArgs(baseDeployCmd)}\``
|
|
79265
79258
|
)}`
|
|
79266
79259
|
});
|
|
79267
|
-
|
|
79268
|
-
|
|
79269
|
-
|
|
79270
|
-
|
|
79271
|
-
|
|
79260
|
+
try {
|
|
79261
|
+
const contents = readFile(outputFile);
|
|
79262
|
+
const entries = contents.split("\n").filter(Boolean).map((entry) => JSON.parse(entry));
|
|
79263
|
+
const url = entries.find((entry) => entry.type === "deploy")?.targets?.[0] ?? entries.find((entry) => entry.type === "pages-deploy")?.url;
|
|
79264
|
+
const deployedUrlRegex = /https:\/\/.+\.(pages|workers)\.dev/;
|
|
79265
|
+
const deployedUrlMatch = url?.match(deployedUrlRegex);
|
|
79266
|
+
if (deployedUrlMatch) {
|
|
79267
|
+
ctx.deployment.url = deployedUrlMatch[0];
|
|
79268
|
+
} else {
|
|
79269
|
+
throw new Error("Failed to find deployment url.");
|
|
79270
|
+
}
|
|
79271
|
+
} catch {
|
|
79272
79272
|
throw new Error("Failed to find deployment url.");
|
|
79273
79273
|
}
|
|
79274
79274
|
if (ctx.deployment.url?.endsWith(".pages.dev")) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-cloudflare",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.32.1",
|
|
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.
|
|
33
|
+
"@cloudflare/workers-types": "^4.20241106.0",
|
|
34
34
|
"@iarna/toml": "^3.0.0",
|
|
35
35
|
"@types/command-exists": "^1.2.0",
|
|
36
36
|
"@types/cross-spawn": "^6.0.2",
|
|
@@ -66,10 +66,10 @@
|
|
|
66
66
|
"wrap-ansi": "^9.0.0",
|
|
67
67
|
"xdg-app-paths": "^8.3.0",
|
|
68
68
|
"yargs": "^17.7.2",
|
|
69
|
-
"@cloudflare/eslint-config-worker": "1.1.0",
|
|
70
|
-
"@cloudflare/workers-tsconfig": "0.0.0",
|
|
71
69
|
"@cloudflare/cli": "1.1.1",
|
|
72
|
-
"
|
|
70
|
+
"@cloudflare/workers-tsconfig": "0.0.0",
|
|
71
|
+
"@cloudflare/eslint-config-worker": "1.1.0",
|
|
72
|
+
"wrangler": "3.86.1"
|
|
73
73
|
},
|
|
74
74
|
"engines": {
|
|
75
75
|
"node": ">=18.14.1"
|
package/templates/svelte/c3.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { logRaw } from "@cloudflare/cli";
|
|
2
2
|
import { brandColor, dim } from "@cloudflare/cli/colors";
|
|
3
|
-
import { spinner } from "@cloudflare/cli/interactive";
|
|
4
3
|
import { runFrameworkGenerator } from "frameworks/index";
|
|
5
|
-
import { transformFile } from "helpers/codemod";
|
|
6
4
|
import { detectPackageManager } from "helpers/packageManagers";
|
|
7
5
|
import { installPackages } from "helpers/packages";
|
|
8
6
|
import type { TemplateConfig } from "../../src/templates";
|
|
@@ -14,7 +12,7 @@ const generate = async (ctx: C3Context) => {
|
|
|
14
12
|
await runFrameworkGenerator(ctx, [
|
|
15
13
|
ctx.project.name,
|
|
16
14
|
"--template",
|
|
17
|
-
"https://github.com/remix-run/remix/tree/main/templates/cloudflare",
|
|
15
|
+
"https://github.com/remix-run/remix/tree/main/templates/cloudflare-workers",
|
|
18
16
|
]);
|
|
19
17
|
|
|
20
18
|
logRaw(""); // newline
|
|
@@ -26,27 +24,6 @@ const configure = async () => {
|
|
|
26
24
|
startText: "Updating the Wrangler version",
|
|
27
25
|
doneText: `${brandColor(`updated`)} ${dim("wrangler@latest")}`,
|
|
28
26
|
});
|
|
29
|
-
|
|
30
|
-
const typeDefsPath = "load-context.ts";
|
|
31
|
-
|
|
32
|
-
const s = spinner();
|
|
33
|
-
s.start(`Updating \`${typeDefsPath}\``);
|
|
34
|
-
|
|
35
|
-
// Remove the empty Env declaration from the template to allow the type from
|
|
36
|
-
// worker-configuration.d.ts to take over
|
|
37
|
-
transformFile(typeDefsPath, {
|
|
38
|
-
visitTSInterfaceDeclaration(n) {
|
|
39
|
-
if (n.node.id.type === "Identifier" && n.node.id.name !== "Env") {
|
|
40
|
-
return this.traverse(n);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// Removes the node
|
|
44
|
-
n.replace();
|
|
45
|
-
return false;
|
|
46
|
-
},
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
s.stop(`${brandColor("updated")} \`${dim(typeDefsPath)}\``);
|
|
50
27
|
};
|
|
51
28
|
|
|
52
29
|
const config: TemplateConfig = {
|
|
@@ -63,8 +40,6 @@ const config: TemplateConfig = {
|
|
|
63
40
|
configure,
|
|
64
41
|
transformPackageJson: async () => ({
|
|
65
42
|
scripts: {
|
|
66
|
-
build:
|
|
67
|
-
"remix vite:build && wrangler pages functions build --outdir build/worker",
|
|
68
43
|
deploy: `${npm} run build && wrangler deploy`,
|
|
69
44
|
preview: `${npm} run build && wrangler dev`,
|
|
70
45
|
"cf-typegen": `wrangler types`,
|