Skip to content

Commit 7d6fa4f

Browse files
committed
Merge branch 'responsive-update-docs' of github.com:maclong9/web-ui into responsive-update-docs
2 parents bb1273b + 0d8bd34 commit 7d6fa4f

File tree

1 file changed

+20
-27
lines changed

1 file changed

+20
-27
lines changed

CONTRIBUTING.md

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,9 @@ This project and everyone participating in it is governed by the [WebUI Code of
4040
### Pull Requests
4141

4242
1. Fork the repository
43-
2. Create your feature branch from the `development` branch, (`git checkout -b feature/amazing-feature`)
44-
3. Commit your changes following conventional commit messages (`git commit -m 'feat: add some amazing feature'`)
45-
4. Push to the branch (`git push origin feature/amazing-feature`)
46-
5. Open a Pull Request to the `development` branch.
43+
2. Create your feature branch from the `development` branch, (`git checkout -b feature-00-amazing-feature`)
44+
3. Push to the branch (`git push origin feature-00-amazing-feature`)
45+
4. Open a Pull Request to the `development` branch.
4746

4847
## Development Process
4948

@@ -66,9 +65,9 @@ WebUI maintains three primary branches:
6665

6766
Version bumps are triggered automatically via commit messages. Use the following prefixes:
6867

69-
- `feat!:` - Major version increment for breaking changes (e.g., `1.0.0``2.0.0`).
70-
- `feat:` - Minor version increment for new features (e.g., `1.0.0``1.1.0`).
71-
- `fix:` or `fix!:` - Patch version increment for bug fixes (e.g., `1.0.0``1.0.1`).
68+
- `feat!:` or `Release` - Major version increment for breaking changes (e.g., `1.0.0``2.0.0`).
69+
- `feat:` or `Feature` - Minor version increment for new features (e.g., `1.0.0``1.1.0`).
70+
- `fix:`, `fix!:` or `Fixes` - Patch version increment for bug fixes (e.g., `1.0.0``1.0.1`).
7271

7372
### Release Process
7473

@@ -79,23 +78,11 @@ The release workflow is fully automated:
7978
3. Release notes are automatically generated from the commit messages.
8079
4. A new tag is created and the release is published on GitHub.
8180

82-
### Quick Fixes (Hotfixes)
83-
84-
For urgent fixes that need to be pushed to `main` right away:
85-
86-
1. Create a PR targeting the `main` branch.
87-
2. Include `fix!:` in the PR title and merge message.
88-
3. Once approved and merged, an action will automatically create PRs for `next` and `development` branches.
89-
4. This ensures all branches remain in sync when quick changes are required in the main branch.
90-
91-
> [!WARNING]
92-
> Ensure the auto-generated PRs are approved and merged promptly to maintain branch synchronization.
93-
9481
### Testing
9582

9683
Automated tests run on every pull request to `main` and `next` branches:
9784

98-
1. Tests are executed in a macOS environment with Swift 6.1.
85+
1. Tests are executed in a macOS environment.
9986
2. The workflow includes caching of Swift Package Manager dependencies for faster builds.
10087
3. All tests must pass before a PR can be merged.
10188

@@ -116,6 +103,9 @@ WebUI uses Swift DocC for documentation:
116103
swift package --disable-sandbox preview-documentation
117104
```
118105

106+
> [!NOTE]
107+
> You can also run `Build Documentation` inside of Xcode to view the documentation in
108+
119109
### Adding New Elements
120110

121111
WebUI follows a compositional pattern for creating HTML elements. When adding a new element, adhere to these guidelines:
@@ -139,12 +129,12 @@ WebUI follows a compositional pattern for creating HTML elements. When adding a
139129
/// Defines the types available for the element.
140130
///
141131
/// Detailed documentation about the enum and its purpose.
142-
public enum ElementType: String {
132+
public enum ElementCustom: String {
143133
/// Documentation for this case.
144-
case primary
134+
case one
145135

146136
/// Documentation for this case.
147-
case secondary
137+
case two
148138
}
149139
```
150140

@@ -155,12 +145,12 @@ WebUI follows a compositional pattern for creating HTML elements. When adding a
155145
/// Detailed documentation about what this element represents and its use cases.
156146
public final class ElementName: Element {
157147
// Properties specific to this element
158-
let type: ElementType?
148+
let customType: ElementCustom?
159149

160150
/// Creates a new HTML element_name.
161151
///
162152
/// - Parameters:
163-
/// - type: Type of the element, optional.
153+
/// - custom: An example custom attribute, optional.
164154
/// - id: Unique identifier, optional.
165155
/// - classes: CSS class names, optional.
166156
/// - role: ARIA role for accessibility, optional.
@@ -187,7 +177,7 @@ WebUI follows a compositional pattern for creating HTML elements. When adding a
187177

188178
// Build custom attributes using Attr namespace
189179
let customAttributes = [
190-
Attribute.typed("type", type)
180+
Attribute.typed("custom", custom) // will generate as `custom="\(custom)"`
191181
].compactMap { $0 }
192182

193183
// Initialize the parent Element class
@@ -205,14 +195,17 @@ WebUI follows a compositional pattern for creating HTML elements. When adding a
205195
}
206196
```
207197

208-
4. **Testing**: Add unit tests for the new element in the `Tests` directory.
198+
4. **Testing**: Add unit tests for the new element in the `Tests/Styles` directory.
209199

210200
5. **Documentation**: Include comprehensive DocC documentation with:
211201
- Class-level documentation explaining the element's purpose
212202
- Parameter documentation for all initializer parameters
213203
- Usage examples showing common implementations
214204
- Mention any accessibility considerations
215205

206+
> [!IMPORTANT]
207+
> Pull requests with new elements, modifiers and utilities will be rejected or put on hold until adequate documentation is provided. This is extemely important for both the end user of the library to understand what each element does and means semantically as well as ensuring maintainability for the maintainers of the project.
208+
216209
## Adding New Style Modifiers
217210

218211
Style modifiers in WebUI follow the unified style system pattern. Here's how to add a new style modifier:

0 commit comments

Comments
 (0)