diff --git a/.eslintrc.json b/.eslintrc.json index 1a54be027..3473fac9b 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -11,7 +11,7 @@ "extends": [ "eslint:recommended", "plugin:@typescript-eslint/eslint-recommended", - "prettier/@typescript-eslint", + "prettier", "plugin:@typescript-eslint/recommended", "plugin:@typescript-eslint/recommended-requiring-type-checking" ], @@ -38,7 +38,8 @@ "SwitchCase": 1, "CallExpression": { "arguments": "first" }, "FunctionExpression": { "parameters": "first" }, - "FunctionDeclaration": { "parameters": "first" } + "FunctionDeclaration": { "parameters": "first" }, + "ignoredNodes": ["TSTypeParameterInstantiation"] } ], "@typescript-eslint/no-empty-function": 0, @@ -49,6 +50,7 @@ "@typescript-eslint/no-unsafe-assignment": 0, "@typescript-eslint/no-unsafe-return": 0, "@typescript-eslint/no-floating-promises": 0, + "@typescript-eslint/unbound-method": ["off"], "@angular-eslint/use-injectable-provided-in": "error", "@angular-eslint/no-attribute-decorator": "error" } diff --git a/.husky/commit-msg b/.husky/commit-msg index 7ea66c8db..a341454e9 100755 --- a/.husky/commit-msg +++ b/.husky/commit-msg @@ -6,3 +6,4 @@ npx stylelint "**/*.scss" npx --no-install commitlint --edit npm test -- --coverage +npx eslint src/**/*.ts \ No newline at end of file diff --git a/angular.json b/angular.json index 604168b93..c643a0445 100644 --- a/angular.json +++ b/angular.json @@ -45,23 +45,6 @@ } ] }, - "web": { - "optimization": false, - "outputHashing": "all", - "sourceMap": true, - "extractCss": true, - "namedChunks": false, - "aot": false, - "extractLicenses": true, - "vendorChunk": false, - "buildOptimizer": false, - "fileReplacements": [ - { - "replace": "src/environments/environment.ts", - "with": "src/environments/environment.web.ts" - } - ] - }, "production": { "optimization": true, "outputHashing": "all", diff --git a/package-lock.json b/package-lock.json index 3d513f4be..a83a0a6de 100644 --- a/package-lock.json +++ b/package-lock.json @@ -74,7 +74,10 @@ "electron": "10.2.0", "electron-builder": "22.9.1", "eslint": "7.13.0", + "eslint-config-prettier": "8.3.0", "eslint-plugin-import": "2.22.1", + "eslint-plugin-prettier": "3.4.0", + "eslint-plugin-tsdoc": "0.2.14", "husky": "5.0.9", "jasmine-core": "~3.6.0", "jasmine-spec-reporter": "~5.0.0", @@ -8152,6 +8155,53 @@ "node": ">=4.0.0" } }, + "node_modules/@microsoft/tsdoc": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/@microsoft/tsdoc/-/tsdoc-0.13.2.tgz", + "integrity": "sha512-WrHvO8PDL8wd8T2+zBGKrMwVL5IyzR3ryWUsl0PXgEV0QHup4mTLi0QcATefGI6Gx9Anu7vthPyyyLpY0EpiQg==", + "dev": true + }, + "node_modules/@microsoft/tsdoc-config": { + "version": "0.15.2", + "resolved": "https://registry.npmjs.org/@microsoft/tsdoc-config/-/tsdoc-config-0.15.2.tgz", + "integrity": "sha512-mK19b2wJHSdNf8znXSMYVShAHktVr/ib0Ck2FA3lsVBSEhSI/TfXT7DJQkAYgcztTuwazGcg58ZjYdk0hTCVrA==", + "dev": true, + "dependencies": { + "@microsoft/tsdoc": "0.13.2", + "ajv": "~6.12.6", + "jju": "~1.4.0", + "resolve": "~1.19.0" + } + }, + "node_modules/@microsoft/tsdoc-config/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/@microsoft/tsdoc-config/node_modules/resolve": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz", + "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==", + "dev": true, + "dependencies": { + "is-core-module": "^2.1.0", + "path-parse": "^1.0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/@ngtools/webpack": { "version": "9.1.12", "resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-9.1.12.tgz", @@ -16585,6 +16635,18 @@ "node": "^10.12.0 || >=12.0.0" } }, + "node_modules/eslint-config-prettier": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.3.0.tgz", + "integrity": "sha512-BgZuLUSeKzvlL/VUjx/Yb787VQ26RU3gGjA3iiFvdsp/2bMfVIWUVP7tjxtjS0e+HP409cPlPvNkQloz8C91ew==", + "dev": true, + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, "node_modules/eslint-import-resolver-node": { "version": "0.3.4", "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.4.tgz", @@ -16902,6 +16964,37 @@ "node": ">=4" } }, + "node_modules/eslint-plugin-prettier": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.4.0.tgz", + "integrity": "sha512-UDK6rJT6INSfcOo545jiaOwB701uAIt2/dR7WnFQoGCVl1/EMqdANBmwUaqqQ45aXprsTGzSa39LI1PyuRBxxw==", + "dev": true, + "dependencies": { + "prettier-linter-helpers": "^1.0.0" + }, + "engines": { + "node": ">=6.0.0" + }, + "peerDependencies": { + "eslint": ">=5.0.0", + "prettier": ">=1.13.0" + }, + "peerDependenciesMeta": { + "eslint-config-prettier": { + "optional": true + } + } + }, + "node_modules/eslint-plugin-tsdoc": { + "version": "0.2.14", + "resolved": "https://registry.npmjs.org/eslint-plugin-tsdoc/-/eslint-plugin-tsdoc-0.2.14.tgz", + "integrity": "sha512-fJ3fnZRsdIoBZgzkQjv8vAj6NeeOoFkTfgosj6mKsFjX70QV256sA/wq+y/R2+OL4L8E79VVaVWrPeZnKNe8Ng==", + "dev": true, + "dependencies": { + "@microsoft/tsdoc": "0.13.2", + "@microsoft/tsdoc-config": "0.15.2" + } + }, "node_modules/eslint-scope": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", @@ -17790,6 +17883,12 @@ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" }, + "node_modules/fast-diff": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz", + "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", + "dev": true + }, "node_modules/fast-glob": { "version": "3.2.5", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.5.tgz", @@ -24429,6 +24528,12 @@ "node": ">=6" } }, + "node_modules/jju": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/jju/-/jju-1.4.0.tgz", + "integrity": "sha1-o6vicYryQaKykE+EpiWXDzia4yo=", + "dev": true + }, "node_modules/joi": { "version": "17.3.0", "resolved": "https://registry.npmjs.org/joi/-/joi-17.3.0.tgz", @@ -32708,6 +32813,18 @@ "node": ">=10.13.0" } }, + "node_modules/prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "dev": true, + "dependencies": { + "fast-diff": "^1.1.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/pretty-bytes": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.5.0.tgz", @@ -48751,6 +48868,48 @@ } } }, + "@microsoft/tsdoc": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/@microsoft/tsdoc/-/tsdoc-0.13.2.tgz", + "integrity": "sha512-WrHvO8PDL8wd8T2+zBGKrMwVL5IyzR3ryWUsl0PXgEV0QHup4mTLi0QcATefGI6Gx9Anu7vthPyyyLpY0EpiQg==", + "dev": true + }, + "@microsoft/tsdoc-config": { + "version": "0.15.2", + "resolved": "https://registry.npmjs.org/@microsoft/tsdoc-config/-/tsdoc-config-0.15.2.tgz", + "integrity": "sha512-mK19b2wJHSdNf8znXSMYVShAHktVr/ib0Ck2FA3lsVBSEhSI/TfXT7DJQkAYgcztTuwazGcg58ZjYdk0hTCVrA==", + "dev": true, + "requires": { + "@microsoft/tsdoc": "0.13.2", + "ajv": "~6.12.6", + "jju": "~1.4.0", + "resolve": "~1.19.0" + }, + "dependencies": { + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "resolve": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz", + "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==", + "dev": true, + "requires": { + "is-core-module": "^2.1.0", + "path-parse": "^1.0.6" + } + } + } + }, "@ngtools/webpack": { "version": "9.1.12", "resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-9.1.12.tgz", @@ -56060,6 +56219,13 @@ } } }, + "eslint-config-prettier": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.3.0.tgz", + "integrity": "sha512-BgZuLUSeKzvlL/VUjx/Yb787VQ26RU3gGjA3iiFvdsp/2bMfVIWUVP7tjxtjS0e+HP409cPlPvNkQloz8C91ew==", + "dev": true, + "requires": {} + }, "eslint-import-resolver-node": { "version": "0.3.4", "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.4.tgz", @@ -56320,6 +56486,25 @@ } } }, + "eslint-plugin-prettier": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.4.0.tgz", + "integrity": "sha512-UDK6rJT6INSfcOo545jiaOwB701uAIt2/dR7WnFQoGCVl1/EMqdANBmwUaqqQ45aXprsTGzSa39LI1PyuRBxxw==", + "dev": true, + "requires": { + "prettier-linter-helpers": "^1.0.0" + } + }, + "eslint-plugin-tsdoc": { + "version": "0.2.14", + "resolved": "https://registry.npmjs.org/eslint-plugin-tsdoc/-/eslint-plugin-tsdoc-0.2.14.tgz", + "integrity": "sha512-fJ3fnZRsdIoBZgzkQjv8vAj6NeeOoFkTfgosj6mKsFjX70QV256sA/wq+y/R2+OL4L8E79VVaVWrPeZnKNe8Ng==", + "dev": true, + "requires": { + "@microsoft/tsdoc": "0.13.2", + "@microsoft/tsdoc-config": "0.15.2" + } + }, "eslint-scope": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", @@ -56836,6 +57021,12 @@ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" }, + "fast-diff": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz", + "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", + "dev": true + }, "fast-glob": { "version": "3.2.5", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.5.tgz", @@ -62157,6 +62348,12 @@ } } }, + "jju": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/jju/-/jju-1.4.0.tgz", + "integrity": "sha1-o6vicYryQaKykE+EpiWXDzia4yo=", + "dev": true + }, "joi": { "version": "17.3.0", "resolved": "https://registry.npmjs.org/joi/-/joi-17.3.0.tgz", @@ -68571,6 +68768,15 @@ "integrity": "sha512-kXtO4s0Lz/DW/IJ9QdWhAf7/NmPWQXkFr/r/WkR3vyI+0v8amTDxiaQSLzs8NBlytfLWX/7uQUMIW677yLKl4w==", "dev": true }, + "prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "dev": true, + "requires": { + "fast-diff": "^1.1.2" + } + }, "pretty-bytes": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.5.0.tgz", diff --git a/package.json b/package.json index d32e78569..7cfe42d9a 100644 --- a/package.json +++ b/package.json @@ -1,157 +1,159 @@ { - "name": "iptvnator", - "version": "0.6.0", - "description": "IPTV player application.", - "homepage": "https://github.com/4gray/iptvnator", - "author": { - "name": "4gray", - "email": "dev@artslab.info" - }, - "keywords": [ - "angular", - "electron", - "typescript", - "m3u", - "m3u8", - "player", - "iptv", - "video", - "tv" - ], - "main": "main.js", - "private": true, - "scripts": { - "postinstall": "electron-builder install-app-deps && husky install", - "ng": "ng", - "start": "npm-run-all -p electron:serve ng:serve", - "build": "npm run electron:serve-tsc && ng build --base-href ./", - "build:dev": "npm run build -- -c dev", - "build:prod": "npm run build -- -c production", - "ng:serve": "ng serve", - "ng:serve:web": "ng serve -c web -o", - "electron:serve-tsc": "tsc -p tsconfig.serve.json", - "electron:serve": "wait-on tcp:4200 && npm run electron:serve-tsc && npx electron . --serve", - "electron:local": "npm run build:prod && npx electron .", - "electron:build": "npm run build:prod && electron-builder build", - "electron:build:mac": "npm run build:prod && electron-builder build -m", - "electron:build:linux": "npm run build:prod && electron-builder build -l --x64 --ia32 --arm64 --armv7l", - "electron:build:windows": "npm run build:prod && electron-builder build -w", - "test": "jest", - "test:watch": "jest --watch", - "e2e": "npm run build:prod && cross-env TS_NODE_PROJECT='e2e/tsconfig.e2e.json' mocha e2e/**/*.ts --config ./.mocharc.json --exit", - "e2e:watch": "npm run e2e -- --watch", - "version": "conventional-changelog -i CHANGELOG.md -p angular -s -r 0 && git add CHANGELOG.md", - "lint": "ng lint" - }, - "devDependencies": { - "@angular-builders/custom-webpack": "9.2.0", - "@angular-devkit/build-angular": "0.1101.4", - "@angular-eslint/builder": "0.0.1-alpha.32", - "@angular-eslint/eslint-plugin": "0.0.1-alpha.32", - "@angular-eslint/eslint-plugin-template": "0.0.1-alpha.32", - "@angular-eslint/template-parser": "0.0.1-alpha.32", - "@angular/cli": "11.1.4", - "@angular/common": "11.1.2", - "@angular/compiler": "11.1.2", - "@angular/compiler-cli": "11.1.2", - "@angular/core": "11.1.2", - "@angular/forms": "11.1.2", - "@angular/language-service": "11.1.2", - "@angular/platform-browser": "11.1.2", - "@angular/platform-browser-dynamic": "11.1.2", - "@angular/router": "11.1.2", - "@commitlint/cli": "11.0.0", - "@commitlint/config-conventional": "11.0.0", - "@ngx-translate/core": "13.0.0", - "@ngx-translate/http-loader": "6.0.0", - "@semantic-release/changelog": "5.0.1", - "@semantic-release/git": "9.0.0", - "@semantic-release/npm": "7.1.1", - "@types/jasmine": "~3.6.0", - "@types/jasminewd2": "2.0.8", - "@types/jest": "26.0.14", - "@types/mocha": "7.0.2", - "@types/node": "12.12.6", - "@typescript-eslint/eslint-plugin": "4.11.1", - "@typescript-eslint/eslint-plugin-tslint": "4.11.1", - "@typescript-eslint/parser": "4.11.1", - "chai": "4.2.0", - "conventional-changelog-cli": "2.0.34", - "core-js": "3.6.5", - "cross-env": "7.0.2", - "electron": "10.2.0", - "electron-builder": "22.9.1", - "eslint": "7.13.0", - "eslint-plugin-import": "2.22.1", - "husky": "5.0.9", - "jasmine-core": "~3.6.0", - "jasmine-spec-reporter": "~5.0.0", - "jest": "26.4.2", - "jest-preset-angular": "8.3.1", - "karma": "5.2.3", - "karma-coverage-istanbul-reporter": "3.0.3", - "karma-electron": "6.3.0", - "karma-jasmine": "~4.0.0", - "karma-jasmine-html-reporter": "^1.5.0", - "mocha": "7.2.0", - "ng-mocks": "11.5.0", - "npm-run-all": "4.1.5", - "prettier": "2.3.0", - "rxjs": "6.6.3", - "semantic-release": "17.2.3", - "spectron": "12.0.0", - "stylelint": "13.13.1", - "stylelint-config-standard": "22.0.0", - "stylelint-scss": "3.19.0", - "ts-node": "8.10.2", - "tslib": "2.1.0", - "typescript": "4.1.3", - "wait-on": "5.2.1", - "webdriver-manager": "12.1.7", - "zone.js": "~0.11.3" - }, - "engines": { - "node": ">=10.13.0" - }, - "dependencies": { - "@angular/animations": "11.1.2", - "@angular/cdk": "11.1.2", - "@angular/flex-layout": "10.0.0-beta.32", - "@angular/material": "11.1.2", - "@datorama/akita": "5.2.6", - "@ngx-pwa/local-storage": "11.1.0", - "@types/hls.js": "0.13.3", - "@types/video.js": "7.3.11", - "@videojs/http-streaming": "2.3.1", - "about-window": "1.13.4", - "axios": "0.21.1", - "custom-electron-titlebar": "3.2.5", - "epg-parser": "0.1.1", - "hls.js": "0.14.16", - "iptv-playlist-parser": "0.6.0", - "lodash": "4.17.21", - "material-icons": "0.3.1", - "moment": "2.29.1", - "nedb": "1.8.0", - "nedb-promises-ts": "0.0.1-4", - "ngx-filter-pipe": "2.1.2", - "ngx-uploader": "11.0.0", - "ngx-whats-new": "0.0.1", - "semver": "7.3.4", - "uuid": "8.3.0", - "video-js": "0.7.0" - }, - "jest": { - "preset": "jest-preset-angular", - "setupFilesAfterEnv": [ - "/src/setupJest.ts" + "name": "iptvnator", + "version": "0.6.0", + "description": "IPTV player application.", + "homepage": "https://github.com/4gray/iptvnator", + "author": { + "name": "4gray", + "email": "dev@artslab.info" + }, + "keywords": [ + "angular", + "electron", + "typescript", + "m3u", + "m3u8", + "player", + "iptv", + "video", + "tv" ], - "testMatch": [ - "**/+(*.)+(spec|test).+(ts)?(x)" - ], - "coverageReporters": [ - "html", - "lcov" - ] - } + "main": "main.js", + "private": true, + "scripts": { + "postinstall": "electron-builder install-app-deps && husky install", + "ng": "ng", + "start": "npm-run-all -p electron:serve ng:serve", + "build": "npm run electron:serve-tsc && ng build --base-href ./", + "build:dev": "npm run build -- -c dev", + "build:prod": "npm run build -- -c production", + "ng:serve": "ng serve", + "ng:serve:web": "ng serve -c web -o", + "electron:serve-tsc": "tsc -p tsconfig.serve.json", + "electron:serve": "wait-on tcp:4200 && npm run electron:serve-tsc && npx electron . --serve", + "electron:local": "npm run build:prod && npx electron .", + "electron:build": "npm run build:prod && electron-builder build", + "electron:build:mac": "npm run build:prod && electron-builder build -m", + "electron:build:linux": "npm run build:prod && electron-builder build -l --x64 --ia32 --arm64 --armv7l", + "electron:build:windows": "npm run build:prod && electron-builder build -w", + "test": "jest", + "test:watch": "jest --watch", + "e2e": "npm run build:prod && cross-env TS_NODE_PROJECT='e2e/tsconfig.e2e.json' mocha e2e/**/*.ts --config ./.mocharc.json --exit", + "e2e:watch": "npm run e2e -- --watch", + "version": "conventional-changelog -i CHANGELOG.md -p angular -s -r 0 && git add CHANGELOG.md", + "lint": "ng lint" + }, + "devDependencies": { + "@angular-builders/custom-webpack": "9.2.0", + "@angular-devkit/build-angular": "0.1101.4", + "@angular-eslint/builder": "0.0.1-alpha.32", + "@angular-eslint/eslint-plugin": "0.0.1-alpha.32", + "@angular-eslint/eslint-plugin-template": "0.0.1-alpha.32", + "@angular-eslint/template-parser": "0.0.1-alpha.32", + "@angular/cli": "11.1.4", + "@angular/common": "11.1.2", + "@angular/compiler": "11.1.2", + "@angular/compiler-cli": "11.1.2", + "@angular/core": "11.1.2", + "@angular/forms": "11.1.2", + "@angular/language-service": "11.1.2", + "@angular/platform-browser": "11.1.2", + "@angular/platform-browser-dynamic": "11.1.2", + "@angular/router": "11.1.2", + "@commitlint/cli": "11.0.0", + "@commitlint/config-conventional": "11.0.0", + "@ngx-translate/core": "13.0.0", + "@ngx-translate/http-loader": "6.0.0", + "@semantic-release/changelog": "5.0.1", + "@semantic-release/git": "9.0.0", + "@semantic-release/npm": "7.1.1", + "@types/jasmine": "~3.6.0", + "@types/jasminewd2": "2.0.8", + "@types/jest": "26.0.14", + "@types/mocha": "7.0.2", + "@types/node": "12.12.6", + "@typescript-eslint/eslint-plugin": "4.11.1", + "@typescript-eslint/eslint-plugin-tslint": "4.11.1", + "@typescript-eslint/parser": "4.11.1", + "chai": "4.2.0", + "conventional-changelog-cli": "2.0.34", + "core-js": "3.6.5", + "cross-env": "7.0.2", + "electron": "10.2.0", + "electron-builder": "22.9.1", + "eslint": "7.13.0", + "eslint-config-prettier": "8.3.0", + "eslint-plugin-import": "2.22.1", + "eslint-plugin-prettier": "3.4.0", + "husky": "5.0.9", + "jasmine-core": "~3.6.0", + "jasmine-spec-reporter": "~5.0.0", + "jest": "26.4.2", + "jest-preset-angular": "8.3.1", + "karma": "5.2.3", + "karma-coverage-istanbul-reporter": "3.0.3", + "karma-electron": "6.3.0", + "karma-jasmine": "~4.0.0", + "karma-jasmine-html-reporter": "^1.5.0", + "mocha": "7.2.0", + "ng-mocks": "11.5.0", + "npm-run-all": "4.1.5", + "prettier": "2.3.0", + "rxjs": "6.6.3", + "semantic-release": "17.2.3", + "spectron": "12.0.0", + "stylelint": "13.13.1", + "stylelint-config-standard": "22.0.0", + "stylelint-scss": "3.19.0", + "ts-node": "8.10.2", + "tslib": "2.1.0", + "typescript": "4.1.3", + "wait-on": "5.2.1", + "webdriver-manager": "12.1.7", + "zone.js": "~0.11.3" + }, + "engines": { + "node": ">=10.13.0" + }, + "dependencies": { + "@angular/animations": "11.1.2", + "@angular/cdk": "11.1.2", + "@angular/flex-layout": "10.0.0-beta.32", + "@angular/material": "11.1.2", + "@datorama/akita": "5.2.6", + "@ngx-pwa/local-storage": "11.1.0", + "@types/hls.js": "0.13.3", + "@types/video.js": "7.3.11", + "@videojs/http-streaming": "2.3.1", + "about-window": "1.13.4", + "axios": "0.21.1", + "custom-electron-titlebar": "3.2.5", + "epg-parser": "0.1.1", + "hls.js": "0.14.16", + "iptv-playlist-parser": "0.6.0", + "lodash": "4.17.21", + "material-icons": "0.3.1", + "moment": "2.29.1", + "nedb": "1.8.0", + "nedb-promises-ts": "0.0.1-4", + "ngx-filter-pipe": "2.1.2", + "ngx-uploader": "11.0.0", + "ngx-whats-new": "0.0.1", + "semver": "7.3.4", + "uuid": "8.3.0", + "video-js": "0.7.0" + }, + "jest": { + "preset": "jest-preset-angular", + "setupFilesAfterEnv": [ + "/src/setupJest.ts" + ], + "testMatch": [ + "**/+(*.)+(spec|test).+(ts)?(x)" + ], + "coverageReporters": [ + "html", + "lcov" + ] + } } diff --git a/src/app/home/home.component.ts b/src/app/home/home.component.ts index f097a80d8..3c09eaeb7 100644 --- a/src/app/home/home.component.ts +++ b/src/app/home/home.component.ts @@ -41,16 +41,18 @@ export class HomeComponent { commandsList = [ { id: PLAYLIST_PARSE_RESPONSE, - execute: (response: any) => this.setPlaylist(response.payload), + execute: (response: { payload: Playlist }) => + this.setPlaylist(response.payload), }, { id: 'playlist-all-result', - execute: (response: { payload: Partial }) => - (this.playlists = response.payload), + execute: (response: { payload: Partial }): void => { + this.playlists = response.payload; + }, }, { id: 'playlist-remove-by-id-result', - execute: () => { + execute: (): void => { this.snackBar.open('Done! Playlist was removed.', null, { duration: 2000, }); @@ -59,7 +61,7 @@ export class HomeComponent { }, { id: ERROR, - execute: (response: { message: string; status: number }) => { + execute: (response: { message: string; status: number }): void => { this.isLoading = false; this.showNotification( `Error: ${response.status} ${response.message}.` diff --git a/src/environments/environment.dev.ts b/src/environments/environment.dev.ts index 7953ebf84..1318b9110 100644 --- a/src/environments/environment.dev.ts +++ b/src/environments/environment.dev.ts @@ -4,6 +4,6 @@ // The list of which env maps to which file can be found in `.angular-cli.json`. export const AppConfig = { - production: false, - environment: 'DEV' + production: false, + environment: 'DEV', }; diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index 047b3fce6..fd12e2060 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -1,4 +1,4 @@ export const AppConfig = { - production: true, - environment: 'PROD' + production: true, + environment: 'PROD', }; diff --git a/src/environments/environment.web.ts b/src/environments/environment.web.ts deleted file mode 100644 index 7953ebf84..000000000 --- a/src/environments/environment.web.ts +++ /dev/null @@ -1,9 +0,0 @@ -// The file contents for the current environment will overwrite these during build. -// The build system defaults to the dev environment which uses `index.ts`, but if you do -// `ng build --env=prod` then `index.prod.ts` will be used instead. -// The list of which env maps to which file can be found in `.angular-cli.json`. - -export const AppConfig = { - production: false, - environment: 'DEV' -}; diff --git a/src/main.ts b/src/main.ts index 6ad7b1007..8ac612d9c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -5,11 +5,11 @@ import { AppModule } from './app/app.module'; import { AppConfig } from './environments/environment'; if (AppConfig.production) { - enableProdMode(); + enableProdMode(); } platformBrowserDynamic() - .bootstrapModule(AppModule, { - preserveWhitespaces: false - }) - .catch(err => console.error(err)); + .bootstrapModule(AppModule, { + preserveWhitespaces: false, + }) + .catch((err) => console.error(err));