Skip to content

Commit

Permalink
Merge pull request #564 from nervosnetwork/rc/v0.1.0-alpha.0
Browse files Browse the repository at this point in the history
[ᚬmaster] RC v0.1.0 alpha.0
  • Loading branch information
ashchan authored Jul 1, 2019
2 parents 3382282 + ed14e4c commit 79bd500
Show file tree
Hide file tree
Showing 224 changed files with 32,758 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# http://editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

# Use 4 spaces for the Python files
[*.py]
indent_size = 4
max_line_length = 120

# The JSON files contain newlines inconsistently
[*.json]
insert_final_newline = ignore

# The JavaScript file
[*.js]
indent_size = 2
max_line_length = 120

# The TypeScript file
[*.{ts,tsx}]
indent_size = 2
trim_trailing_whitespace = true
max_line_length = 120

# Minified JavaScript files shouldn't be changed
[**.min.js]
indent_style = ignore
insert_final_newline = ignore

# Makefiles always use tabs for indentation
[Makefile]
indent_style = tab

# Batch files use tabs for indentation
[*.bat]
indent_style = tab

[*.md]
trim_trailing_whitespace = false
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
jest.config.js
74 changes: 74 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
module.exports = {
"extends": ["airbnb", "plugin:prettier/recommended"],
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"rules": {
"prettier/prettier": [2, {
"printWidth": 120
}],
"semi": [2, "never"],
"comma-dangle": [2, {
"arrays": "always-multiline",
"objects": "always-multiline",
"imports": "always-multiline",
"exports": "always-multiline",
"functions": "ignore"
}],
"import/no-extraneous-dependencies": [2, {
"devDependencies": true
}],
"no-unused-vars": "off",
"implicit-arrow-linebreak": "off",
"@typescript-eslint/no-unused-vars": ["error", {
"vars": "local",
"args": "after-used",
"ignoreRestSiblings": false
}],
"arrow-parens": [2, "as-needed"],
"max-len": [2, {
"code": 120,
"ignoreComments": true,
"ignoreTrailingComments": true,
"ignoreUrls": true,
"ignoreStrings": true,
"ignoreTemplateLiterals": true,
"ignoreRegExpLiterals": true,
}],
"object-curly-newline": ["error", {
"ObjectExpression": {
"consistent": true
},
"ObjectPattern": {
"consistent": true
},
"ImportDeclaration": {
"consistent": true,
},
"ExportDeclaration": {
"multiline": true,
"minProperties": 3
}
}],
"no-plusplus": [0],
"no-console": [2, {
"allow": ["warn", "error", "info"]
}],
"lines-between-class-members": ["error", "always", { exceptAfterSingleLine: true }]
},
"globals": {
"BigInt": "readonly"
},
"env": {
"jest": true,
"browser": true,
"node": true
},
"settings": {
"import/resolver": {
"node": {
"paths": ["src"],
"extensions": [".js", ".jsx", ".ts", ".tsx"]
}
}
}
};
46 changes: 46 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
build
dist
pages
release

# misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
*.log

# deps lock
# yarn-lock.json
package-lock.json
lerna-debug.log

#docs
docs

# vscode config
./packages/neuron-wallet/.vscode

# Webstorm config
.idea

# sqlite db
cell-dev.sqlite
address-dev.sqlite
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"trailingComma": "es5",
"semi": false,
"singleQuote": true
}
32 changes: 32 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
language: node_js

os:
- linux
- osx

dist: xenial
osx_image: xcode10.2

services:
- xvfb

node_js:
- '11'
- '12'

cache:
- npm
- yarn

before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.13.0
- export PATH=$HOME/.yarn/bin:$PATH
- yarn global add lerna

install:
- travis_retry yarn bootstrap

script:
- git diff --exit-code yarn.lock
- CI=false yarn build
- yarn test
27 changes: 27 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [{
"name": "Chrome",
"type": "chrome",
"request": "launch",
"url": "http://localhost:3000",
"webRoot": "${workspaceRoot}/packages/neuron-ui/src"
}, {
"name": "neuron-wallet",
"type": "node",
"request": "launch",
"cwd": "${workspaceRoot}/packages/neuron-wallet",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron",
"windows": {
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron.cmd"
},
"args": ["."],
"outputCapture": "std",
"env": {
"NODE_ENV": "development"
}
}]
}
19 changes: 19 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"eslint.workingDirectories": [
{
"directory": "packages/neuron-wallet",
"changeProcessCWD": true
},
{
"directory": "packages/neuron-ui",
"changeProcessCWD": true
}
],
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact"
],
"typescript.tsdk": "node_modules/typescript/lib"
}
1 change: 1 addition & 0 deletions .yarnrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
registry "https://registry.yarnpkg.com"
69 changes: 69 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,71 @@
# Neuron

Nervos CKB Wallet

[![Azure Pipelines Build Status](https://dev.azure.com/nervosnetwork/neuron/_apis/build/status/nervosnetwork.neuron?branchName=develop)](https://dev.azure.com/nervosnetwork/neuron/_build/latest?definitionId=8&branchName=develop)
[![TravisCI](https://travis-ci.com/nervosnetwork/neuron.svg?branch=develop)](https://travis-ci.com/nervosnetwork/neuron)
[![Telegram Group](https://cdn.rawgit.com/Patrolavia/telegram-badge/8fe3382b/chat.svg)](https://t.me/nervos_ckb_dev)

---

## Quick Start

### Prerequisites

You will need `node >= 11` and `yarn >= 1.12` to build and run this Neuron.

Please be noted that Neuron depends on [node-gyp](https://github.com/nodejs/node-gyp) to build native NPM modules. Follow [this](https://github.com/nodejs/node-gyp#installation) to install node-gyp dependencies.

#### Lerna

Neuron project uses [lerna](https://github.com/lerna/lerna/) for packages management. It can be installed globally, or locally in the project.

```sh
$ yarn global add lerna # install lerna globally
# or
$ yarn add lerna --exact --ignore-workspace-root-check # install lerna locally in the project
```

#### Install Dependencies

After lerna installed, the dependencies can be installed by

```sh
$ yarn bootstrap
```

### Start Neuron

### Start Neuron in development mode

```sh
$ yarn start
```

This command will start two tasks

1. start `neuron-ui`, which works for the user interface.
2. start `neuron-wallet`, works for the wallet functionality.

They are also able to start independently:

```sh
# start neuron-ui at `http://localhost:3000`
$ cd packages/neuron-ui && yarn start
```

```sh
# start neuron-wallet
$ cd packages/neuron-wallet && yarn start:dev
```

### Test

```sh
# launch the test runner in the watch mode.
$ yarn test
```

## License

Neuron is released under the terms of the MIT license. See [COPYING](COPYING) for more information or see [https://opensource.org/licenses/MIT](https://opensource.org/licenses/MIT).
Loading

0 comments on commit 79bd500

Please sign in to comment.