Skip to content

Commit ed5f60b

Browse files
committed
Merge branch 'refs/heads/main' into fix/search-updates
2 parents b6fca34 + 141fd22 commit ed5f60b

File tree

415 files changed

+11500
-2850
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

415 files changed

+11500
-2850
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
# Compiled output
44
/dist
5+
/documentation
56
/tmp
67
/out-tsc
78
/bazel-out

.husky/pre-commit

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,11 @@ npx lint-staged || {
22
printf "\n\nERROR: Linting issues were found in the committed files. Please address them before proceeding.\n\n\n\n"
33
exit 1
44
}
5+
6+
npm run docs:coverage || {
7+
printf "\n\nERROR: Documentation Coverage thresholds are not met."
8+
printf "\n\nIn the future this will block your ability to commit locally until it is resolved."
9+
printf "\n\nThe same pipeline runs via GitHub actions."
10+
printf "\n\nYou are seeing this error because code was added without documentation."
11+
# exit 1
12+
}

.husky/pre-push

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
# npm run build
22

33
npm run test:coverage || {
4-
printf "\n\nERROR: Testing errors or coverage issues were found."
4+
printf "\n\nERROR: Testing errors or coverage issues are found."
55
printf "\n\nIn the future this will block your ability to push to github until it is resolved."
6-
printf "\n\nThe same pipeline runs on github."
6+
printf "\n\nThe same pipeline runs via GitHub actions."
77
printf "\n\nYou are seeing this error because code was added without test coverage."
88
# printf "\n\n Please address them before proceeding.\n\n\n\n"
99
# exit 1
1010
}
1111

