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

[#11345] Update Angular to 12 #11509

Merged
merged 37 commits into from
Feb 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
49a175f
Update Angular to 10
wkurniawan07 Dec 5, 2021
443d211
Update snapshot files
wkurniawan07 Dec 5, 2021
c79346c
Change all async to waitForAsync
wkurniawan07 Dec 5, 2021
8b3fcb6
Update to Angular 11
wkurniawan07 Dec 5, 2021
95f7114
Update some other dependencies
wkurniawan07 Dec 5, 2021
cbf2e7a
Update to Angular 12 and Jest 27
wkurniawan07 Dec 5, 2021
cc88249
Disable critical inlining for CSS
wkurniawan07 Dec 5, 2021
74fa98d
Use new syntaxes for Jest
wkurniawan07 Dec 5, 2021
4a8efb1
Update snapshot files
wkurniawan07 Dec 5, 2021
5a7a542
Update latest dependencies + remove jsonlint
wkurniawan07 Dec 5, 2021
5725ae6
Add flags to prevent implicit any type
wkurniawan07 Dec 4, 2021
c31d023
Replace tslint with eslint in package.json
wkurniawan07 Dec 5, 2021
865b4c8
Replace existing tslint configurations with eslint
wkurniawan07 Dec 5, 2021
4eec98a
Fix violations in HTML files
wkurniawan07 Dec 5, 2021
b4a3351
Fix unused function parameters
wkurniawan07 Dec 5, 2021
6d6c659
Fix empty constructors
wkurniawan07 Dec 5, 2021
19f2f2f
Fix empty lifecycle methods
wkurniawan07 Dec 5, 2021
23d41b4
Restructure some classes to prevent cyclic dependency
wkurniawan07 Dec 5, 2021
91fb659
Fix unnecessary Object.assign
wkurniawan07 Dec 5, 2021
56d56d4
Fix whitespace-related issues
wkurniawan07 Dec 5, 2021
8cd5c4b
Fix operator linebreak positions
wkurniawan07 Dec 5, 2021
9efa052
Fix linebreak consistency within objects
wkurniawan07 Dec 5, 2021
55f9c72
Fix no-negated-condition
wkurniawan07 Dec 5, 2021
2d18e89
Fix arrow functions no-return-assign
wkurniawan07 Dec 5, 2021
ac8d226
Fix JSDoc-related issues
wkurniawan07 Dec 5, 2021
49eabd0
Fix conditional execution no-unused-expressions
wkurniawan07 Dec 5, 2021
8ee53bd
Move default param to last
wkurniawan07 Dec 5, 2021
4f34040
Wrap case blocks to prevent scope pollution
wkurniawan07 Dec 5, 2021
5a875aa
Fix nested ternary expressions
wkurniawan07 Dec 5, 2021
92380cc
Fix unnecessary class usage
wkurniawan07 Dec 5, 2021
c3c6684
Fix Jest usage of callback
wkurniawan07 Dec 5, 2021
8c28006
Fix import-related issues
wkurniawan07 Dec 12, 2021
2ed51c4
Fix max-len issues
wkurniawan07 Dec 5, 2021
ccf7ea8
Fix misc minor issues
wkurniawan07 Dec 5, 2021
315182c
Update latest dependencies + remove ts-node + @angular/language-service
wkurniawan07 Dec 11, 2021
4afde7b
Apply subresource integrity
wkurniawan07 Dec 20, 2021
063b82d
Shorten npm build command
wkurniawan07 Dec 20, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
17 changes: 17 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries

# For the full list of supported browsers by the Angular framework, please see:
# https://angular.io/guide/browser-support

# You can see what browsers were selected by your queries by running:
# npx browserslist

last 1 Chrome version
last 1 Firefox version
last 2 Edge major versions
last 2 Safari major versions
last 2 iOS major versions
Firefox ESR
IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.
2 changes: 1 addition & 1 deletion .github/workflows/e2e-cross.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- name: Install Frontend Dependencies
run: npm ci
- name: Build Frontend Bundle
run: npm run build -- --progress=false --serviceWorker=false
run: npm run build
- name: Start Server
if: matrix.os == 'ubuntu-latest'
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- name: Install Frontend Dependencies
run: npm ci
- name: Build Frontend Bundle
run: npm run build -- --progress=false --serviceWorker=false
run: npm run build
- name: Start Server
run: |
./gradlew serverRun &
Expand Down
61 changes: 38 additions & 23 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"prefix": "tm",
"schematics": {
"@schematics/angular:component": {
"style": "scss"
"style": "scss",
"strict": true
}
},
"architect": {
Expand All @@ -22,7 +23,10 @@
"main": "src/web/main.ts",
"polyfills": "src/web/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"aot": true,
"allowedCommonJsDependencies": [
"core-js",
"moment-timezone"
],
"assets": [
"src/web/assets/"
],
Expand Down Expand Up @@ -51,15 +55,16 @@
"src/web/sitemap.xml",
"src/web/manifest.webmanifest"
],
"optimization": true,
"optimization": {
"scripts": true,
"styles": {
"minify": true,
"inlineCritical": false
},
"fonts": true
},
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": true,
"aot": true,
"extractLicenses": false,
"vendorChunk": true,
"buildOptimizer": true,
"subresourceIntegrity": true,
"serviceWorker": true,
"ngswConfigPath": "ngsw-config.json",
"budgets": [
Expand All @@ -74,19 +79,29 @@
"maximumError": "10kb"
}
]
},
"development": {
"vendorChunk": true,
"extractLicenses": false,
"buildOptimizer": false,
"sourceMap": true,
"optimization": false,
"namedChunks": true
}
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "teammates:build"
},
"configurations": {
"production": {
"browserTarget": "teammates:build:production"
},
"development": {
"browserTarget": "teammates:build:development"
}
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
Expand All @@ -101,19 +116,19 @@
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"builder": "@angular-eslint/builder:lint",
"options": {
"tsConfig": [
"tsconfig.app.json",
"tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
"lintFilePatterns": [
"src/**/*.ts",
"src/**/*.html"
]
}
}
}
}
},
"defaultProject": "teammates"
"defaultProject": "teammates",
"cli": {
"defaultCollection": "@angular-eslint/schematics"
}
}
12 changes: 0 additions & 12 deletions browserslist

