Skip to content

Commit

Permalink
v1.0.2 (+19 squashed commits)
Browse files Browse the repository at this point in the history
Squashed commits:
- beautify log output
- upgrade roadhog to 2.x
- better way to dev
- rebuild preload style
- fix dynamic list click problem
- add setting panel
- Use tab for wrapped style rules.
- Fix custom style for 大会员 member profile page.
  • Loading branch information
zacyu authored and canisminor1990 committed Jan 6, 2018
1 parent 38d5656 commit 2d26e5f
Show file tree
Hide file tree
Showing 80 changed files with 1,455 additions and 959 deletions.
3 changes: 2 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"add-module-exports",
"transform-runtime",
"transform-decorators-legacy",
"transform-class-properties",
"lodash"
]
}
}
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ module.exports = {
'react/display-name': [0],
'react/no-children-prop': [0],
'no-undef': [0],
'no-unused-vars': [1],
'no-unused-vars': [1]
}
};
1 change: 1 addition & 0 deletions .roadhogrc.mock.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default {}
45 changes: 23 additions & 22 deletions .roadhogrc.js → .webpackrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,38 @@ export default {
entry : './src/renderer/index.js',
outputPath : './app/pages',
define : {
'$dirname': '__dirname'
'$dirname': __dirname
},
disableCSSModules : false,
html : {
template: './src/renderer/index.ejs'
},
sass : {
sourceMap : process.env.NODE_ENV === 'development',
includePaths: ['node_modules', 'src/renderer/style']
},
theme: {
"primary-color": "#f25d8e",
theme : {
'primary-color': '#f25d8e'
},
extraPostCSSPlugins: [
pxtorem({
rootValue : 16,
propWhiteList: []
})
pxtorem({rootValue: 16})
],
extraBabelPlugins : [
'transform-runtime',
'transform-decorators-legacy',
'lodash',
[
'import',
[
{
libraryName: 'antd',
style : true
}
]
]
['import', {libraryName: 'antd', libraryDirectory: 'es', style: true}]
],
externals : [
function (context, request, callback) {
let isExternal = false;
const load = [
'electron'
];
if (load.includes(request)) {
isExternal = `require("${request}")`;
}
callback(null, isExternal);
}
],
autoprefixer : {
browsers: ['iOS >= 8', 'Android >= 4']
},
env : {
development: {
extraBabelPlugins: [
Expand All @@ -50,5 +50,6 @@ export default {
{preset: ['default', {discardComments: {removeAll: true}}]})
]
}
}
},
ignoreMomentLocale : true
};
36 changes: 24 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Bilibili Mini-Clinet
# Bilibili Mini-Client

