Skip to content

Commit

Permalink
Merge pull request #6 from NicolasConstant/develop
Browse files Browse the repository at this point in the history
0.2.0 PR
  • Loading branch information
NicolasConstant authored May 20, 2021
2 parents 876b1a8 + b56ae7b commit af23b5d
Show file tree
Hide file tree
Showing 24 changed files with 295 additions and 135 deletions.
2 changes: 2 additions & 0 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ function createWindow(): BrowserWindow {
width: 1000,
height: 600,
frame: false,
backgroundColor: "#030915",
icon: 'src/assets/icons/favicon.ico',
webPreferences: {
nodeIntegration: true,
allowRunningInsecureContent: (serve) ? true : false,
Expand Down
241 changes: 130 additions & 111 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,112 +1,131 @@
{
"name": "msfs-community-downloader",
"version": "0.1.0",
"description": "MSFS addin downloader client",
"homepage": "https://github.com/nicolasconstant/msfs-community-downloader",
"author": {
"name": "Nicolas Constant",
"email": "[email protected]"
},
"keywords": [
"msfs",
"angular",
"electron",
"nodejs",
"typescript",
"windows"
],
"main": "main.js",
"private": true,
"scripts": {
"postinstall": "electron-builder install-app-deps",
"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 -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 --publish=never",
"test": "ng test --watch=false",
"test:watch": "ng test",
"e2e": "npm run build:prod && cross-env TS_NODE_PROJECT='e2e/tsconfig.e2e.json' mocha --timeout 300000 --require ts-node/register e2e/**/*.e2e.ts",
"version": "conventional-changelog -i CHANGELOG.md -s -r 0 && git add CHANGELOG.md",
"lint": "ng lint"
},
"dependencies": {
"@electron/remote": "1.0.4",
"@fortawesome/angular-fontawesome": "0.8.2",
"@fortawesome/fontawesome-svg-core": "^1.2.34",
"@fortawesome/free-brands-svg-icons": "^5.15.2",
"@fortawesome/free-regular-svg-icons": "^5.15.2",
"@fortawesome/free-solid-svg-icons": "^5.15.2",
"adm-zip": "0.5.5",
"electron-dl": "3.2.1",
"fs-extra": "10.0.0"
},
"devDependencies": {
"@angular-builders/custom-webpack": "11.1.1",
"@angular-devkit/build-angular": "0.1102.7",
"@angular-eslint/builder": "2.0.2",
"@angular-eslint/eslint-plugin": "2.0.2",
"@angular-eslint/eslint-plugin-template": "2.0.2",
"@angular-eslint/schematics": "2.0.2",
"@angular-eslint/template-parser": "2.0.2",
"@angular/cli": "11.2.7",
"@angular/common": "11.2.8",
"@angular/compiler": "11.2.8",
"@angular/compiler-cli": "11.2.8",
"@angular/core": "11.2.8",
"@angular/forms": "11.2.8",
"@angular/language-service": "11.2.8",
"@angular/platform-browser": "11.2.8",
"@angular/platform-browser-dynamic": "11.2.8",
"@angular/router": "11.2.8",
"@ngx-translate/core": "13.0.0",
"@ngx-translate/http-loader": "6.0.0",
"@types/jasmine": "3.6.7",
"@types/jasminewd2": "2.0.8",
"@types/mocha": "8.2.1",
"@types/node": "14.14.35",
"@typescript-eslint/eslint-plugin": "4.16.1",
"@typescript-eslint/eslint-plugin-tslint": "4.15.0",
"@typescript-eslint/parser": "4.16.1",
"chai": "4.3.4",
"conventional-changelog-cli": "2.1.1",
"core-js": "3.6.5",
"cross-env": "7.0.3",
"electron": "12.0.6",
"electron-builder": "22.10.5",
"electron-reload": "1.5.0",
"eslint": "7.22.0",
"eslint-plugin-import": "2.22.1",
"eslint-plugin-jsdoc": "31.6.1",
"eslint-plugin-prefer-arrow": "1.2.3",
"jasmine-core": "3.7.1",
"jasmine-spec-reporter": "6.0.0",
"karma": "6.2.0",
"karma-coverage-istanbul-reporter": "3.0.3",
"karma-electron": "6.3.3",
"karma-jasmine": "4.0.1",
"karma-jasmine-html-reporter": "1.5.4",
"mocha": "8.3.2",
"nan": "2.14.2",
"npm-run-all": "4.1.5",
"rxjs": "6.6.6",
"spectron": "14.0.0",
"ts-node": "9.1.1",
"tslib": "2.1.0",
"typescript": "4.0.5",
"wait-on": "5.0.1",
"webdriver-manager": "12.1.8",
"zone.js": "0.10.3"
},
"engines": {
"node": ">=10.13.0"
},
"browserslist": [
"chrome 83"
]
}
"name": "msfs-community-downloader",
"version": "0.2.0",
"description": "MSFS addin downloader client",
"homepage": "https://github.com/nicolasconstant/msfs-community-downloader",
"author": {
"name": "Nicolas Constant",
"email": "[email protected]"
},
"keywords": [
"msfs",
"angular",
"electron",
"nodejs",
"typescript",
"windows"
],
"main": "main.js",
"private": true,
"scripts": {
"postinstall": "electron-builder install-app-deps",
"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 -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 --publish=never",
"test": "ng test --watch=false",
"test:watch": "ng test",
"e2e": "npm run build:prod && cross-env TS_NODE_PROJECT='e2e/tsconfig.e2e.json' mocha --timeout 300000 --require ts-node/register e2e/**/*.e2e.ts",
"version": "conventional-changelog -i CHANGELOG.md -s -r 0 && git add CHANGELOG.md",
"lint": "ng lint"
},
"dependencies": {
"@electron/remote": "1.0.4",
"@fortawesome/angular-fontawesome": "0.8.2",
"@fortawesome/fontawesome-svg-core": "^1.2.34",
"@fortawesome/free-brands-svg-icons": "^5.15.2",
"@fortawesome/free-regular-svg-icons": "^5.15.2",
"@fortawesome/free-solid-svg-icons": "^5.15.2",
"adm-zip": "0.5.5",
"electron-dl": "3.2.1",
"fs-extra": "10.0.0"
},
"devDependencies": {
"@angular-builders/custom-webpack": "11.1.1",
"@angular-devkit/build-angular": "0.1102.7",
"@angular-eslint/builder": "2.0.2",
"@angular-eslint/eslint-plugin": "2.0.2",
"@angular-eslint/eslint-plugin-template": "2.0.2",
"@angular-eslint/schematics": "2.0.2",
"@angular-eslint/template-parser": "2.0.2",
"@angular/cli": "11.2.7",
"@angular/common": "11.2.8",
"@angular/compiler": "11.2.8",
"@angular/compiler-cli": "11.2.8",
"@angular/core": "11.2.8",
"@angular/forms": "11.2.8",
"@angular/language-service": "11.2.8",
"@angular/platform-browser": "11.2.8",
"@angular/platform-browser-dynamic": "11.2.8",
"@angular/router": "11.2.8",
"@ngx-translate/core": "13.0.0",
"@ngx-translate/http-loader": "6.0.0",
"@types/jasmine": "3.6.7",
"@types/jasminewd2": "2.0.8",
"@types/mocha": "8.2.1",
"@types/node": "14.14.35",
"@typescript-eslint/eslint-plugin": "4.16.1",
"@typescript-eslint/eslint-plugin-tslint": "4.15.0",
"@typescript-eslint/parser": "4.16.1",
"chai": "4.3.4",
"conventional-changelog-cli": "2.1.1",
"core-js": "3.6.5",
"cross-env": "7.0.3",
"electron": "12.0.6",
"electron-builder": "22.10.5",
"electron-reload": "1.5.0",
"eslint": "7.22.0",
"eslint-plugin-import": "2.22.1",
"eslint-plugin-jsdoc": "31.6.1",
"eslint-plugin-prefer-arrow": "1.2.3",
"jasmine-core": "3.7.1",
"jasmine-spec-reporter": "6.0.0",
"karma": "6.2.0",
"karma-coverage-istanbul-reporter": "3.0.3",
"karma-electron": "6.3.3",
"karma-jasmine": "4.0.1",
"karma-jasmine-html-reporter": "1.5.4",
"mocha": "8.3.2",
"nan": "2.14.2",
"npm-run-all": "4.1.5",
"rxjs": "6.6.6",
"spectron": "14.0.0",
"ts-node": "9.1.1",
"tslib": "2.1.0",
"typescript": "4.0.5",
"wait-on": "5.0.1",
"webdriver-manager": "12.1.8",
"zone.js": "0.10.3"
},
"engines": {
"node": ">=10.13.0"
},
"browserslist": [
"chrome 83"
],
"build": {
"productName": "MSFS Community Downloader",
"appId": "org.msfs-community-downloader.desktop",
"artifactName": "${productName}-${version}.${ext}",
"npmRebuild": false,
"directories": {
"output": "release"
},
"files": [
"dist/",
"node_modules/",
"main.js",
"package.json"
],
"win": {
"icon": "src/assets/icons/favicon.ico",
"target": "nsis"
}
}
}
Binary file modified psd/app.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added psd/icon.psd
Binary file not shown.
3 changes: 2 additions & 1 deletion src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<header id="titlebar">
<div id="drag-region">
<div id="window-title">
<fa-icon [icon]="faPlane"></fa-icon> <span>MSFS Community Downloader</span>
<fa-icon [icon]="faPlane"></fa-icon> <span>MSFS Community Downloader</span>
<span class="title-links" draggable="false"><a href="https://github.com/NicolasConstant/msfs-community-downloader" target="_blank" class="title-links__link">Github</a> | <a href="https://patreon.com/nicolasconstant" target="_blank" class="title-links__link">Patreon</a></span>
</div>
<div id="window-controls">
<div class="button" id="min-button" (click)="minimize()">
Expand Down
18 changes: 18 additions & 0 deletions src/app/app.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -153,4 +153,22 @@
& #max-button {
display: none;
}
}

