Skip to content

Commit

Permalink
Fix frontend CVEs (#40)
Browse files Browse the repository at this point in the history
* Update @angular/core via ng update to 11.2.14

* Upgrade @angular/cdk to 11.2.14

* Update @angular/cli to 11.2.14

* Update @angular/material to 11.2.14

* Update @ngrx/store to v11

* WIP: fix peer dependencies for angular 11

This commit does NOT compile, likely due to an error with the angular compiler and mismatched version. The next commit will upgrade all deps to angular 12 to remedy this.

* Update @angular/core to v12

* Update @angular/cdk to v12

* Update @angular/material and @angular/flex-layout to v12, also @ngrx/store

* Update @angular/cli to v12

* Update @angular-builders/custom-webpack to v12, replace @cfstratos/ajsf-material with original @ajsf/material

* change custom SassHandler to handle new WebPack 5 Structure as well

* Fix KnownKeys type issues for updated [email protected]

* Remove debug logging

* Remove overrides for angular upgrade

* Upgrade to angular v13

* Upgrade to angular v14

* Remove references to @cfstratos/ajsf-material

* Move code coverage to different tests

* WIP: Fix tests, still a lot of warnings

* discontinue use of karma-coverage-instanbul-reporter

* Use @cypress/request where possible

* Upgrade immer

* Upgrade @types/karma

* Update marked; change imports accordingly

* Update immer; fix typing for api-request-reducers

* update @swimlane/ngx-charts; fix type issues

* Replace request with maintained fork

* Add npm as engine requirement to make sure overrides work

* Fix up lockfile

* Formatting

---------

Co-authored-by: Matthias Folz <[email protected]>
Co-authored-by: Tim Meier <[email protected]>
  • Loading branch information
3 people authored Oct 23, 2023
1 parent dbe4bff commit 83683da
Show file tree
Hide file tree
Showing 629 changed files with 15,227 additions and 40,032 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
!.vscode/extensions.json

# misc
/.angular/cache
/.sass-cache
/connect.lock
/coverage
Expand Down
118 changes: 17 additions & 101 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
Expand All @@ -78,9 +76,7 @@
"optimization": false,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": false,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": false,
Expand All @@ -95,7 +91,6 @@
"serve": {
"builder": "@angular-builders/custom-webpack:dev-server",
"options": {
"aot": true,
"sslCert": "dev-ssl/server.crt",
"proxyConfig": "proxy.conf.js",
"ssl": true,
Expand Down Expand Up @@ -154,7 +149,7 @@
"schematics": {},
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"builder": "@angular-devkit/build-angular:ng-packagr",
"options": {
"preserveSymlinks": true,
"outputPath": "dist/core",
Expand All @@ -168,20 +163,22 @@
},
"configurations": {
"production": {
"budgets": [{
"type": "anyComponentStyle",
"maximumWarning": "6kb"
}],
"fileReplacements": [{
"replace": "src/frontend/packages/core/src/environments/environment.ts",
"with": "src/frontend/packages/core/src/environments/environment.prod.ts"
}],
"budgets": [
{
"type": "anyComponentStyle",
"maximumWarning": "6kb"
}
],
"fileReplacements": [
{
"replace": "src/frontend/packages/core/src/environments/environment.ts",
"with": "src/frontend/packages/core/src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true
Expand Down Expand Up @@ -214,18 +211,6 @@
}
]
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.json"
],
"tslintConfig": "src/frontend/packages/core/tslint.json",
"files": [
"src/frontend/packages/core/src/**/*.ts"
]
}
}
}
},
Expand All @@ -236,7 +221,7 @@
"prefix": "lib",
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"builder": "@angular-devkit/build-angular:ng-packagr",
"options": {
"tsConfig": "src/frontend/packages/store/tsconfig.lib.json",
"project": "src/frontend/packages/store/ng-package.json"
Expand All @@ -254,18 +239,6 @@
"tsConfig": "src/frontend/packages/store/tsconfig.spec.json",
"karmaConfig": "src/frontend/packages/store/karma.conf.js"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.json"
],
"tslintConfig": "src/frontend/packages/store/tslint.json",
"files": [
"src/frontend/packages/store/src/**/*.ts"
]
}
}
}
},
Expand Down Expand Up @@ -316,7 +289,7 @@
"prefix": "lib",
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"builder": "@angular-devkit/build-angular:ng-packagr",
"options": {
"tsConfig": "src/frontend/packages/shared/tsconfig.lib.json",
"project": "src/frontend/packages/shared/ng-package.json"
Expand All @@ -329,14 +302,6 @@
"tsConfig": "src/frontend/packages/shared/tsconfig.spec.json",
"karmaConfig": "src/frontend/packages/shared/karma.conf.js"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": ["src/tsconfig.json"],
"tslintConfig": "src/frontend/packages/shared/tslint.json",
"files": ["src/frontend/packages/shared/src/**/*.ts"]
}
}
}
},
Expand All @@ -347,7 +312,7 @@
"prefix": "lib",
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"builder": "@angular-devkit/build-angular:ng-packagr",
"options": {
"tsConfig": "src/frontend/packages/cloud-foundry/tsconfig.lib.json",
"project": "src/frontend/packages/cloud-foundry/ng-package.json"
Expand All @@ -365,18 +330,6 @@
"tsConfig": "src/frontend/packages/cloud-foundry/tsconfig.spec.json",
"karmaConfig": "src/frontend/packages/cloud-foundry/karma.conf.js"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.json"
],
"tslintConfig": "src/frontend/packages/cloud-foundry/tslint.json",
"files": [
"src/frontend/packages/cloud-foundry/src/**/*.ts"
]
}
}
}
},
Expand All @@ -387,7 +340,7 @@
"prefix": "lib",
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"builder": "@angular-devkit/build-angular:ng-packagr",
"options": {
"tsConfig": "src/frontend/packages/cf-autoscaler/tsconfig.lib.json",
"project": "src/frontend/packages/cf-autoscaler/ng-package.json"
Expand All @@ -405,18 +358,6 @@
"tsConfig": "src/frontend/packages/cf-autoscaler/tsconfig.spec.json",
"karmaConfig": "src/frontend/packages/cf-autoscaler/karma.conf.js"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.json"
],
"tslintConfig": "src/frontend/packages/cf-autoscaler/tslint.json",
"files": [
"src/frontend/packages/cf-autoscaler/src/**/*.ts"
]
}
}
}
},
Expand All @@ -433,18 +374,6 @@
"tsConfig": "src/frontend/packages/kubernetes/tsconfig.spec.json",
"karmaConfig": "src/frontend/packages/kubernetes/karma.conf.js"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.json"
],
"tslintConfig": "src/frontend/packages/kubernetes/tslint.json",
"files": [
"src/frontend/packages/kubernetes/src/**/*.ts"
]
}
}
}
},
Expand All @@ -461,24 +390,11 @@
"tsConfig": "src/frontend/packages/git/tsconfig.spec.json",
"karmaConfig": "src/frontend/packages/git/karma.conf.js"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.json"
],
"tslintConfig": "src/frontend/packages/git/tslint.json",
"files": [
"src/frontend/packages/git/src/**/*.ts"
]
}
}
}
}

},
"defaultProject": "stratos",
"schematics": {
"@schematics/angular:component": {
"prefix": "app",
Expand Down
18 changes: 8 additions & 10 deletions build/karma.conf.creator.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = function (project) {
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('karma-coverage'),
require('karma-spec-reporter'),
require('@angular-devkit/build-angular/plugins/karma'),
require(path.join(repoRoot, 'build/karma.test.reporter.js'))
Expand All @@ -24,16 +24,14 @@ module.exports = function (project) {
random: false
}
},
coverageIstanbulReporter: {
coverageReporter: {
dir: path.join(repoRoot, 'coverage', project),
reports: ['html', 'lcovonly', 'json'],
fixWebpackSourcePaths: true,
'report-config': {
json: {
// Collate all coverage-final files into a single dir for nyc to combine (it can't pick them out from `coverage`)
file: path.join('..', 'nyc', project + '-coverage-final.json')
}
},
subdir: ".",
reporters: [
{ type: 'html' },
{ type: 'json', file: path.join('..', 'nyc', project + '-coverage-final.json')},
{ type: 'lcovonly' }
],
},
reporters: ['spec', 'kjhtml', 'stratos'],
specReporter: {
Expand Down
Loading

0 comments on commit 83683da

Please sign in to comment.