Skip to content

Commit 1dce7d7

Browse files
committed
feat(registries): Merge upstream/main
2 parents 4b5b7d5 + cf5041d commit 1dce7d7

723 files changed

Lines changed: 9161 additions & 9760 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"id": 7359757,
3+
"name": "All Branch Rules",
4+
"target": "branch",
5+
"source_type": "Repository",
6+
"source": "CenterForOpenScience/angular-osf",
7+
"enforcement": "disabled",
8+
"conditions": {
9+
"ref_name": {
10+
"exclude": ["refs/heads/main", "refs/heads/develop"],
11+
"include": ["~ALL"]
12+
}
13+
},
14+
"rules": [
15+
{
16+
"type": "deletion"
17+
},
18+
{
19+
"type": "required_review_thread_resolution",
20+
"parameters": {
21+
"enabled": true
22+
}
23+
},
24+
{
25+
"type": "pull_request",
26+
"parameters": {
27+
"required_approving_review_count": 1,
28+
"dismiss_stale_reviews_on_push": true,
29+
"require_code_owner_review": false,
30+
"require_last_push_approval": true,
31+
"automatic_copilot_code_review_enabled": false,
32+
"allowed_merge_methods": ["squash"]
33+
}
34+
}
35+
],
36+
"bypass_actors": []
37+
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"id": 7359601,
3+
"name": "Main/Develop Branch Rules",
4+
"target": "branch",
5+
"source_type": "Repository",
6+
"source": "CenterForOpenScience/angular-osf",
7+
"enforcement": "active",
8+
"conditions": {
9+
"ref_name": {
10+
"exclude": [],
11+
"include": ["~DEFAULT_BRANCH", "refs/heads/develop"]
12+
}
13+
},
14+
"rules": [
15+
{
16+
"type": "deletion"
17+
},
18+
{
19+
"type": "non_fast_forward"
20+
},
21+
{
22+
"type": "merge_queue",
23+
"parameters": {
24+
"merge_method": "SQUASH",
25+
"max_entries_to_build": 8,
26+
"min_entries_to_merge": 1,
27+
"max_entries_to_merge": 5,
28+
"min_entries_to_merge_wait_minutes": 5,
29+
"grouping_strategy": "ALLGREEN",
30+
"check_response_timeout_minutes": 90
31+
}
32+
},
33+
{
34+
"type": "required_review_thread_resolution",
35+
"parameters": {
36+
"enabled": true
37+
}
38+
},
39+
{
40+
"type": "pull_request",
41+
"parameters": {
42+
"required_approving_review_count": 1,
43+
"dismiss_stale_reviews_on_push": true,
44+
"require_code_owner_review": false,
45+
"require_last_push_approval": true,
46+
"automatic_copilot_code_review_enabled": false,
47+
"allowed_merge_methods": ["squash"]
48+
}
49+
}
50+
],
51+
"bypass_actors": []
52+
}

.github/workflows/review.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
uses: actions/github-script@v7
1919
with:
2020
script: |
21-
const {owner, repo} = context.repo;
21+
const { owner, repo } = context.repo;
2222
2323
// Determine PR number for both pull_request and pull_request_review events
2424
let number;
@@ -41,11 +41,13 @@ jobs:
4141
const latestByUser = new Map();
4242
for (const r of reviews) latestByUser.set(r.user.id, r.state);
4343
44-
// Count approvals
4544
const approvals = [...latestByUser.values()].filter(s => s === 'APPROVED').length;
45+
const hasRequestChanges = [...latestByUser.values()].includes('CHANGES_REQUESTED');
4646
4747
if (approvals < 1) {
4848
core.setFailed(`PR #${number} requires at least one approving review before merging.`);
49+
} else if (hasRequestChanges) {
50+
core.setFailed(`PR #${number} cannot be merged because at least one reviewer has requested changes.`);
4951
} else {
5052
core.info(`Approvals found: ${approvals}. Check passed.`);
5153
}

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,16 @@ take up to 60 seconds once the docker build finishes.
1717
### First steps
1818

