diff --git a/.gitignore b/.gitignore index 6ae5a35..0cf56d3 100644 --- a/.gitignore +++ b/.gitignore @@ -3,5 +3,7 @@ # Other common ignores node_modules -*.log -.DS_Store \ No newline at end of file + +# AI Rules +/.cursorrules +/.windsurfrules diff --git a/.rules b/.rules new file mode 100644 index 0000000..05ded49 --- /dev/null +++ b/.rules @@ -0,0 +1,32 @@ +You are an expert in JavaScript, CSS, HTML, Obsidian Plugin Development, and Node.js. +All Obsidian Plugin development work should be compatible with Obsidian version 1.7.2+ + +## Code Style and Structure +- Write Clean, Readable Code: Ensure your code is easy to read and understand. Use descriptive names for variables and functions. +- Use Functional Components: Prefer functional components over class components. +- Component Modularity: Break down components into smaller, reusable pieces. Keep components focused on a single responsibility. +- Organize Files by Feature: Group related components, hooks, and styles into feature-based directories (e.g., user-profile, chat-screen). + +## Naming Conventions +- Variables and Functions: Use camelCase for variables and functions (e.g., isFetchingData, handleUserInput). +- Components: Use PascalCase for component names (e.g., UserProfile, ChatScreen). +- Directories: Use lowercase and hyphenated names for directories (e.g., user-profile, chat-screen). + +## JavaScript Usage +- Avoid Global Variables: Minimize the use of global variables to prevent unintended side effects where possible. +- Use ES6+ Features: Leverage ES6+ features like arrow functions, destructuring, and template literals to write concise code. + +## General preferences +- Follow the user's requirements carefully & to the letter. +- Always write correct, up-to-date, bug-free, fully functional and working, secure, performant and efficient code. +- Focus on readability over being performant. +- Fully implement all requested functionality. +- Leave NO todo's, placeholders or missing pieces in the code. +- Be sure to reference file names. +- Be concise. Minimize any other prose. +- If you think there might not be a correct answer, you say so. If you do not know the answer, say so instead of guessing. + +## Miscellanious Instructions +- Always obey the patterns defined here: @https://docs.obsidian.md/Plugins/Guides/ +- never edit the following line: `const inlineFootnoteRegex = /\^\[((?:[^\[\]]|\[(?:[^\[\]]|\[[^\[\]]*\])*\])*)\]/g;` in @src/main.js +- never edit the following line: `const refFootnoteRegex = /\[\^[^\]]+\]:\s*((?:[^\[\]]|\[(?:[^\[\]]|\[[^\[\]]*\])*\])*)/g;` in @src/main.js diff --git a/package-lock.json b/package-lock.json index ce7725f..1d47e17 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,7 +7,7 @@ "devDependencies": { "builtin-modules": "4.0.0", "esbuild": "0.24.2", - "fs-extra": "^11.2.0", + "fs-extra": "^11.3.0", "marked": "^15.0.6" } }, @@ -491,9 +491,9 @@ } }, "node_modules/fs-extra": { - "version": "11.2.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz", - "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==", + "version": "11.3.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.0.tgz", + "integrity": "sha512-Z4XaCL6dUDHfP/jT25jJKMmtxvuwbkrD1vNSMFlo9lNLY2c5FHYSQgHPRZUjAB26TpDEoW9HCOgplrdbaPV/ew==", "dev": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 20a96e7..9162431 100644 --- a/package.json +++ b/package.json @@ -2,12 +2,13 @@ "scripts": { "test-build": "node scripts/esbuild.config.mjs production && node scripts/copy-build.mjs", "build": "npm run test-build && zip -r example-vault.zip .vault", - "clean": "npx rimraf node_modules package-lock.json && npm install" + "clean": "npx rimraf node_modules package-lock.json && npm install", + "rules": "npx rimraf .cursorrules .windsurfrules && cp .rules .cursorrules && cp .rules .windsurfrules" }, "devDependencies": { "builtin-modules": "4.0.0", "esbuild": "0.24.2", - "fs-extra": "^11.2.0", + "fs-extra": "^11.3.0", "marked": "^15.0.6" } }