Merge branch 'feature/ng-update' into develop

merge-requests/3/merge
Nato Boram 2020-07-07 20:31:50 -04:00
commit 0e57dc4151
17 changed files with 3504 additions and 2060 deletions

View File

@ -10,7 +10,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/), and this
### Changed ### Changed
* Better screenshot - Better screenshot
- Upgraded to Angular 10
### Deprecated ### Deprecated
@ -28,7 +29,7 @@ Tests were done with `ipfs-npm` : They weren't successful. `ipfs-css` is only mi
### Added ### Added
* GitLab Pages - <https://natoboram.gitlab.io/public-gateway-cacher/> - GitLab Pages - <https://natoboram.gitlab.io/public-gateway-cacher/>
## [1.0.0] - 2019-11-28 ## [1.0.0] - 2019-11-28
@ -36,9 +37,9 @@ This version is a fork of [github.com/ipfs/public-gateway-checker](https://githu
## Types of changes ## Types of changes
* `Added` for new features. - `Added` for new features.
* `Changed` for changes in existing functionality. - `Changed` for changes in existing functionality.
* `Deprecated` for soon-to-be removed features. - `Deprecated` for soon-to-be removed features.
* `Removed` for now removed features. - `Removed` for now removed features.
* `Fixed` for any bug fixes. - `Fixed` for any bug fixes.
* `Security` in case of vulnerabilities. - `Security` in case of vulnerabilities.

View File

@ -196,6 +196,7 @@
}, },
"defaultProject": "public-gateway-cacher", "defaultProject": "public-gateway-cacher",
"cli": { "cli": {
"packageManager": "yarn" "packageManager": "yarn",
"analytics": "10b848ad-8b81-4346-852f-5eff89573a85"
} }
} }

View File