.title-links {
-webkit-app-region: no-drag;
position: absolute;
right: 80px;
color: rgb(82, 80, 94);

&__link {
color: whitesmoke;
text-decoration: none;
transition: all .15s;

&:hover{
color: rgb(255, 186, 57);
color: rgb(66, 179, 255);
}
}
}
7 changes: 6 additions & 1 deletion src/app/core/services/github.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ export class GithubService {
const route = `https://api.github.com/repos/${p.githubOwner}/${p.githubRepo}/releases`;
return this.http.get<GithubRelease[]>(route).toPromise()
.then((rel: GithubRelease[]) => {
const lastRelease = rel.find(x => this.isCandidate(x, p));
const lastRelease = rel
.sort((a, b) => {
return new Date(b.published_at).getTime() - new Date(a.published_at).getTime();
})
.find(x => this.isCandidate(x, p));
const asset = lastRelease.assets.find(y => y.name.includes(p.assetName));

let downloadUrl = lastRelease.zipball_url;
Expand Down Expand Up @@ -47,6 +51,7 @@ interface GithubRelease {
prerelease: boolean;
assets: GithubAsset[];
zipball_url: string;
published_at: Date;
}

interface GithubAsset {
Expand Down
Loading

0 comments on commit af23b5d

Please sign in to comment.