This commit is contained in:
@@ -5,9 +5,9 @@ import type { CliCommand } from "cli/types";
|
||||
import { typewriter, wait } from "cli/utils/cli";
|
||||
import { execAsync, getVersion } from "cli/utils/sys";
|
||||
import { Option } from "commander";
|
||||
import { env } from "bknd";
|
||||
import { env } from "userbase";
|
||||
import color from "picocolors";
|
||||
import { overridePackageJson, updateBkndPackages } from "./npm";
|
||||
import { overridePackageJson, updateUserbasePackages } from "./npm";
|
||||
import { type Template, templates, type TemplateSetupCtx } from "./templates";
|
||||
import { createScoped, flush } from "cli/utils/telemetry";
|
||||
import path from "node:path";
|
||||
@@ -48,7 +48,7 @@ function errorOutro() {
|
||||
// biome-ignore lint/suspicious/noConsoleLog:
|
||||
console.log(
|
||||
color.yellow("Sorry that this happened. If you think this is a bug, please report it at: ") +
|
||||
color.cyan("https://github.com/bknd-io/bknd/issues"),
|
||||
color.cyan("https://github.com/userbase-io/userbase/issues"),
|
||||
);
|
||||
// biome-ignore lint/suspicious/noConsoleLog:
|
||||
console.log("");
|
||||
@@ -80,12 +80,12 @@ async function action(options: {
|
||||
|
||||
const version = await getVersion();
|
||||
$p.intro(
|
||||
`👋 Welcome to the ${color.bold(color.cyan("bknd"))} create cli ${color.bold(`v${version}`)}`,
|
||||
`👋 Welcome to the ${color.bold(color.cyan("userbase"))} create cli ${color.bold(`v${version}`)}`,
|
||||
);
|
||||
|
||||
await $p.stream.message(
|
||||
(async function* () {
|
||||
yield* typewriter("Thanks for choosing to create a new project with bknd!", color.dim);
|
||||
yield* typewriter("Thanks for choosing to create a new project with userbase!", color.dim);
|
||||
await wait();
|
||||
})(),
|
||||
);
|
||||
@@ -127,7 +127,7 @@ async function action(options: {
|
||||
? downloadOpts.dir.split("/").pop()
|
||||
: downloadOpts.dir.replace(/[./]/g, "");
|
||||
|
||||
if (!name || name.length === 0) name = "bknd";
|
||||
if (!name || name.length === 0) name = "userbase";
|
||||
|
||||
let template: Template | undefined;
|
||||
|
||||
@@ -254,7 +254,7 @@ async function action(options: {
|
||||
}
|
||||
|
||||
s.stop("Template downloaded.");
|
||||
await updateBkndPackages(ctx.dir);
|
||||
await updateUserbasePackages(ctx.dir);
|
||||
|
||||
if (template.preinstall) {
|
||||
await template.preinstall(ctx);
|
||||
@@ -335,7 +335,7 @@ async function action(options: {
|
||||
yield "\n\n";
|
||||
yield* typewriter(
|
||||
`Enter your project's directory using ${color.cyan("cd " + ctx.dir)}
|
||||
If you need help, check ${color.cyan("https://docs.bknd.io")} or join our Discord!`,
|
||||
If you need help, check ${color.cyan("https://docs.userbase.io")} or join our Discord!`,
|
||||
);
|
||||
await wait(2);
|
||||
})(),
|
||||
|
||||
@@ -92,10 +92,10 @@ export async function replacePackageJsonVersions(
|
||||
);
|
||||
}
|
||||
|
||||
export async function updateBkndPackages(dir?: string, map?: Record<string, string>) {
|
||||
export async function updateUserbasePackages(dir?: string, map?: Record<string, string>) {
|
||||
try {
|
||||
const versions = {
|
||||
bknd: await sysGetVersion(),
|
||||
userbase: await sysGetVersion(),
|
||||
...(map ?? {}),
|
||||
};
|
||||
await replacePackageJsonVersions(
|
||||
|
||||
@@ -9,8 +9,8 @@ export const aws = {
|
||||
key: "aws",
|
||||
title: "AWS Lambda Basic",
|
||||
integration: "aws",
|
||||
description: "A basic bknd AWS Lambda starter",
|
||||
path: "gh:bknd-io/bknd/examples/aws-lambda",
|
||||
description: "A basic userbase AWS Lambda starter",
|
||||
path: "gh:userbase-io/userbase/examples/aws-lambda",
|
||||
ref: true,
|
||||
setup: async (ctx) => {
|
||||
await $p.stream.info(
|
||||
|
||||
@@ -11,8 +11,8 @@ export const cloudflare = {
|
||||
key: "cloudflare",
|
||||
title: "Cloudflare Basic",
|
||||
integration: "cloudflare",
|
||||
description: "A basic bknd Cloudflare worker",
|
||||
path: "gh:bknd-io/bknd/examples/cloudflare-worker",
|
||||
description: "A basic userbase Cloudflare worker",
|
||||
path: "gh:userbase-io/userbase/examples/cloudflare-worker",
|
||||
ref: true,
|
||||
setup: async (ctx) => {
|
||||
// overwrite assets directory & name
|
||||
@@ -22,7 +22,7 @@ export const cloudflare = {
|
||||
...json,
|
||||
name: ctx.name,
|
||||
assets: {
|
||||
directory: "node_modules/bknd/dist/static",
|
||||
directory: "node_modules/userbase/dist/static",
|
||||
},
|
||||
}),
|
||||
{ dir: ctx.dir },
|
||||
|
||||
@@ -6,15 +6,15 @@ export const deno = {
|
||||
key: "deno",
|
||||
title: "Deno Basic",
|
||||
integration: "deno",
|
||||
description: "A basic bknd Deno server with static assets",
|
||||
path: "gh:bknd-io/bknd/examples/deno",
|
||||
description: "A basic userbase Deno server with static assets",
|
||||
path: "gh:userbase-io/userbase/examples/deno",
|
||||
installDeps: false,
|
||||
ref: true,
|
||||
setup: async (ctx) => {
|
||||
const version = await getVersion();
|
||||
await overrideJson(
|
||||
"deno.json",
|
||||
(json) => ({ ...json, links: undefined, imports: { bknd: `npm:bknd@${version}` } }),
|
||||
(json) => ({ ...json, links: undefined, imports: { userbase: `npm:userbase@${version}` } }),
|
||||
{ dir: ctx.dir },
|
||||
);
|
||||
},
|
||||
|
||||
@@ -33,7 +33,7 @@ export type Template = {
|
||||
description?: string;
|
||||
path: string;
|
||||
/**
|
||||
* adds a ref "#{ref}" to the path. If "true", adds the current version of bknd
|
||||
* adds a ref "#{ref}" to the path. If "true", adds the current version of userbase
|
||||
*/
|
||||
ref?: true | string;
|
||||
/**
|
||||
@@ -53,48 +53,48 @@ export const templates: Template[] = [
|
||||
key: "node",
|
||||
title: "Node.js Basic",
|
||||
integration: "node",
|
||||
description: "A basic bknd Node.js server",
|
||||
path: "gh:bknd-io/bknd/examples/node",
|
||||
description: "A basic userbase Node.js server",
|
||||
path: "gh:userbase-io/userbase/examples/node",
|
||||
ref: true,
|
||||
},
|
||||
{
|
||||
key: "bun",
|
||||
title: "Bun Basic",
|
||||
integration: "bun",
|
||||
description: "A basic bknd Bun server",
|
||||
path: "gh:bknd-io/bknd/examples/bun",
|
||||
description: "A basic userbase Bun server",
|
||||
path: "gh:userbase-io/userbase/examples/bun",
|
||||
ref: true,
|
||||
},
|
||||
{
|
||||
key: "nextjs",
|
||||
title: "Next.js Basic",
|
||||
integration: "nextjs",
|
||||
description: "A basic bknd Next.js starter",
|
||||
path: "gh:bknd-io/bknd/examples/nextjs",
|
||||
description: "A basic userbase Next.js starter",
|
||||
path: "gh:userbase-io/userbase/examples/nextjs",
|
||||
ref: true,
|
||||
},
|
||||
{
|
||||
key: "astro",
|
||||
title: "Astro Basic",
|
||||
integration: "astro",
|
||||
description: "A basic bknd Astro starter",
|
||||
path: "gh:bknd-io/bknd/examples/astro",
|
||||
description: "A basic userbase Astro starter",
|
||||
path: "gh:userbase-io/userbase/examples/astro",
|
||||
ref: true,
|
||||
},
|
||||
{
|
||||
key: "react-router",
|
||||
title: "React Router Basic",
|
||||
integration: "react-router",
|
||||
description: "A basic bknd React Router starter",
|
||||
path: "gh:bknd-io/bknd/examples/react-router",
|
||||
description: "A basic userbase React Router starter",
|
||||
path: "gh:userbase-io/userbase/examples/react-router",
|
||||
ref: true,
|
||||
},
|
||||
{
|
||||
key: "aws",
|
||||
title: "AWS Lambda Basic",
|
||||
integration: "aws",
|
||||
description: "A basic bknd AWS Lambda starter",
|
||||
path: "gh:bknd-io/bknd/examples/aws-lambda",
|
||||
description: "A basic userbase AWS Lambda starter",
|
||||
path: "gh:userbase-io/userbase/examples/aws-lambda",
|
||||
ref: true,
|
||||
},
|
||||
deno,
|
||||
|
||||
Reference in New Issue
Block a user