Compare commits

...

19 Commits

Author SHA1 Message Date
15275236b0 Add build badges to readme 2019-04-28 17:19:15 +02:00
TC
639ae28122 Update linux category 2019-04-28 17:03:36 +02:00
TC
d3453a600b Install deps in docker 2019-04-28 16:36:56 +02:00
TC
caf76e7588 Fix env in travis config 2019-04-28 16:28:02 +02:00
TC
2d3f77d962 Update package lock 2019-04-28 16:27:42 +02:00
TC
5279a45f35 Add travis config 2019-04-28 16:18:40 +02:00
TC
e52e522d22 Release on appveyor 2019-04-28 16:02:46 +02:00
TC
aa3e4b32eb Bump version 2019-04-28 15:55:58 +02:00
TC
eb63917b5d Revert "publish=never for win build"
This reverts commit 6e037483c7.
2019-04-28 15:47:31 +02:00
TC
6e037483c7 publish=never for win build 2019-04-28 13:09:20 +02:00
TC
941477bb0c Build only for Windows on Appveyor 2019-04-28 12:37:44 +02:00
TC
abc2bb8a4f Add Appveyor config 2019-04-28 12:31:55 +02:00
253e82a2d7 Improve readme snippets 2019-04-26 15:23:54 +02:00
TC
708ba3167e Optimize logo 2019-04-19 18:17:17 +02:00
TC
b3c24a5212 Build script + check for updates 2019-04-19 18:10:23 +02:00
9d343bf779 Add release/licence badge in readme 2019-04-20 17:26:33 +02:00
TC
cd78db4e84 Trailing spaces in readme 2019-04-20 17:18:35 +02:00
TC
5648a3020b Fix indent in readme snippet 2019-04-20 17:16:31 +02:00
828e8d472c Add download section in readme 2019-04-20 17:12:15 +02:00
8 changed files with 907 additions and 462 deletions

3
.gitignore vendored
View File

@ -1,3 +1,4 @@
node_modules
/dist
/assets/generated
/assets/generated
electron-builder.yml

43
.travis.yml Normal file
View File

@ -0,0 +1,43 @@
matrix:
include:
- os: osx
osx_image: xcode9.4
language: node_js
node_js: "10"
env:
- ELECTRON_CACHE=$HOME/.cache/electron
- ELECTRON_BUILDER_CACHE=$HOME/.cache/electron-builder
- os: linux
services: docker
language: generic
cache:
directories:
- node_modules
- $HOME/.cache/electron
- $HOME/.cache/electron-builder
script:
- |
if [ "$TRAVIS_OS_NAME" == "linux" ]; then
docker run --rm \
$(env | \
grep -Eo '^[^\s=]*(DEBUG|NODE_|ELECTRON_|YARN_|NPM_|CI|CIRCLE|TRAVIS|APPVEYOR_|CSC_|_TOKEN|_KEY|AWS_|STRIP|BUILD_)[^\s=]*' | \
sed '/^$/d;s/^/-e /' | \
paste -sd ' ' \
) \
-v ${PWD}:/project \
-v ~/.cache/electron:/root/.cache/electron \
-v ~/.cache/electron-builder:/root/.cache/electron-builder \
electronuserland/builder \
/bin/bash -c "npm install && npm run release:linux"
else
npm run release:mac
fi
before_cache:
- rm -rf $HOME/.cache/electron-builder
branches:
except:
- "/^v\\d+\\.\\d+\\.\\d+$/"

20
appveyor.yml Normal file
View File

@ -0,0 +1,20 @@
image: Visual Studio 2017
platform:
- x64
cache:
- node_modules
- '%USERPROFILE%\.electron'
init:
- git config --global core.autocrlf input
install:
- ps: Install-Product node 8 x64
- npm install
build_script:
- npm run release:win
test: off

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 40 KiB

View File

