Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/65678 upgrade angular #3006

Open
wants to merge 83 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
b51afd4
Fix integration test config
jon-shipley Dec 11, 2024
6a86fde
Upgrade typescript to ~4.8 so we can upgrade to angular 15
jon-shipley Dec 11, 2024
3493649
Iniital upgrade to angular 15
jon-shipley Dec 11, 2024
ab88c07
Fix angular15 not able to find any tests
jon-shipley Dec 11, 2024
7a6d45d
Further angular15 upgrades
jon-shipley Dec 11, 2024
0fb82cb
Upgrade rxjs for angular15
jon-shipley Dec 11, 2024
d0636d5
Fix unit test
jon-shipley Dec 11, 2024
836dbd8
Update inferred type from any
jon-shipley Dec 11, 2024
73194ad
Upgrade typescript to 4.9.3
jon-shipley Dec 12, 2024
678f872
WIP: intial angular 16 upgrade
jon-shipley Dec 12, 2024
f4ffbe4
WIP: upgrade deps for angular16
jon-shipley Dec 12, 2024
dab3eaf
Remove code no longer applicable due to upgrade
jon-shipley Dec 12, 2024
188c997
Upgrade uuid
jon-shipley Dec 12, 2024
7b25f48
Remove uuid types - no longer needed
jon-shipley Dec 12, 2024
00a5bf5
Upgrade to node 18
jon-shipley Dec 13, 2024
676474b
SPA - upgrade docker build image
jon-shipley Dec 13, 2024
03fd3e9
Update env.rb
activemq Dec 16, 2024
cd1fe64
Revert node17 change so that ipv4 is first.
jon-shipley Dec 16, 2024
361ac27
Merge branch 'feature/65678-upgrade-angular' of https://github.com/DF…
jon-shipley Dec 16, 2024
4fb7213
Merge remote-tracking branch 'origin/master' into feature/65678-upgra…
jon-shipley Dec 18, 2024
809d676
Update to yarn.lock after running setup after merging in master
jon-shipley Dec 18, 2024
41a6026
Update canDeactive to CanDeactiveFn in CheckComponent (only usage)
jon-shipley Dec 23, 2024
c1ed1df
Merge remote-tracking branch 'origin/master' into feature/65678-upgra…
jon-shipley Dec 24, 2024
d12031b
Upgrade SPA to use node 20
jon-shipley Dec 24, 2024
6308133
[SPA] Dependency updates
jon-shipley Dec 24, 2024
a44f2e2
[SPA] Prep for angular 17
jon-shipley Dec 24, 2024
22406a4
[SPA] initial autmated upgrade
jon-shipley Dec 24, 2024
8baa73c
[SPA] initial manual upgrade to v17
jon-shipley Dec 24, 2024
44952c2
[SPA] manual upgrade to angular 17
jon-shipley Dec 24, 2024
7beb8b7
Remove debug
jon-shipley Dec 24, 2024
a7d15ef
Fix linting
jon-shipley Dec 27, 2024
88621c7
Allow 'explicit any' as this is an angular upgrade and it needs to pa…
jon-shipley Dec 28, 2024
8e44974
lint fixes
jon-shipley Dec 28, 2024
041d3d9
lint fixes and rxjs deprecation refactorings
jon-shipley Dec 30, 2024
f9f71d8
Lint fixes and refactors
jon-shipley Dec 31, 2024
2301401
Refactor rxjs deprecation
jon-shipley Jan 2, 2025
5de2ee1
Refactor angular deprecation
jon-shipley Jan 2, 2025
0cdf300
dep update
jon-shipley Jan 2, 2025
26f6258
dep update
jon-shipley Jan 2, 2025
94722de
Refactor to remove deprecated RouterTestingModule
jon-shipley Jan 2, 2025
29ae08a
Fix lint
jon-shipley Jan 2, 2025
34bd0a2
Refactor deprecated usages of RouterTestingModule
jon-shipley Jan 2, 2025
b5e4198
Fix deprecated usages of initEvent used in spec files
jon-shipley Jan 3, 2025
12faae0
[SPA] fix deprecations, refactor where needed
jon-shipley Jan 3, 2025
7c4c985
Remove file - no apparent usages
jon-shipley Jan 3, 2025
ae0df31
Upgrade to angular 18
jon-shipley Jan 8, 2025
34febe7
Change SPA output dir back to 'dist'
jon-shipley Jan 8, 2025
6b644e7
Remove bashism
jon-shipley Jan 8, 2025
9eb4f24
Update circleci
jon-shipley Jan 8, 2025
defe6f3
Workaround a karma build issue
jon-shipley Jan 9, 2025
442dbac
Fix
jon-shipley Jan 9, 2025
ba89bfe
Fix whitespace
jon-shipley Jan 9, 2025
eb9c913
Add chrome back in
jon-shipley Jan 9, 2025
930e8ff
Remove old cache files
jon-shipley Jan 9, 2025
79c529b
Upgrade angular to v19
jon-shipley Jan 10, 2025
f295fb5
Add prettier config to project
jon-shipley Jan 10, 2025
d6dfccf
[SPA] Turn off eslint errors for prefer-standalone
jon-shipley Jan 10, 2025
5c0bb3d
Reformat
jon-shipley Jan 10, 2025
1aa43e0
Revert circlci workaround
jon-shipley Jan 10, 2025
9dc10df
Revert httpd serve location now that the app is output back into dist.
jon-shipley Jan 10, 2025
5ae7130
Merge remote-tracking branch 'origin/master' into feature/65678-upgra…
jon-shipley Jan 22, 2025
22bfb7f
Fix Safari issues in iOS 13 to iOS 16
jon-shipley Jan 27, 2025
f79bf51
Merge remote-tracking branch 'origin/master' into feature/65678-upgra…
jon-shipley Jan 27, 2025
5d599e7
Update selenium webdriver to latest
jon-shipley Jan 27, 2025
af0eaa6
meta
jon-shipley Jan 27, 2025
3ca7bab
Remove lz-string
jon-shipley Jan 27, 2025
8cd0eb3
Replace Buffer with buffer-esm for esm compatibility
jon-shipley Jan 27, 2025
f944754
update timing for max wait time
activemq Jan 28, 2025
0d57713
Fix desktop versions
jon-shipley Jan 28, 2025
65e9398
Merge branch 'feature/65678-upgrade-angular' of https://github.com/DF…
jon-shipley Jan 28, 2025
1ff56ca
Drop support for Safari 13
jon-shipley Jan 28, 2025
0fc8f3d
Reset Tsconfig
jon-shipley Jan 28, 2025
2e7689a
Update nginx supported browsers
jon-shipley Jan 28, 2025
0237f2c
Update config comments
jon-shipley Jan 28, 2025
e4b65ec
Add comment
jon-shipley Jan 28, 2025
654adbc
Refactor to work better on all browsers
jon-shipley Jan 28, 2025
b58cbb2
Fix tests
jon-shipley Jan 28, 2025
02bb455
Merge branch 'master' into feature/65678-upgrade-angular
jon-shipley Jan 31, 2025
6937c9d
update test
activemq Jan 31, 2025
45489ff
Merge branch 'feature/65678-upgrade-angular' of https://github.com/DF…
activemq Jan 31, 2025
92ddd90
Fix issue running under /bin/sh
jon-shipley Jan 31, 2025
11ee789
Merge branch 'feature/65678-upgrade-angular' of https://github.com/DF…
jon-shipley Jan 31, 2025
2788326
Merge branch 'master' into feature/65678-upgrade-angular
jon-shipley Jan 31, 2025
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
5 changes: 2 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ jobs:
environment:
TZ: Europe/London
steps:
- browser-tools/install-browser-tools:
chrome-version: 126.0.6478.182 # TODO: remove when chromedriver downloads are fixed
- browser-tools/install-browser-tools
- browser-tools/install-chrome
- browser-tools/install-chromedriver
- checkout
Expand All @@ -37,7 +36,7 @@ jobs:
environment:
JEST_JUNIT_OUTPUT_DIR: "reports/junit/js-test-results.xml"
- run: export NVM_DIR=${HOME}/.nvm && source ${NVM_DIR}/nvm.sh; cd pupil-spa; nvm use; yarn install --frozen-lockfile
- run: export NVM_DIR=${HOME}/.nvm && source ${NVM_DIR}/nvm.sh; cd pupil-spa; nvm use; yarn run test-single
- run: export NVM_DIR=${HOME}/.nvm && source ${NVM_DIR}/nvm.sh; cd pupil-spa; nvm use; yarn test:single
- run: export NVM_DIR=${HOME}/.nvm && source ${NVM_DIR}/nvm.sh; cd tslib; nvm use; yarn install --frozen-lockfile
- run: export NVM_DIR=${HOME}/.nvm && source ${NVM_DIR}/nvm.sh; cd tslib; nvm use; yarn test:throttle
- run: export NVM_DIR=${HOME}/.nvm && source ${NVM_DIR}/nvm.sh; cd admin; nvm use; yarn test:frontend
Expand Down
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"trailingComma": "es5",
"tabWidth": 2,
"semi": false,
"singleQuote": true
}
7 changes: 3 additions & 4 deletions pupil-spa/.browserslistrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
> 0.5%
last 4 versions
Firefox ESR
not dead
not IE 11
Safari >= 13
iOS >= 13
Safari >= 14
iOS >= 14
not OperaMini all
not dead
40 changes: 16 additions & 24 deletions pupil-spa/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,49 +1,41 @@
{
"root": true,
"ignorePatterns": [
"projects/**/*"
],
"ignorePatterns": ["projects/**/*"],
"overrides": [
{
"files": [
"*.ts"
],
"parserOptions": {
"project": [
"./tsconfig.json",
"e2e/tsconfig.json"
],
"createDefaultProgram": true
},
"files": ["*.ts"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@angular-eslint/recommended",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
"@angular-eslint/component-selector": [
"@angular-eslint/directive-selector": [
"error",
{
"type": "attribute",
"prefix": "app",
"style": "kebab-case",
"type": "element"
"style": "camelCase"
}
],
"@angular-eslint/directive-selector": [
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": "app",
"style": "camelCase",
"type": "attribute"
"style": "kebab-case"
}
]
],
"@typescript-eslint/no-explicit-any": "off",
"@angular-eslint/prefer-standalone": "off"
}
},
{
"files": [
"*.html"
],
"files": ["*.html"],
"extends": [
"plugin:@angular-eslint/template/recommended"
"plugin:@angular-eslint/template/recommended",
"plugin:@angular-eslint/template/accessibility"
],
"rules": {}
}
Expand Down
2 changes: 1 addition & 1 deletion pupil-spa/.nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v16.17.1
v20.18.0
5 changes: 3 additions & 2 deletions pupil-spa/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
### STAGE 1: Build ###

# We label our stage as 'builder'
FROM node:16-alpine AS builder
FROM node:20-alpine AS builder

# `yarn install` needs to be able to find `git` for lz-string which uses a github.com URL for the version.
RUN apk update && \
apk upgrade && \
apk add git
apk add git && \
apk add alpine-sdk python3 py3-distutils-extra py3-pip

COPY package.json .
COPY yarn.lock .
Expand Down
60 changes: 40 additions & 20 deletions pupil-spa/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,23 @@
"projectType": "application",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"builder": "@angular-devkit/build-angular:application",
"options": {
"outputPath": "dist",
"outputPath": {
"base": "dist",
"browser": ""
},
"index": "src/index.html",
"main": "src/main.ts",
"tsConfig": "src/tsconfig.app.json",
"polyfills": "src/polyfills.ts",
"polyfills": [
"src/polyfills.ts",
"@angular/localize/init"
],
"stylePreprocessorOptions": {
"includePaths": [
"src/lib",
"node_modules/govuk-elements-sass/public/sass/",
"node_modules/govuk_frontend_toolkit/"
"./src/lib",
"./node_modules/govuk-elements-sass/public/sass/",
"./node_modules/govuk_frontend_toolkit/"
]
},
"assets": [
Expand All @@ -31,13 +36,19 @@
"src/styles.scss"
],
"scripts": [],
"vendorChunk": true,
"extractLicenses": false,
"buildOptimizer": false,
"sourceMap": true,
"sourceMap": {
"scripts": true,
"styles": false,
"vendor": true
},
"optimization": true,
"namedChunks": true
},
"namedChunks": true,
"allowedCommonJsDependencies": [
"polly-js"
],
"browser": "src/main.ts"
},
"configurations": {
"production": {
"budgets": [
Expand All @@ -48,11 +59,13 @@
],
"optimization": true,
"outputHashing": "all",
"sourceMap": true,
"sourceMap": {
"scripts": true,
"styles": false,
"vendor": true
},
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
Expand All @@ -66,24 +79,27 @@
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "pupil-spa:build"
"buildTarget": "pupil-spa:build"
},
"configurations": {
"production": {
"browserTarget": "pupil-spa:build:production"
"buildTarget": "pupil-spa:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "pupil-spa:build"
"buildTarget": "pupil-spa:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"builderMode": "application",
"include": [
"**/*.spec.ts"
],
"karmaConfig": "./karma.conf.js",
"stylePreprocessorOptions": {
"includePaths": [
Expand All @@ -92,7 +108,11 @@
"node_modules/govuk_frontend_toolkit/"
]
},
"polyfills": "src/polyfills.ts",
"polyfills": [
"src/polyfills.ts",
"zone.js/testing",
"@angular/localize/init"
],
"tsConfig": "src/tsconfig.spec.json",
"scripts": [],
"styles": [
Expand Down
2 changes: 1 addition & 1 deletion pupil-spa/gen_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -e
# set -x
scriptDir="$( cd "$( dirname "$0" )" >/dev/null && pwd )"
envFile=${scriptDir}/../.env
[[ -f ${envFile} ]] && source ${envFile}
test -f "${envFile}" && . ${envFile}
applicationInsightsConnectionString=${APPINSIGHTS_CONNECTION_STRING}
apiBaseUrl=${PUPIL_API_BASE_URL:-"http://localhost:3003"}
checkStartAPIErrorDelay=${CHECK_START_ERROR_DELAY:-"2000"}
Expand Down
15 changes: 9 additions & 6 deletions pupil-spa/nginx/browsers-map.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,21 @@ map $http_user_agent $outdated {
# -------------------------------------------
# Safari
# Disallow
# safari 12 (Mojave) and below
#
# Allow:
# safari 15 (Monterey)
# safari 13 (Catalina) and below

# Allow (everything else by default)
# safari 14 (Big Sur)
# safari 13 (Catalina)
# safari 15 (Monterey)
# safari 16 (Ventura)
# safari 17 (Sonoma)
# safari 18 (Ventura)

#
"~AppleWebKit.*Version/[0-9]\..*Safari" 1; # Safari version 1 to 9
"~AppleWebKit.*Version/10\..*Safari" 1; # safari 10
"~AppleWebKit.*Version/11\..*Safari" 1; # safari 11
"~AppleWebKit.*Version/12\..*Safari" 1; # safari 12

"~AppleWebKit.*Version/13\..*Safari" 1; # safari 13
# -------------------------------------------
# ie 1-10
#
Expand Down
Loading