![](https://github.com/canisminor1990/bilibili-client/blob/master/doc/preview-0.png?raw=true)

[![](https://img.shields.io/github/release/canisminor1990/bilibili-client.svg)](https://github.com/canisminor1990/bilibili-client)
[![](https://img.shields.io/github/downloads/canisminor1990/bilibili-client/total.svg)](https://github.com/canisminor1990/bilibili-client/releases)

📺 可以摸鱼的 Bilibili Mini-Clinet # 支持Mac/Win
📺 可以摸鱼的 Bilibili Mini-Client # 支持Mac/Win

## Features

Expand All @@ -17,18 +17,18 @@
- [ ] 快捷键
- [ ] ...

## Preview

![](https://github.com/canisminor1990/bilibili-client/blob/master/doc/preview-1.png?raw=true)
![](https://github.com/canisminor1990/bilibili-client/blob/master/doc/preview-2.png?raw=true)
![](https://github.com/canisminor1990/bilibili-client/blob/master/doc/preview-3.png?raw=true)

## Download

点击下方按钮前往releases,下载最新版 `bilibili.app.zip`

[![](https://img.shields.io/badge/bilibili-download-ff69b4.svg?style=for-the-badge)](https://github.com/canisminor1990/bilibili-client/releases)

## Preview

![](https://github.com/canisminor1990/bilibili-client/blob/master/doc/preview-1.png?raw=true)
![](https://github.com/canisminor1990/bilibili-client/blob/master/doc/preview-2.png?raw=true)
![](https://github.com/canisminor1990/bilibili-client/blob/master/doc/preview-3.png?raw=true)

## ChangeLog

|Date|Versiton|Changelog|
Expand All @@ -40,7 +40,8 @@

`electron` `react` `dva` `roadhog` `webpack`

- 结构参考 [dva-boilerplate-electron](https://github.com/sorrycc/dva-boilerplate-electron)
- [dva-boilerplate-electron](https://github.com/sorrycc/dva-boilerplate-electron)
- [Electron 架构](https://github.com/sorrycc/blog/issues/13)

### Directory Structure

Expand All @@ -61,7 +62,9 @@

### Dev

```sh
> 因为采用 [Two-Package.json Structure](https://www.electron.build/tutorials/two-package-structure),需要安装二次依赖
```bash
# 窗口一:watch roadhog => pages / webpack => main
$ yarn dev
# 窗口二:start electron
Expand All @@ -70,17 +73,26 @@ $ yarn start

### Build

```sh
```bash
$ yarn build
# MacOS
$ yarn pack:osx
# Windows
$ yarn pack:win
```

### Pack

> issue: 目前使用yarn安装依赖,pack后会出现丢包,npm i 无此问题 🤔 ... [link](https://github.com/electron-userland/electron-packager/issues/774)
```bash
# pack:osx && pack:win
$ yarn pack
```

## License

[MIT](https://tldrlegal.com/license/mit-license)
- [MIT](https://tldrlegal.com/license/mit-license)

## Copyright

Expand Down
Empty file removed app/assets/.gitkeep
Empty file.
11 changes: 7 additions & 4 deletions app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bilibili-client",
"version": "1.0.1",
"version": "1.0.2",
"productName": "Bilibili Client",
"description": "mini client of bilibili.",
"main": "dist/main.js",
Expand All @@ -9,10 +9,13 @@
"email": "[email protected]"
},
"dependencies": {
"chalk": "^2.3.0",
"electron-config": "^1.0.0",
"electron-is": "^2.4.0",
"electron-log": "^2.2.13",
"electron-debug": "^1.4.0",
"electron-fetch": "^1.1.0"
"electron-fetch": "^1.1.0",
"electron-is": "^2.4.0",
"fancy-log": "^1.3.2",
"devtron": "^1.4.0",
"lodash": "^4.17.4"
}
}
Binary file modified build/icon.icns
Binary file not shown.
Binary file modified build/icon.ico
Binary file not shown.
Binary file removed build/icon.png
Binary file not shown.
33 changes: 17 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"title": "bilibili-client",
"version": "1.0.1",
"version": "1.0.2",
"description": "mini client of bilibili.",
"author": {
"name": "CanisMinor",
Expand All @@ -14,13 +14,14 @@
"scripts": {
"start": "electron app/dist/main",
"dev": "concurrently \"yarn dev:roadhog\" \"yarn dev:main\"",
"dev:roadhog": "roadhog build --watch",
"dev:main": "webpack -w --config ./webpack.config.main.babel.js",
"dev:roadhog": "roadhog dev --open=false",
"dev:main": "webpack -w --config ./webpack.config.babel.js",
"build": "yarn build:roadhog && yarn build:main",
"build:roadhog": "roadhog build",
"build:main": "webpack --config ./webpack.config.main.babel.js",
"build:main": "webpack --config ./webpack.config.babel.js",
"lint": "lint-staged",
"lint:es": "eslint --fix --ext .js src",
"pack": "pack:osx && yarn pack:win",
"pack:base": "electron-packager ./app bilibili --arch=x64 --out ./dist --icon=./build/icon --overwrite --asar --prune",
"pack:win": "yarn pack:base --platform=win32",
"pack:osx": "yarn pack:base --platform=darwin",
Expand All @@ -39,28 +40,25 @@
"git add"
]
},
"peerDependencies": {
"electron-packager": "^10.1.0",
"electron-release": "^2.2.0",
"roadhog": "^1.3.3"
},
"devDependencies": {
"antd": "^3.0.3",
"babel-core": "^6.26.0",
"babel-eslint": "^8.0.0",
"@babel/core": "^7.0.0-beta.36",
"antd": "^3.1.0",
"babel-eslint": "^8.0.1",
"babel-loader": "^7.1.2",
"babel-runtime": "^6.9.2",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-dva-hmr": "^0.4.0",
"babel-plugin-dva-hmr": "^0.4.1",
"babel-plugin-import": "^1.6.2",
"babel-plugin-lodash": "^3.3.2",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-plugin-transform-runtime": "^6.15.0",
"babel-preset-env": "^1.6.0",
"babel-plugin-transform-runtime": "^6.9.0",
"babel-preset-env": "^1.6.1",
"babel-preset-stage-0": "^6.24.1",
"babel-register": "^6.26.0",
"babel-runtime": "^6.26.0",
"classnames": "^2.2.5",
"concurrently": "^3.1.0",
"css-loader": "^0.28.7",
"cssnano": "^3.10.0",
"devtron": "^1.4.0",
"dva": "^2.1.0",
Expand All @@ -70,6 +68,8 @@
"electron-fetch": "^1.1.0",
"electron-is-accelerator": "^0.1.2",
"electron-store": "^1.3.0",
"electron-packager": "^10.1.0",
"electron-release": "^2.2.0",
"eslint": "^4.13.1",
"eslint-config-prettier": "^2.9.0",
"eslint-config-standard": "^10.2.1",
Expand All @@ -93,6 +93,7 @@
"react": "^16.2.0",
"react-dom": "^16.2.0",
"redbox-react": "^1.5.0",
"roadhog": "^2.0.3",
"sass-loader": "^6.0.6",
"webpack": "^3.10.0"
}
Expand Down
Binary file added public/img/icon.png
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 public/img/loading.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 8 additions & 13 deletions src/main/index.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,24 @@
import { app, BrowserWindow } from 'electron';
import is from 'electron-is';
import { join } from 'path';
import log from 'electron-log';
import { Log } from './utils';
import debug from 'electron-debug';
import * as application from './services/application';
import * as application from './services/app';
import * as window from './services/window';
import * as menu from './services/menu';
import * as config from './configs/config';

log.info('=================================');
log.info('main:start');
Log('[app] start 😘');

if (is.dev()) debug();

app.on('ready', () => {
log.info(`main:root:Platform:${process.platform}`);
Log('[app][platform]', process.platform, 1, 2, 3);
application.init();
menu.init();
application.checkUpdate();
// 加载 devtools extension
if (is.dev()) {
BrowserWindow.addDevToolsExtension(join($dirname, '../../extensions/react-devtools/2.5.2_0'));
BrowserWindow.addDevToolsExtension(join($dirname, '../../extensions/redux-devtools/2.15.1_0'));
const exPath = '../../extensions';
BrowserWindow.addDevToolsExtension(join($dirname, exPath, 'react-devtools/2.5.2_0'));
BrowserWindow.addDevToolsExtension(join($dirname, exPath, 'redux-devtools/2.15.1_0'));
}
});

Expand All @@ -38,12 +35,10 @@ app.on('activate', () => {
});

app.on('quit', () => {
log.info('main:stop');
log.info('=================================');
Log('[app] quit');
});

// Register to global, so renderer can access these with remote.getGlobal

global.services = {
application,
window,
Expand Down
20 changes: 20 additions & 0 deletions src/main/services/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { Log } from '../utils';
import { create, getPath } from './window';
import loadMenu from './loadMenu';
import loadIpc from './loadIpc';
import checkUpdate from './checkUpdate';

export function init() {
Log('[app][application] load');
const win = create({
width: 375,
height: 650,
frame: false,
resizable: false,
});
win.loadURL(getPath());
win.setAlwaysOnTop(true);
checkUpdate();
loadMenu(win);
loadIpc(win);
}
Loading

0 comments on commit 2d26e5f

Please sign in to comment.