This file was deleted.

4 changes: 2 additions & 2 deletions docs/setting-up.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ These tools are necessary regardless of whether you are developing front-end or
If you want to develop front-end, you need to install the following:

1. Install Node.js (minimum version 12.11.1).
1. (Optional but highly recommended) Install Angular CLI version 9 globally.
1. (Optional but highly recommended) Install Angular CLI version 12 globally.
```sh
npm install -g @angular/cli@9
npm install -g @angular/cli@12
```
**Verification:** Run `ng` and you should see a list of available Angular CLI commands.

Expand Down
6 changes: 2 additions & 4 deletions docs/static-analysis.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ The version number of all the tool stacks are declared in `build.gradle` or `pac
| [PMD](https://pmd.github.io/) | [`teammates-pmd.xml`](../static-analysis/teammates-pmd.xml), [`teammates-pmdMain.xml`](../static-analysis/teammates-pmdMain.xml) |
| [SpotBugs](https://spotbugs.github.io/) | [`teammates-spotbugs.xml`](../static-analysis/teammates-spotbugs.xml) |
| [ArchUnit](https://github.com/TNG/ArchUnit) | - |
| [TSLint](https://palantir.github.io/tslint/) | [`teammates-tslint.yml`](../static-analysis/teammates-tslint.yml) |
| [JSONlint](https://github.com/marionebl/jsonlint-cli) | - |
| [ESLint](https://eslint.org/) | [`teammates-eslint.yml`](../static-analysis/teammates-eslint.yml) |
| [stylelint](http://stylelint.io) | [`teammates-stylelint.yml`](../static-analysis/teammates-stylelint.yml) |
| [lintspaces](https://github.com/evanshortiss/lintspaces-cli) | - |

Expand All @@ -47,8 +46,7 @@ General rule of thumb when suppressing rules:
| PMD | `./gradlew pmdMain`, `./gradlew pmdTest` |
| SpotBugs | `./gradlew spotbugsMain`, `./gradlew spotbugsTest` |
| ArchUnit | `./gradlew architectureTest` |
| TSLint | `npm run lint:ts` |
| JSONlint | `npm run lint:json` |
| ESLint | `npm run lint:ts` |
| stylelint | `npm run lint:css` |
| lintspaces | `npm run lint:spaces` |

Expand Down
Loading