diff --git a/.compilerc b/.compilerc new file mode 100644 index 0000000..8b5712e --- /dev/null +++ b/.compilerc @@ -0,0 +1,42 @@ +{ + "env": { + "development": { + "application/javascript": { + "presets": [ + [ + "env", + { + "targets": { + "electron": 1.6 + } + } + ], + "react" + ], + "plugins": [ + "transform-async-to-generator" + ], + "sourceMaps": "inline" + } + }, + "production": { + "application/javascript": { + "presets": [ + [ + "env", + { + "targets": { + "electron": 1.6 + } + } + ], + "react" + ], + "plugins": [ + "transform-async-to-generator" + ], + "sourceMaps": "none" + } + } + } +} \ No newline at end of file diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..64f1252 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,9 @@ +{ + "extends": "eslint-config-airbnb", + "rules": { + "import/extensions": 0, + "import/no-extraneous-dependencies": 0, + "import/no-unresolved": [2, { "ignore": ["electron"] }], + "linebreak-style": 0 + } +} diff --git a/.gitignore b/.gitignore index 12b972d..eabeb50 100644 --- a/.gitignore +++ b/.gitignore @@ -61,4 +61,8 @@ typings/ ffmpeg* ffplay* ffprobe* -lib/youtube-dl* +src/lib/youtube-dl* + +node_modules +out + *.exe diff --git a/index.js b/index.js deleted file mode 100644 index 9c5a834..0000000 --- a/index.js +++ /dev/null @@ -1,35 +0,0 @@ -const path = require('path'); -global.dir = path.join(__dirname); -const { - app, - BrowserWindow, - Menu, - dialog, - ipcMain -} = require('electron'); -const fs = require('fs'); -const yt_dl = require('./controller/youtube-dl') - -var win ; - -app.getPath('documents') -app.on('ready', () => { - win = new BrowserWindow({ - width: 1010, - height: 800, - minWidth: 1010, - minHeight: 565, - show: false, - frame: true - }) - win.loadURL(`file://${__dirname}/app/view/layout.html`) - win.once('ready-to-show', () => { - win.show() - //var x = new yt_dl("https://www.youtube.com/watch?v=UbQgXeY_zi4") - //x.download(); - }) - - win.on('closed', () => { - app.quit(); - }) -}) diff --git a/package.json b/package.json index 11357df..5bb5df2 100644 --- a/package.json +++ b/package.json @@ -1,23 +1,65 @@ { - "name": "electron-simple-youtube-downloader", + "name": "cyb3r-youtube-downloader", + "productName": "cyb3r-youtube-downloader", "version": "1.0.0", - "description": "electron-simple-youtube-downloader", - "main": "index.js", + "description": "My Electron application description", + "main": "src/index.js", + "scripts": { + "start": "electron-forge start", + "package": "electron-forge package", + "make": "electron-forge make", + "lint": "eslint src" + }, + "keywords": [], + "author": "theen", + "license": "MIT", + "config": { + "forge": { + "make_targets": { + "win32": [ + "squirrel" + ], + "darwin": [ + "zip" + ], + "linux": [ + "deb", + "rpm" + ] + }, + "electronPackagerConfig": { + "packageManager": "npm" + }, + "electronWinstallerConfig": { + "name": "cyb3r_youtube_downloader" + }, + "electronInstallerDebian": {}, + "electronInstallerRedhat": {}, + "github_repository": { + "owner": "", + "name": "" + }, + "windowsStoreConfig": { + "packageName": "", + "name": "cyb3ryoutubedownloader" + } + } + }, "dependencies": { + "electron-compile": "^6.4.1", "electron": "^1.6.11", "mkdirp": "^0.5.1", - "request": "^2.81.0", - "youtube-dl": "^1.11.1" + "request": "^2.81.0" }, - "devDependencies": {}, - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1", - "start": "electron index.js" - }, - "repository": { - "type": "git", - "url": "https://git.tooru.thee.moe/theenoro/electron-simple-youtube-downloader.git" - }, - "author": "Theenoro", - "license": "ISC" + "devDependencies": { + "babel-plugin-transform-async-to-generator": "^6.24.1", + "babel-preset-env": "^1.6.0", + "babel-preset-react": "^6.24.1", + "electron-prebuilt-compile": "1.6.11", + "eslint": "^3.19.0", + "eslint-config-airbnb": "^15.1.0", + "eslint-plugin-import": "^2.7.0", + "eslint-plugin-jsx-a11y": "^5.1.1", + "eslint-plugin-react": "^7.1.0" + } } diff --git a/app/js/app.js b/src/app/js/app.js similarity index 100% rename from app/js/app.js rename to src/app/js/app.js diff --git a/app/libs/bootstrap/css/bootstrap-theme.css b/src/app/libs/bootstrap/css/bootstrap-theme.css similarity index 100% rename from app/libs/bootstrap/css/bootstrap-theme.css rename to src/app/libs/bootstrap/css/bootstrap-theme.css diff --git a/app/libs/bootstrap/css/bootstrap-theme.css.map b/src/app/libs/bootstrap/css/bootstrap-theme.css.map similarity index 100% rename from app/libs/bootstrap/css/bootstrap-theme.css.map rename to src/app/libs/bootstrap/css/bootstrap-theme.css.map diff --git a/app/libs/bootstrap/css/bootstrap-theme.min.css b/src/app/libs/bootstrap/css/bootstrap-theme.min.css similarity index 100% rename from app/libs/bootstrap/css/bootstrap-theme.min.css rename to src/app/libs/bootstrap/css/bootstrap-theme.min.css diff --git a/app/libs/bootstrap/css/bootstrap-theme.min.css.map b/src/app/libs/bootstrap/css/bootstrap-theme.min.css.map similarity index 100% rename from app/libs/bootstrap/css/bootstrap-theme.min.css.map rename to src/app/libs/bootstrap/css/bootstrap-theme.min.css.map diff --git a/app/libs/bootstrap/css/bootstrap.css b/src/app/libs/bootstrap/css/bootstrap.css similarity index 100% rename from app/libs/bootstrap/css/bootstrap.css rename to src/app/libs/bootstrap/css/bootstrap.css diff --git a/app/libs/bootstrap/css/bootstrap.css.map b/src/app/libs/bootstrap/css/bootstrap.css.map similarity index 100% rename from app/libs/bootstrap/css/bootstrap.css.map rename to src/app/libs/bootstrap/css/bootstrap.css.map diff --git a/app/libs/bootstrap/css/bootstrap.min.css b/src/app/libs/bootstrap/css/bootstrap.min.css similarity index 100% rename from app/libs/bootstrap/css/bootstrap.min.css rename to src/app/libs/bootstrap/css/bootstrap.min.css diff --git a/app/libs/bootstrap/css/bootstrap.min.css.map b/src/app/libs/bootstrap/css/bootstrap.min.css.map similarity index 100% rename from app/libs/bootstrap/css/bootstrap.min.css.map rename to src/app/libs/bootstrap/css/bootstrap.min.css.map diff --git a/app/libs/bootstrap/fonts/glyphicons-halflings-regular.eot b/src/app/libs/bootstrap/fonts/glyphicons-halflings-regular.eot similarity index 100% rename from app/libs/bootstrap/fonts/glyphicons-halflings-regular.eot rename to src/app/libs/bootstrap/fonts/glyphicons-halflings-regular.eot diff --git a/app/libs/bootstrap/fonts/glyphicons-halflings-regular.svg b/src/app/libs/bootstrap/fonts/glyphicons-halflings-regular.svg similarity index 100% rename from app/libs/bootstrap/fonts/glyphicons-halflings-regular.svg rename to src/app/libs/bootstrap/fonts/glyphicons-halflings-regular.svg diff --git a/app/libs/bootstrap/fonts/glyphicons-halflings-regular.ttf b/src/app/libs/bootstrap/fonts/glyphicons-halflings-regular.ttf similarity index 100% rename from app/libs/bootstrap/fonts/glyphicons-halflings-regular.ttf rename to src/app/libs/bootstrap/fonts/glyphicons-halflings-regular.ttf diff --git a/app/libs/bootstrap/fonts/glyphicons-halflings-regular.woff b/src/app/libs/bootstrap/fonts/glyphicons-halflings-regular.woff similarity index 100% rename from app/libs/bootstrap/fonts/glyphicons-halflings-regular.woff rename to src/app/libs/bootstrap/fonts/glyphicons-halflings-regular.woff diff --git a/app/libs/bootstrap/fonts/glyphicons-halflings-regular.woff2 b/src/app/libs/bootstrap/fonts/glyphicons-halflings-regular.woff2 similarity index 100% rename from app/libs/bootstrap/fonts/glyphicons-halflings-regular.woff2 rename to src/app/libs/bootstrap/fonts/glyphicons-halflings-regular.woff2 diff --git a/app/libs/bootstrap/js/bootstrap.js b/src/app/libs/bootstrap/js/bootstrap.js similarity index 100% rename from app/libs/bootstrap/js/bootstrap.js rename to src/app/libs/bootstrap/js/bootstrap.js diff --git a/app/libs/bootstrap/js/bootstrap.min.js b/src/app/libs/bootstrap/js/bootstrap.min.js similarity index 100% rename from app/libs/bootstrap/js/bootstrap.min.js rename to src/app/libs/bootstrap/js/bootstrap.min.js diff --git a/app/libs/bootstrap/js/npm.js b/src/app/libs/bootstrap/js/npm.js similarity index 100% rename from app/libs/bootstrap/js/npm.js rename to src/app/libs/bootstrap/js/npm.js diff --git a/app/libs/jquery/jquery-3.2.1.min.js b/src/app/libs/jquery/jquery-3.2.1.min.js similarity index 100% rename from app/libs/jquery/jquery-3.2.1.min.js rename to src/app/libs/jquery/jquery-3.2.1.min.js diff --git a/app/style/progress.css b/src/app/style/progress.css similarity index 100% rename from app/style/progress.css rename to src/app/style/progress.css diff --git a/app/view/layout.html b/src/app/view/layout.html similarity index 100% rename from app/view/layout.html rename to src/app/view/layout.html diff --git a/controller/youtube-dl.js b/src/controller/youtube-dl.js similarity index 100% rename from controller/youtube-dl.js rename to src/controller/youtube-dl.js diff --git a/src/index.html b/src/index.html new file mode 100644 index 0000000..e11c582 --- /dev/null +++ b/src/index.html @@ -0,0 +1,10 @@ + + +
+ +