Skip to content

Commit

Permalink
added skeleton code for future electron.js support
Browse files Browse the repository at this point in the history
added font swap to google font call

simplified polyfills

updated backend package.json info
  • Loading branch information
Tzahi12345 committed Feb 20, 2020
1 parent 54492b1 commit 393ed5a
Show file tree
Hide file tree
Showing 6 changed files with 103 additions and 8 deletions.
51 changes: 51 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,57 @@
"browserTarget": "youtube-dl-material:build"
}
},
"serve-electron": {
"builder": "@angular-guru/electron-builder:dev-server",
"options": {
"browserTarget": "youtube-dl-material:build"
},
"configurations": {
"production": {
"browserTarget": "youtube-dl-material:build:production"
}
}
},
"electron": {
"builder": "@angular-guru/electron-builder:build",
"options": {
"outputPath": "dist",
"index": "src/index.html",
"main": "main.js",
"tsConfig": "src/tsconfig.app.json",
"polyfills": "src/polyfills.ts",
"assets": [
"src/assets",
"src/favicon.ico",
"src/backend/audio",
"src/backend/video",
"src/backend"
],
"styles": [
"src/styles.scss"
],
"scripts": []
},
"configurations": {
"production": {
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
]
}
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
Expand Down
8 changes: 4 additions & 4 deletions backend/package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{
"name": "backend",
"version": "1.0.0",
"description": "backend for hda",
"description": "backend for YoutubeDL-Material",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Tzahi12345/hda-backend.git"
"url": ""
},
"author": "Isaac Grynsztein",
"license": "MIT",
"bugs": {
"url": "https://github.com/Tzahi12345/hda-backend/issues"
"url": ""
},
"homepage": "https://github.com/Tzahi12345/hda-backend#readme",
"homepage": "",
"dependencies": {
"archiver": "^3.1.1",
"async": "^3.1.0",
Expand Down
41 changes: 41 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
const { app, BrowserWindow } = require('electron');
const path = require('path');
const url = require('url');

let win;

function createWindow() {
win = new BrowserWindow({ width: 800, height: 600 });

// load the dist folder from Angular
win.loadURL(
url.format({
pathname: path.join(__dirname, `/dist/index.html`),
protocol: 'file:',
slashes: true
})
);

// The following is optional and will open the DevTools:
// win.webContents.openDevTools()

win.on('closed', () => {
win = null;
});
}

app.on('ready', createWindow);

// on macOS, closing the window doesn't quit the app
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit();
}
});

// initialize the app's main window
app.on('activate', () => {
if (win === null) {
createWindow();
}
});
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
"e2e": "ng e2e",
"electron": "ng build --base-href ./ && electron ."
},
"private": true,
"dependencies": {
Expand All @@ -33,6 +34,7 @@
"rxjs-compat": "^6.0.0-rc.0",
"tslib": "^1.10.0",
"videogular2": "^7.0.1",
"web-animations-js": "^2.3.2",
"zone.js": "~0.9.1"
},
"devDependencies": {
Expand All @@ -45,6 +47,7 @@
"@types/jasmine": "2.5.45",
"@types/node": "~6.0.60",
"codelyzer": "^5.0.1",
"electron": "^8.0.1",
"jasmine-core": "~2.6.2",
"jasmine-spec-reporter": "~4.1.0",
"karma": "~1.7.0",
Expand Down
2 changes: 1 addition & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1">

<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Roboto&display=swap" rel="stylesheet">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
Expand Down
4 changes: 2 additions & 2 deletions src/polyfills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@


/** Evergreen browsers require these. **/
import 'core-js/es6/reflect';
// import 'core-js/es6/reflect';


/** ALL Firefox browsers require the following to support `@angular/animation`. **/
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
import 'web-animations-js'; // Run `npm install --save web-animations-js`.



Expand Down

0 comments on commit 393ed5a

Please sign in to comment.