create-cloudflare 0.0.0-98944bfb8 → 0.0.0-98d27250d
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 +78 -55
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/templates/angular/c3.ts +18 -4
- package/templates/angular/templates/src/server.ts +15 -0
- package/templates/angular/templates/tools/copy-files.mjs +8 -2
- package/templates/astro/templates/wrangler.toml +1 -0
- package/templates/hello-world/ts/test/tsconfig.json +1 -1
- 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/solid/c3.ts +1 -1
- package/templates-experimental/svelte/c3.ts +1 -1
- package/templates/angular/templates/server.ts +0 -34
- package/templates/angular/templates/tools/alter-polyfills.mjs +0 -27
- package/templates/angular/templates/tools/paths.mjs +0 -9
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
|
}
|
|
@@ -67118,7 +67118,7 @@ var logRaw = (msg) => {
|
|
|
67118
67118
|
`);
|
|
67119
67119
|
};
|
|
67120
67120
|
var log = (msg) => {
|
|
67121
|
-
const lines = msg.split("\n").map((ln) => `${gray(shapes.bar)}
|
|
67121
|
+
const lines = msg.split("\n").map((ln) => `${gray(shapes.bar)}${ln.length > 0 ? " " + white(ln) : ""}`);
|
|
67122
67122
|
logRaw(lines.join("\n"));
|
|
67123
67123
|
};
|
|
67124
67124
|
var newline = () => {
|
|
@@ -68818,7 +68818,10 @@ var spinner = (frames = spinnerFrames.clockwise, color = brandColor) => {
|
|
|
68818
68818
|
start(msg, helpText) {
|
|
68819
68819
|
helpText ||= ``;
|
|
68820
68820
|
currentMsg = msg;
|
|
68821
|
-
startMsg =
|
|
68821
|
+
startMsg = currentMsg;
|
|
68822
|
+
if (helpText !== void 0 && helpText.length > 0) {
|
|
68823
|
+
startMsg += ` ${dim(helpText)}`;
|
|
68824
|
+
}
|
|
68822
68825
|
if (isInteractive()) {
|
|
68823
68826
|
let index = 0;
|
|
68824
68827
|
clearLoop();
|
|
@@ -68831,7 +68834,7 @@ var spinner = (frames = spinnerFrames.clockwise, color = brandColor) => {
|
|
|
68831
68834
|
}
|
|
68832
68835
|
}, frameRate);
|
|
68833
68836
|
} else {
|
|
68834
|
-
|
|
68837
|
+
logRaw(`${leftT} ${startMsg}`);
|
|
68835
68838
|
}
|
|
68836
68839
|
},
|
|
68837
68840
|
update(msg) {
|
|
@@ -68849,17 +68852,20 @@ ${grayBar} ${msg}`);
|
|
|
68849
68852
|
clearLoop();
|
|
68850
68853
|
} else {
|
|
68851
68854
|
if (msg !== void 0) {
|
|
68852
|
-
|
|
68853
|
-
${grayBar} ${msg}`);
|
|
68855
|
+
logRaw(`${grayBar} ${msg}`);
|
|
68854
68856
|
}
|
|
68855
68857
|
newline();
|
|
68856
68858
|
}
|
|
68857
68859
|
}
|
|
68858
68860
|
};
|
|
68859
68861
|
};
|
|
68860
|
-
|
|
68861
|
-
|
|
68862
|
-
|
|
68862
|
+
function isInteractive() {
|
|
68863
|
+
try {
|
|
68864
|
+
return Boolean(process.stdin.isTTY && process.stdout.isTTY);
|
|
68865
|
+
} catch {
|
|
68866
|
+
return false;
|
|
68867
|
+
}
|
|
68868
|
+
}
|
|
68863
68869
|
|
|
68864
68870
|
// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/lib/platform-shims/esm.mjs
|
|
68865
68871
|
var import_assert = require("assert");
|
|
@@ -73719,7 +73725,7 @@ var Yargs = YargsFactory(esm_default);
|
|
|
73719
73725
|
var yargs_default = Yargs;
|
|
73720
73726
|
|
|
73721
73727
|
// package.json
|
|
73722
|
-
var version = "0.0.0-
|
|
73728
|
+
var version = "0.0.0-98d27250d";
|
|
73723
73729
|
|
|
73724
73730
|
// src/metrics.ts
|
|
73725
73731
|
var import_node_async_hooks = require("node:async_hooks");
|
|
@@ -73999,7 +74005,7 @@ var detectPmMismatch = (ctx) => {
|
|
|
73999
74005
|
case "pnpm":
|
|
74000
74006
|
return !(0, import_fs5.existsSync)(import_path5.default.join(projectPath, "pnpm-lock.yaml"));
|
|
74001
74007
|
case "bun":
|
|
74002
|
-
return !(0, import_fs5.existsSync)(import_path5.default.join(projectPath, "bun.lockb"));
|
|
74008
|
+
return !(0, import_fs5.existsSync)(import_path5.default.join(projectPath, "bun.lockb")) && !(0, import_fs5.existsSync)(import_path5.default.join(projectPath, "bun.lock"));
|
|
74003
74009
|
}
|
|
74004
74010
|
};
|
|
74005
74011
|
|
|
@@ -74474,20 +74480,20 @@ var package_default = {
|
|
|
74474
74480
|
"so that we can use dependabot to update these dependencies automatically."
|
|
74475
74481
|
],
|
|
74476
74482
|
dependencies: {
|
|
74477
|
-
"create-astro": "4.
|
|
74483
|
+
"create-astro": "4.10.0",
|
|
74478
74484
|
"create-analog": "1.8.1",
|
|
74479
|
-
"@angular/create": "
|
|
74480
|
-
"create-docusaurus": "3.
|
|
74485
|
+
"@angular/create": "19.0.0",
|
|
74486
|
+
"create-docusaurus": "3.6.1",
|
|
74481
74487
|
"create-hono": "0.14.2",
|
|
74482
74488
|
"create-next-app": "14.2.5",
|
|
74483
|
-
"create-qwik": "1.
|
|
74484
|
-
"create-vite": "5.5.
|
|
74485
|
-
"create-remix": "2.
|
|
74489
|
+
"create-qwik": "1.10.0",
|
|
74490
|
+
"create-vite": "5.5.5",
|
|
74491
|
+
"create-remix": "2.14.0",
|
|
74486
74492
|
"create-solid": "0.5.13",
|
|
74487
|
-
"create-vue": "3.
|
|
74488
|
-
gatsby: "5.
|
|
74489
|
-
nuxi: "3.
|
|
74490
|
-
sv: "0.
|
|
74493
|
+
"create-vue": "3.12.1",
|
|
74494
|
+
gatsby: "5.14.0",
|
|
74495
|
+
nuxi: "3.15.0",
|
|
74496
|
+
sv: "0.6.1"
|
|
74491
74497
|
}
|
|
74492
74498
|
};
|
|
74493
74499
|
|
|
@@ -75227,7 +75233,7 @@ var generate9 = async (ctx) => {
|
|
|
75227
75233
|
await runFrameworkGenerator(ctx, [
|
|
75228
75234
|
ctx.project.name,
|
|
75229
75235
|
"--template",
|
|
75230
|
-
"https://github.com/remix-run/remix/tree/main/templates/cloudflare"
|
|
75236
|
+
"https://github.com/remix-run/remix/tree/main/templates/cloudflare-workers"
|
|
75231
75237
|
]);
|
|
75232
75238
|
logRaw("");
|
|
75233
75239
|
};
|
|
@@ -75237,19 +75243,6 @@ var configure6 = async () => {
|
|
|
75237
75243
|
startText: "Updating the Wrangler version",
|
|
75238
75244
|
doneText: `${brandColor(`updated`)} ${dim("wrangler@latest")}`
|
|
75239
75245
|
});
|
|
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
75246
|
};
|
|
75254
75247
|
var config10 = {
|
|
75255
75248
|
configVersion: 1,
|
|
@@ -75265,7 +75258,6 @@ var config10 = {
|
|
|
75265
75258
|
configure: configure6,
|
|
75266
75259
|
transformPackageJson: async () => ({
|
|
75267
75260
|
scripts: {
|
|
75268
|
-
build: "remix vite:build && wrangler pages functions build --outdir build/worker",
|
|
75269
75261
|
deploy: `${npm6} run build && wrangler deploy`,
|
|
75270
75262
|
preview: `${npm6} run build && wrangler dev`,
|
|
75271
75263
|
"cf-typegen": `wrangler types`
|
|
@@ -75310,7 +75302,7 @@ var configure7 = async (ctx) => {
|
|
|
75310
75302
|
// preset: "cloudflare-pages"
|
|
75311
75303
|
b2.objectProperty(
|
|
75312
75304
|
b2.identifier("preset"),
|
|
75313
|
-
b2.stringLiteral("
|
|
75305
|
+
b2.stringLiteral("cloudflare-pages")
|
|
75314
75306
|
),
|
|
75315
75307
|
// output: {
|
|
75316
75308
|
// dir: "{{ rootDir }}/dist",
|
|
@@ -75466,7 +75458,7 @@ var config12 = {
|
|
|
75466
75458
|
configVersion: 1,
|
|
75467
75459
|
id: "svelte",
|
|
75468
75460
|
frameworkCli: "sv",
|
|
75469
|
-
displayName: "
|
|
75461
|
+
displayName: "SvelteKit",
|
|
75470
75462
|
platform: "workers",
|
|
75471
75463
|
copyFiles: {
|
|
75472
75464
|
variants: {
|
|
@@ -75604,7 +75596,11 @@ var c3_default15 = config13;
|
|
|
75604
75596
|
var import_node_path4 = require("node:path");
|
|
75605
75597
|
var { npm: npm10 } = detectPackageManager();
|
|
75606
75598
|
var generate13 = async (ctx) => {
|
|
75607
|
-
await runFrameworkGenerator(ctx, [
|
|
75599
|
+
await runFrameworkGenerator(ctx, [
|
|
75600
|
+
ctx.project.name,
|
|
75601
|
+
"--ssr",
|
|
75602
|
+
"--server-routing"
|
|
75603
|
+
]);
|
|
75608
75604
|
logRaw("");
|
|
75609
75605
|
};
|
|
75610
75606
|
var configure10 = async (ctx) => {
|
|
@@ -75633,10 +75629,17 @@ async function updateAppCode2() {
|
|
|
75633
75629
|
);
|
|
75634
75630
|
writeFile2((0, import_node_path4.resolve)(appConfigPath), newAppConfig);
|
|
75635
75631
|
s.stop(`${brandColor(`updated`)} ${dim(appConfigPath)}`);
|
|
75632
|
+
const appServerRoutesPath = "src/app/app.routes.server.ts";
|
|
75633
|
+
const appRoutes = readFile((0, import_node_path4.resolve)(appServerRoutesPath));
|
|
75634
|
+
const newAppRoutes = appRoutes.replace(
|
|
75635
|
+
"RenderMode.Prerender",
|
|
75636
|
+
"RenderMode.Server"
|
|
75637
|
+
);
|
|
75638
|
+
writeFile2((0, import_node_path4.resolve)(appServerRoutesPath), newAppRoutes);
|
|
75639
|
+
s.stop(`${brandColor(`updated`)} ${dim(appServerRoutesPath)}`);
|
|
75636
75640
|
s.start(`Updating package.json`);
|
|
75637
75641
|
const packageJsonPath = (0, import_node_path4.resolve)("package.json");
|
|
75638
75642
|
const packageManifest = readJSON(packageJsonPath);
|
|
75639
|
-
delete packageManifest["dependencies"]["@angular/ssr"];
|
|
75640
75643
|
delete packageManifest["dependencies"]["express"];
|
|
75641
75644
|
delete packageManifest["devDependencies"]["@types/express"];
|
|
75642
75645
|
writeFile2(packageJsonPath, JSON.stringify(packageManifest, null, 2));
|
|
@@ -75648,6 +75651,8 @@ function updateAngularJson2(ctx) {
|
|
|
75648
75651
|
const angularJson = readJSON((0, import_node_path4.resolve)("angular.json"));
|
|
75649
75652
|
const architectSection = angularJson.projects[ctx.project.name].architect;
|
|
75650
75653
|
architectSection.build.options.outputPath = "dist";
|
|
75654
|
+
architectSection.build.options.outputMode = "server";
|
|
75655
|
+
architectSection.build.options.ssr.experimentalPlatform = "neutral";
|
|
75651
75656
|
architectSection.build.options.assets.push("src/_routes.json");
|
|
75652
75657
|
writeFile2((0, import_node_path4.resolve)("angular.json"), JSON.stringify(angularJson, null, 2));
|
|
75653
75658
|
s.stop(`${brandColor(`updated`)} ${dim(`\`angular.json\``)}`);
|
|
@@ -75669,7 +75674,7 @@ var config14 = {
|
|
|
75669
75674
|
scripts: {
|
|
75670
75675
|
start: `${npm10} run build && wrangler pages dev dist/cloudflare ${await compatDateFlag()} --experimental-local`,
|
|
75671
75676
|
build: `ng build && ${npm10} run process`,
|
|
75672
|
-
process: "node ./tools/copy-files.mjs
|
|
75677
|
+
process: "node ./tools/copy-files.mjs",
|
|
75673
75678
|
deploy: `${npm10} run build && wrangler pages deploy dist/cloudflare`
|
|
75674
75679
|
}
|
|
75675
75680
|
})
|
|
@@ -76790,7 +76795,7 @@ var config24 = {
|
|
|
76790
76795
|
configVersion: 1,
|
|
76791
76796
|
id: "svelte",
|
|
76792
76797
|
frameworkCli: "sv",
|
|
76793
|
-
displayName: "
|
|
76798
|
+
displayName: "SvelteKit",
|
|
76794
76799
|
platform: "pages",
|
|
76795
76800
|
copyFiles: {
|
|
76796
76801
|
variants: {
|
|
@@ -76845,7 +76850,7 @@ var config25 = {
|
|
|
76845
76850
|
var c3_default35 = config25;
|
|
76846
76851
|
|
|
76847
76852
|
// ../wrangler/package.json
|
|
76848
|
-
var version2 = "0.0.0-
|
|
76853
|
+
var version2 = "0.0.0-98d27250d";
|
|
76849
76854
|
|
|
76850
76855
|
// src/git.ts
|
|
76851
76856
|
var offerGit = async (ctx) => {
|
|
@@ -77934,6 +77939,9 @@ var processArgument = async (args, key, promptConfig) => {
|
|
|
77934
77939
|
};
|
|
77935
77940
|
|
|
77936
77941
|
// src/deploy.ts
|
|
77942
|
+
var import_promises4 = require("node:fs/promises");
|
|
77943
|
+
var import_node_os5 = require("node:os");
|
|
77944
|
+
var import_node_path5 = require("node:path");
|
|
77937
77945
|
var import_toml2 = __toESM(require_toml());
|
|
77938
77946
|
|
|
77939
77947
|
// src/helpers/poll.ts
|
|
@@ -79252,23 +79260,34 @@ var runDeploy = async (ctx) => {
|
|
|
79252
79260
|
JSON.stringify(ctx.commitMessage)
|
|
79253
79261
|
] : []
|
|
79254
79262
|
];
|
|
79255
|
-
const
|
|
79256
|
-
|
|
79263
|
+
const outputFile = (0, import_node_path5.join)(
|
|
79264
|
+
await (0, import_promises4.mkdtemp)((0, import_node_path5.join)((0, import_node_os5.tmpdir)(), "c3-wrangler-deploy-")),
|
|
79265
|
+
"output.json"
|
|
79266
|
+
);
|
|
79267
|
+
await runCommand(deployCmd, {
|
|
79257
79268
|
cwd: ctx.project.path,
|
|
79258
79269
|
env: {
|
|
79259
79270
|
CLOUDFLARE_ACCOUNT_ID: ctx.account.id,
|
|
79260
|
-
NODE_ENV: "production"
|
|
79271
|
+
NODE_ENV: "production",
|
|
79272
|
+
WRANGLER_OUTPUT_FILE_PATH: outputFile
|
|
79261
79273
|
},
|
|
79262
79274
|
startText: "Deploying your application",
|
|
79263
79275
|
doneText: `${brandColor("deployed")} ${dim(
|
|
79264
79276
|
`via \`${quoteShellArgs(baseDeployCmd)}\``
|
|
79265
79277
|
)}`
|
|
79266
79278
|
});
|
|
79267
|
-
|
|
79268
|
-
|
|
79269
|
-
|
|
79270
|
-
|
|
79271
|
-
|
|
79279
|
+
try {
|
|
79280
|
+
const contents = readFile(outputFile);
|
|
79281
|
+
const entries = contents.split("\n").filter(Boolean).map((entry) => JSON.parse(entry));
|
|
79282
|
+
const url = entries.find((entry) => entry.type === "deploy")?.targets?.[0] ?? entries.find((entry) => entry.type === "pages-deploy")?.url;
|
|
79283
|
+
const deployedUrlRegex = /https:\/\/.+\.(pages|workers)\.dev/;
|
|
79284
|
+
const deployedUrlMatch = url?.match(deployedUrlRegex);
|
|
79285
|
+
if (deployedUrlMatch) {
|
|
79286
|
+
ctx.deployment.url = deployedUrlMatch[0];
|
|
79287
|
+
} else {
|
|
79288
|
+
throw new Error("Failed to find deployment url.");
|
|
79289
|
+
}
|
|
79290
|
+
} catch {
|
|
79272
79291
|
throw new Error("Failed to find deployment url.");
|
|
79273
79292
|
}
|
|
79274
79293
|
if (ctx.deployment.url?.endsWith(".pages.dev")) {
|
|
@@ -79353,6 +79372,7 @@ var printSummary = (ctx) => {
|
|
|
79353
79372
|
]);
|
|
79354
79373
|
const documentationUrl = `https://developers.cloudflare.com/${ctx.template.platform}`;
|
|
79355
79374
|
const discordUrl = `https://discord.cloudflare.com`;
|
|
79375
|
+
const reportIssueUrl = "https://github.com/cloudflare/workers-sdk/issues/new/choose";
|
|
79356
79376
|
const lines = [
|
|
79357
79377
|
`\u{1F389} ${bgGreen(" SUCCESS ")} Application ${ctx.deployment.url ? "deployed" : "created"} successfully!`,
|
|
79358
79378
|
``
|
|
@@ -79374,6 +79394,9 @@ var printSummary = (ctx) => {
|
|
|
79374
79394
|
`\u{1F4D6} Explore Documentation`,
|
|
79375
79395
|
`${blue.underline(hyperlink(documentationUrl))}`,
|
|
79376
79396
|
``,
|
|
79397
|
+
`\u{1F41B} Report an Issue`,
|
|
79398
|
+
`${blue.underline(hyperlink(reportIssueUrl))}`,
|
|
79399
|
+
``,
|
|
79377
79400
|
`\u{1F4AC} Join our Community`,
|
|
79378
79401
|
`${blue.underline(hyperlink(discordUrl))}`
|
|
79379
79402
|
);
|