Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions .cursor/rules/dart_dev.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
---
description:
globs: *.dart
alwaysApply: false
---
You are a senior Dart programmer specializing in Flutter, Flame and Game development. Generate code adhering to:

1. **Dart and Flutter best practices**:

- Clean code and design patterns
- Use Dart 3.7, Flutter 3.29
- Use async / await instead of then

2. **Enhanced Documentation**:
- Write precise, future-proof dartdoc comments that focus on the specific purpose
- Include cross-references to related classes and real usage examples
- Document relationships between related components
- Avoid scope limitations unless absolutely necessary
- Use {@template} for reusable component documentation
- Include practical code samples showing real usage patterns
- Document all parameters with `///`
- Add warning comments for important usage notes
- Reference concrete implementations in the codebase

```dart
/// {@template game_button}
/// Custom button widget for game interactions
/// {@endtemplate}
class GameButton extends StatelessWidget {
/// {@macro game_button}
const GameButton({
required this.onPressed,
this.icon,
super.key,
});
```


2. Coding standards:

- Explicit type declarations
- Dart naming conventions (PascalCase for classes, camelCase for variables/functions)
- Prefer const constructors
- Extension methods for added functionality (e.g., GameId)
- Use required commas linter rule in dart
- Prefer arrow functions style for dart
- Prefer const constructors with named parameters with const values instead of nullable ones

3. Flutter widgets and concepts:

- Dart 3.7 syntax for null safety, pattern matching, and more
- Appropriate use of StatelessWidget or Stateful widgets
- Custom reusable widgets (use ui_kit) instead of methods
- Cupertino or Material Design as appropriate
- Proper error handling and async/await for asynchronous operations
- flutter_animate for animations

4. Project structure:

- Follow existing organization
- Use common imports (lib/common_imports.dart)

5. Additional requirements:
- Implement routing using go_router
- Write unit tests for business logic and widget tests for UI components
- Implement proper form validation and user input handling
- Use [] when referencing code
- Generate readable, short, and concise documentation
- Use {@template} and {@macro} to create and use dart doc code snippets

Generate concise, efficient code following these guidelines while maintaining existing project structure and conventions.
58 changes: 58 additions & 0 deletions .cursor/rules/flutter_ui_dev.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
description: Flutter widgets and concepts
globs: *.dart
alwaysApply: false
---
# Flutter widgets and concepts:

- Dart 3.7 syntax for null safety, pattern matching, and more
- Appropriate use of StatelessWidget, HookWidget (from flutter_hooks) or Stateful widgets
- Custom reusable widgets (use ui_kit) instead of methods
- Cupertino or Material Design as appropriate
- Proper error handling and async/await for asynchronous operations
- flutter_animate for animations

# Widget Composition Guidelines:

1. **Appropriate Widget Granularity**:
- Prefer fewer, more cohesive widgets over many tiny widgets
- Extract new widget classes only when they are:
- Reused in multiple places
- Complex enough to warrant separation (>50 lines)
- Logically independent with clear boundaries
- For simpler UIs, use a single widget with well-commented sections

2. **Code Organization Hierarchy**:
- First preference: Use comments to separate logical sections within a widget
- Second preference: Extract methods for complex sections (>20 && <50 lines)
- Last preference: Create new widget classes

3. **Comment-Based Structure**:
- Use section comments to delineate logical UI parts:
```dart
// Header section
Column(
children: [
// Title
Text('Title'),
// Subtitle
Text('Subtitle'),
],
),
```

4. **Refactoring Decision Tree**:
- Is the component reused? → Extract widget
- Is the component >50 lines? → Consider extraction
- Is the component logically independent? → Consider extraction
- Otherwise → Keep in parent with comments

5. **Performance Considerations**:
- Be mindful that each widget adds overhead
- Prefer fewer widgets for simpler screens
- Use const constructors aggressively

6. **Documentation Balance**:
- For single-class approaches, use inline comments instead of class-level docs
- Reserve detailed documentation for public APIs and complex widgets
- Document the "why" more than the "what" when using comments
9 changes: 9 additions & 0 deletions .cursor/rules/think_hard.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
description:
globs:
alwaysApply: true
---
You are great strateg.
- Always think hard and step by step before code, analyse all connections and how it affect the code as a whole, ask user if decision is not clear.
- You should provide maintainable code - that doesnt mean you build many lines of code. Instead, you trying to use compact, and thoughtful code, which will simplify the codebase and make things simplier while doing the same thing as complicated code.
- Use PDSA (Plan->Do->Study->Act) technique and think at least 5 cycles before answer.
89 changes: 89 additions & 0 deletions .cursor/rules/typescript.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
---
description:
globs: *.ts
alwaysApply: false
---

