create-cloudflare 2.40.2 → 2.41.0

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 (43) hide show
  1. package/dist/cli.js +817 -718
  2. package/package.json +4 -4
  3. package/templates/angular/c3.ts +5 -129
  4. package/templates/angular/pages/c3.ts +134 -0
  5. package/{templates-experimental/angular → templates/angular/workers}/c3.ts +2 -2
  6. package/templates/gatsby/c3.ts +5 -45
  7. package/templates/gatsby/pages/c3.ts +50 -0
  8. package/{templates-experimental/gatsby → templates/gatsby/workers}/c3.ts +2 -2
  9. package/templates/hello-world/js/package.json +2 -2
  10. package/templates/hello-world/ts/package.json +2 -2
  11. package/templates/nuxt/c3.ts +5 -130
  12. package/templates/nuxt/pages/c3.ts +145 -0
  13. package/templates/nuxt/{templates → pages/templates}/wrangler.jsonc +0 -3
  14. package/{templates-experimental/nuxt → templates/nuxt/workers}/c3.ts +12 -2
  15. package/templates/vue/c3.ts +5 -25
  16. package/{templates-experimental/vue → templates/vue/pages}/c3.ts +5 -8
  17. package/templates/vue/workers/c3.ts +98 -0
  18. package/templates/vue/workers/js/server/index.js +13 -0
  19. package/templates/vue/workers/js/src/App.vue +107 -0
  20. package/templates/vue/workers/js/src/components/HelloWorld.vue +47 -0
  21. package/templates/vue/workers/js/vite.config.js +21 -0
  22. package/templates/vue/workers/js/wrangler.jsonc +12 -0
  23. package/templates/vue/workers/ts/server/index.ts +13 -0
  24. package/templates/vue/workers/ts/src/App.vue +107 -0
  25. package/templates/vue/workers/ts/src/components/HelloWorld.vue +44 -0
  26. package/templates/vue/workers/ts/tsconfig.worker.json +8 -0
  27. package/templates/vue/workers/ts/vite.config.ts +21 -0
  28. package/templates/vue/workers/ts/worker-configuration.d.ts +6 -0
  29. package/templates/vue/workers/ts/wrangler.jsonc +12 -0
  30. package/templates-experimental/hello-world-with-assets/js/package.json +2 -2
  31. package/templates-experimental/hello-world-with-assets/ts/package.json +2 -2
  32. package/templates-experimental/vue/templates/wrangler.jsonc +0 -10
  33. /package/templates/angular/{templates → pages/templates}/src/_routes.json +0 -0
  34. /package/{templates-experimental/angular → templates/angular/pages}/templates/src/server.ts +0 -0
  35. /package/templates/angular/{templates → pages/templates}/tools/copy-files.mjs +0 -0
  36. /package/templates/angular/{templates → workers/templates}/src/server.ts +0 -0
  37. /package/{templates-experimental/angular → templates/angular/workers}/templates/wrangler.jsonc +0 -0
  38. /package/{templates-experimental/gatsby → templates/gatsby/workers}/templates/wrangler.jsonc +0 -0
  39. /package/{templates-experimental/nuxt → templates/nuxt/pages}/templates/env.d.ts +0 -0
  40. /package/{templates-experimental/nuxt → templates/nuxt/pages}/templates/worker-configuration.d.ts +0 -0
  41. /package/templates/nuxt/{templates → workers/templates}/env.d.ts +0 -0
  42. /package/templates/nuxt/{templates → workers/templates}/worker-configuration.d.ts +0 -0
  43. /package/{templates-experimental/nuxt → templates/nuxt/workers}/templates/wrangler.jsonc +0 -0
