Skip to content

Commit e11de65

Browse files
committed
internal(cursor): Update rules for documentation
1 parent 8be3b17 commit e11de65

File tree

2 files changed

+18
-36
lines changed

2 files changed

+18
-36
lines changed

.cursor/rules/packages-documentation.mdc

Lines changed: 3 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
---
2-
description: Documentation requirements when making breaking changes or adding features to public library interfaces in packages
3-
globs: 'packages/**/*.ts', 'packages/**/*.tsx', 'packages/**/*.js', 'packages/**/*.jsx'
2+
description: Guidelines for writing and formatting documentation for public library interfaces in packages
43
alwaysApply: false
54
---
5+
# Package Documentation Writing Guidelines
66

7-
# Package Documentation Requirements
8-
9-
When making changes to public library interfaces in `/packages`, you **must** update the corresponding documentation in `/docs`.
7+
This guide covers how to write and format documentation for public library interfaces. For information on **when** documentation updates are required, see `.cursorrules`.
108

119
## Documentation Structure
1210

@@ -21,37 +19,6 @@ Each package documentation has subdirectories:
2119
- `concepts/` - Conceptual documentation
2220
- `getting-started/` - Getting started guides
2321

24-
## When to Update Documentation
25-
26-
### Breaking Changes
27-
28-
**Breaking changes** include:
29-
- Removing public APIs (classes, functions, methods, hooks, composables)
30-
- Changing function/method signatures (parameter types, return types, required vs optional)
31-
- Changing class/interface properties (removing, renaming, changing types)
32-
- Changing default behavior that affects existing code
33-
- Deprecating APIs (should be documented with migration path)
34-
35-
**Required actions:**
36-
1. Update the relevant API documentation file in `docs/{package}/api/`
37-
2. Add migration notes or deprecation warnings
38-
3. Update any guides or examples that use the changed API
39-
4. Update TypeScript types/examples in documentation
40-
41-
### New Features
42-
43-
**New features** include:
44-
- Adding new public APIs (classes, functions, methods, hooks, composables)
45-
- Adding new options/parameters to existing APIs
46-
- Adding new configuration options
47-
- New capabilities or behaviors
48-
49-
**Required actions:**
50-
1. Create or update the relevant API documentation file in `docs/{package}/api/`
51-
2. Add usage examples
52-
3. Update relevant guides if the feature affects common workflows
53-
4. Add to getting-started guides if it's a major feature
54-
5522
## Documentation File Naming
5623

5724
API documentation files should match the exported name:

.cursorrules

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,21 @@ Yarn monorepo for normalized reactive state management.
3737
7. **Prefer smaller React components** that do one thing
3838
8. **Use fixtures/interceptors for testing** instead of mocking
3939

40+
## Documentation Updates
41+
42+
**Update docs when changing public APIs** (anything exported from package entry points like `index.ts`).
43+
44+
**Always update docs for:**
45+
- Breaking changes (removing/changing signatures, properties, or behavior; deprecations)
46+
- New public APIs (classes, functions, methods, hooks, composables)
47+
- New options/parameters on existing APIs
48+
49+
**No docs needed for:**
50+
- Internal/private APIs (prefixed with `_`, not exported, or marked `@internal`)
51+
- Implementation-only changes
52+
53+
Update docs **in the same commit/PR** as code changes. For writing guidelines, see `.cursor/rules/packages-documentation.mdc`.
54+
4055
## Common Mistakes to Avoid
4156

4257
- Don't forget `fromJS()` or default property assignments for Entity fields

0 commit comments

Comments
 (0)