create-cloudflare 0.0.0-eb76082b → 0.0.0-ed40cf84

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
@@ -3814,7 +3814,7 @@ var init_args = __esm({
3814
3814
  var version, devDependencies;
3815
3815
  var init_package = __esm({
3816
3816
  "package.json"() {
3817
- version = "0.0.0-eb76082b";
3817
+ version = "0.0.0-ed40cf84";
3818
3818
  devDependencies = {
3819
3819
  "@babel/parser": "^7.21.3",
3820
3820
  "@babel/types": "^7.21.4",
@@ -24217,15 +24217,15 @@ var init_package2 = __esm({
24217
24217
  "additionally it also contains a map that maps frameworks to their respective clis"
24218
24218
  ],
24219
24219
  dependencies: {
24220
- "create-astro": "4.7.1",
24220
+ "create-astro": "4.7.2",
24221
24221
  "@angular/create": "17.1.1",
24222
- "create-docusaurus": "3.1.0",
24222
+ "create-docusaurus": "3.1.1",
24223
24223
  "create-hono": "0.3.2",
24224
- "create-next-app": "14.0.4",
24225
- "create-qwik": "1.4.1",
24224
+ "create-next-app": "14.1.0",
24225
+ "create-qwik": "1.4.2",
24226
24226
  "create-react-app": "5.0.1",
24227
24227
  "create-remix": "2.5.1",
24228
- "create-solid": "0.3.10",
24228
+ "create-solid": "0.4.10",
24229
24229
  "create-svelte": "6.0.8",
24230
24230
  "create-vue": "3.9.1",
24231
24231
  gatsby: "5.13.3",
@@ -33743,10 +33743,10 @@ var require_index_688c5d50 = __commonJS({
33743
33743
  }
33744
33744
  } : (path4, uid, gid) => lchownSync(path4, uid, gid);
33745
33745
  var nodeVersion2 = process.version;
33746
- var readdir2 = (path4, options, cb) => fs__default["default"].readdir(path4, options, cb);
33746
+ var readdir = (path4, options, cb) => fs__default["default"].readdir(path4, options, cb);
33747
33747
  var readdirSync4 = (path4, options) => fs__default["default"].readdirSync(path4, options);
33748
33748
  if (/^v4\./.test(nodeVersion2))
33749
- readdir2 = (path4, options, cb) => fs__default["default"].readdir(path4, cb);
33749
+ readdir = (path4, options, cb) => fs__default["default"].readdir(path4, cb);
33750
33750
  var chown = (cpath, uid, gid, cb) => {
33751
33751
  fs__default["default"][LCHOWN](cpath, uid, gid, handleEISDIR(cpath, uid, gid, (er) => {
33752
33752
  cb(er && er.code !== "ENOENT" ? er : null);
@@ -33773,7 +33773,7 @@ var require_index_688c5d50 = __commonJS({
33773
33773
  }
33774
33774
  };
33775
33775
  var chownr = (p2, uid, gid, cb) => {
33776
- readdir2(p2, { withFileTypes: true }, (er, children) => {
33776
+ readdir(p2, { withFileTypes: true }, (er, children) => {
33777
33777
  if (er) {
33778
33778
  if (er.code === "ENOENT")
33779
33779
  return cb();
@@ -36650,8 +36650,8 @@ var require_index_688c5d50 = __commonJS({
36650
36650
  }
36651
36651
  }
36652
36652
  var fs$readdir = fs3.readdir;
36653
- fs3.readdir = readdir3;
36654
- function readdir3(path4, options, cb) {
36653
+ fs3.readdir = readdir2;
36654
+ function readdir2(path4, options, cb) {
36655
36655
  var args = [path4];
36656
36656
  if (typeof options !== "function") {
36657
36657
  args.push(options);
@@ -40942,7 +40942,7 @@ var c3_exports = {};
40942
40942
  __export(c3_exports, {
40943
40943
  default: () => c3_default
40944
40944
  });
40945
- async function installCFWorker(ctx) {
40945
+ async function installCFWorker() {
40946
40946
  await installPackages(
40947
40947
  ["@cloudflare/workers-types", "@miniflare/tre@next", "wrangler@beta"],
40948
40948
  {
@@ -40999,7 +40999,7 @@ var init_c3 = __esm({
40999
40999
  configure = async (ctx) => {
41000
41000
  updateAngularJson(ctx);
41001
41001
  await updateAppCode();
41002
- await installCFWorker(ctx);
41002
+ await installCFWorker();
41003
41003
  };
41004
41004
  config = {
41005
41005
  configVersion: 1,
@@ -41045,7 +41045,7 @@ var init_c32 = __esm({
41045
41045
  await runFrameworkGenerator(ctx, [ctx.project.name, "--no-install"]);
41046
41046
  logRaw("");
41047
41047
  };
41048
- configure2 = async (ctx) => {
41048
+ configure2 = async () => {
41049
41049
  await runCommand([npx2, "astro", "add", "cloudflare", "-y"], {
41050
41050
  silent: true,
41051
41051
  startText: "Installing adapter",
@@ -41371,30 +41371,30 @@ const styles = {
41371
41371
  },
41372
41372
  } as const;
41373
41373
  `;
41374
- nextConfig = `/** @type {import('next').NextConfig} */
41375
- const nextConfig = {}
41374
+ nextConfig = `import { setupDevBindings } from '@cloudflare/next-on-pages/next-dev';
41376
41375
 
41377
- module.exports = nextConfig
41376
+ /** @type {import('next').NextConfig} */
41377
+ const nextConfig = {};
41378
41378
 
41379
41379
  // Here we use the @cloudflare/next-on-pages next-dev module to allow us to use bindings during local development
41380
41380
  // (when running the application with \`next dev\`), for more information see:
41381
- // https://github.com/dario-piotrowicz/next-on-pages/blob/8e93067/internal-packages/next-dev/README.md
41381
+ // https://github.com/cloudflare/next-on-pages/blob/8e93067/internal-packages/next-dev/README.md
41382
41382
  if (process.env.NODE_ENV === 'development') {
41383
- import('@cloudflare/next-on-pages/next-dev').then(({ setupDevBindings }) => {
41384
- setupDevBindings({
41385
- bindings: {
41386
- // Add here the Cloudflare Bindings you want to have available during local development,
41387
- // for more details on Bindings see: https://developers.cloudflare.com/pages/functions/bindings/)
41388
- //
41389
- // KV Example:
41390
- // MY_KV: {
41391
- // type: 'kv',
41392
- // id: 'xxx',
41393
- // }
41394
- }
41395
- })
41396
- })
41383
+ await setupDevBindings({
41384
+ bindings: {
41385
+ // Add here the Cloudflare Bindings you want to have available during local development,
41386
+ // for more details on Bindings see: https://developers.cloudflare.com/pages/functions/bindings/)
41387
+ //
41388
+ // KV Example:
41389
+ // MY_KV: {
41390
+ // type: 'kv',
41391
+ // id: 'xxx',
41392
+ // }
41393
+ }
41394
+ });
41397
41395
  }
41396
+
41397
+ export default nextConfig;
41398
41398
  `;
41399
41399
  envDts = `declare global {
41400
41400
  namespace NodeJS {
@@ -41544,7 +41544,7 @@ var init_c36 = __esm({
41544
41544
  if (installEslintPlugin) {
41545
41545
  await writeEslintrc(ctx);
41546
41546
  }
41547
- writeFile2(`${projectPath}/next.config.js`, nextConfig);
41547
+ writeFile2(`${projectPath}/next.config.mjs`, nextConfig);
41548
41548
  updateStatus("Updated the next.config.js file");
41549
41549
  writeFile2(`${projectPath}/README.md`, readme);
41550
41550
  updateStatus("Updated the README file");
@@ -41660,7 +41660,7 @@ var init_c37 = __esm({
41660
41660
  writeFile2("./.node-version", "17");
41661
41661
  logRaw("");
41662
41662
  };
41663
- configure4 = async (ctx) => {
41663
+ configure4 = async () => {
41664
41664
  const configFileName = "nuxt.config.ts";
41665
41665
  const configFilePath = (0, import_node_path2.resolve)(configFileName);
41666
41666
  const s = spinner();
@@ -41708,7 +41708,7 @@ var init_c38 = __esm({
41708
41708
  generate8 = async (ctx) => {
41709
41709
  await runFrameworkGenerator(ctx, ["basic", ctx.project.name]);
41710
41710
  };
41711
- configure5 = async (ctx) => {
41711
+ configure5 = async () => {
41712
41712
  const cmd = [npx4, "qwik", "add", "cloudflare-pages"];
41713
41713
  endSection(`Running ${quoteShellArgs(cmd)}`);
41714
41714
  await runCommand(cmd);
@@ -73014,7 +73014,7 @@ var init_c312 = __esm({
73014
73014
  configure: configure6,
73015
73015
  transformPackageJson: async () => ({
73016
73016
  scripts: {
73017
- "pages:preview": `${npm12} run build && wrangler pages dev .svelte-kit/cloudflare`,
73017
+ "pages:preview": `${npm12} run build && wrangler pages dev ${await compatDateFlag()} .svelte-kit/cloudflare`,
73018
73018
  "pages:deploy": `${npm12} run build && wrangler pages deploy .svelte-kit/cloudflare`
73019
73019
  }
73020
73020
  }),
@@ -73220,7 +73220,7 @@ __export(c3_exports20, {
73220
73220
  default: () => c3_default20
73221
73221
  });
73222
73222
  async function copyExistingWorkerFiles(ctx) {
73223
- const { dlx, npm: npm15 } = detectPackageManager();
73223
+ const { dlx } = detectPackageManager();
73224
73224
  await chooseAccount(ctx);
73225
73225
  if (ctx.args.existingScript === void 0) {
73226
73226
  ctx.args.existingScript = await processArgument(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-cloudflare",
3
- "version": "0.0.0-eb76082b",
3
+ "version": "0.0.0-ed40cf84",
4
4
  "description": "A CLI for creating and deploying new applications to Cloudflare.",
5
5
  "keywords": [
6
6
  "cloudflare",
@@ -1,4 +1,3 @@
1
- import { cp } from "node:fs/promises";
2
1
  import { resolve } from "node:path";
3
2
  import { logRaw } from "@cloudflare/cli";
4
3
  import { brandColor, dim } from "@cloudflare/cli/colors";
@@ -19,10 +18,10 @@ const generate = async (ctx: C3Context) => {
19
18
  const configure = async (ctx: C3Context) => {
20
19
  updateAngularJson(ctx);
21
20
  await updateAppCode();
22
- await installCFWorker(ctx);
21
+ await installCFWorker();
23
22
  };
24
23
 
25
- async function installCFWorker(ctx: C3Context) {
24
+ async function installCFWorker() {
26
25
  await installPackages(
27
26
  ["@cloudflare/workers-types", "@miniflare/tre@next", "wrangler@beta"],
28
27
  {
@@ -14,7 +14,7 @@ const generate = async (ctx: C3Context) => {
14
14
  logRaw(""); // newline
15
15
  };
16
16
 
17
- const configure = async (ctx: C3Context) => {
17
+ const configure = async () => {
18
18
  await runCommand([npx, "astro", "add", "cloudflare", "-y"], {
19
19
  silent: true,
20
20
  startText: "Installing adapter",
@@ -112,7 +112,7 @@ const configure = async (ctx: C3Context) => {
112
112
  await writeEslintrc(ctx);
113
113
  }
114
114
 
115
- writeFile(`${projectPath}/next.config.js`, nextConfig);
115
+ writeFile(`${projectPath}/next.config.mjs`, nextConfig);
116
116
  updateStatus("Updated the next.config.js file");
117
117
 
118
118
  writeFile(`${projectPath}/README.md`, readme);
@@ -180,30 +180,30 @@ const styles = {
180
180
  } as const;
181
181
  `;
182
182
 
183
- export const nextConfig = `/** @type {import('next').NextConfig} */
184
- const nextConfig = {}
183
+ export const nextConfig = `import { setupDevBindings } from '@cloudflare/next-on-pages/next-dev';
185
184
 
186
- module.exports = nextConfig
185
+ /** @type {import('next').NextConfig} */
186
+ const nextConfig = {};
187
187
 
188
188
  // Here we use the @cloudflare/next-on-pages next-dev module to allow us to use bindings during local development
189
189
  // (when running the application with \`next dev\`), for more information see:
190
- // https://github.com/dario-piotrowicz/next-on-pages/blob/8e93067/internal-packages/next-dev/README.md
190
+ // https://github.com/cloudflare/next-on-pages/blob/8e93067/internal-packages/next-dev/README.md
191
191
  if (process.env.NODE_ENV === 'development') {
192
- import('@cloudflare/next-on-pages/next-dev').then(({ setupDevBindings }) => {
193
- setupDevBindings({
194
- bindings: {
195
- // Add here the Cloudflare Bindings you want to have available during local development,
196
- // for more details on Bindings see: https://developers.cloudflare.com/pages/functions/bindings/)
197
- //
198
- // KV Example:
199
- // MY_KV: {
200
- // type: 'kv',
201
- // id: 'xxx',
202
- // }
203
- }
204
- })
205
- })
192
+ await setupDevBindings({
193
+ bindings: {
194
+ // Add here the Cloudflare Bindings you want to have available during local development,
195
+ // for more details on Bindings see: https://developers.cloudflare.com/pages/functions/bindings/)
196
+ //
197
+ // KV Example:
198
+ // MY_KV: {
199
+ // type: 'kv',
200
+ // id: 'xxx',
201
+ // }
202
+ }
203
+ });
206
204
  }
205
+
206
+ export default nextConfig;
207
207
  `;
208
208
 
209
209
  export const envDts = `declare global {
@@ -27,7 +27,7 @@ const generate = async (ctx: C3Context) => {
27
27
  logRaw(""); // newline
28
28
  };
29
29
 
30
- const configure = async (ctx: C3Context) => {
30
+ const configure = async () => {
31
31
  const configFileName = "nuxt.config.ts";
32
32
  const configFilePath = resolve(configFileName);
33
33
  const s = spinner();
@@ -1,7 +1,6 @@
1
- import { cp, mkdtemp, readdir, rm } from "fs/promises";
1
+ import { cp, mkdtemp } from "fs/promises";
2
2
  import { tmpdir } from "os";
3
3
  import { join } from "path";
4
- import { crash } from "@cloudflare/cli";
5
4
  import { processArgument } from "@cloudflare/cli/args";
6
5
  import { brandColor, dim } from "@cloudflare/cli/colors";
7
6
  import { runCommand } from "helpers/command";
@@ -10,7 +9,7 @@ import { chooseAccount } from "../../src/common";
10
9
  import type { C3Context } from "types";
11
10
 
12
11
  export async function copyExistingWorkerFiles(ctx: C3Context) {
13
- const { dlx, npm } = detectPackageManager();
12
+ const { dlx } = detectPackageManager();
14
13
 
15
14
  await chooseAccount(ctx);
16
15
 
@@ -12,7 +12,7 @@ const generate = async (ctx: C3Context) => {
12
12
  await runFrameworkGenerator(ctx, ["basic", ctx.project.name]);
13
13
  };
14
14
 
15
- const configure = async (ctx: C3Context) => {
15
+ const configure = async () => {
16
16
  // Add the pages integration
17
17
  const cmd = [npx, "qwik", "add", "cloudflare-pages"];
18
18
  endSection(`Running ${quoteShellArgs(cmd)}`);
@@ -1,6 +1,5 @@
1
- import { logRaw, updateStatus } from "@cloudflare/cli";
2
- import { blue, brandColor, dim } from "@cloudflare/cli/colors";
3
- import { installPackages, runFrameworkGenerator } from "helpers/command";
1
+ import { logRaw } from "@cloudflare/cli";
2
+ import { runFrameworkGenerator } from "helpers/command";
4
3
  import { compatDateFlag } from "helpers/files";
5
4
  import { detectPackageManager } from "helpers/packages";
6
5
  import type { TemplateConfig } from "../../src/templates";
@@ -67,7 +67,7 @@ const config: TemplateConfig = {
67
67
  configure,
68
68
  transformPackageJson: async () => ({
69
69
  scripts: {
70
- "pages:preview": `${npm} run build && wrangler pages dev .svelte-kit/cloudflare`,
70
+ "pages:preview": `${npm} run build && wrangler pages dev ${await compatDateFlag()} .svelte-kit/cloudflare`,
71
71
  "pages:deploy": `${npm} run build && wrangler pages deploy .svelte-kit/cloudflare`,
72
72
  },
73
73
  }),