mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 04:27:21 +00:00
fix: create: cloudflare starter wasn't creating a r2 bucket
This commit is contained in:
2
app/.gitignore
vendored
2
app/.gitignore
vendored
@@ -1,4 +1,4 @@
|
|||||||
playwright-report
|
playwright-report
|
||||||
test-results
|
test-results
|
||||||
bknd.config.*
|
bknd.config.*
|
||||||
app/__test__/helper.d.ts
|
__test__/helper.d.ts
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
"type": "module",
|
"type": "module",
|
||||||
"sideEffects": false,
|
"sideEffects": false,
|
||||||
"bin": "./dist/cli/index.js",
|
"bin": "./dist/cli/index.js",
|
||||||
"version": "0.11.0-rc.5",
|
"version": "0.11.0-rc.6",
|
||||||
"description": "Lightweight Firebase/Supabase alternative built to run anywhere — incl. Next.js, React Router, Astro, Cloudflare, Bun, Node, AWS Lambda & more.",
|
"description": "Lightweight Firebase/Supabase alternative built to run anywhere — incl. Next.js, React Router, Astro, Cloudflare, Bun, Node, AWS Lambda & more.",
|
||||||
"homepage": "https://bknd.io",
|
"homepage": "https://bknd.io",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
@@ -29,7 +29,9 @@ export const cloudflare = {
|
|||||||
{ dir: ctx.dir },
|
{ dir: ctx.dir },
|
||||||
);
|
);
|
||||||
|
|
||||||
const db = ctx.skip ? "d1" : await $p.select({
|
const db = ctx.skip
|
||||||
|
? "d1"
|
||||||
|
: await $p.select({
|
||||||
message: "What database do you want to use?",
|
message: "What database do you want to use?",
|
||||||
options: [
|
options: [
|
||||||
{ label: "Cloudflare D1", value: "d1" },
|
{ label: "Cloudflare D1", value: "d1" },
|
||||||
@@ -64,7 +66,9 @@ export const cloudflare = {
|
|||||||
|
|
||||||
async function createD1(ctx: TemplateSetupCtx) {
|
async function createD1(ctx: TemplateSetupCtx) {
|
||||||
const default_db = "data";
|
const default_db = "data";
|
||||||
const name = ctx.skip ? default_db : await $p.text({
|
const name = ctx.skip
|
||||||
|
? default_db
|
||||||
|
: await $p.text({
|
||||||
message: "Enter database name",
|
message: "Enter database name",
|
||||||
initialValue: default_db,
|
initialValue: default_db,
|
||||||
placeholder: default_db,
|
placeholder: default_db,
|
||||||
@@ -153,13 +157,16 @@ async function createLibsql(ctx: TemplateSetupCtx) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function createR2(ctx: TemplateSetupCtx) {
|
async function createR2(ctx: TemplateSetupCtx) {
|
||||||
const create = ctx.skip ?? await $p.confirm({
|
const create = ctx.skip
|
||||||
|
? false
|
||||||
|
: await $p.confirm({
|
||||||
message: "Do you want to use a R2 bucket?",
|
message: "Do you want to use a R2 bucket?",
|
||||||
initialValue: true,
|
initialValue: true,
|
||||||
});
|
});
|
||||||
if ($p.isCancel(create)) {
|
if ($p.isCancel(create)) {
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!create) {
|
if (!create) {
|
||||||
await overrideJson(
|
await overrideJson(
|
||||||
WRANGLER_FILE,
|
WRANGLER_FILE,
|
||||||
@@ -173,7 +180,9 @@ async function createR2(ctx: TemplateSetupCtx) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const default_bucket = "bucket";
|
const default_bucket = "bucket";
|
||||||
const name = ctx.skip ? default_bucket : await $p.text({
|
const name = ctx.skip
|
||||||
|
? default_bucket
|
||||||
|
: await $p.text({
|
||||||
message: "Enter bucket name",
|
message: "Enter bucket name",
|
||||||
initialValue: default_bucket,
|
initialValue: default_bucket,
|
||||||
placeholder: default_bucket,
|
placeholder: default_bucket,
|
||||||
|
|||||||
Reference in New Issue
Block a user