1919
- Install git commit template: [Commit Template](docs/commit.template.md).
20-
- Volta: [Volta](#volta)
20+
- [Volta](#volta)
2121

2222
### Recommended
2323

24-
- Compodoc: [Compodoc Conventions](docs/compodoc.md).
25-
- Docker Commands: [Docker Commands](docs/docker.md).
26-
- Git Conventions: [Git Conventions](docs/git-convention.md).
27-
- NGXS: [NGXS Conventions](docs/ngxs.md).
24+
- [Compodoc Conventions](docs/compodoc.md).
25+
- [Docker Commands](docs/docker.md).
26+
- [ESLint Strategy](docs/eslint.md).
27+
- [Git Conventions](docs/git-convention.md).
28+
- [NGXS Conventions](docs/ngxs.md).
29+
- [Testing Strategy](docs/testing.md).
2830

2931
### Optional
3032

angular.json

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"allowedCommonJsDependencies": [
2828
"qrcode",
2929
"cedar-embeddable-editor",
30+
"cedar-artifact-viewer",
3031
"markdown-it-video",
3132
"ace-builds/src-noconflict/ext-language_tools"
3233
],
@@ -43,7 +44,7 @@
4344
}
4445
],
4546
"styles": [
46-
"src/assets/styles/styles.scss",
47+
"src/styles/styles.scss",
4748
"node_modules/primeflex/primeflex.css",
4849
"node_modules/@fortawesome/fontawesome-free/css/all.min.css",
4950
"node_modules/ngx-markdown-editor/assets/highlight.js/agate.min.css"
@@ -78,6 +79,17 @@
7879
"outputHashing": "none",
7980
"namedChunks": true
8081
},
82+
"local": {
83+
"optimization": false,
84+
"extractLicenses": false,
85+
"sourceMap": true,
86+
"fileReplacements": [
87+
{
88+
"replace": "src/environments/environment.ts",
89+
"with": "src/environments/environment.local.ts"
90+
}
91+
]
92+
},
8193
"development": {
8294
"optimization": false,
8395
"extractLicenses": false,
@@ -101,6 +113,10 @@
101113
"development": {
102114
"buildTarget": "osf:build:development",
103115
"hmr": false
116+
},
117+
"local": {
118+
"buildTarget": "osf:build:local",
119+
"hmr": false
104120
}
105121
},
106122
"defaultConfiguration": "development"

docs/eslint.md

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# Linting Strategy – OSF Angular
2+
3+
---
4+
5+
## Overview
6+
7+
This project uses a **unified, modern ESLint flat config** approach to enforce consistent coding styles, accessibility standards, and TypeScript best practices. Linting runs on:
8+
9+
- TypeScript (`*.ts`)
10+
- HTML templates (`*.html`)
11+
- Specs (`*.spec.ts`)
12+
13+
It also integrates into the **Git workflow** via `pre-commit` hooks to ensure clean, compliant code before every commit.
14+
15+
---
16+
17+
## Linting Commands
18+
19+
```bash
20+
# Run full project lint
21+
npm run lint
22+
```
23+
24+
---
25+
26+
## ESLint Config Structure
27+
28+
### 1. TypeScript Files (`**/*.ts`)
29+
30+
**Extends**:
31+
32+
- `@eslint/js` → base ESLint config
33+
- `typescript-eslint` recommended & stylistic configs
34+
- `angular-eslint` TypeScript rules
35+
- `eslint-plugin-prettier/recommended`
36+
37+
**Plugins**:
38+
39+
- `eslint-plugin-import`
40+
- `eslint-plugin-simple-import-sort`
41+
- `eslint-plugin-unused-imports`
42+
43+
**Key Rules**:
44+
45+
- Enforces Angular selector styles:
46+
- Directives → `osfFoo` (camelCase)
47+
- Components → `<osf-bar>` (kebab-case)
48+
- Enforces import sorting and duplicate prevention
49+
- Removes unused imports automatically
50+
- Allows unused variables named `_` to support convention (e.g., destructuring)
51+
52+
---
53+
54+
### 2. HTML Templates (`**/*.html`)
55+
56+
**Extends**:
57+
58+
- `angular-eslint/templateRecommended`
59+
- `angular-eslint/templateAccessibility`
60+
61+
**Parser**:
62+
63+
- `@angular-eslint/template-parser`
64+
65+
**Key A11y Rules** (All Set to `"error"`):
66+
67+
- `alt-text`
68+
- `valid-aria`
69+
- `click-events-have-key-events`
70+
- `role-has-required-aria`
71+
- `interactive-supports-focus`
72+
- `no-distracting-elements`
73+
- `no-autofocus`
74+
- `label-has-associated-control`
75+
76+
> This enforces **WCAG accessibility compliance** directly in Angular templates.
77+
78+
---
79+
80+
### 3. Test Files (`**/*.spec.ts`)
81+
82+
Loosened restrictions for developer convenience:
83+
84+
```ts
85+
'@typescript-eslint/no-explicit-any': 'off',
86+
'@typescript-eslint/no-empty-function': 'off',
87+
```
88+
89+
---
90+
91+
## Pre-Commit Hook
92+
93+
The `pre-commit` file includes:
94+
95+
- `npx lint-staged` → Lint only **staged files** before every commit
96+
- Ensures **TypeScript and template linting** run automatically
97+
98+
## Summary
99+
100+
| File Type | Purpose | Key Rules |
101+
| ------------ | ------------------------------------- | --------------------------------------- |
102+
| `*.ts` | Lint Angular + TS logic | Unused imports, selector rules, sorting |
103+
| `*.html` | Enforce a11y & Angular best practices | All template a11y rules enforced |
104+
| `*.spec.ts` | Relaxed for test convenience | Some TS rules turned off |
105+
| `pre-commit` | Git hook to lint before committing | Ensures consistent PR quality |

0 commit comments

Comments
 (0)