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/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/.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/.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/.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 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/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/src/installers/dependencyVersionMap.ts b/cli/src/installers/dependencyVersionMap.ts index 56aa3d06..5df5e35b 100644 --- a/cli/src/installers/dependencyVersionMap.ts +++ b/cli/src/installers/dependencyVersionMap.ts @@ -45,7 +45,7 @@ export const dependencyVersionMap = { "@clerk/themes": "^2.1.33", // FileMaker Data API - "@proofgeist/fmdapi": "^4.2.1", + "@proofgeist/fmdapi": "^4.2.2", // ProofKit "@proofgeist/kit": `^${getVersion()}`, @@ -56,7 +56,7 @@ export const dependencyVersionMap = { "@tanstack/eslint-plugin-query": "^5.59.1", // ProofKit Auth - "@node-rs/argon2": "^2.0.0", + "@node-rs/argon2": "^2.0.2", "@oslojs/binary": "^1.0.0", "@oslojs/crypto": "^1.0.1", "@oslojs/encoding": "^1.1.0", 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 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); 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?"}