diff --git a/.drone.yml b/.drone.yml index ef18a48..67ebd66 100644 --- a/.drone.yml +++ b/.drone.yml @@ -34,37 +34,6 @@ kind: pipeline type: docker name: linux-arm -platform: - os: linux - arch: arm64 - -steps: - - name: build - image: node:alpine - commands: - - npm install - - npm run build:ssr - - name: docker - image: plugins/docker - settings: - auto_tag: true - auto_tag_suffix: linux-arm64 - repo: samuelph/universal-statuspage - username: - from_secret: USERNAME - password: - from_secret: PASSWORD - when: - branch: - - master - event: - - push - ---- -kind: pipeline -type: docker -name: linux-arm - platform: os: linux arch: arm @@ -110,7 +79,6 @@ steps: template: samuelph/universal-statuspage:OS-ARCH platforms: - linux/amd64 - - linux/arm64 - linux/arm username: from_secret: USERNAME @@ -119,7 +87,6 @@ steps: depends_on: - linux-amd64 - - linux-arm64 - linux-arm trigger: diff --git a/angular.json b/angular.json index a458a21..a9c5904 100644 --- a/angular.json +++ b/angular.json @@ -46,6 +46,7 @@ "optimization": true, "outputHashing": "all", "sourceMap": false, + "extractCss": true, "namedChunks": false, "extractLicenses": true, "vendorChunk": false, diff --git a/e2e/tsconfig.json b/e2e/tsconfig.json index c92199c..6b87cc4 100644 --- a/e2e/tsconfig.json +++ b/e2e/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../tsconfig.json", + "extends": "../tsconfig.base.json", "compilerOptions": { "outDir": "../out-tsc/e2e", "module": "commonjs", diff --git a/package.json b/package.json index ce81dc9..ad4d8d6 100644 --- a/package.json +++ b/package.json @@ -15,48 +15,48 @@ }, "private": true, "dependencies": { - "@angular/animations": "~11.0.2", - "@angular/cdk": "^11.0.1", - "@angular/common": "~11.0.2", - "@angular/compiler": "~11.0.2", - "@angular/core": "~11.0.2", - "@angular/forms": "~11.0.2", - "@angular/material": "^11.0.1", - "@angular/platform-browser": "~11.0.2", - "@angular/platform-browser-dynamic": "~11.0.2", - "@angular/platform-server": "~11.0.2", - "@angular/router": "~11.0.2", + "@angular/animations": "~10.0.4", + "@angular/cdk": "^10.0.2", + "@angular/common": "~10.0.4", + "@angular/compiler": "~10.0.4", + "@angular/core": "~10.0.4", + "@angular/forms": "~10.0.4", + "@angular/material": "^10.0.2", + "@angular/platform-browser": "~10.0.4", + "@angular/platform-browser-dynamic": "~10.0.4", + "@angular/platform-server": "~10.0.4", + "@angular/router": "~10.0.4", "@fortawesome/fontawesome-free": "^5.15.1", - "@nguniversal/express-engine": "^11.0.0", + "@nguniversal/express-engine": "^10.1.0", "bootstrap": "^4.5.3", "express": "^4.17.1", "jsonpath-plus": "^4.0.0", "roboto-fontface": "^0.10.0", - "rxjs": "~6.6.3", + "rxjs": "~6.6.0", "tslib": "^2.0.0", "zone.js": "~0.10.2" }, "devDependencies": { - "@angular-devkit/build-angular": "~0.1100.2", - "@angular/cli": "~11.0.2", - "@angular/compiler-cli": "~11.0.2", - "@angular/language-service": "~11.0.2", - "@nguniversal/builders": "^11.0.0", + "@angular-devkit/build-angular": "~0.1000.3", + "@angular/cli": "~10.0.3", + "@angular/compiler-cli": "~10.0.4", + "@angular/language-service": "~10.0.4", + "@nguniversal/builders": "^10.1.0", "@types/express": "^4.17.8", "@types/node": "^14.0.23", - "@types/jasmine": "~3.6.0", + "@types/jasmine": "~3.5.11", "@types/jasminewd2": "~2.0.3", "codelyzer": "^6.0.0", - "jasmine-core": "~3.6.0", + "jasmine-core": "~3.5.0", "jasmine-spec-reporter": "~5.0.0", "karma": "~5.1.0", "karma-chrome-launcher": "~3.1.0", "karma-coverage-istanbul-reporter": "~3.0.2", - "karma-jasmine": "~4.0.0", + "karma-jasmine": "~3.3.0", "karma-jasmine-html-reporter": "^1.5.0", "protractor": "~7.0.0", "ts-node": "~8.10.2", "tslint": "~6.1.0", - "typescript": "~4.0.5" + "typescript": "~3.9.7" } } diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index a240e16..5891c31 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -9,9 +9,8 @@ const routes: Routes = [{ @NgModule({ imports: [RouterModule.forRoot(routes, { - initialNavigation: 'enabled', - relativeLinkResolution: 'legacy' -})], + initialNavigation: 'enabled' + })], exports: [RouterModule] }) export class AppRoutingModule { diff --git a/src/app/app.component.spec.ts b/src/app/app.component.spec.ts index 994ccc9..5d69a33 100644 --- a/src/app/app.component.spec.ts +++ b/src/app/app.component.spec.ts @@ -1,9 +1,9 @@ -import { TestBed, waitForAsync } from '@angular/core/testing'; +import { TestBed, async } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; import { AppComponent } from './app.component'; describe('AppComponent', () => { - beforeEach(waitForAsync(() => { + beforeEach(async(() => { TestBed.configureTestingModule({ imports: [ RouterTestingModule diff --git a/src/app/status/status.component.spec.ts b/src/app/status/status.component.spec.ts index 0fed327..ddf4f67 100644 --- a/src/app/status/status.component.spec.ts +++ b/src/app/status/status.component.spec.ts @@ -1,4 +1,4 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { StatusComponent } from './status.component'; @@ -6,7 +6,7 @@ describe('StatusComponent', () => { let component: StatusComponent; let fixture: ComponentFixture; - beforeEach(waitForAsync(() => { + beforeEach(async(() => { TestBed.configureTestingModule({ declarations: [ StatusComponent ] }) diff --git a/src/main.status.ts b/src/main.status.ts index db41deb..8b466bd 100644 --- a/src/main.status.ts +++ b/src/main.status.ts @@ -1,5 +1,5 @@ import {json, Router} from 'express'; -import {CurrentStatus, Service, State} from './app/_data/data'; +import {CurrentStatus, State} from './app/_data/data'; import {existsSync, readFileSync, writeFileSync} from 'fs'; import {join} from 'path'; import {JSONPath} from 'jsonpath-plus'; @@ -83,53 +83,7 @@ api.post('/update/health', (req, res) => { }); api.get('/status', (req, res) => { - return res.json(cache); -}); - -api.get('/badge', (req, res) => { - const serviceId = req.query.service as string; - if (!serviceId) { - return res.json({ - "schemaVersion": 1, - "label": "sp-status", - "message": "service not provided", - "isError": true - }); - } - const service = cache.groups - .map(g => g.services).reduce((x, y) => x.concat(y), []) - .find(s => s.id === serviceId); - if (!service) { - return res.json({ - "schemaVersion": 1, - "label": "sp-status", - "message": "service not found", - "isError": true - }); - } - const label = req.query.label || service.name; - let message; - let color; - switch (service.state) { - case 'operational': - message = req.query.operational || service.state; - color = '#7ed321'; - break; - case 'outage': - message = req.query.outage || service.state; - color = '#ff6f6f'; - break; - case 'maintenance': - message = req.query.maintenance || service.state; - color = '#f7ca18'; - break; - } - return res.json({ - "schemaVersion": 1, - "label": label, - "message": message, - "color": color - }); + return res.json(cache); }); api.get('/info', (req, res) => { diff --git a/tsconfig.app.json b/tsconfig.app.json index f758d98..44795bd 100644 --- a/tsconfig.app.json +++ b/tsconfig.app.json @@ -1,5 +1,5 @@ { - "extends": "./tsconfig.json", + "extends": "./tsconfig.base.json", "compilerOptions": { "outDir": "./out-tsc/app", "types": [] diff --git a/tsconfig.base.json b/tsconfig.base.json new file mode 100644 index 0000000..ac05639 --- /dev/null +++ b/tsconfig.base.json @@ -0,0 +1,23 @@ +{ + "compileOnSave": false, + "compilerOptions": { + "baseUrl": "./", + "outDir": "./dist/out-tsc", + "sourceMap": true, + "declaration": false, + "downlevelIteration": true, + "experimentalDecorators": true, + "module": "es2020", + "moduleResolution": "node", + "importHelpers": true, + "target": "es2015", + "lib": [ + "es2018", + "dom" + ] + }, + "angularCompilerOptions": { + "fullTemplateTypeCheck": true, + "strictInjectionParameters": true + } +} diff --git a/tsconfig.json b/tsconfig.json index ac05639..e574583 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,23 +1,20 @@ +/* + This is a "Solution Style" tsconfig.json file, and is used by editors and TypeScript’s language server to improve development experience. + It is not intended to be used to perform a compilation. + + To learn more about this file see: https://angular.io/config/solution-tsconfig. +*/ { - "compileOnSave": false, - "compilerOptions": { - "baseUrl": "./", - "outDir": "./dist/out-tsc", - "sourceMap": true, - "declaration": false, - "downlevelIteration": true, - "experimentalDecorators": true, - "module": "es2020", - "moduleResolution": "node", - "importHelpers": true, - "target": "es2015", - "lib": [ - "es2018", - "dom" - ] - }, - "angularCompilerOptions": { - "fullTemplateTypeCheck": true, - "strictInjectionParameters": true - } -} + "files": [], + "references": [ + { + "path": "./tsconfig.app.json" + }, + { + "path": "./tsconfig.spec.json" + }, + { + "path": "./tsconfig.server.json" + } + ] +} \ No newline at end of file diff --git a/tsconfig.spec.json b/tsconfig.spec.json index 6400fde..1db2e6e 100644 --- a/tsconfig.spec.json +++ b/tsconfig.spec.json @@ -1,5 +1,5 @@ { - "extends": "./tsconfig.json", + "extends": "./tsconfig.base.json", "compilerOptions": { "outDir": "./out-tsc/spec", "types": [