From 6e44193e95d7b66548f9696d4f986c3d85dd113b Mon Sep 17 00:00:00 2001 From: Eric Luce <37158449+eluce2@users.noreply.github.com> Date: Wed, 19 Feb 2025 13:55:32 -0600 Subject: [PATCH 1/6] do initial git commit --- .changeset/fair-colts-sin.md | 5 +++++ .changeset/poor-dragons-brush.md | 5 +++++ .changeset/rotten-peaches-do.md | 5 +++++ .changeset/tidy-buckets-obey.md | 5 +++++ cli/src/cli/add/page/index.ts | 2 +- cli/src/cli/init.ts | 18 +++++++++--------- cli/src/helpers/git.ts | 3 +++ cli/template/nextjs/src/app/layout.tsx | 2 +- 8 files changed, 34 insertions(+), 11 deletions(-) create mode 100644 .changeset/fair-colts-sin.md create mode 100644 .changeset/poor-dragons-brush.md create mode 100644 .changeset/rotten-peaches-do.md create mode 100644 .changeset/tidy-buckets-obey.md diff --git a/.changeset/fair-colts-sin.md b/.changeset/fair-colts-sin.md new file mode 100644 index 00000000..792d9747 --- /dev/null +++ b/.changeset/fair-colts-sin.md @@ -0,0 +1,5 @@ +--- +"@proofgeist/kit": patch +--- + +update helper text for npm after adding page diff --git a/.changeset/poor-dragons-brush.md b/.changeset/poor-dragons-brush.md new file mode 100644 index 00000000..3dc58532 --- /dev/null +++ b/.changeset/poor-dragons-brush.md @@ -0,0 +1,5 @@ +--- +"@proofgeist/kit": patch +--- + +additional supression of hydration warning diff --git a/.changeset/rotten-peaches-do.md b/.changeset/rotten-peaches-do.md new file mode 100644 index 00000000..12a245d1 --- /dev/null +++ b/.changeset/rotten-peaches-do.md @@ -0,0 +1,5 @@ +--- +"@proofgeist/kit": patch +--- + +move question about adding data source for new project diff --git a/.changeset/tidy-buckets-obey.md b/.changeset/tidy-buckets-obey.md new file mode 100644 index 00000000..9cc273cd --- /dev/null +++ b/.changeset/tidy-buckets-obey.md @@ -0,0 +1,5 @@ +--- +"@proofgeist/kit": patch +--- + +Make an initial commit when initializing git repo diff --git a/cli/src/cli/add/page/index.ts b/cli/src/cli/add/page/index.ts index cd4cc680..d0235242 100644 --- a/cli/src/cli/add/page/index.ts +++ b/cli/src/cli/add/page/index.ts @@ -183,7 +183,7 @@ export const runAddPageAction = async (opts?: { const pkgManager = getUserPkgManager(); console.log( - `\n${chalk.green("Next steps:")}\nTo preview this page, restart your dev server using the ${chalk.cyan(`${pkgManager} dev`)} command\n` + `\n${chalk.green("Next steps:")}\nTo preview this page, restart your dev server using the ${chalk.cyan(`${pkgManager === "npm" ? "npm run" : pkgManager} dev`)} command\n` ); }; diff --git a/cli/src/cli/init.ts b/cli/src/cli/init.ts index 39ceb753..324877e1 100644 --- a/cli/src/cli/init.ts +++ b/cli/src/cli/init.ts @@ -206,6 +206,15 @@ export const runInit = async (name?: string, opts?: CliFlags) => { // e.g. dir/@mono/app returns ["@mono/app", "dir/app"] const [scopedAppName, appDir] = parseNameAndPath(projectName); + const projectDir = await createBareProject({ + projectName: appDir, + scopedAppName, + packages: usePackages, + noInstall: cliOptions.noInstall, + appRouter: cliOptions.appRouter, + }); + setImportAlias(projectDir, "@/"); + const dataSource = cliOptions.dataSource ?? abortIfCancel( @@ -227,15 +236,6 @@ export const runInit = async (name?: string, opts?: CliFlags) => { }) ); - const projectDir = await createBareProject({ - projectName: appDir, - scopedAppName, - packages: usePackages, - noInstall: cliOptions.noInstall, - appRouter: cliOptions.appRouter, - }); - setImportAlias(projectDir, "@/"); - if (state.appType === "webviewer") { await promptForFileMakerDataSource({ projectDir, diff --git a/cli/src/helpers/git.ts b/cli/src/helpers/git.ts index 527c7fd4..83a7a894 100644 --- a/cli/src/helpers/git.ts +++ b/cli/src/helpers/git.ts @@ -120,6 +120,9 @@ export const initializeGit = async (projectDir: string) => { }); } await execa("git", ["add", "."], { cwd: projectDir }); + await execa("git", ["commit", "-m", "Initial commit"], { + cwd: projectDir, + }); spinner.succeed( `${chalk.green("Successfully initialized and staged")} ${chalk.green.bold( "git" diff --git a/cli/template/nextjs/src/app/layout.tsx b/cli/template/nextjs/src/app/layout.tsx index 2b4efe54..9512cb63 100644 --- a/cli/template/nextjs/src/app/layout.tsx +++ b/cli/template/nextjs/src/app/layout.tsx @@ -22,7 +22,7 @@ export default function RootLayout({ children, }: Readonly<{ children: React.ReactNode }>) { return ( - + From e0682aaed2cdecaac4fea0abe2975785b6fc85fd Mon Sep 17 00:00:00 2001 From: Eric Luce <37158449+eluce2@users.noreply.github.com> Date: Wed, 19 Feb 2025 14:07:35 -0600 Subject: [PATCH 2/6] Add Cursor rules file to project scaffolding --- .changeset/young-parents-dance.md | 5 ++ cli/src/helpers/scaffoldProject.ts | 16 ++++ .../extras/_cursor/rules/cursor-rules.mdc | 75 +++++++++++++++++++ 3 files changed, 96 insertions(+) create mode 100644 .changeset/young-parents-dance.md create mode 100644 cli/template/extras/_cursor/rules/cursor-rules.mdc diff --git a/.changeset/young-parents-dance.md b/.changeset/young-parents-dance.md new file mode 100644 index 00000000..63d4c03f --- /dev/null +++ b/.changeset/young-parents-dance.md @@ -0,0 +1,5 @@ +--- +"@proofgeist/kit": patch +--- + +Copy cursor rules.mdc file into the base project. diff --git a/cli/src/helpers/scaffoldProject.ts b/cli/src/helpers/scaffoldProject.ts index 76982e6b..aa3d93c4 100644 --- a/cli/src/helpers/scaffoldProject.ts +++ b/cli/src/helpers/scaffoldProject.ts @@ -22,6 +22,8 @@ export const scaffoldProject = async ({ state.appType === "browser" ? "template/nextjs" : "template/vite-wv" ); + const extrasDir = path.join(PKG_ROOT, "template/extras"); + if (!noInstall) { logger.info(`\nUsing: ${chalk.cyan.bold(pkgManager)}\n`); } else { @@ -89,7 +91,21 @@ export const scaffoldProject = async ({ spinner.start(); + // Copy the main template fs.copySync(srcDir, projectDir); + + // Copy cursor rules file + const cursorRulesSrc = path.join(extrasDir, "_cursor/rules/cursor-rules.mdc"); + const cursorRulesDest = path.join( + projectDir, + ".cursor/rules/cursor-rules.mdc" + ); + if (fs.existsSync(cursorRulesSrc)) { + fs.ensureDirSync(path.dirname(cursorRulesDest)); + fs.copySync(cursorRulesSrc, cursorRulesDest); + } + + // Rename gitignore fs.renameSync( path.join(projectDir, "_gitignore"), path.join(projectDir, ".gitignore") diff --git a/cli/template/extras/_cursor/rules/cursor-rules.mdc b/cli/template/extras/_cursor/rules/cursor-rules.mdc new file mode 100644 index 00000000..f6d4c275 --- /dev/null +++ b/cli/template/extras/_cursor/rules/cursor-rules.mdc @@ -0,0 +1,75 @@ +--- +description: Cursor Rules Location +globs: *.mdc +--- +# Cursor Rules Location + +Rules for placing and organizing Cursor rule files in the repository. + + +name: cursor_rules_location +description: Standards for placing Cursor rule files in the correct directory +filters: + # Match any .mdc files + - type: file_extension + pattern: "\\.mdc$" + # Match files that look like Cursor rules + - type: content + pattern: "(?s).*?" + # Match file creation events + - type: event + pattern: "file_create" + +actions: + - type: reject + conditions: + - pattern: "^(?!\\.\\/\\.cursor\\/rules\\/.*\\.mdc$)" + message: "Cursor rule files (.mdc) must be placed in the .cursor/rules directory" + + - type: suggest + message: | + When creating Cursor rules: + + 1. Always place rule files in PROJECT_ROOT/.cursor/rules/: + ``` + .cursor/rules/ + ├── your-rule-name.mdc + ├── another-rule.mdc + └── ... + ``` + + 2. Follow the naming convention: + - Use kebab-case for filenames + - Always use .mdc extension + - Make names descriptive of the rule's purpose + + 3. Directory structure: + ``` + PROJECT_ROOT/ + ├── .cursor/ + │ └── rules/ + │ ├── your-rule-name.mdc + │ └── ... + └── ... + ``` + + 4. Never place rule files: + - In the project root + - In subdirectories outside .cursor/rules + - In any other location + +examples: + - input: | + # Bad: Rule file in wrong location + rules/my-rule.mdc + my-rule.mdc + .rules/my-rule.mdc + + # Good: Rule file in correct location + .cursor/rules/my-rule.mdc + output: "Correctly placed Cursor rule file" + +metadata: + priority: high + version: 1.0 + \ No newline at end of file From b0502aceb41fdce5fa2c785e8dad862264cd8247 Mon Sep 17 00:00:00 2001 From: Eric Luce <37158449+eluce2@users.noreply.github.com> Date: Wed, 19 Feb 2025 14:08:42 -0600 Subject: [PATCH 3/6] Add cursor rules to root of project. --- .cursor/rules/cursor-rules.mdc | 75 ++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 .cursor/rules/cursor-rules.mdc diff --git a/.cursor/rules/cursor-rules.mdc b/.cursor/rules/cursor-rules.mdc new file mode 100644 index 00000000..f6d4c275 --- /dev/null +++ b/.cursor/rules/cursor-rules.mdc @@ -0,0 +1,75 @@ +--- +description: Cursor Rules Location +globs: *.mdc +--- +# Cursor Rules Location + +Rules for placing and organizing Cursor rule files in the repository. + + +name: cursor_rules_location +description: Standards for placing Cursor rule files in the correct directory +filters: + # Match any .mdc files + - type: file_extension + pattern: "\\.mdc$" + # Match files that look like Cursor rules + - type: content + pattern: "(?s).*?" + # Match file creation events + - type: event + pattern: "file_create" + +actions: + - type: reject + conditions: + - pattern: "^(?!\\.\\/\\.cursor\\/rules\\/.*\\.mdc$)" + message: "Cursor rule files (.mdc) must be placed in the .cursor/rules directory" + + - type: suggest + message: | + When creating Cursor rules: + + 1. Always place rule files in PROJECT_ROOT/.cursor/rules/: + ``` + .cursor/rules/ + ├── your-rule-name.mdc + ├── another-rule.mdc + └── ... + ``` + + 2. Follow the naming convention: + - Use kebab-case for filenames + - Always use .mdc extension + - Make names descriptive of the rule's purpose + + 3. Directory structure: + ``` + PROJECT_ROOT/ + ├── .cursor/ + │ └── rules/ + │ ├── your-rule-name.mdc + │ └── ... + └── ... + ``` + + 4. Never place rule files: + - In the project root + - In subdirectories outside .cursor/rules + - In any other location + +examples: + - input: | + # Bad: Rule file in wrong location + rules/my-rule.mdc + my-rule.mdc + .rules/my-rule.mdc + + # Good: Rule file in correct location + .cursor/rules/my-rule.mdc + output: "Correctly placed Cursor rule file" + +metadata: + priority: high + version: 1.0 + \ No newline at end of file From 183988b9de3d0c09d07dea9a3bdc7a7e4dd88446 Mon Sep 17 00:00:00 2001 From: Eric Luce <37158449+eluce2@users.noreply.github.com> Date: Wed, 19 Feb 2025 14:15:30 -0600 Subject: [PATCH 4/6] Fix typo in notification helpers import path --- .changeset/tasty-ties-speak.md | 5 +++++ .../app/(main)/auth/profile/reset-password-form.tsx | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/tasty-ties-speak.md diff --git a/.changeset/tasty-ties-speak.md b/.changeset/tasty-ties-speak.md new file mode 100644 index 00000000..389f2217 --- /dev/null +++ b/.changeset/tasty-ties-speak.md @@ -0,0 +1,5 @@ +--- +"@proofgeist/kit": patch +--- + +fix import path for reset password helper diff --git a/cli/template/extras/fmaddon-auth/app/(main)/auth/profile/reset-password-form.tsx b/cli/template/extras/fmaddon-auth/app/(main)/auth/profile/reset-password-form.tsx index d9060d8c..71004c1e 100644 --- a/cli/template/extras/fmaddon-auth/app/(main)/auth/profile/reset-password-form.tsx +++ b/cli/template/extras/fmaddon-auth/app/(main)/auth/profile/reset-password-form.tsx @@ -14,7 +14,7 @@ import { import { TextInput } from "@mantine/core"; import { Stack } from "@mantine/core"; import { useState } from "react"; -import { showSuccessNotification } from "@/utils/notifcation-helpers"; +import { showSuccessNotification } from "@/utils/notification-helpers"; export default function UpdatePasswordForm() { const [showForm, setShowForm] = useState(false); From e97a8fe08b37c3a94daf41c45414981d722ba53d Mon Sep 17 00:00:00 2001 From: Eric Luce <37158449+eluce2@users.noreply.github.com> Date: Wed, 19 Feb 2025 14:28:28 -0600 Subject: [PATCH 5/6] fix eslint errors --- cli/template/extras/fmaddon-auth/app/auth/verify-email/page.tsx | 2 +- .../extras/fmaddon-auth/app/auth/verify-email/resend-button.tsx | 2 +- cli/template/extras/fmaddon-auth/server/auth/utils/session.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cli/template/extras/fmaddon-auth/app/auth/verify-email/page.tsx b/cli/template/extras/fmaddon-auth/app/auth/verify-email/page.tsx index 4c14b08f..5b3069c6 100644 --- a/cli/template/extras/fmaddon-auth/app/auth/verify-email/page.tsx +++ b/cli/template/extras/fmaddon-auth/app/auth/verify-email/page.tsx @@ -15,7 +15,7 @@ export default async function Page() { // TODO: Ideally we'd sent a new verification email automatically if the previous one is expired, // but we can't set cookies inside server components. - let verificationRequest = await getUserEmailVerificationRequestFromRequest(); + const verificationRequest = await getUserEmailVerificationRequestFromRequest(); if (verificationRequest === null && user.emailVerified) { const redirectTo = await getRedirectCookie(); return redirect(redirectTo); diff --git a/cli/template/extras/fmaddon-auth/app/auth/verify-email/resend-button.tsx b/cli/template/extras/fmaddon-auth/app/auth/verify-email/resend-button.tsx index 1e5275ca..ca862eb4 100644 --- a/cli/template/extras/fmaddon-auth/app/auth/verify-email/resend-button.tsx +++ b/cli/template/extras/fmaddon-auth/app/auth/verify-email/resend-button.tsx @@ -9,7 +9,7 @@ export default function ResendButton() { - Didn't receive the email? + {"Didn't receive the email?"}