Skip to content

Commit 70deedb

Browse files
CopilotDaveSkender
andauthored
chore: Update packages (w/ Angular v20) (#397)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: DaveSkender <8432125+DaveSkender@users.noreply.github.com>
1 parent 130b115 commit 70deedb

39 files changed

+7481
-1947
lines changed

.github/copilot-setup-steps.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,9 @@ jobs:
3232
# Install global npm tools
3333
- name: Install global npm dependencies
3434
run: |
35-
npm install -g @angular/cli@latest
35+
npm install -g @angular/cli@latest # Provides 'ng' command
3636
npm install -g typescript@latest
37-
npm install -g eslint@latest
3837
npm install -g prettier@latest
39-
npm install -g @typescript-eslint/parser@latest
40-
npm install -g @typescript-eslint/eslint-plugin@latest
4138
4239
# Install Azure tools
4340
- name: Install Azure tools

.github/workflows/build-website.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,76 @@ jobs:
4747
working-directory: ./client
4848
run: npm install
4949

50+
- name: Run unit tests
51+
working-directory: ./client
52+
run: npm run test:coverage
53+
54+
- name: Publish test results
55+
uses: dorny/test-reporter@v1
56+
if: success() || failure()
57+
with:
58+
name: Jest Tests
59+
path: client/test-results/junit.xml
60+
reporter: jest-junit
61+
62+
- name: Upload coverage reports to Codecov
63+
uses: codecov/codecov-action@v5
64+
with:
65+
file: ./client/coverage/lcov.info
66+
directory: ./client/coverage/
67+
flags: unittests
68+
name: codecov-umbrella
69+
fail_ci_if_error: false
70+
71+
- name: Coverage Report
72+
uses: romeovs/lcov-reporter-action@v0.3.1
73+
if: success() || failure()
74+
with:
75+
lcov-file: ./client/coverage/lcov.info
76+
github-token: ${{ secrets.GITHUB_TOKEN }}
77+
delete-old-comments: true
78+
79+
- name: Add coverage to summary
80+
if: success() || failure()
81+
run: |
82+
echo "## 📊 Test Coverage Report" >> $GITHUB_STEP_SUMMARY
83+
echo "" >> $GITHUB_STEP_SUMMARY
84+
echo "| Metric | Coverage |" >> $GITHUB_STEP_SUMMARY
85+
echo "|--------|----------|" >> $GITHUB_STEP_SUMMARY
86+
87+
if [ -f "./client/coverage/lcov.info" ]; then
88+
# Extract coverage data from lcov.info
89+
STATEMENTS=$(grep -o "LF:[0-9]*" ./client/coverage/lcov.info | awk -F: '{sum+=$2} END {print sum}')
90+
HIT_STATEMENTS=$(grep -o "LH:[0-9]*" ./client/coverage/lcov.info | awk -F: '{sum+=$2} END {print sum}')
91+
FUNCTIONS=$(grep -o "FNF:[0-9]*" ./client/coverage/lcov.info | awk -F: '{sum+=$2} END {print sum}')
92+
HIT_FUNCTIONS=$(grep -o "FNH:[0-9]*" ./client/coverage/lcov.info | awk -F: '{sum+=$2} END {print sum}')
93+
BRANCHES=$(grep -o "BRF:[0-9]*" ./client/coverage/lcov.info | awk -F: '{sum+=$2} END {print sum}')
94+
HIT_BRANCHES=$(grep -o "BRH:[0-9]*" ./client/coverage/lcov.info | awk -F: '{sum+=$2} END {print sum}')
95+
96+
# Calculate percentages using awk
97+
STMT_PCT=$(echo "$HIT_STATEMENTS $STATEMENTS" | awk '{if($2>0) printf "%.2f", $1*100/$2; else print "0"}')
98+
FUNC_PCT=$(echo "$HIT_FUNCTIONS $FUNCTIONS" | awk '{if($2>0) printf "%.2f", $1*100/$2; else print "0"}')
99+
BRANCH_PCT=$(echo "$HIT_BRANCHES $BRANCHES" | awk '{if($2>0) printf "%.2f", $1*100/$2; else print "0"}')
100+
101+
echo "| Statements | ${STMT_PCT}% (${HIT_STATEMENTS}/${STATEMENTS}) |" >> $GITHUB_STEP_SUMMARY
102+
echo "| Functions | ${FUNC_PCT}% (${HIT_FUNCTIONS}/${FUNCTIONS}) |" >> $GITHUB_STEP_SUMMARY
103+
echo "| Branches | ${BRANCH_PCT}% (${HIT_BRANCHES}/${BRANCHES}) |" >> $GITHUB_STEP_SUMMARY
104+
else
105+
echo "| Coverage data | Not available |" >> $GITHUB_STEP_SUMMARY
106+
fi
107+
108+
echo "" >> $GITHUB_STEP_SUMMARY
109+
echo "📁 **Coverage report:** Check the artifacts for detailed HTML coverage report" >> $GITHUB_STEP_SUMMARY
110+
111+
- name: Upload coverage artifacts
112+
uses: actions/upload-artifact@v4
113+
if: success() || failure()
114+
with:
115+
name: coverage-report
116+
path: |
117+
client/coverage/
118+
client/test-results/
119+
50120
- name: Build site
51121
working-directory: ./client
52122
run: npm run build.prod

.github/workflows/deploy-website.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,10 +195,7 @@ jobs:
195195
with:
196196
apiToken: ${{ secrets.CLOUDFLARE_API_KEY }}
197197
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
198-
wranglerVersion: "latest"
199-
command: >
200-
pages deploy artifacts/web
201-
--project-name=${{ vars.CLOUDFLARE_PROJECT_NAME }}
198+
command: pages deploy artifacts/web --project-name=${{ vars.CLOUDFLARE_PROJECT_NAME }}
202199

203200
- name: Tag and draft release note
204201
uses: ncipollo/release-action@v1

client/.eslintrc.json

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,9 @@
88
"files": [
99
"*.ts"
1010
],
11-
"parserOptions": {
12-
"project": [
13-
"tsconfig.json"
14-
],
15-
"createDefaultProgram": true
16-
},
1711
"extends": [
12+
"eslint:recommended",
13+
"plugin:@typescript-eslint/recommended",
1814
"plugin:@angular-eslint/recommended",
1915
"plugin:@angular-eslint/template/process-inline-templates"
2016
],
@@ -42,7 +38,8 @@
4238
"*.html"
4339
],
4440
"extends": [
45-
"plugin:@angular-eslint/template/recommended"
41+
"plugin:@angular-eslint/template/recommended",
42+
"plugin:@angular-eslint/template/accessibility"
4643
],
4744
"rules": {}
4845
}

