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 +37 -37
- package/package.json +1 -1
- package/templates/angular/c3.ts +2 -3
- package/templates/astro/c3.ts +1 -1
- package/templates/next/c3.ts +1 -1
- package/templates/next/templates.ts +18 -18
- package/templates/nuxt/c3.ts +1 -1
- package/templates/pre-existing/c3.ts +2 -3
- package/templates/qwik/c3.ts +1 -1
- package/templates/solid/c3.ts +2 -3
- package/templates/svelte/c3.ts +1 -1
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-
|
|
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.
|
|
24220
|
+
"create-astro": "4.7.2",
|
|
24221
24221
|
"@angular/create": "17.1.1",
|
|
24222
|
-
"create-docusaurus": "3.1.
|
|
24222
|
+
"create-docusaurus": "3.1.1",
|
|
24223
24223
|
"create-hono": "0.3.2",
|
|
24224
|
-
"create-next-app": "14.0
|
|
24225
|
-
"create-qwik": "1.4.
|
|
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.
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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 =
|
|
36654
|
-
function
|
|
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(
|
|
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(
|
|
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 (
|
|
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 =
|
|
41375
|
-
const nextConfig = {}
|
|
41374
|
+
nextConfig = `import { setupDevBindings } from '@cloudflare/next-on-pages/next-dev';
|
|
41376
41375
|
|
|
41377
|
-
|
|
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/
|
|
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
|
-
|
|
41384
|
-
|
|
41385
|
-
|
|
41386
|
-
|
|
41387
|
-
|
|
41388
|
-
|
|
41389
|
-
|
|
41390
|
-
|
|
41391
|
-
|
|
41392
|
-
|
|
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.
|
|
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 (
|
|
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 (
|
|
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
|
|
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
package/templates/angular/c3.ts
CHANGED
|
@@ -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(
|
|
21
|
+
await installCFWorker();
|
|
23
22
|
};
|
|
24
23
|
|
|
25
|
-
async function installCFWorker(
|
|
24
|
+
async function installCFWorker() {
|
|
26
25
|
await installPackages(
|
|
27
26
|
["@cloudflare/workers-types", "@miniflare/tre@next", "wrangler@beta"],
|
|
28
27
|
{
|
package/templates/astro/c3.ts
CHANGED
|
@@ -14,7 +14,7 @@ const generate = async (ctx: C3Context) => {
|
|
|
14
14
|
logRaw(""); // newline
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
const configure = async (
|
|
17
|
+
const configure = async () => {
|
|
18
18
|
await runCommand([npx, "astro", "add", "cloudflare", "-y"], {
|
|
19
19
|
silent: true,
|
|
20
20
|
startText: "Installing adapter",
|
package/templates/next/c3.ts
CHANGED
|
@@ -112,7 +112,7 @@ const configure = async (ctx: C3Context) => {
|
|
|
112
112
|
await writeEslintrc(ctx);
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
-
writeFile(`${projectPath}/next.config.
|
|
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 =
|
|
184
|
-
const nextConfig = {}
|
|
183
|
+
export const nextConfig = `import { setupDevBindings } from '@cloudflare/next-on-pages/next-dev';
|
|
185
184
|
|
|
186
|
-
|
|
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/
|
|
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
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
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 {
|
package/templates/nuxt/c3.ts
CHANGED
|
@@ -27,7 +27,7 @@ const generate = async (ctx: C3Context) => {
|
|
|
27
27
|
logRaw(""); // newline
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
-
const configure = async (
|
|
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
|
|
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
|
|
12
|
+
const { dlx } = detectPackageManager();
|
|
14
13
|
|
|
15
14
|
await chooseAccount(ctx);
|
|
16
15
|
|
package/templates/qwik/c3.ts
CHANGED
|
@@ -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 (
|
|
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)}`);
|
package/templates/solid/c3.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { logRaw
|
|
2
|
-
import {
|
|
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";
|
package/templates/svelte/c3.ts
CHANGED
|
@@ -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
|
}),
|