Skip to content

Commit

Permalink
restructured repo
Browse files Browse the repository at this point in the history
  • Loading branch information
faboweb committed Apr 26, 2019
1 parent 78c711a commit fea459f
Show file tree
Hide file tree
Showing 255 changed files with 205 additions and 196 deletions.
12 changes: 6 additions & 6 deletions .circleci/config.yml
Expand Up @@ -5,8 +5,8 @@ aliases:
# Define paths and never think about them again
- &GAIA /tmp/gaia
- &WORKSPACE /tmp/voyager
- &DIST /tmp/voyager/app/dist
- &DIST_TESTNET /tmp/voyager/app/dist_testnet
- &DIST /tmp/voyager/dist
- &DIST_TESTNET /tmp/voyager/dist_testnet
# Pick docker versions here only, then use the aliases in the executors definition
- &docker-node tendermintdev/voyager_node
- &docker-browsers tendermintdev/voyager_node_browser
Expand Down Expand Up @@ -112,7 +112,7 @@ jobs:
- checkout
- yarn-install
- run: |
mkdir -p app/dist
mkdir -p dist
yarn build:keybase-cache
if [ "${CIRCLE_BRANCH}" = "master" ]; then
Expand All @@ -129,8 +129,8 @@ jobs:
- persist_to_workspace:
root: *WORKSPACE
paths:
- app/dist
- app/dist_testnet
- dist
- dist_testnet

