Skip to content

Commit

Permalink
removed migrate prompt due to bug
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoalbanese committed Oct 23, 2023
1 parent e191319 commit 3f88637
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 36 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kirimase",
"version": "0.0.20",
"version": "0.0.21",
"description": "A Rails-like CLI for building full-stack Next.js apps faster",
"main": "index.js",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion src/commands/add/auth/lucia/generators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const generateViewsAndComponents = (withShadCn: boolean) => {
const loadingPage = generateLoadingPage();
return { signUpPage, signInPage, authFormComponent, homePage, loadingPage };
};
const generateLoadingPage = () => {
export const generateLoadingPage = () => {
return `export default function Loading() {
return (
<div className="grid place-items-center animate-pulse text-zinc-300 pt-4">
Expand Down
6 changes: 1 addition & 5 deletions src/commands/add/auth/shared/generators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -384,11 +384,7 @@ export default async function Account() {
<h1 className="text-3xl font-semibold my-6">Account</h1>
<div className="space-y-6">${
withStripe
? `\n <PlanSettings
subscriptionPlan={subscriptionPlan}
session={session}
/>
`
? `\n <PlanSettings subscriptionPlan={subscriptionPlan} session={session} />`
: ""
}
<UserSettings session={session} />
Expand Down
3 changes: 3 additions & 0 deletions src/commands/add/componentLib/shadcn-ui/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
import { AvailablePackage, PMType } from "../../../../types.js";
import { addContextProviderToLayout } from "../../utils.js";
import { shadcnGenerators } from "./generators.js";
import { generateLoadingPage } from "../../auth/lucia/generators.js";

const manualInstallShadCn = async (
preferredPackageManager: PMType,
Expand Down Expand Up @@ -45,6 +46,8 @@ const manualInstallShadCn = async (
// create components.json
createFile("components.json", generateComponentsJson(rootPath));

createFile(rootPath.concat("app/loading.tsx"), generateLoadingPage());

// todo: install theme switcher
// create theme provider
createFile(
Expand Down
4 changes: 2 additions & 2 deletions src/commands/add/misc/stripe/generators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -457,9 +457,9 @@ export default async function Account() {
<div className="space-y-6">
<PlanSettings
subscriptionPlan={subscriptionPlan}
user={session?.user!}
session={session}
/>
<UserSettings user={session?.user!} />
<UserSettings session={session} />
</div>
</main>
);
Expand Down
3 changes: 2 additions & 1 deletion src/commands/add/misc/stripe/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import { addPackage } from "../../index.js";
import { updateClerkMiddlewareForStripe } from "../../auth/clerk/utils.js";
import { AvailablePackage } from "../../../../types.js";
import { updateTRPCRouter } from "../../../generate/generators/trpcRoute.js";
import { createAccountPage } from "../../auth/shared/generators.js";

export const addStripe = async (packagesBeingInstalled: AvailablePackage[]) => {
const {
Expand Down Expand Up @@ -172,7 +173,7 @@ export const addStripe = async (packagesBeingInstalled: AvailablePackage[]) => {
);

// add billingcard to accountpage with billing card TODO
replaceFile(rootPath.concat("app/account/page.tsx"), generateAccountPage());
replaceFile(rootPath.concat("app/account/page.tsx"), createAccountPage(true));
// create account/billing/page.tsx
createFile(
rootPath.concat("app/account/billing/page.tsx"),
Expand Down
50 changes: 25 additions & 25 deletions src/commands/generate/generators/model/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,30 +40,30 @@ export async function scaffoldModel(
createFile(mutationPath, generateMutationContent(schema, driver, orm));

// migrate db
const migrate = await confirm({
message: "Would you like to generate the migration and migrate the DB?",
});
if (!migrate) return;
if (orm === "drizzle") {
await runCommand(preferredPackageManager, ["run", "db:generate"]);
driver === "sqlite"
? await runCommand(preferredPackageManager, ["run", "db:push"])
: await runCommand(preferredPackageManager, ["run", "db:migrate"]);
}
if (orm === "prisma") {
driver === "sqlite"
? await runCommand(preferredPackageManager, [
"run",
"prisma",
"db",
"push",
])
: await runCommand(preferredPackageManager, [
"run",
"prisma",
"migrate",
"dev",
]);
}
// const migrate = await confirm({
// message: "Would you like to generate the migration and migrate the DB?",
// });
// if (!migrate) return;
// if (orm === "drizzle") {
// await runCommand(preferredPackageManager, ["run", "db:generate"]);
// driver === "sqlite"
// ? await runCommand(preferredPackageManager, ["run", "db:push"])
// : await runCommand(preferredPackageManager, ["run", "db:migrate"]);
// }
// if (orm === "prisma") {
// driver === "sqlite"
// ? await runCommand(preferredPackageManager, [
// "run",
// "prisma",
// "db",
// "push",
// ])
// : await runCommand(preferredPackageManager, [
// "run",
// "prisma",
// "migrate",
// "dev",
// ]);
// }
consola.success("Successfully added model to your database!");
}
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { addPackage } from "./commands/add/index.js";
import { updateConfigFileAfterUpdate } from "./utils.js";

const program = new Command();
program.name("kirimase").description("Kirimase CLI").version("0.0.20");
program.name("kirimase").description("Kirimase CLI").version("0.0.21");

program
.command("init")
Expand Down

0 comments on commit 3f88637

Please sign in to comment.