Skip to content

Commit f854d18

Browse files
committed
chore: upd CONTRIBUTING
1 parent e6259cf commit f854d18

4 files changed

Lines changed: 49 additions & 24 deletions

File tree

.vscode/extensions.json

Lines changed: 0 additions & 12 deletions
This file was deleted.

.vscode/mcp.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

.vscode/settings.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 49 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Contributing
22

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.
44
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.
55

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).
77

88
## Development
99

@@ -31,10 +31,43 @@ git checkout -b my-new-branch
3131

3232
### Install dependencies
3333

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+
3437
```bash
3538
pnpm install
3639
```
3740

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+
3871
## Commit Convention
3972

4073
Before you create a Pull Request, please check whether your commits comply with
@@ -60,7 +93,9 @@ the following categories:
6093
- `chore`: all changes to the repository that do not fit into any of the above
6194
categories
6295

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.
6499

65100
If you are interested in the detailed specification you can visit
66101
https://www.conventionalcommits.org/ or check out the
@@ -104,9 +139,17 @@ export class ExampleDirective {
104139
## Components, Directives
105140

106141
- 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
151+
`viewChild()` / `contentChild()`;
152+
- cleanup → **`inject(DestroyRef).onDestroy(() => …)`**.
110153

111154
```typescript
112155
export class MyComponent {

0 commit comments

Comments
 (0)