@ -1,19 +1,19 @@
import { browser, logging } from 'protractor'; import { browser, logging } from 'protractor';
import { AppPage } from './app.po'; import { AppPage } from './app.po';
describe('workspace-project App', () => { describe('workspace-project App', (): void => {
let page: AppPage; let page: AppPage;
beforeEach(() => { beforeEach((): void => {
page = new AppPage(); page = new AppPage();
}); });
it('should display welcome message', () => { it('should display welcome message', (): void => {
page.navigateTo(); page.navigateTo();
expect(page.getTitleText()).toEqual('public-gateway-cacher app is running!'); expect(page.getTitleText()).toEqual('public-gateway-cacher app is running!');
}); });
afterEach(async () => { afterEach(async (): Promise<void> => {
// Assert that there are no errors emitted from the browser // Assert that there are no errors emitted from the browser
const logs = await browser.manage().logs().get(logging.Type.BROWSER); const logs = await browser.manage().logs().get(logging.Type.BROWSER);
expect(logs).not.toContain(jasmine.objectContaining({ expect(logs).not.toContain(jasmine.objectContaining({

View File

@ -1,9 +1,9 @@
{ {
"extends": "../tsconfig.json", "extends": "../tsconfig.base.json",
"compilerOptions": { "compilerOptions": {
"outDir": "../out-tsc/e2e", "outDir": "../out-tsc/e2e",
"module": "commonjs", "module": "commonjs",
"target": "es5", "target": "es2018",
"types": [ "types": [
"jasmine", "jasmine",
"jasminewd2", "jasminewd2",

View File

@ -16,47 +16,46 @@
}, },
"private": false, "private": false,
"dependencies": { "dependencies": {
"@angular/animations": "~8.2.14", "@angular/animations": "~10.0.2",
"@angular/cdk": "~8.2.3", "@angular/cdk": "~10.0.1",
"@angular/common": "~8.2.14", "@angular/common": "~10.0.2",
"@angular/compiler": "~8.2.14", "@angular/compiler": "~10.0.2",
"@angular/core": "~8.2.14", "@angular/core": "~10.0.2",
"@angular/flex-layout": "^8.0.0-beta.27", "@angular/flex-layout": "^10.0.0-beta.32",
"@angular/forms": "~8.2.14", "@angular/forms": "~10.0.2",
"@angular/material": "^8.2.3", "@angular/material": "^10.0.1",
"@angular/platform-browser": "~8.2.14", "@angular/platform-browser": "~10.0.2",
"@angular/platform-browser-dynamic": "~8.2.14", "@angular/platform-browser-dynamic": "~10.0.2",
"@angular/router": "~8.2.14", "@angular/router": "~10.0.2",
"bootstrap": "^4.4.1", "bootstrap": "^4.4.1",
"hammerjs": "^2.0.8",
"ipfs-css": "^0.13.1", "ipfs-css": "^0.13.1",
"rxjs": "~6.5.3", "rxjs": "~6.6.0",
"tslib": "^1.10.0", "tslib": "^2.0.0",
"zone.js": "~0.9.1" "zone.js": "~0.10.3"
}, },
"devDependencies": { "devDependencies": {
"@angular-devkit/build-angular": "~0.803.20", "@angular-devkit/build-angular": "~0.1000.1",
"@angular/cli": "~8.3.20", "@angular/cli": "~10.0.1",
"@angular/compiler-cli": "~8.2.14", "@angular/compiler-cli": "~10.0.2",
"@angular/language-service": "~8.2.14", "@angular/language-service": "~10.0.2",
"@types/jasmine": "~3.3.8", "@types/jasmine": "~3.3.8",
"@types/jasminewd2": "~2.0.3", "@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4", "@types/node": "^12.11.1",
"codelyzer": "^5.0.0", "codelyzer": "^5.1.2",
"jasmine-core": "~3.4.0", "jasmine-core": "~3.5.0",
"jasmine-spec-reporter": "~4.2.1", "jasmine-spec-reporter": "~5.0.0",
"karma": "~4.1.0", "karma": "~5.0.0",
"karma-chrome-launcher": "~2.2.0", "karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~2.0.1", "karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~2.0.1", "karma-jasmine": "~3.3.0",
"karma-jasmine-html-reporter": "^1.4.0", "karma-jasmine-html-reporter": "^1.5.0",
"protractor": "~5.4.0", "protractor": "~7.0.0",
"rxjs-tslint-rules": "^4.26.3", "rxjs-tslint-rules": "^4.26.3",
"ts-node": "~7.0.0", "ts-node": "~7.0.0",
"tslint": "~5.15.0", "tslint": "~6.1.0",
"tslint-consistent-codestyle": "^1.16.0", "tslint-consistent-codestyle": "^1.16.0",
"tslint-origin-ordered-imports-rule": "^1.2.2", "tslint-origin-ordered-imports-rule": "^1.2.2",
"tslint-rxjs-subject-restrictions-rule": "^1.0.4", "tslint-rxjs-subject-restrictions-rule": "^1.0.4",
"typescript": "~3.5.3" "typescript": "~3.9.6"
} }
} }

View File

@ -1,9 +1,9 @@
import { TestBed, async } from '@angular/core/testing'; import { async, TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing'; import { RouterTestingModule } from '@angular/router/testing';
import { AppComponent } from './app.component'; import { AppComponent } from './app.component';
describe('AppComponent', () => { describe('AppComponent', (): void => {
beforeEach(async(() => { beforeEach(async((): void => {
TestBed.configureTestingModule({ TestBed.configureTestingModule({
imports: [ imports: [
RouterTestingModule RouterTestingModule
@ -14,19 +14,19 @@ describe('AppComponent', () => {
}).compileComponents(); }).compileComponents();
})); }));
it('should create the app', () => { it('should create the app', (): void => {
const fixture = TestBed.createComponent(AppComponent); const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance; const app = fixture.debugElement.componentInstance;
expect(app).toBeTruthy(); expect(app).toBeTruthy();
}); });
it(`should have as title 'public-gateway-cacher'`, () => { it(`should have as title 'public-gateway-cacher'`, (): void => {
const fixture = TestBed.createComponent(AppComponent); const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance; const app = fixture.debugElement.componentInstance;
expect(app.title).toEqual('public-gateway-cacher'); expect(app.title).toEqual('public-gateway-cacher');
}); });
it('should render title', () => { it('should render title', (): void => {
const fixture = TestBed.createComponent(AppComponent); const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges(); fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement; const compiled = fixture.debugElement.nativeElement;

View File

@ -1,24 +1,24 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { PagesComponent } from './pages.component'; import { PagesComponent } from './pages.component';
describe('PagesComponent', () => { describe('PagesComponent', (): void => {
let component: PagesComponent; let component: PagesComponent;
let fixture: ComponentFixture<PagesComponent>; let fixture: ComponentFixture<PagesComponent>;
beforeEach(async(() => { beforeEach(async((): void => {
TestBed.configureTestingModule({ TestBed.configureTestingModule({
declarations: [PagesComponent] declarations: [PagesComponent]
}) })
.compileComponents(); .compileComponents();
})); }));
beforeEach(() => { beforeEach((): void => {
fixture = TestBed.createComponent(PagesComponent); fixture = TestBed.createComponent(PagesComponent);
component = fixture.componentInstance; component = fixture.componentInstance;
fixture.detectChanges(); fixture.detectChanges();
}); });
it('should create', () => { it('should create', (): void => {
expect(component).toBeTruthy(); expect(component).toBeTruthy();
}); });
}); });

View File

@ -21,7 +21,7 @@ export class PagesComponent implements OnInit {
]; ];
subscriptions: Subscription[] = []; subscriptions: Subscription[] = [];
@ViewChild(MatTable, { static: false }) matTable: MatTable<Result>; @ViewChild(MatTable) matTable: MatTable<Result>;
constructor( constructor(
private readonly gatewayService: GatewayService private readonly gatewayService: GatewayService
@ -29,7 +29,7 @@ export class PagesComponent implements OnInit {
ngOnInit(): void { ngOnInit(): void {
this.dataSource = new MatTableDataSource([]); this.dataSource = new MatTableDataSource([]);
this.gatewayService.list().subscribe(gateways => this.gateways = gateways); this.gatewayService.list().subscribe((gateways): void => { this.gateways = gateways; });
} }
cacheIPFS(): void { cacheIPFS(): void {
@ -53,12 +53,12 @@ export class PagesComponent implements OnInit {
this.matTable.renderRows(); this.matTable.renderRows();
console.clear(); console.clear();
this.gateways.forEach(gateway => { this.gateways.forEach((gateway): void => {
this.subscriptions.push( this.subscriptions.push(
this.gatewayService.get(gateway, type, hash).subscribe(_ => { this.gatewayService.get(gateway, type, hash).subscribe((): void => {
this.dataSource.data.push({ gateway: `${gateway.replace(':type', type).replace(':hash', hash)}`, error: null }); this.dataSource.data.push({ gateway: `${gateway.replace(':type', type).replace(':hash', hash)}`, error: null });
this.matTable.renderRows(); this.matTable.renderRows();
}, (error: HttpErrorResponse) => { }, (error: HttpErrorResponse): void => {
this.dataSource.data.push({ gateway: `${gateway.replace(':type', type).replace(':hash', hash)}`, error }); this.dataSource.data.push({ gateway: `${gateway.replace(':type', type).replace(':hash', hash)}`, error });
this.matTable.renderRows(); this.matTable.renderRows();
}) })

View File

@ -1,12 +1,11 @@
import { TestBed } from '@angular/core/testing'; import { TestBed, TestBedStatic } from '@angular/core/testing';
import { GatewayService } from './gateway.service'; import { GatewayService } from './gateway.service';
describe('GatewayService', () => { describe('GatewayService', (): void => {
beforeEach(() => TestBed.configureTestingModule({})); beforeEach((): TestBedStatic => TestBed.configureTestingModule({}));
it('should be created', () => { it('should be created', (): void => {
const service: GatewayService = TestBed.get(GatewayService); const service: GatewayService = TestBed.inject(GatewayService);
expect(service).toBeTruthy(); expect(service).toBeTruthy();
}); });
}); });

View File

@ -1,6 +1,5 @@
import { enableProdMode } from '@angular/core'; import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import 'hammerjs';
import { AppModule } from './app/app.module'; import { AppModule } from './app/app.module';
import { environment } from './environments/environment'; import { environment } from './environments/environment';
@ -9,4 +8,4 @@ if (environment.production) {
} }
platformBrowserDynamic().bootstrapModule(AppModule) platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err)); .catch((err): void => console.error(err));

View File

@ -1,5 +1,5 @@
{ {
"extends": "./tsconfig.json", "extends": "./tsconfig.base.json",
"compilerOptions": { "compilerOptions": {
"outDir": "./out-tsc/app", "outDir": "./out-tsc/app",
"types": [] "types": []

26
tsconfig.base.json Normal file
View File

@ -0,0 +1,26 @@
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"downlevelIteration": true,
"experimentalDecorators": true,
"module": "es2020",
"moduleResolution": "node",
"importHelpers": true,
"target": "es2015",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2018",
"dom"
]
},
"angularCompilerOptions": {
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true
}
}

View File

@ -1,26 +1,17 @@
/*
This is a "Solution Style" tsconfig.json file, and is used by editors and TypeScripts 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, "files": [],
"compilerOptions": { "references": [
"baseUrl": "./", {
"outDir": "./dist/out-tsc", "path": "./tsconfig.app.json"
"sourceMap": true,
"declaration": false,
"downlevelIteration": true,
"experimentalDecorators": true,
"module": "esnext",
"moduleResolution": "node",
"importHelpers": true,
"target": "es2015",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2018",
"dom"
]
}, },
"angularCompilerOptions": { {
"fullTemplateTypeCheck": true, "path": "./tsconfig.spec.json"
"strictInjectionParameters": true
} }
]
} }

View File

@ -1,5 +1,5 @@
{ {
"extends": "./tsconfig.json", "extends": "./tsconfig.base.json",
"compilerOptions": { "compilerOptions": {
"outDir": "./out-tsc/spec", "outDir": "./out-tsc/spec",
"types": [ "types": [

View File

@ -80,7 +80,6 @@
"no-non-null-assertion": true, "no-non-null-assertion": true,
"no-redundant-jsdoc": true, "no-redundant-jsdoc": true,
"no-switch-case-fall-through": true, "no-switch-case-fall-through": true,
"no-use-before-declare": true,
"no-var-requires": false, "no-var-requires": false,
"object-literal-key-quotes": [ "object-literal-key-quotes": [
true, true,

5351
yarn.lock

File diff suppressed because it is too large Load Diff