client/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ speed-measure-plugin*.json
3636
/.sass-cache
3737
/connect.lock
3838
/coverage
39+
/test-results
3940
/libpeerconnection.log
4041
npm-debug.log
4142
yarn-error.log

client/angular.json

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
"includePaths": [
4141
"node_modules",
4242
"src",
43-
"src/styles"]
43+
"src/styles"
44+
]
4445
},
4546
"outputHashing": "all"
4647
},
@@ -89,11 +90,49 @@
8990
"options": {
9091
"buildTarget": "app:build"
9192
}
93+
},
94+
"lint": {
95+
"builder": "@angular-eslint/builder:lint",
96+
"options": {
97+
"lintFilePatterns": [
98+
"src/**/*.ts",
99+
"src/**/*.html"
100+
]
101+
}
92102
}
93103
}
94104
}
95105
},
96106
"cli": {
97-
"analytics": false
107+
"analytics": false,
108+
"schematicCollections": [
109+
"@angular-eslint/schematics"
110+
]
111+
},
112+
"schematics": {
113+
"@schematics/angular:component": {
114+
"type": "component"
115+
},
116+
"@schematics/angular:directive": {
117+
"type": "directive"
118+
},
119+
"@schematics/angular:service": {
120+
"type": "service"
121+
},
122+
"@schematics/angular:guard": {
123+
"typeSeparator": "."
124+
},
125+
"@schematics/angular:interceptor": {
126+
"typeSeparator": "."
127+
},
128+
"@schematics/angular:module": {
129+
"typeSeparator": "."
130+
},
131+
"@schematics/angular:pipe": {
132+
"typeSeparator": "."
133+
},
134+
"@schematics/angular:resolver": {
135+
"typeSeparator": "."
136+
}
98137
}
99138
}

client/eslint.config.js

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

client/jest.config.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
const { defaults } = require("jest-config");
2+
3+
module.exports = {
4+
preset: "jest-preset-angular",
5+
testEnvironment: "jsdom",
6+
setupFilesAfterEnv: ["<rootDir>/src/test-setup.ts"],
7+
moduleFileExtensions: ["ts", "tsx", "js", "json"],
8+
transform: {
9+
"^.+\\.(ts|js|html)$": [
10+
"jest-preset-angular",
11+
{
12+
tsconfig: "<rootDir>/tsconfig.spec.json",
13+
stringifyContentPathRegex: "\\.html$",
14+
},
15+
],
16+
},
17+
testMatch: ["<rootDir>/src/**/*.spec.ts"],
18+
collectCoverageFrom: [
19+
"src/**/*.ts",
20+
"!src/**/*.d.ts",
21+
"!src/main.ts",
22+
"!src/polyfills.ts",
23+
"!src/**/*.module.ts",
24+
"!src/**/environment*.ts",
25+
],
26+
coverageDirectory: "coverage",
27+
coverageReporters: ["html", "text-summary", "lcov"],
28+
reporters: [
29+
"default",
30+
["jest-junit", {
31+
outputDirectory: "test-results",
32+
outputName: "junit.xml"
33+
}]
34+
]
35+
};

0 commit comments

Comments
 (0)