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
+49-6Lines changed: 49 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,9 @@
1
1
# Contributing
2
2
3
-
Thanks for your interest in contributing to Radix Angular. We're happy to have you here.
3
+
Thanks for your interest in contributing to Radix NG. We're happy to have you here.
4
4
Please take a moment to review this document before submitting your first pull request. We also strongly recommend that you check for open issues and pull requests to see if someone else is working on something similar.
5
5
6
-
If you need any help, feel free to reach out to [Telegram](https://t.me/radixng).
6
+
If you need any help, feel free to reach out to [Telegram](https://t.me/radixng) or [Discord](https://discord.gg/NaJb2XRWX9).
7
7
8
8
## Development
9
9
@@ -31,10 +31,43 @@ git checkout -b my-new-branch
31
31
32
32
### Install dependencies
33
33
34
+
The repository is an Nx monorepo managed with [pnpm](https://pnpm.io) (see `packageManager` in
35
+
`package.json`; with corepack enabled the right version is picked up automatically):
36
+
34
37
```bash
35
38
pnpm install
36
39
```
37
40
41
+
## Development workflow
42
+
43
+
```bash
44
+
pnpm storybook:primitives # Storybook dev server (http://localhost:4400)
45
+
pnpm primitives:test # run the Vitest suite
46
+
pnpm primitives:build # build the library
47
+
pnpm eslint:fix # lint + autofix
48
+
pnpm prettier:fix # format
49
+
nx run primitives:test --testFile packages/primitives/<name>/__tests__/<file>.spec.ts # single spec
50
+
```
51
+
52
+
CI requires **zero lint warnings** (`--max-warnings=0`), clean Prettier formatting, green tests,
53
+
and successful builds. Husky hooks run `lint-staged` on commit and `commitlint` on the commit
54
+
message, so most issues surface before push.
55
+
56
+
Note on tests: the suite runs **zoneless** — `fakeAsync` / `tick` / `waitForAsync` are unavailable.
57
+
Use `vi.useFakeTimers()`, `await fixture.whenStable()`, or a macrotask to drain async work.
58
+
59
+
### Generated files (`skills/`)
60
+
61
+
The LLM-facing docs bundle under `skills/` is **generated** from the Storybook docs and the
62
+
compodoc metadata. If your change touches any `stories/*.docs.mdx`**or a primitive's public API**
63
+
(inputs, outputs, selectors), regenerate and commit the result:
64
+
65
+
```bash
66
+
pnpm skills:build
67
+
```
68
+
69
+
CI verifies the bundle is up to date and fails the PR otherwise.
70
+
38
71
## Commit Convention
39
72
40
73
Before you create a Pull Request, please check whether your commits comply with
@@ -60,7 +93,9 @@ the following categories:
60
93
-`chore`: all changes to the repository that do not fit into any of the above
61
94
categories
62
95
63
-
e.g. `feat(components): add new prop to the avatar component`
96
+
The scope is the primitive (package) name, e.g. `feat(avatar): add new prop`,
97
+
`fix(select): keep highlight in view on arrow navigation`. Commit messages are checked by
98
+
commitlint on commit.
64
99
65
100
If you are interested in the detailed specification you can visit
66
101
https://www.conventionalcommits.org/ or check out the
@@ -104,9 +139,17 @@ export class ExampleDirective {
104
139
## Components, Directives
105
140
106
141
- Use `inject` for dependency injection.
107
-
- Avoid using native DOM APIs (e.g., `document.`, `window.`).
108
-
- Avoid using outdated lifecycle hooks (`ngOnChanges`, `ngAfterViewInit`, `ngAfterContentInit`, etc.).
109
-
- Minimize the use of `ngOnInit` and `ngOnDestroy`. Prefer the `constructor`, as it runs within the injection context.
142
+
- Avoid using native DOM APIs (e.g., `document.`, `window.`) directly — guard with
143
+
`isPlatformBrowser` where unavoidable (the primitives must be SSR-safe).
144
+
-**Avoid lifecycle hooks** in primitive source (`packages/primitives/*/src/**`) — an ESLint rule
145
+
warns on `ngOnInit` / `ngOnChanges` / `ngOnDestroy` there. Pick the replacement by what the code
146
+
needs:
147
+
- DI and host-element work → the **`constructor`** (the host element exists there; `input()`
148
+
values do **not** yet);
149
+
- logic that depends on `input()` values → **`effect()` / `computed()` / `linkedSignal()`**;
150
+
- rendered DOM / measurements → **`afterNextRender()` / `afterRenderEffect()`**, signal
0 commit comments