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: CONTRIBUTING.md
+20-27Lines changed: 20 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,10 +40,9 @@ This project and everyone participating in it is governed by the [WebUI Code of
40
40
### Pull Requests
41
41
42
42
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.
47
46
48
47
## Development Process
49
48
@@ -66,9 +65,9 @@ WebUI maintains three primary branches:
66
65
67
66
Version bumps are triggered automatically via commit messages. Use the following prefixes:
68
67
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`).
72
71
73
72
### Release Process
74
73
@@ -79,23 +78,11 @@ The release workflow is fully automated:
79
78
3. Release notes are automatically generated from the commit messages.
80
79
4. A new tag is created and the release is published on GitHub.
81
80
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
-
94
81
### Testing
95
82
96
83
Automated tests run on every pull request to `main` and `next` branches:
97
84
98
-
1. Tests are executed in a macOS environment with Swift 6.1.
85
+
1. Tests are executed in a macOS environment.
99
86
2. The workflow includes caching of Swift Package Manager dependencies for faster builds.
100
87
3. All tests must pass before a PR can be merged.
101
88
@@ -116,6 +103,9 @@ WebUI uses Swift DocC for documentation:
116
103
swift package --disable-sandbox preview-documentation
117
104
```
118
105
106
+
> [!NOTE]
107
+
> You can also run `Build Documentation` inside of Xcode to view the documentation in
108
+
119
109
### Adding New Elements
120
110
121
111
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
139
129
/// Defines the types available for the element.
140
130
///
141
131
/// Detailed documentation about the enum and its purpose.
142
-
publicenumElementType: String{
132
+
publicenumElementCustom: String{
143
133
/// Documentation for this case.
144
-
caseprimary
134
+
caseone
145
135
146
136
/// Documentation for this case.
147
-
casesecondary
137
+
casetwo
148
138
}
149
139
```
150
140
@@ -155,12 +145,12 @@ WebUI follows a compositional pattern for creating HTML elements. When adding a
155
145
/// Detailed documentation about what this element represents and its use cases.
156
146
publicfinalclassElementName: Element{
157
147
// Properties specific to this element
158
-
lettype: ElementType?
148
+
letcustomType: ElementCustom?
159
149
160
150
/// Creates a new HTML element_name.
161
151
///
162
152
/// - Parameters:
163
-
/// - type: Type of the element, optional.
153
+
/// - custom: An example custom attribute, optional.
164
154
/// - id: Unique identifier, optional.
165
155
/// - classes: CSS class names, optional.
166
156
/// - role: ARIA role for accessibility, optional.
@@ -187,7 +177,7 @@ WebUI follows a compositional pattern for creating HTML elements. When adding a
187
177
188
178
// Build custom attributes using Attr namespace
189
179
let customAttributes = [
190
-
Attribute.typed("type", type)
180
+
Attribute.typed("custom", custom) // will generate as `custom="\(custom)"`
191
181
].compactMap { $0 }
192
182
193
183
// Initialize the parent Element class
@@ -205,14 +195,17 @@ WebUI follows a compositional pattern for creating HTML elements. When adding a
205
195
}
206
196
```
207
197
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.
209
199
210
200
5.**Documentation**: Include comprehensive DocC documentation with:
211
201
- Class-level documentation explaining the element's purpose
212
202
- Parameter documentation for all initializer parameters
213
203
- Usage examples showing common implementations
214
204
- Mention any accessibility considerations
215
205
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
+
216
209
## Adding New Style Modifiers
217
210
218
211
Style modifiers in WebUI follow the unified style system pattern. Here's how to add a new style modifier:
0 commit comments