# Build Gaia from the SDK source code specified by tasks/build/Gaia/VERSION
buildGaia:
Expand Down Expand Up @@ -243,7 +243,7 @@ jobs:
- checkout
- yarn-install
- run: |
mkdir -p app/dist
mkdir -p dist
CIRCLECI=true RELEASE=true yarn build:ui
# Create release.
Expand Down
3 changes: 1 addition & 2 deletions .eslintignore
@@ -1,6 +1,5 @@
/archive
/app/dist/
/app/networks/
/dist
/**/builds/*
/testArtifacts
/test/unit/coverage/
Expand Down
5 changes: 2 additions & 3 deletions .gitignore
@@ -1,5 +1,5 @@
.DS_Store
app/dist
dist
builds/*
tasks/builds
coverage
Expand All @@ -12,9 +12,8 @@ thumbs.db
.vscode/*
yarn-error.log
testArtifacts/*
app/networks/local-testnet/*
.idea/*
*.crt
*.key
chromedriver.log
app/src/renderer/keybase-cache.json
src/keybase-cache.json
2 changes: 1 addition & 1 deletion .prettierignore
@@ -1,4 +1,4 @@
/app/dist/
/dist/
/package.json
/test/unit/coverage/
/test/unit/tmp/
Expand Down
12 changes: 2 additions & 10 deletions README.md
@@ -1,4 +1,4 @@
![Lunie logo — spaceship blasting off](/app/static/icons/png/128x128.png)
![Lunie logo — spaceship blasting off](/src/images/png/128x128.png)

# Welcome to [Lunie.io](https://lunie.io)!

Expand Down Expand Up @@ -65,14 +65,6 @@ yarn build:gaia

The version built is specified in `tasks/build/Gaia/VERSION` and the programs are placed in the `builds/Gaia` directory.

### Testnets

To connect to a testnet, Lunie needs the configuration files of those networks in the folder `app/networks/{network_name}`. Gaia has a Git repository that holds the configuration files. Lunie has script to download those configurations for you:

```bash
yarn build:testnets
```

### Caddy Proxy

Currently we need a proxy to enable easy local development. We use [Caddy](https://caddyserver.com). To download run:
Expand Down Expand Up @@ -213,7 +205,7 @@ If you want to run them locally build the UI and serve the files so the E2E test

```bash
yarn build:ui
./node_modules/.bin/http-server /app/dist -p 8081
./node_modules/.bin/http-server /dist -p 8081
```

Then run the actual tests:
Expand Down
1 change: 0 additions & 1 deletion app/networks

This file was deleted.

1 change: 0 additions & 1 deletion app/src/renderer/keybase-cache.json

This file was deleted.

1 change: 0 additions & 1 deletion codecov.yaml
Expand Up @@ -21,4 +21,3 @@ comment:
ignore:
- "tasks/releasePullRequest.js"
- "tasks/publish.js"
- "app/src/renderer/components/govern/*"
26 changes: 12 additions & 14 deletions jest.config.js
Expand Up @@ -3,20 +3,18 @@
module.exports = {
testMatch: [`**/unit/specs/**/*spec.js`],
moduleFileExtensions: [`js`, `vue`],
moduleDirectories: [`app/node_modules`, `node_modules`, `src`],
moduleDirectories: [`node_modules`, `src`],
moduleNameMapper: {
"^src/(.*)$": `<rootDir>/app/src/$1`,
"^app/(.*)$": `<rootDir>/app/$1`,
"^renderer/(.*)$": `<rootDir>/app/src/renderer/$1`,
"^assets/(.*)$": `<rootDir>/app/src/renderer/assets/$1`,
"^common/(.*)$": `<rootDir>/app/src/renderer/components/common/$1`,
"^transactions/(.*)$": `<rootDir>/app/src/renderer/components/transactions/$1`,
"^governance/(.*)$": `<rootDir>/app/src/renderer/components/governance/$1`,
"^monitor/(.*)$": `<rootDir>/app/src/renderer/components/monitor/$1`,
"^staking/(.*)$": `<rootDir>/app/src/renderer/components/staking/$1`,
"^scripts/(.*)$": `<rootDir>/app/src/renderer/scripts/$1`,
"^wallet/(.*)$": `<rootDir>/app/src/renderer/components/wallet/$1`,
"^modules/(.*)$": `<rootDir>/app/src/renderer/vuex/modules/$1`
"^src/(.*)$": `<rootDir>/src/$1`,
"^assets/(.*)$": `<rootDir>/src/assets/$1`,
"^common/(.*)$": `<rootDir>/src/components/common/$1`,
"^transactions/(.*)$": `<rootDir>/src/components/transactions/$1`,
"^governance/(.*)$": `<rootDir>/src/components/governance/$1`,
"^monitor/(.*)$": `<rootDir>/src/components/monitor/$1`,
"^staking/(.*)$": `<rootDir>/src/components/staking/$1`,
"^scripts/(.*)$": `<rootDir>/src/scripts/$1`,
"^wallet/(.*)$": `<rootDir>/src/components/wallet/$1`,
"^modules/(.*)$": `<rootDir>/src/vuex/modules/$1`
},

transform: {
Expand All @@ -34,7 +32,7 @@ module.exports = {
`/build/`,
`/dist/`,
`/test/`,
`/app/src/config.js`
`/src/config.js`
],
testURL: `http://localhost`,
setupFiles: [
Expand Down
6 changes: 3 additions & 3 deletions package.json
Expand Up @@ -22,7 +22,7 @@
"build:ui": "cross-env NODE_ENV=production webpack --colors --config webpack.renderer.config.js --mode=production",
"start": "concurrently -k \"yarn frontend\" \"yarn backend\"",
"start:new": "concurrently -k \"yarn frontend\" \"yarn backend:new\"",
"serve": "http-server -p 8081 ./app/dist",
"serve": "http-server -p 8081 ./dist",
"lint": "yarn lint:eslint && yarn lint:css",
"lint:eslint": "eslint -f ./node_modules/eslint-friendly-formatter \"{,**/}*.{js,vue}\"",
"lint:css": "stylelint '**/*.{css,vue}'",
Expand All @@ -38,7 +38,7 @@
"nodes": "node ./tasks/local-testnet/start.js",
"proxy": "caddy",
"stargate": "./builds/Gaia/darwin_amd64/gaiacli rest-server --laddr 'tcp://localhost:9070' --home './builds/testnets/local-testnet/cli_home' --node 'http://localhost:26657' --chain-id 'local-testnet' --trust-node true",
"frontend": "cross-env NODE_ENV=development FAUCET='http://localhost:8080' webpack-dev-server --hot --colors --config webpack.renderer.config.js --port 9080 --content-base app/dist --https --mode=development",
"frontend": "cross-env NODE_ENV=development FAUCET='http://localhost:8080' webpack-dev-server --hot --colors --config webpack.renderer.config.js --port 9080 --content-base dist --https --mode=development",
"frontend:fixed-https": "yarn frontend --cert 'server_dev.crt' --key 'server_dev.key'",
"connect": "concurrently -k \"yarn stargate\" \"yarn proxy\"",
"backend:new": "concurrently -k \"yarn connect\" \"yarn nodes 2\"",
Expand Down Expand Up @@ -149,4 +149,4 @@
"git add"
]
}
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
@@ -1,5 +1,8 @@
<template>
<transition v-if="show" name="slide-fade">
<transition
v-if="show"
name="slide-fade"
>
<div class="action-modal">
<div class="action-modal-header">
<img
Expand All @@ -17,13 +20,22 @@
<i class="material-icons">close</i>
</div>
</div>
<div v-if="requiresSignIn" class="action-modal-form">
<div
v-if="requiresSignIn"
class="action-modal-form"
>
<p>You need to sign in to submit a transaction.</p>
</div>
<div v-else-if="step === `txDetails`" class="action-modal-form">
<div
v-else-if="step === `txDetails`"
class="action-modal-form"
>
<slot />
</div>
<div v-else-if="step === `fees`" class="action-modal-form">
<div
v-else-if="step === `fees`"
class="action-modal-form"
>
<tm-form-group
v-if="session.experimentalMode"
:error="$v.gasPrice.$error && $v.gasPrice.$invalid"
Expand Down Expand Up @@ -64,7 +76,10 @@
:gas-price="Number(gasPrice)"
/>
</div>
<div v-else-if="step === `sign`" class="action-modal-form">
<div
v-else-if="step === `sign`"
class="action-modal-form"
>
<tm-form-group
v-if="signMethods.length > 1"
class="action-modal-form-group"
Expand All @@ -87,7 +102,7 @@
sending
? `Please verify and sign the transaction on your Ledger`
: `Please plug in your Ledger&nbsp;Nano&nbsp;S and open
the Cosmos app`
the Cosmos app`
}}
</hardware-state>
<tm-form-group
Expand Down Expand Up @@ -172,7 +187,7 @@ import TableInvoice from "common/TableInvoice"
import { mapGetters } from "vuex"
import { uatoms, atoms } from "../../scripts/num.js"
import { between, requiredIf } from "vuelidate/lib/validators"
import { track } from "../../google-analytics.js"
import { track } from "scripts/google-analytics.js"
const defaultStep = `txDetails`
const feeStep = `fees`
Expand Down Expand Up @@ -231,7 +246,14 @@ export default {
uatoms
}),
computed: {
...mapGetters([`connected`, `session`, `bondDenom`, `wallet`, `ledger`, `liquidAtoms`]),
...mapGetters([
`connected`,
`session`,
`bondDenom`,
`wallet`,
`ledger`,
`liquidAtoms`
]),
requiresSignIn() {
return !this.session.signedIn
},
Expand All @@ -246,7 +268,10 @@ export default {
return true
},
selectedSignMethod() {
if (this.session.sessionType === `ledger` || this.session.sessionType === `explore`) {
if (
this.session.sessionType === `ledger` ||
this.session.sessionType === `explore`
) {
return signWithLedger
}
return signWithLocalKeystore
Expand Down Expand Up @@ -368,7 +393,7 @@ export default {
} catch (error) {
this.submissionError = `${this.submissionErrorPrefix}: ${error}.`
}
},
}
},
validations() {
return {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -17,7 +17,7 @@
</template>

<script>
import config from "../../../config"
import config from "src/config"
export default {
name: `tm-session-loading`,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,6 +1,6 @@
"use strict"

const mockValidators = require(`../../helpers/json/mock_validators.json`)
const mockValidators = require(`scripts/mock_validators.json`)
const { sleep } = require(`../scripts/common.js`)

const state = { blockMetas: [], blocks: [], connected: true }
Expand Down
File renamed without changes.
16 changes: 10 additions & 6 deletions app/index.ejs → src/index.ejs
Expand Up @@ -8,12 +8,15 @@
<meta name="theme-color" content="#ffffff">
<title>Lunie</title>

<link rel="apple-touch-icon" sizes="180x180" href="static/icons/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="static/icons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="static/icons/favicon-16x16.png">
<link rel="apple-touch-icon" sizes="180x180"
href="images/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32"
href="images/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16"
href="images/favicon-16x16.png">
<!-- Needs webpack loader -->
<!-- <link rel="manifest" href="static/icons/site.webmanifest"> -->
<link rel="mask-icon" href="static/icons/safari-pinned-tab.svg" color="#5bbad5">
<!-- <link rel="manifest" href="images/site.webmanifest"> -->
<link rel="mask-icon" href="images/safari-pinned-tab.svg" color="#5bbad5">

<% if (htmlWebpackPlugin.options.appModules) { %>
<% } %>
Expand All @@ -22,7 +25,8 @@
<body style="background: #15182d">
<script async src='https://www.google-analytics.com/analytics.js'></script>
<!-- Appzi: Capture Insightful Feedback -->
<script async src="https://app.appzi.io/bootstrap/bundle.js?token=LWNp0"></script>
<script async
src="https://app.appzi.io/bootstrap/bundle.js?token=LWNp0"></script>
<!-- End Appzi -->

<div id="app" style="background: #15182d"></div>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions app/src/renderer/scripts/boot.js → src/scripts/boot.js
Expand Up @@ -16,9 +16,9 @@ import App from "../App"
import routes from "../routes"
import _Node from "../connectors/node"
import _Store from "../vuex/store"
import * as urlHelpers from "../../helpers/url.js"
import _config from "../../config"
import { enableGoogleAnalytics } from "../google-analytics"
import * as urlHelpers from "scripts/url.js"
import _config from "src/config"
import { enableGoogleAnalytics } from "scripts/google-analytics"
const _enableGoogleAnalytics = enableGoogleAnalytics

export const routeGuard = store => (to, from, next) => {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,6 +1,6 @@
import { sleep } from "scripts/common.js"
import Vue from "vue"
import config from "../../../config"
import config from "src/config"

const NODE_HALTED_TIMEOUT = config.node_halted_timeout

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,8 +1,8 @@
import * as Sentry from "@sentry/browser"
import {
track
} from "../../google-analytics.js"
import config from "../../../config"
} from "scripts/google-analytics.js"
import config from "src/config"
import { loadKeys, importKey, testPassword } from "../../scripts/keystore.js"
import { generateSeed } from "../../scripts/wallet.js"

Expand Down
File renamed without changes.
File renamed without changes.
@@ -1,6 +1,6 @@
import * as Sentry from "@sentry/browser"
import Vue from "vue"
import config from "../../../config"
import config from "src/config"
import axios from "axios"

export default ({ node }) => {
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions tasks/keybase-fallback.js
Expand Up @@ -3,7 +3,7 @@
const axios = require(`axios`)
const fs = require(`fs`)
const path = require(`path`)
const { lookupId } = require(`../app/src/renderer/vuex/modules/keybase.js`)
const { lookupId } = require(`../src/vuex/modules/keybase.js`)

// This function creates a file with keybase profiles of all validators (as a fallback cache)
// This should be created on every build
Expand All @@ -27,7 +27,7 @@ async function main() {
}
}))

fs.writeFileSync(path.join(__dirname, `../app/src/renderer/keybase-cache.json`), JSON.stringify(cache), `utf8`)
fs.writeFileSync(path.join(__dirname, `../src/keybase-cache.json`), JSON.stringify(cache), `utf8`)
}

main()
4 changes: 2 additions & 2 deletions test/unit/helpers/node_mock.js
@@ -1,7 +1,7 @@
"use strict"

const mockValidators = require(`src/helpers/json/mock_validators.json`)
const mockLcd = require(`../../../app/src/renderer/connectors/lcdClientMock.js`)
const mockValidators = require(`scripts/mock_validators.json`)
const mockLcd = require(`../../../src/connectors/lcdClientMock.js`)

module.exports = {
// REST
Expand Down

0 comments on commit fea459f

Please sign in to comment.