Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/scripts/check-coverage-thresholds.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const fs = require('fs');
const { execSync } = require('child_process');
const coverage = require('../../coverage/coverage-summary.json');
const jestConfig = require('../../jest.config.js');

Expand Down Expand Up @@ -41,7 +40,6 @@ for (const key of ['branches', 'functions', 'lines', 'statements']) {

if (failed) {
const stars = '*'.repeat(warnMessage.length + 8);
execSync('clear', { stdio: 'inherit' });
console.log('\n\nCongratulations! You have successfully run the coverage check and added tests.');
console.log('\n\nThe jest.config.js file is not insync with your new test additions.');
console.log('Please update the coverage thresholds in jest.config.js.');
Expand Down
40 changes: 39 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,29 @@ on:
branches: ['*'] # or change to match your default branch
push:
branches: ['*']
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 22.13.1

- name: Install dependencies
run: npm ci

- name: Run Jest tests
run: npm run ci:test
test-coverage:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -23,7 +41,27 @@ jobs:
run: npm ci

- name: Run Jest tests with coverage
run: npm run ci
run: npm run ci:test:coverage

- name: Check coverage thresholds
run: npm run test:check-coverage-thresholds
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 22.13.1

- name: Install dependencies
run: npm ci

- name: Run linting
run: npm run lint

- name: Check formatting with prettier
run: npm run format:check
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
/tmp
/out-tsc
/bazel-out
/src/assets/config/config.json

# Node
/node_modules
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ take up to 60 seconds once the docker build finishes.

- Install git commit template: [Commit Template](docs/commit.template.md).
- [Volta](#volta)
- 3rd-party tokens [Configuration](#configuration)

### Recommended

Expand Down Expand Up @@ -59,3 +60,9 @@ npm run test:check-coverage-thresholds

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

## Configuration

OSF uses an `assets/config/config.json` file for any 3rd-party tokens. This file is not committed to the repo.

There is a `assets/config/template.json` file that can be copied to `assets/config/config.json` to store any 3rd-party tokens locally.
18 changes: 3 additions & 15 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = {
'^@osf/(.*)$': '<rootDir>/src/app/$1',
'^@core/(.*)$': '<rootDir>/src/app/core/$1',
'^@shared/(.*)$': '<rootDir>/src/app/shared/$1',
'^@styles/(.*)$': '<rootDir>/src/styles/$1',
'^@styles/(.*)$': '<rootDir>/assets/styles/$1',
'^@testing/(.*)$': '<rootDir>/src/testing/$1',
'^src/environments/environment$': '<rootDir>/src/environments/environment.ts',
},
Expand Down Expand Up @@ -62,24 +62,13 @@ module.exports = {
testPathIgnorePatterns: [
'<rootDir>/src/app/app.config.ts',
'<rootDir>/src/app/app.routes.ts',
'<rootDir>/src/app/features/registry/',
'<rootDir>/src/app/features/project/addons/components/configure-configure-addon/',
'<rootDir>/src/app/features/project/addons/components/connect-configured-addon/',
'<rootDir>/src/app/features/project/addons/components/disconnect-addon-modal/',
'<rootDir>/src/app/features/project/addons/components/confirm-account-connection-modal/',
'<rootDir>/src/app/features/files/components',
'<rootDir>/src/app/features/files/pages/community-metadata',
'<rootDir>/src/app/features/files/pages/file-detail',
'<rootDir>/src/app/features/preprints/',
'<rootDir>/src/app/features/project/contributors/',
'<rootDir>/src/app/features/project/overview/',
'<rootDir>/src/app/features/project/registrations',
'<rootDir>/src/app/features/project/settings',
'<rootDir>/src/app/features/project/wiki',
'<rootDir>/src/app/features/project/project.component.ts',
'<rootDir>/src/app/features/project/',
'<rootDir>/src/app/features/registries/',
'<rootDir>/src/app/features/registry/',
'<rootDir>/src/app/features/settings/addons/',
'<rootDir>/src/app/features/settings/tokens/mappers/',
'<rootDir>/src/app/features/settings/tokens/store/',
'<rootDir>/src/app/shared/components/file-menu/',
'<rootDir>/src/app/shared/components/files-tree/',
Expand All @@ -88,7 +77,6 @@ module.exports = {
'<rootDir>/src/app/shared/components/pie-chart/',
'<rootDir>/src/app/shared/components/resource-citations/',
'<rootDir>/src/app/shared/components/reusable-filter/',
'<rootDir>/src/app/shared/components/subjects/',
'<rootDir>/src/app/shared/components/wiki/edit-section/',
'<rootDir>/src/app/shared/components/wiki/wiki-list/',
],
Expand Down
110 changes: 110 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"ng": "ng",
"analyze-bundle": "ng build --configuration=analyze-bundle && source-map-explorer dist/**/*.js --no-border-checks",
"build": "ng build",
"ci": "npm run lint && jest --coverage",
"ci:test": "jest",
"ci:test:coverage": "jest --coverage",
"docs": "./node_modules/.bin/compodoc -p tsconfig.docs.json --name 'OSF Angular Documentation' --theme 'laravel' -s",
"docs:coverage": "./node_modules/.bin/compodoc -p tsconfig.docs.json --coverageTest 0 --coverageMinimumPerFile 0",
"lint": "ng lint",
Expand Down Expand Up @@ -45,7 +46,9 @@
"@ngxs/logger-plugin": "^19.0.0",
"@ngxs/store": "^19.0.0",
"@primeng/themes": "^19.0.9",
"@sentry/angular": "^10.10.0",
"ace-builds": "^1.42.0",
"angular-google-tag-manager": "^1.11.0",
"cedar-artifact-viewer": "^0.9.5",
"cedar-embeddable-editor": "^1.5.0",
"chart.js": "^4.4.9",
Expand Down
1 change: 1 addition & 0 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<router-outlet />
<osf-toast></osf-toast>
<osf-cookie-consent></osf-cookie-consent>
<osf-full-screen-loader></osf-full-screen-loader>
Loading
Loading