TypeScript Bun Configuration .cursorrules prompt file
About .cursorrules prompt file
What you can build
BDD Test Generator for TypeScript and Bun: An application that automatically generates BDD-style test files for TypeScript projects using Bun's test framework. Users would input the moduleName and functions, and the tool generates structured tests following the "assemble, act, assert" pattern.
GraphQL Microservice Builder with Pothos: A service that helps developers quickly build and deploy GraphQL microservices using Pothos. It would provide templates for defining schemas, resolvers, and connect them with Bun, adhering to the principles and best practices outlined.
Functional TypeScript Snippets Library: A curated library of TypeScript code snippets following functional programming principles. It would include common patterns, helper utilities, and examples of concise code, integrating with popular IDEs.
TypeScript Interface Design Tool: An online tool for designing TypeScript interfaces, emphasizing the use of interfaces over types. It would offer suggestions and optimizations in real-time, aligning with functional component usage.
Error Class Generator for TypeScript: A tool that generates robust error classes for TypeScript projects. It ensures that all custom error classes extend from Error and provide specific templated string messages, in line with best practices.
Data Transformation Visualizer for TypeScript: A web app that helps visualize and create type-safe data transformations in TypeScript. It provides step-by-step guidance and examples, leveraging TypeScript's type system to ensure transformations are safe and reliable.
Microservices Mocking Framework for Bun: A framework that assists developers in mocking dependencies and services while building microservices using Bun. It integrates seamlessly with beforeEach to prepare environments for testing.
TypeScript Code Optimization Analyzer: A service that analyzes TypeScript code for potential improvements, focusing on early returns, avoiding unnecessary else clauses, and ensuring efficient comparisons.
Dependency Graph Tracker for Bun Projects: An app that visually tracks and analyzes the dependency graph of Bun projects, helping developers adhere to the "principle of least power" by identifying unnecessary dependencies.
ES6 Import/Export Linter: A linter that ensures projects use only ES6 named imports and exports, as per the best practice guidelines. It provides suggestions for refactoring and ensures compatibility with modern code standards.
Benefits
- Emphasizes TypeScript interfaces, functional programming patterns, and concise code with single-function focused modules.
- Utilizes Bun's latest features and test framework with behavior-driven development (BDD), adhering to the "assemble act assert" testing style.
- Promotes Unix philosophy, least power principle, and avoids over-engineering, ensuring code simplicity and necessary functionality.
Synopsis
Developers focusing on TypeScript microservices with BDD testing can create well-tested, modular, and efficient services using Bun and Pothos for GraphQL schemas with ergonomic modern code.
Overview of .cursorrules prompt
The .cursorrules file outlines a set of coding practices and guidelines for using TypeScript and Bun, focusing on behavior-driven development (BDD). It emphasizes modern JavaScript practices such as using ES6 imports and named exports, and avoiding default exports. It promotes using Bun's testing framework with BDD principles, focusing on "assemble act assert" testing methodology. The file advises utilizing concise and readable TypeScript code without classes, except for error handling, and using functional and declarative patterns. Key coding principles include using maps instead of enums, preferring interfaces over types, and maintaining small module sizes with descriptive naming. The file also promotes philosophical approaches like the Unix Philosophy, principle of least power, and avoiding over-engineering, aiming for simplicity and efficiency in coding practices.