Skip to content

Commit 35f1f65

Browse files
committed
docs: finish contributing and start on upgrade guide
1 parent 03bbe93 commit 35f1f65

6 files changed

Lines changed: 850 additions & 48 deletions

File tree

.storybook/main.ts

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,29 @@
1-
import type { StorybookConfig } from "@storybook/react-vite";
1+
import type { StorybookConfig } from '@storybook/react-vite';
2+
import remarkGfm from 'remark-gfm';
23

34
const config: StorybookConfig = {
4-
stories: ["../docs/**/*.mdx", "../docs/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
5+
stories: ['../docs/**/*.mdx', '../docs/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
56
addons: [
6-
"@storybook/addon-essentials",
7-
"@storybook/addon-onboarding",
8-
"@chromatic-com/storybook",
9-
"@storybook/addon-interactions",
10-
"storybook-addon-deep-controls",
7+
'@storybook/addon-essentials',
8+
'@storybook/addon-onboarding',
9+
'@chromatic-com/storybook',
10+
'@storybook/addon-interactions',
11+
'storybook-addon-deep-controls',
12+
{
13+
name: '@storybook/addon-docs',
14+
options: {
15+
mdxPluginOptions: {
16+
mdxCompileOptions: {
17+
remarkPlugins: [remarkGfm],
18+
},
19+
},
20+
},
21+
},
1122
],
1223
framework: {
13-
name: "@storybook/react-vite",
24+
name: '@storybook/react-vite',
1425
options: {},
1526
},
16-
staticDirs: ["../docs/assets"],
27+
staticDirs: ['../docs/assets'],
1728
};
1829
export default config;

docs/C_Contributing.mdx

Lines changed: 74 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -52,45 +52,92 @@ Once you're ready to contribute, follow these steps:
5252
git checkout -b your-new-branch-name
5353
```
5454

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
5683

57-
## Project nuances
84+
```bash
85+
# Feature commit
86+
git commit -m "feat: add support for custom board themes"
5887

59-
### DnD Kit Re-rendering
88+
# Bug fix commit
89+
git commit -m "fix: fix piece dragging on mobile devices"
6090

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.
91+
# Documentation commit
92+
git commit -m "docs: update installation instructions"
6293

63-
To optimize performance:
94+
# Breaking change commit
95+
git commit -m "feat!: change board orientation API"
96+
```
6497

65-
- 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
6999

70-
### Performance Considerations
100+
The project uses semantic-release to automatically:
71101

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
77114

78115
### Dependencies
79116

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
82127

83-
### Future Considerations
128+
#### Required Dependencies
84129

85-
The following features are planned or under consideration:
130+
- `react` ^19.0.0
131+
- `react-dom` ^19.0.0
86132

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)
94141

95142
### Browser Support
96143

@@ -101,13 +148,5 @@ The following features are planned or under consideration:
101148
### Accessibility
102149

103150
- Use ARIA attributes for interactive elements
104-
- Ensure keyboard navigation is available
151+
- Ensure keyboard interactions are available
105152
- 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

Comments
 (0)