create-cloudflare 2.67.1 → 2.67.3

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.
Files changed (35) hide show
  1. package/dist/cli.js +2898 -2889
  2. package/package.json +7 -7
  3. package/templates/analog/c3.ts +2 -2
  4. package/templates/angular/pages/c3.ts +3 -3
  5. package/templates/angular/workers/c3.ts +3 -3
  6. package/templates/astro/pages/c3.ts +3 -3
  7. package/templates/astro/workers/c3.ts +3 -3
  8. package/templates/gatsby/pages/c3.ts +1 -1
  9. package/templates/gatsby/workers/c3.ts +1 -1
  10. package/templates/hono/pages/c3.ts +1 -1
  11. package/templates/hono/workers/c3.ts +1 -1
  12. package/templates/nuxt/pages/c3.ts +3 -3
  13. package/templates/nuxt/workers/c3.ts +3 -3
  14. package/templates/pre-existing/c3.ts +2 -2
  15. package/templates/qwik/pages/c3.ts +7 -4
  16. package/templates/qwik/workers/c3.ts +7 -4
  17. package/templates/react/pages/c3.ts +2 -2
  18. package/templates/react/workers/c3.ts +18 -13
  19. package/templates/react/workers/js/src/App.jsx +132 -42
  20. package/templates/react/workers/js/src/assets/cloudflare.svg +1 -0
  21. package/templates/react/workers/ts/src/App.tsx +132 -42
  22. package/templates/react/workers/ts/src/assets/cloudflare.svg +1 -0
  23. package/templates/react-router/c3.ts +1 -1
  24. package/templates/redwood/c3.ts +1 -1
  25. package/templates/solid/c3.ts +2 -2
  26. package/templates/svelte/pages/c3.ts +2 -2
  27. package/templates/svelte/workers/c3.ts +2 -2
  28. package/templates/tanstack-start/c3.ts +1 -1
  29. package/templates/vike/c3.ts +1 -1
  30. package/templates/vike/experimental-c3.ts +1 -1
  31. package/templates/vue/workers/c3.ts +6 -3
  32. package/templates/react/workers/js/src/App.css +0 -45
  33. package/templates/react/workers/js/src/assets/Cloudflare_Logo.svg +0 -53
  34. package/templates/react/workers/ts/src/App.css +0 -45
  35. package/templates/react/workers/ts/src/assets/Cloudflare_Logo.svg +0 -51
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-cloudflare",
3
- "version": "2.67.1",
3
+ "version": "2.67.3",
4
4
  "description": "A CLI for creating and deploying new applications to Cloudflare.",
