create-cloudflare 2.58.0 → 2.59.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.
- package/dist/cli.js +360 -396
- package/package.json +6 -6
- package/templates/analog/c3.ts +39 -61
- package/templates/analog/templates/wrangler.jsonc +10 -3
- package/templates/angular/pages/templates/wrangler.jsonc +2 -2
- package/templates/angular/workers/templates/wrangler.jsonc +2 -2
- package/templates/astro/pages/templates/js/wrangler.jsonc +2 -2
- package/templates/astro/pages/templates/ts/wrangler.jsonc +2 -2
- package/templates/astro/workers/templates/js/wrangler.jsonc +2 -2
- package/templates/astro/workers/templates/ts/wrangler.jsonc +2 -2
- package/templates/common/js/package.json +1 -1
- package/templates/common/js/wrangler.jsonc +2 -2
- package/templates/common/ts/package.json +1 -1
- package/templates/common/ts/wrangler.jsonc +2 -2
- package/templates/docusaurus/workers/templates/wrangler.jsonc +2 -2
- package/templates/gatsby/workers/templates/wrangler.jsonc +2 -2
- package/templates/hello-world/c3.ts +0 -12
- package/templates/hello-world/js/package.json +1 -1
- package/templates/hello-world/js/wrangler.jsonc +2 -2
- package/templates/hello-world/py/package.json +1 -1
- package/templates/hello-world/py/pyproject.toml +1 -1
- package/templates/hello-world/py/wrangler.jsonc +2 -2
- package/templates/hello-world/ts/package.json +1 -1
- package/templates/hello-world/ts/wrangler.jsonc +2 -2
- package/templates/hello-world-assets-only/templates/package.json +1 -1
- package/templates/hello-world-assets-only/templates/wrangler.jsonc +2 -2
- package/templates/hello-world-durable-object/js/package.json +1 -1
- package/templates/hello-world-durable-object/js/wrangler.jsonc +2 -2
- package/templates/hello-world-durable-object/py/package.json +1 -1
- package/templates/hello-world-durable-object/py/pyproject.toml +1 -1
- package/templates/hello-world-durable-object/py/wrangler.jsonc +2 -2
- package/templates/hello-world-durable-object/ts/package.json +1 -1
- package/templates/hello-world-durable-object/ts/wrangler.jsonc +2 -2
- package/templates/hello-world-durable-object-with-assets/js/package.json +1 -1
- package/templates/hello-world-durable-object-with-assets/js/wrangler.jsonc +2 -2
- package/templates/hello-world-durable-object-with-assets/py/package.json +1 -1
- package/templates/hello-world-durable-object-with-assets/py/pyproject.toml +1 -1
- package/templates/hello-world-durable-object-with-assets/py/wrangler.jsonc +2 -2
- package/templates/hello-world-durable-object-with-assets/ts/package.json +1 -1
- package/templates/hello-world-durable-object-with-assets/ts/wrangler.jsonc +2 -2
- package/templates/hello-world-with-assets/js/package.json +1 -1
- package/templates/hello-world-with-assets/js/wrangler.jsonc +2 -2
- package/templates/hello-world-with-assets/py/package.json +1 -1
- package/templates/hello-world-with-assets/py/pyproject.toml +1 -1
- package/templates/hello-world-with-assets/py/wrangler.jsonc +2 -2
- package/templates/hello-world-with-assets/ts/package.json +1 -1
- package/templates/hello-world-with-assets/ts/wrangler.jsonc +2 -2
- package/templates/hello-world-workflows/js/package.json +1 -1
- package/templates/hello-world-workflows/js/wrangler.jsonc +2 -2
- package/templates/hello-world-workflows/ts/package.json +1 -1
- package/templates/hello-world-workflows/ts/wrangler.jsonc +2 -2
- package/templates/hono/pages/templates/wrangler.jsonc +2 -2
- package/templates/hono/workers/templates/wrangler.jsonc +2 -2
- package/templates/next/c3.ts +9 -22
- package/templates/nuxt/pages/templates/wrangler.jsonc +2 -2
- package/templates/nuxt/workers/templates/wrangler.jsonc +2 -2
- package/templates/openapi/ts/wrangler.jsonc +2 -2
- package/templates/pre-existing/js/package.json +1 -1
- package/templates/queues/js/package.json +1 -1
- package/templates/queues/js/wrangler.jsonc +2 -2
- package/templates/queues/ts/package.json +1 -1
- package/templates/queues/ts/wrangler.jsonc +2 -2
- package/templates/qwik/pages/templates/wrangler.jsonc +2 -2
- package/templates/qwik/workers/templates/wrangler.jsonc +2 -2
- package/templates/react/pages/templates/wrangler.jsonc +2 -2
- package/templates/react/workers/js/wrangler.jsonc +2 -2
- package/templates/react/workers/ts/wrangler.jsonc +2 -2
- package/templates/scheduled/js/package.json +1 -1
- package/templates/scheduled/js/wrangler.jsonc +2 -2
- package/templates/scheduled/ts/package.json +2 -2
- package/templates/scheduled/ts/wrangler.jsonc +2 -2
- package/templates/solid/templates/wrangler.jsonc +2 -2
- package/templates/svelte/pages/templates/wrangler.jsonc +2 -2
- package/templates/svelte/workers/templates/wrangler.jsonc +2 -2
- package/templates/vue/pages/templates/wrangler.jsonc +2 -2
- package/templates/vue/workers/js/wrangler.jsonc +2 -2
- package/templates/vue/workers/ts/wrangler.jsonc +2 -2
- package/templates/waku/wrangler.jsonc +2 -2
- package/templates/analog/snippets/devBindingsModule.ts +0 -7
- package/templates/analog/templates/env.d.ts +0 -13
- package/templates/analog/templates/src/dev-bindings.ts +0 -18
- package/templates/next/templates/.dev.vars +0 -2
- package/templates/next/templates/__dot__gitignore +0 -39
- package/templates/next/templates/open-next.config.ts +0 -9
- package/templates/next/templates/public/_headers +0 -3
- package/templates/next/templates/wrangler.jsonc +0 -13
package/templates/next/c3.ts
CHANGED
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { downloadRemoteTemplate, updatePackageName } from "../../src/templates";
|
|
2
2
|
import type { TemplateConfig } from "../../src/templates";
|
|
3
3
|
import type { C3Context } from "types";
|
|
4
4
|
|
|
5
5
|
const generate = async (ctx: C3Context) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"--example",
|
|
15
|
-
"https://github.com/opennextjs/opennextjs-cloudflare/tree/main/create-cloudflare/next",
|
|
16
|
-
]);
|
|
6
|
+
const repoUrl =
|
|
7
|
+
"https://github.com/opennextjs/opennextjs-cloudflare/tree/main/create-cloudflare/next";
|
|
8
|
+
|
|
9
|
+
await downloadRemoteTemplate(repoUrl, {
|
|
10
|
+
intoFolder: ctx.project.path,
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
await updatePackageName(ctx);
|
|
17
14
|
};
|
|
18
15
|
|
|
19
16
|
const envInterfaceName = "CloudflareEnv";
|
|
@@ -24,17 +21,7 @@ export default {
|
|
|
24
21
|
frameworkCli: "create-next-app",
|
|
25
22
|
platform: "workers",
|
|
26
23
|
displayName: "Next.js",
|
|
27
|
-
copyFiles: {
|
|
28
|
-
path: "./templates",
|
|
29
|
-
},
|
|
30
24
|
generate,
|
|
31
|
-
transformPackageJson: async () => ({
|
|
32
|
-
scripts: {
|
|
33
|
-
deploy: `opennextjs-cloudflare build && opennextjs-cloudflare deploy`,
|
|
34
|
-
preview: `opennextjs-cloudflare build && opennextjs-cloudflare preview`,
|
|
35
|
-
"cf-typegen": `wrangler types --env-interface ${envInterfaceName} ${typesPath}`,
|
|
36
|
-
},
|
|
37
|
-
}),
|
|
38
25
|
devScript: "dev",
|
|
39
26
|
previewScript: "preview",
|
|
40
27
|
deployScript: "deploy",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "<
|
|
2
|
+
"name": "<WORKER_NAME>",
|
|
3
3
|
"main": "./dist/worker/serve-cloudflare.js",
|
|
4
4
|
// https://developers.cloudflare.com/workers/platform/compatibility-dates
|
|
5
|
-
"compatibility_date": "<
|
|
5
|
+
"compatibility_date": "<COMPATIBILITY_DATE>",
|
|
6
6
|
// nodejs_als is required for Waku server-side request context
|
|
7
7
|
// It can be removed if only building static pages
|
|
8
8
|
"compatibility_flags": ["nodejs_als"],
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { NitroApp } from 'nitropack';
|
|
2
|
-
import { defineNitroPlugin } from 'nitropack/dist/runtime/plugin';
|
|
3
|
-
|
|
4
|
-
export default defineNitroPlugin((nitroApp: NitroApp) => {
|
|
5
|
-
nitroApp.hooks.hook('request', async (event) => {
|
|
6
|
-
const _pkg = 'wrangler'; // Bypass bundling!
|
|
7
|
-
const { getPlatformProxy } = (await import(
|
|
8
|
-
_pkg
|
|
9
|
-
)) as typeof import('wrangler');
|
|
10
|
-
const platform = await getPlatformProxy();
|
|
11
|
-
|
|
12
|
-
event.context.cf = platform['cf'];
|
|
13
|
-
event.context.cloudflare = {
|
|
14
|
-
env: platform['env'] as unknown as Env,
|
|
15
|
-
context: platform['ctx'],
|
|
16
|
-
};
|
|
17
|
-
});
|
|
18
|
-
});
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
|
2
|
-
|
|
3
|
-
# dependencies
|
|
4
|
-
/node_modules
|
|
5
|
-
/.pnp
|
|
6
|
-
.pnp.js
|
|
7
|
-
.yarn/install-state.gz
|
|
8
|
-
|
|
9
|
-
# testing
|
|
10
|
-
/coverage
|
|
11
|
-
|
|
12
|
-
# next.js
|
|
13
|
-
/.next/
|
|
14
|
-
/out/
|
|
15
|
-
|
|
16
|
-
# production
|
|
17
|
-
/build
|
|
18
|
-
|
|
19
|
-
# misc
|
|
20
|
-
.DS_Store
|
|
21
|
-
*.pem
|
|
22
|
-
|
|
23
|
-
# debug
|
|
24
|
-
npm-debug.log*
|
|
25
|
-
yarn-debug.log*
|
|
26
|
-
yarn-error.log*
|
|
27
|
-
|
|
28
|
-
# local env files
|
|
29
|
-
.env*.local
|
|
30
|
-
|
|
31
|
-
# vercel
|
|
32
|
-
.vercel
|
|
33
|
-
|
|
34
|
-
# typescript
|
|
35
|
-
*.tsbuildinfo
|
|
36
|
-
next-env.d.ts
|
|
37
|
-
|
|
38
|
-
# OpenNext
|
|
39
|
-
/.open-next
|
|
@@ -1,9 +0,0 @@
|
|
|
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
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "<app-name>",
|
|
3
|
-
"main": ".open-next/worker.js",
|
|
4
|
-
"compatibility_date": "2025-03-01",
|
|
5
|
-
"compatibility_flags": [
|
|
6
|
-
"nodejs_compat",
|
|
7
|
-
"global_fetch_strictly_public"
|
|
8
|
-
],
|
|
9
|
-
"assets": {
|
|
10
|
-
"binding": "ASSETS",
|
|
11
|
-
"directory": ".open-next/assets"
|
|
12
|
-
}
|
|
13
|
-
}
|