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
**Remember:** Catalyst controllers require a custom element in the component template.
148
+
**Note:** Catalyst automatically handles custom element registration, so the boilerplate `window.customElements.define()` code is not necessary. The custom element must be present in the component template.
The `static/previews.json` file is auto-generated by running:
217
+
218
+
```bash
219
+
bundle exec rake static:dump
241
220
```
242
221
222
+
This task is automatically run by the `.github/workflows/static-files.yml` workflow on every push to main. The file contains component preview configurations used for visual regression testing.
223
+
243
224
Run tests:
244
225
```bash
245
226
./script/test # All tests
@@ -313,12 +294,11 @@ We periodically sync with GitHub's Primer repository. The process:
313
294
- Use `status :open_project` for OpenProject components
314
295
- Document all public APIs with YARD
315
296
- Restrict HTML tags appropriately
316
-
- Use `system_arguments` for HTML attributes
297
+
- Use `system_arguments` for HTML attributes and styling (via utility classes). Full reference: https://primer.style/view-components/lookbook/pages/system_arguments/
317
298
- Follow ViewComponent best practices
318
299
319
300
### JavaScript/TypeScript
320
-
- Use Catalyst for interactive components
321
-
- Export custom elements properly
301
+
- Use Web Components for interactive components (consider using Catalyst to DRY up boilerplate involved in creating custom elements)
322
302
- Follow GitHub's JavaScript style guide
323
303
- Use TypeScript for type safety
324
304
@@ -339,10 +319,9 @@ We periodically sync with GitHub's Primer repository. The process:
339
319
2.**Add changeset** for user-facing changes: `npx changeset`
340
320
3.**Write YARD docs** for new components/public methods
341
321
4.**Add Lookbook previews** to demonstrate usage
342
-
5.**Update `static/previews.json`** for visual regression tests
343
-
6.**Ensure linters pass**: `npm run lint && ./script/rubocop`
344
-
7.**Keep changes focused** - one feature/fix per PR
345
-
8.**Update documentation** if API changes
322
+
5.**Ensure linters pass**: `npm run lint && ./script/rubocop`
323
+
6.**Keep changes focused** - one feature/fix per PR
0 commit comments