Skip to content

Commit 12a018f

Browse files
committed
Initialize web application via create-cloudflare CLI
Details: C3 = create-cloudflare@2.49.0 project name = md-chat framework = next framework cli = create-next-app@15.3.3 package manager = bun@1.2.15 wrangler = wrangler@4.19.1 git = 2.49.0.windows.1
1 parent 3835454 commit 12a018f

File tree

10 files changed

+7796
-59
lines changed

10 files changed

+7796
-59
lines changed

.gitignore

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,8 @@
33
# dependencies
44
/node_modules
55
/.pnp
6-
.pnp.*
7-
.yarn/*
8-
!.yarn/patches
9-
!.yarn/plugins
10-
!.yarn/releases
11-
!.yarn/versions
6+
.pnp.js
7+
.yarn/install-state.gz
128

139
# testing
1410
/coverage
@@ -28,14 +24,20 @@
2824
npm-debug.log*
2925
yarn-debug.log*
3026
yarn-error.log*
31-
.pnpm-debug.log*
3227

33-
# env files (can opt-in for committing if needed)
34-
.env*
28+
# local env files
29+
.env*.local
3530

3631
# vercel
3732
.vercel
3833

3934
# typescript
4035
*.tsbuildinfo
4136
next-env.d.ts
37+
38+
# OpenNext
39+
/.open-next
40+
41+
# wrangler files
42+
.wrangler
43+
.dev.vars*

.vscode/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"files.associations": {
3+
"wrangler.json": "jsonc"
4+
}
5+
}

bun.lock

Lines changed: 1922 additions & 26 deletions
Large diffs are not rendered by default.

cloudflare-env.d.ts

Lines changed: 5754 additions & 0 deletions
Large diffs are not rendered by default.

next.config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@ const nextConfig: NextConfig = {
55
};
66

77
export default nextConfig;
8+
9+
// added by create cloudflare to enable calling `getCloudflareContext()` in `next dev`
10+
import { initOpenNextCloudflareForDev } from '@opennextjs/cloudflare';
11+
initOpenNextCloudflareForDev();

open-next.config.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { defineCloudflareConfig } from "@opennextjs/cloudflare";
2+
3+
export default defineCloudflareConfig({
4+
// Uncomment to enable R2 cache,
5+
// It should be imported as:
6+
// `import r2IncrementalCache from "@opennextjs/cloudflare/overrides/incremental-cache/r2-incremental-cache";`
7+
// See https://opennext.js.org/cloudflare/caching for more details
8+
// incrementalCache: r2IncrementalCache,
9+
});

package.json

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,29 @@
11
{
2-
"name": "md-chat",
3-
"version": "0.1.0",
4-
"private": true,
5-
"scripts": {
6-
"dev": "next dev --turbopack",
7-
"build": "next build",
8-
"start": "next start",
9-
"lint": "next lint"
10-
},
11-
"dependencies": {
12-
"react": "^19.0.0",
13-
"react-dom": "^19.0.0",
14-
"next": "15.3.3"
15-
},
16-
"devDependencies": {
17-
"typescript": "^5",
18-
"@types/node": "^20",
19-
"@types/react": "^19",
20-
"@types/react-dom": "^19",
21-
"@tailwindcss/postcss": "^4",
22-
"tailwindcss": "^4"
23-
}
24-
}
2+
"name": "md-chat",
3+
"version": "0.1.0",
4+
"private": true,
5+
"scripts": {
6+
"dev": "next dev --turbopack",
7+
"build": "next build",
8+
"start": "next start",
9+
"lint": "next lint",
10+
"deploy": "opennextjs-cloudflare build && opennextjs-cloudflare deploy",
11+
"preview": "opennextjs-cloudflare build && opennextjs-cloudflare preview",
12+
"cf-typegen": "wrangler types --env-interface CloudflareEnv ./cloudflare-env.d.ts"
13+
},
14+
"dependencies": {
15+
"@opennextjs/cloudflare": "^1.0.2",
16+
"next": "15.3.3",
17+
"react": "^19.0.0",
18+
"react-dom": "^19.0.0"
19+
},
20+
"devDependencies": {
21+
"@tailwindcss/postcss": "^4",
22+
"@types/node": "^22.15.30",
23+
"@types/react": "^19",
24+
"@types/react-dom": "^19",
25+
"tailwindcss": "^4",
26+
"typescript": "^5",
27+
"wrangler": "^4.19.1"
28+
}
29+
}

public/_headers

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# https://developers.cloudflare.com/workers/static-assets/headers
2+
/_next/static/*
3+
Cache-Control: public,max-age=31536000,immutable

tsconfig.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@
2020
],
2121
"paths": {
2222
"@/*": ["./src/*"]
23-
}
23+
},
24+
"types": [
25+
"./cloudflare-env.d.ts",
26+
"node"
27+
]
2428
},
2529
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
2630
"exclude": ["node_modules"]

wrangler.jsonc

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/**
2+
* For more details on how to configure Wrangler, refer to:
3+
* https://developers.cloudflare.com/workers/wrangler/configuration/
4+
*/
5+
{
6+
"$schema": "node_modules/wrangler/config-schema.json",
7+
"name": "md-chat",
8+
"main": ".open-next/worker.js",
9+
"compatibility_date": "2025-03-01",
10+
"compatibility_flags": [
11+
"nodejs_compat",
12+
"global_fetch_strictly_public"
13+
],
14+
"assets": {
15+
"binding": "ASSETS",
16+
"directory": ".open-next/assets"
17+
},
18+
"observability": {
19+
"enabled": true
20+
}
21+
/**
22+
* Smart Placement
23+
* Docs: https://developers.cloudflare.com/workers/configuration/smart-placement/#smart-placement
24+
*/
25+
// "placement": { "mode": "smart" },
26+
27+
/**
28+
* Bindings
29+
* Bindings allow your Worker to interact with resources on the Cloudflare Developer Platform, including
30+
* databases, object storage, AI inference, real-time communication and more.
31+
* https://developers.cloudflare.com/workers/runtime-apis/bindings/
32+
*/
33+
34+
/**
35+
* Environment Variables
36+
* https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables
37+
*/
38+
// "vars": { "MY_VARIABLE": "production_value" },
39+
/**
40+
* Note: Use secrets to store sensitive data.
41+
* https://developers.cloudflare.com/workers/configuration/secrets/
42+
*/
43+
44+
/**
45+
* Static Assets
46+
* https://developers.cloudflare.com/workers/static-assets/binding/
47+
*/
48+
// "assets": { "directory": "./public/", "binding": "ASSETS" },
49+
50+
/**
51+
* Service Bindings (communicate between multiple Workers)
52+
* https://developers.cloudflare.com/workers/wrangler/configuration/#service-bindings
53+
*/
54+
// "services": [{ "binding": "MY_SERVICE", "service": "my-service" }]
55+
}

0 commit comments

Comments
 (0)