You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/C_Contributing.mdx
+74-35Lines changed: 74 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,45 +52,92 @@ Once you're ready to contribute, follow these steps:
52
52
git checkout -b your-new-branch-name
53
53
```
54
54
55
-
## Project guidelines
55
+
## Commit Guidelines
56
+
57
+
This project uses [Conventional Commits](https://www.conventionalcommits.org/) for commit messages and [semantic-release](https://semantic-release.gitbook.io/semantic-release/) for automated versioning, release notes, and publishing to npm. All commits are validated using [commitlint](https://commitlint.js.org/).
58
+
59
+
### Commit Message Format
60
+
61
+
Each commit message should follow the conventional commit format:
62
+
63
+
```
64
+
<type>(optional scope): <description>
65
+
66
+
[optional body]
67
+
68
+
[optional footer]
69
+
```
70
+
71
+
Breaking changes should be indicated by a `!` in the type. e.g. `feat!` or `fix!`.
72
+
73
+
### Types
74
+
75
+
-`feat`: A new feature (triggers minor version bump)
76
+
-`fix`: A bug fix (triggers patch version bump)
77
+
-`docs`: Documentation changes
78
+
-`refactor`: Code changes that neither fix a bug nor add a feature
79
+
-`test`: Adding or fixing tests
80
+
-`chore`: Changes to the build process or auxiliary tools
81
+
82
+
### Examples
56
83
57
-
## Project nuances
84
+
```bash
85
+
# Feature commit
86
+
git commit -m "feat: add support for custom board themes"
58
87
59
-
### DnD Kit Re-rendering
88
+
# Bug fix commit
89
+
git commit -m "fix: fix piece dragging on mobile devices"
60
90
61
-
When using @dnd-kit for drag and drop functionality, it's important to note that all droppable and draggable elements will re-render on each drag event. This is due to how @dnd-kit tracks the position and state of draggable elements.
- Use React.memo on draggable/droppable components where possible
66
-
- Keep draggable components lightweight
67
-
- Avoid expensive calculations or operations in draggable components
68
-
- Consider using CSS transforms for animations instead of JavaScript
98
+
### Semantic Release
69
99
70
-
### Performance Considerations
100
+
The project uses semantic-release to automatically:
71
101
72
-
- Components are memoized to prevent unnecessary re-renders
73
-
- CSS transforms are used for animations instead of JavaScript
74
-
- Drag overlay uses a cloned piece to maintain performance
75
-
- Position updates are batched to minimize re-renders
76
-
- Square and piece components are kept lightweight
102
+
- Determine the next version number based on commit types
103
+
- Generate release notes
104
+
- Publish to npm
105
+
- Create git tags
106
+
107
+
Version bumps are determined by commit types:
108
+
109
+
-`feat` commits trigger a minor version bump (1.0.0 -> 1.1.0)
110
+
-`fix` commits trigger a patch version bump (1.0.0 -> 1.0.1)
111
+
- Commits with `feat!` or `fix!` in the type trigger a major version bump (1.1.2 -> 2.0.0)
112
+
113
+
## Project guidelines
77
114
78
115
### Dependencies
79
116
80
-
- less dependencies the better
81
-
- use react 19+
117
+
The project aims to maintain a minimal dependency footprint to ensure optimal performance, smaller bundle size, and reduce potential security risks. Here are our dependency guidelines:
118
+
119
+
- Keep dependencies to an absolute minimum
120
+
- All dependencies must be actively maintained
121
+
- Dependencies should have permissive licenses (MIT, Apache, etc.)
122
+
- Evaluate each new dependency carefully for:
123
+
- Bundle size impact
124
+
- Security implications
125
+
- Maintenance status
126
+
- Browser compatibility
82
127
83
-
###Future Considerations
128
+
#### Required Dependencies
84
129
85
-
The following features are planned or under consideration:
130
+
-`react` ^19.0.0
131
+
-`react-dom` ^19.0.0
86
132
87
-
- Multiple board support
88
-
- Accessibility improvements
89
-
- Promotion handling
90
-
- Premoves
91
-
- Arrows
92
-
- Comprehensive test suite
93
-
- CI/CD pipeline with semantic versioning
133
+
#### Development Dependencies
134
+
135
+
Development dependencies should also be kept minimal but include necessary tooling for:
136
+
137
+
- Building (rolldown, typescript)
138
+
- Testing (storybook)
139
+
- Code quality (eslint, prettier)
140
+
- Release management (semantic-release)
94
141
95
142
### Browser Support
96
143
@@ -101,13 +148,5 @@ The following features are planned or under consideration:
101
148
### Accessibility
102
149
103
150
- Use ARIA attributes for interactive elements
104
-
- Ensure keyboard navigation is available
151
+
- Ensure keyboard interactions are available
105
152
- Provide clear feedback for user actions
106
-
107
-
## Getting Help
108
-
109
-
- Open an issue for bugs or feature requests
110
-
- Check existing issues before creating new ones
111
-
- Join our community discussions on GitHub
112
-
113
-
Remember: Every contribution, no matter how small, helps make react-chessboard better for everyone!
0 commit comments