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
-[Pre-commit Enforcement via Husky](#pre-commit-enforcement-via-husky)
9
+
-[CI/CD Enforcement](#cicd-enforcement)
10
+
-[Tips for Passing Coverage](#tips-for-passing-coverage)
11
+
-[Output Directory](#output-directory)
12
+
-[Need Help?](#need-help)
13
+
14
+
---
15
+
16
+
## Overview
17
+
3
18
This project uses [Compodoc](https://compodoc.app/) to generate and enforce documentation for all Angular code. Documentation is mandatory and must meet a **100% coverage threshold** to ensure consistent API clarity across the codebase.
Copy file name to clipboardExpand all lines: docs/git-convention.md
+24-2Lines changed: 24 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,25 @@
1
1
# CommitLint and Git Branch Naming Convention (Aligned with Angular Guideline)
2
2
3
+
## Index
4
+
5
+
-[Overview](#overview)
6
+
-[Local pipeline](#local-pipeline)
7
+
-[Contributing Workflow](#contributing-workflow)
8
+
-[Commitlint](#commitlint)
9
+
-[Branch Naming Format](#branch-naming-format)
10
+
11
+
---
12
+
13
+
## Overview
14
+
3
15
To maintain a clean, structured commit history and optimize team collaboration, we adhere to the Angular Conventional Commits standard for both commit messages and Git branch naming. This ensures every change type is immediately recognizable and supports automation for changelog generation, semantic versioning, and streamlined release processes.
4
16
5
17
In addition, we enforce these standards using CommitLint, ensuring that all commit messages conform to the defined rules before they are accepted into the repository.
6
18
7
19
This project employs both GitHub Actions and a local pre-commit pipeline to validate commit messages, enforce branch naming conventions, and maintain repository integrity throughout the development workflow.
8
20
21
+
---
22
+
9
23
## Local pipeline
10
24
11
25
The local pipeline is managed via husky
@@ -16,6 +30,8 @@ The local pipeline is managed via husky
16
30
- All tests pass
17
31
- Test coverage is met
18
32
33
+
---
34
+
19
35
## Contributing Workflow
20
36
21
37
To contribute to this repository, follow these steps:
@@ -69,6 +85,8 @@ This workflow ensures that:
69
85
70
86
For a step-by-step guide on forking and creating pull requests, see [GitHub’s documentation on forks](https://docs.github.com/en/get-started/quickstart/fork-a-repo) and [about pull requests](https://docs.github.com/en/pull-requests).
71
87
88
+
---
89
+
72
90
## Commitlint
73
91
74
92
OSF uses [Commitlint](https://www.npmjs.com/package/commitlint) to **enforce a consistent commit message format**.
@@ -156,10 +174,10 @@ update stuff
156
174
Refs #456
157
175
```
158
176
159
-
---
160
-
161
177
Commitlint will run automatically and reject non-compliant messages.
162
178
179
+
---
180
+
163
181
## Branch Naming Format
164
182
165
183
### The branch name should follow the format:
@@ -175,10 +193,14 @@ short-description – a brief description of the change.
175
193
176
194
```
177
195
196
+
---
197
+
178
198
## Available Types (type)
179
199
180
200
See the [Allowed Commit Types](#allowed-commit-types) section for details.
Copy file name to clipboardExpand all lines: docs/ngxs.md
+44-2Lines changed: 44 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,18 @@
1
-
# NGXS State Management Overview
1
+
# NGXS State Management
2
+
3
+
## Index
4
+
5
+
-[Purpose](#purpose)
6
+
-[Core Concepts](#core-concepts)
7
+
-[Directory Structure](#directory-structure)
8
+
-[State Models](#state-models)
9
+
-[Tooling and Extensions](#tooling-and-extensions)
10
+
-[Testing](#testing)
11
+
-[Documentation](#documentation)
12
+
13
+
---
14
+
15
+
## Overview
2
16
3
17
The OSF Angular project uses [NGXS](https://www.ngxs.io/) as the state management library for Angular applications. NGXS provides a simple, powerful, and TypeScript-friendly framework for managing state across components and services.
4
18
@@ -45,6 +59,33 @@ src/app/shared/services/
45
59
46
60
---
47
61
62
+
## State Models
63
+
64
+
The OSF Angular project follows a consistent NGXS state model structure to ensure clarity, predictability, and alignment across all features. The recommended shape for each domain-specific state is as follows:
65
+
66
+
1. Domain state pattern:
67
+
68
+
```ts
69
+
domain: {
70
+
data: [], // Array of typed model data (e.g., Project[], User[])
71
+
isLoading: false, // Indicates if data retrieval (GET) is in progress
72
+
isSubmitting: false, // Indicates if data submission (POST/PUT/DELETE) is in progress
73
+
error: null, // Captures error messages from failed HTTP requests
74
+
}
75
+
```
76
+
77
+
2.`data` holds the strongly typed collection of entities defined by the feature's interface or model class.
78
+
79
+
3.`isLoading` is a signal used to inform the component and template layer that a read or fetch operation is currently pending.
80
+
81
+
4.`isSubmitting` signals that a write operation (form submission, update, delete, etc.) is currently in progress.
82
+
83
+
5.`error` stores error state information (commonly strings or structured error objects) that result from failed service interactions. This can be displayed in UI or logged for debugging.
84
+
85
+
Each domain state should be minimal, normalized, and scoped to its specific feature, mirroring the structure and shape of the corresponding OSF backend API response.
86
+
87
+
---
88
+
48
89
## Tooling and Extensions
49
90
50
91
-[Redux DevTools](https://github.com/zalmoxisus/redux-devtools-extension) is supported. Enable it in development via `NgxsReduxDevtoolsPluginModule`.
@@ -55,7 +96,8 @@ src/app/shared/services/
55
96
56
97
## Testing
57
98
58
-
- Mock `Store` using `jest.fn()` or test-specific modules for unit testing components and services.
99
+
-[Testing Strategy](docs/testing.md)
100
+
-[NGXS State Testing Strategy](docs/testing.md#ngxs-state-testing-strategy)
The OSF Angular project uses a modular and mock-driven testing strategy. A shared `testing/` folder provides reusable mocks, mock data, and testing module configuration to support consistent and maintainable unit tests across the codebase.
@@ -29,20 +45,6 @@ The OSF Angular project defines a `@testing` scope that can be used for importin
0 commit comments