@ -1,8 +1,9 @@
"use strict";
const path = require("path");
const electron = require("electron");
const isDev = require("electron-is-dev");
const electron = require("electron");
const isDev = require("electron-is-dev");
const { autoUpdater } = require("electron-updater");
const { setApplicationMenu } = require("./menu");
const { getEnabledPlugins, store } = require("./store");
@ -15,6 +16,7 @@ require("electron-debug")();
// Prevent window being garbage collected
let mainWindow;
autoUpdater.autoDownload = false;
let icon = "assets/youtube-music.png";
if (process.platform == "win32") {
@ -120,6 +122,20 @@ app.on("activate", () => {
app.on("ready", () => {
setApplicationMenu();
mainWindow = createMainWindow();
if (!isDev) {
autoUpdater.checkForUpdatesAndNotify();
autoUpdater.on("update-available", () => {
const dialogOpts = {
type : "info",
buttons: ["OK"],
title : "Application Update",
message: "A new version is available",
detail :
"A new version is available and can be downloaded at https://github.com/th-ch/youtube-music/releases/latest"
};
electron.dialog.showMessageBox(dialogOpts);
});
}
// Optimized for Mac OS X
if (process.platform === "darwin") {

1204
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,8 @@
{
"name" : "youtube-music",
"productName": "YouTube Music",
"version" : "1.0.0",
"description": "",
"version" : "1.1.1",
"description": "YouTube Music Desktop App - including custom plugins",
"license" : "MIT",
"repository" : "th-ch/youtube-music",
"author" : {
@ -10,28 +10,50 @@
"email": "th-ch@users.noreply.github.com",
"url" : "https://github.com/th-ch/youtube-music"
},
"build": {
"appId" : "com.github.th-ch.youtube-music",
"productName": "YouTube Music",
"mac" : {
"identity": null,
"icon" : "assets/generated/icons/mac/icon.icns"
},
"win": {
"icon": "assets/generated/icons/win/icon.ico"
},
"linux": {
"icon" : "assets/generated/icons/png",
"category": "AudioVideo"
}
},
"scripts": {
"test" : "xo",
"start" : "electron .",
"icon" : "electron-icon-maker --input=assets/youtube-music.png --output=assets/generated",
"postinstall": "npm run icon && npm rebuild && node plugins/adblocker/generator.js && electron-rebuild",
"build" : "electron-packager . --out=dist --asar --overwrite --all --icon=assets/generated/icons/mac/icon.icns --prune=true",
"build:macos": "electron-packager . --platform=darwin --arch=x64 --out=dist --asar --overwrite --icon=assets/generated/icons/mac/icon.icns --prune=true"
"test" : "xo",
"start" : "electron .",
"icon" : "rimraf assets/generated && electron-icon-maker --input=assets/youtube-music.png --output=assets/generated",
"postinstall" : "npm run icon && npm rebuild && node plugins/adblocker/generator.js && electron-rebuild",
"clean" : "rimraf dist",
"build" : "npm run clean && build --win --mac --linux",
"build:mac" : "npm run clean && build --mac",
"build:win" : "npm run clean && build --win",
"release:linux": "npm run clean && build --linux -p always",
"release:mac" : "npm run clean && build --mac -p always",
"release:win" : "npm run clean && build --win -p always"
},
"dependencies": {
"ad-block" : "^4.1.3",
"electron-debug" : "^2.0.0",
"electron-is-dev" : "^1.0.1",
"electron-localshortcut": "^3.1.0",
"electron-store" : "^2.0.0"
"electron-store" : "^2.0.0",
"electron-updater" : "^4.0.6"
},
"devDependencies": {
"devtron" : "^1.4.0",
"electron" : "^4.0.8",
"electron-builder" : "^20.40.2",
"electron-devtools-installer": "^2.2.4",
"electron-icon-maker" : "0.0.4",
"electron-packager" : "^13.1.1",
"electron-rebuild" : "^1.8.4",
"rimraf" : "^2.6.3",
"xo" : "^0.24.0"
},
"xo": {

View File

@ -1,4 +1,9 @@
# YouTube Music [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo)
# YouTube Music
[![GitHub release](https://img.shields.io/github/release/th-ch/youtube-music.svg)](https://GitHub.com/th-ch/youtube-music/releases/)
[![GitHub license](https://img.shields.io/github/license/th-ch/youtube-music.svg)](https://github.com/th-ch/youtube-music/blob/master/LICENSE)
[![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo)
[![Build status](https://ci.appveyor.com/api/projects/status/tgre12r150ynvwl2?svg=true)](https://ci.appveyor.com/project/th-ch/youtube-music)
[![Build Status](https://travis-ci.org/th-ch/youtube-music.svg?branch=master)](https://travis-ci.org/th-ch/youtube-music)
![Screenshot](screenshot.jpg "Screenshot")
@ -7,6 +12,15 @@
- Native look & feel, aims at keeping the original interface
- Framework for custom plugins: change YouTube Music to your needs (style, content, features), enable/disable plugins in one click
## Download
You can check out the [latest release](https://github.com/th-ch/youtube-music/releases/latest) to quickly find the latest version.
Here are the links to the current version:
- [Mac](https://github.com/th-ch/youtube-music/releases/download/v1.0.0/youtube-music-1.0.0.dmg)
- [Windows](https://github.com/th-ch/youtube-music/releases/download/v1.0.0/youtube-music-setup-1.0.0.exe)
- [Linux](https://github.com/th-ch/youtube-music/releases/download/v1.0.0/youtube-music-1.0.0-x86_64.AppImage)
## Available plugins:
- **Ad Blocker**: block all ads and tracking out of the box
@ -16,7 +30,7 @@
## Dev
```
```sh
git clone https://github.com/th-ch/youtube-music
cd youtube-music
npm install
@ -36,7 +50,7 @@ Create a folder in `plugins/YOUR-PLUGIN-NAME`:
- if you need to manipulate the BrowserWindow, create a file `back.js` with the following template:
```
```node
module.exports = win => {
// win is the BrowserWindow object
};
@ -44,10 +58,10 @@ module.exports = win => {
- if you need to change the front, create a file `front.js` with the following template:
```
```node
module.exports = () => {
// This function will be called as a preload script
// So you can use front features like `document.querySelector`
// So you can use front features like `document.querySelector`
};
```
@ -55,7 +69,10 @@ module.exports = () => {
- injecting custom CSS: create a `style.css` file in the same folder then:
```
```node
const path = require("path");
const { injectCSS } = require("../utils");
// back.js
module.exports = win => {
injectCSS(win.webContents, path.join(__dirname, "style.css"));
@ -64,7 +81,7 @@ module.exports = win => {
- changing the HTML:
```
```node
// front.js
module.exports = () => {
// Remove the login button
@ -76,11 +93,11 @@ module.exports = () => {
## Build
```
$ npm run build
```sh
npm run build
```
Builds the app for macOS, Linux, and Windows, using [electron-packager](https://github.com/electron-userland/electron-packager).
Builds the app for macOS, Linux, and Windows, using [electron-builder](https://github.com/electron-userland/electron-builder).
## License