create-cloudflare 0.0.0-941d4110c → 0.0.0-9435af0b9

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
@@ -73725,7 +73725,7 @@ var Yargs = YargsFactory(esm_default);
73725
73725
  var yargs_default = Yargs;
73726
73726
 
73727
73727
  // package.json
73728
- var version = "0.0.0-941d4110c";
73728
+ var version = "0.0.0-9435af0b9";
73729
73729
 
73730
73730
  // src/metrics.ts
73731
73731
  var import_node_async_hooks = require("node:async_hooks");
@@ -73817,6 +73817,13 @@ var runCommand = async (command2, opts = {}) => {
73817
73817
  doneText: opts.doneText,
73818
73818
  promise() {
73819
73819
  const [executable, ...args] = command2;
73820
+ if (args[0] === "wrangler") {
73821
+ const metrics = readMetricsConfig();
73822
+ if (metrics.c3permission?.enabled === false) {
73823
+ opts.env ??= {};
73824
+ opts.env["WRANGLER_SEND_METRICS"] = "false";
73825
+ }
73826
+ }
73820
73827
  const abortController = new AbortController();
73821
73828
  const cmd = (0, import_cross_spawn.spawn)(executable, [...args], {
73822
73829
  // TODO: ideally inherit stderr, but npm install uses this for warnings
@@ -74482,11 +74489,11 @@ var package_default = {
74482
74489
  dependencies: {
74483
74490
  "create-astro": "4.10.0",
74484
74491
  "create-analog": "1.8.1",
74485
- "@angular/create": "18.2.11",
74492
+ "@angular/create": "19.0.0",
74486
74493
  "create-docusaurus": "3.6.1",
74487
74494
  "create-hono": "0.14.2",
74488
74495
  "create-next-app": "14.2.5",
74489
- "create-qwik": "1.9.1",
74496
+ "create-qwik": "1.11.0",
74490
74497
  "create-vite": "5.5.5",
74491
74498
  "create-remix": "2.14.0",
74492
74499
  "create-solid": "0.5.13",
@@ -74526,7 +74533,11 @@ var runFrameworkGenerator = async (ctx, args) => {
74526
74533
  // templates-experimental/angular/c3.ts
74527
74534
  var { npm } = detectPackageManager();
74528
74535
  var generate = async (ctx) => {
74529
- await runFrameworkGenerator(ctx, [ctx.project.name, "--ssr"]);
74536
+ await runFrameworkGenerator(ctx, [
74537
+ ctx.project.name,
74538
+ "--ssr",
74539
+ "--server-routing"
74540
+ ]);
74530
74541
  logRaw("");
74531
74542
  };
74532
74543
  var configure = async (ctx) => {
@@ -74535,9 +74546,9 @@ var configure = async (ctx) => {
74535
74546
  await installCFWorker();
74536
74547
  };
74537
74548
  async function installCFWorker() {
74538
- await installPackages(["@cloudflare/workers-types", "wrangler"], {
74549
+ await installPackages(["xhr2"], {
74539
74550
  dev: true,
74540
- startText: "Installing adapter dependencies",
74551
+ startText: "Installing additional dependencies",
74541
74552
  doneText: `${brandColor("installed")} ${dim(`via \`${npm} install\``)}`
74542
74553
  });
74543
74554
  }
@@ -74552,10 +74563,17 @@ async function updateAppCode() {
74552
74563
  );
74553
74564
  writeFile2((0, import_node_path3.resolve)(appConfigPath), newAppConfig);
74554
74565
  s.stop(`${brandColor(`updated`)} ${dim(appConfigPath)}`);
74566
+ const appServerRoutesPath = "src/app/app.routes.server.ts";
74567
+ const appRoutes = readFile((0, import_node_path3.resolve)(appServerRoutesPath));
74568
+ const newAppRoutes = appRoutes.replace(
74569
+ "RenderMode.Prerender",
74570
+ "RenderMode.Server"
74571
+ );
74572
+ writeFile2((0, import_node_path3.resolve)(appServerRoutesPath), newAppRoutes);
74573
+ s.stop(`${brandColor(`updated`)} ${dim(appServerRoutesPath)}`);
74555
74574
  s.start(`Updating package.json`);
74556
74575
  const packageJsonPath = (0, import_node_path3.resolve)("package.json");
74557
74576
  const packageManifest = readJSON(packageJsonPath);
74558
- delete packageManifest["dependencies"]["@angular/ssr"];
74559
74577
  delete packageManifest["dependencies"]["express"];
74560
74578
  delete packageManifest["devDependencies"]["@types/express"];
74561
74579
  writeFile2(packageJsonPath, JSON.stringify(packageManifest, null, 2));
@@ -74567,7 +74585,8 @@ function updateAngularJson(ctx) {
74567
74585
  const angularJson = readJSON((0, import_node_path3.resolve)("angular.json"));
74568
74586
  const architectSection = angularJson.projects[ctx.project.name].architect;
74569
74587
  architectSection.build.options.outputPath = "dist";
74570
- architectSection.build.options.assets.push("src/_routes.json");
74588
+ architectSection.build.options.outputMode = "server";
74589
+ architectSection.build.options.ssr.experimentalPlatform = "neutral";
74571
74590
  writeFile2((0, import_node_path3.resolve)("angular.json"), JSON.stringify(angularJson, null, 2));
74572
74591
  s.stop(`${brandColor(`updated`)} ${dim(`\`angular.json\``)}`);
74573
74592
  }
@@ -74583,13 +74602,13 @@ var config = {
74583
74602
  path: "templates-experimental/angular",
74584
74603
  devScript: "start",
74585
74604
  deployScript: "deploy",
74605
+ previewScript: "start",
74586
74606
  generate,
74587
74607
  configure,
74588
74608
  transformPackageJson: async () => ({
74589
74609
  scripts: {
74590
74610
  start: `${npm} run build && wrangler dev`,
74591
- build: `ng build && ${npm} run process`,
74592
- process: "node ./tools/alter-polyfills.mjs",
74611
+ build: `ng build`,
74593
74612
  deploy: `${npm} run build && wrangler deploy`
74594
74613
  }
74595
74614
  })
@@ -75069,7 +75088,7 @@ var updateNuxtConfig = () => {
75069
75088
  b2.objectExpression([
75070
75089
  b2.objectProperty(
75071
75090
  b2.identifier("preset"),
75072
- b2.stringLiteral("./cloudflare-preset")
75091
+ b2.stringLiteral("cloudflare_module")
75073
75092
  )
75074
75093
  ])
75075
75094
  );
@@ -75285,6 +75304,7 @@ var configure7 = async (ctx) => {
75285
75304
  });
75286
75305
  usesTypescript(ctx);
75287
75306
  const filePath = `app.config.${usesTypescript(ctx) ? "ts" : "js"}`;
75307
+ const compatDate = await getWorkerdCompatibilityDate();
75288
75308
  updateStatus(`Updating configuration in ${blue(filePath)}`);
75289
75309
  transformFile(filePath, {
75290
75310
  visitCallExpression: function(n2) {
@@ -75299,60 +75319,14 @@ var configure7 = async (ctx) => {
75299
75319
  b2.objectProperty(
75300
75320
  b2.identifier("server"),
75301
75321
  b2.objectExpression([
75302
- // preset: "cloudflare-pages"
75322
+ // preset: "cloudflare_module"
75303
75323
  b2.objectProperty(
75304
75324
  b2.identifier("preset"),
75305
- b2.stringLiteral("cloudflare-pages")
75306
- ),
75307
- // output: {
75308
- // dir: "{{ rootDir }}/dist",
75309
- // publicDir: "{{ output.dir }}/public",
75310
- // serverDir: "{{ output.dir }}/worker",
75311
- // },
75312
- b2.objectProperty(
75313
- b2.identifier("output"),
75314
- b2.objectExpression([
75315
- b2.objectProperty(
75316
- b2.identifier("dir"),
75317
- b2.stringLiteral("{{ rootDir }}/dist")
75318
- ),
75319
- b2.objectProperty(
75320
- b2.identifier("publicDir"),
75321
- b2.stringLiteral("{{ output.dir }}/public")
75322
- ),
75323
- b2.objectProperty(
75324
- b2.identifier("serverDir"),
75325
- b2.stringLiteral("{{ output.dir }}/worker")
75326
- )
75327
- ])
75328
- ),
75329
- // rollupConfig: {
75330
- // external: ["node:async_hooks"],
75331
- // },
75332
- b2.objectProperty(
75333
- b2.identifier("rollupConfig"),
75334
- b2.objectExpression([
75335
- b2.objectProperty(
75336
- b2.identifier("external"),
75337
- b2.arrayExpression([b2.stringLiteral("node:async_hooks")])
75338
- )
75339
- ])
75325
+ b2.stringLiteral("cloudflare_module")
75340
75326
  ),
75341
- // hooks: {
75342
- // // Prevent the Pages preset from writing the _routes.json etc.
75343
- // compiled() {},
75344
- // },
75345
75327
  b2.objectProperty(
75346
- b2.identifier("hooks"),
75347
- b2.objectExpression([
75348
- b2.objectMethod(
75349
- "method",
75350
- b2.identifier("compiled"),
75351
- [],
75352
- b2.blockStatement([]),
75353
- false
75354
- )
75355
- ])
75328
+ b2.identifier("compatibilityDate"),
75329
+ b2.stringLiteral(compatDate)
75356
75330
  )
75357
75331
  ])
75358
75332
  )
@@ -75596,7 +75570,11 @@ var c3_default15 = config13;
75596
75570
  var import_node_path4 = require("node:path");
75597
75571
  var { npm: npm10 } = detectPackageManager();
75598
75572
  var generate13 = async (ctx) => {
75599
- await runFrameworkGenerator(ctx, [ctx.project.name, "--ssr"]);
75573
+ await runFrameworkGenerator(ctx, [
75574
+ ctx.project.name,
75575
+ "--ssr",
75576
+ "--server-routing"
75577
+ ]);
75600
75578
  logRaw("");
75601
75579
  };
75602
75580
  var configure10 = async (ctx) => {
@@ -75605,14 +75583,11 @@ var configure10 = async (ctx) => {
75605
75583
  await installCFWorker2();
75606
75584
  };
75607
75585
  async function installCFWorker2() {
75608
- await installPackages(
75609
- ["@cloudflare/workers-types", "@miniflare/tre@next", "wrangler@beta"],
75610
- {
75611
- dev: true,
75612
- startText: "Installing adapter dependencies",
75613
- doneText: `${brandColor("installed")} ${dim(`via \`${npm10} install\``)}`
75614
- }
75615
- );
75586
+ await installPackages(["xhr2"], {
75587
+ dev: true,
75588
+ startText: "Installing additional dependencies",
75589
+ doneText: `${brandColor("installed")} ${dim(`via \`${npm10} install\``)}`
75590
+ });
75616
75591
  }
75617
75592
  async function updateAppCode2() {
75618
75593
  const s = spinner();
@@ -75625,10 +75600,17 @@ async function updateAppCode2() {
75625
75600
  );
75626
75601
  writeFile2((0, import_node_path4.resolve)(appConfigPath), newAppConfig);
75627
75602
  s.stop(`${brandColor(`updated`)} ${dim(appConfigPath)}`);
75603
+ const appServerRoutesPath = "src/app/app.routes.server.ts";
75604
+ const appRoutes = readFile((0, import_node_path4.resolve)(appServerRoutesPath));
75605
+ const newAppRoutes = appRoutes.replace(
75606
+ "RenderMode.Prerender",
75607
+ "RenderMode.Server"
75608
+ );
75609
+ writeFile2((0, import_node_path4.resolve)(appServerRoutesPath), newAppRoutes);
75610
+ s.stop(`${brandColor(`updated`)} ${dim(appServerRoutesPath)}`);
75628
75611
  s.start(`Updating package.json`);
75629
75612
  const packageJsonPath = (0, import_node_path4.resolve)("package.json");
75630
75613
  const packageManifest = readJSON(packageJsonPath);
75631
- delete packageManifest["dependencies"]["@angular/ssr"];
75632
75614
  delete packageManifest["dependencies"]["express"];
75633
75615
  delete packageManifest["devDependencies"]["@types/express"];
75634
75616
  writeFile2(packageJsonPath, JSON.stringify(packageManifest, null, 2));
@@ -75640,6 +75622,8 @@ function updateAngularJson2(ctx) {
75640
75622
  const angularJson = readJSON((0, import_node_path4.resolve)("angular.json"));
75641
75623
  const architectSection = angularJson.projects[ctx.project.name].architect;
75642
75624
  architectSection.build.options.outputPath = "dist";
75625
+ architectSection.build.options.outputMode = "server";
75626
+ architectSection.build.options.ssr.experimentalPlatform = "neutral";
75643
75627
  architectSection.build.options.assets.push("src/_routes.json");
75644
75628
  writeFile2((0, import_node_path4.resolve)("angular.json"), JSON.stringify(angularJson, null, 2));
75645
75629
  s.stop(`${brandColor(`updated`)} ${dim(`\`angular.json\``)}`);
@@ -75655,13 +75639,14 @@ var config14 = {
75655
75639
  },
75656
75640
  devScript: "start",
75657
75641
  deployScript: "deploy",
75642
+ previewScript: "start",
75658
75643
  generate: generate13,
75659
75644
  configure: configure10,
75660
75645
  transformPackageJson: async () => ({
75661
75646
  scripts: {
75662
- start: `${npm10} run build && wrangler pages dev dist/cloudflare ${await compatDateFlag()} --experimental-local`,
75647
+ start: `${npm10} run build && wrangler pages dev dist/cloudflare ${await compatDateFlag()}`,
75663
75648
  build: `ng build && ${npm10} run process`,
75664
- process: "node ./tools/copy-files.mjs && node ./tools/alter-polyfills.mjs",
75649
+ process: "node ./tools/copy-files.mjs",
75665
75650
  deploy: `${npm10} run build && wrangler pages deploy dist/cloudflare`
75666
75651
  }
75667
75652
  })
@@ -76837,7 +76822,7 @@ var config25 = {
76837
76822
  var c3_default35 = config25;
76838
76823
 
76839
76824
  // ../wrangler/package.json
76840
- var version2 = "0.0.0-941d4110c";
76825
+ var version2 = "0.0.0-9435af0b9";
76841
76826
 
76842
76827
  // src/git.ts
76843
76828
  var offerGit = async (ctx) => {