1212
npm run test:check-coverage-thresholds || {
13-
printf "\n\nERROR: Coverage thresholds were not met."
13+
printf "\n\nERROR: Coverage thresholds are not met."
1414
printf "\n\nIn the future this will block your ability to push to github until it is resolved."
15-
printf "\n\nThe same pipeline runs on github."
15+
printf "\n\nThe same pipeline runs via GitHub actions."
1616
printf "\n\nYou are seeing this error because test coverage increased without updating the jest.config.js thresholds."
1717
#printf "\n\nPlease address them before proceeding.\n\n\n\n"
1818
# exit 1

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,17 @@ take up to 60 seconds once the docker build finishes.
1414

1515
## Index
1616

17-
### Recommended
17+
### First steps
1818

1919
- Install git commit template: [Commit Template](docs/commit.template.md).
20+
- Volta: [Volta](#volta)
21+
22+
### Recommended
23+
24+
- Compodoc: [Compodoc Conventions](docs/compodoc.md).
2025
- Docker Commands: [Docker Commands](docs/docker.md).
2126
- Git Conventions: [Git Conventions](docs/git-convention.md).
22-
- Volta: [Volta](#volta)
27+
- NGXS: [NGXS Conventions](docs/ngxs.md).
2328

2429
### Optional
2530

@@ -50,4 +55,4 @@ npm run test:check-coverage-thresholds
5055
## Volta
5156

5257
OSF uses volta to manage node and npm versions inside of the repository
53-
Install Volta from https://volta.sh/ and it will automatically pin Node/npm per the repo toolchain.
58+
Install Volta from [volta](https://volta.sh/) and it will automatically pin Node/npm per the repo toolchain.

docs/assets/osf-ngxs-diagram.png

100 KB
Loading

docs/compodoc.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Angular Documentation with Compodoc
2+
3+
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.
4+
5+
---
6+
7+
## How to Generate Documentation
8+
9+
To generate and view the documentation locally:
10+
11+
```bash
12+
npm run docs
13+
```
14+
15+
This will:
16+
17+
1. Build the Compodoc documentation.
18+
2. Launch a local web server to view it (typically on [http://localhost:8080](http://localhost:8080)).
19+
20+
---
21+
22+
## Documentation Coverage Requirements
23+
24+
- **100% Compodoc coverage is required** across all services, components, models, and utilities.
25+
- All public methods, properties, and classes must be documented using proper JSDoc style comments.
26+
- Coverage checks are enforced **before every commit** and **during CI/CD** via GitHub Actions.
27+
28+
---
29+
30+
## Pre-commit Enforcement via Husky
31+
32+
Husky is configured to run a **pre-commit hook** that will:
33+
34+
- Run Compodoc.
35+
- Check coverage.
36+
- Block the commit if documentation coverage is below 100%.
37+
38+
If the hook fails, you’ll see output indicating which files or symbols are undocumented.
39+
40+
---
41+
42+
## CI/CD Enforcement
43+
44+
During pull requests and merges, GitHub Actions re-validates documentation coverage.
45+
46+
Any PR that does not meet the 100% documentation requirement will be blocked from merging until resolved.
47+
48+
---
49+
50+
## Tips for Passing Coverage
51+
52+
- Use `@Input`, `@Output`, and `@Injectable` annotations with proper descriptions.
53+
- Document every exported interface, function, method, and variable.
54+
- Use the `@example` tag for complex methods when helpful.
55+
- Apply JSDoc on constructor-injected properties using `@param`.
56+
57+
---
58+
59+
## Output Directory
60+
61+
By default, generated documentation lives in:
62+
63+
```
64+
/documentation/
65+
```
66+
67+
This folder is **not committed to the repo** and is only used locally or in build pipelines.
68+
69+
---
70+
71+
## Need Help?
72+
73+
Run the following to see detailed CLI options:
74+
75+
```bash
76+
npx compodoc --help
77+
```
78+
79+
Or visit: [https://compodoc.app](https://compodoc.app)
80+
81+
---

docs/ngxs.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# NGXS State Management Overview
2+
3+
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+
5+
---
6+
7+
## Purpose
8+
9+
The goal of using NGXS is to centralize and streamline the handling of application state, reduce boilerplate, and maintain a predictable flow of data and events throughout the OSF Angular app.
10+
11+
---
12+
13+
## Core Concepts
14+
15+
- **State**: Defines a slice of the application state and how it is modified in response to actions.
16+
- **Actions**: Dispatched to signal state changes or trigger effects (e.g., API calls).
17+
- **Selectors**: Functions that extract and transform data from the store.
18+
- **Store**: Centralized container that holds the application state.
19+
- **Effects** (via `@ngxs-labs/effects` or `@ngxs/store`): Side-effect handling such as HTTP requests, logging, etc.
20+
21+
### Diagram
22+
23+
[![OSF NGRX Diagram](./assets/osf-ngxs-diagram.png)](./assets/osf-ngxs-diagram.png)
24+
25+
---
26+
27+
## Directory Structure
28+
29+
Typical NGXS-related files are organized as follows:
30+
31+
```
32+
src/app/shared/stores/
33+
└── addons/
34+
├── addons.actions.ts # All action definitions
35+
├── addons.models.ts # Interfaces & data models
36+
├── addons.state.ts # State implementation
37+
├── addons.selectors.ts # Reusable selectors
38+
```
39+
40+
```
41+
src/app/shared/services/
42+
└── addons/
43+
├── addons.service.ts # External API calls
44+
```
45+
46+
---
47+
48+
## Tooling and Extensions
49+
50+
- [Redux DevTools](https://github.com/zalmoxisus/redux-devtools-extension) is supported. Enable it in development via `NgxsReduxDevtoolsPluginModule`.
51+
- [NGXS Logger Plugin](https://www.ngxs.io/plugins/logger) can be used for debugging dispatched actions and state changes.
52+
- [NGXS Storage Plugin](https://www.ngxs.io/plugins/storage) allows selective persistence of state across reloads.
53+
54+
---
55+
56+
## Testing
57+
58+
- Mock `Store` using `jest.fn()` or test-specific modules for unit testing components and services.
59+
60+
---
61+
62+
## Documentation
63+
64+
Refer to the official NGXS documentation for full API details and advanced usage:
65+
[https://www.ngxs.io/docs](https://www.ngxs.io/docs)

jest.config.js

Lines changed: 38 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ module.exports = {
99
'^@core/(.*)$': '<rootDir>/src/app/core/$1',
1010
'^@shared/(.*)$': '<rootDir>/src/app/shared/$1',
1111
'^@styles/(.*)$': '<rootDir>/assets/styles/$1',
12+
'^@testing/(.*)$': '<rootDir>/src/testing/$1',
1213
'^src/environments/environment$': '<rootDir>/src/environments/environment.ts',
1314
},
1415
transform: {
@@ -32,6 +33,10 @@ module.exports = {
3233
'!src/app/**/*.models.{ts.js}',
3334
'!src/app/**/*.model.{ts.js}',
3435
'!src/app/**/*.route.{ts,js}',
36+
'!src/app/**/*.enum.{ts,js}',
37+
'!src/app/**/*.type.{ts,js}',
38+
'!src/app/**/*.enum.{ts,js}',
39+
'!src/app/**/*.type.{ts,js}',
3540
'!src/app/**/*.spec.{ts,js}',
3641
'!src/app/**/*.module.ts',
3742
'!src/app/**/index.ts',
@@ -46,59 +51,57 @@ module.exports = {
4651
statements: 41.63,
4752
},
4853
},
54+
watchPathIgnorePatterns: [
55+
'<rootDir>/node_modules/',
56+
'<rootDir>/dist/',
57+
'<rootDir>/coverage/',
58+
'<rootDir>/src/assets/',
59+
'<rootDir>/src/environments/',
60+
'<rootDir>/src/@types/',
61+
],
62+
watchPathIgnorePatterns: [
63+
'<rootDir>/node_modules/',
64+
'<rootDir>/dist/',
65+
'<rootDir>/coverage/',
66+
'<rootDir>/src/assets/',
67+
'<rootDir>/src/environments/',
68+
'<rootDir>/src/@types/',
69+
],
4970
testPathIgnorePatterns: [
5071
'<rootDir>/src/app/app.config.ts',
5172
'<rootDir>/src/app/app.routes.ts',
5273
'<rootDir>/src/app/features/registry/',
53-
'<rootDir>/src/app/features/project/',
74+
'<rootDir>/src/app/features/project/addons/components/configure-configure-addon/',
75+
'<rootDir>/src/app/features/project/addons/components/connect-configured-addon/',
76+
'<rootDir>/src/app/features/project/addons/components/disconnect-addon-modal/',
77+
'<rootDir>/src/app/features/project/analytics/',
78+
'<rootDir>/src/app/features/project/contributors/',
79+
'<rootDir>/src/app/features/project/files/',
80+
'<rootDir>/src/app/features/project/metadata/',
81+
'<rootDir>/src/app/features/project/overview/',
82+
'<rootDir>/src/app/features/project/registrations',
83+
'<rootDir>/src/app/features/project/settings',
84+
'<rootDir>/src/app/features/project/wiki',
85+
'<rootDir>/src/app/features/project/project.component.ts',
5486
'<rootDir>/src/app/features/registries/',
5587
'<rootDir>/src/app/features/settings/addons/',
5688
'<rootDir>/src/app/features/settings/settings-container.component.ts',
5789
'<rootDir>/src/app/features/settings/tokens/components/',
5890
'<rootDir>/src/app/features/settings/tokens/mappers/',
5991
'<rootDir>/src/app/features/settings/tokens/store/',
6092
'<rootDir>/src/app/features/settings/tokens/pages/tokens-list/',
61-
'<rootDir>/src/app/shared/components/education-history/',
62-
'<rootDir>/src/app/shared/components/education-history-dialog/',
63-
'<rootDir>/src/app/shared/components/employment-history/',
64-
'<rootDir>/src/app/shared/components/employment-history-dialog/',
6593
'<rootDir>/src/app/shared/components/file-menu/',
6694
'<rootDir>/src/app/shared/components/files-tree/',
67-
'<rootDir>/src/app/shared/components/filter-chips/',
68-
'<rootDir>/src/app/shared/components/form-select/',
69-
'<rootDir>/src/app/shared/components/full-screen-loader/',
70-
'<rootDir>/src/app/shared/components/generic-filter/',
71-
'<rootDir>/src/app/shared/components/icon/',
72-
'<rootDir>/src/app/shared/components/info-icon/',
73-
'<rootDir>/src/app/shared/components/license/',
7495
'<rootDir>/src/app/shared/components/line-chart/',
75-
'<rootDir>/src/app/shared/components/list-info-shortener/',
76-
'<rootDir>/src/app/shared/components/loading-spinner/',
7796
'<rootDir>/src/app/shared/components/make-decision-dialog/',
78-
'<rootDir>/src/app/shared/components/markdown/',
79-
'<rootDir>/src/app/shared/components/password-input-hint/',
8097
'<rootDir>/src/app/shared/components/pie-chart/',
81-
'<rootDir>/src/app/shared/components/readonly-input/',
82-
'<rootDir>/src/app/shared/components/registration-card/',
83-
'<rootDir>/src/app/shared/components/resource-card/',
8498
'<rootDir>/src/app/shared/components/resource-citations/',
85-
'<rootDir>/src/app/shared/components/resource-metadata/',
8699
'<rootDir>/src/app/shared/components/reusable-filter/',
87-
'<rootDir>/src/app/shared/components/search-help-tutorial/',
88-
'<rootDir>/src/app/shared/components/search-input/',
89-
'<rootDir>/src/app/shared/components/search-results-container/',
90-
'<rootDir>/src/app/shared/components/select/',
91-
'<rootDir>/src/app/shared/components/shared-metadata/',
92-
'<rootDir>/src/app/shared/components/statistic-card/',
93-
'<rootDir>/src/app/shared/components/status-badge/',
94-
'<rootDir>/src/app/shared/components/stepper/',
95-
'<rootDir>/src/app/shared/components/sub-header/',
100+
'<rootDir>/src/app/shared/components/shared-metadata/dialogs/affiliated-institutions-dialog/',
101+
'<rootDir>/src/app/shared/components/shared-metadata/dialogs/contributors-dialog/',
102+
'<rootDir>/src/app/shared/components/shared-metadata/shared-metadata',
96103
'<rootDir>/src/app/shared/components/subjects/',
97-
'<rootDir>/src/app/shared/components/tags-input/',
98-
'<rootDir>/src/app/shared/components/text-input/',
99-
'<rootDir>/src/app/shared/components/toast/',
100-
'<rootDir>/src/app/shared/components/truncated-text/',
101-
'<rootDir>/src/app/shared/components/view-only-table/',
102-
'<rootDir>/src/app/shared/components/wiki/',
104+
'<rootDir>/src/app/shared/components/wiki/edit-section/',
105+
'<rootDir>/src/app/shared/components/wiki/wiki-list/',
103106
],
104107
};

0 commit comments

Comments
 (0)