5
5
  "keywords": [
6
6
  "cloudflare",
@@ -30,8 +30,8 @@
30
30
  "devDependencies": {
31
31
  "@babel/parser": "^7.21.3",
32
32
  "@babel/types": "^7.21.4",
33
- "@clack/prompts": "^0.6.3",
34
- "@cloudflare/workers-types": "^4.20260420.1",
33
+ "@clack/prompts": "^1.2.0",
34
+ "@cloudflare/workers-types": "^4.20260424.1",
35
35
  "@types/command-exists": "^1.2.0",
36
36
  "@types/cross-spawn": "^6.0.2",
37
37
  "@types/deepmerge": "^2.2.0",
@@ -72,13 +72,13 @@
72
72
  "wrap-ansi": "^9.0.0",
73
73
  "xdg-app-paths": "^8.3.0",
74
74
  "yargs": "^17.7.2",
75
- "@cloudflare/cli": "1.4.0",
75
+ "@cloudflare/cli-shared-helpers": "0.1.0",
76
76
  "@cloudflare/codemod": "1.1.0",
77
77
  "@cloudflare/mock-npm-registry": "0.0.0",
78
- "@cloudflare/vite-plugin": "1.33.0",
78
+ "@cloudflare/vite-plugin": "1.33.2",
79
79
  "@cloudflare/workers-tsconfig": "0.0.0",
80
- "@cloudflare/workers-utils": "0.17.0",
81
- "wrangler": "4.84.0"
80
+ "@cloudflare/workers-utils": "0.18.0",
81
+ "wrangler": "4.85.0"
82
82
  },
83
83
  "engines": {
84
84
  "node": ">=20.0.0"
@@ -1,5 +1,5 @@
1
- import { logRaw, updateStatus } from "@cloudflare/cli";
2
- import { blue } from "@cloudflare/cli/colors";
1
+ import { logRaw, updateStatus } from "@cloudflare/cli-shared-helpers";
2
+ import { blue } from "@cloudflare/cli-shared-helpers/colors";
3
3
  import { mergeObjectProperties, transformFile } from "@cloudflare/codemod";
4
4
  import { runFrameworkGenerator } from "frameworks/index";
5
5
  import { getWorkerdCompatibilityDate } from "helpers/compatDate";
@@ -1,7 +1,7 @@
1
1
  import { resolve } from "node:path";
2
- import { logRaw } from "@cloudflare/cli";
3
- import { brandColor, dim } from "@cloudflare/cli/colors";
4
- import { spinner } from "@cloudflare/cli/interactive";
2
+ import { logRaw } from "@cloudflare/cli-shared-helpers";
3
+ import { brandColor, dim } from "@cloudflare/cli-shared-helpers/colors";
4
+ import { spinner } from "@cloudflare/cli-shared-helpers/interactive";
5
5
  import { runFrameworkGenerator } from "frameworks/index";
6
6
  import { readFile, readJSON, writeFile } from "helpers/files";
7
7
  import { detectPackageManager } from "helpers/packageManagers";
@@ -1,7 +1,7 @@
1
1
  import { resolve } from "node:path";
2
- import { logRaw } from "@cloudflare/cli";
3
- import { brandColor, dim } from "@cloudflare/cli/colors";
4
- import { spinner } from "@cloudflare/cli/interactive";
2
+ import { logRaw } from "@cloudflare/cli-shared-helpers";
3
+ import { brandColor, dim } from "@cloudflare/cli-shared-helpers/colors";
4
+ import { spinner } from "@cloudflare/cli-shared-helpers/interactive";
5
5
  import { runFrameworkGenerator } from "frameworks/index";
6
6
  import { readFile, readJSON, writeFile } from "helpers/files";
7
7
  import { detectPackageManager } from "helpers/packageManagers";
@@ -1,6 +1,6 @@
1
- import { logRaw, updateStatus } from "@cloudflare/cli";
2
- import { blue, brandColor, dim } from "@cloudflare/cli/colors";
3
- import { runCommand } from "@cloudflare/cli/command";
1
+ import { logRaw, updateStatus } from "@cloudflare/cli-shared-helpers";
2
+ import { blue, brandColor, dim } from "@cloudflare/cli-shared-helpers/colors";
3
+ import { runCommand } from "@cloudflare/cli-shared-helpers/command";
4
4
  import { transformFile } from "@cloudflare/codemod";
5
5
  import { runFrameworkGenerator } from "frameworks/index";
6
6
  import { usesTypescript } from "helpers/files";
@@ -1,6 +1,6 @@
1
- import { logRaw } from "@cloudflare/cli";
2
- import { brandColor, dim } from "@cloudflare/cli/colors";
3
- import { runCommand } from "@cloudflare/cli/command";
1
+ import { logRaw } from "@cloudflare/cli-shared-helpers";
2
+ import { brandColor, dim } from "@cloudflare/cli-shared-helpers/colors";
3
+ import { runCommand } from "@cloudflare/cli-shared-helpers/command";
4
4
  import { runFrameworkGenerator } from "frameworks/index";
5
5
  import { usesTypescript } from "helpers/files";
6
6
  import { detectPackageManager } from "helpers/packageManagers";
@@ -1,4 +1,4 @@
1
- import { inputPrompt } from "@cloudflare/cli/interactive";
1
+ import { inputPrompt } from "@cloudflare/cli-shared-helpers/interactive";
2
2
  import { runFrameworkGenerator } from "frameworks/index";
3
3
  import { detectPackageManager } from "helpers/packageManagers";
4
4
  import type { TemplateConfig } from "../../../src/templates";
@@ -1,4 +1,4 @@
1
- import { inputPrompt } from "@cloudflare/cli/interactive";
1
+ import { inputPrompt } from "@cloudflare/cli-shared-helpers/interactive";
2
2
  import { runFrameworkGenerator } from "frameworks/index";
3
3
  import { detectPackageManager } from "helpers/packageManagers";
4
4
  import type { TemplateConfig } from "../../../src/templates";
@@ -1,4 +1,4 @@
1
- import { logRaw } from "@cloudflare/cli";
1
+ import { logRaw } from "@cloudflare/cli-shared-helpers";
2
2
  import { runFrameworkGenerator } from "frameworks/index";
3
3
  import { detectPackageManager } from "helpers/packageManagers";
4
4
  import type { TemplateConfig } from "../../../src/templates";
@@ -1,4 +1,4 @@
1
- import { logRaw } from "@cloudflare/cli";
1
+ import { logRaw } from "@cloudflare/cli-shared-helpers";
2
2
  import { runFrameworkGenerator } from "frameworks/index";
3
3
  import { detectPackageManager } from "helpers/packageManagers";
4
4
  import type { TemplateConfig } from "../../../src/templates";
@@ -1,6 +1,6 @@
1
- import { logRaw } from "@cloudflare/cli";
2
- import { brandColor, dim } from "@cloudflare/cli/colors";
3
- import { spinner } from "@cloudflare/cli/interactive";
1
+ import { logRaw } from "@cloudflare/cli-shared-helpers";
2
+ import { brandColor, dim } from "@cloudflare/cli-shared-helpers/colors";
3
+ import { spinner } from "@cloudflare/cli-shared-helpers/interactive";
4
4
  import { mergeObjectProperties, transformFile } from "@cloudflare/codemod";
5
5
  import { runFrameworkGenerator } from "frameworks/index";
6
6
  import { writeFile } from "helpers/files";
@@ -1,6 +1,6 @@
1
- import { logRaw } from "@cloudflare/cli";
2
- import { brandColor, dim } from "@cloudflare/cli/colors";
3
- import { spinner } from "@cloudflare/cli/interactive";
1
+ import { logRaw } from "@cloudflare/cli-shared-helpers";
2
+ import { brandColor, dim } from "@cloudflare/cli-shared-helpers/colors";
3
+ import { spinner } from "@cloudflare/cli-shared-helpers/interactive";
4
4
  import { mergeObjectProperties, transformFile } from "@cloudflare/codemod";
5
5
  import { runFrameworkGenerator } from "frameworks/index";
6
6
  import { writeFile } from "helpers/files";
@@ -2,8 +2,8 @@ import { existsSync } from "node:fs";
2
2
  import { cp, mkdtemp } from "node:fs/promises";
3
3
  import { tmpdir } from "node:os";
4
4
  import { join } from "node:path";
5
- import { brandColor, dim } from "@cloudflare/cli/colors";
6
- import { runCommand } from "@cloudflare/cli/command";
5
+ import { brandColor, dim } from "@cloudflare/cli-shared-helpers/colors";
6
+ import { runCommand } from "@cloudflare/cli-shared-helpers/command";
7
7
  import { processArgument } from "helpers/args";
8
8
  import { detectPackageManager } from "helpers/packageManagers";
9
9
  import { chooseAccount, wranglerLogin } from "../../src/wrangler/accounts";
@@ -1,7 +1,10 @@
1
- import { endSection } from "@cloudflare/cli";
2
- import { brandColor } from "@cloudflare/cli/colors";
3
- import { quoteShellArgs, runCommand } from "@cloudflare/cli/command";
4
- import { spinner } from "@cloudflare/cli/interactive";
1
+ import { endSection } from "@cloudflare/cli-shared-helpers";
2
+ import { brandColor } from "@cloudflare/cli-shared-helpers/colors";
3
+ import {
4
+ quoteShellArgs,
5
+ runCommand,
6
+ } from "@cloudflare/cli-shared-helpers/command";
7
+ import { spinner } from "@cloudflare/cli-shared-helpers/interactive";
5
8
  import { transformFile } from "@cloudflare/codemod";
6
9
  import { runFrameworkGenerator } from "frameworks/index";
7
10
  import { loadTemplateSnippets } from "helpers/codemod";
@@ -1,7 +1,10 @@
1
- import { endSection } from "@cloudflare/cli";
2
- import { brandColor } from "@cloudflare/cli/colors";
3
- import { quoteShellArgs, runCommand } from "@cloudflare/cli/command";
4
- import { spinner } from "@cloudflare/cli/interactive";
1
+ import { endSection } from "@cloudflare/cli-shared-helpers";
2
+ import { brandColor } from "@cloudflare/cli-shared-helpers/colors";
3
+ import {
4
+ quoteShellArgs,
5
+ runCommand,
6
+ } from "@cloudflare/cli-shared-helpers/command";
7
+ import { spinner } from "@cloudflare/cli-shared-helpers/interactive";
5
8
  import { transformFile } from "@cloudflare/codemod";
6
9
  import { runFrameworkGenerator } from "frameworks/index";
7
10
  import { loadTemplateSnippets } from "helpers/codemod";
@@ -1,5 +1,5 @@
1
- import { logRaw } from "@cloudflare/cli";
2
- import { inputPrompt } from "@cloudflare/cli/interactive";
1
+ import { logRaw } from "@cloudflare/cli-shared-helpers";
2
+ import { inputPrompt } from "@cloudflare/cli-shared-helpers/interactive";
3
3
  import { runFrameworkGenerator } from "frameworks/index";
4
4
  import { detectPackageManager } from "helpers/packageManagers";
5
5
  import type { TemplateConfig } from "../../../src/templates";
@@ -1,7 +1,10 @@
1
1
  import assert from "node:assert";
2
- import { logRaw } from "@cloudflare/cli";
3
- import { brandColor, dim } from "@cloudflare/cli/colors";
4
- import { inputPrompt, spinner } from "@cloudflare/cli/interactive";
2
+ import { logRaw } from "@cloudflare/cli-shared-helpers";
3
+ import { brandColor, dim } from "@cloudflare/cli-shared-helpers/colors";
4
+ import {
5
+ inputPrompt,
6
+ spinner,
7
+ } from "@cloudflare/cli-shared-helpers/interactive";
5
8
  import { transformFile } from "@cloudflare/codemod";
6
9
  import { runFrameworkGenerator } from "frameworks/index";
7
10
  import { readJSON, usesTypescript, writeJSON } from "helpers/files";
@@ -122,25 +125,27 @@ async function getVariant(ctx: C3Context) {
122
125
  lang: "ts",
123
126
  label: "TypeScript",
124
127
  },
125
- {
126
- value: "react-swc-ts",
127
- lang: "ts",
128
- label: "TypeScript + SWC",
129
- },
130
128
  {
131
129
  value: "react",
132
130
  lang: "js",
133
131
  label: "JavaScript",
134
132
  },
135
- {
136
- value: "react-swc",
137
- lang: "js",
138
- label: "JavaScript + SWC",
139
- },
140
133
  ];
141
134
 
142
135
  // If variant is provided via CLI args, use it directly
143
136
  if (ctx.args.variant) {
137
+ const deprecatedVariantReplacements: Record<string, string> = {
138
+ "react-swc-ts": "react-ts",
139
+ "react-swc": "react",
140
+ };
141
+
142
+ const replacement = deprecatedVariantReplacements[ctx.args.variant];
143
+ if (replacement) {
144
+ throw new Error(
145
+ `The React variant "${ctx.args.variant}" is no longer available. Use "${replacement}" instead.`
146
+ );
147
+ }
148
+
144
149
  const selected = variantsOptions.find(
145
150
  (variant) => variant.value === ctx.args.variant
146
151
  );
@@ -1,7 +1,8 @@
1
1
  import { useState } from 'react'
2
2
  import reactLogo from './assets/react.svg'
3
3
  import viteLogo from './assets/vite.svg'
4
- import cloudflareLogo from './assets/Cloudflare_Logo.svg'
4
+ import cloudflareLogo from './assets/cloudflare.svg'
5
+ import heroImg from './assets/hero.png'
5
6
  import './App.css'
6
7
 
7
8
  function App() {
@@ -10,47 +11,136 @@ function App() {
10
11
 
11
12
  return (
12
13
  <>
13
- <div>
14
- <a href='https://vite.dev' target='_blank'>
15
- <img src={viteLogo} className='logo' alt='Vite logo' />
16
- </a>
17
- <a href='https://react.dev' target='_blank'>
18
- <img src={reactLogo} className='logo react' alt='React logo' />
19
- </a>
20
- <a href='https://workers.cloudflare.com/' target='_blank'>
21
- <img src={cloudflareLogo} className='logo cloudflare' alt='Cloudflare logo' />
22
- </a>
23
- </div>
24
- <h1>Vite + React + Cloudflare</h1>
25
- <div className='card'>
26
- <button
27
- onClick={() => setCount((count) => count + 1)}
28
- aria-label='increment'
29
- >
30
- count is {count}
31
- </button>
32
- <p>
33
- Edit <code>src/App.tsx</code> and save to test HMR
34
- </p>
35
- </div>
36
- <div className='card'>
37
- <button
38
- onClick={() => {
39
- fetch('/api/')
40
- .then((res) => res.json())
41
- .then((data) => setName(data.name))
42
- }}
43
- aria-label='get name'
44
- >
45
- Name from API is: {name}
46
- </button>
47
- <p>
48
- Edit <code>worker/index.js</code> to change the name
49
- </p>
50
- </div>
51
- <p className='read-the-docs'>
52
- Click on the Vite and React logos to learn more
53
- </p>
14
+ <section id="center">
15
+ <div className="hero">
16
+ <img src={heroImg} className="base" width="170" height="179" alt="" />
17
+ <img src={reactLogo} className="framework" alt="React logo" />
18
+ <img src={viteLogo} className="vite" alt="Vite logo" />
19
+ </div>
20
+ <div>
21
+ <h1>Get started with Cloudflare</h1>
22
+ <p>
23
+ Edit <code>src/App.jsx</code> or <code>worker/index.js</code> and save to test <code>HMR</code>
24
+ </p>
25
+ </div>
26
+ <ul style={{ display: 'flex', gap: '1rem', listStyle: 'none', padding: 0 }}>
27
+ <li>
28
+ <button
29
+ className="counter"
30
+ onClick={() => setCount((count) => count + 1)}
31
+ >
32
+ Count is {count}
33
+ </button>
34
+ </li>
35
+ <li>
36
+ <button
37
+ className="counter"
38
+ onClick={() => {
39
+ fetch('/api/')
40
+ .then((res) => res.json())
41
+ .then((data) => setName(data.name))
42
+ }}
43
+ aria-label='get name'
44
+ >
45
+ Name from API is: {name}
46
+ </button>
47
+ </li>
48
+ </ul>
49
+
50
+
51
+ </section>
52
+
53
+ <div className="ticks"></div>
54
+
55
+ <section id="next-steps">
56
+ <div id="docs">
57
+ <svg className="icon" role="presentation" aria-hidden="true">
58
+ <use href="/icons.svg#documentation-icon"></use>
59
+ </svg>
60
+ <h2>Documentation</h2>
61
+ <p>Your questions, answered</p>
62
+ <ul>
63
+ <li>
64
+ <a href="https://vite.dev/" target="_blank">
65
+ <img className="logo" src={viteLogo} alt="" />
66
+ Explore Vite
67
+ </a>
68
+ </li>
69
+ <li>
70
+ <a href="https://react.dev/" target="_blank">
71
+ <img className="button-icon" src={reactLogo} alt="" />
72
+ Learn more
73
+ </a>
74
+ </li>
75
+ <li>
76
+ <a href="https://workers.cloudflare.com/" target="_blank">
77
+ <img className="button-icon" src={cloudflareLogo} alt="" />
78
+ Workers Docs
79
+ </a>
80
+ </li>
81
+ </ul>
82
+ </div>
83
+ <div id="social">
84
+ <svg className="icon" role="presentation" aria-hidden="true">
85
+ <use href="/icons.svg#social-icon"></use>
86
+ </svg>
87
+ <h2>Connect with us</h2>
88
+ <p>Join the Vite community</p>
89
+ <ul>
90
+ <li>
91
+ <a href="https://github.com/vitejs/vite" target="_blank">
92
+ <svg
93
+ className="button-icon"
94
+ role="presentation"
95
+ aria-hidden="true"
96
+ >
97
+ <use href="/icons.svg#github-icon"></use>
98
+ </svg>
99
+ GitHub
100
+ </a>
101
+ </li>
102
+ <li>
103
+ <a href="https://chat.vite.dev/" target="_blank">
104
+ <svg
105
+ className="button-icon"
106
+ role="presentation"
107
+ aria-hidden="true"
108
+ >
109
+ <use href="/icons.svg#discord-icon"></use>
110
+ </svg>
111
+ Discord
112
+ </a>
113
+ </li>
114
+ <li>
115
+ <a href="https://x.com/vite_js" target="_blank">
116
+ <svg
117
+ className="button-icon"
118
+ role="presentation"
119
+ aria-hidden="true"
120
+ >
121
+ <use href="/icons.svg#x-icon"></use>
122
+ </svg>
123
+ X.com
124
+ </a>
125
+ </li>
126
+ <li>
127
+ <a href="https://bsky.app/profile/vite.dev" target="_blank">
128
+ <svg
129
+ className="button-icon"
130
+ role="presentation"
131
+ aria-hidden="true"
132
+ >
133
+ <use href="/icons.svg#bluesky-icon"></use>
134
+ </svg>
135
+ Bluesky
136
+ </a>
137
+ </li>
138
+ </ul>
139
+ </div>
140
+ </section>
141
+
142
+ <div className="ticks"></div>
143
+ <section id="spacer"></section>
54
144
  </>
55
145
  )
56
146
  }
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="40" height="19" fill="none" viewBox="0 0 40 19"><path fill="#f6821f" d="m27.16 18.507.204-.735c.242-.873.152-1.68-.255-2.274-.374-.547-.998-.868-1.755-.906l-14.346-.19a.3.3 0 0 1-.127-.034.3.3 0 0 1-.099-.09.31.31 0 0 1-.03-.27.4.4 0 0 1 .128-.185.37.37 0 0 1 .205-.081l14.479-.192c1.717-.082 3.576-1.536 4.227-3.31l.826-2.25a.55.55 0 0 0 .022-.298C29.702 3.29 25.94 0 21.44 0c-4.146 0-7.667 2.792-8.928 6.673a4.1 4.1 0 0 0-2.978-.86c-1.99.206-3.589 1.877-3.786 3.953a4.6 4.6 0 0 0 .11 1.547C2.605 11.41 0 14.189 0 17.603q0 .459.065.911c.009.07.042.134.093.18.05.047.116.072.183.073l26.485.003h.007a.34.34 0 0 0 .205-.076.36.36 0 0 0 .122-.187"/><path fill="#fbad41" d="M31.94 8.153q-.2 0-.397.01a.2.2 0 0 0-.062.014.2.2 0 0 0-.091.061.24.24 0 0 0-.054.098l-.564 2.033c-.243.874-.152 1.68.254 2.274.375.547.998.868 1.756.906l3.058.191a.3.3 0 0 1 .123.035.28.28 0 0 1 .142.22.3.3 0 0 1-.015.14.4.4 0 0 1-.128.185.37.37 0 0 1-.205.08l-3.177.192c-1.725.083-3.585 1.536-4.235 3.31l-.23.626a.18.18 0 0 0 .017.16.17.17 0 0 0 .134.08h10.941a.3.3 0 0 0 .176-.06.3.3 0 0 0 .106-.16 8.5 8.5 0 0 0 .291-2.216c0-4.517-3.51-8.18-7.84-8.18"/></svg>
@@ -1,7 +1,8 @@
1
1
  import { useState } from 'react'
2
2
  import reactLogo from './assets/react.svg'
3
3
  import viteLogo from './assets/vite.svg'
4
- import cloudflareLogo from './assets/Cloudflare_Logo.svg'
4
+ import cloudflareLogo from './assets/cloudflare.svg'
5
+ import heroImg from './assets/hero.png'
5
6
  import './App.css'
6
7
 
7
8
  function App() {
@@ -10,47 +11,136 @@ function App() {
10
11
 
11
12
  return (
12
13
  <>
13
- <div>
14
- <a href='https://vite.dev' target='_blank'>
15
- <img src={viteLogo} className='logo' alt='Vite logo' />
16
- </a>
17
- <a href='https://react.dev' target='_blank'>
18
- <img src={reactLogo} className='logo react' alt='React logo' />
19
- </a>
20
- <a href='https://workers.cloudflare.com/' target='_blank'>
21
- <img src={cloudflareLogo} className='logo cloudflare' alt='Cloudflare logo' />
22
- </a>
23
- </div>
24
- <h1>Vite + React + Cloudflare</h1>
25
- <div className='card'>
26
- <button
27
- onClick={() => setCount((count) => count + 1)}
28
- aria-label='increment'
29
- >
30
- count is {count}
31
- </button>
32
- <p>
33
- Edit <code>src/App.tsx</code> and save to test HMR
34
- </p>
35
- </div>
36
- <div className='card'>
37
- <button
38
- onClick={() => {
39
- fetch('/api/')
40
- .then((res) => res.json() as Promise<{ name: string }>)
41
- .then((data) => setName(data.name))
42
- }}
43
- aria-label='get name'
44
- >
45
- Name from API is: {name}
46
- </button>
47
- <p>
48
- Edit <code>worker/index.ts</code> to change the name
49
- </p>
50
- </div>
51
- <p className='read-the-docs'>
52
- Click on the Vite and React logos to learn more
53
- </p>
14
+ <section id="center">
15
+ <div className="hero">
16
+ <img src={heroImg} className="base" width="170" height="179" alt="" />
17
+ <img src={reactLogo} className="framework" alt="React logo" />
18
+ <img src={viteLogo} className="vite" alt="Vite logo" />
19
+ </div>
20
+ <div>
21
+ <h1>Get started with Cloudflare</h1>
22
+ <p>
23
+ Edit <code>src/App.tsx</code> or <code>worker/index.ts</code> and save to test <code>HMR</code>
24
+ </p>
25
+ </div>
26
+ <ul style={{ display: 'flex', gap: '1rem', listStyle: 'none', padding: 0 }}>
27
+ <li>
28
+ <button
29
+ className="counter"
30
+ onClick={() => setCount((count) => count + 1)}
31
+ >
32
+ Count is {count}
33
+ </button>
34
+ </li>
35
+ <li>
36
+ <button
37
+ className="counter"
38
+ onClick={() => {
39
+ fetch('/api/')
40
+ .then((res) => res.json())
41
+ .then((data) => setName(data.name))
42
+ }}
43
+ aria-label='get name'
44
+ >
45
+ Name from API is: {name}
46
+ </button>
47
+ </li>
48
+ </ul>
49
+
50
+
51
+ </section>
52
+
53
+ <div className="ticks"></div>
54
+
55
+ <section id="next-steps">
56
+ <div id="docs">
57
+ <svg className="icon" role="presentation" aria-hidden="true">
58
+ <use href="/icons.svg#documentation-icon"></use>
59
+ </svg>
60
+ <h2>Documentation</h2>
61
+ <p>Your questions, answered</p>
62
+ <ul>
63
+ <li>
64
+ <a href="https://vite.dev/" target="_blank">
65
+ <img className="logo" src={viteLogo} alt="" />
66
+ Explore Vite
67
+ </a>
68
+ </li>
69
+ <li>
70
+ <a href="https://react.dev/" target="_blank">
71
+ <img className="button-icon" src={reactLogo} alt="" />
72
+ Learn more
73
+ </a>
74
+ </li>
75
+ <li>
76
+ <a href="https://workers.cloudflare.com/" target="_blank">
77
+ <img className="button-icon" src={cloudflareLogo} alt="" />
78
+ Workers Docs
79
+ </a>
80
+ </li>
81
+ </ul>
82
+ </div>
83
+ <div id="social">
84
+ <svg className="icon" role="presentation" aria-hidden="true">
85
+ <use href="/icons.svg#social-icon"></use>
86
+ </svg>
87
+ <h2>Connect with us</h2>
88
+ <p>Join the Vite community</p>
89
+ <ul>
90
+ <li>
91
+ <a href="https://github.com/vitejs/vite" target="_blank">
92
+ <svg
93
+ className="button-icon"
94
+ role="presentation"
95
+ aria-hidden="true"
96
+ >
97
+ <use href="/icons.svg#github-icon"></use>
98
+ </svg>
99
+ GitHub
100
+ </a>
101
+ </li>
102
+ <li>
103
+ <a href="https://chat.vite.dev/" target="_blank">
104
+ <svg
105
+ className="button-icon"
106
+ role="presentation"
107
+ aria-hidden="true"
108
+ >
109
+ <use href="/icons.svg#discord-icon"></use>
110
+ </svg>
111
+ Discord
112
+ </a>
113
+ </li>
114
+ <li>
115
+ <a href="https://x.com/vite_js" target="_blank">
116
+ <svg
117
+ className="button-icon"
118
+ role="presentation"
119
+ aria-hidden="true"
120
+ >
121
+ <use href="/icons.svg#x-icon"></use>
122
+ </svg>
123
+ X.com
124
+ </a>
125
+ </li>
126
+ <li>
127
+ <a href="https://bsky.app/profile/vite.dev" target="_blank">
128
+ <svg
129
+ className="button-icon"
130
+ role="presentation"
131
+ aria-hidden="true"
132
+ >
133
+ <use href="/icons.svg#bluesky-icon"></use>
134
+ </svg>
135
+ Bluesky
136
+ </a>
137
+ </li>
138
+ </ul>
139
+ </div>
140
+ </section>
141
+
142
+ <div className="ticks"></div>
143
+ <section id="spacer"></section>
54
144
  </>
55
145
  )
56
146
  }
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="40" height="19" fill="none" viewBox="0 0 40 19"><path fill="#f6821f" d="m27.16 18.507.204-.735c.242-.873.152-1.68-.255-2.274-.374-.547-.998-.868-1.755-.906l-14.346-.19a.3.3 0 0 1-.127-.034.3.3 0 0 1-.099-.09.31.31 0 0 1-.03-.27.4.4 0 0 1 .128-.185.37.37 0 0 1 .205-.081l14.479-.192c1.717-.082 3.576-1.536 4.227-3.31l.826-2.25a.55.55 0 0 0 .022-.298C29.702 3.29 25.94 0 21.44 0c-4.146 0-7.667 2.792-8.928 6.673a4.1 4.1 0 0 0-2.978-.86c-1.99.206-3.589 1.877-3.786 3.953a4.6 4.6 0 0 0 .11 1.547C2.605 11.41 0 14.189 0 17.603q0 .459.065.911c.009.07.042.134.093.18.05.047.116.072.183.073l26.485.003h.007a.34.34 0 0 0 .205-.076.36.36 0 0 0 .122-.187"/><path fill="#fbad41" d="M31.94 8.153q-.2 0-.397.01a.2.2 0 0 0-.062.014.2.2 0 0 0-.091.061.24.24 0 0 0-.054.098l-.564 2.033c-.243.874-.152 1.68.254 2.274.375.547.998.868 1.756.906l3.058.191a.3.3 0 0 1 .123.035.28.28 0 0 1 .142.22.3.3 0 0 1-.015.14.4.4 0 0 1-.128.185.37.37 0 0 1-.205.08l-3.177.192c-1.725.083-3.585 1.536-4.235 3.31l-.23.626a.18.18 0 0 0 .017.16.17.17 0 0 0 .134.08h10.941a.3.3 0 0 0 .176-.06.3.3 0 0 0 .106-.16 8.5 8.5 0 0 0 .291-2.216c0-4.517-3.51-8.18-7.84-8.18"/></svg>