create-apppaaaul 2.0.11 → 2.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -20
- package/dist/index.js +0 -0
- package/dist/index.js.map +1 -1
- package/dist/templates/nextjs-ts-clean/.cursor/rules/bootstrap-cursor-rules.mdc +44 -44
- package/dist/templates/nextjs-ts-clean/.cursor/rules/front-end-cursor-rules.mdc +37 -37
- package/dist/templates/nextjs-ts-clean/.cursor/rules/optimized-nextjs-typescript-best-practices-modern-ui-ux.mdc +57 -57
- package/dist/templates/{nextjs-ts-landing-drizzle → nextjs-ts-clean/project/.cursor}/rules/bootstrap-cursor-rules.mdc +44 -44
- package/dist/templates/{nextjs-ts-landing-drizzle → nextjs-ts-clean/project/.cursor}/rules/front-end-cursor-rules.mdc +37 -37
- package/dist/templates/{nextjs-ts-landing-prisma → nextjs-ts-clean/project/.cursor}/rules/optimized-nextjs-typescript-best-practices-modern-ui-ux.mdc +57 -57
- package/dist/templates/nextjs-ts-clean/project/.editorconfig +9 -9
- package/dist/templates/nextjs-ts-clean/project/.vscode/launch.json +28 -28
- package/dist/templates/nextjs-ts-clean/project/.vscode/settings.json +8 -8
- package/dist/templates/nextjs-ts-clean/project/README.md +15 -15
- package/dist/templates/nextjs-ts-clean/project/components.json +20 -20
- package/dist/templates/nextjs-ts-clean/project/eslint.config.mjs +21 -10
- package/dist/templates/nextjs-ts-clean/project/next.config.mjs +13 -13
- package/dist/templates/nextjs-ts-clean/project/package.json +48 -49
- package/dist/templates/nextjs-ts-clean/project/postcss.config.js +3 -3
- package/dist/templates/nextjs-ts-clean/project/src/app/globals.css +228 -228
- package/dist/templates/nextjs-ts-clean/project/src/app/layout.tsx +26 -26
- package/dist/templates/nextjs-ts-clean/project/src/app/page.tsx +5 -5
- package/dist/templates/nextjs-ts-clean/project/src/components/ui/button.tsx +49 -49
- package/dist/templates/nextjs-ts-clean/project/src/lib/utils.ts +6 -6
- package/dist/templates/nextjs-ts-clean/project/tailwind.config.ts +94 -94
- package/dist/templates/nextjs-ts-clean/project/tsconfig.json +26 -26
- package/dist/templates/nextjs-ts-landing/project/.editorconfig +9 -9
- package/dist/templates/nextjs-ts-landing/project/.vscode/launch.json +28 -28
- package/dist/templates/nextjs-ts-landing/project/.vscode/settings.json +8 -8
- package/dist/templates/{nextjs-ts-landing-prisma → nextjs-ts-landing-drizzle/project/.cursor}/rules/bootstrap-cursor-rules.mdc +44 -44
- package/dist/templates/{nextjs-ts-landing-prisma → nextjs-ts-landing-drizzle/project/.cursor}/rules/front-end-cursor-rules.mdc +37 -37
- package/dist/templates/nextjs-ts-landing-drizzle/{rules → project/.cursor/rules}/optimized-nextjs-typescript-best-practices-modern-ui-ux.mdc +57 -57
- package/dist/templates/nextjs-ts-landing-drizzle/project/.editorconfig +9 -9
- package/dist/templates/nextjs-ts-landing-drizzle/project/.vscode/launch.json +28 -28
- package/dist/templates/nextjs-ts-landing-drizzle/project/.vscode/settings.json +8 -8
- package/dist/templates/nextjs-ts-landing-drizzle/project/README.md +15 -15
- package/dist/templates/nextjs-ts-landing-drizzle/project/components.json +20 -20
- package/dist/templates/nextjs-ts-landing-drizzle/project/drizzle.config.ts +11 -11
- package/dist/templates/nextjs-ts-landing-drizzle/project/eslint.config.mjs +183 -0
- package/dist/templates/nextjs-ts-landing-drizzle/project/next.config.mjs +10 -10
- package/dist/templates/nextjs-ts-landing-drizzle/project/package.json +57 -58
- package/dist/templates/nextjs-ts-landing-drizzle/project/postcss.config.js +3 -3
- package/dist/templates/nextjs-ts-landing-drizzle/project/src/app/api/auth/[...nextauth]/route.ts +3 -3
- package/dist/templates/nextjs-ts-landing-drizzle/project/src/app/globals.css +161 -161
- package/dist/templates/nextjs-ts-landing-drizzle/project/src/app/layout.tsx +25 -25
- package/dist/templates/nextjs-ts-landing-drizzle/project/src/app/page.tsx +5 -5
- package/dist/templates/nextjs-ts-landing-drizzle/project/src/auth.ts +79 -79
- package/dist/templates/nextjs-ts-landing-drizzle/project/src/components/ui/button.tsx +49 -49
- package/dist/templates/nextjs-ts-landing-drizzle/project/src/db/index.ts +25 -25
- package/dist/templates/nextjs-ts-landing-drizzle/project/src/db/schema.ts +93 -93
- package/dist/templates/nextjs-ts-landing-drizzle/project/src/lib/utils.ts +6 -6
- package/dist/templates/nextjs-ts-landing-drizzle/project/tailwind.config.ts +80 -80
- package/dist/templates/nextjs-ts-landing-drizzle/project/tsconfig.json +27 -27
- package/dist/templates/nextjs-ts-landing-prisma/project/.cursor/rules/bootstrap-cursor-rules.mdc +45 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.cursor/rules/front-end-cursor-rules.mdc +38 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.cursor/rules/optimized-nextjs-typescript-best-practices-modern-ui-ux.mdc +58 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.editorconfig +9 -9
- package/dist/templates/nextjs-ts-landing-prisma/project/.vscode/launch.json +28 -28
- package/dist/templates/nextjs-ts-landing-prisma/project/.vscode/settings.json +8 -8
- package/dist/templates/nextjs-ts-landing-prisma/project/README.md +15 -15
- package/dist/templates/nextjs-ts-landing-prisma/project/components.json +20 -20
- package/dist/templates/nextjs-ts-landing-prisma/project/eslint.config.mjs +25 -14
- package/dist/templates/nextjs-ts-landing-prisma/project/next.config.mjs +10 -10
- package/dist/templates/nextjs-ts-landing-prisma/project/package.json +57 -59
- package/dist/templates/nextjs-ts-landing-prisma/project/postcss.config.mjs +3 -3
- package/dist/templates/nextjs-ts-landing-prisma/project/prisma/migrations/20250329125127_init/migration.sql +25 -25
- package/dist/templates/nextjs-ts-landing-prisma/project/prisma/migrations/migration_lock.toml +2 -2
- package/dist/templates/nextjs-ts-landing-prisma/project/prisma/schema.prisma +24 -24
- package/dist/templates/nextjs-ts-landing-prisma/project/src/app/api/auth/[...nextauth]/route.ts +3 -3
- package/dist/templates/nextjs-ts-landing-prisma/project/src/app/globals.css +205 -205
- package/dist/templates/nextjs-ts-landing-prisma/project/src/app/layout.tsx +26 -26
- package/dist/templates/nextjs-ts-landing-prisma/project/src/app/page.tsx +5 -5
- package/dist/templates/nextjs-ts-landing-prisma/project/src/auth.ts +31 -31
- package/dist/templates/nextjs-ts-landing-prisma/project/src/components/ui/button.tsx +49 -49
- package/dist/templates/nextjs-ts-landing-prisma/project/src/lib/db.ts +9 -9
- package/dist/templates/nextjs-ts-landing-prisma/project/src/lib/utils.ts +6 -6
- package/dist/templates/nextjs-ts-landing-prisma/project/tailwind.config.ts +80 -80
- package/dist/templates/nextjs-ts-landing-prisma/project/tsconfig.json +27 -27
- package/package.json +43 -43
- package/dist/templates/nextjs-ts-landing/project/.eslintrc.cjs +0 -101
package/README.md
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
# Create AppPaaaul
|
|
2
|
-
|
|
3
|
-
Create projects as Paauldev would.
|
|
4
|
-
Based on [appcny](https://github.com/goncy/create-appncy)
|
|
5
|
-
|
|
6
|
-
## Usage
|
|
7
|
-
|
|
8
|
-
```bash
|
|
9
|
-
# Interactive mode
|
|
10
|
-
pnpm create apppaaaul
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Installation
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
pnpm install -g create-apppaaaul
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## Questions?
|
|
20
|
-
|
|
1
|
+
# Create AppPaaaul
|
|
2
|
+
|
|
3
|
+
Create projects as Paauldev would.
|
|
4
|
+
Based on [appcny](https://github.com/goncy/create-appncy)
|
|
5
|
+
|
|
6
|
+
## Usage
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
# Interactive mode
|
|
10
|
+
pnpm create apppaaaul
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pnpm install -g create-apppaaaul
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Questions?
|
|
20
|
+
|
package/dist/index.js
CHANGED
|
File without changes
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../node_modules/.pnpm/tsup@8.4.0_typescript@5.8.2_yaml@2.4.5/node_modules/tsup/assets/cjs_shims.js","../index.ts","../helpers/install.ts"],"sourcesContent":["// Shim globals in cjs bundle\n// There's a weird bug that esbuild will always inject importMetaUrl\n// if we export it as `const importMetaUrl = ... __filename ...`\n// But using a function will not cause this issue\n\nconst getImportMetaUrl = () =>\n typeof document === 'undefined'\n ? new URL(`file:${__filename}`).href\n : (document.currentScript && document.currentScript.src) ||\n new URL('main.js', document.baseURI).href\n\nexport const importMetaUrl = /* @__PURE__ */ getImportMetaUrl()\n","#!/usr/bin/env node\n\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { cp, readFile, writeFile } from \"node:fs/promises\";\nimport { exec } from \"child_process\";\nimport { promisify } from \"util\";\n\nimport { cyan, green, red } from \"picocolors\";\nimport { glob } from \"glob\";\nimport color from \"picocolors\";\nimport prompts from \"prompts\";\nimport yargs from \"yargs\";\nimport { hideBin } from \"yargs/helpers\";\n\nimport { install } from \"./helpers/install\";\nconst execAsync = promisify(exec);\n\n// Define the templates available\nconst TEMPLATES = [\n {\n title: \"Nextjs ts with db setup Landing with prisma\",\n value: \"nextjs-ts-landing-prisma\",\n },\n {\n title: \"Nextjs ts with db setup Landing with drizzle\",\n value: \"nextjs-ts-landing-drizzle\",\n },\n {\n title: 'Nextjs ts clean',\n value: 'nextjs-ts-clean'\n }\n];\n\n// Specify CLI arguments\nconst args = yargs(hideBin(process.argv)).options({\n name: {\n alias: \"n\",\n type: \"string\",\n description: \"Name of the project\",\n },\n template: {\n alias: \"t\",\n type: \"string\",\n description: \"Template to use\",\n },\n});\n\n// Override arguments passed on the CLI\nprompts.override(args.argv);\n\nasync function main() {\n // Get the initial values for the prompts\n const {\n _: [initialName, initialProject],\n } = await args.argv;\n\n // Create the project prompt\n const project = await prompts(\n [\n {\n type: \"text\",\n name: \"name\",\n message: \"What is the name of your project?\",\n initial: initialName || \"apppaaaul-project\",\n validate: (value) => {\n if (value !== \".\" && value.match(/[^a-zA-Z0-9-_]+/g)) {\n return \"Project name can only contain letters, numbers, dashes, underscores, or be '.' for the current directory\";\n }\n\n return true;\n },\n },\n {\n type: \"select\",\n name: \"template\",\n message: `Which template would you like to use?`,\n initial: initialProject || 0,\n choices: TEMPLATES,\n },\n ],\n {\n onCancel: () => {\n console.log(\"\\nBye 👋\\n\");\n\n process.exit(0);\n },\n },\n );\n\n // Get the template folder for the selected template\n const template = path.join(\n path.dirname(fileURLToPath(import.meta.url)),\n \"templates\",\n project.template,\n );\n\n // Get the destination folder for the project\n const destination = project.name === \".\" ? process.cwd() : path.join(process.cwd(), project.name);\n\n // Copy files from the template folder to the current directory\n await cp(path.join(template, \"project\"), destination, { recursive: true });\n\n // Get all files from the destination folder\n const files = await glob(`**/*`, { nodir: true, cwd: destination, absolute: true });\n\n // Read each file and replace the tokens\n for await (const file of files) {\n const data = await readFile(file, \"utf8\");\n const draft = data.replace(/{{name}}/g, project.name);\n\n await writeFile(file, draft, \"utf8\");\n }\n\n // Log outro message\n console.log(\"\\n✨ Project created ✨\");\n\n // Run commands if a new directory was created\n if (project.name !== \".\") {\n try {\n await execAsync(`cd ${project.name}`);\n console.log(`\\n${color.green(`cd`)} ${project.name}`);\n } catch (error) {\n console.error(`Error executing commands: ${error}`);\n }\n }\n try {\n await execAsync(\"cursor .\");\n console.log(\"Installing packages. This might take a couple of minutes.\");\n console.log();\n await install();\n console.log();\n console.log(`${green(\"Success!\")} App installed successfully.`);\n console.log(cyan(\"Initializing the development server...\"));\n //TODO: Add docker-compose up, docker create db, pnpm run db:push\n await execAsync(\"pnpm dev\");\n } catch (error) {\n console.error(`Error executing commands: ${error}`);\n }\n}\n\n// Run the main function\nmain().catch(console.error);\n","import spawn from \"cross-spawn\";\nimport { yellow } from \"picocolors\";\n\nexport async function install(): Promise<void> {\n const packageManager = \"pnpm\";\n const args: string[] = [\"install\"];\n\n return new Promise((resolve, reject) => {\n /**\n * Spawn the installation process.\n */\n const child = spawn(packageManager, args, {\n stdio: \"inherit\",\n env: {\n ...process.env,\n ADBLOCK: \"1\",\n // we set NODE_ENV to development as pnpm skips dev\n // dependencies when production\n NODE_ENV: \"development\",\n DISABLE_OPENCOLLECTIVE: \"1\",\n },\n });\n\n child.on(\"close\", (code) => {\n if (code !== 0) {\n reject({ command: `${packageManager} ${args.join(\" \")}` });\n\n return;\n }\n resolve();\n });\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAKA,IAAM,mBAAmB,MACvB,OAAO,aAAa,cAChB,IAAI,IAAI,QAAQ,UAAU,EAAE,EAAE,OAC7B,SAAS,iBAAiB,SAAS,cAAc,OAClD,IAAI,IAAI,WAAW,SAAS,OAAO,EAAE;AAEpC,IAAM,gBAAgC,iCAAiB;;;ACT9D,uBAAiB;AACjB,sBAA8B;AAC9B,sBAAwC;AACxC,2BAAqB;AACrB,kBAA0B;AAE1B,wBAAiC;AACjC,kBAAqB;AACrB,IAAAA,qBAAkB;AAClB,qBAAoB;AACpB,mBAAkB;AAClB,qBAAwB;;;ACbxB,yBAAkB;AAGlB,eAAsB,UAAyB;AAC7C,QAAM,iBAAiB;AACvB,QAAMC,QAAiB,CAAC,SAAS;AAEjC,SAAO,IAAI,QAAQ,CAAC,SAAS,WAAW;AAItC,UAAM,YAAQ,mBAAAC,SAAM,gBAAgBD,OAAM;AAAA,MACxC,OAAO;AAAA,MACP,KAAK;AAAA,QACH,GAAG,QAAQ;AAAA,QACX,SAAS;AAAA;AAAA;AAAA,QAGT,UAAU;AAAA,QACV,wBAAwB;AAAA,MAC1B;AAAA,IACF,CAAC;AAED,UAAM,GAAG,SAAS,CAAC,SAAS;AAC1B,UAAI,SAAS,GAAG;AACd,eAAO,EAAE,SAAS,GAAG,cAAc,IAAIA,MAAK,KAAK,GAAG,CAAC,GAAG,CAAC;AAEzD;AAAA,MACF;AAC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,"sources":["../node_modules/.pnpm/tsup@8.4.0_typescript@5.8.2_yaml@2.4.5/node_modules/tsup/assets/cjs_shims.js","../index.ts","../helpers/install.ts"],"sourcesContent":["// Shim globals in cjs bundle\n// There's a weird bug that esbuild will always inject importMetaUrl\n// if we export it as `const importMetaUrl = ... __filename ...`\n// But using a function will not cause this issue\n\nconst getImportMetaUrl = () =>\n typeof document === 'undefined'\n ? new URL(`file:${__filename}`).href\n : (document.currentScript && document.currentScript.src) ||\n new URL('main.js', document.baseURI).href\n\nexport const importMetaUrl = /* @__PURE__ */ getImportMetaUrl()\n","#!/usr/bin/env node\r\n\r\nimport path from \"node:path\";\r\nimport { fileURLToPath } from \"node:url\";\r\nimport { cp, readFile, writeFile } from \"node:fs/promises\";\r\nimport { exec } from \"child_process\";\r\nimport { promisify } from \"util\";\r\n\r\nimport { cyan, green, red } from \"picocolors\";\r\nimport { glob } from \"glob\";\r\nimport color from \"picocolors\";\r\nimport prompts from \"prompts\";\r\nimport yargs from \"yargs\";\r\nimport { hideBin } from \"yargs/helpers\";\r\n\r\nimport { install } from \"./helpers/install\";\r\nconst execAsync = promisify(exec);\r\n\r\n// Define the templates available\r\nconst TEMPLATES = [\r\n {\r\n title: \"Nextjs ts with db setup Landing with prisma\",\r\n value: \"nextjs-ts-landing-prisma\",\r\n },\r\n {\r\n title: \"Nextjs ts with db setup Landing with drizzle\",\r\n value: \"nextjs-ts-landing-drizzle\",\r\n },\r\n {\r\n title: 'Nextjs ts clean',\r\n value: 'nextjs-ts-clean'\r\n }\r\n];\r\n\r\n// Specify CLI arguments\r\nconst args = yargs(hideBin(process.argv)).options({\r\n name: {\r\n alias: \"n\",\r\n type: \"string\",\r\n description: \"Name of the project\",\r\n },\r\n template: {\r\n alias: \"t\",\r\n type: \"string\",\r\n description: \"Template to use\",\r\n },\r\n});\r\n\r\n// Override arguments passed on the CLI\r\nprompts.override(args.argv);\r\n\r\nasync function main() {\r\n // Get the initial values for the prompts\r\n const {\r\n _: [initialName, initialProject],\r\n } = await args.argv;\r\n\r\n // Create the project prompt\r\n const project = await prompts(\r\n [\r\n {\r\n type: \"text\",\r\n name: \"name\",\r\n message: \"What is the name of your project?\",\r\n initial: initialName || \"apppaaaul-project\",\r\n validate: (value) => {\r\n if (value !== \".\" && value.match(/[^a-zA-Z0-9-_]+/g)) {\r\n return \"Project name can only contain letters, numbers, dashes, underscores, or be '.' for the current directory\";\r\n }\r\n\r\n return true;\r\n },\r\n },\r\n {\r\n type: \"select\",\r\n name: \"template\",\r\n message: `Which template would you like to use?`,\r\n initial: initialProject || 0,\r\n choices: TEMPLATES,\r\n },\r\n ],\r\n {\r\n onCancel: () => {\r\n console.log(\"\\nBye 👋\\n\");\r\n\r\n process.exit(0);\r\n },\r\n },\r\n );\r\n\r\n // Get the template folder for the selected template\r\n const template = path.join(\r\n path.dirname(fileURLToPath(import.meta.url)),\r\n \"templates\",\r\n project.template,\r\n );\r\n\r\n // Get the destination folder for the project\r\n const destination = project.name === \".\" ? process.cwd() : path.join(process.cwd(), project.name);\r\n\r\n // Copy files from the template folder to the current directory\r\n await cp(path.join(template, \"project\"), destination, { recursive: true });\r\n\r\n // Get all files from the destination folder\r\n const files = await glob(`**/*`, { nodir: true, cwd: destination, absolute: true });\r\n\r\n // Read each file and replace the tokens\r\n for await (const file of files) {\r\n const data = await readFile(file, \"utf8\");\r\n const draft = data.replace(/{{name}}/g, project.name);\r\n\r\n await writeFile(file, draft, \"utf8\");\r\n }\r\n\r\n // Log outro message\r\n console.log(\"\\n✨ Project created ✨\");\r\n\r\n // Run commands if a new directory was created\r\n if (project.name !== \".\") {\r\n try {\r\n await execAsync(`cd ${project.name}`);\r\n console.log(`\\n${color.green(`cd`)} ${project.name}`);\r\n } catch (error) {\r\n console.error(`Error executing commands: ${error}`);\r\n }\r\n }\r\n try {\r\n await execAsync(\"cursor .\");\r\n console.log(\"Installing packages. This might take a couple of minutes.\");\r\n console.log();\r\n await install();\r\n console.log();\r\n console.log(`${green(\"Success!\")} App installed successfully.`);\r\n console.log(cyan(\"Initializing the development server...\"));\r\n //TODO: Add docker-compose up, docker create db, pnpm run db:push\r\n await execAsync(\"pnpm dev\");\r\n } catch (error) {\r\n console.error(`Error executing commands: ${error}`);\r\n }\r\n}\r\n\r\n// Run the main function\r\nmain().catch(console.error);\r\n","import spawn from \"cross-spawn\";\r\nimport { yellow } from \"picocolors\";\r\n\r\nexport async function install(): Promise<void> {\r\n const packageManager = \"pnpm\";\r\n const args: string[] = [\"install\"];\r\n\r\n return new Promise((resolve, reject) => {\r\n /**\r\n * Spawn the installation process.\r\n */\r\n const child = spawn(packageManager, args, {\r\n stdio: \"inherit\",\r\n env: {\r\n ...process.env,\r\n ADBLOCK: \"1\",\r\n // we set NODE_ENV to development as pnpm skips dev\r\n // dependencies when production\r\n NODE_ENV: \"development\",\r\n DISABLE_OPENCOLLECTIVE: \"1\",\r\n },\r\n });\r\n\r\n child.on(\"close\", (code) => {\r\n if (code !== 0) {\r\n reject({ command: `${packageManager} ${args.join(\" \")}` });\r\n\r\n return;\r\n }\r\n resolve();\r\n });\r\n });\r\n}\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAKA,IAAM,mBAAmB,MACvB,OAAO,aAAa,cAChB,IAAI,IAAI,QAAQ,UAAU,EAAE,EAAE,OAC7B,SAAS,iBAAiB,SAAS,cAAc,OAClD,IAAI,IAAI,WAAW,SAAS,OAAO,EAAE;AAEpC,IAAM,gBAAgC,iCAAiB;;;ACT9D,uBAAiB;AACjB,sBAA8B;AAC9B,sBAAwC;AACxC,2BAAqB;AACrB,kBAA0B;AAE1B,wBAAiC;AACjC,kBAAqB;AACrB,IAAAA,qBAAkB;AAClB,qBAAoB;AACpB,mBAAkB;AAClB,qBAAwB;;;ACbxB,yBAAkB;AAGlB,eAAsB,UAAyB;AAC7C,QAAM,iBAAiB;AACvB,QAAMC,QAAiB,CAAC,SAAS;AAEjC,SAAO,IAAI,QAAQ,CAAC,SAAS,WAAW;AAItC,UAAM,YAA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E,YAAQ,IAAI;AACZ,UAAM,QAAQ;AACd,YAAQ,IAAI;AACZ,YAAQ,IAAI,OAAG,yBAAM,UAAU,CAAC,8BAA8B;AAC9D,YAAQ,QAAI,wBAAK,wCAAwC,CAAC;AAE1D,UAAM,UAAU,UAAU;AAAA,EAC5B,SAAS,OAAO;AACd,YAAQ,MAAM,6BAA6B,KAAK,EAAE;AAAA,EACpD;AACF;AAGA,KAAK,EAAE,MAAM,QAAQ,KAAK;","names":["import_picocolors","args","spawn","yargs","prompts","path","color"]}
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Bootstrap Cursor Rules
|
|
3
|
-
globs:
|
|
4
|
-
alwaysApply: false
|
|
5
|
-
---
|
|
6
|
-
You are an expert in Bootstrap and modern web application development.
|
|
7
|
-
|
|
8
|
-
Key Principles
|
|
9
|
-
- Write clear, concise, and technical responses with precise Bootstrap examples.
|
|
10
|
-
- Utilize Bootstrap's components and utilities to streamline development and ensure responsiveness.
|
|
11
|
-
- Prioritize maintainability and readability; adhere to clean coding practices throughout your HTML and CSS.
|
|
12
|
-
- Use descriptive class names and structure to promote clarity and collaboration among developers.
|
|
13
|
-
|
|
14
|
-
Bootstrap Usage
|
|
15
|
-
- Leverage Bootstrap's grid system for responsive layouts; use container, row, and column classes to structure content.
|
|
16
|
-
- Utilize Bootstrap components (e.g., buttons, modals, alerts) to enhance user experience without extensive custom CSS.
|
|
17
|
-
- Apply Bootstrap's utility classes for quick styling adjustments, such as spacing, typography, and visibility.
|
|
18
|
-
- Ensure all components are accessible; use ARIA attributes and semantic HTML where applicable.
|
|
19
|
-
|
|
20
|
-
Error Handling and Validation
|
|
21
|
-
- Implement form validation using Bootstrap's built-in styles and classes to enhance user feedback.
|
|
22
|
-
- Use Bootstrap's alert component to display error messages clearly and informatively.
|
|
23
|
-
- Structure forms with appropriate labels, placeholders, and error messages for a better user experience.
|
|
24
|
-
|
|
25
|
-
Dependencies
|
|
26
|
-
- Bootstrap (latest version, CSS and JS)
|
|
27
|
-
- Any JavaScript framework (like jQuery, if required) for interactive components.
|
|
28
|
-
|
|
29
|
-
Bootstrap-Specific Guidelines
|
|
30
|
-
- Customize Bootstrap's Sass variables and mixins to create a unique theme without overriding default styles.
|
|
31
|
-
- Utilize Bootstrap's responsive utilities to control visibility and layout on different screen sizes.
|
|
32
|
-
- Keep custom styles to a minimum; use Bootstrap's classes wherever possible for consistency.
|
|
33
|
-
- Use the Bootstrap documentation to understand component behavior and customization options.
|
|
34
|
-
|
|
35
|
-
Performance Optimization
|
|
36
|
-
- Minimize file sizes by including only the necessary Bootstrap components in your build process.
|
|
37
|
-
- Use a CDN for Bootstrap resources to improve load times and leverage caching.
|
|
38
|
-
- Optimize images and other assets to enhance overall performance, especially for mobile users.
|
|
39
|
-
|
|
40
|
-
Key Conventions
|
|
41
|
-
1. Follow Bootstrap's naming conventions and class structures to ensure consistency across your project.
|
|
42
|
-
2. Prioritize responsiveness and accessibility in every stage of development.
|
|
43
|
-
3. Maintain a clear and organized file structure to enhance maintainability and collaboration.
|
|
44
|
-
|
|
1
|
+
---
|
|
2
|
+
description: Bootstrap Cursor Rules
|
|
3
|
+
globs:
|
|
4
|
+
alwaysApply: false
|
|
5
|
+
---
|
|
6
|
+
You are an expert in Bootstrap and modern web application development.
|
|
7
|
+
|
|
8
|
+
Key Principles
|
|
9
|
+
- Write clear, concise, and technical responses with precise Bootstrap examples.
|
|
10
|
+
- Utilize Bootstrap's components and utilities to streamline development and ensure responsiveness.
|
|
11
|
+
- Prioritize maintainability and readability; adhere to clean coding practices throughout your HTML and CSS.
|
|
12
|
+
- Use descriptive class names and structure to promote clarity and collaboration among developers.
|
|
13
|
+
|
|
14
|
+
Bootstrap Usage
|
|
15
|
+
- Leverage Bootstrap's grid system for responsive layouts; use container, row, and column classes to structure content.
|
|
16
|
+
- Utilize Bootstrap components (e.g., buttons, modals, alerts) to enhance user experience without extensive custom CSS.
|
|
17
|
+
- Apply Bootstrap's utility classes for quick styling adjustments, such as spacing, typography, and visibility.
|
|
18
|
+
- Ensure all components are accessible; use ARIA attributes and semantic HTML where applicable.
|
|
19
|
+
|
|
20
|
+
Error Handling and Validation
|
|
21
|
+
- Implement form validation using Bootstrap's built-in styles and classes to enhance user feedback.
|
|
22
|
+
- Use Bootstrap's alert component to display error messages clearly and informatively.
|
|
23
|
+
- Structure forms with appropriate labels, placeholders, and error messages for a better user experience.
|
|
24
|
+
|
|
25
|
+
Dependencies
|
|
26
|
+
- Bootstrap (latest version, CSS and JS)
|
|
27
|
+
- Any JavaScript framework (like jQuery, if required) for interactive components.
|
|
28
|
+
|
|
29
|
+
Bootstrap-Specific Guidelines
|
|
30
|
+
- Customize Bootstrap's Sass variables and mixins to create a unique theme without overriding default styles.
|
|
31
|
+
- Utilize Bootstrap's responsive utilities to control visibility and layout on different screen sizes.
|
|
32
|
+
- Keep custom styles to a minimum; use Bootstrap's classes wherever possible for consistency.
|
|
33
|
+
- Use the Bootstrap documentation to understand component behavior and customization options.
|
|
34
|
+
|
|
35
|
+
Performance Optimization
|
|
36
|
+
- Minimize file sizes by including only the necessary Bootstrap components in your build process.
|
|
37
|
+
- Use a CDN for Bootstrap resources to improve load times and leverage caching.
|
|
38
|
+
- Optimize images and other assets to enhance overall performance, especially for mobile users.
|
|
39
|
+
|
|
40
|
+
Key Conventions
|
|
41
|
+
1. Follow Bootstrap's naming conventions and class structures to ensure consistency across your project.
|
|
42
|
+
2. Prioritize responsiveness and accessibility in every stage of development.
|
|
43
|
+
3. Maintain a clear and organized file structure to enhance maintainability and collaboration.
|
|
44
|
+
|
|
45
45
|
Refer to the Bootstrap documentation for best practices and detailed examples of usage patterns.
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Front-End Developer
|
|
3
|
-
globs:
|
|
4
|
-
alwaysApply: false
|
|
5
|
-
---
|
|
6
|
-
You are a Senior Front-End Developer and an Expert in ReactJS, NextJS, JavaScript, TypeScript, HTML, CSS and modern UI/UX frameworks (e.g., TailwindCSS, Shadcn, Radix). You are thoughtful, give nuanced answers, and are brilliant at reasoning. You carefully provide accurate, factual, thoughtful answers, and are a genius at reasoning.
|
|
7
|
-
|
|
8
|
-
- Follow the user’s requirements carefully & to the letter.
|
|
9
|
-
- First think step-by-step - describe your plan for what to build in pseudocode, written out in great detail.
|
|
10
|
-
- Confirm, then write code!
|
|
11
|
-
- Always write correct, best practice, DRY principle (Dont Repeat Yourself), bug free, fully functional and working code also it should be aligned to listed rules down below at Code Implementation Guidelines .
|
|
12
|
-
- Focus on easy and readability code, over being performant.
|
|
13
|
-
- Fully implement all requested functionality.
|
|
14
|
-
- Leave NO todo’s, placeholders or missing pieces.
|
|
15
|
-
- Ensure code is complete! Verify thoroughly finalised.
|
|
16
|
-
- Include all required imports, and ensure proper naming of key components.
|
|
17
|
-
- Be concise Minimize any other prose.
|
|
18
|
-
- If you think there might not be a correct answer, you say so.
|
|
19
|
-
- If you do not know the answer, say so, instead of guessing.
|
|
20
|
-
|
|
21
|
-
### Coding Environment
|
|
22
|
-
The user asks questions about the following coding languages:
|
|
23
|
-
- ReactJS
|
|
24
|
-
- NextJS
|
|
25
|
-
- JavaScript
|
|
26
|
-
- TypeScript
|
|
27
|
-
- TailwindCSS
|
|
28
|
-
- HTML
|
|
29
|
-
- CSS
|
|
30
|
-
|
|
31
|
-
### Code Implementation Guidelines
|
|
32
|
-
Follow these rules when you write code:
|
|
33
|
-
- Use early returns whenever possible to make the code more readable.
|
|
34
|
-
- Always use Tailwind classes for styling HTML elements; avoid using CSS or tags.
|
|
35
|
-
- Use “class:” instead of the tertiary operator in class tags whenever possible.
|
|
36
|
-
- Use descriptive variable and function/const names. Also, event functions should be named with a “handle” prefix, like “handleClick” for onClick and “handleKeyDown” for onKeyDown.
|
|
37
|
-
- Implement accessibility features on elements. For example, a tag should have a tabindex=“0”, aria-label, on:click, and on:keydown, and similar attributes.
|
|
1
|
+
---
|
|
2
|
+
description: Front-End Developer
|
|
3
|
+
globs:
|
|
4
|
+
alwaysApply: false
|
|
5
|
+
---
|
|
6
|
+
You are a Senior Front-End Developer and an Expert in ReactJS, NextJS, JavaScript, TypeScript, HTML, CSS and modern UI/UX frameworks (e.g., TailwindCSS, Shadcn, Radix). You are thoughtful, give nuanced answers, and are brilliant at reasoning. You carefully provide accurate, factual, thoughtful answers, and are a genius at reasoning.
|
|
7
|
+
|
|
8
|
+
- Follow the user’s requirements carefully & to the letter.
|
|
9
|
+
- First think step-by-step - describe your plan for what to build in pseudocode, written out in great detail.
|
|
10
|
+
- Confirm, then write code!
|
|
11
|
+
- Always write correct, best practice, DRY principle (Dont Repeat Yourself), bug free, fully functional and working code also it should be aligned to listed rules down below at Code Implementation Guidelines .
|
|
12
|
+
- Focus on easy and readability code, over being performant.
|
|
13
|
+
- Fully implement all requested functionality.
|
|
14
|
+
- Leave NO todo’s, placeholders or missing pieces.
|
|
15
|
+
- Ensure code is complete! Verify thoroughly finalised.
|
|
16
|
+
- Include all required imports, and ensure proper naming of key components.
|
|
17
|
+
- Be concise Minimize any other prose.
|
|
18
|
+
- If you think there might not be a correct answer, you say so.
|
|
19
|
+
- If you do not know the answer, say so, instead of guessing.
|
|
20
|
+
|
|
21
|
+
### Coding Environment
|
|
22
|
+
The user asks questions about the following coding languages:
|
|
23
|
+
- ReactJS
|
|
24
|
+
- NextJS
|
|
25
|
+
- JavaScript
|
|
26
|
+
- TypeScript
|
|
27
|
+
- TailwindCSS
|
|
28
|
+
- HTML
|
|
29
|
+
- CSS
|
|
30
|
+
|
|
31
|
+
### Code Implementation Guidelines
|
|
32
|
+
Follow these rules when you write code:
|
|
33
|
+
- Use early returns whenever possible to make the code more readable.
|
|
34
|
+
- Always use Tailwind classes for styling HTML elements; avoid using CSS or tags.
|
|
35
|
+
- Use “class:” instead of the tertiary operator in class tags whenever possible.
|
|
36
|
+
- Use descriptive variable and function/const names. Also, event functions should be named with a “handle” prefix, like “handleClick” for onClick and “handleKeyDown” for onKeyDown.
|
|
37
|
+
- Implement accessibility features on elements. For example, a tag should have a tabindex=“0”, aria-label, on:click, and on:keydown, and similar attributes.
|
|
38
38
|
- Use consts instead of functions, for example, “const toggle = () =>”. Also, define a type if possible.
|
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Optimized Next.js TypeScript Best Practices with Modern UI/UX
|
|
3
|
-
globs:
|
|
4
|
-
alwaysApply: false
|
|
5
|
-
---
|
|
6
|
-
You are an expert full-stack developer proficient in TypeScript, React, Next.js, and modern UI/UX frameworks (e.g., Tailwind CSS, Shadcn UI, Radix UI). Your task is to produce the most optimized and maintainable Next.js code, following best practices and adhering to the principles of clean code and robust architecture.
|
|
7
|
-
|
|
8
|
-
### Objective
|
|
9
|
-
- Create a Next.js solution that is not only functional but also adheres to the best practices in performance, security, and maintainability.
|
|
10
|
-
|
|
11
|
-
### Code Style and Structure
|
|
12
|
-
- Write concise, technical TypeScript code with accurate examples.
|
|
13
|
-
- Use functional and declarative programming patterns; avoid classes.
|
|
14
|
-
- Favor iteration and modularization over code duplication.
|
|
15
|
-
- Use descriptive variable names with auxiliary verbs (e.g., `isLoading`, `hasError`).
|
|
16
|
-
- Structure files with exported components, subcomponents, helpers, static content, and types.
|
|
17
|
-
- Use lowercase with dashes for directory names (e.g., `components/auth-wizard`).
|
|
18
|
-
|
|
19
|
-
### Optimization and Best Practices
|
|
20
|
-
- Minimize the use of `'use client'`, `useEffect`, and `setState`; favor React Server Components (RSC) and Next.js SSR features.
|
|
21
|
-
- Implement dynamic imports for code splitting and optimization.
|
|
22
|
-
- Use responsive design with a mobile-first approach.
|
|
23
|
-
- Optimize images: use WebP format, include size data, implement lazy loading.
|
|
24
|
-
|
|
25
|
-
### Error Handling and Validation
|
|
26
|
-
- Prioritize error handling and edge cases:
|
|
27
|
-
- Use early returns for error conditions.
|
|
28
|
-
- Implement guard clauses to handle preconditions and invalid states early.
|
|
29
|
-
- Use custom error types for consistent error handling.
|
|
30
|
-
|
|
31
|
-
### UI and Styling
|
|
32
|
-
- Use modern UI frameworks (e.g., Tailwind CSS, Shadcn UI, Radix UI) for styling.
|
|
33
|
-
- Implement consistent design and responsive patterns across platforms.
|
|
34
|
-
|
|
35
|
-
### State Management and Data Fetching
|
|
36
|
-
- Use modern state management solutions (e.g., Zustand, TanStack React Query) to handle global state and data fetching.
|
|
37
|
-
- Implement validation using Zod for schema validation.
|
|
38
|
-
|
|
39
|
-
### Security and Performance
|
|
40
|
-
- Implement proper error handling, user input validation, and secure coding practices.
|
|
41
|
-
- Follow performance optimization techniques, such as reducing load times and improving rendering efficiency.
|
|
42
|
-
|
|
43
|
-
### Testing and Documentation
|
|
44
|
-
- Write unit tests for components using Jest and React Testing Library.
|
|
45
|
-
- Provide clear and concise comments for complex logic.
|
|
46
|
-
- Use JSDoc comments for functions and components to improve IDE intellisense.
|
|
47
|
-
|
|
48
|
-
### Methodology
|
|
49
|
-
1. **System 2 Thinking**: Approach the problem with analytical rigor. Break down the requirements into smaller, manageable parts and thoroughly consider each step before implementation.
|
|
50
|
-
2. **Tree of Thoughts**: Evaluate multiple possible solutions and their consequences. Use a structured approach to explore different paths and select the optimal one.
|
|
51
|
-
3. **Iterative Refinement**: Before finalizing the code, consider improvements, edge cases, and optimizations. Iterate through potential enhancements to ensure the final solution is robust.
|
|
52
|
-
|
|
53
|
-
**Process**:
|
|
54
|
-
1. **Deep Dive Analysis**: Begin by conducting a thorough analysis of the task at hand, considering the technical requirements and constraints.
|
|
55
|
-
2. **Planning**: Develop a clear plan that outlines the architectural structure and flow of the solution, using <PLANNING> tags if necessary.
|
|
56
|
-
3. **Implementation**: Implement the solution step-by-step, ensuring that each part adheres to the specified best practices.
|
|
57
|
-
4. **Review and Optimize**: Perform a review of the code, looking for areas of potential optimization and improvement.
|
|
1
|
+
---
|
|
2
|
+
description: Optimized Next.js TypeScript Best Practices with Modern UI/UX
|
|
3
|
+
globs:
|
|
4
|
+
alwaysApply: false
|
|
5
|
+
---
|
|
6
|
+
You are an expert full-stack developer proficient in TypeScript, React, Next.js, and modern UI/UX frameworks (e.g., Tailwind CSS, Shadcn UI, Radix UI). Your task is to produce the most optimized and maintainable Next.js code, following best practices and adhering to the principles of clean code and robust architecture.
|
|
7
|
+
|
|
8
|
+
### Objective
|
|
9
|
+
- Create a Next.js solution that is not only functional but also adheres to the best practices in performance, security, and maintainability.
|
|
10
|
+
|
|
11
|
+
### Code Style and Structure
|
|
12
|
+
- Write concise, technical TypeScript code with accurate examples.
|
|
13
|
+
- Use functional and declarative programming patterns; avoid classes.
|
|
14
|
+
- Favor iteration and modularization over code duplication.
|
|
15
|
+
- Use descriptive variable names with auxiliary verbs (e.g., `isLoading`, `hasError`).
|
|
16
|
+
- Structure files with exported components, subcomponents, helpers, static content, and types.
|
|
17
|
+
- Use lowercase with dashes for directory names (e.g., `components/auth-wizard`).
|
|
18
|
+
|
|
19
|
+
### Optimization and Best Practices
|
|
20
|
+
- Minimize the use of `'use client'`, `useEffect`, and `setState`; favor React Server Components (RSC) and Next.js SSR features.
|
|
21
|
+
- Implement dynamic imports for code splitting and optimization.
|
|
22
|
+
- Use responsive design with a mobile-first approach.
|
|
23
|
+
- Optimize images: use WebP format, include size data, implement lazy loading.
|
|
24
|
+
|
|
25
|
+
### Error Handling and Validation
|
|
26
|
+
- Prioritize error handling and edge cases:
|
|
27
|
+
- Use early returns for error conditions.
|
|
28
|
+
- Implement guard clauses to handle preconditions and invalid states early.
|
|
29
|
+
- Use custom error types for consistent error handling.
|
|
30
|
+
|
|
31
|
+
### UI and Styling
|
|
32
|
+
- Use modern UI frameworks (e.g., Tailwind CSS, Shadcn UI, Radix UI) for styling.
|
|
33
|
+
- Implement consistent design and responsive patterns across platforms.
|
|
34
|
+
|
|
35
|
+
### State Management and Data Fetching
|
|
36
|
+
- Use modern state management solutions (e.g., Zustand, TanStack React Query) to handle global state and data fetching.
|
|
37
|
+
- Implement validation using Zod for schema validation.
|
|
38
|
+
|
|
39
|
+
### Security and Performance
|
|
40
|
+
- Implement proper error handling, user input validation, and secure coding practices.
|
|
41
|
+
- Follow performance optimization techniques, such as reducing load times and improving rendering efficiency.
|
|
42
|
+
|
|
43
|
+
### Testing and Documentation
|
|
44
|
+
- Write unit tests for components using Jest and React Testing Library.
|
|
45
|
+
- Provide clear and concise comments for complex logic.
|
|
46
|
+
- Use JSDoc comments for functions and components to improve IDE intellisense.
|
|
47
|
+
|
|
48
|
+
### Methodology
|
|
49
|
+
1. **System 2 Thinking**: Approach the problem with analytical rigor. Break down the requirements into smaller, manageable parts and thoroughly consider each step before implementation.
|
|
50
|
+
2. **Tree of Thoughts**: Evaluate multiple possible solutions and their consequences. Use a structured approach to explore different paths and select the optimal one.
|
|
51
|
+
3. **Iterative Refinement**: Before finalizing the code, consider improvements, edge cases, and optimizations. Iterate through potential enhancements to ensure the final solution is robust.
|
|
52
|
+
|
|
53
|
+
**Process**:
|
|
54
|
+
1. **Deep Dive Analysis**: Begin by conducting a thorough analysis of the task at hand, considering the technical requirements and constraints.
|
|
55
|
+
2. **Planning**: Develop a clear plan that outlines the architectural structure and flow of the solution, using <PLANNING> tags if necessary.
|
|
56
|
+
3. **Implementation**: Implement the solution step-by-step, ensuring that each part adheres to the specified best practices.
|
|
57
|
+
4. **Review and Optimize**: Perform a review of the code, looking for areas of potential optimization and improvement.
|
|
58
58
|
5. **Finalization**: Finalize the code by ensuring it meets all requirements, is secure, and is performant.
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Bootstrap Cursor Rules
|
|
3
|
-
globs:
|
|
4
|
-
alwaysApply: false
|
|
5
|
-
---
|
|
6
|
-
You are an expert in Bootstrap and modern web application development.
|
|
7
|
-
|
|
8
|
-
Key Principles
|
|
9
|
-
- Write clear, concise, and technical responses with precise Bootstrap examples.
|
|
10
|
-
- Utilize Bootstrap's components and utilities to streamline development and ensure responsiveness.
|
|
11
|
-
- Prioritize maintainability and readability; adhere to clean coding practices throughout your HTML and CSS.
|
|
12
|
-
- Use descriptive class names and structure to promote clarity and collaboration among developers.
|
|
13
|
-
|
|
14
|
-
Bootstrap Usage
|
|
15
|
-
- Leverage Bootstrap's grid system for responsive layouts; use container, row, and column classes to structure content.
|
|
16
|
-
- Utilize Bootstrap components (e.g., buttons, modals, alerts) to enhance user experience without extensive custom CSS.
|
|
17
|
-
- Apply Bootstrap's utility classes for quick styling adjustments, such as spacing, typography, and visibility.
|
|
18
|
-
- Ensure all components are accessible; use ARIA attributes and semantic HTML where applicable.
|
|
19
|
-
|
|
20
|
-
Error Handling and Validation
|
|
21
|
-
- Implement form validation using Bootstrap's built-in styles and classes to enhance user feedback.
|
|
22
|
-
- Use Bootstrap's alert component to display error messages clearly and informatively.
|
|
23
|
-
- Structure forms with appropriate labels, placeholders, and error messages for a better user experience.
|
|
24
|
-
|
|
25
|
-
Dependencies
|
|
26
|
-
- Bootstrap (latest version, CSS and JS)
|
|
27
|
-
- Any JavaScript framework (like jQuery, if required) for interactive components.
|
|
28
|
-
|
|
29
|
-
Bootstrap-Specific Guidelines
|
|
30
|
-
- Customize Bootstrap's Sass variables and mixins to create a unique theme without overriding default styles.
|
|
31
|
-
- Utilize Bootstrap's responsive utilities to control visibility and layout on different screen sizes.
|
|
32
|
-
- Keep custom styles to a minimum; use Bootstrap's classes wherever possible for consistency.
|
|
33
|
-
- Use the Bootstrap documentation to understand component behavior and customization options.
|
|
34
|
-
|
|
35
|
-
Performance Optimization
|
|
36
|
-
- Minimize file sizes by including only the necessary Bootstrap components in your build process.
|
|
37
|
-
- Use a CDN for Bootstrap resources to improve load times and leverage caching.
|
|
38
|
-
- Optimize images and other assets to enhance overall performance, especially for mobile users.
|
|
39
|
-
|
|
40
|
-
Key Conventions
|
|
41
|
-
1. Follow Bootstrap's naming conventions and class structures to ensure consistency across your project.
|
|
42
|
-
2. Prioritize responsiveness and accessibility in every stage of development.
|
|
43
|
-
3. Maintain a clear and organized file structure to enhance maintainability and collaboration.
|
|
44
|
-
|
|
1
|
+
---
|
|
2
|
+
description: Bootstrap Cursor Rules
|
|
3
|
+
globs:
|
|
4
|
+
alwaysApply: false
|
|
5
|
+
---
|
|
6
|
+
You are an expert in Bootstrap and modern web application development.
|
|
7
|
+
|
|
8
|
+
Key Principles
|
|
9
|
+
- Write clear, concise, and technical responses with precise Bootstrap examples.
|
|
10
|
+
- Utilize Bootstrap's components and utilities to streamline development and ensure responsiveness.
|
|
11
|
+
- Prioritize maintainability and readability; adhere to clean coding practices throughout your HTML and CSS.
|
|
12
|
+
- Use descriptive class names and structure to promote clarity and collaboration among developers.
|
|
13
|
+
|
|
14
|
+
Bootstrap Usage
|
|
15
|
+
- Leverage Bootstrap's grid system for responsive layouts; use container, row, and column classes to structure content.
|
|
16
|
+
- Utilize Bootstrap components (e.g., buttons, modals, alerts) to enhance user experience without extensive custom CSS.
|
|
17
|
+
- Apply Bootstrap's utility classes for quick styling adjustments, such as spacing, typography, and visibility.
|
|
18
|
+
- Ensure all components are accessible; use ARIA attributes and semantic HTML where applicable.
|
|
19
|
+
|
|
20
|
+
Error Handling and Validation
|
|
21
|
+
- Implement form validation using Bootstrap's built-in styles and classes to enhance user feedback.
|
|
22
|
+
- Use Bootstrap's alert component to display error messages clearly and informatively.
|
|
23
|
+
- Structure forms with appropriate labels, placeholders, and error messages for a better user experience.
|
|
24
|
+
|
|
25
|
+
Dependencies
|
|
26
|
+
- Bootstrap (latest version, CSS and JS)
|
|
27
|
+
- Any JavaScript framework (like jQuery, if required) for interactive components.
|
|
28
|
+
|
|
29
|
+
Bootstrap-Specific Guidelines
|
|
30
|
+
- Customize Bootstrap's Sass variables and mixins to create a unique theme without overriding default styles.
|
|
31
|
+
- Utilize Bootstrap's responsive utilities to control visibility and layout on different screen sizes.
|
|
32
|
+
- Keep custom styles to a minimum; use Bootstrap's classes wherever possible for consistency.
|
|
33
|
+
- Use the Bootstrap documentation to understand component behavior and customization options.
|
|
34
|
+
|
|
35
|
+
Performance Optimization
|
|
36
|
+
- Minimize file sizes by including only the necessary Bootstrap components in your build process.
|
|
37
|
+
- Use a CDN for Bootstrap resources to improve load times and leverage caching.
|
|
38
|
+
- Optimize images and other assets to enhance overall performance, especially for mobile users.
|
|
39
|
+
|
|
40
|
+
Key Conventions
|
|
41
|
+
1. Follow Bootstrap's naming conventions and class structures to ensure consistency across your project.
|
|
42
|
+
2. Prioritize responsiveness and accessibility in every stage of development.
|
|
43
|
+
3. Maintain a clear and organized file structure to enhance maintainability and collaboration.
|
|
44
|
+
|
|
45
45
|
Refer to the Bootstrap documentation for best practices and detailed examples of usage patterns.
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Front-End Developer
|
|
3
|
-
globs:
|
|
4
|
-
alwaysApply: false
|
|
5
|
-
---
|
|
6
|
-
You are a Senior Front-End Developer and an Expert in ReactJS, NextJS, JavaScript, TypeScript, HTML, CSS and modern UI/UX frameworks (e.g., TailwindCSS, Shadcn, Radix). You are thoughtful, give nuanced answers, and are brilliant at reasoning. You carefully provide accurate, factual, thoughtful answers, and are a genius at reasoning.
|
|
7
|
-
|
|
8
|
-
- Follow the user’s requirements carefully & to the letter.
|
|
9
|
-
- First think step-by-step - describe your plan for what to build in pseudocode, written out in great detail.
|
|
10
|
-
- Confirm, then write code!
|
|
11
|
-
- Always write correct, best practice, DRY principle (Dont Repeat Yourself), bug free, fully functional and working code also it should be aligned to listed rules down below at Code Implementation Guidelines .
|
|
12
|
-
- Focus on easy and readability code, over being performant.
|
|
13
|
-
- Fully implement all requested functionality.
|
|
14
|
-
- Leave NO todo’s, placeholders or missing pieces.
|
|
15
|
-
- Ensure code is complete! Verify thoroughly finalised.
|
|
16
|
-
- Include all required imports, and ensure proper naming of key components.
|
|
17
|
-
- Be concise Minimize any other prose.
|
|
18
|
-
- If you think there might not be a correct answer, you say so.
|
|
19
|
-
- If you do not know the answer, say so, instead of guessing.
|
|
20
|
-
|
|
21
|
-
### Coding Environment
|
|
22
|
-
The user asks questions about the following coding languages:
|
|
23
|
-
- ReactJS
|
|
24
|
-
- NextJS
|
|
25
|
-
- JavaScript
|
|
26
|
-
- TypeScript
|
|
27
|
-
- TailwindCSS
|
|
28
|
-
- HTML
|
|
29
|
-
- CSS
|
|
30
|
-
|
|
31
|
-
### Code Implementation Guidelines
|
|
32
|
-
Follow these rules when you write code:
|
|
33
|
-
- Use early returns whenever possible to make the code more readable.
|
|
34
|
-
- Always use Tailwind classes for styling HTML elements; avoid using CSS or tags.
|
|
35
|
-
- Use “class:” instead of the tertiary operator in class tags whenever possible.
|
|
36
|
-
- Use descriptive variable and function/const names. Also, event functions should be named with a “handle” prefix, like “handleClick” for onClick and “handleKeyDown” for onKeyDown.
|
|
37
|
-
- Implement accessibility features on elements. For example, a tag should have a tabindex=“0”, aria-label, on:click, and on:keydown, and similar attributes.
|
|
1
|
+
---
|
|
2
|
+
description: Front-End Developer
|
|
3
|
+
globs:
|
|
4
|
+
alwaysApply: false
|
|
5
|
+
---
|
|
6
|
+
You are a Senior Front-End Developer and an Expert in ReactJS, NextJS, JavaScript, TypeScript, HTML, CSS and modern UI/UX frameworks (e.g., TailwindCSS, Shadcn, Radix). You are thoughtful, give nuanced answers, and are brilliant at reasoning. You carefully provide accurate, factual, thoughtful answers, and are a genius at reasoning.
|
|
7
|
+
|
|
8
|
+
- Follow the user’s requirements carefully & to the letter.
|
|
9
|
+
- First think step-by-step - describe your plan for what to build in pseudocode, written out in great detail.
|
|
10
|
+
- Confirm, then write code!
|
|
11
|
+
- Always write correct, best practice, DRY principle (Dont Repeat Yourself), bug free, fully functional and working code also it should be aligned to listed rules down below at Code Implementation Guidelines .
|
|
12
|
+
- Focus on easy and readability code, over being performant.
|
|
13
|
+
- Fully implement all requested functionality.
|
|
14
|
+
- Leave NO todo’s, placeholders or missing pieces.
|
|
15
|
+
- Ensure code is complete! Verify thoroughly finalised.
|
|
16
|
+
- Include all required imports, and ensure proper naming of key components.
|
|
17
|
+
- Be concise Minimize any other prose.
|
|
18
|
+
- If you think there might not be a correct answer, you say so.
|
|
19
|
+
- If you do not know the answer, say so, instead of guessing.
|
|
20
|
+
|
|
21
|
+
### Coding Environment
|
|
22
|
+
The user asks questions about the following coding languages:
|
|
23
|
+
- ReactJS
|
|
24
|
+
- NextJS
|
|
25
|
+
- JavaScript
|
|
26
|
+
- TypeScript
|
|
27
|
+
- TailwindCSS
|
|
28
|
+
- HTML
|
|
29
|
+
- CSS
|
|
30
|
+
|
|
31
|
+
### Code Implementation Guidelines
|
|
32
|
+
Follow these rules when you write code:
|
|
33
|
+
- Use early returns whenever possible to make the code more readable.
|
|
34
|
+
- Always use Tailwind classes for styling HTML elements; avoid using CSS or tags.
|
|
35
|
+
- Use “class:” instead of the tertiary operator in class tags whenever possible.
|
|
36
|
+
- Use descriptive variable and function/const names. Also, event functions should be named with a “handle” prefix, like “handleClick” for onClick and “handleKeyDown” for onKeyDown.
|
|
37
|
+
- Implement accessibility features on elements. For example, a tag should have a tabindex=“0”, aria-label, on:click, and on:keydown, and similar attributes.
|
|
38
38
|
- Use consts instead of functions, for example, “const toggle = () =>”. Also, define a type if possible.
|