Skip to content

Commit

Permalink
Merge pull request #147 from cosmos/jordan/138-electron-stuff
Browse files Browse the repository at this point in the history
trying to spruce up our native experience
  • Loading branch information
faboweb authored Dec 5, 2017
2 parents c744120 + 79d808c commit fbc2f70
Show file tree
Hide file tree
Showing 19 changed files with 40 additions and 27 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ make install
Then build and run the app:
```bash
npm run pack && npm run build:darwin
open builds/cosmos-ui-darwin-x64/cosmos-ui.app
open builds/Cosmos-darwin-x64/Cosmos.app
```

When you are testing the build system you can skip the repackaging of the JS files with:
Expand Down Expand Up @@ -96,14 +96,14 @@ $ npm run pack
$ npm run test:e2e
```

## Debug
To debug the electron application first build it and then run the node inspector for the build files:
```bash
$ electron --inspect-brk builds/{{your build}}/resources/app/dist/main.js
```
## Debug

To debug the electron application first build it and then run the node inspector for the build files:

```bash
$ electron --inspect-brk builds/{{your build}}/resources/app/dist/main.js
```

Then attach to the debugger via the posted url in Chrome.


Expand Down Expand Up @@ -155,4 +155,4 @@ $ rm -rf yarn.lock
$ rm -rf package-lock.json
```

- If your components are not found using a short path, check if the path resolution is applied for webpack (in `webpack.renderer.js > rendererConfig.resolve.alias`) and jest (in `package.json > jest.moduleNameMapper`).
- If your components are not found using a short path, check if the path resolution is applied for webpack (in `webpack.renderer.js > rendererConfig.resolve.alias`) and jest (in `package.json > jest.moduleNameMapper`).
Binary file modified app/icons/icon.icns
Binary file not shown.
Binary file modified app/icons/icon.ico
Binary file not shown.
Binary file added app/icons/png/16x16.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 app/icons/png/24x24.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 app/icons/png/32x32.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 app/icons/png/48x48.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 app/icons/png/96x96.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 app/icons/png/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 app/icons/png/icon@2x.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 app/icons/png/icon@3x.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 app/icons/png/icon@4x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions app/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"name": "cosmos-ui",
"name": "Cosmos",
"productName": "Cosmos",
"version": "0.1.0",
"description": "The user interface for Cosmos, built in Vue.",
"description": "The human interface for Cosmos.",
"main": "./dist/main.js",
"author": "All In Bits, Inc <hello@tendermint.com>",
"license": "Apache-2.0",
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ let mainWindow
let baseserverProcess
let streams = []
let nodeIP

const WIN = /^win/.test(process.platform)
const DEV = process.env.NODE_ENV === 'development'
const TEST = JSON.parse(process.env.COSMOS_TEST || 'false') !== false
Expand Down Expand Up @@ -96,6 +97,10 @@ function createWindow () {
minHeight: 480,
width: 1200,
height: 800,
center: true,
title: 'Cosmos',
darkTheme: true,
titleBarStyle: 'hidden',
webPreferences: { webSecurity: false }
})
// mainWindow.maximize()
Expand Down
10 changes: 6 additions & 4 deletions app/src/renderer/components/common/AppHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ export default {
<style lang="stylus">
@require '~variables'
#app-header
.container
-webkit-app-region: drag
@media screen and (max-width: 1023px)
#app-header
position fixed
Expand Down Expand Up @@ -95,6 +99,7 @@ export default {
&.header-item-logo
font-size sm
img
height 1rem
Expand All @@ -118,11 +123,8 @@ export default {
flex-flow column nowrap
.header-item-logo
height 3rem
border-bottom px solid bc
display flex
align-items center
padding 0 1rem
padding 2rem 1rem .75rem
img
height 1.25rem
Expand Down
5 changes: 4 additions & 1 deletion app/src/renderer/components/common/NiPageHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ export default {
<style lang="stylus">
@require '~variables'
.ni-page-header
-webkit-app-region: drag;
.ni-page-header-container
min-height 3rem
border-bottom px solid bc
Expand Down Expand Up @@ -49,7 +52,7 @@ export default {
white-space nowrap
overflow hidden
text-overflow ellipsis
font-size lg
line-height 1.5rem
font-weight 400
Expand Down
1 change: 1 addition & 0 deletions app/src/renderer/styles/app.styl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ html, body, #app
a
color link
text-decoration none

&:hover
color hover

Expand Down
2 changes: 1 addition & 1 deletion config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const path = require('path')
let config = {
// Name of electron app
// Will be used in production builds
name: 'cosmos-ui',
name: 'Cosmos',

// Use ESLint (extends `standard`)
// Further changes can be made in `.eslintrc.js`
Expand Down
19 changes: 10 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
{
"name": "cosmos-ui-electron",
"name": "Cosmos",
"productName": "Cosmos",
"version": "0.1.0",
"description": "The electron wrapper for Cosmos UI.",
"author": "All In Bits, Inc <hello@tendermint.com>",
"license": "Apache-2.0",
"homepage": "https://cosmos.network",
"repository": {
"type": "git",
"url": "git+https://github.com/cosmos/cosmos-ui.git"
},
"engines": {
"node": ">=8.0.0"
},
Expand All @@ -12,7 +20,7 @@
"build:linux": "cross-env PLATFORM_TARGET=linux node tasks/release.js",
"build:mas": "cross-env PLATFORM_TARGET=mas node tasks/release.js",
"build:win32": "cross-env PLATFORM_TARGET=win32 node tasks/release.js",
"release:darwin": "electron-installer-dmg --overwrite builds/cosmos-ui-darwin-x64/cosmos-ui.app builds/cosmos",
"release:darwin": "electron-installer-dmg --overwrite builds/Cosmos-darwin-x64/Cosmos.app builds/cosmos",
"uionly": "cross-env COSMOS_UI_ONLY='true' yarn run testnet",
"local": "npm run testnet local",
"testnet": "node tasks/testnet.js",
Expand All @@ -29,13 +37,6 @@
"rebuild": "electron-rebuild --module-dir app",
"postinstall": "cd app && yarn && cd .. && npm run rebuild"
},
"author": "All In Bits, Inc <hello@tendermint.com>",
"license": "Apache-2.0",
"homepage": "https://cosmos.network",
"repository": {
"type": "git",
"url": "git+https://github.com/cosmos/cosmos-ui.git"
},
"devDependencies": {
"babel-core": "^6.8.0",
"babel-eslint": "^7.0.0",
Expand Down

0 comments on commit fbc2f70

Please sign in to comment.