@@ -0,0 +1,44 @@
1
+ <script setup lang="ts">
2
+ defineProps<{
3
+ msg: string
4
+ }>()
5
+ </script>
6
+
7
+ <template>
8
+ <div class="greetings">
9
+ <h1 class="green">{{ msg }}</h1>
10
+ <h3>
11
+ You’ve successfully created a project with
12
+ <a href="https://vite.dev/" target="_blank" rel="noopener">Vite</a> +
13
+ <a href="https://vuejs.org/" target="_blank" rel="noopener">Vue 3</a> +
14
+ <a href="https://developers.cloudflare.com/workers/" target="_blank" rel="noopener"
15
+ >Cloudflare Workers</a
16
+ >. What's next?
17
+ </h3>
18
+ </div>
19
+ </template>
20
+
21
+ <style scoped>
22
+ h1 {
23
+ font-weight: 500;
24
+ font-size: 2.6rem;
25
+ position: relative;
26
+ top: -10px;
27
+ }
28
+
29
+ h3 {
30
+ font-size: 1.2rem;
31
+ }
32
+
33
+ .greetings h1,
34
+ .greetings h3 {
35
+ text-align: center;
36
+ }
37
+
38
+ @media (min-width: 1024px) {
39
+ .greetings h1,
40
+ .greetings h3 {
41
+ text-align: left;
42
+ }
43
+ }
44
+ </style>
@@ -0,0 +1,8 @@
1
+ {
2
+ "extends": "./tsconfig.node.json",
3
+ "compilerOptions": {
4
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.worker.tsbuildinfo",
5
+ "types": ["@cloudflare/workers-types/2023-07-01", "./worker-configuration.d.ts","vite/client"],
6
+ },
7
+ "include": ["server"],
8
+ }
@@ -0,0 +1,21 @@
1
+ import { fileURLToPath, URL } from 'node:url'
2
+
3
+ import { defineConfig } from 'vite'
4
+ import vue from '@vitejs/plugin-vue'
5
+ import vueDevTools from 'vite-plugin-vue-devtools'
6
+
7
+ import { cloudflare } from "@cloudflare/vite-plugin"
8
+
9
+ // https://vite.dev/config/
10
+ export default defineConfig({
11
+ plugins: [
12
+ vue(),
13
+ vueDevTools(),
14
+ cloudflare()
15
+ ],
16
+ resolve: {
17
+ alias: {
18
+ '@': fileURLToPath(new URL('./src', import.meta.url))
19
+ },
20
+ },
21
+ })
@@ -0,0 +1,6 @@
1
+ // Generated by Wrangler by running `wrangler types`
2
+ // After adding bindings to `wrangler.jsonc`, regenerate this interface via `npm run cf-typegen`
3
+
4
+ interface Env {
5
+ ASSETS: Fetcher;
6
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "<TBD>",
3
+ "compatibility_date": "<TBD>",
4
+ "main": "server/index.ts",
5
+ "assets": {
6
+ "not_found_handling": "single-page-application",
7
+ "binding": "ASSETS"
8
+ },
9
+ "observability": {
10
+ "enabled": true
11
+ }
12
+ }
@@ -9,8 +9,8 @@
9
9
  "test": "vitest"
10
10
  },
11
11
  "devDependencies": {
12
- "@cloudflare/vitest-pool-workers": "^0.6.4",
12
+ "@cloudflare/vitest-pool-workers": "^0.7.5",
13
13
  "wrangler": "^3.101.0",
14
- "vitest": "~2.1.9"
14
+ "vitest": "~3.0.7"
15
15
  }
16
16
  }
@@ -10,9 +10,9 @@
10
10
  "cf-typegen": "wrangler types"
11
11
  },
12
12
  "devDependencies": {
13
- "@cloudflare/vitest-pool-workers": "^0.6.4",
13
+ "@cloudflare/vitest-pool-workers": "^0.7.5",
14
14
  "typescript": "^5.5.2",
15
- "vitest": "~2.1.9",
15
+ "vitest": "~3.0.7",
16
16
  "wrangler": "^3.101.0"
17
17
  }
18
18
  }
@@ -1,10 +0,0 @@
1
- {
2
- "name": "<TBD>",
3
- "compatibility_date": "<TBD>",
4
- "assets": {
5
- "directory": "./dist"
6
- },
7
- "observability": {
8
- "enabled": true
9
- }
10
- }