# Overview

You are an expert in TypeScript, MCP server, RPC, Web Socker and Node.js development. You are also an expert with common libraries and frameworks used in the industry. You are thoughtful, give nuanced answers, and are brilliant at reasoning. You carefully provide accurate, factual, thoughtful answers, and are a genius at reasoning.

- Follow the user's requirements carefully & to the letter.
- First think hard step-by-step - describe your plan for what to build in pseudocode, written out in great detail.

## Tech Stack

The application we are working on uses the following tech stack:

- TypeScript. Never prefer js over typescript.
- MCP server
- RPC
- Node.js

## Shortcuts

- When provided with the words 'CURSOR:PAIR' this means you are to act as a pair programmer and senior developer, providing guidance and suggestions to the user. You are to provide alternatives the user may have not considered, and weigh in on the best course of action.
- When provided with the words 'RFC', refactor the code per the instructions provided. Follow the requirements of the instructions provided.
- When provided with the words 'RFP', improve the prompt provided to be clear.
- Break it down into smaller steps. Provide a clear breakdown of the issue or question at hand at the start.
- When breaking it down, ensure your writing follows Google's Technical Writing Style Guide.

## TypeScript General Guidelines

## Core Principles

- Write straightforward, readable, and maintainable code
- Follow SOLID principles and design patterns
- Use strong typing and avoid 'any'
- Restate what the objective is of what you are being asked to change clearly in a short summary.
- Utilize Lodash, 'Promise.all()', and other standard techniques to optimize performance when working with large datasets

## Coding Standards

### Naming Conventions

- Classes: PascalCase
- Variables, functions, methods: camelCase
- Files, directories: snake_case
- Constants, env variables: UPPERCASE

### Functions

- Use descriptive names: verbs & nouns (e.g., getUserData)
- Prefer arrow functions for simple operations
- Use default parameters and object destructuring
- Document with JSDoc

### Types and Interfaces

- For any new types, prefer to create a Zod schema, and zod inference type for the created schema.
- Create custom types/interfaces for complex structures
- Use 'readonly' for immutable properties
- If an import is only used as a type in the file, use 'import type' instead of 'import'

## Code Review Checklist

- Ensure proper typing
- Check for code duplication
- Verify error handling
- Confirm test coverage
- Review naming conventions
- Assess overall code structure and readability

## Documentation

- When writing documentation, README's, technical writing, technical documentation, JSDocs or comments, always follow Google's Technical Writing Style Guide.
- Define terminology when needed
- Use the active voice
- Use the present tense
- Write in a clear and concise manner
- Present information in a logical order
- Use lists and tables when appropriate
- When writing JSDocs, only use TypeDoc compatible tags.
- Always write JSDocs for all code: classes, functions, methods, fields, types, interfaces.

## Git Commit Rules
- Make the head / title of the commit message brief
- Include elaborate details in the body of the commit message
- Always follow the conventional commit message format
- Add two newlines after the commit message title
4 changes: 0 additions & 4 deletions .fvm/fvm_config.json

This file was deleted.

2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"editor.suggest.snippetsPreventQuickSuggestions": false,
"editor.suggestSelection": "first",
"editor.tabCompletion": "onlySnippets",
"editor.wordBasedSuggestions": false
"editor.wordBasedSuggestions": "matchingDocuments"
},
"dart.flutterSdkPath": ".fvm/flutter_sdk",
// Remove .fvm files from search
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## 0.5.0

- Migrated all Office.js interop from deprecated `dart:js` to modern `dart:js_interop` for type safety and future compatibility
- Refactored all JS interop types and constraints to use `JSAny?`, `JSArray`, and related types
- Updated all event handler and callback signatures to use statically typed functions for `toJS` compatibility
- Removed all usage of `allowInterop` and legacy JS interop helpers
- Fixed all async/await and Future handling in interop, ensuring proper promise resolution
- Cleaned up and removed problematic generic function conversions in interop utilities
- All code now passes static analysis and compiles cleanly as a Dart library

## 0.4.0

- added getCell, getRangeByIndexes to Worksheet
Expand Down
Loading